diff --git a/api/deepExploration/deepExploration.js b/api/deepExploration/deepExploration.js index db2a6ab..800b626 100644 --- a/api/deepExploration/deepExploration.js +++ b/api/deepExploration/deepExploration.js @@ -1 +1,101 @@ -import { http } from '@/utils/http.js' \ No newline at end of file +import { http } from '@/utils/http.js' + + +//主力追踪意图 +export const getModel1First = (data) => { + return http({ + method: 'POST', + url: '/api/coze/trackingFirst', + data + }) +} + +//主力追踪意图 +export const getModel1Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/trackingSecond', + data + }) +} + + +//主力追踪意图 +export const getModel2First = (data) => { + return http({ + method: 'POST', + url: '/api/coze/radarFirst', + data + }) +} + +//主力追踪意图 +export const getModel2Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/radarSecond', + data + }) +} + +//主力追踪意图 +export const getModel3First = (data) => { + return http({ + method: 'POST', + url: '/api/coze/decodingFirst', + data + }) +} + +//主力追踪意图 +export const getModel3Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/decodingSecond', + data + }) +} + +//主力追踪意图 +export const getModel4First = (data) => { + return http({ + method: 'POST', + url: '/api/coze/fundsFirst', + data + }) +} + +//主力追踪意图 +export const getModel4Second = (data) => { + return http({ + method: 'POST', + url: '/api/coze/fundsSecond', + data + }) +} + + + +//历史记录列表 +export const RecordListApi = (data) => { + return http({ + method: 'POST', + url: '/api/coze/mainForceList', + data:data + }) +} + + + + +//历史记录详情 +export const RecordInfoApi = (data) => { + return http({ + method: 'POST', + url: '/api/coze/clickRecord', + data:data + }) +} + + + diff --git a/api/tcpConnection.js b/api/tcpConnection.js index 8975925..c31188e 100644 --- a/api/tcpConnection.js +++ b/api/tcpConnection.js @@ -6,7 +6,8 @@ */ // 引用TCP插件 -const TCPSocket = uni.requireNativePlugin("Aimer-TCPPlugin"); +const TCPSocket = uni.requireNativePlugin('Aimer-TCPPlugin'); +// const TCPSocket = uni.requireNativePlugin("Aimer-TCPPlugin"); // TCP连接配置 const TCP_CONFIG = { diff --git a/common/util.js b/common/util.js index 3fbc198..8ef5cb4 100644 --- a/common/util.js +++ b/common/util.js @@ -1,6 +1,6 @@ var util = {} util.data = {} -util.data.base_url = 'https://hwjb.homilychart.com/testApi' +util.data.base_url = 'https://dbqb.nfdxy.net/testApi' // util.data.base_url = 'https://dbqb.nfdxy.net/prodApi' // AJAX 请求方法 diff --git a/components/deepExploration_header.vue b/components/deepExploration_header.vue index a3e6fc3..daae53c 100644 --- a/components/deepExploration_header.vue +++ b/components/deepExploration_header.vue @@ -1,409 +1,508 @@ \ No newline at end of file diff --git a/pages/deepExploration/MainForceActions.vue b/pages/deepExploration/MainForceActions.vue index dafe118..f9e87fc 100644 --- a/pages/deepExploration/MainForceActions.vue +++ b/pages/deepExploration/MainForceActions.vue @@ -5,7 +5,7 @@ - @@ -69,6 +69,16 @@ import { onLoad } from '@dcloudio/uni-app' + import { + getModel1First, + getModel1Second, + getModel2First, + getModel2Second, + getModel3First, + getModel3Second, + getModel4First, + getModel4Second, + } from '/api/deepExploration/deepExploration.js' // 响应式变量定义 const type = ref('deepExploration') @@ -92,6 +102,29 @@ }, ]) + //搜索股票 + const searchStock = () => { + console.log('搜索参数:', stockName.value); + if (currentIndex.value == 0) { + handleModel(0) + } else if (currentIndex.value == 1) { + console.log(index); + handleModel(1) + } else if (currentIndex.value == 2) { + console.log(index); + handleModel(2) + } else if (currentIndex.value == 3) { + console.log(index); + handleModel(3) + }else{ + uni.showToast({ + title: '请选择模块', + icon: 'none', + duration: 2000 + }) + } + + } //点击四大模块 const handleModel = (index) => { currentIndex.value = index @@ -110,9 +143,42 @@ } } + const stockName = ref('') + const searchName = ref('') + const stockCode = ref('') + const language = ref('') + const recordId = ref('') + const parentId = ref('') + const stockId = ref('') //点击主力追踪 - const handleTrack = () => { - + const handleTrack = async () => { + try { + const result = await getModel1First({ + content: searchName.value, + language: "cn", + marketList: "hk,cn,usa,my,sg,vi,in,gb", + model: 1 + }) + console.log('result', result); + if (result.code == 200) { + stockCode.value = result.data.code + stockName.value = result.data.name + recordId.value = result.data.recordId + parentId.value = result.data.parentId + stockId.value = result.data.stockId + language.value = result.data.language + const res = await getModel1Second({ + language: language.value, + recordId: recordId.value, + parentId: parentId.value, + stockId: stockId.value + }) + console.log('res', res); + } + + } catch { + + } } //点击主力雷达 @@ -129,12 +195,7 @@ const handleCapitalFlow = () => { } - const stockName = ref('TSLA') - //搜索股票 - const searchStock = () => { - console.log('搜索参数:', stockName.value); - } // 1. K线图配置 const opts = ref({ @@ -733,4 +794,8 @@ width: 100%; } } + + * { + box-sizing: border-box; + } \ No newline at end of file diff --git a/pages/deepExploration/deepExploration.vue b/pages/deepExploration/deepExploration.vue index fd9eed3..57bd1aa 100644 --- a/pages/deepExploration/deepExploration.vue +++ b/pages/deepExploration/deepExploration.vue @@ -1,427 +1,460 @@ \ No newline at end of file diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index 685758b..7ca432a 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -316,7 +316,7 @@ const renderMarkdown = (content) => { return marked.parse(content); }; -const type = ref("member"); +const type = ref("deepMate"); const inputMessage = ref(""); const showThinking = ref(true); const isSending = ref(false); diff --git a/pages/setting/account.vue b/pages/setting/account.vue index 5dd5a60..d03f1d1 100644 --- a/pages/setting/account.vue +++ b/pages/setting/account.vue @@ -71,11 +71,16 @@ ref, onMounted } from 'vue' + + import {useUserStore} from "../../stores/modules/userInfo" const iSMT = ref(0) const jwcode = ref('90047681') const showLogout = ref(false) + const userStore = useUserStore() const handleConfirmLogout = () => { + + userStore.clearUserInfo() showLogout.value = false uni.showToast({ title: '退出登录成功', diff --git a/pages/start/Registration/Registration.vue b/pages/start/Registration/Registration.vue index b2cb182..e786964 100644 --- a/pages/start/Registration/Registration.vue +++ b/pages/start/Registration/Registration.vue @@ -197,8 +197,9 @@ import { SendEmailCodeApi, SendPhoneCodeApi, } from "../../../api/start/login"; +import { useDeviceStore} from "../../../stores/modules/deviceInfo" -const type = ref("member"); +const type = ref(""); const email = ref(""); const password = ref(""); const phone = ref(""); @@ -271,11 +272,14 @@ async function register() { const registerType = changeLoginType(); isLoading.value = true; + const deviceStore = useDeviceStore() + const res = await registerApi({ registerType: registerType, account: account, verifyCode: verifyCode.value, agree: agreed.value, + deviceId:deviceStore.deviceInfo.deviceId }); isLoading.value = false; diff --git a/pages/start/login/login.vue b/pages/start/login/login.vue index 5b19cf6..3c3f05d 100644 --- a/pages/start/login/login.vue +++ b/pages/start/login/login.vue @@ -266,9 +266,10 @@ import { } from "../../../api/start/login"; import { useUserStore } from "../../../stores/modules/userInfo"; +import { useDeviceStore } from "../../../stores/modules/deviceInfo"; const deepChartID = ref(""); -const type = ref("member"); +const type = ref(""); const email = ref(""); const password = ref(""); const country = ref("+86"); @@ -347,6 +348,8 @@ async function Login() { return; } + const deviceStore = useDeviceStore(); + const account = changeAccount(); const loginType = changeLoginType(); isLoading.value = true; @@ -357,6 +360,7 @@ async function Login() { password: password.value, useCode: verifyCode.value ? true : false, idToken: "", + deviceId: deviceStore.deviceInfo.deviceId, }); isLoading.value = false; @@ -815,7 +819,6 @@ function validatePhoneNumber(countryCode, phoneNumber) { } } - .back-btn, .headphone-btn { font-size: 36rpx; diff --git a/pages/start/recoverPassword/recoverPassword.vue b/pages/start/recoverPassword/recoverPassword.vue index ada6c57..1bdca81 100644 --- a/pages/start/recoverPassword/recoverPassword.vue +++ b/pages/start/recoverPassword/recoverPassword.vue @@ -237,7 +237,7 @@ import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-po import { verificationPhone, verificationEmail } from "../login/verification"; import { SendEmailCodeApi, SendPhoneCodeApi } from "../../../api/start/login"; -const type = ref("member"); +const type = ref(""); const email = ref(""); const password = ref(""); const newPasswordFirst = ref(""); diff --git a/pages/start/select/select.vue b/pages/start/select/select.vue index 7663375..6b9cd88 100644 --- a/pages/start/select/select.vue +++ b/pages/start/select/select.vue @@ -26,7 +26,7 @@ import footerBar from "../../../components/footerBar"; import { ref, reactive, toRefs, watch } from "vue"; -const type = ref("member"); +const type = ref(""); function toRegistration() { uni.redirectTo({ diff --git a/stores/index.js b/stores/index.js index 354b74d..ada9fd8 100644 --- a/stores/index.js +++ b/stores/index.js @@ -9,5 +9,6 @@ pinia.use(persist) // 导入所有模块 export * from './modules/userInfo' export * from './modules/deviceInfo' +export * from './modules/deepExploration' // 默认导出,给 main.js 使用 export default pinia \ No newline at end of file diff --git a/stores/modules/deepExploration.js b/stores/modules/deepExploration.js new file mode 100644 index 0000000..d326807 --- /dev/null +++ b/stores/modules/deepExploration.js @@ -0,0 +1,44 @@ +import { defineStore } from 'pinia' +import { ref } from 'vue' + +// 定义 Store +export const useDeepExplorationStore = defineStore( + 'deepExploration', + () => { + // 会员信息 + const deepExplorationInfo = ref() + + // 保存会员信息,登录时使用 + const setDeepExplorationInfo = (val) => { + deepExplorationInfo.value = val + } + + // 清理会员信息,退出时使用 + const clearDeepExplorationInfo = () => { + deepExplorationInfo.value = undefined + } + + // 记得 return + return { + deepExplorationInfo, + setDeepExplorationInfo, + clearDeepExplorationInfo, + } + }, + // TODO: 持久化 + { + // 网页端持久化 + // persist: true, + // 小程序端持久化 + persist: { + storage: { + getItem(key) { + return uni.getStorageSync(key) + }, + setItem(key, value) { + uni.setStorageSync(key, value) + }, + }, + }, + }, +) diff --git a/utils/http.js b/utils/http.js index f1e7714..69d672f 100644 --- a/utils/http.js +++ b/utils/http.js @@ -1,7 +1,7 @@ import { useUserStore } from "../stores/modules/userInfo" import { useDeviceStore } from "../stores/modules/deviceInfo" -const baseURL = "https://hwjb.homilychart.com/testApi" +const baseURL = "https://dbqb.nfdxy.net/testApi" const httpInterceptor = { @@ -30,21 +30,20 @@ const httpInterceptor = { const deviceInfo =useDeviceStore() - const client = 'ios'; + options.header = { ...options.header, - 'source-client': 'miniapp', // 标准头与文档头同时设置,确保兼容 'content-type': 'application/json', 'contentType': 'application/json', - 'version': '1', - 'client': client, - 'deviceId': deviceInfo.deviceId + 'version': uni.getSystemInfoSync().appVersion, + 'client': uni.getSystemInfoSync().platform == 'ios' ? 'ios' : 'android', + 'deviceId': deviceInfo.deviceInfo.deviceId } //4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致 const memberStore = useUserStore() const token = memberStore.userInfo?.token || options.data?.token - // const token = 'dccec0b65a94f498b8183a17589ab16e' + // const token = '1b3a58424c5324e40d4bf4d085e18047' if (token) { options.header.token = token }