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.

309 lines
5.5 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="deepmate">
  3. <view class="deepmate-container">
  4. <view class="deepmate-header">
  5. <view class="title-container">
  6. <view class="title-left">
  7. <text class="deepmate-title">DeepMate</text>
  8. <text class="deepmate-subtitle">您的市场最佳顾问~</text>
  9. </view>
  10. <view class="title-right">
  11. <image class="deepmate-icon" src="https://d31zlh4on95l9h.cloudfront.net/images/7faa683450cc071bcc746fea8191ff6b.png" mode="aspectFit"></image>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="deepmate-content">
  16. <view class="deepmate-hotspots">
  17. <view class="deepmate-question">
  18. <text class="question-text">今日股票策略晨报</text>
  19. </view>
  20. <view class="hotspot-item">
  21. <text>热门股票分析</text>
  22. </view>
  23. <view class="hotspot-item">
  24. <text>行业趋势预测</text>
  25. </view>
  26. <view class="hotspot-item">
  27. <text>市场风险提示</text>
  28. </view>
  29. <view class="hotspot-item">
  30. <text>投资策略建议</text>
  31. </view>
  32. <view class="hotspot-item">
  33. <text>财经新闻解读</text>
  34. </view>
  35. </view>
  36. <view class="deepmate-action">
  37. <input
  38. class="stock-input"
  39. type="text"
  40. placeholder="请输入股票代码/名称,获取AI洞察"
  41. placeholder-style="color:#fff;opacity:1"
  42. v-model="inputValue"
  43. @confirm="handleSend"
  44. />
  45. <view class="send-button-container" @click="handleSend">
  46. <image class="send-button" src="https://d31zlh4on95l9h.cloudfront.net/images/3da018821a5c82b06a1d6ddc81b960ac.png" mode="aspectFit"></image>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. name: 'DeepMate',
  56. data() {
  57. return {
  58. inputValue: ''
  59. }
  60. },
  61. methods: {
  62. handleSend() {
  63. // 检查输入是否为空
  64. if (!this.inputValue.trim()) {
  65. uni.showToast({
  66. title: '请输入股票代码或名称',
  67. icon: 'none',
  68. duration: 2000
  69. })
  70. return
  71. }
  72. // 跳转到deepMate页面,并传递输入的内容
  73. uni.navigateTo({
  74. url: `/pages/deepMate/deepMate?query=${encodeURIComponent(this.inputValue.trim())}`
  75. })
  76. // 清空输入框
  77. this.inputValue = ''
  78. }
  79. }
  80. }
  81. </script>
  82. <style>
  83. /* DeepMate样式 */
  84. .deepmate-container {
  85. background-color: #ffe6e6;
  86. border-radius: 10px;
  87. padding: 15px 15px 15px 15px;
  88. margin: 0;
  89. width: 100%;
  90. box-sizing: border-box;
  91. overflow: hidden;
  92. }
  93. .deepmate-header {
  94. margin-bottom: 10px;
  95. }
  96. .title-container {
  97. display: flex;
  98. align-items: center;
  99. justify-content: space-between;
  100. width: 100%;
  101. }
  102. .title-left {
  103. width: 50%;
  104. display: flex;
  105. flex-direction: column;
  106. }
  107. .title-right {
  108. width: 50%;
  109. display: flex;
  110. justify-content: center;
  111. align-items: center;
  112. }
  113. .deepmate-title {
  114. font-size: 18px;
  115. font-weight: bold;
  116. color: #ff4d4f;
  117. display: block;
  118. }
  119. .deepmate-icon {
  120. width: 50px;
  121. height: 50px;
  122. margin-left: 0;
  123. }
  124. .deepmate-subtitle {
  125. font-size: 12px;
  126. color: #666;
  127. display: block;
  128. margin-top: 5px;
  129. }
  130. .deepmate-hotspots {
  131. margin: 10px 0;
  132. background-color: #ffffff;
  133. border-radius: 10px;
  134. padding: 10px;
  135. }
  136. .deepmate-question {
  137. display: flex;
  138. align-items: center;
  139. margin-bottom: 10px;
  140. padding-left: 10px;
  141. position: relative;
  142. }
  143. .deepmate-question:before {
  144. content: "";
  145. position: absolute;
  146. left: 0;
  147. top: 0;
  148. bottom: 0;
  149. width: 4px;
  150. background-color: #ff4d4f;
  151. border-radius: 2px;
  152. }
  153. .question-text {
  154. font-size: 16px;
  155. font-weight: bold;
  156. color: #333;
  157. }
  158. .hotspot-item {
  159. background-color: #f5f5f5;
  160. padding: 8px 12px;
  161. border-radius: 6px;
  162. margin-bottom: 8px;
  163. }
  164. .hotspot-item text {
  165. font-size: 14px;
  166. color: #333;
  167. }
  168. .deepmate-action {
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. background-color: #ff4d4f;
  173. padding: 8px 15px;
  174. border-radius: 25px;
  175. margin-top: 10px;
  176. border: none;
  177. }
  178. .stock-input {
  179. flex: 1;
  180. height: 36px;
  181. font-size: 13px;
  182. color: #ffffff;
  183. padding: 0 8px;
  184. border: none;
  185. background-color: transparent;
  186. min-width: 0;
  187. overflow: hidden;
  188. text-overflow: ellipsis;
  189. white-space: nowrap;
  190. }
  191. /* .stock-input::placeholder {
  192. color: rgba(255, 255, 255, 0.8);
  193. } */
  194. .send-button-container {
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. width: 36px;
  199. height: 36px;
  200. background-color: #ffffff;
  201. border-radius: 50%;
  202. margin-left: 10px;
  203. }
  204. .send-button {
  205. width: 20px;
  206. height: 20px;
  207. }
  208. .icon-container {
  209. position: relative;
  210. width: 50px;
  211. height: 50px;
  212. border-radius: 50%;
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. background-color: #f0f8ff;
  217. }
  218. .deepmate-icon {
  219. width: 40px;
  220. height: 40px;
  221. border-radius: 50%;
  222. }
  223. .ripple-effect {
  224. position: absolute;
  225. border-radius: 50%;
  226. background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, rgba(255, 0, 0, 0.1) 70%);
  227. animation-name: ripple;
  228. animation-duration: 3s;
  229. animation-timing-function: ease-out;
  230. animation-iteration-count: infinite;
  231. }
  232. .ripple-1 {
  233. width: 100%;
  234. height: 100%;
  235. animation-delay: 0s;
  236. }
  237. .ripple-2 {
  238. width: 100%;
  239. height: 100%;
  240. animation-delay: 1s;
  241. }
  242. .ripple-3 {
  243. width: 100%;
  244. height: 100%;
  245. animation-delay: 2s;
  246. }
  247. @keyframes ripple {
  248. 0% {
  249. transform: scale(0.8);
  250. opacity: 1;
  251. }
  252. 100% {
  253. transform: scale(1.5);
  254. opacity: 0;
  255. }
  256. }
  257. /* 小屏幕设备优化 */
  258. @media screen and (max-width: 375px) {
  259. .stock-input {
  260. font-size: 12px;
  261. padding: 0 6px;
  262. }
  263. .deepmate-action {
  264. padding: 6px 12px;
  265. }
  266. }
  267. /* 超小屏幕设备优化 */
  268. @media screen and (max-width: 320px) {
  269. .stock-input {
  270. font-size: 11px;
  271. padding: 0 4px;
  272. }
  273. .deepmate-action {
  274. padding: 5px 10px;
  275. }
  276. }
  277. </style>