From cc8d4be07f46f3ecc2617a289f0faa69355cf07f Mon Sep 17 00:00:00 2001 From: chenhao Date: Thu, 28 May 2026 13:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=20=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/img/nocart.png | Bin 0 -> 827 bytes src/App.vue | 71 +++++++++++++++++++------------ src/router.js | 2 +- src/styles/public.less | 8 +++- src/views/Goods/GoodsDetail.vue | 28 ++++++++---- src/views/Trade/TradeConfirm.vue | 8 ++-- src/views/Trade/TradeDetail.vue | 2 +- src/views/Trade/Tradelist.vue | 10 +++-- 8 files changed, 83 insertions(+), 46 deletions(-) create mode 100644 public/img/nocart.png diff --git a/public/img/nocart.png b/public/img/nocart.png new file mode 100644 index 0000000000000000000000000000000000000000..611a5b5c0803aeb7db7d1ac253a655d0672c14c6 GIT binary patch literal 827 zcmV-B1H}A^P)c7eXQ; z=niQw5(8xt`IJaLRoF#H$Sf#(Yl>c`hl(I0izrwifnCukq{$={M$1X3hyOl#I-N8B zGY>8Jb2j_Ge*3%DI(zT+Z&g)wHLk?w%$)W=*)Ue%8H_~4(K6R$$MF?j%*+FWfLc{m zEyW%z#18|4=Ho1Uhf6Z^Xp>+V_h24Az)e`4nXfkqBVrU=u@Y}L`48dj0=yL;;gyJ3 z*(AiL<#*`-zJ}U^%shtM)wO>sBCZ%@fkCZRRn-evo0%<$h{f22({W8^?&&3rhzg0{ zakxy+!=LyZTQakq^~sFdmYEZ{MZL4$kBD;`f<26VKMLVf3;j%_h5p2aKtj1FVNIHW#NT1En z2euI}V|_%dYjB^_Js!B`#YS-^o>O1M{cL+gY$)UNnMFpBna9K3yXlM%5kBIb5F{zH$5^;m+3 za139lci6Uw2z=88Xas4uv$(#%cb3+HuFa5{d$9_Oa49arOL(Ifq-aj4+sRMZh^tDl z*L8k-{41l5C>N@~_kPLD{rwYU9unXFvd$0^*8Kn?&AbO!^Qvr002ovPDHLk FV1kIzfb#$V literal 0 HcmV?d00001 diff --git a/src/App.vue b/src/App.vue index 554e8d3..7acf551 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@ @@ -15,17 +15,32 @@ export default { return routes.filter(r => r.meta.cache).map(r => r.name) } }, + data() { + return { + wechatShareInfo: {} + } + }, watch: { $route(to, from) { const title = to.meta.title || '' this.updateTitle(title) + this.updateShare(undefined, undefined, undefined) } }, + mounted() { + this.init() + }, methods: { + init() { + this.$post('/v1/client/HWxinfoClient/share', { url: location.href }).then(data => { + this.wechatShareInfo = data + }).finally(() => { + this.updateShare() + }) + }, updateTitle(title) { document.title = title if (this.$isWechat()) { - // 微信安卓需要用 iframe 触发标题更新 const iframe = document.createElement('iframe') iframe.style.display = 'none' iframe.src = 'https://www.baidu.com/favicon.ico?' + Date.now() @@ -39,32 +54,34 @@ export default { }, updateShare(title, desc, imgUrl) { if (wx && this.$isWechat()) { - // this.$CommonAPI.Post('GetJSSDKConfig', location.href).then(data => { - let shareinfo = { - title: title || '泰古润' || this.wechatShareInfo.ShareTitle, - desc: desc || '汇聚平凡梦想,共创美好未来' || this.wechatShareInfo.ShareContent, - imgUrl: this.$file(imgUrl || this.wechatShareInfo.ShareLogo), - link: this.$getShareLink(), - }; - if (this.$isWechatMini()) - wx.miniProgram.postMessage({ data: { share: shareinfo } }); - data.jsApiList.push('wx-open-launch-weapp'); - data.openTagList = ['wx-open-launch-weapp']; - wx.config(data); - wx.ready(() => { - wx.updateAppMessageShareData(shareinfo); - wx.updateTimelineShareData(shareinfo); - if (location.hash == '#/Weapp') { - document.addEventListener('WeixinOpenTagsError', function (e) { - alert(e.detail.errMsg); // 无法使用开放标签的错误原因,需回退兼容。仅无法使用开放标签,JS-SDK其他功能不受影响 - }); - } + this.$post('/v1/client/HWxinfoClient/share', { url: location.href }).then(data => { + let shareinfo = { + title: title || this.wechatShareInfo.ShareTitle || '泰古润', + desc: desc || this.wechatShareInfo.ShareContent || '汇聚平凡梦想,共创美好未来', + imgUrl: this.$file(imgUrl || this.wechatShareInfo.ShareLogo || '/img/logo.png'), + link: this.$getShareLink(), + }; + if (this.$isWechatMini()) + wx.miniProgram.postMessage({ data: { share: shareinfo } }); + data.jsApiList.push('wx-open-launch-weapp'); + data.openTagList = ['wx-open-launch-weapp']; + wx.config({ + debug: false, + appId: data.appid, + timestamp: data.timestamp, + nonceStr: data.noncestr, + signature: data.signature, + jsApiList: data.jsApiList, + openTagList: data.openTagList + }); + wx.ready(() => { + wx.updateAppMessageShareData(shareinfo); + wx.updateTimelineShareData(shareinfo); + }); + wx.error((e) => { + console.error('wx.error', e); + }); }); - wx.error((e) => { - if (location.hash == '#/Weapp') - alert(JSON.stringify(e)); - }); - // }); } }, } diff --git a/src/router.js b/src/router.js index 1616b40..1a445bc 100644 --- a/src/router.js +++ b/src/router.js @@ -178,7 +178,7 @@ const routes = [ path: '/TradeList', name: 'TradeList', component: () => import('./views/Trade/TradeList.vue'), - meta: { title: '订单列表' } + meta: { title: '订单列表', cache: true } }, { path: '/Pay', diff --git a/src/styles/public.less b/src/styles/public.less index 8ecf433..545f048 100644 --- a/src/styles/public.less +++ b/src/styles/public.less @@ -780,7 +780,7 @@ img { .van-tab { height: 10.13vw; background-color: #ededed; - font-size: 4vw; + font-size: 3.67vw; } .van-tab--active { @@ -2239,6 +2239,12 @@ img { color: #303030; white-space: nowrap; + .overhide { + width: 70vw; + overflow: hidden; + .text-hide(1); + } + img { width: 3.73vw; height: 2.93vw; diff --git a/src/views/Goods/GoodsDetail.vue b/src/views/Goods/GoodsDetail.vue index a9e8b14..147675f 100644 --- a/src/views/Goods/GoodsDetail.vue +++ b/src/views/Goods/GoodsDetail.vue @@ -1,5 +1,5 @@