myOrder.js
8.6 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
"use strict";
var common_vendor = require("../../common/vendor.js");
var api_index = require("../../api/index.js");
require("../../utils/request.js");
if (!Array) {
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
const _easycom_u_tabs2 = common_vendor.resolveComponent("u-tabs");
const _easycom_u_count_down2 = common_vendor.resolveComponent("u-count-down");
(_easycom_u_navbar2 + _easycom_u_tabs2 + _easycom_u_count_down2)();
}
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
const _easycom_u_tabs = () => "../../uni_modules/uview-plus/components/u-tabs/u-tabs.js";
const _easycom_u_count_down = () => "../../uni_modules/uview-plus/components/u-count-down/u-count-down.js";
if (!Math) {
(_easycom_u_navbar + _easycom_u_tabs + _easycom_u_count_down + orderShop + PayMode + tipPops)();
}
const orderShop = () => "../../componets/orderShop.js";
const PayMode = () => "../../componets/checkPayMode.js";
const tipPops = () => "../../componets/tipPop.js";
const _sfc_main = {
setup(__props) {
common_vendor.onLoad((e) => {
tabStatus.value = e.status * 1;
});
common_vendor.onShow(() => {
console.log("\u8BA2\u5355\u72B6\u6001", tabStatus.value);
getOrderLists(tabStatus.value == 5 ? 21 : tabStatus.value * 1);
});
let tabStatus = common_vendor.ref(0);
let orderList = common_vendor.ref([]);
const list1 = common_vendor.reactive([{ name: "\u5168\u90E8" }, { name: "\u5F85\u4ED8\u6B3E" }, { name: "\u5F85\u53D1\u8D27" }, { name: "\u5F85\u6536\u8D27" }, { name: "\u5F85\u8BC4\u4EF7" }, { name: "\u552E\u540E" }]);
const operateOrder = (item, type) => {
orderId.value = item.id;
if (type == 0 || type == 2) {
tipType.value = type == 0 ? 1 : 2;
tipShow.value = true;
} else if (type == 1) {
modeShow.value = true;
} else if (type == 3) {
getReceipts();
} else if (type == 4) {
common_vendor.index.navigateTo({
url: "/pages/mine/evaluate"
});
} else if (type == 5) {
toDetaile(item.id);
}
};
const pointsBtns = (type) => {
console.log(type);
tipShow.value = false;
if (type == 1) {
tipType.value == 1 ? getCancleOrders() : getRefunds();
}
};
let orderId = common_vendor.ref("");
let integral = common_vendor.ref(0);
let tipType = common_vendor.ref(1);
let modeShow = common_vendor.ref(false);
let tipShow = common_vendor.ref(false);
const toDetaile = (id) => {
console.log("\u8BA2\u5355");
common_vendor.index.navigateTo({
url: `/pages/mine/orderDetail?id=${id}`
});
};
const copy = (text) => {
common_vendor.index.setClipboardData({
data: text,
success: () => {
common_vendor.index.showToast({ title: "\u590D\u5236\u6210\u529F", icon: "none" });
}
});
};
const click = (e) => {
console.log(e);
getOrderLists(e.index == 5 ? 21 : e.index == 4 ? 5 : e.index);
};
const getOrderLists = async (status) => {
try {
const res = await api_index.getOrderList(status);
orderList.value = res;
console.log("getOrderList", res);
} catch (err) {
common_vendor.index.showToast({
title: err,
icon: "none"
});
console.log("getOrderList", err);
}
};
const getCancleOrders = async () => {
try {
const res = await api_index.getCancleOrder(orderId.value);
common_vendor.index.showToast({ title: "\u8BA2\u5355\u5DF2\u53D6\u6D88~", icon: "none" });
tipShow.value = false;
tabStatus.value = 0;
getOrderLists(0);
console.log("getCancleOrder", res);
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getCancleOrder", err);
}
};
const getRefunds = async () => {
try {
const res = await api_index.getRefund(orderId.value);
common_vendor.index.showToast({ title: "\u5DF2\u7533\u8BF7,\u7B49\u5F85\u5BA2\u670D\u5BA1\u6838", icon: "none" });
getOrderLists(2);
console.log("getRefund", res);
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getRefund", err);
}
};
const getReceipts = async () => {
try {
const res = await api_index.getReceipt(orderId.value);
common_vendor.index.showToast({ title: "\u5DF2\u6536\u8D27,\u671F\u5F85\u4E0B\u6B21\u4E0B\u5355~", icon: "none" });
getOrderLists(3);
console.log("getReceipt", res);
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getReceipt", err);
}
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.p({
placeholder: true,
title: "\u8BA2\u5355",
bgColor: "#F8FAFB",
autoBack: true
}),
b: common_vendor.o(click),
c: common_vendor.p({
activeStyle: {
color: "#000000",
fontWeight: "bold",
transform: "scale(1.05)"
},
inactiveStyle: {
color: "#00000099",
transform: "scale(1)"
},
itemStyle: "padding-left: 5px;padding-bottom:12rpx; padding-right: 5px; height: 34px;",
list: common_vendor.unref(list1),
current: common_vendor.unref(tabStatus),
lineWidth: "15",
lineColor: "#FB753C",
scrollable: false
}),
d: common_vendor.f(common_vendor.unref(orderList), (item, index, i0) => {
return common_vendor.e({
a: item.order_status == 1
}, item.order_status == 1 ? {
b: "67be9ace-2-" + i0,
c: common_vendor.p({
time: item.time * 1e3,
format: "mm:ss"
})
} : {}, {
d: [3, 4, 21].includes(item.order_status)
}, [3, 4, 21].includes(item.order_status) ? {
e: common_vendor.t(item.express_no),
f: common_vendor.o(($event) => copy(item.express_no))
} : {}, {
g: "67be9ace-3-" + i0,
h: common_vendor.p({
shop: item
}),
i: item.order_status == 1
}, item.order_status == 1 ? common_vendor.e({
j: common_vendor.t(item.goodstatus_text == "" ? "\u53D6\u6D88\u4ED8\u6B3E" : "\u53D6\u6D88\u5151\u6362"),
k: common_vendor.o(($event) => operateOrder(item, 0)),
l: item.order_status == 1
}, item.order_status == 1 ? {
m: common_vendor.t(item.goodstatus_text == "" ? "\u7ACB\u5373\u652F\u4ED8" : "\u7ACB\u5373\u5151\u6362"),
n: common_vendor.o(($event) => operateOrder(item, 1))
} : {}) : {}, {
o: item.order_status == 2
}, item.order_status == 2 ? {
p: common_vendor.o(($event) => operateOrder(item, 2))
} : {}, {
q: item.order_status == 3
}, item.order_status == 3 ? common_vendor.e({
r: item.order_status == 3 && item.goodstatus_text == ""
}, item.order_status == 3 && item.goodstatus_text == "" ? {
s: common_vendor.o(($event) => true)
} : {}, {
t: common_vendor.o(($event) => operateOrder(item, 3))
}) : {}, {
v: item.order_status == 5
}, item.order_status == 5 ? {
w: common_vendor.o(($event) => operateOrder(item, 4))
} : {}, {
x: item.order_status == 21
}, item.order_status == 21 ? {
y: common_vendor.o(($event) => operateOrder(item, 5))
} : {}, {
z: item.id,
A: common_vendor.o(($event) => toDetaile(item.id), item.id)
});
}),
e: !common_vendor.unref(orderList).length
}, !common_vendor.unref(orderList).length ? {} : {}, {
f: common_vendor.o(($event) => common_vendor.isRef(modeShow) ? modeShow.value = false : modeShow = false),
g: common_vendor.p({
orderId: common_vendor.unref(orderId),
isOrderPay: true,
totalPrice: common_vendor.unref(orderList).total_price,
modeShow: common_vendor.unref(modeShow)
}),
h: common_vendor.o(pointsBtns),
i: common_vendor.p({
integral: common_vendor.unref(integral),
tipType: common_vendor.unref(tipType),
tipShow: common_vendor.unref(tipShow)
})
});
};
}
};
var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/vue/\u5927\u5065\u5EB7\u5546\u57CE/healthMall/pages/mine/myOrder.vue"]]);
wx.createPage(MiniProgramPage);