lilei 9 月之前
父节点
当前提交
d7ba58c4c4
共有 2 个文件被更改,包括 10 次插入13 次删除
  1. 5 7
      pagesB/shopiing/searchProduct.vue
  2. 5 6
      pagesB/shopiing/shopProduct.vue

+ 5 - 7
pagesB/shopiing/searchProduct.vue

@@ -38,7 +38,7 @@
 			>
 			</chooseProductItem>
 			<!-- loading -->
-			<view class="loading-bar" v-if="total>0 && (loading||loadEnd)">{{loadText}}</view>
+			<view class="loading-bar" v-if="loading||loadEnd">{{loadText}}</view>
 			<!-- <view class="empty-bar" v-if="total==0&&!loading">
 				<image mode="aspectFit" :src="empty.imgUrl"></image>
 				<view>{{empty.tip}}</view>
@@ -215,15 +215,12 @@
 					dealerSn: dealerSn,
 					status: 1
 				}).then(res => {
-					this.loading = false
 					if(res.status == 200){
 						this.total = Number(res.data.count)
 						if(this.total){
 							const list = res.data.list || []
-							const ret = []
-							// 更新已选状态
-							list.forEach(k => {
-							  ret.push({
+							const ret = list.map(k => {
+								return {
 								  id: k.id,
 								  price: k.price,
 								  productCode: k.productCode,
@@ -239,7 +236,7 @@
 								  status: k.status,
 								  statusDictValue: k.statusDictValue,
 								  dealerScopeFlag: k.dealerScopeFlag
-							  })
+							  }
 							})
 							// 追加数据
 							this.list.push(ret)
@@ -257,6 +254,7 @@
 						this.loadEnd = false
 						this.loadText = res.message
 					}
+					this.loading = false
 				}).catch(err => {
 					this.loading = false
 				})

+ 5 - 6
pagesB/shopiing/shopProduct.vue

@@ -106,7 +106,7 @@
 				clzId: null, // 一级分类
 				categorySn: null ,// 当前分类sn
 				categoryList: [], // 二级分类列表
-				enableRefresh: true,
+				enableRefresh: false,
 				triggered: false,
 				pulling: false
 			};
@@ -240,15 +240,13 @@
 					dealerSn: dealerSn,
 					status: 1
 				}).then(res => {
-					this.loading = false
 					if(res.status == 200){
 						this.total = Number(res.data.count)
 						if(this.total){
 							const list = res.data.list || []
-							const ret = []
 							// 更新已选状态
-							list.forEach(k => {
-							  ret.push({
+							const ret = list.map(k => {
+								return {
 								  id: k.id,
 								  price: k.price,
 								  productCode: k.productCode,
@@ -264,7 +262,7 @@
 								  status: k.status,
 								  statusDictValue: k.statusDictValue,
 								  dealerScopeFlag: k.dealerScopeFlag
-							  })
+							  }
 							})
 							// 追加数据
 							this.list.push(ret)
@@ -282,6 +280,7 @@
 						this.loadEnd = false
 						this.loadText = res.message
 					}
+					this.loading = false
 				}).catch(err => {
 					this.loading = false
 				})