优化接口

This commit is contained in:
duan
2024-06-04 15:45:49 +08:00
parent a54580549a
commit bdd5a6a325
4 changed files with 29 additions and 11 deletions

View File

@@ -56,7 +56,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxc2bb94c0ddda1032", "appid" : "wxd88fffa983758a30",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : true, "minified" : true,

View File

@@ -155,12 +155,12 @@
uni.getStorage({ uni.getStorage({
key: 'itemData', key: 'itemData',
success: function(res) { success: function(res) {
console.log(res.data,'数据');
_this.type = res.data.value _this.type = res.data.value
_this.distiricttopCommon() _this.distiricttopCommon()
setTimeout(() => { // setTimeout(() => {
_this.GetTop() _this.GetTop()
}, 1000) // _this.init_fn()
// }, 1000)
} }
}); });
// this.type = e.value // this.type = e.value
@@ -170,7 +170,19 @@
// }, 1000) // }, 1000)
}, },
onShow() { onShow() {
this.init_fn() let _this = this
uni.getStorage({
key: 'itemData',
success: function(res) {
_this.type = res.data.value
_this.distiricttopCommon()
// setTimeout(() => {
// _this.GetTop()
_this.init_fn()
// }, 1000)
}
});
// this.init_fn()
}, },
computed: { computed: {
HeighT() { //手机类型的尺寸 HeighT() { //手机类型的尺寸

View File

@@ -40,8 +40,13 @@
size: 10, //页容量 size: 10, //页容量
status: 'loadmore', status: 'loadmore',
}, },
userId:null
} }
}, },
onLoad() {
this.userId = uni.cache.get('userInfo').id
// this.paygetShopByMember()
},
onShow() { onShow() {
this.paygetShopByMember() this.paygetShopByMember()
}, },

View File

@@ -388,15 +388,16 @@
case 'addcart': case 'addcart':
this.cartLists = msg this.cartLists = msg
if (msg.data.length != 0) { if (msg.data.length != 0) {
let nums = 0
msg.data.forEach((item, index, arr) => { //初始化skuidname的数据 选择第一个 msg.data.forEach((item, index, arr) => { //初始化skuidname的数据 选择第一个
console.log(this.skuidsearch,'调试1')
console.log(item.skuId,'调试2')
if (item.skuId == this.skuidsearch) { if (item.skuId == this.skuidsearch) {
this.$set(this, 'amountcartNumber', item.number) nums = item.number
} else { }
this.$set(this, 'amountcartNumber', 0) // else {
} // this.$set(this, 'amountcartNumber', 0)
// }
}) })
this.$set(this, 'amountcartNumber', nums)
} else { } else {
this.$set(this, 'amountcartNumber', 0) this.$set(this, 'amountcartNumber', 0)
} }