Browse Source

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

dongqian/feature-20251022181325-deepmate简版
dongqian 3 weeks ago
parent
commit
1dac18e991
  1. 89
      pages/customStockList/customStockList.vue
  2. 10
      pages/home/home.vue

89
pages/customStockList/customStockList.vue

@ -103,6 +103,13 @@
</view>
<view class="toolbar-right">
<button
class="delete-btn"
:disabled="selectedStockIds.length === 0"
@click="deleteSelectedStocks"
>
删除
</button>
<button
class="add-to-group-btn"
:disabled="selectedStockIds.length === 0"
@click="showGroupSelectModal = true"
@ -143,7 +150,7 @@
</template>
<script>
import { getUserStockGroupList, addUserStockGroup, getUserStockList, updateUserStockGroup } from '@/api/home/mySelections.js'
import { getUserStockGroupList, addUserStockGroup, getUserStockList, updateUserStockGroup, deleteUserStock } from '@/api/home/mySelections.js'
export default {
data() {
@ -484,7 +491,7 @@
this.selectedStockIds = []
//
this.loadStockList()
this.loadStocksByGroup(this.currentGroupId)
} catch (error) {
console.error('移动股票失败:', error)
@ -495,6 +502,69 @@
} finally {
uni.hideLoading()
}
},
//
async deleteSelectedStocks() {
//
if (this.selectedStockIds.length === 0) {
uni.showToast({
title: '请先选择要删除的股票',
icon: 'none'
})
return
}
//
uni.showModal({
title: '确认删除',
content: `确定要删除选中的 ${this.selectedStockIds.length} 只股票吗?`,
success: async (res) => {
if (res.confirm) {
await this.performDeleteStocks()
}
}
})
},
//
async performDeleteStocks() {
try {
uni.showLoading({
title: '删除中...'
})
// API
const deletePromises = this.selectedStockIds.map(stockId => {
return deleteUserStock(null, null, {
groupId: this.currentGroupId,
id: stockId
})
})
await Promise.all(deletePromises)
uni.showToast({
title: '删除成功',
icon: 'success'
})
// 退
this.isMultiSelectMode = false
this.selectedStockIds = []
//
this.loadStocksByGroup(this.currentGroupId)
} catch (error) {
console.error('删除股票失败:', error)
uni.showToast({
title: '删除失败,请重试',
icon: 'none'
})
} finally {
uni.hideLoading()
}
}
}
}
@ -782,6 +852,21 @@
.toolbar-right {
display: flex;
align-items: center;
gap: 12px;
}
.delete-btn {
background-color: #ff6b6b;
color: #fff;
border: none;
border-radius: 6px;
padding: 8px 16px;
font-size: 14px;
}
.delete-btn:disabled {
background-color: #ccc;
color: #999;
}
.add-to-group-btn {

10
pages/home/home.vue

@ -223,11 +223,11 @@ export default {
//
swiperImages: [
'https://d31zlh4on95l9h.cloudfront.net/images/44ec37501cf3ecf5438d401c3d66fcd3.png',
'https://d31zlh4on95l9h.cloudfront.net/images/80274b6626bb403d717469b3672333c9.png',
'https://d31zlh4on95l9h.cloudfront.net/images/14481c76b09509977d3879ba3141ebc7.png',
'https://d31zlh4on95l9h.cloudfront.net/images/19e4c5542e5f974e1c6938897aa20ef9.png',
'https://d31zlh4on95l9h.cloudfront.net/images/d0bc1c1bb71917132865b82dab99831b.png'
'https://d31zlh4on95l9h.cloudfront.net/images/893a55bc0de424a1c9abf9f0d3eb2bb0.png',
'https://d31zlh4on95l9h.cloudfront.net/images/35b413c98b2f3b6f67f99beb29dc9017.png',
'https://d31zlh4on95l9h.cloudfront.net/images/413bd37201f13e04bb491f285b553d03.png',
'https://d31zlh4on95l9h.cloudfront.net/images/f3dde163daa842ff5818d521ce674c16.png',
'https://d31zlh4on95l9h.cloudfront.net/images/b1dae32cf36055c1c626df1eea29e6b6.png'
],
//

Loading…
Cancel
Save