Просмотр исходного кода

零售 解决培训班添加的一些问题

wangning 5 лет назад
Родитель
Сommit
6ba14ed0f1

+ 2 - 1
hdApp/src/pages.json

@@ -847,7 +847,8 @@
         {
           "path": "trainingClass",
           "style": {
-            "navigationBarTitleText": "培训班"
+            "navigationBarTitleText": "培训班",
+            "enablePullDownRefresh": true
           }
         },
         {

+ 18 - 4
hdApp/src/pagesStatistics/trainingClass.vue

@@ -4,6 +4,7 @@
       scroll-y
       class="shop-list"
     >
+    <block v-if="!$util.isEmpty(shopList)">
       <view
         class="shop-item"
         v-for="(item, index) in shopList"
@@ -31,6 +32,13 @@
           > </text>
         </view>
       </view>
+      </block>
+      <block v-else>
+        <AppWrapperEmpty
+            title="暂无数据"
+            :is-empty="$util.isEmpty(shopList)"
+          />
+      </block>
     </scroll-view>
     <view class="under-bar">
       <button
@@ -44,19 +52,25 @@
 </template>
 <script>
 import { getPxClassDataApi, pxClassDel } from "@/api/product/index";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
 export default {
-  components: {},
+  components: { AppWrapperEmpty },
   data () {
     return {
       shopList: []
     };
   },
-  mounted () {
-    this.getData()
+  onPullDownRefresh() {
+    this.getData().then(res => {
+      uni.stopPullDownRefresh();
+    })
   },
   methods: {
+    init() {
+      this.getData()
+    },
     getData () {
-      getPxClassDataApi().then(res => {
+      return getPxClassDataApi().then(res => {
         console.log(res)
         this.shopList = res.data.list
       }).catch(err => { console.log(err) })

+ 1 - 1
hdApp/src/pagesStatistics/trainingClassEdit.vue

@@ -34,7 +34,7 @@
             name="tuition"
             placeholder="请输入价格"
             maxlength="50"
-            type="text"
+            type="digit"
           />
         </tui-list-cell>
         <tui-list-cell