Commit db3b3307 by 李伟康

feat(OrderPopup): 优化多个组件并添加加载完成事件

- 在 CarModelList、CouponList、DiversionMerchant、EmployeeList、GoodsList、PackageList 和 SkuGoodsList 组件中添加 onComplete 事件
- 在 OrderPopup 组件中添加 loadComplete 状态和相关逻辑
- 优化 CarModelList 组件中的条件判断逻辑
- 为 OrderPopup 组件添加加载中动画
1 parent 30a15305
......@@ -25,11 +25,14 @@
:class="[
{'sub-brand-name':j.isTitle},
{'item flex':!j.isTitle},
{active: currentId ? j.id == currentId : j.id == data.customer[params.idKey]}
{active: (currentId ? j.id == currentId : j.id == data.customer[params.idKey]) && !j.isTitle}
]"
@click="choose(j,c)"
>
<view class="sprite-icon icon-tag-checked" v-if="!j.isTitle"></view>
<view
class="sprite-icon icon-tag-checked"
v-if="!j.isTitle"
></view>
{{j.name}}
</view>
</template>
......@@ -132,7 +135,7 @@ export default {
}
})
this.list = carModelList
this.$emit('onComplete')
},
handleSearch (searchValue) {
if (!searchValue) {
......
......@@ -114,6 +114,7 @@ export default {
list,
};
})
this.$emit('onComplete')
this.list = couponList
},
async getCustomerCouponList (customerPhone) {
......
......@@ -42,6 +42,7 @@ export default {
merchantId: shopMerchantId
})
if (data && data.length) {
this.$emit('onComplete')
this.list = data
params.cacheData = data
this.$emit('update:params', params)
......
......@@ -46,6 +46,7 @@ export default {
name: searchValue
})
if (data && data.length) {
this.$emit('onComplete')
this.list = data
params.cacheData = data
this.$emit('update:params', params)
......
......@@ -100,6 +100,7 @@ export default {
this.currentIds.push(e.goods.goodsId)
this.chooseList.push(e)
})
this.$emit('onComplete')
return arr
},
choose (i) {
......
......@@ -115,6 +115,7 @@ export default {
this.currentIds.push(e.packageGoods.packageCode)
this.chooseList.push(e)
})
this.$emit('onComplete')
return arr
},
choose (i) {
......
......@@ -184,6 +184,7 @@ export default {
this.chooseList.push(e)
}
})
this.$emit('onComplete')
return arr
},
async choose (i, index) {
......
......@@ -45,7 +45,7 @@
<view :class="['popup-body',{ 'hide-search' :componentObject.hideSearch}]">
<scroll-view
scroll-y
class="popup-scroll-view"
:class="['popup-scroll-view',{show:loadComplete}]"
>
<component
:is="componentObject.name"
......@@ -55,9 +55,14 @@
ref="componentRef"
@choose="chooseContent = $event"
@openSkuPopup="openSkuPopup"
@onComplete="loadComplete = true"
></component>
</scroll-view>
<image
v-if="!loadComplete"
class="loading"
src="../../assets/images/common/loadding.gif"
/>
</view>
</popup>
<sku-popup
......@@ -123,6 +128,7 @@ export default {
position: 'bottom',
chooseContent: null,
componentObject: null,
loadComplete: false
}
},
watch: {
......@@ -281,9 +287,23 @@ export default {
}
.popup-body {
height: calc(100% - 392rpx);
position: relative;
.popup-scroll-view {
height: 100%;
padding-top: 32rpx;
opacity: 0;
}
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(64);
height: toRpx(64);
}
.show{
opacity: 1;
}
}
.hide-search {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!