Browse Source

Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into dongqian/feature-20251022181325-deepmate简版

dongqian/feature-20251022181325-deepmate简版
dongqian 4 weeks ago
parent
commit
62ab22e3d4
  1. 84
      api/deepExploration/deepExploration.js
  2. 2
      api/tcpConnection.js
  3. 2
      common/util.js
  4. 68
      components/deepExploration_header.vue
  5. 76
      pages/deepExploration/MainForceActions.vue
  6. 149
      pages/deepExploration/deepExploration.vue
  7. 1
      stores/index.js
  8. 44
      stores/modules/deepExploration.js
  9. 9
      utils/http.js

84
api/deepExploration/deepExploration.js

@ -1,11 +1,76 @@
import { http } from '@/utils/http.js' import { http } from '@/utils/http.js'
//点击主力追踪
export const getModel1 = () => {
//主力追踪意图
export const getModel1First = (data) => {
return http({ return http({
method: 'GET',
method: 'POST',
url: '/api/coze/trackingFirst', 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
}) })
} }
@ -28,3 +93,16 @@ export const stocSelectApi = (data) => {
}) })
} }
//历史记录详情
export const RecordInfoApi = (data) => {
return http({
method: 'POST',
url: '/api/coze/clickRecord',
data:data
})
}

2
api/tcpConnection.js

@ -6,7 +6,7 @@
*/ */
// 引用TCP插件 // 引用TCP插件
// const TCPSocket = uni.requireNativePlugin('Aimer-TCPPlugin');
const TCPSocket = uni.requireNativePlugin('Aimer-TCPPlugin');
// const TCPSocket = uni.requireNativePlugin("Aimer-TCPPlugin"); // const TCPSocket = uni.requireNativePlugin("Aimer-TCPPlugin");
// TCP连接配置 // TCP连接配置

2
common/util.js

@ -1,6 +1,6 @@
var util = {} var util = {}
util.data = {} 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' // util.data.base_url = 'https://dbqb.nfdxy.net/prodApi'
// AJAX 请求方法 // AJAX 请求方法

68
components/deepExploration_header.vue

@ -84,8 +84,12 @@
</template> </template>
<script setup> <script setup>
import { RecordListApi } from "../api/deepExploration/deepExploration";
import {
RecordListApi,
RecordInfoApi,
} from "../api/deepExploration/deepExploration";
import { ref, onMounted, computed } from "vue"; import { ref, onMounted, computed } from "vue";
import { useDeepExplorationStore } from "../stores/modules/deepExploration";
const props = defineProps({ const props = defineProps({
name: { name: {
@ -144,53 +148,21 @@ const onDrawerBackClick = () => {
// //
async function itemClick(item) { async function itemClick(item) {
// const res = await postHistoryDetail({
// recordId: item.id,
// parentId: item.parentId,
// model: 5,
// });
// if (res.code == 200) {
// const message = res.data.wokeFlowData.One.markdown;
// messages.value = [];
// const botMsg = {
// content: message,
// isUser: false,
// isTyping: false,
// isThinking: false,
// };
// messages.value.push(botMsg);
// }
}
const historyList = ref([
{
title: "今天", //
items: [
{
icon: "/static/deepExploration-images/Americle.png",
stockName: "TechCore", //
stockCode: "600001", // 6
createdTime: "14:35", // :
},
{
icon: "/static/deepExploration-images/Americle.png",
stockName: "MediaLink",
stockCode: "600002",
createdTime: "10:12",
},
],
},
{
title: "昨天",
items: [
{
icon: "/static/deepExploration-images/Americle.png",
stockName: "FinServ",
stockCode: "600003",
createdTime: "09:48",
},
],
},
]);
const res = await RecordInfoApi({
recordId: item.id,
parentId: item.parentId,
model: 5,
});
if (res.code == 200) {
const message = res.data;
const deepExplorationStore = useDeepExplorationStore();
deepExplorationStore.setDeepExplorationInfo(message);
onDrawerBackClick();
console.log(deepExplorationStore.deepExplorationInfo);
}
}
const historyList = ref([]);
// YYYY-MM-DD HH:mm // YYYY-MM-DD HH:mm
const formatTimeForHistory = (timeString) => { const formatTimeForHistory = (timeString) => {

76
pages/deepExploration/MainForceActions.vue

@ -5,7 +5,7 @@
<deepExploration_header></deepExploration_header> <deepExploration_header></deepExploration_header>
<view class="search"> <view class="search">
<input v-model="stockName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
<input v-model="searchName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
placeholder-style="color: #A6A6A6; font-size: 22rpx;" /> placeholder-style="color: #A6A6A6; font-size: 22rpx;" />
<image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png" <image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png"
mode="aspectFill"></image> mode="aspectFill"></image>
@ -69,6 +69,16 @@
import { import {
onLoad onLoad
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import {
getModel1First,
getModel1Second,
getModel2First,
getModel2Second,
getModel3First,
getModel3Second,
getModel4First,
getModel4Second,
} from '/api/deepExploration/deepExploration.js'
// //
const type = ref('deepExploration') 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) => { const handleModel = (index) => {
currentIndex.value = index currentIndex.value = index
@ -110,10 +143,43 @@
} }
} }
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 {
} }
}
// //
const handleRadar = () => { const handleRadar = () => {
@ -129,12 +195,7 @@
const handleCapitalFlow = () => { const handleCapitalFlow = () => {
} }
const stockName = ref('TSLA')
//
const searchStock = () => {
console.log('搜索参数:', stockName.value);
}
// 1. K线 // 1. K线
const opts = ref({ const opts = ref({
@ -733,6 +794,7 @@
width: 100%; width: 100%;
} }
} }
* { * {
box-sizing: border-box; box-sizing: border-box;
} }

149
pages/deepExploration/deepExploration.vue

@ -3,30 +3,56 @@
<!-- 顶部状态栏占位 --> <!-- 顶部状态栏占位 -->
<view class="top" :style="{ height: iSMT + 'px' }"></view> <view class="top" :style="{ height: iSMT + 'px' }"></view>
<!-- 标题图标部分 --> <!-- 标题图标部分 -->
<deepExploration_header></deepExploration_header>
<deepExploration_header
></deepExploration_header>
<view class="search"> <view class="search">
<input v-model="stockName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
placeholder-style="color: #A6A6A6; font-size: 22rpx;" />
<image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png"
mode="aspectFill"></image>
<input
v-model="stockName"
class="searchInput"
type="text"
placeholder="请输入股票名称、股票代码"
placeholder-style="color: #A6A6A6; font-size: 22rpx;"
/>
<image
@click="searchStock"
class="seachIcon"
src="/static/deepExploration-images/search.png"
mode="aspectFill"
></image>
</view> </view>
<!-- 四大功能模块 --> <!-- 四大功能模块 -->
<view class="select"> <view class="select">
<view class="selectItem" @click="toMain('主力追踪')"> <view class="selectItem" @click="toMain('主力追踪')">
<image class="img" src="/static/deepExploration-images/icon3.png" mode="aspectFill"></image>
<image
class="img"
src="/static/deepExploration-images/icon3.png"
mode="aspectFill"
></image>
<view class="txt">主力追踪</view> <view class="txt">主力追踪</view>
</view> </view>
<view class="selectItem" @click="toMain('主力雷达')"> <view class="selectItem" @click="toMain('主力雷达')">
<image class="img" src="/static/deepExploration-images/icon2.png" mode="aspectFill"></image>
<image
class="img"
src="/static/deepExploration-images/icon2.png"
mode="aspectFill"
></image>
<view class="txt">主力雷达</view> <view class="txt">主力雷达</view>
</view> </view>
<view class="selectItem" @click="toMain('主力解码')"> <view class="selectItem" @click="toMain('主力解码')">
<image class="img" src="/static/deepExploration-images/icon1.png" mode="aspectFill"></image>
<image
class="img"
src="/static/deepExploration-images/icon1.png"
mode="aspectFill"
></image>
<view class="txt">主力解码</view> <view class="txt">主力解码</view>
</view> </view>
<view class="selectItem" @click="toMain('主力资金流')"> <view class="selectItem" @click="toMain('主力资金流')">
<image class="img" src="/static/deepExploration-images/icon4.png" mode="aspectFill"></image>
<image
class="img"
src="/static/deepExploration-images/icon4.png"
mode="aspectFill"
></image>
<view class="txt">主力资金流</view> <view class="txt">主力资金流</view>
</view> </view>
</view> </view>
@ -39,7 +65,7 @@
<view class="txt"> <view class="txt">
<text>选股策略</text> <text>选股策略</text>
</view> </view>
<view class="viewAll" @click='viewAll'>
<view class="viewAll" @click="viewAll">
<text>查看全部</text> <text>查看全部</text>
</view> </view>
</view> </view>
@ -48,14 +74,19 @@
<view class="selectionItem"> <view class="selectionItem">
<view class="header"> <view class="header">
<view class="left"> <view class="left">
<image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
<image
src="/static/deepExploration-images/plus.png"
mode="aspectFill"
></image>
<text>抄底卖顶</text> <text>抄底卖顶</text>
</view> </view>
<view class="right"> <view class="right">
<image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
<image
src="/static/deepExploration-images/Americle.png"
mode="aspectFill"
></image>
<text>美股</text> <text>美股</text>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="contentTitle"> <view class="contentTitle">
@ -78,11 +109,17 @@
<view class="selectionItem"> <view class="selectionItem">
<view class="header"> <view class="header">
<view class="left"> <view class="left">
<image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
<image
src="/static/deepExploration-images/plus.png"
mode="aspectFill"
></image>
<text>抄底卖顶</text> <text>抄底卖顶</text>
</view> </view>
<view class="right"> <view class="right">
<image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
<image
src="/static/deepExploration-images/Americle.png"
mode="aspectFill"
></image>
<text>美股</text> <text>美股</text>
</view> </view>
</view> </view>
@ -116,39 +153,68 @@
import deepExploration_header from '@/components/deepExploration_header.vue' import deepExploration_header from '@/components/deepExploration_header.vue'
import { stocSelectApi } from '@/api/deepExploration/deepExploration.js' import { stocSelectApi } from '@/api/deepExploration/deepExploration.js'
const type = ref('deepExploration')
const iSMT = ref(0)
const type = ref("deepExploration");
const iSMT = ref(0);
// //
const toMain = (val) => { const toMain = (val) => {
if (val == '主力追踪') {
if (val == "主力追踪") {
uni.navigateTo({ uni.navigateTo({
url: '/pages/deepExploration/MainForceActions?index=1'
})
} else if (val == '主力雷达') {
url: "/pages/deepExploration/MainForceActions?index=1",
});
} else if (val == "主力雷达") {
uni.navigateTo({ uni.navigateTo({
url: '/pages/deepExploration/MainForceActions?index=2'
})
} else if (val == '主力解码') {
url: "/pages/deepExploration/MainForceActions?index=2",
});
} else if (val == "主力解码") {
uni.navigateTo({ uni.navigateTo({
url: '/pages/deepExploration/MainForceActions?index=3'
})
} else if (val == '主力资金流') {
url: "/pages/deepExploration/MainForceActions?index=3",
});
} else if (val == "主力资金流") {
uni.navigateTo({ uni.navigateTo({
url: '/pages/deepExploration/MainForceActions?index=4'
})
url: "/pages/deepExploration/MainForceActions?index=4",
});
} }
};
}
const stockName = ref('')
const stockName = ref("");
// //
const searchStock = () => { const searchStock = () => {
console.log('搜索参数:', stockName.value);
console.log("搜索参数:", stockName.value);
uni.navigateTo({ uni.navigateTo({
url: `/pages/deepExploration/MainForceActions?stockName=${stockName.value}`
})
}
url: `/pages/deepExploration/MainForceActions?stockName=${stockName.value}`,
});
};
//
const viewAll = () => {
uni.navigateTo({
url: "/pages/deepExploration/stockSelectDetail",
});
};
//
const stockData = [
{
name: "(MKTW)MarketWise Inc",
close: "$14.190",
select: "$13.180",
},
{
name: "(MTCH)Match Group Inc",
close: "$32.120",
select: "$28.120",
},
{
name: "(MKTW)MarketWise Inc",
close: "$14.190",
select: "$13.180",
},
];
onMounted(() => {
//
iSMT.value = uni.getSystemInfoSync().statusBarHeight;
});
// //
const viewAll = () => { const viewAll = () => {
@ -215,7 +281,7 @@
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #F3F3F3;
background-color: #f3f3f3;
width: calc(100% - 60rpx); width: calc(100% - 60rpx);
height: 80rpx; height: 80rpx;
border-radius: 50rpx; border-radius: 50rpx;
@ -266,7 +332,7 @@
.gap { .gap {
width: 100%; width: 100%;
height: 15rpx; height: 15rpx;
background-color: #F3F3F3;
background-color: #f3f3f3;
} }
.stockSelection { .stockSelection {
@ -302,7 +368,7 @@
.stockSelection_content { .stockSelection_content {
.selectionItem { .selectionItem {
background-color: #F3F3F3;
background-color: #f3f3f3;
padding: 30rpx 15rpx 17rpx 30rpx; padding: 30rpx 15rpx 17rpx 30rpx;
border-radius: 30rpx; border-radius: 30rpx;
margin-top: 30rpx; margin-top: 30rpx;
@ -341,7 +407,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-radius: 15rpx; border-radius: 15rpx;
background-color: #FFFFFF;
background-color: #ffffff;
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
image { image {
@ -389,7 +455,6 @@
width: 120rpx; width: 120rpx;
margin-left: 60rpx; margin-left: 60rpx;
} }
} }
.contentItem { .contentItem {
@ -437,9 +502,7 @@
} }
} }
} }
} }
} }
.static-footer { .static-footer {

1
stores/index.js

@ -9,5 +9,6 @@ pinia.use(persist)
// 导入所有模块 // 导入所有模块
export * from './modules/userInfo' export * from './modules/userInfo'
export * from './modules/deviceInfo' export * from './modules/deviceInfo'
export * from './modules/deepExploration'
// 默认导出,给 main.js 使用 // 默认导出,给 main.js 使用
export default pinia export default pinia

44
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)
},
},
},
},
)

9
utils/http.js

@ -1,7 +1,7 @@
import { useUserStore } from "../stores/modules/userInfo" import { useUserStore } from "../stores/modules/userInfo"
import { useDeviceStore } from "../stores/modules/deviceInfo" import { useDeviceStore } from "../stores/modules/deviceInfo"
const baseURL = "https://hwjb.homilychart.com/testApi"
const baseURL = "https://dbqb.nfdxy.net/testApi"
const httpInterceptor = { const httpInterceptor = {
@ -30,15 +30,14 @@ const httpInterceptor = {
const deviceInfo =useDeviceStore() const deviceInfo =useDeviceStore()
const client = 'ios';
options.header = { options.header = {
...options.header, ...options.header,
'source-client': 'miniapp',
// 标准头与文档头同时设置,确保兼容 // 标准头与文档头同时设置,确保兼容
'content-type': 'application/json', 'content-type': 'application/json',
'contentType': 'application/json', 'contentType': 'application/json',
'version': '1',
'client': client,
'version': uni.getSystemInfoSync().appVersion,
'client': uni.getSystemInfoSync().platform == 'ios' ? 'ios' : 'android',
'deviceId': deviceInfo.deviceInfo.deviceId 'deviceId': deviceInfo.deviceInfo.deviceId
} }
//4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致 //4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致

Loading…
Cancel
Save