353 lines
10 KiB
JavaScript
353 lines
10 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_shop_order_index = require("../../api/shop/order/index.js");
|
|
const api_booking_field_index = require("../../api/booking/field/index.js");
|
|
const api_shop_wechatDeposit_index = require("../../api/shop/wechatDeposit/index.js");
|
|
const store_modules_user = require("../../store/modules/user.js");
|
|
const userStore = store_modules_user.useUserStore();
|
|
const _sfc_main = {
|
|
components: {},
|
|
data() {
|
|
return {
|
|
isLogin: false,
|
|
orderNo: "",
|
|
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: "文字"
|
|
}
|
|
],
|
|
colors: ["#333333", "#4cd964", "#dd524d"],
|
|
current: 0,
|
|
colorIndex: 0,
|
|
activeColor: "#108001",
|
|
styleType: "text"
|
|
};
|
|
},
|
|
onLoad(option) {
|
|
this.orderNo = option.orderNo;
|
|
this.logo = common_vendor.index.getStorageSync("app_logo") ? common_vendor.index.getStorageSync("app_logo") : "https://oss.wsdns.cn/20240423/7f6878104a6d4427884721f412ab5441.png?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90";
|
|
this.reload();
|
|
},
|
|
onShow() {
|
|
},
|
|
// 触底函数
|
|
onReachBottom() {
|
|
const app = this;
|
|
const { where } = this;
|
|
if (app.canReset) {
|
|
app.where.page = ++where.page;
|
|
app.reload();
|
|
}
|
|
},
|
|
methods: {
|
|
async reload() {
|
|
const app = this;
|
|
const userInfo = await userStore.fetchUserInfo();
|
|
if (Object.keys(userInfo).length > 0) {
|
|
app.isLogin = true;
|
|
}
|
|
const { where, userId, orderNo } = this;
|
|
console.log("userId: ", userId);
|
|
where.userId = userId;
|
|
api_shop_order_index.getByOrderNo(orderNo).then((data) => {
|
|
app.form = data;
|
|
if (data.orderStatus == 1) {
|
|
common_vendor.index.setNavigationBarTitle({
|
|
title: "订单核销"
|
|
});
|
|
}
|
|
common_vendor.index.hideLoading();
|
|
}).catch((err) => {
|
|
console.log("err: ", err);
|
|
app.form = {};
|
|
common_vendor.index.hideLoading();
|
|
});
|
|
},
|
|
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();
|
|
},
|
|
// 弹出登录提示框
|
|
// openLogin() {
|
|
// if (!this.isLogin) {
|
|
// this.$refs.login.open('bottom');
|
|
// return false;
|
|
// }
|
|
// },
|
|
// 弹出登录提示框
|
|
async openLogin() {
|
|
if (!this.isLogin) {
|
|
this.$refs.login.open("bottom");
|
|
}
|
|
},
|
|
save() {
|
|
const app = this;
|
|
const { orderNo } = this;
|
|
common_vendor.index.showLoading({
|
|
title: "请求中."
|
|
});
|
|
api_booking_field_index.verification(orderNo).then((res) => {
|
|
common_vendor.index.showToast({
|
|
title: "核销成功",
|
|
icon: "success"
|
|
});
|
|
common_vendor.index.hideLoading();
|
|
app.reload();
|
|
}).catch((res) => {
|
|
common_vendor.index.showToast({
|
|
title: res.message || "请检查您的网络.",
|
|
icon: "none"
|
|
});
|
|
common_vendor.index.hideLoading();
|
|
app.reload();
|
|
});
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
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_button2 = common_vendor.resolveComponent("uv-button");
|
|
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
|
|
(_easycom_uv_cell2 + _easycom_uv_cell_group2 + _easycom_uni_card2 + _easycom_uv_parse2 + _easycom_uv_gap2 + _easycom_uv_button2 + _easycom_ws_login2)();
|
|
}
|
|
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_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_cell + _easycom_uv_cell_group + _easycom_uni_card + _easycom_uv_parse + _easycom_uv_gap + _easycom_uv_button + _easycom_ws_login)();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: $data.isLogin
|
|
}, $data.isLogin ? common_vendor.e({
|
|
b: common_vendor.p({
|
|
title: `${$data.form.merchantName}`,
|
|
label: ` `,
|
|
cellStyle: {
|
|
padding: "0",
|
|
paddingBottom: "5px"
|
|
},
|
|
border: false
|
|
}),
|
|
c: common_vendor.f($data.form.orderInfo, (item, index, i0) => {
|
|
return {
|
|
a: "6e3de76a-3-" + i0 + ",6e3de76a-1",
|
|
b: common_vendor.p({
|
|
title: `${item.fieldName}`,
|
|
label: `${item.comments}`,
|
|
cellStyle: {
|
|
padding: "0",
|
|
paddingBottom: "5px"
|
|
},
|
|
value: `¥${item.price}`,
|
|
border: false
|
|
}),
|
|
c: index
|
|
};
|
|
}),
|
|
d: common_vendor.p({
|
|
customStyle: {
|
|
backgroundColor: "#ffffff"
|
|
},
|
|
border: false
|
|
}),
|
|
e: common_vendor.t($data.form.totalPrice),
|
|
f: common_vendor.t($data.form.payPrice),
|
|
g: common_vendor.p({
|
|
title: "预定信息",
|
|
border: false,
|
|
["is-shadow"]: false,
|
|
padding: 0
|
|
}),
|
|
h: $data.form.orderNo
|
|
}, $data.form.orderNo ? common_vendor.e({
|
|
i: common_vendor.p({
|
|
title: `姓名`,
|
|
value: `${$data.form.realName}`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
}
|
|
}),
|
|
j: common_vendor.p({
|
|
title: `手机号码`,
|
|
value: `${$data.form.phone}`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
}
|
|
}),
|
|
k: common_vendor.p({
|
|
title: `订单号`,
|
|
value: `${$data.form.orderId}`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
}
|
|
}),
|
|
l: common_vendor.p({
|
|
content: $data.form.orderNo,
|
|
selectable: true
|
|
}),
|
|
m: common_vendor.p({
|
|
title: `订单编号`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
}
|
|
}),
|
|
n: $data.form.orderStatus == 0
|
|
}, $data.form.orderStatus == 0 ? {
|
|
o: common_vendor.t(`${$data.orderStatus[$data.form.orderStatus]}`)
|
|
} : {}, {
|
|
p: $data.form.orderStatus == 1
|
|
}, $data.form.orderStatus == 1 ? {
|
|
q: common_vendor.t(`${$data.orderStatus[$data.form.orderStatus]}`)
|
|
} : {}, {
|
|
r: common_vendor.p({
|
|
title: `订单状态`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
}
|
|
}),
|
|
s: common_vendor.p({
|
|
title: `下单时间`,
|
|
value: `${$data.form.createTime}`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
}
|
|
}),
|
|
t: common_vendor.p({
|
|
title: `支付方式`,
|
|
value: `${$data.payType[$data.form.payType]}`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
}
|
|
}),
|
|
v: common_vendor.p({
|
|
title: `优惠说明`,
|
|
value: `${$data.form.couponDesc ? $data.form.couponDesc : "无"}`,
|
|
cellStyle: {
|
|
padding: "8px"
|
|
},
|
|
border: false
|
|
}),
|
|
w: common_vendor.p({
|
|
customStyle: {
|
|
backgroundColor: "#ffffff",
|
|
padding: "8px 0"
|
|
},
|
|
border: false
|
|
}),
|
|
x: common_vendor.p({
|
|
border: false,
|
|
["is-shadow"]: false,
|
|
padding: 0
|
|
})
|
|
}) : {}, {
|
|
y: common_vendor.p({
|
|
height: "20"
|
|
}),
|
|
z: $data.form.orderStatus == 0
|
|
}, $data.form.orderStatus == 0 ? {
|
|
A: common_vendor.o($options.save),
|
|
B: common_vendor.p({
|
|
customStyle: {
|
|
background: "linear-gradient(to right, #ccff66, #008e04)",
|
|
borderRadius: "30px",
|
|
color: "#ffffff"
|
|
},
|
|
text: "确认核销"
|
|
})
|
|
} : {}) : {
|
|
C: common_vendor.o($options.openLogin),
|
|
D: common_vendor.p({
|
|
customStyle: {
|
|
background: "linear-gradient(to right, #ccff66, #008e04)",
|
|
borderRadius: "30px",
|
|
color: "#ffffff"
|
|
},
|
|
text: "请先登录"
|
|
}),
|
|
E: common_vendor.sr("login", "6e3de76a-18"),
|
|
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/admin/order-scan.vue"]]);
|
|
wx.createPage(MiniProgramPage);
|