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] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=81=87=E7=9A=84=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E8=82=A1=E7=A5=A8=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=9B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=89=E4=B8=AD=E8=82=A1=E7=A5=A8=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=9B=E6=96=B0=E5=A2=9E=E5=BA=95=E9=83=A8?= =?UTF-8?q?=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 }} + + + + 新建分组 + + + + + + + +