gcz 2 năm trước cách đây
mục cha
commit
42f6dcfc7b
3 tập tin đã thay đổi với 26 bổ sung12 xóa
  1. 9 2
      center/paycode.vue
  2. 1 1
      common/apiurl.js
  3. 16 9
      xushuo/xushuoproduct.vue

+ 9 - 2
center/paycode.vue

@@ -38,7 +38,8 @@
 				qrContent: {}, // 要生成的二维码值
 				params:{
 					
-				}
+				},
+				timer: null,
 				
 			}
 		},
@@ -50,7 +51,13 @@
 			this.qrContent = JSON.stringify(this.qrContent);
 			let that = this;
 			that.showQrcode();//一加载生成二维码
-			setInterval(this.refreshCode, 30000);
+			this.timer = setInterval(() => {
+			  this.refreshCode()
+			}, 30000);
+		},
+		onUnload() {
+		    // 页面离开时停止计时器
+		    clearInterval(this.timer)
 		},
 		methods: {
 			// 展示二维码

+ 1 - 1
common/apiurl.js

@@ -79,7 +79,7 @@ const apiurl = {
 	},
 	// 商行产品类型
 	shopGoodsType: {
-		url: '/shopGoodsType/list',
+		url: '/dict/data/type/area_name',
 		type: 'get'
 	},
 	// 商行产品列表

+ 16 - 9
xushuo/xushuoproduct.vue

@@ -70,7 +70,10 @@
 				//如果希望先请求其他接口,再触发upCallback,可参考以下写法
 				if(!this.hasTypeId){
 					this.$u.api.shopGoodsType().then(res=>{
-						this.tabsList = res.data.rows;
+						// this.tabsList = res.data;
+						this.tabsList = res.data.map(item=>{
+							return {name:item.dictLabel,id:item.dictValue}
+						});
 						this.hasTypeId = true
 						this.mescroll.resetUpScroll() // 重新触发upCallback
 					}).catch(()=>{
@@ -120,14 +123,18 @@
 			reloadList() {
 				this.mescroll.resetUpScroll();
 			},
-			shopGoodsType(){
-				this.$u.api.shopGoodsType().then(res=>{
-					this.tabsList = res.data.rows;
-					// console.log('shopGoodsType',res);
-				}).catch(err=>{
-					// console.log('err11111',err);
-				})
-			},
+			// shopGoodsType(){
+			// 	this.$u.api.shopGoodsType().then(res=>{
+			// 		console.log('shopGoodsType',res.data);
+			// 		this.tabsList = res.data.map(item=>{
+			// 			return {name:item.dictLabel,id:item.dictValue}
+			// 		});
+			// 		console.log('shopGoodsType',res.data);
+			// 		console.log('tabsList',this.tabsList);
+			// 	}).catch(err=>{
+			// 		// console.log('err11111',err);
+			// 	})
+			// },
 			tabsClick(item){
 				this.activeIndex = item.index;
 				this.reloadList()