master
Chopper 2022-02-21 22:45:39 +08:00
parent 12ea0c2b84
commit 31f438edfa
2 changed files with 12 additions and 23 deletions

View File

@ -21,16 +21,7 @@
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
{{storeCollected ? '已收藏店铺' : '收藏店铺'}}
</span>
<!--
先看下udesk merchantEuid 是否有值
有的话 链接udesk
没有的话 显示云智服
-->
<span class="ml_10" v-if="storeMsg.merchantEuid" @click="IMService()"></span>
<span v-else @click="connectCs(storeMsg.yzfSign)" class="ml_10">
<Icon custom="icomoon icon-customer-service" />联系客服
</span>
<span class="ml_10" @click="IMService()"></span>
</div>
</div>
</div>
@ -58,6 +49,7 @@ import {
} from "@/api/member";
import { getDetailById } from "@/api/shopentry";
import { getIMDetail } from "@/api/common";
import Storage from "../plugins/storage";
export default {
name: "GoodsDetail",
beforeRouteEnter(to, from, next) {
@ -66,7 +58,6 @@ export default {
},
created() {
this.getGoodsDetail();
// this.getIMDetailMethods();
},
data() {
return {
@ -80,8 +71,15 @@ export default {
},
methods: {
// im
IMService() {
window.open(this.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);
},
// im
async getIMDetailMethods() {
@ -186,11 +184,6 @@ export default {
location.reload();
},
},
computed: {
IM() {
return this.IMLink + this.storeMsg.merchantEuid;
},
},
components: {
Search,
ShopHeader,

View File

@ -4,9 +4,6 @@
<FormItem label="云IM地址" prop="httpUrl">
<Input v-model="formValidate.httpUrl"/>
</FormItem>
<FormItem label="平台ID" class="label-item" prop="tenantId">
<Input v-model="formValidate.tenantId"/>
</FormItem>
<div class="label-btns">
<Button type="primary" @click="submit('formValidate')"></Button>
</div>
@ -22,8 +19,7 @@ export default {
return {
ruleValidate: {}, //
formValidate: { //
httpUrl: "",
tenantId: ""
httpUrl: ""
},
};
},