You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

408 lines
8.1 KiB

4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
  1. <template>
  2. <view class="titleContent">
  3. <view class="left">
  4. <uni-icons @click="handleBack" type="back" size="23" color="#111"></uni-icons>
  5. </view>
  6. <view class="title">深度探索</view>
  7. <view class="right">
  8. <image class="notice" src="/static/deepExploration-images/notice.png" mode="aspectFill"></image>
  9. <image @click="handleHistory" class="history" src="/static/deepExploration-images/history.png"
  10. mode="aspectFill"></image>
  11. </view>
  12. </view>
  13. <view class="drawer-overlay" v-show="showHistoryDrawer"></view>
  14. <view class="drawer-panel" v-show="showHistoryDrawer" @click.stop @touchmove.stop.prevent
  15. :style="{ transform: 'translateY(' + drawerOffsetY + 'px)' }">
  16. <view class="drawer-header">
  17. <text class="drawer-title">历史对话</text>
  18. <view class="drawer-actions">
  19. <view class="delete-all-container">
  20. <image class="delete-icon" src="/static/deepExploration-images/delete.png"></image>
  21. <text class="delete-all" @click="clearAllHistory">删除全部</text>
  22. </view>
  23. <view class="drawer-close" @click="closeHistoryDrawer">
  24. <image src="/static/deepExploration-images/close.png" mode="aspectFill"></image>
  25. </view>
  26. </view>
  27. </view>
  28. <scroll-view scroll-y="true" class="drawer-content">
  29. <view class="drawer-inner">
  30. <view v-if="historyList.length === 0" class="empty-history">
  31. <text>暂无历史记录</text>
  32. </view>
  33. <view v-for="(section, sIdx) in historyList" :key="sIdx" class="history-section">
  34. <text class="section-title">{{ section.title }}</text>
  35. <view v-for="(item, idx) in section.items" :key="idx" class="history-item">
  36. <view class="history-left">
  37. <view class="flag-circle">
  38. <image :src="item.icon" mode="aspectFill"></image>
  39. </view>
  40. </view>
  41. <view class="history-main" @click="itemClick(item)">
  42. <text class="history-query">{{ item.stockName }}</text>
  43. <text class="history-query">{{ item.stockCode }}</text>
  44. </view>
  45. <text class="history-time">{{ item.createdTime }}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </scroll-view>
  50. </view>
  51. </template>
  52. <script setup>
  53. import {
  54. ref,
  55. onMounted
  56. } from 'vue'
  57. const props = defineProps({
  58. name: {
  59. type: String,
  60. default: ''
  61. }
  62. })
  63. const showHistoryDrawer = ref(false)
  64. const drawerOffsetY = ref(0);
  65. const handleHistory = () => {
  66. showHistoryDrawer.value = true
  67. }
  68. const clearAllHistory = () => {
  69. uni.setStorageSync("search_history", []);
  70. };
  71. //返回上一页
  72. const handleBack = ()=>{
  73. uni.navigateBack()
  74. }
  75. const closeHistoryDrawer = () => {
  76. showHistoryDrawer.value = false;
  77. };
  78. // const onDrawerBackClick = () => {
  79. // const hideDistance = uni.upx2px(900);
  80. // drawerOffsetY.value = hideDistance;
  81. // setTimeout(() => {
  82. // closeHistoryDrawer();
  83. // drawerOffsetY.value = 0;
  84. // }, 180);
  85. // };
  86. // 历史记录详情
  87. async function itemClick(item) {
  88. // const res = await postHistoryDetail({
  89. // recordId: item.id,
  90. // parentId: item.parentId,
  91. // model: 5,
  92. // });
  93. // if (res.code == 200) {
  94. // const message = res.data.wokeFlowData.One.markdown;
  95. // messages.value = [];
  96. // const botMsg = {
  97. // content: message,
  98. // isUser: false,
  99. // isTyping: false,
  100. // isThinking: false,
  101. // };
  102. // messages.value.push(botMsg);
  103. // }
  104. }
  105. const historyList = ref([{
  106. title: "今天", // 分组标题(如“今天”“昨天”“更早”)
  107. items: [{
  108. icon: '/static/deepExploration-images/Americle.png',
  109. stockName: "TechCore", // 股票名称
  110. stockCode: "600001", // 6位数字股票代码
  111. createdTime: "14:35" // 时间格式(时:分)
  112. },
  113. {
  114. icon: '/static/deepExploration-images/Americle.png',
  115. stockName: "MediaLink",
  116. stockCode: "600002",
  117. createdTime: "10:12"
  118. }
  119. ]
  120. },
  121. {
  122. title: "昨天",
  123. items: [{
  124. icon: '/static/deepExploration-images/Americle.png',
  125. stockName: "FinServ",
  126. stockCode: "600003",
  127. createdTime: "09:48"
  128. }]
  129. }
  130. ]);
  131. onMounted(() => {
  132. })
  133. </script>
  134. <style scoped lang="scss">
  135. * {
  136. box-sizing: border-box;
  137. }
  138. .titleContent {
  139. display: flex;
  140. align-items: center;
  141. justify-content: space-between;
  142. padding: 30rpx 60rpx 40rpx 35rpx;
  143. box-shadow: 2rpx 2rpx 8rpx rgba(0, 0, 0, 0.1);
  144. .left {
  145. display: flex;
  146. align-items: center;
  147. width: 36rpx;
  148. height: 36rpx;
  149. }
  150. .title {
  151. position: absolute;
  152. left: 50%;
  153. transform: translateX(-50%);
  154. color: #000000;
  155. font-family: "PingFang SC";
  156. font-size: 19px;
  157. font-style: normal;
  158. font-weight: 400;
  159. line-height: 25px;
  160. }
  161. .right {
  162. display: flex;
  163. align-items: center;
  164. gap: 20rpx;
  165. .notice {
  166. width: 35rpx;
  167. height: 35rpx;
  168. gap: 20rpx;
  169. }
  170. .history {
  171. width: 32rpx;
  172. height: 32rpx;
  173. align-items: center;
  174. }
  175. }
  176. }
  177. /* 搜索历史侧拉框样式 */
  178. .drawer-overlay {
  179. position: fixed;
  180. left: 0;
  181. top: 0;
  182. right: 0;
  183. bottom: 0;
  184. background-color: rgba(0, 0, 0, 0.35);
  185. z-index: 900;
  186. }
  187. .drawer-panel {
  188. position: fixed;
  189. left: 0;
  190. right: 0;
  191. bottom: 0;
  192. height: 75vh;
  193. max-height: 80vh;
  194. width: 100%;
  195. background: #ffffff;
  196. box-shadow: 0 -8rpx 20rpx rgba(0, 0, 0, 0.06);
  197. z-index: 1000;
  198. display: flex;
  199. flex-direction: column;
  200. border-top-left-radius: 20rpx;
  201. border-top-right-radius: 20rpx;
  202. transition: transform 0.22s ease;
  203. }
  204. .drawer-back {
  205. position: absolute;
  206. left: 50%;
  207. top: -14px;
  208. transform: translateX(-50%);
  209. width: 28px;
  210. height: 48px;
  211. border-radius: 12px;
  212. background: #fff;
  213. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. }
  218. .drawer-back-icon {
  219. font-size: 16px;
  220. color: #8a8a8a;
  221. }
  222. .drawer-actions {
  223. display: flex;
  224. align-items: center;
  225. gap: 40rpx;
  226. }
  227. .delete-all-container {
  228. display: flex;
  229. align-items: center;
  230. gap: 14rpx;
  231. }
  232. .delete-icon {
  233. width: 28rpx;
  234. height: 32rpx;
  235. }
  236. .delete-all {
  237. font-size: 28rpx;
  238. }
  239. .drawer-close {
  240. width: 48rpx;
  241. height: 48rpx;
  242. border-radius: 24rpx;
  243. /* background: #f5f5f5; */
  244. /* box-shadow: 0 2px 8px rgba(0,0,0,0.08); */
  245. display: flex;
  246. align-items: center;
  247. justify-content: center;
  248. image {
  249. width: 100%;
  250. height: 100%;
  251. }
  252. }
  253. .drawer-header {
  254. display: flex;
  255. align-items: center;
  256. justify-content: space-between;
  257. padding: 52rpx 28rpx 0rpx 28rpx;
  258. /* border-bottom: 2rpx solid #f0f0f0; */
  259. }
  260. .drawer-title {
  261. font-size: 32rpx;
  262. font-weight: 600;
  263. color: #333333;
  264. }
  265. .drawer-content {
  266. flex: 1;
  267. min-height: 0;
  268. /* 让 flex 子元素可在容器内收缩以启用滚动 */
  269. height: 100%;
  270. overscroll-behavior-y: contain;
  271. /* 防止滚动串联到页面 */
  272. -webkit-overflow-scrolling: touch;
  273. /* iOS 惯性滚动 */
  274. touch-action: pan-y;
  275. /* 优化触控滚动,仅垂直 */
  276. }
  277. .drawer-inner {
  278. padding: 20rpx 24rpx 20rpx 24rpx;
  279. }
  280. .history-section {
  281. margin-bottom: 20rpx;
  282. /* margin: 0 24rpx; */
  283. }
  284. .section-title {
  285. font-size: 26rpx;
  286. color: #888;
  287. margin: 10rpx 6rpx 16rpx;
  288. }
  289. .history-item {
  290. display: flex;
  291. align-items: center;
  292. padding: 19rpx 18rpx;
  293. background-color: #f6f7f9;
  294. border-radius: 12rpx;
  295. margin-bottom: 12rpx;
  296. }
  297. .history-left {
  298. margin-right: 20rpx;
  299. width: 50rpx;
  300. height: 50rpx;
  301. }
  302. .flag-circle {
  303. width: 50rpx;
  304. height: 50rpx;
  305. border-radius: 50%;
  306. background: #fff;
  307. border: 2rpx solid #eee;
  308. display: flex;
  309. align-items: center;
  310. justify-content: center;
  311. image{
  312. width: 50rpx;
  313. height: 50rpx;
  314. border-radius: 50%;
  315. }
  316. }
  317. .history-main {
  318. flex: 1;
  319. }
  320. .history-query {
  321. color: #000000;
  322. text-align: center;
  323. font-size: 24rpx;
  324. font-weight: 400;
  325. line-height: 40rpx;
  326. }
  327. .history-time {
  328. font-size: 22rpx;
  329. color: #999;
  330. }
  331. .history-card {
  332. background-color: #fff;
  333. border: 2rpx solid #f2f2f2;
  334. border-left: 8rpx solid rgb(220, 31, 29);
  335. border-radius: 12rpx;
  336. padding: 18rpx 20rpx;
  337. margin-bottom: 16rpx;
  338. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.03);
  339. }
  340. .history-query {
  341. font-size: 28rpx;
  342. color: #333333;
  343. font-weight: 500;
  344. }
  345. .history-time {
  346. margin-top: 8rpx;
  347. font-size: 22rpx;
  348. color: #888888;
  349. }
  350. .empty-history {
  351. padding: 40rpx;
  352. color: #999999;
  353. text-align: center;
  354. }
  355. </style>