增加客服功能

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 = {})=> { export const querySappNotifyTplList = (data = {})=> {
return coreRequest(url.querySappNotifyTplList, data, {}, 'get') 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`, // 进仓单列表 getWarehouseInList: `/oms2c/emisWarehouseIn/listSimple`, // 进仓单列表
getWarehouseInInfo: `/oms2c/emisWarehouseIn/getWarehouseInDetail`, // 获取进仓单详情 getWarehouseInInfo: `/oms2c/emisWarehouseIn/getWarehouseInDetail`, // 获取进仓单详情
cusConfirmWsIn: `/oms2c/emisWarehouseIn/cusConfirmWsIn`, // 确认进仓单 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 let { fullPath } = _thisPage.$page
goto(fullPath, 2) goto(fullPath, 2)
} }
const gotoWebview = ({ url })=> {
goto(`webview/index?url=${encodeURIComponent(url)}`)
}
export { export {
reLaunch, reLaunch,
gotoWebview,
goto, goto,
goBack, goBack,
setClipboardData, setClipboardData,

View File

@ -16,10 +16,10 @@
</view> </view>
</u-row> </u-row>
<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> <u-icon name="kefu-ermai" size="40" custom-style="margin: 0 auto;"></u-icon>
<text class="pt-10">客服</text> <text class="pt-10">客服</text>
</view> --> </view>
</u-row> </u-row>
</u-row> </u-row>
</template> </template>
@ -34,6 +34,9 @@
get(){ get(){
return this.value return this.value
} }
},
kefuH5Url() {
return this.$store.getters.kefuH5Url
}, },
}, },
watch: { watch: {
@ -79,8 +82,8 @@
handleChooseEmp(){ handleChooseEmp(){
this.goto(`user/exclusiveCourier?type=choose`) this.goto(`user/exclusiveCourier?type=choose`)
}, },
handleConnect(){ handleConnect(){
this.gotoWebview({ url: `${this.kefuH5Url}` })
}, },
} }
} }

View File

@ -72,6 +72,11 @@
// hasLeftWin: { // hasLeftWin: {
// type: Boolean // type: Boolean
// } // }
},
computed: {
kefuH5Url() {
return this.$store.getters.kefuH5Url
},
}, },
data() { data() {
return { return {
@ -89,7 +94,8 @@
// { title: 'HSCODE', subTitle: "海关归类信息", icon: getCdnUrl(`sdg/t-HS.png`), url: '' }, // { title: 'HSCODE', subTitle: "海关归类信息", icon: getCdnUrl(`sdg/t-HS.png`), url: '' },
// { title: 'RECP', subTitle: "优惠税率安排查询", icon: getCdnUrl(`sdg/t-RE.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-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 showFollow: false
} }
@ -106,6 +112,8 @@
async handleToolItemClict(item) { async handleToolItemClict(item) {
if(item.url == 'action:scan') { if(item.url == 'action:scan') {
this.handleCheckOpenPost() this.handleCheckOpenPost()
} else if(item.url == 'action:kefu') {
this.gotoWebview({ url: `${this.kefuH5Url}` })
} else { } else {
goto(item.url) goto(item.url)
} }
@ -124,7 +132,7 @@
}, },
officialOnError(e) { officialOnError(e) {
console.log('公众号组件加载失败===', e.detail.status) console.log('公众号组件加载失败===', e.detail.status)
} },
} }
} }
</script> </script>

View File

@ -75,7 +75,10 @@ const store = createStore({
state.univerifyErrorMsg = payload state.univerifyErrorMsg = payload
} }
}, },
getters: { getters: {
kefuH5Url: (state)=> {
return state.user?.info?.kefuH5Url || ''
},
userInfo: (state)=> { userInfo: (state)=> {
return state.user?.info || {} return state.user?.info || {}
}, },

View File

@ -82,11 +82,14 @@ export default {
return 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 = { const info = {
...resInfo.user, ...resInfo.user,
roles: resInfo.user, roles: resInfo.user,
permissions: resInfo.permissions permissions: resInfo.permissions,
kefuH5Url: kefuRes.data,
} }
commit(USERKEY.GETUSERINFO, info) commit(USERKEY.GETUSERINFO, info)