confirmOrder.js
5.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
"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 + payMode + tipPop)();
}
const payMode = () => "../../componets/checkPayMode.js";
const tipPop = () => "../../componets/tipPop.js";
const shopAddres = () => "../../componets/address.js";
const _sfc_main = {
setup(__props) {
common_vendor.onLoad((e) => {
if (e.ids) {
car_Id.value = e.ids;
getCarsettlements(e.ids);
} else {
shopType.value = e.shopType;
payParams.value = JSON.parse(e.params);
getbBuyDatas(JSON.parse(e.params));
console.log(e.params, "\u5546\u54C1\u89C4\u683C\u4FE1\u606F");
}
common_vendor.index.getStorageSync("defaultAdres") ? adress.value = common_vendor.index.getStorageSync("defaultAdres") : "";
});
common_vendor.onShow(() => {
common_vendor.index.getStorageSync("balance") ? balance.value = common_vendor.index.getStorageSync("balance") : "";
});
let modeShow = common_vendor.ref(false);
let payParams = common_vendor.ref({});
let shopType = common_vendor.ref(1);
let car_Id = common_vendor.ref("");
let balance = common_vendor.ref(0);
let buyShop = common_vendor.ref([]);
let orderInfo = common_vendor.ref({});
const getbBuyDatas = async (obj) => {
try {
let params = {
goods_id: obj.id,
num: obj.num,
goods_spec_id: obj.specId
};
const res = await api_index.getbBuyData(params);
buyShop.value = res.goods_list;
orderInfo.value = res;
console.log("getbBuyData", res);
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getbBuyData", err);
}
};
const getCarsettlements = async (ids) => {
try {
const res = await api_index.getCarsettlement(ids);
buyShop.value = res.goods_list;
orderInfo.value = res;
console.log("getCarsettlement", res);
} catch (err) {
common_vendor.index.showToast({ title: err, icon: "none" });
console.log("getCarsettlement", err);
}
};
let adress = common_vendor.ref({});
const checkAddress = () => {
common_vendor.index.navigateTo({
url: `/pages/mine/myAddress?isCheck=${1}`,
events: {
steBack: (data) => {
adress.value = data;
console.log("\u5730\u5740", data);
}
}
});
};
const tipShow = common_vendor.ref(false);
const pointsBtns = (type) => {
tipShow.value = false;
if (type == 1) {
modeShow.value = true;
}
};
const btns = () => {
if (shopType.value == 3) {
console.log("\u7ACB\u5373\u5151\u6362\u6309\u94AE");
if (common_vendor.index.getStorageSync("myPoints") < orderInfo.value.coscore)
return common_vendor.index.showToast({ title: "\u60A8\u7684\u79EF\u5206\u4E0D\u8DB3~", icon: "none" });
tipShow.value = true;
} else {
modeShow.value = true;
console.log("\u7ACB\u5373\u8D2D\u4E70");
}
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.p({
bgColor: "#F6F8FA",
placeholder: true,
title: "",
autoBack: true
}),
b: !common_vendor.unref(adress).name
}, !common_vendor.unref(adress).name ? {
c: common_vendor.o(checkAddress)
} : {
d: common_vendor.p({
adress: common_vendor.unref(adress)
})
}, {
e: common_vendor.f(common_vendor.unref(buyShop), (item, k0, i0) => {
return common_vendor.e({
a: item.image,
b: common_vendor.t(item.name),
c: common_vendor.t(item.describe)
}, common_vendor.unref(shopType) != 3 ? {
d: common_vendor.t(item.goods_price)
} : {
e: common_vendor.t(common_vendor.unref(orderInfo).coscore)
}, {
f: common_vendor.t(item.total_num),
g: item.id
});
}),
f: common_vendor.unref(shopType) != 3,
g: common_vendor.unref(shopType) == 3
}, common_vendor.unref(shopType) == 3 ? {
h: common_vendor.t(common_vendor.unref(orderInfo).express_price)
} : {}, {
i: common_vendor.unref(shopType) == 3
}, common_vendor.unref(shopType) == 3 ? {
j: common_vendor.t(common_vendor.unref(orderInfo).coscore),
k: common_vendor.t(common_vendor.unref(orderInfo).express_price)
} : {
l: common_vendor.t(common_vendor.unref(orderInfo).total_price)
}, {
m: common_vendor.t(common_vendor.unref(shopType) == 3 ? "\u7ACB\u5373\u5151\u6362" : "\u7ACB\u5373\u8D2D\u4E70"),
n: common_vendor.o(btns),
o: common_vendor.o(($event) => common_vendor.isRef(modeShow) ? modeShow.value = false : modeShow = false),
p: common_vendor.p({
car_Id: common_vendor.unref(car_Id),
balance: common_vendor.unref(balance),
totalPrice: common_vendor.unref(orderInfo).total_price,
adressId: common_vendor.unref(adress).id,
payParams: common_vendor.unref(payParams),
modeShow: common_vendor.unref(modeShow)
}),
q: common_vendor.o(pointsBtns),
r: common_vendor.p({
integral: common_vendor.unref(orderInfo).coscore,
tipShow: tipShow.value
})
});
};
}
};
var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/vue/\u5927\u5065\u5EB7\u5546\u57CE/healthMall/pages/shopCar/confirmOrder.vue"]]);
wx.createPage(MiniProgramPage);