增加客服功能

This commit is contained in:
aihe 2024-10-31 13:13:32 +08:00
parent 55e0ccf621
commit a2d91e1459
7 changed files with 42 additions and 13 deletions

View File

@ -96,3 +96,9 @@ export const getComplainInfo = (data = {})=> {
export const querySappNotifyTplList = (data = {})=> {
return coreRequest(url.querySappNotifyTplList, data, {}, 'get')
}
// 获取客服消息链接
export const getOnlineKefuH5Url = (data = {})=> {
return coreRequest(url.getOnlineKefuH5Url, data, {}, 'get')
}

View File

@ -63,6 +63,8 @@ export default {
getWarehouseInInfo: `/oms2c/emisWarehouseIn/getWarehouseInDetail`, // 获取进仓单详情
cusConfirmWsIn: `/oms2c/emisWarehouseIn/cusConfirmWsIn`, // 确认进仓单
querySappNotifyTplList: `/oms2c/common/querySappNotifyTplList`, // 小程序订阅消息模板列表
getOnlineKefuH5Url: `/oms2c/common/getOnlineKefuH5Url`, // 获取客服消息链接
}

View File

@ -286,9 +286,13 @@ const reloadCurrentPage = (_thisPage)=> {
goto(fullPath, 2)
}
const gotoWebview = ({ url })=> {
goto(`webview/index?url=${encodeURIComponent(url)}`)
}
export {
reLaunch,
gotoWebview,
goto,
goBack,
setClipboardData,

View File

@ -16,10 +16,10 @@
</view>
</u-row>
<u-row>
<!-- <view @click="handleConnect" class="text-center">
<view @click="handleConnect" class="text-center">
<u-icon name="kefu-ermai" size="40" custom-style="margin: 0 auto;"></u-icon>
<text class="pt-10">客服</text>
</view> -->
</view>
</u-row>
</u-row>
</template>
@ -35,6 +35,9 @@
return this.value
}
},
kefuH5Url() {
return this.$store.getters.kefuH5Url
},
},
watch: {
},
@ -80,7 +83,7 @@
this.goto(`user/exclusiveCourier?type=choose`)
},
handleConnect(){
this.gotoWebview({ url: `${this.kefuH5Url}` })
},
}
}

View File

@ -73,6 +73,11 @@
// type: Boolean
// }
},
computed: {
kefuH5Url() {
return this.$store.getters.kefuH5Url
},
},
data() {
return {
mainBtnlist: [
@ -90,6 +95,7 @@
// { 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: '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)
}
},
}
}
</script>

View File

@ -76,6 +76,9 @@ const store = createStore({
}
},
getters: {
kefuH5Url: (state)=> {
return state.user?.info?.kefuH5Url || ''
},
userInfo: (state)=> {
return state.user?.info || {}
},

View File

@ -83,10 +83,13 @@ export default {
}
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)