Commit d5365d53 by 李伟康

AI跳转

1 parent de881de7
......@@ -24,6 +24,7 @@ Page({
onLoad(options) {
this.getTabHeight()
this.getSceneMarketMaterialMenu()
this.getAIUrl()
},
/**
......
......@@ -2,6 +2,7 @@ import {
getSceneMarketMaterialMenu,
getSceneMarketMaterialList,
enterPageTrack,
getAiagent
} from '../request'
import dayjs from 'dayjs'
export default {
......@@ -148,8 +149,35 @@ export default {
})
},
jumpAI() {
wx.navigateToMiniProgram({
appId: 'wx4cc95d0fd0729c32'
if (this.aiUrl) wx.navigateTo({
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
......@@ -43,7 +43,14 @@ module.exports = {
leavePageTrack(data = {}) {
return api.post('dj.api.customer.dynamic.record.leave', data)
},
getSceneMarketConfig(){
getSceneMarketConfig() {
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
......@@ -114,6 +114,7 @@ class Request {
if (!apiName) {
throw new Error('apiName is null')
}
if(apiName.split('.').length > 1) apiName = apiName.split('.')[0]
if (merchant) apiName = 'merchants'
const appKey = secretKey[apiName].appKey
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!