商家增加im按钮
parent
31f438edfa
commit
7e8ff778f9
|
@ -9,3 +9,10 @@ export const getChildRegion = (id) => {
|
|||
export const getRegion = (params) => {
|
||||
return getRequest(`${commonUrl}/common/common/region/region`, params);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 获取IM接口前缀
|
||||
export function getIMDetail () {
|
||||
return getRequest(`${commonUrl}/common/common/IM`);
|
||||
}
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
<div class="shop-box">
|
||||
<div class="box-item">
|
||||
<div>店铺名称:{{userData.storeName || '暂无'}}</div>
|
||||
|
||||
</div>
|
||||
<div class="box-item">
|
||||
<div>店铺状态:{{userData.storeDisable=='OPEN' ? '开启中' : '关闭'}}</div>
|
||||
</div>
|
||||
<div class="box-item" @click="im()">
|
||||
<Button type="info">点击登录客服</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rate-box">
|
||||
|
@ -199,6 +201,7 @@
|
|||
|
||||
<script>
|
||||
import { getSellerHomeData, getHomeNotice } from "@/api/index";
|
||||
import { getIMDetail } from "@/api/common"
|
||||
import { seeArticle } from "@/api/pages";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
|
@ -214,6 +217,7 @@ export default {
|
|||
noticesDetail: { // 平台公告详情
|
||||
title: "",
|
||||
},
|
||||
IMLink:"",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -242,6 +246,24 @@ export default {
|
|||
this.noticeFlage = true;
|
||||
}
|
||||
},
|
||||
async im() {
|
||||
// 获取访问Token
|
||||
let accessToken = this.getStore("accessToken");
|
||||
await this.getIMDetailMethods();
|
||||
if (!accessToken) {
|
||||
this.$Message.error("请登录后再联系客服");
|
||||
return;
|
||||
}
|
||||
window.open(this.IMLink + "?token=" + accessToken);
|
||||
},
|
||||
|
||||
// 获取im信息
|
||||
async getIMDetailMethods() {
|
||||
let res = await getIMDetail();
|
||||
if (res.success) {
|
||||
this.IMLink = res.result;
|
||||
}
|
||||
},
|
||||
// 获取首页数据
|
||||
async getHomeData() {
|
||||
let res = await getSellerHomeData();
|
||||
|
|
Loading…
Reference in New Issue