From 604f9aff08e5d98c4b47779a1cc20e2c6a545a11 Mon Sep 17 00:00:00 2001 From: chenhao Date: Wed, 3 Jun 2026 17:02:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=20=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 8 +- src/views/Merchant/MerchantIntroduction.vue | 22 ++++- src/views/Tabbars/Mall.vue | 32 ++++-- src/views/Tabbars/Social.vue | 38 +++++++- src/views/User/Checkout/Checkout.vue | 103 +++++++++++--------- src/views/User/ShopInfo.vue | 63 +++++++++++- 6 files changed, 192 insertions(+), 74 deletions(-) diff --git a/src/App.vue b/src/App.vue index b7d32a8..5fad15f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -49,9 +49,9 @@ export default { }, mounted() { this.init() - this.$geo.getWebGeo().then(pos => { - this.geo = pos - }) + // this.$geo.getWebGeo().then(pos => { + // this.geo = pos + // }) }, methods: { updateTitle(title) { @@ -96,7 +96,7 @@ export default { link: this.$getShareLink(), }; // alert(JSON.stringify(shareinfo)) - const jsApiList = data.jsApiList || ['onMenuShareTimeline', 'onMenuShareAppMessage', 'updateAppMessageShareData', 'updateTimelineShareData']; + const jsApiList = data.jsApiList || ['onMenuShareTimeline', 'onMenuShareAppMessage', 'updateAppMessageShareData', 'updateTimelineShareData', 'openLocation', 'getLocation']; const openTagList = data.openTagList || ['wx-open-launch-weapp']; jsApiList.push('wx-open-launch-weapp'); wx.config({ diff --git a/src/views/Merchant/MerchantIntroduction.vue b/src/views/Merchant/MerchantIntroduction.vue index 8f99121..e05670a 100644 --- a/src/views/Merchant/MerchantIntroduction.vue +++ b/src/views/Merchant/MerchantIntroduction.vue @@ -24,15 +24,15 @@ - + -
{{ formData.shopaddress }}
- 修改请联系平台 +
{{ formData.shopaddress }}
+ 修改请联系平台
@@ -384,11 +384,25 @@ export default { font-size: 3.73vw; } - :deep(.van-field__control:disabled) { + :deep(.van-field__control:disabled), + :deep(.van-field__control[readonly]) { color: #999; background: transparent; } + :deep(.van-field--readonly) { + .van-field__value { + color: #999; + } + } + + .shop-intro-wrap { + .readonly-text { + color: #999; + font-size: 3.2vw; + } + } + .img-thumb { width: 14vw; height: 10vw; diff --git a/src/views/Tabbars/Mall.vue b/src/views/Tabbars/Mall.vue index 4eb2f3d..e34cf47 100644 --- a/src/views/Tabbars/Mall.vue +++ b/src/views/Tabbars/Mall.vue @@ -123,13 +123,16 @@
- - - - - - +
+ + + + + + +
@@ -233,9 +236,9 @@ export default { this.$get('/v1/client/EProsClient?recommend=true').then(res => { this.hotData = res.data.items || [] }), - this.$get('/v1/client/EProcatesClient/1').then(res => { - const filtered = res.data.filter(i => i.homeshowed) - this.typeData = filtered + this.$get('/v1/client/EProcatesClient/3').then(res => { + // const filtered = res.data.filter(i => i.homeshowed) + this.typeData = res.data }), ]).catch(err => { this.$showFailToast(err.message || '加载失败') @@ -280,4 +283,13 @@ export default { color: #999; width: 100%; } + +.goods { + .tabs-sticky { + position: sticky; + top: 0; + z-index: 99; + background: #f5f5f5; + } +} diff --git a/src/views/Tabbars/Social.vue b/src/views/Tabbars/Social.vue index af62f8a..b4d8aca 100644 --- a/src/views/Tabbars/Social.vue +++ b/src/views/Tabbars/Social.vue @@ -46,7 +46,7 @@
{{ item.feeratio }}%
-
可到店消费
+
可到店消费
@@ -55,7 +55,7 @@ {{ item.shopprovince + item.shopcity + item.shopcounty }}{{ item.shopstreet }}{{ item.shopaddress }} {{ (item.distance / 1000)?.toFixed(2) - }}km + }}km @@ -85,10 +85,38 @@ export default { } }, async mounted() { - const res = await this.$geo.getWebGeo(); - this.searchparams.latitude = res.lat; - this.searchparams.longitude = res.lon; this.init(); + + if (wx && this.$isWechat()) { + this.$post('/v1/client/HWxinfoClient/share', JSON.stringify(location.href)).then(res => { + const data = res.data || {}; + const jsApiList = data.jsApiList || ['onMenuShareTimeline', 'onMenuShareAppMessage', 'updateAppMessageShareData', 'updateTimelineShareData', 'openLocation', 'getLocation']; + const openTagList = data.openTagList || ['wx-open-launch-weapp']; + jsApiList.push('wx-open-launch-weapp'); + wx.config({ + debug: false, + appId: data.appid, + timestamp: Number(data.timestamp) || 0, + nonceStr: data.noncestr, + signature: data.signature, + jsApiList: jsApiList, + openTagList: openTagList + }); + wx.ready(() => { + wx.getLocation({ + type: 'gcj02', + success: (e) => { + this.searchparams.latitude = e.latitude; + this.searchparams.longitude = e.longitude; + } + }); + }); + }); + } else { + const res = await this.$geo.getWebGeo(); + this.searchparams.latitude = res.lat; + this.searchparams.longitude = res.lon; + } this.$nextTick(() => { this.checkScroll(); const ro = new ResizeObserver(() => this.checkScroll()); diff --git a/src/views/User/Checkout/Checkout.vue b/src/views/User/Checkout/Checkout.vue index bb5a769..88ba8fe 100644 --- a/src/views/User/Checkout/Checkout.vue +++ b/src/views/User/Checkout/Checkout.vue @@ -1,64 +1,71 @@ @@ -68,6 +75,7 @@ export default { data() { return { checked: '', + shopopen: true, id: this.$route.query.id, data: { user: {}, @@ -106,6 +114,7 @@ export default { this.$get(`/v1/client/DShopsClient/${this.id}`).then(res => { // console.log(res); this.data.shop = res.data; + this.shopopen = res.data.enabled; this.req.shopuserid = res.data.userid; }) }, diff --git a/src/views/User/ShopInfo.vue b/src/views/User/ShopInfo.vue index bc458b6..46df815 100644 --- a/src/views/User/ShopInfo.vue +++ b/src/views/User/ShopInfo.vue @@ -5,7 +5,7 @@
- +
{{ shopInfo.shopname }} @@ -80,25 +80,80 @@ export default { init() { this.$get('/v1/client/DShopsClient/list', { userid: this.$route.query.id }).then(res => { this.shopInfo = res.data.items[0] || {} - }) + }); }, callPhone() { if (this.shopInfo.shopphone) { window.location.href = `tel:${this.shopInfo.shopphone}` } }, + previewImage(url) { + const imageUrl = this.$file(url); + if (imageUrl) { + this.$showImagePreview({ images: [imageUrl], startPosition: 0 }); + } + }, openMap() { if (this.shopInfo.shoplatitude && this.shopInfo.shoplongitude) { const lat = this.shopInfo.shoplatitude; const lon = this.shopInfo.shoplongitude; - const fullAddress = encodeURIComponent( + const fullAddress = ( (this.shopInfo.shopprovince || '') + (this.shopInfo.shopcity || '') + (this.shopInfo.shopcounty || '') + (this.shopInfo.shopstreet || '') + (this.shopInfo.shopaddress || '') ); - window.open(`https://uri.amap.com/navigation?to=${lon},${lat},${fullAddress}&mode=car&src=shop`, '_blank'); + if (wx && this.$isWechat()) { + this.$post('/v1/client/HWxinfoClient/share', JSON.stringify(location.href)).then(res => { + const data = res.data || {}; + const jsApiList = data.jsApiList || ['onMenuShareTimeline', 'onMenuShareAppMessage', 'updateAppMessageShareData', 'updateTimelineShareData', 'openLocation', 'getLocation']; + const openTagList = data.openTagList || ['wx-open-launch-weapp']; + jsApiList.push('wx-open-launch-weapp'); + wx.config({ + debug: false, + appId: data.appid, + timestamp: Number(data.timestamp) || 0, + nonceStr: data.noncestr, + signature: data.signature, + jsApiList: jsApiList, + openTagList: openTagList + }); + wx.ready(() => { + wx.getLocation({ + type: 'gcj02', + success: (e) => { + this.searchparams.latitude = e.latitude; + this.searchparams.longitude = e.longitude; + } + }); + wx.openLocation({ + latitude: Number(lat), + longitude: Number(lon), + name: this.shopInfo.shopname || '', + address: fullAddress, + scale: 15, + infoUrl: '', + success: () => { + console.log('wx.openLocation success'); + }, + fail: (err) => { + console.error('wx.openLocation fail', err); + // window.open(`https://uri.amap.com/navigation?to=${lon},${lat},${fullAddress}&mode=car&src=shop`, '_blank'); + } + }); + }); + wx.error((err) => { + console.error('wx.error', err); + }); + // wx.error((err) => { + // console.error('wx.openLocation error', err); + // window.open(`https://uri.amap.com/navigation?to=${lon},${lat},${fullAddress}&mode=car&src=shop`, '_blank'); + // }); + }); + } else { + window.open(`https://uri.amap.com/navigation?to=${lon},${lat},${fullAddress}&mode=car&src=shop`, '_blank'); + } } }, }