完善订单模块

This commit is contained in:
2025-05-16 09:14:08 +08:00
parent a92a6c5baf
commit 2b0d3c9c20
10 changed files with 463 additions and 237 deletions

View File

@ -1,59 +1,61 @@
<template>
<view class="order-goods bg-white">
<view class="bg-white">
<view v-for="(item, index) in list" :key="index" class="item-wrap u-p-b-20">
<view class="row-between u-p-l-20 u-p-r-20 u-p-t-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>
<view class="item row" @tap="toGoods(item.goods_id)">
<view class="item" :class="{row: mode != 'pay', 'row-start': mode == 'pay'}" @tap="toGoods(item.goods_id)">
<view>
<u-image :src="item.image_str || item.image"
:width="imageWidth"
:height="imageHeight"
:border-radius="imageRadius"
mode="aspectFit"
:mode="mode === 'confirm' ? 'aspectFill' : 'aspectFit'"
lazy-load/>
</view>
<view class="goods-info ml20 flex1">
<view class="sm text-999">
<view class="sm text-999" v-if="mode === 'order'">
<view>下单时间:2024-10-10 16:58:53</view>
<view>预计时间:2025-10-10 16:58:54</view>
<view>数量:x{{ item.goods_num }}</view>
<view>实付:0.00</view>
<view>实付:
<price-format
v-if="!item.is_member && order_type === 0"
:weight="500"
:subscript-size="24"
:first-size="34"
:second-size="24"
:price="item.original_price || item.goods_price"
></price-format>
</view>
<view>{{item.spec_value_str || item.spec_value}}</view>
</view>
<view class="sm text-999" v-if="mode === 'confirm'">
<view class="u-line-2" style="color: #1D2129">{{ item.goods_name || item.name }}</view>
<view class="u-m-t-4">周一至周日可用</view>
<view class="row u-m-t-10">
<view class="primary">
<price-format :price="item.original_price || item.goods_price" :subscriptSize="22" :firstSize="40" :secondSize="32"></price-format>
</view>
</view>
</view>
<view class="sm text-999" v-if="mode === 'pay'">
<view class="u-line-2" style="color: #1D2129">{{ item.goods_name || item.name }}</view>
</view>
<view class="sm text-999" v-if="mode === 'order_detail'">
<view class="u-line-2" style="color: #1D2129">{{ item.goods_name || item.name }}</view>
<view class="u-m-t-4">x{{ item.goods_num }}</view>
<view class="row u-m-t-10">
<view class="primary">
<price-format :price="item.original_price || item.goods_price" :subscriptSize="22" :firstSize="40" :secondSize="32"></price-format>
</view>
</view>
</view>
</view>
</view>
<view class="u-m-t-26 u-m-b-26 u-p-l-20 u-p-r-20">
<u-line color="#EEE" />
</view>
<view class="u-m-t-26 row-between u-p-l-20 u-p-r-20">
<view class="primary flex1">
<view v-if="getCancelTime(orderCancleTime) > 0" >
<u-count-down separator="zh"
:timestamp="getCancelTime(item.order_cancel_time)" separator-color="#FF2C3C"
color="#FF2C3C" :separator-size="26" :font-size="26" bg-color="transparent"
@end="refresh"></u-count-down>
</view>
</view>
<view class="row">
<view class="u-m-r-16">
<u-button @click="cancleOrder" hover-class="none" :customStyle="{width: '164rpx', height: '60rpx', color: '#999', border: '1px solid #DDD'}" :plain="true" :hair-line="false" shape="circle">取消订单</u-button>
</view>
<view>
<u-button @click="toPay" 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="seeDetails" 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>
<template v-if="mode === 'comfirm'">
<template v-if="mode === 'confirm'">
<view class="delivery" v-if="delivery === 1 && !item.is_express"
>该商品不支持快递配送</view
>
@ -116,7 +118,7 @@ export default {
type: Number,
default: 1
},
// order | comfirm
// order | confirm | pay
mode: {
type: String,
default: 'order'
@ -140,10 +142,6 @@ export default {
orderDesc: {
type: String,
default: ''
},
orderCancleTime: {
type: Number,
default: 0
}
},
@ -153,18 +151,8 @@ export default {
uni.navigateTo({
url: `/pages/goods_details/goods_details?id=${id}`
})
},
refresh() {
this.$emit('refresh')
}
},
computed: {
getCancelTime() {
return (time) => time - Date.now() / 1000;
},
},
}
}
</script>
<style lang="scss">