Commit d5365d53 by 李伟康

AI跳转

1 parent de881de7
...@@ -24,6 +24,7 @@ Page({ ...@@ -24,6 +24,7 @@ Page({
onLoad(options) { onLoad(options) {
this.getTabHeight() this.getTabHeight()
this.getSceneMarketMaterialMenu() this.getSceneMarketMaterialMenu()
this.getAIUrl()
}, },
/** /**
......
...@@ -2,6 +2,7 @@ import { ...@@ -2,6 +2,7 @@ import {
getSceneMarketMaterialMenu, getSceneMarketMaterialMenu,
getSceneMarketMaterialList, getSceneMarketMaterialList,
enterPageTrack, enterPageTrack,
getAiagent
} from '../request' } from '../request'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
...@@ -148,8 +149,35 @@ export default { ...@@ -148,8 +149,35 @@ export default {
}) })
}, },
jumpAI() { jumpAI() {
wx.navigateToMiniProgram({ if (this.aiUrl) wx.navigateTo({
appId: 'wx4cc95d0fd0729c32' url: `/pages/webView/webView?url=${encodeURIComponent(this.aiUrl)}`
}) })
else {
wx.$util.showToast('暂无权限')
this.getAIUrl()
}
},
async getAIUrl() {
const {
phone,
uuid
} = this.data.userInfo, {
code,
data
} = await getAiagent({
accountPhone: phone,
ownerShipType: 0,
agentCode: 'AI6'
})
if (code == 0 && data && data.length) {
let [item] = data, {
ownerPost,
agentUrl,
domainName,
presuppositionProblem,
accountPhone
} = item
this.aiUrl = `${agentUrl}?one_id=${uuid}&platformType=0&phone=${accountPhone}&position=${ownerPost}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}`
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -43,7 +43,14 @@ module.exports = { ...@@ -43,7 +43,14 @@ module.exports = {
leavePageTrack(data = {}) { leavePageTrack(data = {}) {
return api.post('dj.api.customer.dynamic.record.leave', data) return api.post('dj.api.customer.dynamic.record.leave', data)
}, },
getSceneMarketConfig(){ getSceneMarketConfig() {
return api.getMock('scene-market-config') return api.getMock('scene-market-config')
} },
getAiagent(data = {}) {
return api.post('dj.pad.api.aiagent.get.special.agent',
data,
[],
"/rop-dj-pad/router",
"dj")
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -114,6 +114,7 @@ class Request { ...@@ -114,6 +114,7 @@ class Request {
if (!apiName) { if (!apiName) {
throw new Error('apiName is null') throw new Error('apiName is null')
} }
if(apiName.split('.').length > 1) apiName = apiName.split('.')[0]
if (merchant) apiName = 'merchants' if (merchant) apiName = 'merchants'
const appKey = secretKey[apiName].appKey const appKey = secretKey[apiName].appKey
const secret = secretKey[apiName].secret const secret = secretKey[apiName].secret
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!