feat: 优化im 接口403判定,新增从买家端以及卖家端进行跳转im权限判定,新增im掉线重连以及重连成功提醒,新增发送的消息断线将会进行重新发送消息提示,优化最近浏览 订单列表空展示。注释部分im打印的日志信息

This commit is contained in:
学习很差啦
2023-03-01 14:59:54 +08:00
parent 32b29f45e7
commit 4700bc995a
16 changed files with 288 additions and 153 deletions

View File

@@ -50,8 +50,7 @@ import {
getGoodsDistribution,
} from "@/api/member";
import { getDetailById } from "@/api/shopentry";
import { getIMDetail } from "@/api/common";
import Storage from "../plugins/storage";
import imTalk from '@/components/mixes/talkIm'
export default {
name: "GoodsDetail",
beforeRouteEnter (to, from, next) {
@@ -61,6 +60,7 @@ export default {
created () {
this.getGoodsDetail();
},
mixins: [imTalk],
data () {
return {
goodsMsg: {}, // 商品信息
@@ -68,49 +68,11 @@ export default {
categoryBar: [], // 分类
storeCollected: false, // 商品收藏
storeMsg: {}, // 店铺信息
IMLink: "",
};
},
methods: {
// 跳转im客服
async IMService () {
// 获取访问Token
let accessToken = Storage.getItem("accessToken");
await this.getIMDetailMethods();
if (!accessToken) {
this.$Message.error("请登录后再联系客服");
return;
}
window.open(
this.IMLink +
"?token=" +
accessToken +
"&id=" +
this.goodsMsg.data.storeId +
"&goodsId=" +
this.goodsMsg.data.goodsId +
"&skuId=" +
this.goodsMsg.data.id
);
// window.open(
// 'http://192.168.0.139:8000/' +
// "?token=" +
// accessToken +
// "&id=" +
// this.goodsMsg.data.storeId +
// "&goodsId=" +
// this.goodsMsg.data.goodsId +
// "&skuId=" +
// this.goodsMsg.data.id
// );
},
// 获取im信息
async getIMDetailMethods () {
let res = await getIMDetail();
if (res.success) {
this.IMLink = res.result;
}
},
// 点击规格
targetClickSku (val) {
this.getGoodsDetail(val);