102 lines
3.3 KiB
JavaScript
102 lines
3.3 KiB
JavaScript
"use strict";
|
|||
|
|
const common_vendor = require("../../common/vendor.js");
|
||
|
|
const api_payment = require("../../api/payment.js");
|
||
|
|
const Header = () => "../../components/header.js";
|
||
|
|
const _sfc_main = {
|
||
|
|
components: {
|
||
|
|
Header
|
||
|
|
},
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
orderNum: 0,
|
||
|
|
// 支付处理ID
|
||
|
|
paymentLink: null,
|
||
|
|
// H5支付处理页面
|
||
|
|
orderMsg: "支付处理中...",
|
||
|
|
loadingShow: true
|
||
|
|
};
|
||
|
|
},
|
||
|
|
onLoad(options) {
|
||
|
|
common_vendor.index.__f__("log", "at pages/payment_processing/payment_processing.vue:28", "options", options);
|
||
|
|
this.orderNum = options.orderNum || 0;
|
||
|
|
const paymentLink = options.link;
|
||
|
|
if (paymentLink && paymentLink !== "null") {
|
||
|
|
this.paymentLink = paymentLink;
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: `/pages/zfb_payment/zfb_payment?link=${paymentLink}`
|
||
|
|
// 假设有一个专门的支付页面来处理支付链接
|
||
|
|
});
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onShow() {
|
||
|
|
if (this.orderNum) {
|
||
|
|
this.getOrderById();
|
||
|
|
}
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
async getOrderById() {
|
||
|
|
const params = {
|
||
|
|
orderNum: this.orderNum
|
||
|
|
};
|
||
|
|
common_vendor.index.__f__("log", "at pages/payment_processing/payment_processing.vue:48", "params", params);
|
||
|
|
const resp = await api_payment.queryResult(params);
|
||
|
|
common_vendor.index.__f__("log", "at pages/payment_processing/payment_processing.vue:50", "queryResult resp", resp);
|
||
|
|
if (resp && resp.bizcode === 100) {
|
||
|
|
const data = resp.data || {};
|
||
|
|
if (data.state === 0) {
|
||
|
|
this.loadingShow = false;
|
||
|
|
this.orderMsg = "订单不存在";
|
||
|
|
} else if (data.state === 1) {
|
||
|
|
this.orderMsg = "支付处理中...";
|
||
|
|
} else if (data.state === 2) {
|
||
|
|
this.loadingShow = false;
|
||
|
|
this.orderMsg = "支付成功";
|
||
|
|
this.jumpWayOk();
|
||
|
|
} else if (data.state === 3) {
|
||
|
|
this.loadingShow = false;
|
||
|
|
this.orderMsg = "支付失败";
|
||
|
|
this.jumpWayError();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// 跳转到支付成功页面
|
||
|
|
jumpWayOk() {
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: "/pages/order_submit_ok/order_submit_ok"
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 跳转到支付失败页面
|
||
|
|
jumpWayError() {
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: "/pages/order_submit_error/order_submit_error"
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
if (!Array) {
|
||
|
|
const _component_Header = common_vendor.resolveComponent("Header");
|
||
|
|
const _easycom_up_loading_icon2 = common_vendor.resolveComponent("up-loading-icon");
|
||
|
|
(_component_Header + _easycom_up_loading_icon2)();
|
||
|
|
}
|
||
|
|
const _easycom_up_loading_icon = () => "../../uni_modules/uview-plus/components/u-loading-icon/u-loading-icon.js";
|
||
|
|
if (!Math) {
|
||
|
|
_easycom_up_loading_icon();
|
||
|
|
}
|
||
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||
|
|
return {
|
||
|
|
a: common_vendor.p({
|
||
|
|
leftTitle: "H5支付",
|
||
|
|
leftPathType: "switchTab",
|
||
|
|
leftPath: "/pages/mine/mine"
|
||
|
|
}),
|
||
|
|
b: common_vendor.p({
|
||
|
|
show: $data.loadingShow,
|
||
|
|
color: "#009A4F"
|
||
|
|
}),
|
||
|
|
c: common_vendor.t($data.orderMsg)
|
||
|
|
};
|
||
|
|
}
|
||
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f7613669"]]);
|
||
|
|
wx.createPage(MiniProgramPage);
|
||
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/payment_processing/payment_processing.js.map
|