diff --git a/src/pageB/user_order/conponents/order-item.vue b/src/pageB/user_order/conponents/order-item.vue index 9a065d0..3022a0b 100644 --- a/src/pageB/user_order/conponents/order-item.vue +++ b/src/pageB/user_order/conponents/order-item.vue @@ -1,35 +1,43 @@ diff --git a/src/pageB/user_order/index.vue b/src/pageB/user_order/index.vue index dd1ba3e..40f66fb 100644 --- a/src/pageB/user_order/index.vue +++ b/src/pageB/user_order/index.vue @@ -1,32 +1,82 @@ @@ -34,4 +84,9 @@ .badge { @apply bg-badge; } + .suspension { + top:0; + // #ifdef H5 + top: 44px // #endif + } diff --git a/src/pageB/user_select_pro/index.vue b/src/pageB/user_select_pro/index.vue index 7bec35b..a382566 100644 --- a/src/pageB/user_select_pro/index.vue +++ b/src/pageB/user_select_pro/index.vue @@ -1,30 +1,29 @@ @@ -44,17 +48,65 @@ export default { data() { return { - list: [{}, {}] + modeShow: false, + id: '', + isFirstLoading: true, + order: {}, }; + }, + onLoad({ + id + }) { + this.id = id + this.getDate() + }, + computed: { + //需要提货的商品 + pickGoods() { + return this.order?.products?.filter(item => item.amount) ?? [] + } + }, + methods: { + async getDate() { + try { + const resDate = await this.$api.get(`/v1/order/underline/${this.id}`) + this.order = resDate + } catch (err) {} finally { + this.isFirstLoading = false + } + }, + onSubmit() { + this.pickGoods.length == 0 ? this.$u.toast('请至少选择一个商品提货') : this.modeShow = true + }, + //更新 + update(e) { + this.order.products = [...this.order.products] + }, + async confirm() { + try { + const arr = this.pickGoods.map(item => { + return { + amount: item.amount, + id: item.id + } + }) + await this.$api.post(`/v1/order/underline/${this.id}/package`, { + products: arr + }) + this.$u.toast('提货成功') + await this.getDate() + } catch (err) {} + } } }