Commit 47de8e39 by 李伟康

feat(OrderPopup): 添加失效订单逻辑并优化加载显示

- 在 GoodsList 组件中添加 isDefeatOrder 属性,用于判断是否为失效订单
- 在 popupmixin 中添加 isDefeatOrder 属性
- 在 OrderPopup 组件中添加 isDefeatOrder 属性并传递给子组件
- 优化 OrderScreen 组件的加载显示逻辑,添加 onComplete 方法
- 调整 OrderScreen 组件的样式,优化折叠/展开功能
1 parent e4f3120c
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<template v-if="i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)"> <template v-if="i.goods.merchantGoodsPosition && (i.goods.goodsInfo.goodsType == 1 || i.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)">
<text>「{{ i.goods.positionStr}}」</text> <text>「{{ i.goods.positionStr}}」</text>
</template> </template>
<text class="price">¥{{i.goods.price}}</text> <text class="price">¥{{isDefeatOrder? 0 :i.goods.price}}</text>
</view> </view>
</template> </template>
<!-- </template> --> <!-- </template> -->
......
...@@ -13,7 +13,8 @@ export default { ...@@ -13,7 +13,8 @@ export default {
props: { props: {
params: Object, params: Object,
data: [Object, Array], data: [Object, Array],
dataKey: String dataKey: String,
isDefeatOrder: Boolean
}, },
computed: { computed: {
listData () { listData () {
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
:params.sync="componentObject[popupType]" :params.sync="componentObject[popupType]"
:data="data" :data="data"
:dataKey="dataKey" :dataKey="dataKey"
:isDefeatOrder="isDefeatOrder"
ref="componentRef" ref="componentRef"
@choose="chooseContent = $event" @choose="chooseContent = $event"
@openSkuPopup="openSkuPopup" @openSkuPopup="openSkuPopup"
...@@ -118,7 +119,11 @@ export default { ...@@ -118,7 +119,11 @@ export default {
}, },
data: [Object, Array], data: [Object, Array],
externalData: null, externalData: null,
dataKey: String dataKey: String,
isDefeatOrder: {
type: Boolean,
default: false
}
}, },
provide () { provide () {
......
...@@ -17,10 +17,13 @@ ...@@ -17,10 +17,13 @@
></uni-icons> ></uni-icons>
</view> </view>
</view> </view>
<view class="popup-body" :key="viewKey"> <view
class="popup-body"
:key="viewKey"
>
<scroll-view <scroll-view
scroll-y scroll-y
:class="['popup-scroll-view',{show:loadComplete}]" :class="['popup-scroll-view',{'popup-show':loadComplete}]"
> >
<template v-for="(i, index) in screenList"> <template v-for="(i, index) in screenList">
<view <view
...@@ -33,7 +36,10 @@ ...@@ -33,7 +36,10 @@
({{userInfo[i.suffix]}}) ({{userInfo[i.suffix]}})
</template> </template>
<template v-if="i.hasToggle"> <template v-if="i.hasToggle">
<view class="toggle-btn" @click="i.toggle = !i.toggle">{{i.toggle ? '收起' : '展开'}}</view> <view
class="toggle-btn"
@click="i.toggle = !i.toggle"
>{{i.toggle ? '收起' : '展开'}}</view>
</template> </template>
</view> </view>
<view :class="['box',{'fold':i.hasToggle},{'show':i.toggle}]"> <view :class="['box',{'fold':i.hasToggle},{'show':i.toggle}]">
...@@ -43,6 +49,7 @@ ...@@ -43,6 +49,7 @@
:params.sync="i.params" :params.sync="i.params"
@choose="choose" @choose="choose"
:data="chooseContent" :data="chooseContent"
@onComplete="onComplete"
/> />
</view> </view>
</view> </view>
...@@ -80,20 +87,25 @@ export default { ...@@ -80,20 +87,25 @@ export default {
data () { data () {
return { return {
screenList: config.screenList, screenList: config.screenList,
loadComplete: true,
chooseContent: {}, chooseContent: {},
viewKey:Date.now(), viewKey: Date.now(),
onCompleteNum: 0
} }
}, },
provide () { provide () {
return { return {
userInfo: this.userInfo, userInfo: this.userInfo,
} }
}, },
computed: { computed: {
userInfo () { userInfo () {
return uni.$storage.get("userInfo") return uni.$storage.get("userInfo")
}, },
loadComplete () {
return this.onCompleteNum == this.screenList.length
}
}, },
mounted () { mounted () {
}, },
...@@ -133,6 +145,10 @@ export default { ...@@ -133,6 +145,10 @@ export default {
this.$emit('onConfirm', chooseContent) this.$emit('onConfirm', chooseContent)
this.close() this.close()
}, },
onComplete () {
if (this.onCompleteNum == this.screenList.length) return
this.onCompleteNum += 1
}
} }
} }
</script> </script>
...@@ -168,6 +184,7 @@ export default { ...@@ -168,6 +184,7 @@ export default {
height: calc(100% - 312rpx); height: calc(100% - 312rpx);
position: relative; position: relative;
.popup-scroll-view { .popup-scroll-view {
opacity: 0;
height: 100%; height: 100%;
padding-top: 8rpx; padding-top: 8rpx;
.item-box { .item-box {
...@@ -187,17 +204,20 @@ export default { ...@@ -187,17 +204,20 @@ export default {
font-size: 24rpx; font-size: 24rpx;
} }
} }
.box{ .box {
overflow: hidden; overflow: hidden;
} }
.fold{ .fold {
height: 72rpx; height: 72rpx;
} }
.show{ .show {
height: auto !important; height: auto !important;
} }
} }
} }
.popup-show {
opacity: 1;
}
.loading { .loading {
position: absolute; position: absolute;
top: 50%; top: 50%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!