完善订单

This commit is contained in:
2025-05-16 15:15:36 +08:00
parent 2b0d3c9c20
commit 7ae003c61f
8 changed files with 433 additions and 60 deletions

View File

@ -325,9 +325,22 @@
// 去结算
goSettle() {
uni.navigateTo({
url: `/pages/order_now/order_now?id=${id}`
const goods = this.cartLists.map(item => {
return {
item_id: item.item_id,
num: item.goods_num
}
})
uni.navigateTo({
url: "/pages/order_now/order_now?data=" +
encodeURIComponent(
JSON.stringify({
goods,
type: "cart",
})
),
});
},
// 跳转商品详情页

View File

@ -3,15 +3,17 @@
<view v-for="(item, index) in list" :key="index" class="item-wrap u-p-b-20">
<view class="row-between u-p-r-20 u-p-t-20 u-p-b-24" v-if="mode === 'order'">
<view class="u-line-1 nr bold-500 text-000"> {{ item.goods_name || item.name }}</view>
<view class="text-999 flex1 u-m-l-40 text-nowrap">{{ orderDesc }}</view>
<!-- 未发货订单暂时理解为未制作 -->
<!-- 已发货订单暂时理解为已完成 -->
<view class="flex1 u-m-l-40 text-nowrap" :class="{'primary': orderStatus == 1, 'text-999': orderStatus != 1}">{{ orderDesc }}</view>
</view>
<view class="item" :class="{row: mode != 'pay', 'row-start': mode == 'pay'}" @tap="toGoods(item.goods_id)">
<view>
<view :style="{ width: imageWidth + 'rpx', height: imageHeight + 'rpx' }">
<u-image :src="item.image_str || item.image"
:width="imageWidth"
:height="imageHeight"
:border-radius="imageRadius"
:mode="mode === 'confirm' ? 'aspectFill' : 'aspectFit'"
:mode="imgMode"
lazy-load/>
</view>
<view class="goods-info ml20 flex1">
@ -21,7 +23,7 @@
<view>数量:x{{ item.goods_num }}</view>
<view>实付:
<price-format
v-if="!item.is_member && order_type === 0"
v-if="!item.is_member && (order_type === 0 || order_type === 1)"
:weight="500"
:subscript-size="24"
:first-size="34"
@ -63,33 +65,6 @@
>该商品不支持门店自提</view
>
</template>
<view class="goods-footer row" v-if="link">
<view style="flex: 1"></view>
<navigator
class="mr20"
hover-class="none"
:url="'/bundle/pages/goods_reviews/goods_reviews?id=' + item.id"
v-if="item.comment_btn"
>
<button size="xs" class="plain br60" hover-class="none">评价晒图</button>
</navigator>
<navigator
v-if="item.refund_btn"
hover-class="none"
:url="
'/bundle/pages/apply_refund/apply_refund?order_id=' +
item.order_id +
'&item_id=' +
item.item_id
"
>
<button size="xs" class="plain br60" hover-class="none">申请退款</button>
</navigator>
<view v-if="item.after_status_desc" style="color: orange">
{{ item.after_status_desc }}
</view>
</view>
</view>
</view>
</template>
@ -142,6 +117,14 @@ export default {
orderDesc: {
type: String,
default: ''
},
imgMode: {
type: String,
default: 'scaleToFill'
},
orderStatus: {
type: Number,
default: 0
}
},

View File

@ -6,7 +6,7 @@
:key="index"
:url="'/pages/order_details/order_details?id=' + item.id">
<order-goods :list="item.order_goods" :order_type="item.order_type" :imageRadius="12"
:orderDesc="item.order_status_desc"></order-goods>
:orderDesc="item.order_status_desc" :orderStatus="item.order_status"></order-goods>
<view class="u-m-t-26 u-m-b-26 u-p-l-20 u-p-r-20">
<u-line color="#EEE" />
</view>
@ -33,12 +33,12 @@
:customStyle="{ width: '164rpx', height: '60rpx', backgroundColor: themeColor, color: '#fff', border: 'none' }"
:hair-line="false" shape="circle">去付款</u-button>
</view>
<view v-if="type === 'delivery' || type === 'finish'">
<u-button @click="seeDetails" hover-class="none" :customStyle="{width: '164rpx', height: '60rpx', backgroundColor: themeColor, color: '#fff', border: 'none'}" :hair-line="false" shape="circle">查看详情</u-button>
<view v-if="item.order_status > 0 && item.order_status < 4">
<u-button @click.stop="seeDetails(item.id)" hover-class="none" :customStyle="{width: '164rpx', height: '60rpx', backgroundColor: themeColor, color: '#fff', border: 'none'}" :hair-line="false" shape="circle">查看详情</u-button>
</view>
<view v-if="item.order_status == 4">
<u-button @click.stop="toRefund(item.id, item.order_goods)" hover-class="none" :customStyle="{width: '164rpx', height: '60rpx', backgroundColor: themeColor, color: '#fff', border: 'none'}" :hair-line="false" shape="circle">申请退款</u-button>
</view>
<!-- <view>
<u-button @click="toRefund" hover-class="none" :customStyle="{width: '164rpx', height: '60rpx', backgroundColor: themeColor, color: '#fff', border: 'none'}" :hair-line="false" shape="circle">申请退款</u-button>
</view> -->
</view>
</view>
</navigator>
@ -88,7 +88,20 @@ export default {
}
},
created() {
uni.$on("refreshorder", () => {
this.reflesh();
});
uni.$on("payment", (params) => {
if (params.result) {
this.reflesh();
uni.navigateBack();
setTimeout(() => this.$toast({ title: "支付成功" }), 0.5 * 1000);
}
});
},
destroyed: function () {
uni.$off(["payment", "refreshorder"]);
},
methods: {
// 初始化数据
upCallback(page) {
@ -138,13 +151,23 @@ export default {
},
// 查看详情
seeDetails() {
seeDetails(id) {
uni.navigateTo({
url: `/pages/order_details/order_details?id=${id}`
})
},
// 申请退款
toRefund() {
toRefund(id, goods) {
if (goods.length == 1) {
uni.navigateTo({
url: `/bundle/pages/apply_refund/apply_refund?order_id=${goods[0].order_id}&item_id=${goods[0].item_id}`
})
} else {
uni.navigateTo({
url: `/pages/order_details/order_details?id=${id}`
})
}
}
},
computed: {