优化
This commit is contained in:
@@ -140,7 +140,9 @@ async function confirmOrder() {
|
||||
memberAccount: ''
|
||||
})
|
||||
} else {
|
||||
payLoading.value = false
|
||||
scanModalRef.value.show()
|
||||
return
|
||||
}
|
||||
break;
|
||||
case 'cash'://现金
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="shop_list" :class="{ img: shopListType == 'img' }" v-loading="loading">
|
||||
<!-- <swiper class="swiper_box" direction="vertical" @slideChange="onSlideChange"> -->
|
||||
<swiper class="swiper_box" direction="vertical">
|
||||
<swiper class="swiper_box" direction="vertical" @slideChange="onSlideChange">
|
||||
<swiper-slide class="slide_item" v-for="(goods, index) in goodsList" :key="index">
|
||||
<div class="item_wrap" v-for="item in goods" :key="item.id" @click="showSkuHandle(item)">
|
||||
<div class="item">
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper>
|
||||
</div>
|
||||
</div>
|
||||
<div class="empty">
|
||||
<el-empty description="空空如也~" v-if="!goodsList.length" />
|
||||
</div>
|
||||
@@ -236,15 +236,15 @@ async function productqueryCommodityInfoAjax() {
|
||||
}
|
||||
// loading.value = false
|
||||
|
||||
if (res.pages > 2 && loopTimer.value == null) {
|
||||
// 启动循环任务
|
||||
// loopMax.value = parseInt(res.total / goodsPageSize.value)
|
||||
loopGetGoods()
|
||||
}
|
||||
if (goodsPage.value >= res.pages) {
|
||||
clearInterval(loopTimer.value)
|
||||
loopTimer.value = null
|
||||
}
|
||||
// if (res.pages > 2 && loopTimer.value == null) {
|
||||
// // 启动循环任务
|
||||
// // loopMax.value = parseInt(res.total / goodsPageSize.value)
|
||||
// loopGetGoods()
|
||||
// }
|
||||
// if (goodsPage.value >= res.pages) {
|
||||
// clearInterval(loopTimer.value)
|
||||
// loopTimer.value = null
|
||||
// }
|
||||
return res.list
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
@@ -290,9 +290,17 @@ const onSlideChange = _.debounce(async function (e) {
|
||||
if (e.activeIndex == e.previousIndex || finish.value) return
|
||||
if (e.activeIndex > e.previousIndex) {
|
||||
// console.log('向下滑动');
|
||||
goodsPage.value++
|
||||
const res = await productqueryCommodityInfoAjax()
|
||||
goodsList.value.push(res)
|
||||
{
|
||||
goodsPage.value++
|
||||
const res = await productqueryCommodityInfoAjax()
|
||||
goodsList.value.push(res)
|
||||
}
|
||||
|
||||
{
|
||||
goodsPage.value++
|
||||
const res = await productqueryCommodityInfoAjax()
|
||||
goodsList.value.push(res)
|
||||
}
|
||||
// goodsList.value.shift()
|
||||
} else {
|
||||
// console.log('向上滑动');
|
||||
|
||||
Reference in New Issue
Block a user