purchase-let/pagesOrder/order/component/good.vue

171 lines
4.5 KiB
Vue
Raw Normal View History

2024-04-26 18:04:56 +08:00
<template>
<view class="shop-item">
<view class="item-title" @click="navTo">
2024-04-30 16:24:55 +08:00
<view>{{datas.number}}</view>
2024-04-30 18:08:36 +08:00
<view v-if="datas.paid==0">
2024-05-06 14:26:18 +08:00
<text>待付款</text>
2024-04-30 18:08:36 +08:00
</view>
<view v-else>
2024-05-07 19:02:43 +08:00
<text v-if="datas.status==0">待收货</text>
2024-04-30 18:08:36 +08:00
<text v-if="datas.status==1">待收货</text>
<text v-if="datas.status==2||datas.status==3">已完成</text>
</view>
2024-04-26 18:04:56 +08:00
</view>
<view class="item-body" @click="navTo">
<view class="body-content">
2024-04-30 18:08:36 +08:00
<view style="display: flex;flex: 1;flex-shrink: 0;">
<view v-for="(item,index) in datas.goods_list" :key="index">
2024-04-30 16:24:55 +08:00
<image class="image" :src="item.imgs"></image>
2024-04-30 18:08:36 +08:00
</view>
</view>
<view
style="display: flex;flex-direction: column;align-items: center;justify-content: center;width: 100rpx;">
<up-icon name="arrow-right-double" color="#20B128"></up-icon>
2024-04-26 18:04:56 +08:00
</view>
</view>
2024-04-30 18:08:36 +08:00
<view class="all"> {{datas.goods_count}} 件商品, 总金额 <text>¥{{datas.total}}</text> </view>
2024-04-26 18:04:56 +08:00
</view>
2024-05-06 14:26:18 +08:00
<view v-if="datas.paid==0" class="item-btn">
2024-05-06 17:58:41 +08:00
<view style="width: 80px;"><up-button size="small" plain color="#989898" shape="circle" @click="cancleOrder">取消订单</up-button></view>
2024-05-08 14:50:27 +08:00
<view style="width: 80px;"><up-button size="small" color="#20B128" shape="circle" @click="rePay">立即支付</up-button></view>
2024-04-26 18:04:56 +08:00
</view>
2024-04-30 18:08:36 +08:00
<view v-else class="item-btn">
<!-- <view style="width: 80px;"><up-button size="small" plain color="#989898" shape="circle">申请售后</up-button></view> -->
2024-05-08 14:50:27 +08:00
<view @click="takeOrder" v-if="datas.status==1" style="width: 80px;"><up-button size="small" color="#20B128"
2024-04-30 18:08:36 +08:00
shape="circle">确认收货</up-button></view>
2024-05-08 15:25:03 +08:00
<view @click="purchaseAgain" v-if="datas.status==2||datas.status==3" style="width: 80px;"><up-button size="small" plain color="#20B128"
2024-04-30 18:08:36 +08:00
shape="circle">再次购买</up-button></view>
<view @click="navTo" style="width: 80px;"><up-button size="small" plain color="#20B128"
shape="circle">查看详情</up-button></view>
2024-04-26 18:04:56 +08:00
</view>
2024-04-30 18:08:36 +08:00
<!-- <view v-if="type==3" class="item-close">
2024-04-26 18:04:56 +08:00
<view class="title">
<view class="type">退款申请中</view>
<view>等待商家处理</view>
</view>
<up-icon name="arrow-right"></up-icon>
2024-04-30 18:08:36 +08:00
</view> -->
2024-04-26 18:04:56 +08:00
</view>
</template>
<script setup>
2024-04-30 18:08:36 +08:00
// 订单状态0待发货1待收货2已完成3已完成)
const props = defineProps({
type: {
type: Number,
default: 0
},
datas: {
type: Object,
default: () => {}
}
2024-04-26 18:04:56 +08:00
})
2024-04-30 18:08:36 +08:00
const navTo = () => {
uni.navigateTo({
url: `/pagesOrder/detail/detail?type=${props.datas.paid}&id=${props.datas.id}`
})
}
2024-05-06 17:58:41 +08:00
2024-05-08 15:25:03 +08:00
const emit = defineEmits(['cancleOrder', 'rePay', 'takeOrder', 'purchaseAgain']);
2024-05-06 17:58:41 +08:00
const cancleOrder = ()=>{
emit('cancleOrder', props.datas)
}
2024-05-07 13:39:08 +08:00
2024-05-08 14:50:27 +08:00
const takeOrder = ()=>{
emit('takeOrder', props.datas)
}
2024-05-08 15:25:03 +08:00
const purchaseAgain = ()=>{
emit('purchaseAgain', props.datas)
}
2024-05-07 13:39:08 +08:00
const rePay = ()=>{
emit('rePay', props.datas)
}
2024-04-26 18:04:56 +08:00
</script>
<style lang="scss">
2024-04-30 18:08:36 +08:00
.shop-item {
2024-04-26 18:04:56 +08:00
width: 710rpx;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 14rpx;
padding: 20rpx;
box-sizing: border-box;
2024-04-30 18:08:36 +08:00
.item-title {
2024-04-26 18:04:56 +08:00
display: flex;
justify-content: space-between;
}
2024-04-30 18:08:36 +08:00
.item-body {
2024-04-26 18:04:56 +08:00
margin: 20rpx 0;
2024-04-30 18:08:36 +08:00
.body-content {
2024-04-26 18:04:56 +08:00
display: flex;
2024-04-30 18:08:36 +08:00
justify-content: space-between;
2024-04-26 18:04:56 +08:00
color: #989898;
2024-04-30 18:08:36 +08:00
.image {
width: 160rpx;
height: 160rpx;
2024-04-30 16:24:55 +08:00
margin-right: 20rpx;
2024-04-30 18:08:36 +08:00
border-radius: 14rpx;
2024-04-30 16:24:55 +08:00
}
2024-04-30 18:08:36 +08:00
.title {
2024-04-26 18:04:56 +08:00
display: flex;
justify-content: space-between;
font-size: 28rpx;
color: #444;
}
2024-04-30 18:08:36 +08:00
.tips {
2024-04-26 18:04:56 +08:00
display: flex;
justify-content: space-between;
font-size: 24rpx;
margin-top: 10rpx;
}
2024-04-30 18:08:36 +08:00
2024-04-30 16:24:55 +08:00
}
2024-04-30 18:08:36 +08:00
.all {
2024-04-30 16:24:55 +08:00
text-align: right;
font-size: 26rpx;
2024-04-30 18:08:36 +08:00
text {
2024-04-30 16:24:55 +08:00
color: #F55726;
2024-04-26 18:04:56 +08:00
}
}
}
2024-04-30 18:08:36 +08:00
.item-btn {
2024-04-26 18:04:56 +08:00
display: flex;
justify-content: flex-end;
2024-04-30 18:08:36 +08:00
view {
2024-04-26 18:04:56 +08:00
width: 80rpx;
margin-left: 20rpx;
}
}
2024-04-30 18:08:36 +08:00
.item-close {
2024-04-26 18:04:56 +08:00
display: flex;
justify-content: space-between;
align-items: center;
background-color: #F6F6F6;
padding: 15rpx;
border-radius: 14rpx;
2024-04-30 18:08:36 +08:00
.title {
2024-04-26 18:04:56 +08:00
display: flex;
2024-04-30 18:08:36 +08:00
.type {
2024-04-26 18:04:56 +08:00
font-weight: 600;
margin-right: 20rpx;
}
}
}
}
</style>