红包逻辑需要重构
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user