@zhangcf233/pay 1.0.11 → 1.0.13

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 CHANGED
@@ -1,15 +1,14 @@
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-4e76879e]{font-family:WeChat-Bold}.pay-popup[data-v-4e76879e]{display:flex;flex-direction:column;width:100vw;box-sizing:border-box;overflow:hidden;padding:0 .15rem .2rem;transition:all .3s}.title[data-v-4e76879e]{text-align:center;margin:.16rem 0}.check-box[data-v-4e76879e]{display:flex;justify-content:center;align-items:center;font-size:.12rem;padding:.1rem 0}.protocol-popup[data-v-4e76879e]{height:70vh;width:100vw;overflow-x:hidden}.protocol-popup .prptocol[data-v-4e76879e]{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%}.protocol-popup .prptocol .btn-box[data-v-4e76879e]{height:10%;width:100%;display:flex;justify-content:space-around;padding:.1rem;box-sizing:content-box}.protocol-popup .prptocol .btn-box>*[data-v-4e76879e]{width:45%}.protocol-popup .prptocol iframe[data-v-4e76879e]{display:block;width:100%;height:90%;margin:0;border:0}.agree-dialog .check-box[data-v-4e76879e]{margin:.2rem}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";.protocol-popup[data-v-1e3531b1]{height:70vh;width:100vw;overflow-x:hidden}.protocol-popup .protocol[data-v-1e3531b1]{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%}.protocol-popup .protocol .btn-box[data-v-1e3531b1]{height:10%;width:100%;display:flex;justify-content:space-around;padding:.1rem;box-sizing:content-box}.protocol-popup .protocol .btn-box>*[data-v-1e3531b1]{width:45%}.protocol-popup .protocol iframe[data-v-1e3531b1]{display:block;width:100%;height:90%;margin:0;border:0;padding:.16rem;box-sizing:border-box}.agreement[data-v-017a359d]{display:flex;justify-content:center;align-items:center;font-size:.12rem;margin:.16rem 0}.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}.identity[data-v-5f9eb7e3]{margin-top:.16rem}@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-05e06290]{font-family:WeChat-Bold}.custom-price .input[data-v-05e06290]{font-size:.2rem;padding:0;margin-top:.16rem}@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-a6f45494]{width:100%;margin:.16rem 0;display:grid;grid-template-columns:repeat(3,1fr);gap:.1rem;box-sizing:border-box;font-weight:500}.loading[data-v-a6f45494]{display:flex;justify-content:center;align-items:center}.select[data-v-a6f45494]{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-7115f264]{font-family:WeChat-Bold}.pay-popup[data-v-7115f264]{display:flex;flex-direction:column;width:100vw;box-sizing:border-box;overflow:hidden;padding:0 .15rem .2rem;transition:all .3s}.title[data-v-7115f264]{text-align:center;margin:.16rem 0}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => {
5
5
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
6
  return value;
7
7
  };
8
- var _a, _b;
9
8
  import { Dialog, Toast, Divider, Button } from "vant";
10
9
  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";
10
+ import Component from "vue-class-component";
11
+ import { Prop, Inject, Watch, Component as Component$1, Vue as Vue$1, Provide } from "vue-property-decorator";
13
12
  async function request(url, data, method = "POST") {
14
13
  return new Promise((res, rej) => {
15
14
  const AppToken = localStorage.getItem("AppToken") || "";
@@ -62,9 +61,9 @@ const success = (data) => {
62
61
  data
63
62
  };
64
63
  };
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);
64
+ const ua = navigator.userAgent;
65
+ const isYM = /LT-APP/.test(ua);
66
+ const isZW = /ZW-APP/.test(ua);
68
67
  const alipay = async (options) => {
69
68
  const { id, key, value, prefix } = options;
70
69
  let url = location.origin + `/Payment/${prefix || ""}Alipay`;
@@ -85,19 +84,19 @@ const alipay = async (options) => {
85
84
  if (!Data) {
86
85
  return fail("支付跳转地址不存在");
87
86
  }
88
- if (inApp) {
87
+ if (isZW) {
89
88
  Vue.prototype.$jsBridge.openLink(Data);
90
89
  return;
91
90
  }
92
91
  location.href = Data;
93
92
  };
94
93
  function getQrcode() {
95
- return isYM || inApp || isThirdParty;
94
+ return isYM || isZW;
96
95
  }
97
96
  const isMpWeixin = /miniProgram/i.test(navigator.userAgent) && /micromessenger/i.test(navigator.userAgent);
98
97
  const wechat = (params) => {
99
- var _a2;
100
- const { id, appid, key, value, prefix } = params;
98
+ var _a;
99
+ const { id, appid, key, value, prefix = "" } = params;
101
100
  if (!appid) {
102
101
  Dialog({
103
102
  title: "小程序 id 不存在"
@@ -123,7 +122,7 @@ const wechat = (params) => {
123
122
  /** 支付渠道id*/
124
123
  paymentId: id,
125
124
  /** 支付渠道接口*/
126
- payApi: `${location.origin}}/Payment/${prefix}Weixin`,
125
+ payApi: `${location.origin}/Payment/${prefix}Weixin`,
127
126
  /** tokenkey*/
128
127
  tokenKey: "AppToken",
129
128
  /** token 值*/
@@ -132,7 +131,7 @@ const wechat = (params) => {
132
131
  const query = encodeURIComponent(Object.entries(options).map(([key2, value2]) => `${key2}=${String(value2)}`).join("&"));
133
132
  const url = `weixin://dl/business/?appid=${appid}&path=pages/home/index&query=${query}`;
134
133
  if (window.ReactNativeWebView) {
135
- (_a2 = window.ReactNativeWebView) == null ? void 0 : _a2.postMessage(JSON.stringify(
134
+ (_a = window.ReactNativeWebView) == null ? void 0 : _a.postMessage(JSON.stringify(
136
135
  {
137
136
  type: "openUrl",
138
137
  data: {
@@ -194,7 +193,7 @@ const sendPay = async ({ channel, key, value, prefix }) => {
194
193
  };
195
194
  const BaseTheme = "orange";
196
195
  const ignorePlatform = ["platform"];
197
- const BaseAgreement = "https://qi0irqynw8.feishu.cn/docx/Ea1PdrV5SonBfHxAIHUchKjVnVf";
196
+ const BaseAgreement = "https://czyxzs.xuelm.cn/agreement.html";
198
197
  const AgentConfig = {
199
198
  needId: false,
200
199
  name: "店铺余额",
@@ -236,6 +235,11 @@ const AgentConfig = {
236
235
  pay: {
237
236
  key: "Money"
238
237
  },
238
+ identity: {
239
+ disable: false,
240
+ api: "/AgentUser/GetUserInfo",
241
+ auth: "/AgentUser/Authentication"
242
+ },
239
243
  agreement: BaseAgreement
240
244
  };
241
245
  const UserConfig = {
@@ -278,97 +282,112 @@ const UserConfig = {
278
282
  pay: {
279
283
  key: "Money"
280
284
  },
285
+ identity: {
286
+ disable: false,
287
+ api: "/PlayerUser/GetUserInfo",
288
+ auth: "/PlayerUser/Authentication"
289
+ },
281
290
  agreement: BaseAgreement
282
291
  };
283
292
  const PayAllConfig = {
284
293
  agent: AgentConfig,
285
294
  user: UserConfig
286
295
  };
287
- const getPayMoney = async (url, key) => {
288
- const data = await request(url);
289
- if (!(key in data)) {
290
- fail(JSON.stringify(data) || "解析数据异常", `余额数据中不存在 ${key}`);
291
- return 0;
292
- }
293
- return data[key];
294
- };
295
- var __defProp$6 = Object.defineProperty;
296
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
297
- var __decorateClass$6 = (decorators, target, key, kind) => {
298
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
296
+ var __defProp$a = Object.defineProperty;
297
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
298
+ var __decorateClass$a = (decorators, target, key, kind) => {
299
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
299
300
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
300
301
  if (decorator = decorators[i])
301
302
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
302
303
  if (kind && result)
303
- __defProp$6(target, key, result);
304
+ __defProp$a(target, key, result);
304
305
  return result;
305
306
  };
306
- let PayError$1 = class PayError extends Vue$1 {
307
+ let AgreementPopup$1 = class AgreementPopup extends Vue {
307
308
  constructor() {
308
309
  super(...arguments);
309
- __publicField(this, "load");
310
- __publicField(this, "loading", true);
311
- __publicField(this, "message", "");
310
+ __publicField(this, "value");
311
+ __publicField(this, "config");
312
+ __publicField(this, "open", false);
312
313
  }
313
- get showLoading() {
314
- return this.loading || this.message;
314
+ mounted() {
315
+ this.open = this.value;
315
316
  }
316
- async mounted() {
317
- await this.retry();
317
+ onValue(n) {
318
+ this.open = n;
318
319
  }
319
- test() {
320
- this.loading = true;
321
- setTimeout(() => {
322
- this.loading = false;
323
- }, 100);
320
+ onOpen(n) {
321
+ this.$emit("input", n);
324
322
  }
325
- async retry() {
326
- this.message = "";
327
- this.loading = true;
328
- const res = await this.load().finally(() => {
329
- this.loading = false;
330
- }).catch((message) => {
331
- this.message = message;
332
- });
333
- if (res != void 0) {
334
- this.$emit("done", res);
335
- }
323
+ disagree() {
324
+ this.$emit("disagree");
325
+ }
326
+ agreeProtocolAndPay() {
327
+ this.$emit("agreeProtocolAndPay");
336
328
  }
337
329
  };
338
- __decorateClass$6([
339
- Prop()
340
- ], PayError$1.prototype, "load", 2);
341
- PayError$1 = __decorateClass$6([
330
+ __decorateClass$a([
331
+ Prop({ default: false })
332
+ ], AgreementPopup$1.prototype, "value", 2);
333
+ __decorateClass$a([
334
+ Inject()
335
+ ], AgreementPopup$1.prototype, "config", 2);
336
+ __decorateClass$a([
337
+ Watch("value")
338
+ ], AgreementPopup$1.prototype, "onValue", 1);
339
+ __decorateClass$a([
340
+ Watch("open")
341
+ ], AgreementPopup$1.prototype, "onOpen", 1);
342
+ AgreementPopup$1 = __decorateClass$a([
342
343
  Component
343
- ], PayError$1);
344
- var render$6 = function() {
344
+ ], AgreementPopup$1);
345
+ var render$a = function() {
345
346
  var _vm = this;
346
347
  var _h = _vm.$createElement;
347
348
  var _c = _vm._self._c || _h;
348
- return _c("div", {
349
- staticClass: "pay-error-container"
349
+ return _c("van-popup", {
350
+ staticClass: "protocol-popup",
351
+ attrs: {
352
+ "position": "bottom",
353
+ "overlay": true,
354
+ "round": ""
355
+ },
356
+ model: {
357
+ value: _vm.open,
358
+ callback: function($$v) {
359
+ _vm.open = $$v;
360
+ },
361
+ expression: "open"
362
+ }
350
363
  }, [_c("div", {
351
- staticClass: "loading",
352
- style: {
353
- display: _vm.showLoading ? "flex" : "none"
364
+ staticClass: "protocol"
365
+ }, [_c("iframe", {
366
+ attrs: {
367
+ "src": _vm.config.agreement
354
368
  }
355
- }, [_vm.message ? _c("van-tag", {
369
+ }), _c("div", {
370
+ staticClass: "btn-box"
371
+ }, [_c("van-button", {
356
372
  attrs: {
357
- "type": "danger"
373
+ "block": ""
358
374
  },
359
375
  on: {
360
- "click": _vm.retry
376
+ "click": _vm.disagree
361
377
  }
362
- }, [_vm._v(" " + _vm._s(_vm.message) + " 点击重试 ")]) : _c("van-loading", {
363
- staticClass: "loading-icon",
378
+ }, [_vm._v("不同意")]), _c("van-button", {
364
379
  attrs: {
365
- "size": "20",
366
- "type": "spinner"
380
+ "color": _vm.config.theme,
381
+ "block": "",
382
+ "type": "primary"
383
+ },
384
+ on: {
385
+ "click": _vm.agreeProtocolAndPay
367
386
  }
368
- })], 1), _vm._t("default")], 2);
387
+ }, [_vm._v("同意并支付")])], 1)])]);
369
388
  };
370
- var staticRenderFns$6 = [];
371
- const payError_vue_vue_type_style_index_0_scoped_true_lang = "";
389
+ var staticRenderFns$a = [];
390
+ const popup_vue_vue_type_style_index_0_scoped_true_lang$2 = "";
372
391
  function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
373
392
  var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
374
393
  if (render2) {
@@ -425,34 +444,281 @@ function normalizeComponent(scriptExports, render2, staticRenderFns2, functional
425
444
  options
426
445
  };
427
446
  }
428
- const __cssModules$6 = {};
429
- var __component__$6 = /* @__PURE__ */ normalizeComponent(
447
+ const __cssModules$a = {};
448
+ var __component__$a = /* @__PURE__ */ normalizeComponent(
449
+ AgreementPopup$1,
450
+ render$a,
451
+ staticRenderFns$a,
452
+ false,
453
+ __vue2_injectStyles$a,
454
+ "1e3531b1",
455
+ null,
456
+ null
457
+ );
458
+ function __vue2_injectStyles$a(context) {
459
+ for (let o in __cssModules$a) {
460
+ this[o] = __cssModules$a[o];
461
+ }
462
+ }
463
+ const AgreementPopup2 = /* @__PURE__ */ function() {
464
+ return __component__$a.exports;
465
+ }();
466
+ var __defProp$9 = Object.defineProperty;
467
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
468
+ var __decorateClass$9 = (decorators, target, key, kind) => {
469
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
470
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
471
+ if (decorator = decorators[i])
472
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
473
+ if (kind && result)
474
+ __defProp$9(target, key, result);
475
+ return result;
476
+ };
477
+ let Agreement$1 = class Agreement extends Vue {
478
+ constructor() {
479
+ super(...arguments);
480
+ __publicField(this, "value");
481
+ __publicField(this, "config");
482
+ // 同意协议本地标识
483
+ __publicField(this, "agreeProtocolFlag", "__isAgreeProtocol__");
484
+ // 是否同意协议
485
+ __publicField(this, "agree", false);
486
+ // 是否展示协议
487
+ __publicField(this, "show", false);
488
+ }
489
+ // 初始化时赋值内部状态
490
+ mounted() {
491
+ this.agree = Boolean(localStorage.getItem(this.agreeProtocolFlag) || false);
492
+ }
493
+ onOpen(n) {
494
+ this.$emit("input", n);
495
+ if (n) {
496
+ localStorage.setItem(this.agreeProtocolFlag, "true");
497
+ } else {
498
+ localStorage.removeItem(this.agreeProtocolFlag);
499
+ }
500
+ }
501
+ onValue(n) {
502
+ this.agree = n;
503
+ }
504
+ // 展示协议
505
+ openProtocol() {
506
+ this.show = true;
507
+ }
508
+ // 不同意协议
509
+ disagree() {
510
+ console.log("不同意协议");
511
+ this.agree = false;
512
+ this.show = false;
513
+ }
514
+ // 同意协议
515
+ agreeProtocol() {
516
+ this.agree = true;
517
+ this.show = false;
518
+ }
519
+ // 同意并支付
520
+ agreeProtocolAndPay() {
521
+ this.agreeProtocol();
522
+ this.$nextTick(() => {
523
+ this.$emit("pay");
524
+ });
525
+ }
526
+ };
527
+ __decorateClass$9([
528
+ Prop({ default: false })
529
+ ], Agreement$1.prototype, "value", 2);
530
+ __decorateClass$9([
531
+ Inject()
532
+ ], Agreement$1.prototype, "config", 2);
533
+ __decorateClass$9([
534
+ Watch("agree")
535
+ ], Agreement$1.prototype, "onOpen", 1);
536
+ __decorateClass$9([
537
+ Watch("value")
538
+ ], Agreement$1.prototype, "onValue", 1);
539
+ Agreement$1 = __decorateClass$9([
540
+ Component({
541
+ components: {
542
+ AgreementPopup: AgreementPopup2
543
+ }
544
+ })
545
+ ], Agreement$1);
546
+ var render$9 = function() {
547
+ var _vm = this;
548
+ var _h = _vm.$createElement;
549
+ var _c = _vm._self._c || _h;
550
+ return _c("div", {
551
+ staticClass: "agreement"
552
+ }, [_c("van-checkbox", {
553
+ attrs: {
554
+ "checked-color": _vm.config.theme,
555
+ "icon-size": "12"
556
+ },
557
+ model: {
558
+ value: _vm.agree,
559
+ callback: function($$v) {
560
+ _vm.agree = $$v;
561
+ },
562
+ expression: "agree"
563
+ }
564
+ }, [_vm._v(" 阅读并同意 "), _c("span", {
565
+ style: {
566
+ color: _vm.config.theme
567
+ },
568
+ on: {
569
+ "click": function($event) {
570
+ $event.stopPropagation();
571
+ return _vm.openProtocol.apply(null, arguments);
572
+ }
573
+ }
574
+ }, [_vm._v("充值协议")])]), _c("AgreementPopup", {
575
+ on: {
576
+ "disagree": _vm.disagree,
577
+ "agreeProtocolAndPay": _vm.agreeProtocolAndPay
578
+ },
579
+ model: {
580
+ value: _vm.show,
581
+ callback: function($$v) {
582
+ _vm.show = $$v;
583
+ },
584
+ expression: "show"
585
+ }
586
+ })], 1);
587
+ };
588
+ var staticRenderFns$9 = [];
589
+ const agreement_vue_vue_type_style_index_0_scoped_true_lang = "";
590
+ const __cssModules$9 = {};
591
+ var __component__$9 = /* @__PURE__ */ normalizeComponent(
592
+ Agreement$1,
593
+ render$9,
594
+ staticRenderFns$9,
595
+ false,
596
+ __vue2_injectStyles$9,
597
+ "017a359d",
598
+ null,
599
+ null
600
+ );
601
+ function __vue2_injectStyles$9(context) {
602
+ for (let o in __cssModules$9) {
603
+ this[o] = __cssModules$9[o];
604
+ }
605
+ }
606
+ const Agreement2 = /* @__PURE__ */ function() {
607
+ return __component__$9.exports;
608
+ }();
609
+ const getPayMoney = async (url, key) => {
610
+ const data = await request(url);
611
+ if (!(key in data)) {
612
+ fail(JSON.stringify(data) || "解析数据异常", `余额数据中不存在 ${key}`);
613
+ return 0;
614
+ }
615
+ return data[key];
616
+ };
617
+ var __defProp$8 = Object.defineProperty;
618
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
619
+ var __decorateClass$8 = (decorators, target, key, kind) => {
620
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
621
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
622
+ if (decorator = decorators[i])
623
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
624
+ if (kind && result)
625
+ __defProp$8(target, key, result);
626
+ return result;
627
+ };
628
+ let PayError$1 = class PayError extends Vue$1 {
629
+ constructor() {
630
+ super(...arguments);
631
+ __publicField(this, "load");
632
+ __publicField(this, "loading", true);
633
+ __publicField(this, "message", "");
634
+ }
635
+ get showLoading() {
636
+ return this.loading || this.message;
637
+ }
638
+ async mounted() {
639
+ await this.retry();
640
+ }
641
+ test() {
642
+ this.loading = true;
643
+ setTimeout(() => {
644
+ this.loading = false;
645
+ }, 100);
646
+ }
647
+ async retry() {
648
+ this.message = "";
649
+ this.loading = true;
650
+ const res = await this.load().finally(() => {
651
+ this.loading = false;
652
+ }).catch((message) => {
653
+ this.message = message;
654
+ });
655
+ if (res != void 0) {
656
+ this.$emit("done", res);
657
+ }
658
+ }
659
+ };
660
+ __decorateClass$8([
661
+ Prop()
662
+ ], PayError$1.prototype, "load", 2);
663
+ PayError$1 = __decorateClass$8([
664
+ Component$1
665
+ ], PayError$1);
666
+ var render$8 = function() {
667
+ var _vm = this;
668
+ var _h = _vm.$createElement;
669
+ var _c = _vm._self._c || _h;
670
+ return _c("div", {
671
+ staticClass: "pay-error-container"
672
+ }, [_c("div", {
673
+ staticClass: "loading",
674
+ style: {
675
+ display: _vm.showLoading ? "flex" : "none"
676
+ }
677
+ }, [_vm.message ? _c("van-tag", {
678
+ attrs: {
679
+ "type": "danger"
680
+ },
681
+ on: {
682
+ "click": _vm.retry
683
+ }
684
+ }, [_vm._v(" " + _vm._s(_vm.message) + " 点击重试 ")]) : _c("van-loading", {
685
+ staticClass: "loading-icon",
686
+ attrs: {
687
+ "size": "20",
688
+ "type": "spinner"
689
+ }
690
+ })], 1), _vm._t("default")], 2);
691
+ };
692
+ var staticRenderFns$8 = [];
693
+ const payError_vue_vue_type_style_index_0_scoped_true_lang = "";
694
+ const __cssModules$8 = {};
695
+ var __component__$8 = /* @__PURE__ */ normalizeComponent(
430
696
  PayError$1,
431
- render$6,
432
- staticRenderFns$6,
697
+ render$8,
698
+ staticRenderFns$8,
433
699
  false,
434
- __vue2_injectStyles$6,
700
+ __vue2_injectStyles$8,
435
701
  "0817c014",
436
702
  null,
437
703
  null
438
704
  );
439
- function __vue2_injectStyles$6(context) {
440
- for (let o in __cssModules$6) {
441
- this[o] = __cssModules$6[o];
705
+ function __vue2_injectStyles$8(context) {
706
+ for (let o in __cssModules$8) {
707
+ this[o] = __cssModules$8[o];
442
708
  }
443
709
  }
444
710
  const PayError2 = /* @__PURE__ */ function() {
445
- return __component__$6.exports;
711
+ return __component__$8.exports;
446
712
  }();
447
- var __defProp$5 = Object.defineProperty;
448
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
449
- var __decorateClass$5 = (decorators, target, key, kind) => {
450
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
713
+ var __defProp$7 = Object.defineProperty;
714
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
715
+ var __decorateClass$7 = (decorators, target, key, kind) => {
716
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
451
717
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
452
718
  if (decorator = decorators[i])
453
719
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
454
720
  if (kind && result)
455
- __defProp$5(target, key, result);
721
+ __defProp$7(target, key, result);
456
722
  return result;
457
723
  };
458
724
  let Balance$1 = class Balance extends Vue {
@@ -473,15 +739,15 @@ let Balance$1 = class Balance extends Vue {
473
739
  this.$emit("change", money);
474
740
  }
475
741
  };
476
- __decorateClass$5([
742
+ __decorateClass$7([
477
743
  Inject()
478
744
  ], Balance$1.prototype, "config", 2);
479
- Balance$1 = __decorateClass$5([
480
- Component({
745
+ Balance$1 = __decorateClass$7([
746
+ Component$1({
481
747
  components: { PayError: PayError2 }
482
748
  })
483
749
  ], Balance$1);
484
- var render$5 = function() {
750
+ var render$7 = function() {
485
751
  var _vm = this;
486
752
  var _h = _vm.$createElement;
487
753
  var _c = _vm._self._c || _h;
@@ -496,26 +762,26 @@ var render$5 = function() {
496
762
  }
497
763
  }, [_c("h1", [_vm._v(" " + _vm._s(_vm.value) + " ")])])], 1);
498
764
  };
499
- var staticRenderFns$5 = [];
765
+ var staticRenderFns$7 = [];
500
766
  const balance_vue_vue_type_style_index_0_scoped_true_lang = "";
501
- const __cssModules$5 = {};
502
- var __component__$5 = /* @__PURE__ */ normalizeComponent(
767
+ const __cssModules$7 = {};
768
+ var __component__$7 = /* @__PURE__ */ normalizeComponent(
503
769
  Balance$1,
504
- render$5,
505
- staticRenderFns$5,
770
+ render$7,
771
+ staticRenderFns$7,
506
772
  false,
507
- __vue2_injectStyles$5,
773
+ __vue2_injectStyles$7,
508
774
  "20b4bf5f",
509
775
  null,
510
776
  null
511
777
  );
512
- function __vue2_injectStyles$5(context) {
513
- for (let o in __cssModules$5) {
514
- this[o] = __cssModules$5[o];
778
+ function __vue2_injectStyles$7(context) {
779
+ for (let o in __cssModules$7) {
780
+ this[o] = __cssModules$7[o];
515
781
  }
516
782
  }
517
783
  const Balance2 = /* @__PURE__ */ function() {
518
- return __component__$5.exports;
784
+ return __component__$7.exports;
519
785
  }();
520
786
  const getPayChannels = async (url, ignores) => {
521
787
  const list = await request(url);
@@ -552,15 +818,15 @@ function getChannelType(name) {
552
818
  }
553
819
  return "unknow";
554
820
  }
555
- var __defProp$4 = Object.defineProperty;
556
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
557
- var __decorateClass$4 = (decorators, target, key, kind) => {
558
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
821
+ var __defProp$6 = Object.defineProperty;
822
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
823
+ var __decorateClass$6 = (decorators, target, key, kind) => {
824
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
559
825
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
560
826
  if (decorator = decorators[i])
561
827
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
562
828
  if (kind && result)
563
- __defProp$4(target, key, result);
829
+ __defProp$6(target, key, result);
564
830
  return result;
565
831
  };
566
832
  let Channels$1 = class Channels extends Vue {
@@ -610,17 +876,17 @@ let Channels$1 = class Channels extends Vue {
610
876
  this.$emit("change", this.channels[0]);
611
877
  }
612
878
  };
613
- __decorateClass$4([
879
+ __decorateClass$6([
614
880
  Inject()
615
881
  ], Channels$1.prototype, "config", 2);
616
- Channels$1 = __decorateClass$4([
617
- Component$1({
882
+ Channels$1 = __decorateClass$6([
883
+ Component({
618
884
  components: {
619
885
  PayError: PayError2
620
886
  }
621
887
  })
622
888
  ], Channels$1);
623
- var render$4 = function() {
889
+ var render$6 = function() {
624
890
  var _vm = this;
625
891
  var _h = _vm.$createElement;
626
892
  var _c = _vm._self._c || _h;
@@ -663,16 +929,280 @@ var render$4 = function() {
663
929
  }
664
930
  });
665
931
  };
666
- var staticRenderFns$4 = [];
932
+ var staticRenderFns$6 = [];
667
933
  const channelContainer_vue_vue_type_style_index_0_scoped_true_lang = "";
934
+ const __cssModules$6 = {};
935
+ var __component__$6 = /* @__PURE__ */ normalizeComponent(
936
+ Channels$1,
937
+ render$6,
938
+ staticRenderFns$6,
939
+ false,
940
+ __vue2_injectStyles$6,
941
+ "70746494",
942
+ null,
943
+ null
944
+ );
945
+ function __vue2_injectStyles$6(context) {
946
+ for (let o in __cssModules$6) {
947
+ this[o] = __cssModules$6[o];
948
+ }
949
+ }
950
+ const Channels2 = /* @__PURE__ */ function() {
951
+ return __component__$6.exports;
952
+ }();
953
+ const getIdentity = async (url) => {
954
+ const info = {
955
+ status: false,
956
+ name: ""
957
+ };
958
+ const { RealName } = await request(url);
959
+ if (RealName == void 0) {
960
+ throw new Error(`不存在实名信息`);
961
+ }
962
+ if (RealName == "") {
963
+ return info;
964
+ }
965
+ info.name = RealName;
966
+ info.status = true;
967
+ return info;
968
+ };
969
+ const setIdentity = async (url, data) => {
970
+ const { Message, Status } = await request(url, data);
971
+ if (!Status) {
972
+ throw new Error(Message);
973
+ }
974
+ return true;
975
+ };
976
+ var __defProp$5 = Object.defineProperty;
977
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
978
+ var __decorateClass$5 = (decorators, target, key, kind) => {
979
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
980
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
981
+ if (decorator = decorators[i])
982
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
983
+ if (kind && result)
984
+ __defProp$5(target, key, result);
985
+ return result;
986
+ };
987
+ let Identity$2 = class Identity extends Vue {
988
+ constructor() {
989
+ super(...arguments);
990
+ __publicField(this, "config");
991
+ // 姓名
992
+ __publicField(this, "name", "");
993
+ // 身份证
994
+ __publicField(this, "id", "");
995
+ // 认证状态
996
+ __publicField(this, "status", false);
997
+ }
998
+ // 请求参数
999
+ get params() {
1000
+ return {
1001
+ RealName: this.name,
1002
+ IdCard: this.id
1003
+ };
1004
+ }
1005
+ async onSubmit() {
1006
+ const result = await setIdentity(this.config.identity.auth, this.params).catch(
1007
+ (message) => {
1008
+ Dialog({
1009
+ title: "认证失败",
1010
+ message
1011
+ });
1012
+ }
1013
+ );
1014
+ if (result) {
1015
+ this.$emit("done", this.params);
1016
+ }
1017
+ }
1018
+ };
1019
+ __decorateClass$5([
1020
+ Inject()
1021
+ ], Identity$2.prototype, "config", 2);
1022
+ Identity$2 = __decorateClass$5([
1023
+ Component
1024
+ ], Identity$2);
1025
+ var render$5 = function() {
1026
+ var _vm = this;
1027
+ var _h = _vm.$createElement;
1028
+ var _c = _vm._self._c || _h;
1029
+ return _c("van-form", {
1030
+ on: {
1031
+ "submit": _vm.onSubmit
1032
+ }
1033
+ }, [_c("van-field", {
1034
+ attrs: {
1035
+ "name": "姓名",
1036
+ "label": "姓名",
1037
+ "placeholder": "姓名",
1038
+ "rules": [{
1039
+ required: true,
1040
+ message: "请填写姓名"
1041
+ }]
1042
+ },
1043
+ model: {
1044
+ value: _vm.name,
1045
+ callback: function($$v) {
1046
+ _vm.name = $$v;
1047
+ },
1048
+ expression: "name"
1049
+ }
1050
+ }), _c("van-field", {
1051
+ attrs: {
1052
+ "name": "身份证号码",
1053
+ "label": "身份证号码",
1054
+ "placeholder": "身份证号码",
1055
+ "rules": [{
1056
+ required: true,
1057
+ message: "请填写身份证号码"
1058
+ }]
1059
+ },
1060
+ model: {
1061
+ value: _vm.id,
1062
+ callback: function($$v) {
1063
+ _vm.id = $$v;
1064
+ },
1065
+ expression: "id"
1066
+ }
1067
+ }), _c("div", {
1068
+ staticStyle: {
1069
+ "margin": "16px"
1070
+ }
1071
+ }, [_c("van-button", {
1072
+ attrs: {
1073
+ "block": "",
1074
+ "color": _vm.config.theme,
1075
+ "native-type": "submit"
1076
+ }
1077
+ }, [_vm._v("认证")])], 1)], 1);
1078
+ };
1079
+ var staticRenderFns$5 = [];
1080
+ const __cssModules$5 = {};
1081
+ var __component__$5 = /* @__PURE__ */ normalizeComponent(
1082
+ Identity$2,
1083
+ render$5,
1084
+ staticRenderFns$5,
1085
+ false,
1086
+ __vue2_injectStyles$5,
1087
+ null,
1088
+ null,
1089
+ null
1090
+ );
1091
+ function __vue2_injectStyles$5(context) {
1092
+ for (let o in __cssModules$5) {
1093
+ this[o] = __cssModules$5[o];
1094
+ }
1095
+ }
1096
+ const Identity$1 = /* @__PURE__ */ function() {
1097
+ return __component__$5.exports;
1098
+ }();
1099
+ var __defProp$4 = Object.defineProperty;
1100
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
1101
+ var __decorateClass$4 = (decorators, target, key, kind) => {
1102
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
1103
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1104
+ if (decorator = decorators[i])
1105
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1106
+ if (kind && result)
1107
+ __defProp$4(target, key, result);
1108
+ return result;
1109
+ };
1110
+ let IdentityPopup = class extends Vue {
1111
+ constructor() {
1112
+ super(...arguments);
1113
+ __publicField(this, "config");
1114
+ __publicField(this, "showPopup", false);
1115
+ __publicField(this, "info", {
1116
+ status: false,
1117
+ name: ""
1118
+ });
1119
+ }
1120
+ get text() {
1121
+ if (this.info.status) {
1122
+ return `已实名 ${this.info.name}`;
1123
+ }
1124
+ return `未实名 点击进行实名认证`;
1125
+ }
1126
+ load() {
1127
+ return getIdentity(this.config.identity.api);
1128
+ }
1129
+ done(data) {
1130
+ Object.assign(this.info, data);
1131
+ this.$emit("onIdentity", data);
1132
+ }
1133
+ openPopup() {
1134
+ if (!this.info.status) {
1135
+ this.showPopup = true;
1136
+ }
1137
+ }
1138
+ authDone(data) {
1139
+ this.showPopup = false;
1140
+ this.done({
1141
+ status: true,
1142
+ name: data.RealName
1143
+ });
1144
+ }
1145
+ };
1146
+ __decorateClass$4([
1147
+ Inject()
1148
+ ], IdentityPopup.prototype, "config", 2);
1149
+ IdentityPopup = __decorateClass$4([
1150
+ Component({
1151
+ components: {
1152
+ PayError: PayError2,
1153
+ Identity: Identity$1
1154
+ }
1155
+ })
1156
+ ], IdentityPopup);
1157
+ var render$4 = function() {
1158
+ var _vm = this;
1159
+ var _h = _vm.$createElement;
1160
+ var _c = _vm._self._c || _h;
1161
+ return _c("PayError", {
1162
+ attrs: {
1163
+ "load": _vm.load
1164
+ },
1165
+ on: {
1166
+ "done": _vm.done
1167
+ }
1168
+ }, [_c("van-notice-bar", {
1169
+ staticClass: "identity",
1170
+ attrs: {
1171
+ "left-icon": "user-circle-o",
1172
+ "text": _vm.text
1173
+ },
1174
+ on: {
1175
+ "click": _vm.openPopup
1176
+ }
1177
+ }), _c("van-popup", {
1178
+ attrs: {
1179
+ "position": "bottom",
1180
+ "overlay": "",
1181
+ "round": ""
1182
+ },
1183
+ model: {
1184
+ value: _vm.showPopup,
1185
+ callback: function($$v) {
1186
+ _vm.showPopup = $$v;
1187
+ },
1188
+ expression: "showPopup"
1189
+ }
1190
+ }, [_c("Identity", {
1191
+ on: {
1192
+ "done": _vm.authDone
1193
+ }
1194
+ })], 1)], 1);
1195
+ };
1196
+ var staticRenderFns$4 = [];
1197
+ const popup_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
668
1198
  const __cssModules$4 = {};
669
1199
  var __component__$4 = /* @__PURE__ */ normalizeComponent(
670
- Channels$1,
1200
+ IdentityPopup,
671
1201
  render$4,
672
1202
  staticRenderFns$4,
673
1203
  false,
674
1204
  __vue2_injectStyles$4,
675
- "70746494",
1205
+ "5f9eb7e3",
676
1206
  null,
677
1207
  null
678
1208
  );
@@ -681,7 +1211,7 @@ function __vue2_injectStyles$4(context) {
681
1211
  this[o] = __cssModules$4[o];
682
1212
  }
683
1213
  }
684
- const Channels2 = /* @__PURE__ */ function() {
1214
+ const Identity2 = /* @__PURE__ */ function() {
685
1215
  return __component__$4.exports;
686
1216
  }();
687
1217
  var __defProp$3 = Object.defineProperty;
@@ -709,7 +1239,7 @@ __decorateClass$3([
709
1239
  Prop({ default: null })
710
1240
  ], PriceCustom$1.prototype, "customPrice", 2);
711
1241
  PriceCustom$1 = __decorateClass$3([
712
- Component$1
1242
+ Component
713
1243
  ], PriceCustom$1);
714
1244
  var render$3 = function() {
715
1245
  var _vm = this;
@@ -745,7 +1275,7 @@ var __component__$3 = /* @__PURE__ */ normalizeComponent(
745
1275
  staticRenderFns$3,
746
1276
  false,
747
1277
  __vue2_injectStyles$3,
748
- "ea027830",
1278
+ "05e06290",
749
1279
  null,
750
1280
  null
751
1281
  );
@@ -785,7 +1315,7 @@ __decorateClass$2([
785
1315
  Prop({ default: {} })
786
1316
  ], PriceItem$1.prototype, "price", 2);
787
1317
  PriceItem$1 = __decorateClass$2([
788
- Component$1
1318
+ Component
789
1319
  ], PriceItem$1);
790
1320
  var render$2 = function() {
791
1321
  var _vm = this;
@@ -887,7 +1417,7 @@ __decorateClass$1([
887
1417
  Watch("customPrice")
888
1418
  ], PriceContainer$1.prototype, "onCustomPriceChange", 1);
889
1419
  PriceContainer$1 = __decorateClass$1([
890
- Component$1({
1420
+ Component({
891
1421
  components: {
892
1422
  PriceItem: PriceItem2,
893
1423
  PayError: PayError2,
@@ -948,7 +1478,7 @@ var __component__$1 = /* @__PURE__ */ normalizeComponent(
948
1478
  staticRenderFns$1,
949
1479
  false,
950
1480
  __vue2_injectStyles$1,
951
- "737beb57",
1481
+ "a6f45494",
952
1482
  null,
953
1483
  null
954
1484
  );
@@ -976,12 +1506,8 @@ let PayPopup$1 = class PayPopup extends Vue {
976
1506
  super(...arguments);
977
1507
  __publicField(this, "config");
978
1508
  __publicField(this, "id");
979
- // 同意协议本地标识
980
- __publicField(this, "isAgreeProtocolFlag", "__isAgreeProtocol__");
981
1509
  // 是否同意支付协议
982
1510
  __publicField(this, "isAgreeProtocol", false);
983
- // 是否弹出充值协议
984
- __publicField(this, "isOpenProtocol", false);
985
1511
  // 默认主题
986
1512
  __publicField(this, "baseTheme", BaseTheme);
987
1513
  // 弹出层是否显示
@@ -1001,29 +1527,22 @@ let PayPopup$1 = class PayPopup extends Vue {
1001
1527
  // 价目表
1002
1528
  price: false,
1003
1529
  // 渠道
1004
- channel: false
1530
+ channel: false,
1531
+ // 实名信息
1532
+ identity: false
1005
1533
  });
1006
1534
  }
1007
- onIsAgreeProtocolChange(n) {
1008
- if (n) {
1009
- localStorage.setItem(this.isAgreeProtocolFlag, "true");
1010
- } else {
1011
- localStorage.removeItem(this.isAgreeProtocolFlag);
1012
- }
1013
- }
1014
1535
  async mounted() {
1015
1536
  this.$nextTick(() => {
1016
1537
  this.visible = true;
1017
1538
  this.initLoad();
1018
- this.isAgreeProtocol = Boolean(
1019
- localStorage.getItem(this.isAgreeProtocolFlag) || false
1020
- );
1021
1539
  });
1022
1540
  }
1023
1541
  // 初始化加载状态
1024
1542
  initLoad() {
1025
1543
  this.loading.balance = this.config.balance.disabled;
1026
1544
  this.loading.price = this.config.price.disabled;
1545
+ this.loading.identity = this.config.identity.disable;
1027
1546
  }
1028
1547
  // 关闭弹出层
1029
1548
  onClose() {
@@ -1033,29 +1552,14 @@ let PayPopup$1 = class PayPopup extends Vue {
1033
1552
  onClosed() {
1034
1553
  this.$emit("onClosed");
1035
1554
  }
1036
- // 打开协议弹窗
1037
- openProtocol() {
1038
- this.isOpenProtocol = true;
1039
- }
1040
- // 同意协议
1041
- agreeProtocol() {
1042
- this.isAgreeProtocol = true;
1043
- this.isOpenProtocol = false;
1044
- }
1045
- // 不同意协议
1046
- notAgree() {
1047
- this.isAgreeProtocol = false;
1048
- this.isOpenProtocol = false;
1049
- }
1050
- // 同意并支付
1051
- agreeProtocolAndPay() {
1052
- this.agreeProtocol();
1053
- this.onTopup();
1555
+ // 隐私协议组件
1556
+ get agreementRef() {
1557
+ return this.$refs.agreementRef;
1054
1558
  }
1055
1559
  // 点击充值
1056
1560
  async onTopup() {
1057
1561
  if (!this.isAgreeProtocol) {
1058
- this.openProtocol();
1562
+ this.agreementRef.openProtocol();
1059
1563
  return;
1060
1564
  }
1061
1565
  const { key, prefix } = this.config.pay;
@@ -1083,6 +1587,9 @@ let PayPopup$1 = class PayPopup extends Vue {
1083
1587
  this.price = price;
1084
1588
  this.loading.price = true;
1085
1589
  }
1590
+ onIdentityChange(info) {
1591
+ this.loading.identity = info.status;
1592
+ }
1086
1593
  // 计算最终金额
1087
1594
  get finalPrice() {
1088
1595
  return this.price.price / 100;
@@ -1103,18 +1610,17 @@ __decorateClass([
1103
1610
  __decorateClass([
1104
1611
  Prop({ default: void 0 })
1105
1612
  ], PayPopup$1.prototype, "id", 2);
1106
- __decorateClass([
1107
- Watch("isAgreeProtocol")
1108
- ], PayPopup$1.prototype, "onIsAgreeProtocolChange", 1);
1109
1613
  PayPopup$1 = __decorateClass([
1110
- Component$1({
1614
+ Component({
1111
1615
  components: {
1112
1616
  Balance: Balance2,
1113
1617
  Divider,
1114
1618
  PriceContainer: PriceContainer2,
1115
1619
  Button,
1116
1620
  PriceCustom: PriceCustom2,
1117
- Channels: Channels2
1621
+ Channels: Channels2,
1622
+ Agreement: Agreement2,
1623
+ Identity: Identity2
1118
1624
  }
1119
1625
  })
1120
1626
  ], PayPopup$1);
@@ -1126,7 +1632,7 @@ var render = function() {
1126
1632
  staticClass: "pay-popup",
1127
1633
  attrs: {
1128
1634
  "position": "bottom",
1129
- "overlay": true,
1635
+ "overlay": "",
1130
1636
  "round": ""
1131
1637
  },
1132
1638
  on: {
@@ -1154,12 +1660,14 @@ var render = function() {
1154
1660
  on: {
1155
1661
  "change": _vm.onChannelChange
1156
1662
  }
1157
- }), _c("div", {
1158
- staticClass: "check-box"
1159
- }, [_c("van-checkbox", {
1160
- attrs: {
1161
- "checked-color": _vm.config.theme,
1162
- "icon-size": "12"
1663
+ }), !_vm.config.identity.disable ? [_c("Identity", {
1664
+ on: {
1665
+ "onIdentity": _vm.onIdentityChange
1666
+ }
1667
+ })] : _vm._e(), _c("Agreement", {
1668
+ ref: "agreementRef",
1669
+ on: {
1670
+ "pay": _vm.onTopup
1163
1671
  },
1164
1672
  model: {
1165
1673
  value: _vm.isAgreeProtocol,
@@ -1168,17 +1676,7 @@ var render = function() {
1168
1676
  },
1169
1677
  expression: "isAgreeProtocol"
1170
1678
  }
1171
- }, [_vm._v(" 阅读并同意 "), _c("span", {
1172
- style: {
1173
- color: _vm.config.theme
1174
- },
1175
- on: {
1176
- "click": function($event) {
1177
- $event.stopPropagation();
1178
- return _vm.openProtocol.apply(null, arguments);
1179
- }
1180
- }
1181
- }, [_vm._v("充值协议")])])], 1), _c("Button", {
1679
+ }), _c("Button", {
1182
1680
  attrs: {
1183
1681
  "disabled": _vm.disable,
1184
1682
  "color": _vm.config.theme || _vm.baseTheme,
@@ -1187,45 +1685,7 @@ var render = function() {
1187
1685
  on: {
1188
1686
  "click": _vm.onTopup
1189
1687
  }
1190
- }, [_vm._v(" 立即支付 " + _vm._s(_vm.finalPrice) + " 元 ")]), _c("van-popup", {
1191
- staticClass: "protocol-popup",
1192
- attrs: {
1193
- "position": "bottom",
1194
- "overlay": true,
1195
- "round": ""
1196
- },
1197
- model: {
1198
- value: _vm.isOpenProtocol,
1199
- callback: function($$v) {
1200
- _vm.isOpenProtocol = $$v;
1201
- },
1202
- expression: "isOpenProtocol"
1203
- }
1204
- }, [_c("div", {
1205
- staticClass: "prptocol"
1206
- }, [_c("iframe", {
1207
- attrs: {
1208
- "src": _vm.config.agreement
1209
- }
1210
- }), _c("div", {
1211
- staticClass: "btn-box"
1212
- }, [_c("van-button", {
1213
- attrs: {
1214
- "block": ""
1215
- },
1216
- on: {
1217
- "click": _vm.notAgree
1218
- }
1219
- }, [_vm._v("不同意")]), _c("van-button", {
1220
- attrs: {
1221
- "color": _vm.config.theme,
1222
- "block": "",
1223
- "type": "primary"
1224
- },
1225
- on: {
1226
- "click": _vm.agreeProtocolAndPay
1227
- }
1228
- }, [_vm._v("同意并支付")])], 1)])])], 2);
1688
+ }, [_vm._v(" 立即支付 " + _vm._s(_vm.finalPrice) + " 元 ")])], 2);
1229
1689
  };
1230
1690
  var staticRenderFns = [];
1231
1691
  const popup_vue_vue_type_style_index_0_scoped_true_lang = "";
@@ -1236,7 +1696,7 @@ var __component__ = /* @__PURE__ */ normalizeComponent(
1236
1696
  staticRenderFns,
1237
1697
  false,
1238
1698
  __vue2_injectStyles,
1239
- "4e76879e",
1699
+ "7115f264",
1240
1700
  null,
1241
1701
  null
1242
1702
  );
@@ -1273,9 +1733,9 @@ const plugin = {
1273
1733
  instance.$on("onClosed", () => {
1274
1734
  res();
1275
1735
  setTimeout(() => {
1276
- var _a2;
1736
+ var _a;
1277
1737
  instance.$destroy();
1278
- (_a2 = instance.$el.parentNode) == null ? void 0 : _a2.removeChild(instance.$el);
1738
+ (_a = instance.$el.parentNode) == null ? void 0 : _a.removeChild(instance.$el);
1279
1739
  }, 300);
1280
1740
  });
1281
1741
  instance.$mount();