From dfd3885486909a1ef8c9467ff9f4407cf892dc1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Mon, 20 Dec 2021 17:34:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=82=A8=E5=A4=87udesk=E6=96=B9=E6=A1=88?= =?UTF-8?q?=EF=BC=8C=E6=9A=82=E6=97=B6=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/product/goods.vue | 95 ++++++++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 34 deletions(-) diff --git a/pages/product/goods.vue b/pages/product/goods.vue index b48d1f8..f6c15ad 100644 --- a/pages/product/goods.vue +++ b/pages/product/goods.vue @@ -221,7 +221,7 @@ - 送至 + 送至 {{ delivery.consigneeAddressPath | clearStrComma @@ -343,7 +343,7 @@ @closeBuy="closePopupBuy" @queryCart="cartCount()" :goodsDetail="goodsDetail" - :goodsSpec="goodsSpec" + :goodsSpec="goodsSpec" :isGroup="isGroup" :id="productId" v-if="goodsDetail.id" @@ -362,6 +362,7 @@ import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/ import * as API_trade from "@/api/trade.js"; import * as API_Members from "@/api/members.js"; import * as API_store from "@/api/store.js"; +import { getIMDetail } from '@/api/common' import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js"; /************请求存储***************/ import storage from "@/utils/storage.js"; @@ -522,9 +523,17 @@ export default { startTimer: false, //未开启 是false routerVal: "", + IMLink:"", // IM地址 + }; }, + computed:{ + IM() { + return this.IMLink + this.storeDetail.merchantEuid; + }, + }, + watch: { isGroup(val) { if (val) { @@ -679,7 +688,7 @@ export default { this.cartCount(); // 获取店铺推荐商品 - this.getstoreRecommend(); + this.getStoreRecommend(); // 获取商品列表 this.getOtherLikeGoods(); @@ -688,37 +697,55 @@ export default { if (this.$options.filters.isLogin("auth")) { this.getGoodsCollectionFun(this.goodsDetail.id); } - }, - linkMsgDetail() { - // 客服 - // #ifdef MP-WEIXIN + // 获取IM 需要的话使用 + // this.getIMDetailMethods(); - const params = { - storeName: this.storeDetail.storeName, - goodsName: this.goodsDetail.goodsName, - goodsId: this.goodsDetail.goodsId, - goodsImg: this.goodsDetail.thumbnail, - price: this.goodsDetail.promotionPrice || this.goodsDetail.price, - // originalPrice: this.goodsDetail.original || this.goodsDetail.price, - uuid: storage.getUuid(), - token: storage.getAccessToken(), - sign: this.storeDetail.yzfSign, - mpSign: this.storeDetail.yzfMpSign, - }; - uni.navigateTo({ - url: - "/pages/product/customerservice/index?params=" + - encodeURIComponent(JSON.stringify(params)), - }); - // #endif - // #ifndef MP-WEIXIN - const sign = this.storeDetail.yzfSign; - uni.navigateTo({ - url: - "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" + - sign, - }); - // #endif + }, + + async getIMDetailMethods(){ + let res = await getIMDetail() + if(res.data.success){ + this.IMLink = res.data.result + } + }, + + linkMsgDetail() { + + if(this.storeDetail.merchantEuid){ + uni.navigateTo({ + url:`/pages/tabbar/home/web-view?src=${this.IM}` + }); + } + else{ + // 客服 + // #ifdef MP-WEIXIN + const params = { + storeName: this.storeDetail.storeName, + goodsName: this.goodsDetail.goodsName, + goodsId: this.goodsDetail.goodsId, + goodsImg: this.goodsDetail.thumbnail, + price: this.goodsDetail.promotionPrice || this.goodsDetail.price, + // originalPrice: this.goodsDetail.original || this.goodsDetail.price, + uuid: storage.getUuid(), + token: storage.getAccessToken(), + sign: this.storeDetail.yzfSign, + mpSign: this.storeDetail.yzfMpSign, + }; + uni.navigateTo({ + url: + "/pages/product/customerservice/index?params=" + + encodeURIComponent(JSON.stringify(params)), + }); + // #endif + // #ifndef MP-WEIXIN + const sign = this.storeDetail.yzfSign; + uni.navigateTo({ + url: + "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" + + sign, + }); + // #endif + } }, // 格式化金钱 1999 --> [1999,00] formatPrice(val) { @@ -834,7 +861,7 @@ export default { /** * 获取店铺推荐商品列表 */ - getstoreRecommend() { + getStoreRecommend() { getGoodsList({ pageNumber: 1, pageSize: 6, From c1d4d3926545aac5be6be5c378a558f387fef7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Mon, 20 Dec 2021 17:34:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?udesk=20=E6=8A=80=E6=9C=AF=E5=82=A8?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/common.js | 58 ++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/api/common.js b/api/common.js index ae5e2dc..030e5e2 100644 --- a/api/common.js +++ b/api/common.js @@ -1,26 +1,32 @@ -/** - * 公共API - */ -import {http, Method} from '@/utils/request.js'; -import api from '@/config/api.js'; - - - -/** - * 获取地区数据 - * @param id - */ -export function getRegionsById(id = 0) { - return http.request({ - url: `${api.common}/region/item/${id}`, - method: Method.GET, - message: false, - }); -} - -/** - * 文件上传地址 - * @type {string} - */ -export const upload =api.common+'/upload/file'; - +/** + * 公共API + */ +import { http, Method } from "@/utils/request.js"; +import api from "@/config/api.js"; + +/** + * 获取地区数据 + * @param id + */ +export function getRegionsById(id = 0) { + return http.request({ + url: `${api.common}/region/item/${id}`, + method: Method.GET, + message: false, + }); +} + +// 获取IM接口前缀 +export function getIMDetail() { + return http.request({ + url: `${api.common}/IM`, + method: Method.GET, + message: false, + }); +} + +/** + * 文件上传地址 + * @type {string} + */ +export const upload = api.common + "/upload/file";