Fix(店铺):点击查看视频触发两次请求问题

This commit is contained in:
lifizer
2024-07-09 16:04:43 +08:00
parent 89190e216f
commit 3659280b5b
+9 -7
View File
@@ -232,7 +232,7 @@
controls
play-btn-position="center"
class="video-item"
@click="infoItemViewClick(item)"
@play="infoItemViewClick(item)"
/>
</view>
<view v-else>
@@ -661,13 +661,15 @@ export default {
// this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
},
infoItemViewClick(item) {
hotelNewsView({ id: item.id }).finally(() => {
this.infoArray.map(info => {
if (info.id === item.id) {
info.pv += 1
}
uni.$u.debounce(() => {
hotelNewsView({ id: item.id }).finally(() => {
this.infoArray.map(info => {
if (info.id === item.id) {
info.pv += 1
}
})
})
})
}, 500)
},
publishBtnClick: function () {
this.$yrouter.push('/pagesInn/inn/innInfoPublish?hotelId=' + this.inn.id)