IM携带商品信息

master
chc 2023-06-01 10:10:51 +08:00
parent 5b58d1de5e
commit 09ce16dc95
3 changed files with 14 additions and 6 deletions

View File

@ -15,16 +15,24 @@ export default {
}, },
methods: { methods: {
// im // im
async IMService(id) { async IMService(id, goodsId, skuId) {
// 访Token // 访Token
let accessToken = Storage.getItem("accessToken"); let accessToken = Storage.getItem("accessToken");
await this.getIMDetailMethods(); await this.getIMDetailMethods();
const userInfo = await getMemberMsg(); const userInfo = await getMemberMsg();
if (userInfo.success) { if (userInfo.success) {
//Id,IM
if(goodsId && skuId){
window.open(
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId + "&goodsId=" + goodsId + "&skuId=" + skuId
);
}else{
window.open( window.open(
this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId this.IMLink + "?token=" + accessToken + "&id=" + id || this.storeMsg.storeId
); );
}
} else { } else {
this.$Message.error("请登录后再联系客服"); this.$Message.error("请登录后再联系客服");
return; return;

View File

@ -22,7 +22,7 @@
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" /> <Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
{{ storeCollected? "已收藏店铺": "收藏店铺" }} {{ storeCollected? "已收藏店铺": "收藏店铺" }}
</span> </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> </div>
</div> </div>

View File

@ -14,7 +14,7 @@
type="ios-heart"/>{{ type="ios-heart"/>{{
storeCollected ? '已收藏店铺' : '收藏店铺' storeCollected ? '已收藏店铺' : '收藏店铺'
}}</span> }}</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> custom="icomoon icon-customer-service"/>联系客服</span>
</div> </div>
</div> </div>