orderCard.vue
5.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<template>
<view class="orderCard" @click="goOrderDetaPage">
<view class="flex justify-between align-center">
<view class="flex align-center w80" @click.stop="goStorePage">
<!-- <u-icon name="/static/images/home/shopTitle.png" size="20"></u-icon>-->
<view :style="{ backgroundImage: 'url(/static/images/home/shopTitle.png)', backgroundSize:'100% 100%',width:'20px',height:'20px', backgroundRepeat: 'no-repeat'}"></view>
<view class="margin-left-xs overflow-one-lines">
{{pageForm.fCzmc}}
</view>
</view>
<view class="themeColor">
{{pageForm.fDdzt}}
</view>
</view>
<u-divider></u-divider>
<view v-for="(item,index) of pageForm.ddxqList" :key="index" class="flex justify-between margin-top">
<view class="" style="min-width: 80px;min-height: 80px">
<u-image width="80px" height="80px" :src="item.fTp?item.fTp:'/static/images/gas-icon/gasicon.png'"></u-image>
</view>
<view class="w60 flex flex-direction justify-between margin-left-sm">
<view class="overflow-one-lines">
{{item.fSpmc}}
</view>
<view class="text-sm text-gray overflow-one-lines">
规格:{{item.fMs}}
</view>
<view class="text-lg text-bold overflow-one-lines">
¥{{item.fDj}}
</view>
</view>
<view class="flex flex-wrap justify-end">
<view v-if="pageForm.fPsfs" :class="[pageForm.fPsfs=='自提'?'ztSty':'psSty','psfsSty']">
{{pageForm.fPsfs}}</view>
<view class="flex align-end">X{{item.fSl}}</view>
</view>
</view>
<u-divider></u-divider>
<view class="flex margin-top-lg">
<view class="text-gray overflow-one-lines">
订单编号:{{pageForm.fDddh}}
</view>
</view>
<view class="flex margin-top-sm">
<view class="text-gray">
备注信息:{{pageForm.fMjly}}
</view>
</view>
<view class="flex margin-top-lg margin-bottom-lg justify-end ">
<view class="text-gray">
<!-- 共{{pageForm.ddxqList.length}}件商品 -->
合计:
</view>
<view class="themeColor overflow-one-lines">
¥{{pageForm.fDdje}}
</view>
</view>
<view class="flex justify-end">
<view class="margin-left-sm" v-if="pageForm.fDdzt =='待配送' " @click.stop="goGasCancel">
<u-button shape="circle" color="">取消订单</u-button>
</view>
<!-- <view class="margin-left-sm" @click.stop="goGasDetailPage">-->
<!-- <u-button shape="circle" color="">再来一单</u-button>-->
<!-- </view>-->
<!-- <view class="margin-left-sm">
<u-button shape="circle" color="" @click.stop="reminderShipment">提醒发货</u-button>
</view> -->
<!-- <view class="margin-left-sm">
<u-button shape="circle" color="#EA5504" @click.stop="customerService">联系客服</u-button>
</view> -->
</view>
</view>
</template>
<script>
import {cancelOrder} from "../../../api/order";
export default {
components: {},
props: {
orderitem: Object
},
watch: {
orderitem(val) {
console.log('打印Val', val);
}
},
data() {
return {
pageForm: {
fCzmc: '',
fDdzt: '待付款',
fDddh: 'A2011100221001',
ddxqList: [],
fSpmc: '',
fGg: '',
fTp: '',
fDdjg: '',
fDj: '',
fDdly: '',
fSl: '',
fCzid: '',
}
}
},
computed: {
},
onLoad() {
// this.pageForm = {...this.orderItem};
},
created() {
this.pageForm = {
...this.orderitem
};
// this.$forceUpdate();
},
methods: {
//用户取消订单
async goGasCancel(){
let paramsData ={
ddid: this.pageForm.id
};
this.$modal.confirm('确认取消订单?', '提示').then(async () => {
let cancelOrderResult = await this.$api.orderApi.cancelOrder(paramsData);
if(cancelOrderResult.code ==200){
this.$modal.msgSuccess('订单取消成功!');
this.pageForm.fDdzt ='已取消';
this.$emit('orderCancel');
}else {
this.$modal.msgError('会员信息修改失败!');
}
}).catch(() => {
console.log("取消");
});
},
goStorePage() {
let czid = this.pageForm.fCzid;
console.log('打印czid',czid)
uni.navigateTo({
url: "/pages/home/storeDetails?czid="+czid
})
},
goGasDetailPage() {
uni.navigateTo({
url: "/pages/home/gasDetail"
})
},
goOrderDetaPage() {
// console.log('打印this.pageForm.id', this.pageForm);
uni.navigateTo({
url: `/pages/order/orderDetail?id=${this.pageForm.id}`
})
},
reminderShipment() {
},
customerService() {
},
}
}
</script>
<style lang="scss" scoped>
.orderCard {
margin: 10px;
padding: 10px;
background: #fff;
border-radius: 15px;
.psfsSty {
width: 70px;
height: 23px;
border-radius: 5px;
text-align: center;
line-height: 23px;
font-size: 12px;
}
.ztSty {
font-family: "苹方 中等", 苹方, sans-serif;
font-weight: 400;
font-style: normal;
color: rgb(0, 174, 170);
background-color: #e6f7f7;
}
.psSty {
font-family: "苹方 中等", 苹方, sans-serif;
font-weight: 400;
font-style: normal;
color: rgb(255, 165, 0);
background-color: #fff6e6;
}
}
</style>