xiebaomin 1 年之前
父节点
当前提交
90b4c9d987
共有 1 个文件被更改,包括 15 次插入4 次删除
  1. 15 4
      pages/goods/procurement.vue

+ 15 - 4
pages/goods/procurement.vue

@@ -53,7 +53,7 @@
             <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
             <!--加载loadding-->
         </view>
-        <proEmpty v-if="procurementList.length === 0" />
+        <proEmpty v-if="isEmpty" />
     </view>
 </template>
 
@@ -126,7 +126,8 @@ export default {
             nomoreText: '已经没有了~',
             isLastPage: false, // 是否是最后一页
             joinData: {}, // 我要参与
-            procurement: {}
+            procurement: {},
+            isEmpty: false, // 判断是否为空
         }
     },
     computed: {
@@ -135,15 +136,16 @@ export default {
     },
     onShow() {
         if (this.hasLogin) {
-         	  this.userInfo = uni.getStorageSync('userInfo')
+         	this.userInfo = uni.getStorageSync('userInfo')
             this.pageInfo.userId = this.userInfo.userId
-          	 this.participate.userId = this.userInfo.userId
+          	this.participate.userId = this.userInfo.userId
             this.procurementAllList()
         } else {
             this.$api.redirectTo('/pages/login/login')
         }
     },
     onLoad() {
+        // 刷新数据
         uni.$on('refreshAddData', () => {
             this.procurementAllAddList()
         })
@@ -157,6 +159,7 @@ export default {
         }
     },
     onPullDownRefresh() {
+        this.isEmpty = false
         this.isLastPage = false
         this.procurementList = []
         this.procurementAllList()
@@ -165,6 +168,11 @@ export default {
     methods: {
         // tab 切换
         handlerTabs($event) {
+            uni.showToast({
+                icon:'loading',
+                duration:1000
+            })
+            this.isEmpty = false
             this.isLastPage = false
             this.procurementList = []
             this.currentTab = $event.index
@@ -248,6 +256,9 @@ export default {
                     this.loadding = !this.isLastPage
                     this.pullUpOn = !this.isLastPage
                     this.skeletonShow = false
+                    if (this.procurementList.length === 0) {
+                        this.isEmpty = true
+                    }
                 } catch (error) {
                     console.log(error)
                 }