From cab79f73463bb6b4eb62a60bd1b4d3283c98f2e1 Mon Sep 17 00:00:00 2001 From: wangdong <1551135706@qq.com> Date: Wed, 18 Sep 2024 17:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 6 ++++-- pages/goods/list.vue | 30 +++++++++++++++++++++--------- pages/wallet/recharge/index.vue | 6 ++++-- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/App.vue b/App.vue index ba0825c..b2a40c3 100644 --- a/App.vue +++ b/App.vue @@ -17,9 +17,11 @@ onLaunch({ path, query, scene }) { console.log(this.$route); // #ifdef H5 - const storeId = this.getQueryString('storeId'); + const storeId = this.$route.query.storeId || this.getQueryString('storeId') || ''; console.log(storeId); - uni.setStorageSync('storeId', storeId || ''); + if (storeId) { + uni.setStorageSync('storeId', storeId || ''); + } // #endif // #ifdef MP // 小程序主动更新 diff --git a/pages/goods/list.vue b/pages/goods/list.vue index ae83394..84212c3 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -3,7 +3,7 @@ - + @@ -467,14 +467,26 @@ return new Promise((resolve, reject) => { GoodsApi.list(param) .then(result => { - selectorQuery.selectAll('.head').boundingClientRect((rects) => { - app.blheight = rects[0].height - }).exec(); - const newList = result.data.list - let arr = getMoreListData(newList, app.list, pageNo); - // app.list.data = app.arrayUnique(arr, 'goods_id') - app.list.data = arr; - app.total = result.data.list.total; + console.log(result); + try{ + // #ifdef H5 + console.log(this.$refs.head.$el.offsetHeight); + app.blheight = this.$refs.head.$el.offsetHeight; + // #endif + // #ifndef H5 + selectorQuery.selectAll('.head').boundingClientRect((rects) => { + app.blheight = rects[0].height + }).exec(); + // #endif + const newList = result.data.list + let arr = getMoreListData(newList, app.list, pageNo); + // app.list.data = app.arrayUnique(arr, 'goods_id') + app.list.data = arr; + app.total = result.data.list.total; + }catch(e){ + console.log(e); + //TODO handle the exception + } resolve(newList) }) .catch(reject) diff --git a/pages/wallet/recharge/index.vue b/pages/wallet/recharge/index.vue index cf84866..b8d1ef3 100644 --- a/pages/wallet/recharge/index.vue +++ b/pages/wallet/recharge/index.vue @@ -373,18 +373,20 @@ import * as UploadApi from '@/api/upload' app.$toast('请上传支付凭证'); return } - params = { ...params, ...app.voucherForm}; + params = { ...params, extra: {...app.voucherForm}}; console.log(params); app.disabled = true // #endif RechargeApi.submit(params) .then(result => { - console.log(result); if (app.curPaymentItem.method === 'huifu') { const { miniPayRequest, out_trade_no } = result.data.payment; app.miniPayRequest = miniPayRequest; app.miniPayRequest.out_trade_no = out_trade_no; } else { + // #ifdef H5 + this.onShowSuccess(result) + // #endif app.onSubmitCallback(result) } })