From 63ebf1a7c5e140054a8a64c8561f5f5b863ffce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B?= <994041296@163.com> Date: Fri, 10 Feb 2023 14:13:22 +0800 Subject: [PATCH] =?UTF-8?q?im=E9=87=8D=E5=A4=8D=E8=AF=B7=E6=B1=82=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/im/index.vue | 20 +++++++++------- pages/product/goods.vue | 52 +++++++++++++++++++++-------------------- utils/filters.js | 4 ++-- 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/pages/mine/im/index.vue b/pages/mine/im/index.vue index 4ad59b8..ffd12f0 100644 --- a/pages/mine/im/index.vue +++ b/pages/mine/im/index.vue @@ -10,7 +10,7 @@ - @@ -36,8 +36,8 @@ }} ¥{{ - JSON.parse(item.text)['price'] + style="font-size:20rpx;">¥{{ + JSON.parse(item.text)['price'] | unitPrice }} @@ -141,8 +141,8 @@ goodListData.goodsName }} - ¥{{ - goodListData.price + ¥{{ + goodListData.price | unitPrice }} @@ -318,7 +318,8 @@ export default { scrollHeight: 0, ws: new SocketService(), resolve: {}, - goodListData: {} + goodListData: {}, + count: 0 } }, // watch: { @@ -416,16 +417,15 @@ export default { if (!this.socketOpen) { // 监听连接失败 uni.onSocketError(function (err) { - let count = 0; - if (count < 3) { + if (this.count < 3) { if (err && err.code !== 1000) { _this.socketOpen = true; uni.connectSocket({ url: url, }); - count = count + 1 } } + this.count++ }); } // 监听连接关闭 @@ -795,6 +795,7 @@ export default { flex: 1; overflow: hidden; margin-left: 12rpx; + width: 400rpx; .goodsdesc-name { font-size: 12px; @@ -804,6 +805,7 @@ export default { overflow: hidden; margin-bottom: 20rpx; + .goodsCard_goodNmae { color: black; text-overflow: ellipsis; diff --git a/pages/product/goods.vue b/pages/product/goods.vue index c5cc4fc..72e7047 100644 --- a/pages/product/goods.vue +++ b/pages/product/goods.vue @@ -7,11 +7,12 @@ + '/pages/product/goods?id=' + + this.routerVal.id + + '&goodsId=' + + this.routerVal.goodsId + " :thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" + @close="enableShare = false" /> @@ -66,8 +67,8 @@ {{ - favorite ? "已收藏" : "收藏" -}} + favorite? "已收藏": "收藏" + }} @@ -85,20 +86,21 @@ ¥{{ - $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[0] -}}.{{ - $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[1] + $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[0] + }}.{{ + $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[1] }} ~ ¥{{ - $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] -}}.{{ - $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] + $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] + }}.{{ + $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }} - ¥{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] -}}.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }} + ¥{{ + $options.filters.goodsFormatPrice(goodsDetail.price)[0] + }}.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }} @@ -114,8 +116,8 @@ {{ - favorite ? "已收藏" : "收藏" -}} + favorite? "已收藏": "收藏" + }} @@ -150,8 +152,8 @@ 已选 {{ selectedGoods.spec.specName }}-{{ - selectedGoods.spec.specValue -}} + selectedGoods.spec.specValue + }} 默认 @@ -162,8 +164,8 @@ 送至 {{ - delivery.consigneeAddressPath | clearStrComma -}} + delivery.consigneeAddressPath | clearStrComma + }} 暂无地址信息 @@ -601,10 +603,10 @@ export default { linkMsgDetail () { // lili 基础客服 - // this.$options.filters.talkIm(this.storeDetail.storeId) - uni.navigateTo({ - url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}` - }); + this.$options.filters.talkIm(this.goodsDetail.storeId, this.routerVal.goodsId, this.routerVal.id) + // uni.navigateTo({ + // url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}` + // }); // udesk 代码 // if (this.storeDetail.merchantEuid) { diff --git a/utils/filters.js b/utils/filters.js index e991b84..bb75189 100644 --- a/utils/filters.js +++ b/utils/filters.js @@ -363,10 +363,10 @@ export function quiteLoginOut () { /** * 跳转im */ -export function talkIm (storeId) { +export function talkIm (storeId, goodsId, id) { if (isLogin('auth')) { uni.navigateTo({ - url: `/pages/tabbar/home/web-view?IM=${storeId}`, + url: `/pages/mine/im/index?userId=${storeId}&goodsid=${goodsId}&skuid=${id}` }); } else {