orderDetail.js
6.8 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
"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");
_easycom_u_navbar2();
}
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
if (!Math) {
(_easycom_u_navbar + shopAddres + orderShops + PayMode + tipPops)();
}
const shopAddres = () => "../../componets/address.js";
const orderShops = () => "../../componets/orderShop.js";
const tipPops = () => "../../componets/tipPop.js";
const PayMode = () => "../../componets/checkPayMode.js";
const _sfc_main = {
setup(__props) {
common_vendor.onLoad((e) => {
console.log(e.id);
orderId.value = e.id;
getOrderdetails(e.id);
});
let tipShow = common_vendor.ref(false);
let orderList = common_vendor.ref({});
let modeShow = common_vendor.ref(false);
let orderId = common_vendor.ref("");
let btnType = common_vendor.ref(1);
let integral = common_vendor.ref(0);
let tipType = common_vendor.ref(1);
let placeOrder = common_vendor.ref([
{ id: 1, name: "\u8BA2\u5355\u7F16\u53F7", text: "1212" },
{ id: 2, name: "\u652F\u4ED8\u65B9\u5F0F", text: "1212" },
{ id: 3, name: "\u4E0B\u5355\u65F6\u95F4", text: "1212" },
{ id: 4, name: "\u5FEB\u9012\u7F16\u53F7", text: "1212" }
]);
const leftClickHandler = () => {
common_vendor.index.navigateBack({ delta: 1 });
};
const copy = () => {
common_vendor.index.setClipboardData({
data: orderList.value.express_no,
success: () => {
common_vendor.index.showToast({ title: "\u590D\u5236\u6210\u529F", icon: "none" });
}
});
};
const btns = (type) => {
if (type == 0) {
tipType.value = btnType.value == 1 ? 1 : 2;
tipShow.value = true;
} else {
btnType.value == 1 ? modeShow.value = true : getReceipts();
}
};
const pointsBtns = (type) => {
console.log(type);
tipShow.value = false;
if (type == 1) {
tipType.value == 1 ? getCancleOrders() : getRefunds();
}
};
const { proxy } = common_vendor.getCurrentInstance();
const getOrderdetails = async (id) => {
try {
const res = await api_index.getOrderdetail(id);
orderList.value = res;
btnType.value = res.order_status;
placeOrder.value[0].text = res.order_no;
placeOrder.value[1].text = res.zhifu == 1 ? "\u5FAE\u4FE1" : "\u4F59\u989D";
placeOrder.value[2].text = res.createtime;
placeOrder.value[3].text = res.express_no;
console.log("getOrderdetail", res);
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getOrderdetail", err);
}
};
const getCancleOrders = async () => {
try {
const res = await api_index.getCancleOrder(orderId.value);
proxy.$methods.showTN("\u8BA2\u5355\u5DF2\u53D6\u6D88~");
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);
proxy.$methods.showTN("\u5DF2\u7533\u8BF7,\u7B49\u5F85\u5BA2\u670D\u5BA1\u6838");
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);
proxy.$methods.showTN("\u5DF2\u6536\u8D27,\u671F\u5F85\u4E0B\u6B21\u4E0B\u5355~");
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.o(leftClickHandler),
b: common_vendor.p({
bgColor: "transparent",
placeholder: true
}),
c: common_vendor.p({
isOrder: true,
adress: common_vendor.unref(orderList)
}),
d: common_vendor.p({
shop: common_vendor.unref(orderList)
}),
e: common_vendor.unref(orderList).goodstatus_text !== 3
}, common_vendor.unref(orderList).goodstatus_text !== 3 ? {
f: common_vendor.t(common_vendor.unref(orderList).total_price)
} : {}, {
g: common_vendor.unref(orderList).goodstatus_text === 3
}, common_vendor.unref(orderList).goodstatus_text === 3 ? {
h: common_vendor.t(common_vendor.unref(orderList).express_price),
i: common_vendor.t(common_vendor.unref(orderList).score),
j: common_vendor.t(common_vendor.unref(orderList).express_price)
} : {}, {
k: common_vendor.f(common_vendor.unref(placeOrder), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.name),
b: common_vendor.t(item.text),
c: index == 0
}, index == 0 ? {
d: common_vendor.o(copy)
} : {}, {
e: item.id
});
}),
l: common_vendor.unref(btnType) == 3
}, common_vendor.unref(btnType) == 3 ? {} : {}, {
m: common_vendor.unref(btnType) <= 2
}, common_vendor.unref(btnType) <= 2 ? {
n: common_vendor.t(common_vendor.unref(btnType) == 1 ? "\u53D6\u6D88\u4ED8\u6B3E" : common_vendor.unref(btnType) == 2 ? "\u7533\u8BF7\u9000\u6B3E" : "\u8054\u7CFB\u5BA2\u670D"),
o: common_vendor.o(($event) => btns(0))
} : {}, {
p: common_vendor.unref(btnType) == 1 || common_vendor.unref(btnType) == 3
}, common_vendor.unref(btnType) == 1 || common_vendor.unref(btnType) == 3 ? {
q: common_vendor.t(common_vendor.unref(btnType) == 1 ? "\u7ACB\u5373\u652F\u4ED8" : "\u786E\u8BA4\u6536\u8D27"),
r: common_vendor.o(($event) => btns(1))
} : {}, {
s: common_vendor.o(($event) => common_vendor.isRef(modeShow) ? modeShow.value = false : modeShow = false),
t: common_vendor.p({
orderId: common_vendor.unref(orderId),
isOrderPay: true,
totalPrice: common_vendor.unref(orderList).total_price,
modeShow: common_vendor.unref(modeShow)
}),
v: common_vendor.o(pointsBtns),
w: 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/orderDetail.vue"]]);
wx.createPage(MiniProgramPage);