From 606c3dd7a20e21470df2182202687cdb78588486 Mon Sep 17 00:00:00 2001 From: chenhao Date: Thu, 28 May 2026 16:47:19 +0800 Subject: [PATCH] 1 --- src/App.vue | 4 ++-- src/components/BaseList.vue | 35 +------------------------------- src/components/BasePage.vue | 1 + src/router.js | 2 +- src/styles/public.less | 4 ++++ src/views/Goods/GoodsDetail.vue | 11 +++++----- src/views/Index.vue | 1 + src/views/Tabbars/Gift.vue | 2 +- src/views/Tabbars/Mall.vue | 22 ++------------------ src/views/Trade/TradeConfirm.vue | 6 ++++-- src/views/Trade/Tradelist.vue | 2 +- 11 files changed, 23 insertions(+), 67 deletions(-) diff --git a/src/App.vue b/src/App.vue index 7acf551..c236804 100644 --- a/src/App.vue +++ b/src/App.vue @@ -32,7 +32,7 @@ export default { }, methods: { init() { - this.$post('/v1/client/HWxinfoClient/share', { url: location.href }).then(data => { + this.$post('/v1/client/HWxinfoClient/share', { url: encodeURIComponent(location.href) }).then(data => { this.wechatShareInfo = data }).finally(() => { this.updateShare() @@ -54,7 +54,7 @@ export default { }, updateShare(title, desc, imgUrl) { if (wx && this.$isWechat()) { - this.$post('/v1/client/HWxinfoClient/share', { url: location.href }).then(data => { + this.$post('/v1/client/HWxinfoClient/share', { url: encodeURIComponent(location.href) }).then(data => { let shareinfo = { title: title || this.wechatShareInfo.ShareTitle || '泰古润', desc: desc || this.wechatShareInfo.ShareContent || '汇聚平凡梦想,共创美好未来', diff --git a/src/components/BaseList.vue b/src/components/BaseList.vue index 8b6bf71..859cbfb 100644 --- a/src/components/BaseList.vue +++ b/src/components/BaseList.vue @@ -25,7 +25,6 @@ export default { pageSize: { type: Number, default: 10 }, finishedText: { type: String, default: '没有更多了' }, parseData: { type: Function, default: (res) => res.data.items }, - cacheKey: { type: String, default: '' }, }, data() { return { @@ -35,8 +34,6 @@ export default { page: 1, requestId: 0, observer: null, - _cacheKey: null, - _dataCache: null, } }, emits: ['update:list', 'load', 'refresh'], @@ -53,19 +50,6 @@ export default { deep: true } }, - created() { - if (this.cacheKey) { - const cached = sessionStorage.getItem(this.cacheKey) - if (cached) { - try { - const { list, page, finished, params } = JSON.parse(cached) - if (JSON.stringify(this.params) === JSON.stringify(params)) { - this._dataCache = { list, page, finished } - } - } catch (e) { } - } - } - }, mounted() { this.$nextTick(() => { this.observer = new IntersectionObserver((entries) => { @@ -77,27 +61,10 @@ export default { this.observer.observe(this.$refs.sentinel) } }) - window.addEventListener('scroll', this.onWindowScroll) }, methods: { - onWindowScroll() { - if (this.finished || this.loading) return - const el = this.$refs.sentinel - if (!el) return - const rect = el.getBoundingClientRect() - if (rect.top < window.innerHeight) { - this.loadMore() - } - }, loadMore() { if (this.loading) return - if (this._dataCache && this._dataCache.params && JSON.stringify(this.params) === JSON.stringify(this._dataCache.params)) { - this.list = this._dataCache.list - this.page = this._dataCache.page - this.finished = this._dataCache.finished - this.loading = false - return - } const currentRequestId = this.requestId this.loading = true const request = this.method === 'get' ? this.$get : this.$post @@ -105,7 +72,6 @@ export default { .then(res => { if (currentRequestId !== this.requestId) return const data = this.parseData(res) - // console.log(data); const safeData = data || [] if (this.page === 1) { @@ -169,6 +135,7 @@ export default { .finished-text, .empty-text { + width: 100%; text-align: center; padding: 15px; color: #969799; diff --git a/src/components/BasePage.vue b/src/components/BasePage.vue index 25722f3..f799243 100644 --- a/src/components/BasePage.vue +++ b/src/components/BasePage.vue @@ -16,6 +16,7 @@ export default { props: [ 'back', 'hideHome', 'title' ], + emits: ['updateShare'], watch: { title(val, old) { if (val) diff --git a/src/router.js b/src/router.js index 1a445bc..a8b3826 100644 --- a/src/router.js +++ b/src/router.js @@ -24,7 +24,7 @@ const routes = [ path: '/Mall', name: 'Mall', component: () => import('./views/Tabbars/Mall.vue'), - meta: { title: '商城', cache: true } + meta: { title: '商城' } }, { path: '/PointMall', diff --git a/src/styles/public.less b/src/styles/public.less index 545f048..9720b31 100644 --- a/src/styles/public.less +++ b/src/styles/public.less @@ -769,6 +769,10 @@ img { .tradelist { .f5; + >div { + .b_l_w; + } + &::before { background: #f6f6f6; } diff --git a/src/views/Goods/GoodsDetail.vue b/src/views/Goods/GoodsDetail.vue index 147675f..ed6faad 100644 --- a/src/views/Goods/GoodsDetail.vue +++ b/src/views/Goods/GoodsDetail.vue @@ -174,11 +174,11 @@ -
+
+ style="height: 55vw;top:12vw;z-index: 2;position: absolute;overflow-y: scroll;font-size: 3.73vw;color: #333333;padding: 0 4vw 3.33vw;border-bottom: 1px solid #f5f5f5;"> 不支持发货区域: @@ -188,7 +188,7 @@
@@ -237,10 +237,9 @@ export default { formattedForbidArea() { if (!this.data.forbidbuyarea) return '暂无' try { - // 去掉转义的反斜杠 const str = this.data.forbidbuyarea.replace(/\\"/g, '"') const arr = JSON.parse(str) - return arr.map(s => s.split('-')[1] || s).join('、') + return arr.join('、') } catch { return this.data.forbidbuyarea.replace(/\\"/g, '"') } @@ -341,7 +340,7 @@ export default { this.$showFailToast("该规格库存不足,无法购买"); return; } - this.$navigate(`/TradeConfirm?id=${this.data.id}&skuname=${encodeURIComponent(this.tempSku.skuname)}&buynums=${this.tempSku.Qty}`); + this.$navigate(`/TradeConfirm/?id=${this.data.id}&skuname=${encodeURIComponent(this.tempSku.skuname)}&buynums=${this.tempSku.Qty}`); }, beforeShare() { this.showShare = true; diff --git a/src/views/Index.vue b/src/views/Index.vue index 079e101..47aea01 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -15,6 +15,7 @@