orderShop.vue
3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<!-- 订单商品 -->
<view class="shop" v-for="(it, idx) in shop.goods_detail" :key="it.id">
<view class="shopPhoto">
<image :src="it.image" mode=""></image>
</view>
<view class="info">
<view class="shopTitle ellipsis">{{ it.goods_name }}</view>
<view class="desc ellipsis">{{ it.describe }}</view>
<view class="num ellipsis">x{{ it.total_num }}</view>
<!-- 非积分商品 -->
<view class="priceBox flexJ" v-if="it.goodstatus != 3">
<text>¥{{ it.total_price }}</text>
<view class="reality flexA">
<view class="shi">{{ textHandler(shop.order_status) }}</view>
<text>¥</text>
<view class="price">{{ it.total_price }}</view>
</view>
</view>
<!-- 积分商品 -->
<view class="pointsShop" v-else>
<text>{{ textHandler(shop.order_status) }}</text>
<image src="/static/shopCarIc/pointsIc.png" mode=""></image>
<view class="points">{{ it.coscore }}</view>
<view class="pointsPrice">¥{{ it.diff_price }}</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive, onMounted, nextTick } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
const props = defineProps({
shop: {
type: Array,
default: []
}
})
const textHandler = orderStatus => ([1, 11].includes(orderStatus) ? '需付款:' : [2, 3, 4, 21].includes(orderStatus) ? '实付款:' : '')
onMounted(() => {
nextTick(() => {
console.log(props.shop, '订单数据是什么')
})
})
</script>
<style lang="scss">
.shop {
display: flex;
justify-content: space-between;
margin-bottom: 32rpx;
.shopPhoto {
width: 180rpx;
height: 180rpx;
margin-right: 16rpx;
image {
width: 180rpx;
height: 180rpx;
border-radius: 8rpx;
}
}
.info {
width: 100%;
.shopTitle {
color: #323233ff;
font-size: 26rpx;
font-weight: 700;
}
.desc {
margin: 16rpx 0;
color: #00000066;
font-size: 20rpx;
}
.num {
color: #757d8cff;
font-size: 26rpx;
text-align: right;
}
.priceBox {
margin-top: 14rpx;
text {
color: #ff3d3dff;
font-size: 28rpx;
}
.shi {
color: #ff3d3dff;
font-size: 28rpx;
margin-top: 4rpx;
margin-right: 2rpx;
}
.reality {
color: #fc4338ff;
font-size: 24rpx;
text {
color: #fc4338ff;
font-size: 22rpx;
font-weight: 700;
margin-top: 10rpx;
}
.price {
color: #fc4338ff;
font-size: 40rpx;
font-weight: 700;
}
}
}
.pointsShop {
display: flex;
justify-content: flex-end;
margin-top: 14rpx;
text {
color: #fc4338ff;
font-size: 24rpx;
}
image {
width: 30rpx;
height: 30rpx;
}
.points {
margin: 0 28rpx 0 14rpx;
color: #ee0a24ff;
font-size: 28rpx;
font-weight: 700;
}
.pointsPrice {
color: #ff3d3dff;
font-size: 26rpx;
}
}
}
}
</style>