diff --git a/common/api/common.js b/common/api/common.js index 1de1544..11d999e 100644 --- a/common/api/common.js +++ b/common/api/common.js @@ -95,4 +95,10 @@ export const getComplainInfo = (data = {})=> { // 小程序订阅消息模板列表 export const querySappNotifyTplList = (data = {})=> { return coreRequest(url.querySappNotifyTplList, data, {}, 'get') -} \ No newline at end of file +} + +// 获取客服消息链接 +export const getOnlineKefuH5Url = (data = {})=> { + return coreRequest(url.getOnlineKefuH5Url, data, {}, 'get') +} + diff --git a/common/api/url.js b/common/api/url.js index fc1fb18..86f241b 100644 --- a/common/api/url.js +++ b/common/api/url.js @@ -62,7 +62,9 @@ export default { getWarehouseInList: `/oms2c/emisWarehouseIn/listSimple`, // 进仓单列表 getWarehouseInInfo: `/oms2c/emisWarehouseIn/getWarehouseInDetail`, // 获取进仓单详情 cusConfirmWsIn: `/oms2c/emisWarehouseIn/cusConfirmWsIn`, // 确认进仓单 - querySappNotifyTplList: `/oms2c/common/querySappNotifyTplList`, // 小程序订阅消息模板列表 + querySappNotifyTplList: `/oms2c/common/querySappNotifyTplList`, // 小程序订阅消息模板列表 + getOnlineKefuH5Url: `/oms2c/common/getOnlineKefuH5Url`, // 获取客服消息链接 + } diff --git a/common/untool.js b/common/untool.js index ff22d45..983cb79 100644 --- a/common/untool.js +++ b/common/untool.js @@ -285,10 +285,14 @@ const reloadCurrentPage = (_thisPage)=> { let { fullPath } = _thisPage.$page goto(fullPath, 2) } - + +const gotoWebview = ({ url })=> { + goto(`webview/index?url=${encodeURIComponent(url)}`) +} export { - reLaunch, + reLaunch, + gotoWebview, goto, goBack, setClipboardData, diff --git a/components/buns-post-edit-templates/bpe-bindedpost-tmp.vue b/components/buns-post-edit-templates/bpe-bindedpost-tmp.vue index 19170b0..01d2202 100644 --- a/components/buns-post-edit-templates/bpe-bindedpost-tmp.vue +++ b/components/buns-post-edit-templates/bpe-bindedpost-tmp.vue @@ -16,10 +16,10 @@ - + @@ -34,6 +34,9 @@ get(){ return this.value } + }, + kefuH5Url() { + return this.$store.getters.kefuH5Url }, }, watch: { @@ -79,8 +82,8 @@ handleChooseEmp(){ this.goto(`user/exclusiveCourier?type=choose`) }, - handleConnect(){ - + handleConnect(){ + this.gotoWebview({ url: `${this.kefuH5Url}` }) }, } } diff --git a/pages/tabBar/sending/sending.vue b/pages/tabBar/sending/sending.vue index 90acafc..7932e35 100644 --- a/pages/tabBar/sending/sending.vue +++ b/pages/tabBar/sending/sending.vue @@ -72,6 +72,11 @@ // hasLeftWin: { // type: Boolean // } + }, + computed: { + kefuH5Url() { + return this.$store.getters.kefuH5Url + }, }, data() { return { @@ -89,7 +94,8 @@ // { title: 'HSCODE', subTitle: "海关归类信息", icon: getCdnUrl(`sdg/t-HS.png`), url: '' }, // { title: 'RECP', subTitle: "优惠税率安排查询", icon: getCdnUrl(`sdg/t-RE.png`), url: '' }, // { title: '扫码寄件', subTitle: "扫描条码发货", icon: getCdnUrl(`sdg/t-saoma.png`), url: 'action:scan' }, - { title: '快递查询', subTitle: "快递单跟踪查询", icon: getCdnUrl(`sdg/t-yundan.png`), url: 'post/query' }, + { title: '快递查询', subTitle: "快递单跟踪查询", icon: getCdnUrl(`sdg/t-yundan.png`), url: 'post/query' }, + { title: '客服', subTitle: "与在线客服交流", icon: getCdnUrl(`sdg/t-yundan.png`), url: 'action:kefu', }, ], showFollow: false } @@ -106,6 +112,8 @@ async handleToolItemClict(item) { if(item.url == 'action:scan') { this.handleCheckOpenPost() + } else if(item.url == 'action:kefu') { + this.gotoWebview({ url: `${this.kefuH5Url}` }) } else { goto(item.url) } @@ -124,7 +132,7 @@ }, officialOnError(e) { console.log('公众号组件加载失败===', e.detail.status) - } + }, } } diff --git a/store/index.js b/store/index.js index bc4163f..df5ebb8 100644 --- a/store/index.js +++ b/store/index.js @@ -75,7 +75,10 @@ const store = createStore({ state.univerifyErrorMsg = payload } }, - getters: { + getters: { + kefuH5Url: (state)=> { + return state.user?.info?.kefuH5Url || '' + }, userInfo: (state)=> { return state.user?.info || {} }, diff --git a/store/modules/user.js b/store/modules/user.js index 390a7d6..350fdca 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -82,11 +82,14 @@ export default { return } - const resInfo = await apiService.getInfoByApp() + const resInfo = await apiService.getInfoByApp() + const { userld, nickName } = resInfo.user + const kefuRes = await apiService.getOnlineKefuH5Url({ userld, nickName }) const info = { ...resInfo.user, roles: resInfo.user, - permissions: resInfo.permissions + permissions: resInfo.permissions, + kefuH5Url: kefuRes.data, } commit(USERKEY.GETUSERINFO, info)