增加客服功能

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

@ -95,4 +95,10 @@ 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

@ -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`, // 获取客服消息链接
}

View File

@ -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,

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>
@ -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}` })
},
}
}

View File

@ -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)
}
},
}
}
</script>

View File

@ -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 || {}
},

View File

@ -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)