Files
gxtyzx-uniapp/dist/dev/mp-weixin/package/order/detail.js
T

379 lines
11 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const api_shop_order_index = require("../../api/shop/order/index.js");
const api_shop_wechatDeposit_index = require("../../api/shop/wechatDeposit/index.js");
const _sfc_main = {
components: {},
data() {
return {
isLogin: false,
orderId: 0,
userId: 0,
form: {},
where: {
page: 1
},
canReset: false,
loadMore: "more",
logo: "",
items: ["全部订单", "未支付", "已支付", "已完成", "押金"],
orderStatus: ["未使用", "已完成", "已取消", "取消中", "退款申请中", "退款被拒绝", "退款成功", "客户端申请退款"],
payType: [
"余额支付",
"微信支付",
"会员卡支付",
"支付宝",
"现金",
"POS机",
"VIP月卡",
"VIP年卡",
"VIP次卡",
"IC月卡",
"IC年卡",
"IC次卡",
"免费",
"VIP充值卡",
"IC充值卡",
"积分支付",
"VIP季卡",
"IC季卡"
],
orderList: [],
styles: [
{
value: "button",
text: "按钮",
checked: true
},
{
value: "text",
text: "文字"
}
],
h5_url: "",
colors: ["#333333", "#4cd964", "#dd524d"],
current: 0,
colorIndex: 0,
activeColor: "#108001",
styleType: "text"
};
},
onLoad(option) {
this.orderId = option.id;
this.openLogin();
this.reload();
},
onShow() {
this.openLogin();
},
// 触底函数
onReachBottom() {
const app = this;
const { where } = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
reload() {
const app = this;
const { where, userId, orderId } = this;
if (userId == 0) {
app.openLogin();
return;
}
where.userId = userId;
common_vendor.index.showLoading({
title: "数据读取中."
});
api_shop_order_index.getOrder(orderId).then((data) => {
console.log("data: ", data);
app.form = data;
if (data.orderStatus == 1) {
common_vendor.index.setNavigationBarTitle({
title: "订单详情(已完成)"
});
}
common_vendor.index.hideLoading();
});
const h5_url = common_vendor.index.getStorageSync("h5_url");
const tid = common_vendor.index.getStorageSync("TenantId");
if (h5_url) {
app.h5_url = h5_url;
} else {
app.h5_url = `http://${tid}.h5.wsdns.cn`;
}
},
navTo(url) {
common_vendor.index.navigateTo({
url
});
},
onClickItem(e) {
const app = this;
const { where, userId } = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
if (userId == 0) {
app.openLogin();
return;
}
if (index == 0) {
where.payStatus = void 0;
where.orderStatus = void 0;
}
if (index == 1) {
where.payStatus = 2;
}
if (index == 2) {
where.payStatus = 1;
}
if (index == 3) {
where.orderStatus = 1;
}
if (index == 4) {
api_shop_wechatDeposit_index.pageWechatDeposit({
uid: common_vendor.index.getStorageSync("user_id")
}).then((res) => {
console.log("res: ", res);
app.orderList = res.list;
});
return false;
}
this.reload();
},
// 弹出登录提示框
async openLogin() {
this.userId = common_vendor.index.getStorageSync("user_id");
if (!this.userId) {
this.$refs.login.open("bottom");
return false;
}
}
}
};
if (!Array) {
const _easycom_uv_qrcode2 = common_vendor.resolveComponent("uv-qrcode");
const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell");
const _easycom_uv_cell_group2 = common_vendor.resolveComponent("uv-cell-group");
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
const _easycom_uv_parse2 = common_vendor.resolveComponent("uv-parse");
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
const _easycom_uv_count_to2 = common_vendor.resolveComponent("uv-count-to");
const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button");
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
(_easycom_uv_qrcode2 + _easycom_uv_cell2 + _easycom_uv_cell_group2 + _easycom_uni_card2 + _easycom_uv_parse2 + _easycom_uv_gap2 + _easycom_uv_count_to2 + _easycom_uv_button2 + _easycom_ws_login2)();
}
const _easycom_uv_qrcode = () => "../../uni_modules/uv-qrcode/components/uv-qrcode/uv-qrcode.js";
const _easycom_uv_cell = () => "../../uni_modules/uv-cell/components/uv-cell/uv-cell.js";
const _easycom_uv_cell_group = () => "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group.js";
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
const _easycom_uv_parse = () => "../../uni_modules/uv-parse/components/uv-parse/uv-parse.js";
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
const _easycom_uv_count_to = () => "../../uni_modules/uv-count-to/components/uv-count-to/uv-count-to.js";
const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js";
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
if (!Math) {
(_easycom_uv_qrcode + _easycom_uv_cell + _easycom_uv_cell_group + _easycom_uni_card + _easycom_uv_parse + _easycom_uv_gap + _easycom_uv_count_to + _easycom_uv_button + _easycom_ws_login)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.form.orderId
}, $data.form.orderId ? common_vendor.e({
b: $data.form.payStatus == 1 && $data.form.orderStatus == 0
}, $data.form.payStatus == 1 && $data.form.orderStatus == 0 ? {
c: common_vendor.sr("qrcode", "69543d40-0"),
d: common_vendor.p({
size: "280rpx",
options: {
data: $data.form.orderNo,
foregroundImageSrc: $data.form.merchantAvatar,
margin: 10,
foregroundImagePadding: 4,
foregroundImageHeight: 30,
foregroundImageWidth: 30,
foregroundImageBorderRadius: 4
},
value: `${$data.h5_url}#/package/admin/order-scan?orderNo=${$data.form.orderNo}`
})
} : {}, {
e: common_vendor.p({
title: `${$data.form.merchantName}`,
label: ` `,
cellStyle: {
padding: "0",
paddingBottom: "5px"
},
border: false
}),
f: common_vendor.f($data.form.orderInfo, (item, index, i0) => {
return common_vendor.e({
a: "69543d40-4-" + i0 + ",69543d40-2",
b: common_vendor.p({
title: `${item.fieldName}`,
label: `${item.comments}`,
cellStyle: {
padding: "0",
paddingBottom: "5px"
},
value: `¥${item.price}`,
border: item.isChildren
}),
c: item.isChildren
}, item.isChildren ? {
d: "69543d40-5-" + i0 + ",69543d40-2",
e: common_vendor.p({
label: `成人票 ¥50`,
value: `x ${item.adultNum}`,
cellStyle: {
padding: "0",
paddingBottom: "5px"
},
border: false
})
} : {}, {
f: item.isChildren
}, item.isChildren ? {
g: "69543d40-6-" + i0 + ",69543d40-2",
h: common_vendor.p({
label: `儿童票 ¥35`,
value: `x ${item.childrenNum}`,
cellStyle: {
padding: "0",
paddingBottom: "5px"
},
border: false
})
} : {}, {
i: index
});
}),
g: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff"
},
border: false
}),
h: common_vendor.t($data.form.totalPrice),
i: common_vendor.t($data.form.payPrice),
j: common_vendor.p({
title: "预定信息",
border: false,
["is-shadow"]: false,
padding: 0
}),
k: $data.form.orderNo
}, $data.form.orderNo ? common_vendor.e({
l: common_vendor.p({
title: `姓名`,
value: `${$data.form.realName}`,
cellStyle: {
padding: "8px"
}
}),
m: common_vendor.p({
title: `手机号码`,
value: `${$data.form.phone}`,
cellStyle: {
padding: "8px"
}
}),
n: common_vendor.p({
title: `订单号`,
value: `${$data.form.orderId}`,
cellStyle: {
padding: "8px"
}
}),
o: common_vendor.p({
content: $data.form.orderNo,
selectable: true
}),
p: common_vendor.p({
title: `订单编号`,
cellStyle: {
padding: "8px"
}
}),
q: $data.form.payStatus == 0
}, $data.form.payStatus == 0 ? {} : {
r: common_vendor.t($data.orderStatus[$data.form.orderStatus])
}, {
s: common_vendor.p({
title: `订单状态`,
cellStyle: {
padding: "8px"
}
}),
t: common_vendor.p({
title: `下单时间`,
value: `${$data.form.createTime}`,
cellStyle: {
padding: "8px"
}
}),
v: common_vendor.p({
title: `支付方式`,
value: `${$data.payType[$data.form.payType]}`,
cellStyle: {
padding: "8px"
}
}),
w: common_vendor.p({
title: `优惠说明`,
value: `${$data.form.couponDesc ? $data.form.couponDesc : "无"}`,
cellStyle: {
padding: "8px"
},
border: false
}),
x: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff",
padding: "8px 0"
},
border: false
}),
y: common_vendor.p({
border: false,
["is-shadow"]: false,
padding: 0
})
}) : {}, {
z: common_vendor.p({
height: "20"
}),
A: $data.form.payStatus == 0
}, $data.form.payStatus == 0 ? {
B: common_vendor.p({
decimals: "2",
duration: "30",
color: "#ebcf00",
bold: true,
endVal: $data.form.payPrice
}),
C: common_vendor.o(($event) => $options.navTo(`/package/booking/confirm?id=${$data.form.orderId}`)),
D: common_vendor.p({
customStyle: {
background: "linear-gradient(to right, #70b915, #008e04)",
borderRadius: "0 30px 30px 0",
color: "#ffffff",
border: "none",
padding: "22px 30px"
},
text: "去支付"
})
} : {}, {
E: common_vendor.sr("login", "69543d40-21"),
F: common_vendor.o($options.reload),
G: common_vendor.p({
logo: $data.logo
})
}) : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/order/detail.vue"]]);
wx.createPage(MiniProgramPage);