IM携带商品信息
parent
5b58d1de5e
commit
09ce16dc95
|
@ -15,16 +15,24 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
// 跳转im客服
|
||||
async IMService(id) {
|
||||
async IMService(id, goodsId, skuId) {
|
||||
|
||||
// 获取访问Token
|
||||
let accessToken = Storage.getItem("accessToken");
|
||||
await this.getIMDetailMethods();
|
||||
const userInfo = await getMemberMsg();
|
||||
if (userInfo.success) {
|
||||
window.open(
|
||||
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId
|
||||
);
|
||||
//携带商品Id,在IM可以发送商品信息
|
||||
if(goodsId && skuId){
|
||||
window.open(
|
||||
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId + "&goodsId=" + goodsId + "&skuId=" + skuId
|
||||
);
|
||||
}else{
|
||||
window.open(
|
||||
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId
|
||||
);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$Message.error("请登录后再联系客服");
|
||||
return;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
|
||||
{{ storeCollected? "已收藏店铺": "收藏店铺" }}
|
||||
</span>
|
||||
<span class="ml_10" @click="IMService(goodsMsg.data.storeId)">联系客服</span>
|
||||
<span class="ml_10" @click="IMService(goodsMsg.data.storeId,goodsMsg.data.goodsId,goodsMsg.data.id)">联系客服</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
type="ios-heart"/>{{
|
||||
storeCollected ? '已收藏店铺' : '收藏店铺'
|
||||
}}</span>
|
||||
<span class="hover-pointer ml_10" style="width:80px" @click="IMService(storeMsg.storeId)"><Icon
|
||||
<span class="hover-pointer ml_10" style="width:80px" @click="IMService(storeMsg.storeId,null,null)"><Icon
|
||||
custom="icomoon icon-customer-service"/>联系客服</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue