matchPayDone.js
3.53 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
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_match = require("../../common/match.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = {
__name: "matchPayDone",
setup(__props) {
const data = common_vendor.reactive({
chargeFlag: "",
amount: "",
payType: ""
});
const { chargeFlag, payType, amount } = common_vendor.toRefs(data);
getApp();
let cptId;
let groupId;
common_vendor.onLoad((option) => {
console.log(option);
cptId = option.cptId;
groupId = option.groupId;
chargeFlag.value = option.chargeFlag;
option.orderId;
if (option.amount) {
amount.value = option.amount;
}
if (option.payType) {
payType.value = option.payType;
}
});
function goDetail() {
common_vendor.index.redirectTo({
url: `/pages/usercenter/matchSignDetail?id=${cptId}&groupId=${groupId}&auditStatus=1}`
});
}
function download() {
common_match.downloadpz(cptId, groupId).then((res) => {
goWebView(res.data);
});
}
function goWebView(url) {
console.log(url);
url = url.replace("http://", "https://");
common_vendor.index.showLoading({
title: "下载中"
});
common_vendor.index.downloadFile({
url,
success: function(res) {
common_vendor.index.hideLoading();
var filePath = res.tempFilePath;
common_vendor.index.showLoading({
title: "正在打开"
});
common_vendor.index.openDocument({
filePath,
showMenu: true,
success: function(res2) {
common_vendor.index.hideLoading();
},
fail: function(err) {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: err,
icon: "none",
duration: 2e3
});
}
});
},
fail: function(error) {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: `下载失败`,
icon: "none",
duration: 2e3
});
}
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.p({
type: "checkbox-filled",
size: "100",
color: "#1EC886"
}),
b: common_vendor.unref(chargeFlag) == "0"
}, common_vendor.unref(chargeFlag) == "0" ? {} : common_vendor.e({
c: common_vendor.t(common_vendor.unref(amount)),
d: common_vendor.unref(payType) == "0"
}, common_vendor.unref(payType) == "0" ? {} : common_vendor.unref(payType) == "1" ? {} : common_vendor.unref(payType) == "2" ? {} : {}, {
e: common_vendor.unref(payType) == "1",
f: common_vendor.unref(payType) == "2"
}), {
g: common_vendor.o(download),
h: common_vendor.o(goDetail)
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-9177fafc"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_match/match/matchPayDone.vue"]]);
wx.createPage(MiniProgramPage);