红包逻辑需要重构

This commit is contained in:
cbb
2026-01-16 17:57:43 +08:00
parent 5f9629f198
commit f0aee6ba14
16 changed files with 335 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getProductDetail, getProductCommentList } from '@/api/mall'
import { ref, computed } from 'vue'
import { navigateTo } from '@/utils/router'
@@ -17,11 +17,14 @@
/** 评论数量获取 */
const getComment = async productId => {
const res = await getProductCommentList({
productId,
pageNum: 1,
pageSize: 1
})
const res = await getProductCommentList(
{
productId,
pageNum: 1,
pageSize: 1
},
false
)
commentNum.value = res.total
}
@@ -50,7 +53,9 @@
productId.value = e.productId
groupId.value = e?.groupId || ''
await getData(e.productId)
await getComment(e.productId)
})
onShow(() => {
getComment(productId.value)
})
</script>
@@ -64,13 +69,13 @@
class="left-icon"
></image>
</template>
<template #right>
<!-- <template #right>
<image
src="/static/images/public/share-icon.png"
mode="heightFix"
class="right-icon"
></image>
</template>
</template> -->
</nav-bar>
<!-- 顶部图片 -->
<view class="top-img">