From a942eef02e0b83ce427ca0f7c2776d6939c4e5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Thu, 30 Oct 2025 11:47:01 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E8=82=A1=E7=A5=A8=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E5=92=8C=E6=B6=A8=E8=B7=8C=E5=B9=85=E6=B0=B4=E5=B9=B3=E5=88=86?= =?UTF-8?q?=E5=B8=83=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/customStockList/customStockList.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/customStockList/customStockList.vue b/pages/customStockList/customStockList.vue index 348f18e..ad96b5f 100644 --- a/pages/customStockList/customStockList.vue +++ b/pages/customStockList/customStockList.vue @@ -74,7 +74,7 @@ {{ stock.price || '--' }} - {{ stock.change >= 0 ? '+' : '' }}{{ stock.change || '--' }} + {{ stock.change >= 0 ? '+' : '-' }}{{ stock.change || '--' }} @@ -448,15 +448,15 @@ .stock-price { display: flex; - flex-direction: column; - align-items: flex-end; + flex-direction: row; + align-items: center; + gap: 8px; } .price { font-size: 16px; font-weight: 500; color: #333333; - margin-bottom: 4px; } .change { From d8f3f8e2f006737c7d57e4912d0a31101d1ef938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Thu, 30 Oct 2025 13:07:06 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=81=87=E7=9A=84?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=82=A1=E7=A5=A8=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=9B=E5=A2=9E=E5=8A=A0=E9=80=89=E4=B8=AD=E8=82=A1=E7=A5=A8?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=9B=E6=96=B0=E5=A2=9E=E5=BA=95?= =?UTF-8?q?=E9=83=A8=E6=93=8D=E4=BD=9C=E6=A1=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/home/mySelections.js | 34 ++- pages/customStockList/customStockList.vue | 433 +++++++++++++++++++++++++++++- 2 files changed, 461 insertions(+), 6 deletions(-) diff --git a/api/home/mySelections.js b/api/home/mySelections.js index a22e69e..3b7cbb7 100644 --- a/api/home/mySelections.js +++ b/api/home/mySelections.js @@ -325,6 +325,37 @@ class MySelectionsAPI { throw error } } + + /** + * 更新自选股分组(假接口) + * @param {Function} successCallback - 成功回调函数 + * @param {Function} failCallback - 失败回调函数 + * @param {Object} data - 请求参数 {stockId: number, groupId: number} + * @returns {Promise} + */ + static async updateUserStockGroup(successCallback, failCallback = null, data = {}) { + const url = '/api/homePage/userStock/updateGroup' + + try { + const response = await http({ + url: url, + method: 'POST', + data: data + }) + + console.log('更新自选股分组 - 响应:', response) + if (successCallback && typeof successCallback === 'function') { + successCallback(response) + } + return response + } catch (error) { + console.error('更新自选股分组 - 失败:', error) + if (failCallback && typeof failCallback === 'function') { + failCallback(error) + } + throw error + } + } } // 导出API类 @@ -341,5 +372,6 @@ export const { updateUserStockGroupName, deleteUserStockGroup, deleteUserStock, - addUserStock + addUserStock, + updateUserStockGroup } = MySelectionsAPI \ No newline at end of file diff --git a/pages/customStockList/customStockList.vue b/pages/customStockList/customStockList.vue index ad96b5f..5d02923 100644 --- a/pages/customStockList/customStockList.vue +++ b/pages/customStockList/customStockList.vue @@ -66,7 +66,18 @@ v-for="stock in stockList" :key="stock.id" class="stock-item" + @click="handleStockClick(stock)" > + + + + + + + {{ stock.name || stock.code }} {{ stock.code }} @@ -81,11 +92,58 @@ + + + + + 已选择 {{ selectedStockIds.length }} 只股票 + + {{ isAllSelected ? '取消全选' : '全选' }} + + + + + + + + + + + + 编辑分组 + + + + + + {{ group.name }} + + + + 新建分组 + + + + + + + +