@zhangcf233/pay 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pay.es.js +822 -534
- package/dist/pay.umd.js +2 -2
- package/dist/types/api/getChannels.d.ts +6 -3
- package/dist/types/api/getEnabledChannel.d.ts +3 -2
- package/dist/types/api/index.d.ts +2 -3
- package/dist/types/api/{alipay.d.ts → pay/alipay.d.ts} +1 -1
- package/dist/types/api/{pay.d.ts → pay/index.d.ts} +3 -3
- package/dist/types/api/pay/wechat.d.ts +11 -0
- package/dist/types/api/request.d.ts +2 -2
- package/dist/types/components/balance/balance.vue.d.ts +1 -1
- package/dist/types/components/channels/channel-container.vue.d.ts +2 -1
- package/dist/types/components/popup.vue.d.ts +1 -1
- package/dist/types/components/price/price-container.vue.d.ts +1 -1
- package/dist/types/components/price/price.vue.d.ts +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/{@types → types}/channel.d.ts +9 -2
- package/dist/types/{@types → types}/config.d.ts +3 -0
- package/dist/types/{@types → types}/create.d.ts +1 -1
- package/package.json +2 -2
- package/dist/types/@types/api.d.ts +0 -6
- /package/dist/types/api/{fail.d.ts → tools/fail.d.ts} +0 -0
- /package/dist/types/api/{success.d.ts → tools/success.d.ts} +0 -0
- /package/dist/types/{@types → types}/index.d.ts +0 -0
- /package/dist/types/{@types → types}/money.d.ts +0 -0
- /package/dist/types/{@types → types}/post.d.ts +0 -0
- /package/dist/types/{@types → types}/price.d.ts +0 -0
package/dist/pay.es.js
CHANGED
|
@@ -1,99 +1,212 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
headers: {
|
|
19
|
-
AppToken: i,
|
|
20
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
21
|
-
},
|
|
22
|
-
body: new URLSearchParams(n).toString()
|
|
23
|
-
}).then(async (a) => {
|
|
24
|
-
if (!a.ok) {
|
|
25
|
-
const l = await a.text();
|
|
26
|
-
throw new Error(`HTTP ${a.status} ${a.statusText}: ${l}`);
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
return await a.json();
|
|
30
|
-
} catch {
|
|
31
|
-
s("解析 JSON 异常");
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";.pay-error-container[data-v-0817c014]{position:relative}.pay-error-container .loading[data-v-0817c014]{width:100%;height:100%;position:absolute;background:#fff;z-index:1;transition:all .3s;justify-content:center;align-items:center}.pay-error-container .message[data-v-0817c014]{font-size:.1rem}@font-face{font-family:WeChat-Bold;src:url(https://shangrao-qqzh.oss-cn-hangzhou.aliyuncs.com/pay/fonts/WeChatSansStd-Bold.ttf)}.wechat-font[data-v-20b4bf5f]{font-family:WeChat-Bold}.root[data-v-20b4bf5f]{text-align:center}.cell[data-v-70746494]{display:flex;align-items:center;justify-content:space-between;height:.3rem}.cell .name[data-v-70746494]{width:30vw;color:gray;font-size:.14rem;display:flex;align-items:center;justify-content:end}@font-face{font-family:WeChat-Bold;src:url(https://shangrao-qqzh.oss-cn-hangzhou.aliyuncs.com/pay/fonts/WeChatSansStd-Bold.ttf)}.wechat-font[data-v-ea027830]{font-family:WeChat-Bold}.custom-price .input[data-v-ea027830]{font-size:.2rem}@font-face{font-family:WeChat-Bold;src:url(https://shangrao-qqzh.oss-cn-hangzhou.aliyuncs.com/pay/fonts/WeChatSansStd-Bold.ttf)}.wechat-font[data-v-79d1ed34]{font-family:WeChat-Bold}.price-root[data-v-79d1ed34]{position:relative;text-align:center;background:#f3f3f3;border-radius:.08rem;padding:.1rem 0;display:flex;flex-direction:column;height:.6rem;box-sizing:border-box;justify-content:space-between;align-items:center}.price-root .gift[data-v-79d1ed34]{position:absolute;top:-.1rem;right:-.05rem;background:linear-gradient(248.45deg,#fa1e1e,#ff7752 99.44%);padding:0 .05rem;border-radius:.1rem .1rem .1rem 0;font-size:.1rem;border-width:.02rem;border-color:#fff;border-style:solid;box-sizing:border-box;color:#fff}.price-root .token-count[data-v-79d1ed34]{display:flex;justify-content:center;align-items:center;font-size:.2rem}.price-root .token-count img[data-v-79d1ed34]{width:.16rem;height:.16rem;margin-right:.02rem}.price-root .price[data-v-79d1ed34]{font-size:.14rem}.only-price[data-v-79d1ed34]{align-items:center;justify-content:center}.only-price .price[data-v-79d1ed34]{font-size:.2rem}.content[data-v-737beb57]{width:100%;margin:.2rem 0;display:grid;grid-template-columns:repeat(3,1fr);gap:.1rem;box-sizing:border-box;font-weight:500}.loading[data-v-737beb57]{display:flex;justify-content:center;align-items:center}.select[data-v-737beb57]{color:#fff}@font-face{font-family:WeChat-Bold;src:url(https://shangrao-qqzh.oss-cn-hangzhou.aliyuncs.com/pay/fonts/WeChatSansStd-Bold.ttf)}.wechat-font[data-v-4ac1c510]{font-family:WeChat-Bold}.pay-popup[data-v-4ac1c510]{display:flex;flex-direction:column;width:100vw;box-sizing:border-box;overflow:hidden;padding:0 .15rem .2rem;transition:all .3s}.title[data-v-4ac1c510]{text-align:center;margin:.16rem 0}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => {
|
|
5
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
var _a, _b;
|
|
9
|
+
import { Dialog, Toast, Divider, Button } from "vant";
|
|
10
|
+
import Vue from "vue";
|
|
11
|
+
import Component$1 from "vue-class-component";
|
|
12
|
+
import { Prop, Component, Vue as Vue$1, Inject, Watch, Provide } from "vue-property-decorator";
|
|
13
|
+
async function request(url, data, method = "POST") {
|
|
14
|
+
return new Promise((res, rej) => {
|
|
15
|
+
const AppToken = localStorage.getItem("AppToken") || "";
|
|
16
|
+
if (!AppToken) {
|
|
17
|
+
throw new Error("token 不存在");
|
|
32
18
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
fetch(url, {
|
|
20
|
+
method,
|
|
21
|
+
headers: {
|
|
22
|
+
AppToken,
|
|
23
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
24
|
+
},
|
|
25
|
+
body: new URLSearchParams(data).toString()
|
|
26
|
+
}).then(async (response) => {
|
|
27
|
+
if (!response.ok) {
|
|
28
|
+
const errorText = await response.text();
|
|
29
|
+
throw new Error(`HTTP ${response.status} ${response.statusText}: ${errorText}`);
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
return await response.json();
|
|
33
|
+
} catch (error) {
|
|
34
|
+
rej("解析 JSON 异常");
|
|
35
|
+
}
|
|
36
|
+
}).then((data2) => {
|
|
37
|
+
res(data2);
|
|
38
|
+
}).catch((error) => {
|
|
39
|
+
let message = (error == null ? void 0 : error.message) || "未知异常";
|
|
40
|
+
if (error.message.includes("404")) {
|
|
41
|
+
message = "资源未找到";
|
|
42
|
+
} else if (error.message.includes("500")) {
|
|
43
|
+
message = "服务器错误";
|
|
44
|
+
} else if (error instanceof TypeError && error.message === "Failed to fetch") {
|
|
45
|
+
message = "网络连接失败";
|
|
46
|
+
}
|
|
47
|
+
rej(message);
|
|
48
|
+
});
|
|
38
49
|
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
message
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
}
|
|
51
|
+
const fail = (message, title = "请求失败") => {
|
|
52
|
+
Dialog({ title, message });
|
|
53
|
+
return {
|
|
54
|
+
status: false,
|
|
55
|
+
message
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const success = (data) => {
|
|
59
|
+
return {
|
|
60
|
+
status: true,
|
|
61
|
+
message: "成功",
|
|
62
|
+
data
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const isYM = /LT-APP/.test(navigator.userAgent);
|
|
66
|
+
const inApp = (_b = (_a = Vue.prototype) == null ? void 0 : _a.$jsBridge) == null ? void 0 : _b.inApp;
|
|
67
|
+
const isThirdParty = Boolean(window.ReactNativeWebView);
|
|
68
|
+
const alipay = async (options) => {
|
|
69
|
+
const { id, key, value, prefix } = options;
|
|
70
|
+
let url = location.origin + `/Payment/${prefix || ""}Alipay`;
|
|
71
|
+
const qrcode = getQrcode();
|
|
72
|
+
url += `?qrcode=${qrcode}&id=${id}`;
|
|
73
|
+
if (!(key && value)) {
|
|
74
|
+
return fail("支付参数异常", `支付时缺少 key value 参数:${JSON.stringify(options)}`);
|
|
75
|
+
}
|
|
76
|
+
url += `&${key}=${value}`;
|
|
77
|
+
if (!qrcode) {
|
|
78
|
+
location.href = url;
|
|
79
|
+
return success();
|
|
80
|
+
}
|
|
81
|
+
const { Data, Status, Message } = await request(url, {}, "GET");
|
|
82
|
+
if (!Status) {
|
|
83
|
+
return fail("支付请求失败", Message || "请求支付结果异常");
|
|
84
|
+
}
|
|
85
|
+
if (!Data) {
|
|
86
|
+
return fail("支付跳转地址不存在");
|
|
87
|
+
}
|
|
88
|
+
if (inApp) {
|
|
89
|
+
Vue.prototype.$jsBridge.openLink(Data);
|
|
60
90
|
return;
|
|
61
91
|
}
|
|
62
|
-
location.href =
|
|
92
|
+
location.href = Data;
|
|
63
93
|
};
|
|
64
|
-
function
|
|
65
|
-
return
|
|
94
|
+
function getQrcode() {
|
|
95
|
+
return isYM || inApp || isThirdParty;
|
|
66
96
|
}
|
|
67
|
-
const
|
|
68
|
-
|
|
97
|
+
const isMpWeixin = /miniProgram/i.test(navigator.userAgent) && /micromessenger/i.test(navigator.userAgent);
|
|
98
|
+
const wechat = (params) => {
|
|
99
|
+
var _a2;
|
|
100
|
+
const { id, appid, key, value, prefix } = params;
|
|
101
|
+
if (!appid) {
|
|
102
|
+
Dialog({
|
|
103
|
+
title: "小程序 id 不存在"
|
|
104
|
+
});
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!localStorage.getItem("AppToken")) {
|
|
108
|
+
Dialog({
|
|
109
|
+
title: "环境异常",
|
|
110
|
+
message: "本地 AppToken 不存在! 请重新登录",
|
|
111
|
+
showCancelButton: false,
|
|
112
|
+
confirmButtonText: "确定"
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const options = {
|
|
117
|
+
/** 小程序 id*/
|
|
118
|
+
appid,
|
|
119
|
+
/** 支付分类的 key*/
|
|
120
|
+
payKey: key,
|
|
121
|
+
/** 支付分类订单号*/
|
|
122
|
+
payValue: value,
|
|
123
|
+
/** 支付渠道id*/
|
|
124
|
+
paymentId: id,
|
|
125
|
+
/** 支付渠道接口*/
|
|
126
|
+
payApi: `${location.origin}}/Payment/${prefix}Weixin`,
|
|
127
|
+
/** tokenkey*/
|
|
128
|
+
tokenKey: "AppToken",
|
|
129
|
+
/** token 值*/
|
|
130
|
+
tokenValue: localStorage.getItem("AppToken")
|
|
131
|
+
};
|
|
132
|
+
const query = encodeURIComponent(Object.entries(options).map(([key2, value2]) => `${key2}=${String(value2)}`).join("&"));
|
|
133
|
+
const url = `weixin://dl/business/?appid=${appid}&path=pages/home/index&query=${query}`;
|
|
134
|
+
if (window.ReactNativeWebView) {
|
|
135
|
+
(_a2 = window.ReactNativeWebView) == null ? void 0 : _a2.postMessage(JSON.stringify(
|
|
136
|
+
{
|
|
137
|
+
type: "openUrl",
|
|
138
|
+
data: {
|
|
139
|
+
url
|
|
140
|
+
},
|
|
141
|
+
code: 200
|
|
142
|
+
}
|
|
143
|
+
));
|
|
144
|
+
} else if (isMpWeixin) {
|
|
145
|
+
const params2 = Object.entries(options).map(([key2, value2]) => `${key2}=${String(value2)}`).join("&");
|
|
146
|
+
uni.navigateTo({
|
|
147
|
+
url: `/pages/home/pay?${params2}`
|
|
148
|
+
// url: `/pages/home/pay`
|
|
149
|
+
});
|
|
150
|
+
} else {
|
|
151
|
+
location.href = url;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const EnableChannel = {
|
|
155
|
+
alipay,
|
|
156
|
+
wechat
|
|
69
157
|
};
|
|
70
|
-
function
|
|
71
|
-
return
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
158
|
+
function getEnabledChannel(list, ignoers) {
|
|
159
|
+
return list.filter(({ type }) => {
|
|
160
|
+
if (ignoers.includes(type)) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
if (type in EnableChannel) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
74
166
|
});
|
|
75
167
|
}
|
|
76
|
-
const
|
|
77
|
-
const { type
|
|
78
|
-
|
|
168
|
+
const sendPay = async ({ channel, key, value, prefix }) => {
|
|
169
|
+
const { type, id, appid } = channel;
|
|
170
|
+
const yuanValue = String(Number(value) / 100);
|
|
171
|
+
if (!(type in EnableChannel)) {
|
|
172
|
+
Toast(`暂不支持此渠道`);
|
|
173
|
+
}
|
|
174
|
+
switch (type) {
|
|
79
175
|
case "alipay":
|
|
80
|
-
return await
|
|
176
|
+
return await alipay({ id, key, value: yuanValue, prefix });
|
|
177
|
+
case "wechat":
|
|
178
|
+
if (!appid) {
|
|
179
|
+
return Dialog({
|
|
180
|
+
title: "参数异常",
|
|
181
|
+
message: `此渠道未配置小程序 appid 请先使用其他渠道!`
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return await wechat({
|
|
185
|
+
appid,
|
|
186
|
+
prefix,
|
|
187
|
+
key,
|
|
188
|
+
value,
|
|
189
|
+
id
|
|
190
|
+
});
|
|
81
191
|
default:
|
|
82
|
-
|
|
192
|
+
Toast(`暂不支持此渠道`);
|
|
83
193
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
194
|
+
};
|
|
195
|
+
const BaseTheme = "orange";
|
|
196
|
+
const ignorePlatform = ["platform"];
|
|
197
|
+
const AgentConfig = {
|
|
198
|
+
needId: false,
|
|
86
199
|
name: "店铺余额",
|
|
87
200
|
theme: "#4089ff",
|
|
88
201
|
/** 余额*/
|
|
89
202
|
balance: {
|
|
90
|
-
disabled:
|
|
203
|
+
disabled: false,
|
|
91
204
|
key: "Money",
|
|
92
205
|
api: "/AgentUser/GetMoney"
|
|
93
206
|
},
|
|
94
207
|
price: {
|
|
95
|
-
disabled:
|
|
96
|
-
custom:
|
|
208
|
+
disabled: false,
|
|
209
|
+
custom: true,
|
|
97
210
|
prices: [
|
|
98
211
|
{
|
|
99
212
|
price: 800
|
|
@@ -116,23 +229,25 @@ const fe = async ({ channel: e, key: n, value: t, prefix: r }) => {
|
|
|
116
229
|
]
|
|
117
230
|
},
|
|
118
231
|
channel: {
|
|
119
|
-
api: "/SystemPayment/GetList"
|
|
232
|
+
api: "/SystemPayment/GetList",
|
|
233
|
+
ignores: ignorePlatform
|
|
120
234
|
},
|
|
121
235
|
pay: {
|
|
122
236
|
key: "Money"
|
|
123
237
|
}
|
|
124
|
-
}
|
|
238
|
+
};
|
|
239
|
+
const UserConfig = {
|
|
125
240
|
theme: "#ff4f4f",
|
|
126
241
|
name: "幸运币余额",
|
|
127
|
-
needId:
|
|
242
|
+
needId: false,
|
|
128
243
|
balance: {
|
|
129
|
-
disabled:
|
|
244
|
+
disabled: false,
|
|
130
245
|
key: "PlaMoney",
|
|
131
246
|
api: "/PlayerUser/GetMoney"
|
|
132
247
|
},
|
|
133
248
|
price: {
|
|
134
|
-
disabled:
|
|
135
|
-
custom:
|
|
249
|
+
disabled: false,
|
|
250
|
+
custom: true,
|
|
136
251
|
prices: [
|
|
137
252
|
{
|
|
138
253
|
price: 200
|
|
@@ -155,29 +270,42 @@ const fe = async ({ channel: e, key: n, value: t, prefix: r }) => {
|
|
|
155
270
|
]
|
|
156
271
|
},
|
|
157
272
|
channel: {
|
|
158
|
-
api: "/SystemPayment/GetList"
|
|
273
|
+
api: "/SystemPayment/GetList",
|
|
274
|
+
ignores: ignorePlatform
|
|
159
275
|
},
|
|
160
276
|
pay: {
|
|
161
277
|
key: "Money"
|
|
162
278
|
}
|
|
163
|
-
}, ve = {
|
|
164
|
-
agent: X,
|
|
165
|
-
user: de
|
|
166
|
-
}, ge = async (e, n) => {
|
|
167
|
-
const t = await T(e);
|
|
168
|
-
return n in t ? t[n] : (v(JSON.stringify(t) || "解析数据异常", `余额数据中不存在 ${n}`), 0);
|
|
169
279
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
280
|
+
const PayAllConfig = {
|
|
281
|
+
agent: AgentConfig,
|
|
282
|
+
user: UserConfig
|
|
283
|
+
};
|
|
284
|
+
const getPayMoney = async (url, key) => {
|
|
285
|
+
const data = await request(url);
|
|
286
|
+
if (!(key in data)) {
|
|
287
|
+
fail(JSON.stringify(data) || "解析数据异常", `余额数据中不存在 ${key}`);
|
|
288
|
+
return 0;
|
|
289
|
+
}
|
|
290
|
+
return data[key];
|
|
291
|
+
};
|
|
292
|
+
var __defProp$6 = Object.defineProperty;
|
|
293
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
294
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
295
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
296
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
297
|
+
if (decorator = decorators[i])
|
|
298
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
299
|
+
if (kind && result)
|
|
300
|
+
__defProp$6(target, key, result);
|
|
301
|
+
return result;
|
|
174
302
|
};
|
|
175
|
-
let $ = class extends
|
|
303
|
+
let PayError$1 = class PayError extends Vue$1 {
|
|
176
304
|
constructor() {
|
|
177
305
|
super(...arguments);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
306
|
+
__publicField(this, "load");
|
|
307
|
+
__publicField(this, "loading", true);
|
|
308
|
+
__publicField(this, "message", "");
|
|
181
309
|
}
|
|
182
310
|
get showLoading() {
|
|
183
311
|
return this.loading || this.message;
|
|
@@ -186,352 +314,461 @@ let $ = class extends ae {
|
|
|
186
314
|
await this.retry();
|
|
187
315
|
}
|
|
188
316
|
test() {
|
|
189
|
-
this.loading =
|
|
190
|
-
|
|
317
|
+
this.loading = true;
|
|
318
|
+
setTimeout(() => {
|
|
319
|
+
this.loading = false;
|
|
191
320
|
}, 100);
|
|
192
321
|
}
|
|
193
322
|
async retry() {
|
|
194
|
-
this.message = ""
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
323
|
+
this.message = "";
|
|
324
|
+
this.loading = true;
|
|
325
|
+
const res = await this.load().finally(() => {
|
|
326
|
+
this.loading = false;
|
|
327
|
+
}).catch((message) => {
|
|
328
|
+
this.message = message;
|
|
199
329
|
});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
330
|
+
if (res != void 0) {
|
|
331
|
+
this.$emit("done", res);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
__decorateClass$6([
|
|
336
|
+
Prop()
|
|
337
|
+
], PayError$1.prototype, "load", 2);
|
|
338
|
+
PayError$1 = __decorateClass$6([
|
|
339
|
+
Component
|
|
340
|
+
], PayError$1);
|
|
341
|
+
var render$6 = function() {
|
|
342
|
+
var _vm = this;
|
|
343
|
+
var _h = _vm.$createElement;
|
|
344
|
+
var _c = _vm._self._c || _h;
|
|
345
|
+
return _c("div", {
|
|
212
346
|
staticClass: "pay-error-container"
|
|
213
|
-
}, [
|
|
347
|
+
}, [_c("div", {
|
|
214
348
|
staticClass: "loading",
|
|
215
349
|
style: {
|
|
216
|
-
display:
|
|
350
|
+
display: _vm.showLoading ? "flex" : "none"
|
|
217
351
|
}
|
|
218
|
-
}, [
|
|
352
|
+
}, [_vm.message ? _c("van-tag", {
|
|
219
353
|
attrs: {
|
|
220
|
-
type: "danger"
|
|
354
|
+
"type": "danger"
|
|
221
355
|
},
|
|
222
356
|
on: {
|
|
223
|
-
click:
|
|
357
|
+
"click": _vm.retry
|
|
224
358
|
}
|
|
225
|
-
}, [
|
|
359
|
+
}, [_vm._v(" " + _vm._s(_vm.message) + " 点击重试 ")]) : _c("van-loading", {
|
|
226
360
|
staticClass: "loading-icon",
|
|
227
361
|
attrs: {
|
|
228
|
-
size: "20",
|
|
229
|
-
type: "spinner"
|
|
362
|
+
"size": "20",
|
|
363
|
+
"type": "spinner"
|
|
230
364
|
}
|
|
231
|
-
})], 1),
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
if (
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
365
|
+
})], 1), _vm._t("default")], 2);
|
|
366
|
+
};
|
|
367
|
+
var staticRenderFns$6 = [];
|
|
368
|
+
const payError_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
369
|
+
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
370
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
371
|
+
if (render2) {
|
|
372
|
+
options.render = render2;
|
|
373
|
+
options.staticRenderFns = staticRenderFns2;
|
|
374
|
+
options._compiled = true;
|
|
375
|
+
}
|
|
376
|
+
if (functionalTemplate) {
|
|
377
|
+
options.functional = true;
|
|
378
|
+
}
|
|
379
|
+
if (scopeId) {
|
|
380
|
+
options._scopeId = "data-v-" + scopeId;
|
|
381
|
+
}
|
|
382
|
+
var hook;
|
|
383
|
+
if (moduleIdentifier) {
|
|
384
|
+
hook = function(context) {
|
|
385
|
+
context = context || // cached call
|
|
386
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
387
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
388
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
389
|
+
context = __VUE_SSR_CONTEXT__;
|
|
390
|
+
}
|
|
391
|
+
if (injectStyles) {
|
|
392
|
+
injectStyles.call(this, context);
|
|
393
|
+
}
|
|
394
|
+
if (context && context._registeredComponents) {
|
|
395
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
options._ssrRegister = hook;
|
|
399
|
+
} else if (injectStyles) {
|
|
400
|
+
hook = shadowMode ? function() {
|
|
401
|
+
injectStyles.call(
|
|
402
|
+
this,
|
|
403
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
404
|
+
);
|
|
405
|
+
} : injectStyles;
|
|
406
|
+
}
|
|
407
|
+
if (hook) {
|
|
408
|
+
if (options.functional) {
|
|
409
|
+
options._injectStyles = hook;
|
|
410
|
+
var originalRender = options.render;
|
|
411
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
412
|
+
hook.call(context);
|
|
413
|
+
return originalRender(h, context);
|
|
252
414
|
};
|
|
253
415
|
} else {
|
|
254
|
-
var
|
|
255
|
-
|
|
416
|
+
var existing = options.beforeCreate;
|
|
417
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
256
418
|
}
|
|
419
|
+
}
|
|
257
420
|
return {
|
|
258
|
-
exports:
|
|
259
|
-
options
|
|
421
|
+
exports: scriptExports,
|
|
422
|
+
options
|
|
260
423
|
};
|
|
261
424
|
}
|
|
262
|
-
const
|
|
263
|
-
var
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
$
|
|
267
|
-
|
|
268
|
-
|
|
425
|
+
const __cssModules$6 = {};
|
|
426
|
+
var __component__$6 = /* @__PURE__ */ normalizeComponent(
|
|
427
|
+
PayError$1,
|
|
428
|
+
render$6,
|
|
429
|
+
staticRenderFns$6,
|
|
430
|
+
false,
|
|
431
|
+
__vue2_injectStyles$6,
|
|
269
432
|
"0817c014",
|
|
270
433
|
null,
|
|
271
434
|
null
|
|
272
435
|
);
|
|
273
|
-
function
|
|
274
|
-
for (let
|
|
275
|
-
this[
|
|
436
|
+
function __vue2_injectStyles$6(context) {
|
|
437
|
+
for (let o in __cssModules$6) {
|
|
438
|
+
this[o] = __cssModules$6[o];
|
|
439
|
+
}
|
|
276
440
|
}
|
|
277
|
-
const
|
|
278
|
-
return
|
|
441
|
+
const PayError2 = /* @__PURE__ */ function() {
|
|
442
|
+
return __component__$6.exports;
|
|
279
443
|
}();
|
|
280
|
-
var
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
444
|
+
var __defProp$5 = Object.defineProperty;
|
|
445
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
446
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
447
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
448
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
449
|
+
if (decorator = decorators[i])
|
|
450
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
451
|
+
if (kind && result)
|
|
452
|
+
__defProp$5(target, key, result);
|
|
453
|
+
return result;
|
|
284
454
|
};
|
|
285
|
-
let
|
|
455
|
+
let Balance$1 = class Balance extends Vue {
|
|
286
456
|
constructor() {
|
|
287
457
|
super(...arguments);
|
|
288
|
-
|
|
289
|
-
|
|
458
|
+
__publicField(this, "config");
|
|
459
|
+
__publicField(this, "value", 0);
|
|
290
460
|
}
|
|
291
461
|
load() {
|
|
292
|
-
const { key
|
|
293
|
-
if (!
|
|
294
|
-
throw new Error(
|
|
295
|
-
|
|
462
|
+
const { key, api } = this.config.balance;
|
|
463
|
+
if (!api || !key) {
|
|
464
|
+
throw new Error(`不存在 key 或 api`);
|
|
465
|
+
}
|
|
466
|
+
return getPayMoney(api, key);
|
|
296
467
|
}
|
|
297
|
-
onBalanceLoad(
|
|
298
|
-
this.value =
|
|
468
|
+
onBalanceLoad(money) {
|
|
469
|
+
this.value = money / 100;
|
|
470
|
+
this.$emit("change", money);
|
|
299
471
|
}
|
|
300
472
|
};
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
],
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
components: { PayError:
|
|
473
|
+
__decorateClass$5([
|
|
474
|
+
Inject()
|
|
475
|
+
], Balance$1.prototype, "config", 2);
|
|
476
|
+
Balance$1 = __decorateClass$5([
|
|
477
|
+
Component({
|
|
478
|
+
components: { PayError: PayError2 }
|
|
307
479
|
})
|
|
308
|
-
],
|
|
309
|
-
var
|
|
310
|
-
var
|
|
311
|
-
|
|
480
|
+
], Balance$1);
|
|
481
|
+
var render$5 = function() {
|
|
482
|
+
var _vm = this;
|
|
483
|
+
var _h = _vm.$createElement;
|
|
484
|
+
var _c = _vm._self._c || _h;
|
|
485
|
+
return _c("div", {
|
|
312
486
|
staticClass: "root wechat-font"
|
|
313
|
-
}, [
|
|
487
|
+
}, [_c("PayError", {
|
|
314
488
|
attrs: {
|
|
315
|
-
load:
|
|
489
|
+
"load": _vm.load
|
|
316
490
|
},
|
|
317
491
|
on: {
|
|
318
|
-
done:
|
|
492
|
+
"done": _vm.onBalanceLoad
|
|
319
493
|
}
|
|
320
|
-
}, [
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
494
|
+
}, [_c("h1", [_vm._v(" " + _vm._s(_vm.value) + " ")])])], 1);
|
|
495
|
+
};
|
|
496
|
+
var staticRenderFns$5 = [];
|
|
497
|
+
const balance_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
498
|
+
const __cssModules$5 = {};
|
|
499
|
+
var __component__$5 = /* @__PURE__ */ normalizeComponent(
|
|
500
|
+
Balance$1,
|
|
501
|
+
render$5,
|
|
502
|
+
staticRenderFns$5,
|
|
503
|
+
false,
|
|
504
|
+
__vue2_injectStyles$5,
|
|
505
|
+
"20b4bf5f",
|
|
330
506
|
null,
|
|
331
507
|
null
|
|
332
508
|
);
|
|
333
|
-
function
|
|
334
|
-
for (let
|
|
335
|
-
this[
|
|
509
|
+
function __vue2_injectStyles$5(context) {
|
|
510
|
+
for (let o in __cssModules$5) {
|
|
511
|
+
this[o] = __cssModules$5[o];
|
|
512
|
+
}
|
|
336
513
|
}
|
|
337
|
-
const
|
|
338
|
-
return
|
|
339
|
-
}()
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
514
|
+
const Balance2 = /* @__PURE__ */ function() {
|
|
515
|
+
return __component__$5.exports;
|
|
516
|
+
}();
|
|
517
|
+
const getPayChannels = async (url, ignores) => {
|
|
518
|
+
const list = await request(url);
|
|
519
|
+
const newParamsList = list.map(({
|
|
520
|
+
Id: id,
|
|
521
|
+
PaymentValue: name,
|
|
522
|
+
PaymentName: uuid,
|
|
523
|
+
PaymentIcon: icon,
|
|
524
|
+
AgentDescribe: appid
|
|
525
|
+
}) => {
|
|
526
|
+
const type = getChannelType(name);
|
|
527
|
+
return {
|
|
528
|
+
id,
|
|
529
|
+
name,
|
|
530
|
+
icon,
|
|
531
|
+
type,
|
|
532
|
+
appid
|
|
533
|
+
};
|
|
534
|
+
});
|
|
535
|
+
return getEnabledChannel(newParamsList, ignores);
|
|
536
|
+
};
|
|
537
|
+
function getChannelType(name) {
|
|
538
|
+
if (name.includes("支付宝")) {
|
|
539
|
+
return "alipay";
|
|
540
|
+
}
|
|
541
|
+
if (name.includes("微信")) {
|
|
542
|
+
return "wechat";
|
|
543
|
+
}
|
|
544
|
+
if (name.includes("平台币")) {
|
|
545
|
+
return "platform";
|
|
546
|
+
}
|
|
547
|
+
if (name.includes("苹果")) {
|
|
548
|
+
return "apple";
|
|
549
|
+
}
|
|
550
|
+
return "unknow";
|
|
355
551
|
}
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
552
|
+
var __defProp$4 = Object.defineProperty;
|
|
553
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
554
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
555
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
556
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
557
|
+
if (decorator = decorators[i])
|
|
558
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
559
|
+
if (kind && result)
|
|
560
|
+
__defProp$4(target, key, result);
|
|
561
|
+
return result;
|
|
360
562
|
};
|
|
361
|
-
let
|
|
563
|
+
let Channels$1 = class Channels extends Vue {
|
|
362
564
|
constructor() {
|
|
363
565
|
super(...arguments);
|
|
364
|
-
|
|
566
|
+
__publicField(this, "config");
|
|
365
567
|
// 支付渠道
|
|
366
|
-
|
|
568
|
+
__publicField(this, "channels", []);
|
|
367
569
|
// 选择的支付渠道下标
|
|
368
|
-
|
|
570
|
+
__publicField(this, "select", 0);
|
|
369
571
|
// 是否显示气泡
|
|
370
|
-
|
|
572
|
+
__publicField(this, "showPopover", false);
|
|
371
573
|
}
|
|
372
574
|
// 根据渠道计算选项
|
|
373
575
|
get actions() {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
576
|
+
if (this.channels.length) {
|
|
577
|
+
return this.channels.map(({ name: text, id, icon }, index) => ({
|
|
578
|
+
text,
|
|
579
|
+
id,
|
|
580
|
+
disabled: index == this.select
|
|
581
|
+
}));
|
|
582
|
+
} else {
|
|
583
|
+
return [];
|
|
584
|
+
}
|
|
379
585
|
}
|
|
380
586
|
// 切换渠道
|
|
381
|
-
onSelect(
|
|
382
|
-
this.select =
|
|
587
|
+
onSelect(action, index) {
|
|
588
|
+
this.select = index;
|
|
589
|
+
this.$emit("change", this.channels[index]);
|
|
383
590
|
}
|
|
384
591
|
get name() {
|
|
385
|
-
let
|
|
386
|
-
|
|
592
|
+
let item = this.channels[this.select];
|
|
593
|
+
if (item) {
|
|
594
|
+
return item.name;
|
|
595
|
+
} else {
|
|
596
|
+
return "";
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
get ignores() {
|
|
600
|
+
return this.config.channel.ignores || [];
|
|
387
601
|
}
|
|
388
602
|
load() {
|
|
389
|
-
return
|
|
603
|
+
return getPayChannels(this.config.channel.api, this.ignores);
|
|
390
604
|
}
|
|
391
|
-
onLoadChannels(
|
|
392
|
-
this.channels =
|
|
605
|
+
onLoadChannels(data) {
|
|
606
|
+
this.channels = getEnabledChannel(data, this.ignores);
|
|
607
|
+
this.$emit("change", this.channels[0]);
|
|
393
608
|
}
|
|
394
609
|
};
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
],
|
|
398
|
-
|
|
399
|
-
|
|
610
|
+
__decorateClass$4([
|
|
611
|
+
Inject()
|
|
612
|
+
], Channels$1.prototype, "config", 2);
|
|
613
|
+
Channels$1 = __decorateClass$4([
|
|
614
|
+
Component$1({
|
|
400
615
|
components: {
|
|
401
|
-
PayError:
|
|
616
|
+
PayError: PayError2
|
|
402
617
|
}
|
|
403
618
|
})
|
|
404
|
-
],
|
|
405
|
-
var
|
|
406
|
-
var
|
|
407
|
-
|
|
619
|
+
], Channels$1);
|
|
620
|
+
var render$4 = function() {
|
|
621
|
+
var _vm = this;
|
|
622
|
+
var _h = _vm.$createElement;
|
|
623
|
+
var _c = _vm._self._c || _h;
|
|
624
|
+
return _c("van-popover", {
|
|
408
625
|
attrs: {
|
|
409
|
-
trigger: "click",
|
|
410
|
-
actions:
|
|
411
|
-
placement: "top-end"
|
|
626
|
+
"trigger": "click",
|
|
627
|
+
"actions": _vm.actions,
|
|
628
|
+
"placement": "top-end"
|
|
412
629
|
},
|
|
413
630
|
on: {
|
|
414
|
-
select:
|
|
631
|
+
"select": _vm.onSelect
|
|
415
632
|
},
|
|
416
|
-
scopedSlots:
|
|
633
|
+
scopedSlots: _vm._u([{
|
|
417
634
|
key: "reference",
|
|
418
635
|
fn: function() {
|
|
419
|
-
return [
|
|
636
|
+
return [_c("div", {
|
|
420
637
|
staticClass: "cell"
|
|
421
|
-
}, [
|
|
638
|
+
}, [_c("h5", [_vm._v("付款方式")]), _c("PayError", {
|
|
422
639
|
staticClass: "name",
|
|
423
640
|
attrs: {
|
|
424
|
-
load:
|
|
641
|
+
"load": _vm.load
|
|
425
642
|
},
|
|
426
643
|
on: {
|
|
427
|
-
done:
|
|
644
|
+
"done": _vm.onLoadChannels
|
|
428
645
|
}
|
|
429
|
-
}, [
|
|
646
|
+
}, [_c("div", [_vm._v(" " + _vm._s(_vm.name) + " "), _c("van-icon", {
|
|
430
647
|
attrs: {
|
|
431
|
-
name: "arrow"
|
|
648
|
+
"name": "arrow"
|
|
432
649
|
}
|
|
433
650
|
})], 1)])], 1)];
|
|
434
651
|
},
|
|
435
|
-
proxy:
|
|
652
|
+
proxy: true
|
|
436
653
|
}]),
|
|
437
654
|
model: {
|
|
438
|
-
value:
|
|
439
|
-
callback: function(
|
|
440
|
-
|
|
655
|
+
value: _vm.showPopover,
|
|
656
|
+
callback: function($$v) {
|
|
657
|
+
_vm.showPopover = $$v;
|
|
441
658
|
},
|
|
442
659
|
expression: "showPopover"
|
|
443
660
|
}
|
|
444
661
|
});
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
662
|
+
};
|
|
663
|
+
var staticRenderFns$4 = [];
|
|
664
|
+
const channelContainer_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
665
|
+
const __cssModules$4 = {};
|
|
666
|
+
var __component__$4 = /* @__PURE__ */ normalizeComponent(
|
|
667
|
+
Channels$1,
|
|
668
|
+
render$4,
|
|
669
|
+
staticRenderFns$4,
|
|
670
|
+
false,
|
|
671
|
+
__vue2_injectStyles$4,
|
|
672
|
+
"70746494",
|
|
454
673
|
null,
|
|
455
674
|
null
|
|
456
675
|
);
|
|
457
|
-
function
|
|
458
|
-
for (let
|
|
459
|
-
this[
|
|
676
|
+
function __vue2_injectStyles$4(context) {
|
|
677
|
+
for (let o in __cssModules$4) {
|
|
678
|
+
this[o] = __cssModules$4[o];
|
|
679
|
+
}
|
|
460
680
|
}
|
|
461
|
-
const
|
|
462
|
-
return
|
|
681
|
+
const Channels2 = /* @__PURE__ */ function() {
|
|
682
|
+
return __component__$4.exports;
|
|
463
683
|
}();
|
|
464
|
-
var
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
684
|
+
var __defProp$3 = Object.defineProperty;
|
|
685
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
686
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
687
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
688
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
689
|
+
if (decorator = decorators[i])
|
|
690
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
691
|
+
if (kind && result)
|
|
692
|
+
__defProp$3(target, key, result);
|
|
693
|
+
return result;
|
|
468
694
|
};
|
|
469
|
-
let
|
|
695
|
+
let PriceCustom$1 = class PriceCustom extends Vue {
|
|
470
696
|
constructor() {
|
|
471
697
|
super(...arguments);
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
onChange(
|
|
476
|
-
this.$emit("input", Number(
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
],
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
],
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
|
|
698
|
+
__publicField(this, "customPrice");
|
|
699
|
+
__publicField(this, "value", null);
|
|
700
|
+
}
|
|
701
|
+
onChange(val) {
|
|
702
|
+
this.$emit("input", Number(val));
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
__decorateClass$3([
|
|
706
|
+
Prop({ default: null })
|
|
707
|
+
], PriceCustom$1.prototype, "customPrice", 2);
|
|
708
|
+
PriceCustom$1 = __decorateClass$3([
|
|
709
|
+
Component$1
|
|
710
|
+
], PriceCustom$1);
|
|
711
|
+
var render$3 = function() {
|
|
712
|
+
var _vm = this;
|
|
713
|
+
var _h = _vm.$createElement;
|
|
714
|
+
var _c = _vm._self._c || _h;
|
|
715
|
+
return _c("div", {
|
|
488
716
|
staticClass: "custom-price"
|
|
489
|
-
}, [
|
|
717
|
+
}, [_c("h5", [_vm._v("自定义金额")]), _c("van-field", {
|
|
490
718
|
staticClass: "input wechat-font",
|
|
491
719
|
attrs: {
|
|
492
|
-
type: "digit",
|
|
493
|
-
placeholder: "请输入金额",
|
|
494
|
-
clearable: ""
|
|
720
|
+
"type": "digit",
|
|
721
|
+
"placeholder": "请输入金额",
|
|
722
|
+
"clearable": ""
|
|
495
723
|
},
|
|
496
724
|
on: {
|
|
497
|
-
input:
|
|
725
|
+
"input": _vm.onChange
|
|
498
726
|
},
|
|
499
727
|
model: {
|
|
500
|
-
value:
|
|
501
|
-
callback: function(
|
|
502
|
-
|
|
728
|
+
value: _vm.value,
|
|
729
|
+
callback: function($$v) {
|
|
730
|
+
_vm.value = $$v;
|
|
503
731
|
},
|
|
504
732
|
expression: "value"
|
|
505
733
|
}
|
|
506
734
|
})], 1);
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
735
|
+
};
|
|
736
|
+
var staticRenderFns$3 = [];
|
|
737
|
+
const priceCustom_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
738
|
+
const __cssModules$3 = {};
|
|
739
|
+
var __component__$3 = /* @__PURE__ */ normalizeComponent(
|
|
740
|
+
PriceCustom$1,
|
|
741
|
+
render$3,
|
|
742
|
+
staticRenderFns$3,
|
|
743
|
+
false,
|
|
744
|
+
__vue2_injectStyles$3,
|
|
515
745
|
"ea027830",
|
|
516
746
|
null,
|
|
517
747
|
null
|
|
518
748
|
);
|
|
519
|
-
function
|
|
520
|
-
for (let
|
|
521
|
-
this[
|
|
749
|
+
function __vue2_injectStyles$3(context) {
|
|
750
|
+
for (let o in __cssModules$3) {
|
|
751
|
+
this[o] = __cssModules$3[o];
|
|
752
|
+
}
|
|
522
753
|
}
|
|
523
|
-
const
|
|
524
|
-
return
|
|
754
|
+
const PriceCustom2 = /* @__PURE__ */ function() {
|
|
755
|
+
return __component__$3.exports;
|
|
525
756
|
}();
|
|
526
|
-
var
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
757
|
+
var __defProp$2 = Object.defineProperty;
|
|
758
|
+
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
759
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
760
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
761
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
762
|
+
if (decorator = decorators[i])
|
|
763
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
764
|
+
if (kind && result)
|
|
765
|
+
__defProp$2(target, key, result);
|
|
766
|
+
return result;
|
|
530
767
|
};
|
|
531
|
-
let
|
|
768
|
+
let PriceItem$1 = class PriceItem extends Vue {
|
|
532
769
|
constructor() {
|
|
533
770
|
super(...arguments);
|
|
534
|
-
|
|
771
|
+
__publicField(this, "price");
|
|
535
772
|
}
|
|
536
773
|
get realPrice() {
|
|
537
774
|
return this.price.price / 100;
|
|
@@ -541,201 +778,233 @@ let O = class extends _ {
|
|
|
541
778
|
return !this.price.count;
|
|
542
779
|
}
|
|
543
780
|
};
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
],
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
],
|
|
550
|
-
var
|
|
551
|
-
var
|
|
552
|
-
|
|
781
|
+
__decorateClass$2([
|
|
782
|
+
Prop({ default: {} })
|
|
783
|
+
], PriceItem$1.prototype, "price", 2);
|
|
784
|
+
PriceItem$1 = __decorateClass$2([
|
|
785
|
+
Component$1
|
|
786
|
+
], PriceItem$1);
|
|
787
|
+
var render$2 = function() {
|
|
788
|
+
var _vm = this;
|
|
789
|
+
var _h = _vm.$createElement;
|
|
790
|
+
var _c = _vm._self._c || _h;
|
|
791
|
+
return _c("div", {
|
|
553
792
|
staticClass: "price-root wechat-font",
|
|
554
793
|
class: {
|
|
555
|
-
"only-price":
|
|
794
|
+
"only-price": _vm.onlyPrice
|
|
556
795
|
}
|
|
557
|
-
}, [
|
|
796
|
+
}, [_vm.price.giftCount ? _c("span", {
|
|
558
797
|
staticClass: "gift"
|
|
559
|
-
}, [
|
|
798
|
+
}, [_vm._v(" 赠" + _vm._s(_vm.price.giftCount) + " ")]) : _vm._e(), _vm.price.count ? _c("span", {
|
|
560
799
|
staticClass: "token-count"
|
|
561
|
-
}, [
|
|
800
|
+
}, [_c("img", {
|
|
562
801
|
attrs: {
|
|
563
|
-
src: "https://shangrao-qqzh.oss-cn-hangzhou.aliyuncs.com/npdd/user/my-v3/imgs/niu-coin-top-up-icon.png"
|
|
802
|
+
"src": "https://shangrao-qqzh.oss-cn-hangzhou.aliyuncs.com/npdd/user/my-v3/imgs/niu-coin-top-up-icon.png"
|
|
564
803
|
}
|
|
565
|
-
}),
|
|
804
|
+
}), _vm._v(" " + _vm._s(_vm.price.count) + " ")]) : _vm._e(), _c("span", {
|
|
566
805
|
staticClass: "price"
|
|
567
|
-
}, [
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
806
|
+
}, [_vm._v("¥" + _vm._s(_vm.realPrice))])]);
|
|
807
|
+
};
|
|
808
|
+
var staticRenderFns$2 = [];
|
|
809
|
+
const price_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
810
|
+
const __cssModules$2 = {};
|
|
811
|
+
var __component__$2 = /* @__PURE__ */ normalizeComponent(
|
|
812
|
+
PriceItem$1,
|
|
813
|
+
render$2,
|
|
814
|
+
staticRenderFns$2,
|
|
815
|
+
false,
|
|
816
|
+
__vue2_injectStyles$2,
|
|
817
|
+
"79d1ed34",
|
|
577
818
|
null,
|
|
578
819
|
null
|
|
579
820
|
);
|
|
580
|
-
function
|
|
581
|
-
for (let
|
|
582
|
-
this[
|
|
821
|
+
function __vue2_injectStyles$2(context) {
|
|
822
|
+
for (let o in __cssModules$2) {
|
|
823
|
+
this[o] = __cssModules$2[o];
|
|
824
|
+
}
|
|
583
825
|
}
|
|
584
|
-
const
|
|
585
|
-
return
|
|
826
|
+
const PriceItem2 = /* @__PURE__ */ function() {
|
|
827
|
+
return __component__$2.exports;
|
|
586
828
|
}();
|
|
587
|
-
var
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
829
|
+
var __defProp$1 = Object.defineProperty;
|
|
830
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
831
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
832
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
833
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
834
|
+
if (decorator = decorators[i])
|
|
835
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
836
|
+
if (kind && result)
|
|
837
|
+
__defProp$1(target, key, result);
|
|
838
|
+
return result;
|
|
591
839
|
};
|
|
592
|
-
let
|
|
840
|
+
let PriceContainer$1 = class PriceContainer extends Vue {
|
|
593
841
|
constructor() {
|
|
594
842
|
super(...arguments);
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
843
|
+
__publicField(this, "config");
|
|
844
|
+
__publicField(this, "value", 0);
|
|
845
|
+
__publicField(this, "prices", []);
|
|
846
|
+
__publicField(this, "customPrice", 0);
|
|
847
|
+
__publicField(this, "loading", true);
|
|
848
|
+
__publicField(this, "message", "");
|
|
601
849
|
}
|
|
602
850
|
async mounted() {
|
|
603
851
|
}
|
|
604
852
|
/** 载入价目表*/
|
|
605
853
|
load() {
|
|
606
|
-
const { load
|
|
607
|
-
if (
|
|
608
|
-
return
|
|
609
|
-
|
|
610
|
-
|
|
854
|
+
const { load, prices } = this.config.price;
|
|
855
|
+
if (load) {
|
|
856
|
+
return load;
|
|
857
|
+
}
|
|
858
|
+
if (prices) {
|
|
859
|
+
return new Promise((res) => res(prices));
|
|
860
|
+
}
|
|
611
861
|
}
|
|
612
862
|
/** 价目表加载成功*/
|
|
613
|
-
onLoadPrices(
|
|
614
|
-
this.prices =
|
|
863
|
+
onLoadPrices(prices) {
|
|
864
|
+
this.prices = prices;
|
|
865
|
+
this.changePrice(0);
|
|
615
866
|
}
|
|
616
867
|
/** 切换价格*/
|
|
617
|
-
changePrice(
|
|
618
|
-
this.value =
|
|
868
|
+
changePrice(index) {
|
|
869
|
+
this.value = index;
|
|
870
|
+
this.$emit("change", this.prices[index]);
|
|
619
871
|
}
|
|
620
|
-
onCustomPriceChange(
|
|
621
|
-
|
|
872
|
+
onCustomPriceChange(n) {
|
|
873
|
+
if (n) {
|
|
874
|
+
this.$emit("change", { price: n * 100 });
|
|
875
|
+
} else {
|
|
876
|
+
this.$emit("change", this.prices[this.value]);
|
|
877
|
+
}
|
|
622
878
|
}
|
|
623
879
|
};
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
],
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
],
|
|
630
|
-
|
|
631
|
-
|
|
880
|
+
__decorateClass$1([
|
|
881
|
+
Inject()
|
|
882
|
+
], PriceContainer$1.prototype, "config", 2);
|
|
883
|
+
__decorateClass$1([
|
|
884
|
+
Watch("customPrice")
|
|
885
|
+
], PriceContainer$1.prototype, "onCustomPriceChange", 1);
|
|
886
|
+
PriceContainer$1 = __decorateClass$1([
|
|
887
|
+
Component$1({
|
|
632
888
|
components: {
|
|
633
|
-
PriceItem:
|
|
634
|
-
PayError:
|
|
635
|
-
PriceCustom:
|
|
889
|
+
PriceItem: PriceItem2,
|
|
890
|
+
PayError: PayError2,
|
|
891
|
+
PriceCustom: PriceCustom2
|
|
636
892
|
}
|
|
637
893
|
})
|
|
638
|
-
],
|
|
639
|
-
var
|
|
640
|
-
var
|
|
641
|
-
|
|
894
|
+
], PriceContainer$1);
|
|
895
|
+
var render$1 = function() {
|
|
896
|
+
var _vm = this;
|
|
897
|
+
var _h = _vm.$createElement;
|
|
898
|
+
var _c = _vm._self._c || _h;
|
|
899
|
+
return !_vm.config.price.disabled ? _c("div", {
|
|
642
900
|
staticClass: "price-container"
|
|
643
|
-
}, [
|
|
901
|
+
}, [_c("h5", [_vm._v("选择充值金额")]), _c("PayError", {
|
|
644
902
|
attrs: {
|
|
645
|
-
load:
|
|
903
|
+
"load": _vm.load
|
|
646
904
|
},
|
|
647
905
|
on: {
|
|
648
|
-
done:
|
|
906
|
+
"done": _vm.onLoadPrices
|
|
649
907
|
}
|
|
650
|
-
}, [
|
|
908
|
+
}, [_c("div", {
|
|
651
909
|
staticClass: "content"
|
|
652
|
-
},
|
|
653
|
-
return
|
|
654
|
-
key:
|
|
910
|
+
}, _vm._l(_vm.prices, function(p, index) {
|
|
911
|
+
return _c("price-item", {
|
|
912
|
+
key: index,
|
|
655
913
|
staticClass: "price-item",
|
|
656
914
|
class: {
|
|
657
|
-
select:
|
|
915
|
+
select: index == _vm.value
|
|
658
916
|
},
|
|
659
917
|
style: {
|
|
660
|
-
backgroundColor:
|
|
918
|
+
backgroundColor: index == _vm.value ? _vm.config.theme || "orange" : ""
|
|
661
919
|
},
|
|
662
920
|
attrs: {
|
|
663
|
-
price:
|
|
921
|
+
"price": p
|
|
664
922
|
},
|
|
665
923
|
nativeOn: {
|
|
666
|
-
click: function(
|
|
667
|
-
return
|
|
924
|
+
"click": function($event) {
|
|
925
|
+
return _vm.changePrice(index);
|
|
668
926
|
}
|
|
669
927
|
}
|
|
670
928
|
});
|
|
671
|
-
}), 1)]),
|
|
929
|
+
}), 1)]), _vm.config.price.custom ? [_c("PriceCustom", {
|
|
672
930
|
model: {
|
|
673
|
-
value:
|
|
674
|
-
callback: function(
|
|
675
|
-
|
|
931
|
+
value: _vm.customPrice,
|
|
932
|
+
callback: function($$v) {
|
|
933
|
+
_vm.customPrice = $$v;
|
|
676
934
|
},
|
|
677
935
|
expression: "customPrice"
|
|
678
936
|
}
|
|
679
|
-
})] :
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
937
|
+
})] : _vm._e()], 2) : _vm._e();
|
|
938
|
+
};
|
|
939
|
+
var staticRenderFns$1 = [];
|
|
940
|
+
const priceContainer_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
941
|
+
const __cssModules$1 = {};
|
|
942
|
+
var __component__$1 = /* @__PURE__ */ normalizeComponent(
|
|
943
|
+
PriceContainer$1,
|
|
944
|
+
render$1,
|
|
945
|
+
staticRenderFns$1,
|
|
946
|
+
false,
|
|
947
|
+
__vue2_injectStyles$1,
|
|
948
|
+
"737beb57",
|
|
689
949
|
null,
|
|
690
950
|
null
|
|
691
951
|
);
|
|
692
|
-
function
|
|
693
|
-
for (let
|
|
694
|
-
this[
|
|
952
|
+
function __vue2_injectStyles$1(context) {
|
|
953
|
+
for (let o in __cssModules$1) {
|
|
954
|
+
this[o] = __cssModules$1[o];
|
|
955
|
+
}
|
|
695
956
|
}
|
|
696
|
-
const
|
|
697
|
-
return
|
|
957
|
+
const PriceContainer2 = /* @__PURE__ */ function() {
|
|
958
|
+
return __component__$1.exports;
|
|
698
959
|
}();
|
|
699
|
-
var
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
960
|
+
var __defProp2 = Object.defineProperty;
|
|
961
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
962
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
963
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
964
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
965
|
+
if (decorator = decorators[i])
|
|
966
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
967
|
+
if (kind && result)
|
|
968
|
+
__defProp2(target, key, result);
|
|
969
|
+
return result;
|
|
703
970
|
};
|
|
704
|
-
let
|
|
971
|
+
let PayPopup$1 = class PayPopup extends Vue {
|
|
705
972
|
constructor() {
|
|
706
973
|
super(...arguments);
|
|
707
|
-
|
|
708
|
-
|
|
974
|
+
__publicField(this, "config");
|
|
975
|
+
__publicField(this, "id");
|
|
709
976
|
// 默认主题
|
|
710
|
-
|
|
977
|
+
__publicField(this, "baseTheme", BaseTheme);
|
|
711
978
|
// 弹出层是否显示
|
|
712
|
-
|
|
979
|
+
__publicField(this, "visible", false);
|
|
713
980
|
// 余额
|
|
714
|
-
|
|
981
|
+
__publicField(this, "balance", 0);
|
|
715
982
|
// 价格
|
|
716
|
-
|
|
983
|
+
__publicField(this, "price", {
|
|
717
984
|
price: 0
|
|
718
985
|
});
|
|
719
986
|
// 选择的渠道
|
|
720
|
-
|
|
987
|
+
__publicField(this, "channel", null);
|
|
721
988
|
// 加载状态
|
|
722
|
-
|
|
989
|
+
__publicField(this, "loading", {
|
|
723
990
|
// 余额
|
|
724
|
-
balance:
|
|
991
|
+
balance: false,
|
|
725
992
|
// 价目表
|
|
726
|
-
price:
|
|
993
|
+
price: false,
|
|
727
994
|
// 渠道
|
|
728
|
-
channel:
|
|
995
|
+
channel: false
|
|
729
996
|
});
|
|
730
997
|
}
|
|
731
998
|
async mounted() {
|
|
732
999
|
this.$nextTick(() => {
|
|
733
|
-
this.visible =
|
|
1000
|
+
this.visible = true;
|
|
1001
|
+
this.initLoad();
|
|
734
1002
|
});
|
|
735
1003
|
}
|
|
736
1004
|
// 初始化加载状态
|
|
737
1005
|
initLoad() {
|
|
738
|
-
this.loading.balance = this.config.balance.disabled
|
|
1006
|
+
this.loading.balance = this.config.balance.disabled;
|
|
1007
|
+
this.loading.price = this.config.price.disabled;
|
|
739
1008
|
}
|
|
740
1009
|
// 关闭弹出层
|
|
741
1010
|
onClose() {
|
|
@@ -747,27 +1016,31 @@ let m = class extends _ {
|
|
|
747
1016
|
}
|
|
748
1017
|
// 点击充值
|
|
749
1018
|
async onTopup() {
|
|
750
|
-
const { key
|
|
1019
|
+
const { key, prefix } = this.config.pay;
|
|
1020
|
+
const value = String(this.id || this.price.price);
|
|
751
1021
|
if (!this.channel) {
|
|
752
|
-
|
|
1022
|
+
fail("渠道不存在");
|
|
753
1023
|
return;
|
|
754
1024
|
}
|
|
755
|
-
await
|
|
1025
|
+
await sendPay({
|
|
756
1026
|
channel: this.channel,
|
|
757
|
-
key
|
|
758
|
-
value
|
|
759
|
-
prefix
|
|
1027
|
+
key,
|
|
1028
|
+
value,
|
|
1029
|
+
prefix
|
|
760
1030
|
});
|
|
1031
|
+
this.onClosed();
|
|
761
1032
|
}
|
|
762
1033
|
/** 余额变动*/
|
|
763
|
-
onBanlanceChange(
|
|
764
|
-
this.loading.balance =
|
|
1034
|
+
onBanlanceChange(money) {
|
|
1035
|
+
this.loading.balance = true;
|
|
765
1036
|
}
|
|
766
|
-
onChannelChange(
|
|
767
|
-
this.channel =
|
|
1037
|
+
onChannelChange(channel) {
|
|
1038
|
+
this.channel = channel;
|
|
1039
|
+
this.loading.channel = true;
|
|
768
1040
|
}
|
|
769
|
-
onPriceChange(
|
|
770
|
-
this.price =
|
|
1041
|
+
onPriceChange(price) {
|
|
1042
|
+
this.price = price;
|
|
1043
|
+
this.loading.price = true;
|
|
771
1044
|
}
|
|
772
1045
|
// 计算最终金额
|
|
773
1046
|
get finalPrice() {
|
|
@@ -775,122 +1048,137 @@ let m = class extends _ {
|
|
|
775
1048
|
}
|
|
776
1049
|
// 计算是否允许充值
|
|
777
1050
|
get disable() {
|
|
778
|
-
return !Object.values(this.loading).every((
|
|
1051
|
+
return !Object.values(this.loading).every((val) => val === true);
|
|
779
1052
|
}
|
|
780
1053
|
// 计算页面标题
|
|
781
1054
|
get title() {
|
|
782
1055
|
return this.config.name;
|
|
783
1056
|
}
|
|
784
1057
|
};
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
],
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
],
|
|
792
|
-
|
|
793
|
-
|
|
1058
|
+
__decorateClass([
|
|
1059
|
+
Provide("config"),
|
|
1060
|
+
Prop({ default: AgentConfig })
|
|
1061
|
+
], PayPopup$1.prototype, "config", 2);
|
|
1062
|
+
__decorateClass([
|
|
1063
|
+
Prop({ default: void 0 })
|
|
1064
|
+
], PayPopup$1.prototype, "id", 2);
|
|
1065
|
+
PayPopup$1 = __decorateClass([
|
|
1066
|
+
Component$1({
|
|
794
1067
|
components: {
|
|
795
|
-
Balance:
|
|
796
|
-
Divider
|
|
797
|
-
PriceContainer:
|
|
798
|
-
Button
|
|
799
|
-
PriceCustom:
|
|
800
|
-
Channels:
|
|
1068
|
+
Balance: Balance2,
|
|
1069
|
+
Divider,
|
|
1070
|
+
PriceContainer: PriceContainer2,
|
|
1071
|
+
Button,
|
|
1072
|
+
PriceCustom: PriceCustom2,
|
|
1073
|
+
Channels: Channels2
|
|
801
1074
|
}
|
|
802
1075
|
})
|
|
803
|
-
],
|
|
804
|
-
var
|
|
805
|
-
var
|
|
806
|
-
|
|
1076
|
+
], PayPopup$1);
|
|
1077
|
+
var render = function() {
|
|
1078
|
+
var _vm = this;
|
|
1079
|
+
var _h = _vm.$createElement;
|
|
1080
|
+
var _c = _vm._self._c || _h;
|
|
1081
|
+
return _c("van-popup", {
|
|
807
1082
|
staticClass: "pay-popup",
|
|
808
1083
|
attrs: {
|
|
809
|
-
position: "bottom",
|
|
810
|
-
overlay:
|
|
811
|
-
round: ""
|
|
1084
|
+
"position": "bottom",
|
|
1085
|
+
"overlay": true,
|
|
1086
|
+
"round": ""
|
|
812
1087
|
},
|
|
813
1088
|
on: {
|
|
814
|
-
closed:
|
|
815
|
-
close:
|
|
1089
|
+
"closed": _vm.onClosed,
|
|
1090
|
+
"close": _vm.onClose
|
|
816
1091
|
},
|
|
817
1092
|
model: {
|
|
818
|
-
value:
|
|
819
|
-
callback: function(
|
|
820
|
-
|
|
1093
|
+
value: _vm.visible,
|
|
1094
|
+
callback: function($$v) {
|
|
1095
|
+
_vm.visible = $$v;
|
|
821
1096
|
},
|
|
822
1097
|
expression: "visible"
|
|
823
1098
|
}
|
|
824
|
-
}, [
|
|
1099
|
+
}, [_c("h4", {
|
|
825
1100
|
staticClass: "title"
|
|
826
|
-
}, [
|
|
1101
|
+
}, [_vm._v(" " + _vm._s(_vm.title) + " ")]), !_vm.config.balance.disabled ? [_c("Balance", {
|
|
827
1102
|
on: {
|
|
828
|
-
change:
|
|
1103
|
+
"change": _vm.onBanlanceChange
|
|
829
1104
|
}
|
|
830
|
-
}),
|
|
1105
|
+
}), _c("Divider")] : _vm._e(), !_vm.config.price.disabled ? [_c("PriceContainer", {
|
|
831
1106
|
on: {
|
|
832
|
-
change:
|
|
1107
|
+
"change": _vm.onPriceChange
|
|
833
1108
|
}
|
|
834
|
-
}),
|
|
1109
|
+
}), _c("Divider")] : _vm._e(), _c("Channels", {
|
|
835
1110
|
on: {
|
|
836
|
-
change:
|
|
1111
|
+
"change": _vm.onChannelChange
|
|
837
1112
|
}
|
|
838
|
-
}),
|
|
1113
|
+
}), _c("Divider"), _c("Button", {
|
|
839
1114
|
attrs: {
|
|
840
|
-
disabled:
|
|
841
|
-
color:
|
|
842
|
-
block: ""
|
|
1115
|
+
"disabled": _vm.disable,
|
|
1116
|
+
"color": _vm.config.theme || _vm.baseTheme,
|
|
1117
|
+
"block": ""
|
|
843
1118
|
},
|
|
844
1119
|
on: {
|
|
845
|
-
click:
|
|
1120
|
+
"click": _vm.onTopup
|
|
846
1121
|
}
|
|
847
|
-
}, [
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1122
|
+
}, [_vm._v(" 立即支付 " + _vm._s(_vm.finalPrice) + " 元 ")])], 2);
|
|
1123
|
+
};
|
|
1124
|
+
var staticRenderFns = [];
|
|
1125
|
+
const popup_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1126
|
+
const __cssModules = {};
|
|
1127
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
1128
|
+
PayPopup$1,
|
|
1129
|
+
render,
|
|
1130
|
+
staticRenderFns,
|
|
1131
|
+
false,
|
|
1132
|
+
__vue2_injectStyles,
|
|
1133
|
+
"4ac1c510",
|
|
857
1134
|
null,
|
|
858
1135
|
null
|
|
859
1136
|
);
|
|
860
|
-
function
|
|
861
|
-
for (let
|
|
862
|
-
this[
|
|
1137
|
+
function __vue2_injectStyles(context) {
|
|
1138
|
+
for (let o in __cssModules) {
|
|
1139
|
+
this[o] = __cssModules[o];
|
|
1140
|
+
}
|
|
863
1141
|
}
|
|
864
|
-
const
|
|
865
|
-
return
|
|
866
|
-
}()
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
config: a,
|
|
881
|
-
id: c
|
|
1142
|
+
const PayPopup2 = /* @__PURE__ */ function() {
|
|
1143
|
+
return __component__.exports;
|
|
1144
|
+
}();
|
|
1145
|
+
const plugin = {
|
|
1146
|
+
install(vue) {
|
|
1147
|
+
const create = (type, ...args) => {
|
|
1148
|
+
return new Promise((res, rej) => {
|
|
1149
|
+
const config = PayAllConfig[type];
|
|
1150
|
+
const { needId } = config;
|
|
1151
|
+
const id = args[0];
|
|
1152
|
+
if (needId && !id) {
|
|
1153
|
+
Dialog({
|
|
1154
|
+
title: "参数异常",
|
|
1155
|
+
message: `${type} 类型需要传入订单号 当前未传入!`
|
|
1156
|
+
});
|
|
1157
|
+
return;
|
|
882
1158
|
}
|
|
1159
|
+
const Constructor = Vue.extend(PayPopup2);
|
|
1160
|
+
const instance = new Constructor({
|
|
1161
|
+
// 注入配置
|
|
1162
|
+
propsData: {
|
|
1163
|
+
config,
|
|
1164
|
+
id
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
instance.$on("onClosed", () => {
|
|
1168
|
+
res();
|
|
1169
|
+
setTimeout(() => {
|
|
1170
|
+
var _a2;
|
|
1171
|
+
instance.$destroy();
|
|
1172
|
+
(_a2 = instance.$el.parentNode) == null ? void 0 : _a2.removeChild(instance.$el);
|
|
1173
|
+
}, 300);
|
|
1174
|
+
});
|
|
1175
|
+
instance.$mount();
|
|
1176
|
+
document.body.appendChild(instance.$el);
|
|
883
1177
|
});
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
var d;
|
|
887
|
-
f.$destroy(), (d = f.$el.parentNode) == null || d.removeChild(f.$el);
|
|
888
|
-
}, 300);
|
|
889
|
-
}), f.$mount(), document.body.appendChild(f.$el);
|
|
890
|
-
});
|
|
891
|
-
e.prototype.$pay = { create: n };
|
|
1178
|
+
};
|
|
1179
|
+
vue.prototype.$pay = { create };
|
|
892
1180
|
}
|
|
893
1181
|
};
|
|
894
1182
|
export {
|
|
895
|
-
|
|
1183
|
+
plugin as PayPlugin
|
|
896
1184
|
};
|