From c83aa0b4c47d3e806a4aa26030ad099560300d94 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Fri, 9 Aug 2024 14:01:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 5 ++++- framework/11-api.js | 23 +++++++++++------------ pages/order_food/confirm_order.vue | 13 ++++++++----- pages/order_food/order_food.vue | 18 +----------------- store/index.js | 5 +++++ 5 files changed, 29 insertions(+), 35 deletions(-) diff --git a/App.vue b/App.vue index 262edcc..93723c0 100644 --- a/App.vue +++ b/App.vue @@ -53,7 +53,10 @@ }, methods: { userlogin() { + console.log(333) if (!uni.cache.get('token')) { + // this.$store.dispatch("loginEvent"); //获取shapid + uni.login({ provider: 'weixin', success: (data) => { @@ -76,7 +79,7 @@ fail: (err) => {} }); }, - }) + }) } } } diff --git a/framework/11-api.js b/framework/11-api.js index e3ffbba..2a97e5b 100644 --- a/framework/11-api.js +++ b/framework/11-api.js @@ -104,18 +104,17 @@ async function request(options) { if (res.code != 0) { console.log(options) if (res.code == -4) { - uni.showToast({ - title: res.message || res.msg, - icon: "none", - success: () => { - // setTimeout(res => { - // store.dispatch("loginEvent"); //获取shapid - // }, 1000) - } - }) - // setTimeout(res => { - // store.dispatch("loginEvent"); //获取shapid - // }, 1000) + // uni.showToast({ + // title: res.message || res.msg, + // icon: "none", + // success: () => { + // // setTimeout(res => { + // // store.dispatch("loginEvent"); //获取shapid + // // }, 1000) + // } + // }) + uni.$u.debounce(store.dispatch("loginEvent"), 1000); //获取shapid + } else if (res.code == 482) { let nowTime = new Date() / 1000 | 0 let offset = parseInt(res.data.message) - parseInt(nowTime); diff --git a/pages/order_food/confirm_order.vue b/pages/order_food/confirm_order.vue index 1474243..30fffb6 100644 --- a/pages/order_food/confirm_order.vue +++ b/pages/order_food/confirm_order.vue @@ -10,7 +10,7 @@ - + 温馨提示:请适量点餐,避免浪费 @@ -93,7 +93,7 @@ - + {{ item.name }} @@ -210,8 +210,8 @@ this.listinfo.name = JSON.parse(e.storeInfo).shopName; }, onShow() { - uni.$on('message', this.getMessage) if (this.listinfoid) { + uni.$on('message', this.getMessage) this.orderorderInfo() } else { this.handlemessage() @@ -310,6 +310,7 @@ userId: uni.cache.get('userInfo').id, "type": "connect", }) + uni.$on('message', this.getMessage) }, /** @@ -590,7 +591,8 @@ display: flex; align-items: center; .informIcon{ - width: 26.7rpx; + width: 26.79rpx; + height: 24.06rpx; margin-right: 8rpx; } .informText{ @@ -923,7 +925,8 @@ .method_list_top_left{ display: flex; .icon{ - width: 54rpx!important; + width: 54.67rpx!important; + height: 48rpx!important; margin-right: 22rpx; } .name{ diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index 614616f..c75aac7 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -382,7 +382,6 @@ return `left-${this.leftIndex? this.leftIndex:0}`; }, HeighT() { //手机类型的尺寸 导航栏高度 - console.log(this.$store.getters.is_BarHeight) return this.$store.getters.is_BarHeight.heightBar + this.$store.getters.is_BarHeight.customBar }, scrollHeight() { @@ -510,9 +509,6 @@ * 图片加载 */ imageLoaded(item, index, index1) { - console.log(index) - console.log(index1) - console.log(this.shopProductList.productInfo[index]) this.shopProductList.productInfo[index].products[index1]['imgLoad'] = true; // e.currentTarget.src }, @@ -552,7 +548,6 @@ } else { if (this.amountcartNumber > 0) { - console.log(item) if (this.skuNumber < this.skuSuit && this.amountcartNumber <= this.skuSuit) { this.amountcartNumber = this.amountcartNumber - (this.skuSuit == 0 ? 1 : this.skuSuit); } else { @@ -727,11 +722,8 @@ isSkuidname = JSON.parse(JSON.stringify(this.skuidname)); isSkuidname.push(this.specifications.tagSnap[0].children[o].name) //筛选符合条件的规格列表 - console.log(isSkuidname); filteredJson = this.querySpecList.filter(obj => obj.specSnap.indexOf(isSkuidname) == 0); - console.log(filteredJson); for (let i = 0; i < filteredJson.length; i++) { - console.log(filteredJson[i].isGrounding) if (filteredJson[i].isGrounding) { this.specifications.tagSnap[0].children[o].isGrounding = true break; // 终止循环 @@ -746,7 +738,6 @@ // console.log(val) // this.skuidname.push(val.children[0].info) // }) - console.log(this.specifications.tagSnap) this.hodgepodge(this.specifications.tagSnap[0], 2) //获取skuid /2查找价格和数量 } @@ -806,11 +797,8 @@ isSkuidname = JSON.parse(JSON.stringify(this.skuidname)); isSkuidname.push(this.specifications.tagSnap[index + 1].children[o].name) //筛选符合条件的规格列表 - console.log(isSkuidname); filteredJson = this.querySpecList.filter(obj => obj.specSnap.indexOf(isSkuidname) == 0); - console.log(filteredJson); for (let i = 0; i < filteredJson.length; i++) { - console.log(filteredJson[i].isGrounding) if (filteredJson[i].isGrounding) { this.specifications.tagSnap[index + 1].children[o].isGrounding = true break; // 终止循环 @@ -824,7 +812,6 @@ // res.data.forEach((v,e)=>{ // // this.$set(this.specifications.tagSnap[e], 'children', v.value) // }) - console.log(this.specifications.tagSnap) this.$forceUpdate(); this.hodgepodge(item, 2) @@ -839,7 +826,7 @@ */ async hodgepodge(item, a, c, num) { //此接口去获取商品id !!!赋值库存 数量 价格等 try { - console.log(this.skuidname.join(",")) + // console.log(this.skuidname.join(",")) let res = await this.api.productqueryProductSku({ code: uni.cache.get('tableCode'), shopId: uni.cache.get('shopUser'), @@ -1035,14 +1022,11 @@ break; } } - console.log(index) /* 查找当前滚动距离 */ if (index >= this.lastbottom) { // - console.log(index, this.leftIndex) this.leftIndex = index > this.leftIndex ? index : this.leftIndex // this.leftIndex = this.leftIndex } else { - console.log(22918) this.leftIndex = (index < 0 ? 0 : index); } } diff --git a/store/index.js b/store/index.js index 8277552..6a9111b 100644 --- a/store/index.js +++ b/store/index.js @@ -78,6 +78,11 @@ const store = new Vuex.Store({ uni.cache.set('miniAppOpenId', res.data.userInfo .miniAppOpenId) uni.cache.set('userInfo', res.data.userInfo); + let pages = getCurrentPages() + let curPage = pages[pages.length -1 ] + curPage.onLoad(curPage.options) + curPage.onShow() + curPage.onReady() this.$isResolve() } }, From fddaea0e7b87924bcf76dd369c19d8c68648019f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Fri, 9 Aug 2024 15:28:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=20=20=E5=8A=A0=E4=BA=86=E8=8A=82=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 -- framework/11-api.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/App.vue b/App.vue index 93723c0..fee1d6b 100644 --- a/App.vue +++ b/App.vue @@ -53,10 +53,8 @@ }, methods: { userlogin() { - console.log(333) if (!uni.cache.get('token')) { // this.$store.dispatch("loginEvent"); //获取shapid - uni.login({ provider: 'weixin', success: (data) => { diff --git a/framework/11-api.js b/framework/11-api.js index 2a97e5b..00cdb1f 100644 --- a/framework/11-api.js +++ b/framework/11-api.js @@ -113,7 +113,7 @@ async function request(options) { // // }, 1000) // } // }) - uni.$u.debounce(store.dispatch("loginEvent"), 1000); //获取shapid + uni.$u.throttle(store.dispatch("loginEvent"), 1000); //获取shapid } else if (res.code == 482) { let nowTime = new Date() / 1000 | 0 From 728774fa6650877bde6ae396e618e631ff34add6 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Fri, 9 Aug 2024 15:42:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order_food/order_food.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index c75aac7..aca1fed 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -692,6 +692,7 @@ this.isSpec = true; // 但但单个规格弹框的处理 this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量 + this.skuBtnText = `添加到购物车` } else { // 多规格数据处理 this.isSpec = false;