From 050ef466d44b11553162dbd071521ba4ecccd317 Mon Sep 17 00:00:00 2001 From: fanfan Date: Tue, 22 Oct 2024 22:09:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/detail.vue | 20 +++++++ pages/goods/seckillDetail.vue | 105 ++++++++++++++++++++-------------- 2 files changed, 83 insertions(+), 42 deletions(-) diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index ff8b02c..3696a3a 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -828,6 +828,7 @@ }, //跳转京东小程序详情 toJDdetal() { + if (this.goods.jd_short_url) { wx.navigateToMiniProgram({ appId: 'wx91d27dbf599dff74', //app.json内容 path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(this.goods.jd_short_url), @@ -841,6 +842,25 @@ console.log("打开成功") } }) + // #ifndef MP-WEIXIN + window.location.href = this.goods.link; + // #endif + } else { + // #ifdef MP-WEIXIN + wx.navigateToMiniProgram({ + appId: 'wx91d27dbf599dff74', + path: '/pages/item/detail/detail?sku=' + this.goods_sku_no, + envVersion: 'release', + success(res) { + // 打开成功 + console.log(res); + } + }) + // #endif + // #ifndef MP-WEIXIN + window.location.href = this.goods.link; + // #endif + } }, //修改价格 openPirce(type) { diff --git a/pages/goods/seckillDetail.vue b/pages/goods/seckillDetail.vue index 7505339..77ed395 100644 --- a/pages/goods/seckillDetail.vue +++ b/pages/goods/seckillDetail.vue @@ -499,7 +499,7 @@ city: '南京市', district: '玄武区' }, - setting:{} + setting: {} } }, computed: { @@ -540,34 +540,34 @@ }, methods: { // 在线客服 - handleContact() { - // 商城客服设置 - const setting = this.setting - // 企业微信客服 - if (setting.provider == 'wxqykf') { - if (!setting.config.wxqykf.url || !setting.config.wxqykf.corpId) { - this.$toast('客服链接和企业ID不能为空') - return - } - // #ifdef H5 - window.open(setting.config.wxqykf.url) - // #endif - // #ifdef MP-WEIXIN - wx.openCustomerServiceChat({ - extInfo: { - url: setting.config.wxqykf.url - }, - corpId: setting.config.wxqykf.corpId, - success(res) {}, - fail(res){ - console.log(res,'企业微信') - } - }) - // #endif - }else{ - this.$toast('暂不支持企业微信客服') + handleContact() { + // 商城客服设置 + const setting = this.setting + // 企业微信客服 + if (setting.provider == 'wxqykf') { + if (!setting.config.wxqykf.url || !setting.config.wxqykf.corpId) { + this.$toast('客服链接和企业ID不能为空') + return + } + // #ifdef H5 + window.open(setting.config.wxqykf.url) + // #endif + // #ifdef MP-WEIXIN + wx.openCustomerServiceChat({ + extInfo: { + url: setting.config.wxqykf.url + }, + corpId: setting.config.wxqykf.corpId, + success(res) {}, + fail(res) { + console.log(res, '企业微信') } - }, + }) + // #endif + } else { + this.$toast('暂不支持企业微信客服') + } + }, onLook(isLink, url) { if (isLink) { uni.navigateTo({ @@ -734,19 +734,39 @@ }, //跳转京东小程序详情 toJDdetal() { - wx.navigateToMiniProgram({ - appId: 'wx91d27dbf599dff74', //app.json内容 - path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(this.goods.jd_short_url), - extraData: { - foo: 'bar' - }, - envVersion: 'release', - success(res) { - // 打开成功 - console.log(res); - console.log("打开成功") - } - }) + if (this.goods.jd_short_url) { + wx.navigateToMiniProgram({ + appId: 'wx91d27dbf599dff74', //app.json内容 + path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(this.goods.jd_short_url), + extraData: { + foo: 'bar' + }, + envVersion: 'release', + success(res) { + // 打开成功 + console.log(res); + console.log("打开成功") + } + }) + // #ifndef MP-WEIXIN + window.location.href = this.goods.link; + // #endif + } else { + // #ifdef MP-WEIXIN + wx.navigateToMiniProgram({ + appId: 'wx91d27dbf599dff74', + path: '/pages/item/detail/detail?sku=' + this.goods_sku_no, + envVersion: 'release', + success(res) { + // 打开成功 + console.log(res); + } + }) + // #endif + // #ifndef MP-WEIXIN + window.location.href = this.goods.link; + // #endif + } }, //修改价格 openPirce(type) { @@ -984,7 +1004,8 @@ that.goods_sku_no = "" if (info.skuList && info.skuList.length > 0) { if (info.goods_id) { - that.goods_sku_no = info.skuList.filter(item => item.goods_id === info.goods_id)[0].goods_sku_no; + that.goods_sku_no = info.skuList.filter(item => item.goods_id === info + .goods_id)[0].goods_sku_no; } // that.goods_sku_no = info.skuList[0].goods_sku_no }