@uxda/appkit 4.3.13 → 4.3.15

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.
Files changed (35) hide show
  1. package/COMPONENT_USAGE.md +3 -3
  2. package/dist/appkit.css +12 -105
  3. package/dist/index.js +449 -1060
  4. package/package.json +5 -2
  5. package/src/balance/api/index.ts +1 -1
  6. package/src/balance/components/PromoterCard.vue +0 -1
  7. package/src/notice/api/index.ts +1 -1
  8. package/src/notice/components/NoticeList2.vue +73 -234
  9. package/src/notice/components/useCommonList.ts +0 -1
  10. package/src/payment/api/endpoints.ts +14 -2
  11. package/src/payment/api/index.ts +1 -2
  12. package/src/payment/components/RechargeResult.vue +1 -0
  13. package/src/payment/components/RechargeView.vue +45 -13
  14. package/src/payment/components/TradeView.vue +153 -326
  15. package/src/payment/services/request-payment.ts +0 -2
  16. package/src/payment/types.ts +0 -1
  17. package/src/register/components/SelfRegistration.vue +1 -1
  18. package/src/shared/components/AppVerify.vue +6 -15
  19. package/src/shared/components/OcrBusinessLicense.vue +37 -20
  20. package/src/shared/components/OcrIcon.vue +67 -105
  21. package/src/shared/components/index.ts +1 -3
  22. package/src/shared/composables/index.ts +0 -1
  23. package/src/shared/composables/useDeviceEnv.ts +35 -1
  24. package/src/shared/composables/useUpload.ts +51 -96
  25. package/src/shared/http/Http.ts +0 -1
  26. package/src/shared/tracking/tracking-sdk.ts +1 -0
  27. package/src/shared/weixin/jssdk.ts +0 -1
  28. package/src/user/api/index.ts +1 -1
  29. package/src/user/components/UserAuth.vue +1 -1
  30. package/src/user/components/UserFeedback.vue +0 -1
  31. package/src/user/components/UserInfo.vue +0 -2
  32. package/types/global.d.ts +0 -2
  33. package/src/shared/components/OcrBank.vue +0 -202
  34. package/src/shared/components/OcrInvoice.vue +0 -322
  35. package/src/shared/composables/useCompress.ts +0 -64
package/dist/index.js CHANGED
@@ -4,12 +4,12 @@ import '@nutui/nutui-taro/dist/packages/checkbox/style/css';
4
4
  import { defineComponent, reactive, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, ref, computed, onUnmounted, resolveDirective, createCommentVNode, withDirectives, renderSlot, createVNode, normalizeStyle, unref, isRef, onMounted, createStaticVNode, watch, vShow, mergeModels, useModel, resolveComponent, vModelText, watchPostEffect, withModifiers } from 'vue';
5
5
  import '@nutui/nutui-taro/dist/packages/grid/style/css';
6
6
  import '@nutui/nutui-taro/dist/packages/griditem/style/css';
7
- import Taro, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, request as request$1, uploadFile, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, getStorageSync, setStorageSync, getSystemInfo, getNetworkType, getEnv, getAccountInfoSync, getPerformance, onAppHide, useDidShow, onAppShow, onNetworkStatusChange, useRouter } from '@tarojs/taro';
7
+ import Taro, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, uploadFile, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, getStorageSync, setStorageSync, getSystemInfo, getNetworkType, getEnv, getAccountInfoSync, getPerformance, onAppHide, useDidShow, onAppShow, onNetworkStatusChange, useRouter } from '@tarojs/taro';
8
8
  import '@nutui/nutui-taro/dist/packages/popup/style/css';
9
9
  import isMobilePhone from 'validator/es/lib/isMobilePhone';
10
10
  import isIdentityCard from 'validator/es/lib/isIdentityCard';
11
11
  import qs from 'qs';
12
- import { NsForm, NsInput, NsButton, useNutshell, NsIcon, usePopup, NsButtonGroup, usePaging, NsPage, NsTabs, NsPageContent, NsSkeleton, NsRepeator, NsCard, NsEmpty, NsCheckbox } from '@uxda/nutshell/taro';
12
+ import { NsForm, NsInput, NsButton, NsIcon, usePopup, useNutshell, NsButtonGroup, usePaging, NsPage, NsTabs, NsTabsItem, NsPageContent, NsSkeleton, NsRepeator, NsCard, NsEmpty, NsCheckbox } from '@uxda/nutshell/taro';
13
13
  import '@nutui/nutui-taro/dist/packages/actionsheet/style/css';
14
14
  import pako from 'pako';
15
15
  import dsBridge from 'dsbridge';
@@ -34,7 +34,7 @@ import '@nutui/nutui-taro/dist/packages/step/style/css';
34
34
 
35
35
  const _hoisted_1$G = { class: "token-line number" };
36
36
  const _hoisted_2$t = { class: "number" };
37
- var script$O = /* @__PURE__ */ defineComponent({
37
+ var script$M = /* @__PURE__ */ defineComponent({
38
38
  __name: "AmountPicker",
39
39
  props: {
40
40
  items: { type: Array, required: true, default: () => [] },
@@ -107,7 +107,7 @@ var script$O = /* @__PURE__ */ defineComponent({
107
107
  }
108
108
  });
109
109
 
110
- script$O.__file = "src/payment/components/AmountPicker.vue";
110
+ script$M.__file = "src/payment/components/AmountPicker.vue";
111
111
 
112
112
  const getSdkConfig = (appCode, url) => {
113
113
  return new Promise((resolve, reject) => {
@@ -128,7 +128,6 @@ function requestWxH5Pay(options) {
128
128
  title: "\u63D0\u793A",
129
129
  content: "\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u5FAE\u4FE1\u652F\u4ED8\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00",
130
130
  confirmText: "\u786E\u5B9A",
131
- confirmColor: "#017fff",
132
131
  success: () => {
133
132
  }
134
133
  });
@@ -311,84 +310,71 @@ function useEncode() {
311
310
  };
312
311
  }
313
312
 
314
- const compressImageWithCanvas = (src, quality) => {
315
- return new Promise((resolve, reject) => {
316
- const img = new Image();
317
- img.crossOrigin = "anonymous";
318
- img.onload = () => {
319
- try {
320
- const canvas = document.createElement("canvas");
321
- const ctx = canvas.getContext("2d");
322
- if (!ctx) {
323
- reject(new Error("\u65E0\u6CD5\u83B7\u53D6 canvas \u4E0A\u4E0B\u6587"));
324
- return;
325
- }
326
- const maxWidth = 850;
327
- const maxHeight = 850;
328
- let width = img.width;
329
- let height = img.height;
330
- if (width > maxWidth || height > maxHeight) {
331
- const ratio = Math.min(maxWidth / width, maxHeight / height);
332
- width = width * ratio;
333
- height = height * ratio;
334
- }
335
- canvas.width = width;
336
- canvas.height = height;
337
- ctx.drawImage(img, 0, 0, width, height);
338
- canvas.toBlob(
339
- (blob) => {
340
- if (!blob) {
341
- reject(new Error("\u56FE\u7247\u538B\u7F29\u5931\u8D25"));
342
- return;
343
- }
344
- const compressedUrl = URL.createObjectURL(blob);
345
- resolve(compressedUrl);
346
- },
347
- "image/jpeg",
348
- quality / 100
349
- );
350
- } catch (error) {
351
- reject(error);
352
- }
353
- };
354
- img.onerror = () => {
355
- reject(new Error("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25"));
356
- };
357
- img.src = src;
358
- });
313
+ const globalData = {};
314
+
315
+ const appKitOptions = {
316
+ app: () => "",
317
+ tenant: () => "",
318
+ token: () => "",
319
+ tempToken: () => "",
320
+ baseUrl: () => "",
321
+ 401() {
322
+ },
323
+ gray: () => ""
359
324
  };
360
- async function compressImage(src, quality = 80) {
361
- if (Taro.getEnv() === "WEB") {
362
- try {
363
- const compressedUrl = await compressImageWithCanvas(src, quality);
364
- return { tempFilePath: compressedUrl };
365
- } catch (error) {
366
- console.error("\u56FE\u7247\u538B\u7F29\u5931\u8D25:", error);
367
- return { tempFilePath: src };
368
- }
369
- } else {
325
+ const useAppKitOptions = () => {
326
+ if (!globalData.$appKitOptions) {
327
+ globalData.$appKitOptions = appKitOptions;
328
+ }
329
+ return globalData.$appKitOptions;
330
+ };
331
+
332
+ const mappings$1 = {
333
+ downloadUrl: "thrumb",
334
+ fileId: "id",
335
+ fileName: "name",
336
+ fileSize: "size",
337
+ fileSuffix: "ext",
338
+ fileType: "type",
339
+ originalUrl: "url"
340
+ };
341
+ const transformFields = (row) => {
342
+ return Object.fromEntries(Object.entries(row).map(([k, v]) => [mappings$1[k] || k, v]));
343
+ };
344
+ const useUpload = (config) => {
345
+ const appkitOptions = useAppKitOptions();
346
+ const upload = (url, file) => {
370
347
  return new Promise((resolve, reject) => {
371
- Taro.compressImage({
372
- src,
373
- quality,
374
- success: (res) => {
375
- resolve(res);
348
+ uploadFile({
349
+ url: config.baseUrl + url,
350
+ filePath: file.path,
351
+ name: "file",
352
+ formData: {
353
+ objectNo: `min${Date.now()}`
376
354
  },
377
- fail: (res) => {
378
- reject(res);
355
+ header: {
356
+ ...config.headers,
357
+ token: appkitOptions.tempToken() || appkitOptions.token()
358
+ },
359
+ success: (rsp) => {
360
+ const { data } = rsp;
361
+ try {
362
+ const response = JSON.parse(data);
363
+ console.log("===response", response);
364
+ resolve(transformFields(response.result));
365
+ } catch (e) {
366
+ reject({
367
+ message: "\u6587\u4EF6\u4E0A\u4F20\u5F02\u5E38"
368
+ });
369
+ }
379
370
  }
380
371
  });
381
372
  });
382
- }
383
- }
384
- function getCompressQuality(size) {
385
- let quality = 100;
386
- const curSize = size / (1024 * 1024);
387
- if (curSize > 6) {
388
- quality = quality - (curSize - 6) / curSize * 100;
389
- }
390
- return quality;
391
- }
373
+ };
374
+ return {
375
+ upload
376
+ };
377
+ };
392
378
 
393
379
  const defaultCryptoConfig = {
394
380
  maskField: "mask",
@@ -429,25 +415,6 @@ function useCrypto(config) {
429
415
  };
430
416
  }
431
417
 
432
- const globalData = {};
433
-
434
- const appKitOptions = {
435
- app: () => "",
436
- tenant: () => "",
437
- token: () => "",
438
- tempToken: () => "",
439
- baseUrl: () => "",
440
- 401() {
441
- },
442
- gray: () => ""
443
- };
444
- const useAppKitOptions = () => {
445
- if (!globalData.$appKitOptions) {
446
- globalData.$appKitOptions = appKitOptions;
447
- }
448
- return globalData.$appKitOptions;
449
- };
450
-
451
418
  const defaultLogOptions = {
452
419
  projectName: "ddyk-dev",
453
420
  logStore: "ddjf-internet-web",
@@ -581,59 +548,11 @@ function useWxAuth() {
581
548
  };
582
549
  }
583
550
 
584
- const mappings$1 = {
585
- downloadUrl: "thrumb",
586
- fileId: "id",
587
- fileName: "name",
588
- fileSize: "size",
589
- fileSuffix: "ext",
590
- fileType: "type",
591
- originalUrl: "url"
592
- };
593
- const transformFields = (row) => {
594
- return Object.fromEntries(Object.entries(row).map(([k, v]) => [mappings$1[k] || k, v]));
595
- };
596
- const useUpload = (config) => {
597
- const appkitOptions = useAppKitOptions();
598
- const upload = (url, file) => {
599
- return new Promise((resolve, reject) => {
600
- uploadFile({
601
- url: config.baseUrl + url,
602
- filePath: file.path,
603
- name: "file",
604
- formData: {
605
- objectNo: `min${Date.now()}`,
606
- appCode: config.headers?.appcode || appkitOptions.app()
607
- },
608
- header: {
609
- ...config.headers,
610
- token: appkitOptions.tempToken() || appkitOptions.token()
611
- },
612
- success: (rsp) => {
613
- const { data } = rsp;
614
- try {
615
- const response = JSON.parse(data);
616
- console.log("===response", response);
617
- resolve(transformFields(response.result));
618
- } catch (e) {
619
- reject({
620
- message: "\u6587\u4EF6\u4E0A\u4F20\u5F02\u5E38"
621
- });
622
- }
623
- }
624
- });
625
- });
626
- };
627
- return {
628
- upload
629
- };
630
- };
631
-
632
551
  const _hoisted_1$F = {
633
552
  key: 0,
634
553
  class: "page-title"
635
554
  };
636
- var script$N = /* @__PURE__ */ defineComponent({
555
+ var script$L = /* @__PURE__ */ defineComponent({
637
556
  __name: "PageHeader",
638
557
  props: {
639
558
  title: { type: String, required: false, default: "" },
@@ -690,10 +609,10 @@ var script$N = /* @__PURE__ */ defineComponent({
690
609
  }
691
610
  });
692
611
 
693
- script$N.__file = "src/shared/components/PageHeader.vue";
612
+ script$L.__file = "src/shared/components/PageHeader.vue";
694
613
 
695
614
  const _hoisted_1$E = { class: "drawer-body" };
696
- var script$M = /* @__PURE__ */ defineComponent({
615
+ var script$K = /* @__PURE__ */ defineComponent({
697
616
  __name: "AppDrawer",
698
617
  props: {
699
618
  modelValue: { type: Boolean, required: true },
@@ -717,7 +636,7 @@ var script$M = /* @__PURE__ */ defineComponent({
717
636
  "onUpdate:visible": onVisibleChange
718
637
  }, {
719
638
  default: withCtx(() => [
720
- createVNode(script$N, {
639
+ createVNode(script$L, {
721
640
  title: __props.title,
722
641
  style: normalizeStyle(unref(Taro).getEnv() !== "WEB" ? "" : "--height: 40px"),
723
642
  onClose: onPageHeaderClose
@@ -733,18 +652,18 @@ var script$M = /* @__PURE__ */ defineComponent({
733
652
  }
734
653
  });
735
654
 
736
- script$M.__file = "src/shared/components/AppDrawer.vue";
655
+ script$K.__file = "src/shared/components/AppDrawer.vue";
737
656
 
738
657
  const _hoisted_1$D = { class: "app-verify column" };
739
658
  const _hoisted_2$s = { class: "caption" };
740
659
  const _hoisted_3$m = { class: "number" };
741
- const _hoisted_4$i = { class: "form-btn" };
742
- const _hoisted_5$e = {
660
+ const _hoisted_4$h = { class: "form-btn" };
661
+ const _hoisted_5$d = {
743
662
  key: 1,
744
663
  class: "caption"
745
664
  };
746
665
  const _hoisted_6$a = { class: "row buttons" };
747
- var script$L = /* @__PURE__ */ defineComponent({
666
+ var script$J = /* @__PURE__ */ defineComponent({
748
667
  __name: "AppVerify",
749
668
  props: {
750
669
  phone: { type: String, required: true },
@@ -819,7 +738,7 @@ var script$L = /* @__PURE__ */ defineComponent({
819
738
  method: (value) => value.length === 6
820
739
  }]
821
740
  }, null, 8, ["modelValue", "rules"]),
822
- createElementVNode("div", _hoisted_4$i, [
741
+ createElementVNode("div", _hoisted_4$h, [
823
742
  !sent.value ? withDirectives((openBlock(), createBlock(
824
743
  unref(NsButton),
825
744
  {
@@ -838,7 +757,7 @@ var script$L = /* @__PURE__ */ defineComponent({
838
757
  ]) : createCommentVNode("v-if", true),
839
758
  sent.value ? (openBlock(), createElementBlock(
840
759
  "div",
841
- _hoisted_5$e,
760
+ _hoisted_5$d,
842
761
  toDisplayString(countdown.value) + "s\u540E\u91CD\u65B0\u53D1\u9001",
843
762
  1
844
763
  /* TEXT */
@@ -851,7 +770,6 @@ var script$L = /* @__PURE__ */ defineComponent({
851
770
  createElementVNode("div", _hoisted_6$a, [
852
771
  withDirectives((openBlock(), createBlock(unref(NsButton), {
853
772
  class: "cancel-btn",
854
- r: 20,
855
773
  onClick: _cache[2] || (_cache[2] = ($event) => emits("cancel"))
856
774
  }, {
857
775
  default: withCtx(() => [..._cache[3] || (_cache[3] = [
@@ -868,7 +786,6 @@ var script$L = /* @__PURE__ */ defineComponent({
868
786
  ]),
869
787
  withDirectives((openBlock(), createBlock(unref(NsButton), {
870
788
  color: "primary",
871
- r: 20,
872
789
  onClick: onOk
873
790
  }, {
874
791
  default: withCtx(() => [..._cache[4] || (_cache[4] = [
@@ -889,10 +806,10 @@ var script$L = /* @__PURE__ */ defineComponent({
889
806
  }
890
807
  });
891
808
 
892
- script$L.__file = "src/shared/components/AppVerify.vue";
809
+ script$J.__file = "src/shared/components/AppVerify.vue";
893
810
 
894
811
  const _hoisted_1$C = { key: 0 };
895
- var script$K = /* @__PURE__ */ defineComponent({
812
+ var script$I = /* @__PURE__ */ defineComponent({
896
813
  __name: "index",
897
814
  props: {
898
815
  text: { type: String, required: false },
@@ -959,7 +876,7 @@ var script$K = /* @__PURE__ */ defineComponent({
959
876
  }
960
877
  });
961
878
 
962
- script$K.__file = "src/components/dd-notice-bar/index.vue";
879
+ script$I.__file = "src/components/dd-notice-bar/index.vue";
963
880
 
964
881
  const typeMappings = {
965
882
  CZ: "\u5145\u503C",
@@ -1122,7 +1039,7 @@ function useHttp$3() {
1122
1039
  const headers = {
1123
1040
  Token: appkitOptions.tempToken() || appkitOptions.token(),
1124
1041
  Appcode: appkitOptions.app(),
1125
- tid: appkitOptions.tenant(),
1042
+ cookie: `tid=${appkitOptions.tenant()}`,
1126
1043
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
1127
1044
  };
1128
1045
  const $http = createHttp({
@@ -1164,7 +1081,7 @@ function useHttp$3() {
1164
1081
  return $http;
1165
1082
  }
1166
1083
 
1167
- var script$J = /* @__PURE__ */ defineComponent({
1084
+ var script$H = /* @__PURE__ */ defineComponent({
1168
1085
  __name: "DeviceVersion",
1169
1086
  props: {
1170
1087
  versions: { type: String, required: false, default: "{}" }
@@ -1211,7 +1128,7 @@ var script$J = /* @__PURE__ */ defineComponent({
1211
1128
  }
1212
1129
  });
1213
1130
  return (_ctx, _cache) => {
1214
- return showAlert.value ? (openBlock(), createBlock(script$K, {
1131
+ return showAlert.value ? (openBlock(), createBlock(script$I, {
1215
1132
  key: 0,
1216
1133
  showClose: "",
1217
1134
  style: normalizeStyle(topStype.value),
@@ -1222,83 +1139,102 @@ var script$J = /* @__PURE__ */ defineComponent({
1222
1139
  }
1223
1140
  });
1224
1141
 
1225
- script$J.__file = "src/shared/components/DeviceVersion.vue";
1142
+ script$H.__file = "src/shared/components/DeviceVersion.vue";
1226
1143
 
1227
- var script$I = /* @__PURE__ */ defineComponent({
1144
+ var script$G = /* @__PURE__ */ defineComponent({
1228
1145
  __name: "OcrIcon",
1229
1146
  props: {
1230
1147
  disabled: { type: Boolean, required: false, default: false },
1231
1148
  side: { type: String, required: false, default: "face" },
1232
- className: { type: String, required: false, default: "" },
1233
- uploadUrl: { type: String, required: false, default: "/saas-base/file/uploadPublic" },
1234
- customUpload: { type: Function, required: false },
1235
- hasUploadVo: { type: Boolean, required: false, default: true },
1236
- customClick: { type: Boolean, required: false, default: false }
1149
+ class: { type: String, required: false, default: "" }
1237
1150
  },
1238
1151
  emits: ["complete"],
1239
- setup(__props, { expose: __expose, emit: __emit }) {
1152
+ setup(__props, { emit: __emit }) {
1240
1153
  const appKitOptions = useAppKitOptions();
1241
- const $http = useHttp$3(), $n = useNutshell();
1242
1154
  const emits = __emit;
1243
1155
  const props = __props;
1156
+ async function taroImgCompress(src, quality = 80) {
1157
+ if (Taro.getEnv() === "WEB") {
1158
+ return src;
1159
+ } else {
1160
+ return new Promise((resolve, reject) => {
1161
+ Taro.compressImage({
1162
+ src,
1163
+ quality,
1164
+ success: (res) => {
1165
+ resolve(res);
1166
+ },
1167
+ fail: (res) => {
1168
+ reject(res);
1169
+ }
1170
+ });
1171
+ });
1172
+ }
1173
+ }
1174
+ function getCompressQuality(size) {
1175
+ let quality = 100;
1176
+ const curSize = size / (1024 * 1024);
1177
+ if (curSize > 6) {
1178
+ quality = quality - (curSize - 6) / curSize * 100;
1179
+ }
1180
+ return quality;
1181
+ }
1244
1182
  function allTrim(str) {
1245
1183
  return str.replace(/\s+/g, "");
1246
1184
  }
1247
1185
  async function onUploadFile(csRes) {
1248
1186
  let result = null;
1249
1187
  try {
1188
+ console.log("===\u4E0A\u4F20", csRes);
1250
1189
  let { path, size, tempFilePath } = csRes.tempFiles[0];
1251
- const compressImg = await compressImage(path || tempFilePath, getCompressQuality(size)) || {};
1252
- const filePath = compressImg.tempFilePath || path;
1253
- if (props.customUpload) {
1254
- props.customUpload(filePath);
1255
- return;
1190
+ let filePath;
1191
+ if (Taro.getEnv() !== "WEB") {
1192
+ const compressImg = await taroImgCompress(path || tempFilePath, getCompressQuality(size)) || {};
1193
+ filePath = compressImg.tempFilePath || path;
1194
+ } else {
1195
+ filePath = path || tempFilePath;
1256
1196
  }
1257
- showLoading({ title: "\u8EAB\u4EFD\u8BC1\u8BC6\u522B\u4E2D..", mask: true });
1197
+ console.log(filePath, "filePath");
1198
+ showLoading({ title: "\u8EAB\u4EFD\u8BC1\u8BC6\u522B\u4E2D.." });
1258
1199
  const session = appKitOptions.token();
1259
1200
  const baseUrl = appKitOptions.baseUrl();
1260
1201
  const upRes = await uploadFile({
1261
- url: `${baseUrl}${!props.hasUploadVo ? props.uploadUrl : "/hkapprove/ocr/idcard"}`,
1202
+ url: baseUrl + "/hkapprove/ocr/idcard",
1262
1203
  filePath,
1263
1204
  name: "file",
1264
1205
  formData: {
1265
1206
  objectNo: `min${Date.now()}`,
1266
- side: props.side,
1267
- appCode: appKitOptions.app()
1207
+ side: props.side
1268
1208
  },
1269
1209
  header: {
1270
1210
  token: session || ""
1271
1211
  }
1272
1212
  });
1213
+ hideLoading();
1273
1214
  const res = JSON.parse(upRes.data);
1274
1215
  if (res.code === "200") {
1275
- if (props.hasUploadVo) {
1276
- hideLoading();
1277
- const faceInfo = res.result.faceInfo || {};
1278
- const backInfo = res.result.backInfo || {};
1279
- result = {
1280
- faceInfo: {
1281
- name: allTrim(faceInfo.name || ""),
1282
- certNo: allTrim(faceInfo.num || ""),
1283
- address: allTrim(faceInfo.address || "")
1284
- },
1285
- backInfo: {
1286
- startDate: backInfo?.startDate || "",
1287
- endDate: backInfo?.endDate || ""
1288
- },
1289
- fileUploadVO: res.result.fileUploadVO || {}
1290
- };
1291
- if (props.side === "face" && !result.faceInfo.name && !result.faceInfo.certNo) {
1292
- showToast({ title: "\u8BC6\u522B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5", icon: "none" });
1293
- }
1294
- if (props.side === "back" && !result.backInfo?.startDate && !result.backInfo?.endDate) {
1295
- showToast({ title: "\u8BC6\u522B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5", icon: "none" });
1296
- }
1297
- } else {
1298
- await getOcrInfo(res.result);
1216
+ const faceInfo = res.result.faceInfo || {};
1217
+ const backInfo = res.result.backInfo || {};
1218
+ result = {
1219
+ faceInfo: {
1220
+ name: allTrim(faceInfo.name || ""),
1221
+ certNo: allTrim(faceInfo.num || ""),
1222
+ address: allTrim(faceInfo.address || "")
1223
+ },
1224
+ backInfo: {
1225
+ startDate: backInfo?.startDate || "",
1226
+ endDate: backInfo?.endDate || ""
1227
+ },
1228
+ fileUploadVO: res.result.fileUploadVO || {}
1229
+ };
1230
+ console.log("===\u8BC6\u522B", result);
1231
+ if (props.side === "face" && !result.faceInfo.name && !result.faceInfo.certNo) {
1232
+ showToast({ title: "\u8BC6\u522B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5", icon: "none" });
1233
+ }
1234
+ if (props.side === "back" && !result.backInfo?.startDate && !result.backInfo?.endDate) {
1235
+ showToast({ title: "\u8BC6\u522B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5", icon: "none" });
1299
1236
  }
1300
1237
  } else {
1301
- hideLoading();
1302
1238
  showToast({
1303
1239
  title: res.msg,
1304
1240
  icon: "error"
@@ -1308,42 +1244,7 @@ var script$I = /* @__PURE__ */ defineComponent({
1308
1244
  hideLoading();
1309
1245
  console.log(err);
1310
1246
  }
1311
- props.hasUploadVo && (result?.faceInfo.name || result?.backInfo.startDate) && emits("complete", result);
1312
- }
1313
- async function getOcrInfo(file) {
1314
- try {
1315
- const res = await $http.get("/hkbase/common/idCard", {
1316
- fileUrl: typeof file === "string" ? file : file.originalUrl,
1317
- side: props.side
1318
- });
1319
- hideLoading();
1320
- if (props.side === "face" && !res?.name || props.side === "back" && !res?.signDate) {
1321
- $n.dialog({
1322
- title: "\u8BC6\u522B\u5931\u8D25",
1323
- message: `\u60A8\u4E0A\u4F20\u7684\u56FE\u7247\u53EF\u80FD\u4E0D\u591F\u6E05\u6670\u6216\u4E0E\u5F53\u524D\u529F\u80FD\u4E0D\u7B26\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u4E00\u5F20\u6E05\u6670\u3001\u5B8C\u6574\u7684\u56FE\u7247\u3002\u8C22\u8C22\uFF01`,
1324
- okText: "\u6211\u77E5\u9053\u4E86",
1325
- cancelText: ""
1326
- });
1327
- return;
1328
- }
1329
- emits("complete", {
1330
- faceInfo: {
1331
- name: allTrim(res?.name || ""),
1332
- certNo: allTrim(res?.cardNumber || ""),
1333
- address: allTrim(res?.address || "")
1334
- },
1335
- backInfo: {
1336
- startDate: res?.expireDate || "",
1337
- endDate: res?.signDate || ""
1338
- },
1339
- fileUploadVO: {
1340
- fileUrl: typeof file === "string" ? file : file.originalUrl,
1341
- fileKey: typeof file === "string" ? file : file.fileId
1342
- }
1343
- });
1344
- } catch (err) {
1345
- hideLoading();
1346
- }
1247
+ emits("complete", result);
1347
1248
  }
1348
1249
  const activeSheetVisible = ref(false);
1349
1250
  const actionSheetMenus = [
@@ -1381,7 +1282,7 @@ var script$I = /* @__PURE__ */ defineComponent({
1381
1282
  onUploadFile(csRes);
1382
1283
  }
1383
1284
  }
1384
- async function onUpload() {
1285
+ async function onPhotograph() {
1385
1286
  if (props.disabled) return;
1386
1287
  if (Taro.getEnv() === "WEB") {
1387
1288
  const csRes = await chooseMedia({
@@ -1396,9 +1297,6 @@ var script$I = /* @__PURE__ */ defineComponent({
1396
1297
  }
1397
1298
  activeSheetVisible.value = true;
1398
1299
  }
1399
- __expose({
1400
- onUpload
1401
- });
1402
1300
  return (_ctx, _cache) => {
1403
1301
  const _component_nut_action_sheet = ActionSheet;
1404
1302
  const _directive_track_click = resolveDirective("track-click");
@@ -1409,8 +1307,8 @@ var script$I = /* @__PURE__ */ defineComponent({
1409
1307
  withDirectives((openBlock(), createElementBlock(
1410
1308
  "div",
1411
1309
  {
1412
- class: normalizeClass(["ocr-icon", [__props.disabled ? "disabled" : "", __props.className]]),
1413
- onClick: _cache[0] || (_cache[0] = ($event) => !__props.customClick ? onUpload() : null)
1310
+ class: normalizeClass(["ocr-icon", [__props.disabled ? "disabled" : ""]]),
1311
+ onClick: onPhotograph
1414
1312
  },
1415
1313
  [
1416
1314
  renderSlot(_ctx.$slots, "icon", {}, () => [
@@ -1424,7 +1322,7 @@ var script$I = /* @__PURE__ */ defineComponent({
1424
1322
  ]),
1425
1323
  createVNode(_component_nut_action_sheet, {
1426
1324
  visible: activeSheetVisible.value,
1427
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => activeSheetVisible.value = $event),
1325
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => activeSheetVisible.value = $event),
1428
1326
  "menu-items": actionSheetMenus,
1429
1327
  onChoose: chooseImages,
1430
1328
  "cancel-txt": "\u53D6\u6D88"
@@ -1437,193 +1335,48 @@ var script$I = /* @__PURE__ */ defineComponent({
1437
1335
  }
1438
1336
  });
1439
1337
 
1440
- script$I.__file = "src/shared/components/OcrIcon.vue";
1338
+ script$G.__file = "src/shared/components/OcrIcon.vue";
1441
1339
 
1442
- var script$H = /* @__PURE__ */ defineComponent({
1443
- __name: "OcrBank",
1340
+ var script$F = /* @__PURE__ */ defineComponent({
1341
+ __name: "OcrBusinessLicense",
1444
1342
  props: {
1445
- disabled: { type: Boolean, required: false, default: false },
1446
- class: { type: String, required: false, default: "" },
1447
- uploadUrl: { type: String, required: false, default: "/hkbase/file/uploadFile" },
1448
- customClick: { type: Boolean, required: false, default: false }
1343
+ disabled: { type: Boolean, required: true }
1449
1344
  },
1450
1345
  emits: ["complete"],
1451
- setup(__props, { expose: __expose, emit: __emit }) {
1346
+ setup(__props, { emit: __emit }) {
1452
1347
  const appKitOptions = useAppKitOptions();
1453
- const $http = useHttp$3(), $n = useNutshell();
1454
1348
  const emits = __emit;
1455
1349
  const props = __props;
1456
- async function onUploadFile(csRes) {
1457
- try {
1458
- let { path, size, tempFilePath } = csRes.tempFiles[0];
1459
- const compressImg = await compressImage(path || tempFilePath, getCompressQuality(size)) || {};
1460
- const filePath = compressImg.tempFilePath || path;
1461
- showLoading({ title: "\u94F6\u884C\u5361\u8BC6\u522B\u4E2D..", mask: true });
1462
- const session = appKitOptions.token();
1463
- const baseUrl = appKitOptions.baseUrl();
1464
- const upRes = await uploadFile({
1465
- url: baseUrl + props.uploadUrl,
1466
- filePath,
1467
- name: "file",
1468
- formData: {
1469
- objectNo: `min${Date.now()}`,
1470
- appCode: appKitOptions.app()
1350
+ async function taroImgCompress(src, quality = 80) {
1351
+ return new Promise((resolve, reject) => {
1352
+ Taro.compressImage({
1353
+ src,
1354
+ quality,
1355
+ success: (res) => {
1356
+ resolve(res);
1471
1357
  },
1472
- header: {
1473
- token: session || ""
1358
+ fail: (res) => {
1359
+ reject(res);
1474
1360
  }
1475
1361
  });
1476
- const res = JSON.parse(upRes.data);
1477
- if (res.code === "200") {
1478
- await getBankCardInfo(res.result);
1479
- } else {
1480
- hideLoading();
1481
- showToast({
1482
- title: res.msg,
1483
- icon: "error"
1484
- });
1485
- }
1486
- } catch (err) {
1487
- hideLoading();
1488
- console.log(err);
1489
- }
1490
- }
1491
- async function getBankCardInfo(file) {
1492
- try {
1493
- const res = await $http.get("/hkbase/common/bankCard", {
1494
- fileUrl: typeof file === "string" ? file : file.originalUrl
1495
- });
1496
- hideLoading();
1497
- if (res && !res.bankCardNumber) {
1498
- $n.dialog({
1499
- title: "\u8BC6\u522B\u5931\u8D25",
1500
- message: `\u60A8\u4E0A\u4F20\u7684\u56FE\u7247\u53EF\u80FD\u4E0D\u591F\u6E05\u6670\u6216\u4E0E\u5F53\u524D\u529F\u80FD\u4E0D\u7B26\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u4E00\u5F20\u6E05\u6670\u3001\u5B8C\u6574\u7684\u56FE\u7247\u3002\u8C22\u8C22\uFF01`,
1501
- okText: "\u6211\u77E5\u9053\u4E86",
1502
- cancelText: ""
1503
- });
1504
- return;
1505
- }
1506
- emits("complete", {
1507
- ...res,
1508
- fileUrl: typeof file === "string" ? file : file.originalUrl,
1509
- fileKey: typeof file === "string" ? file : file.fileId
1510
- });
1511
- } catch (err) {
1512
- hideLoading();
1513
- }
1514
- }
1515
- const activeSheetVisible = ref(false);
1516
- const actionSheetMenus = [
1517
- {
1518
- name: "\u62CD\u6444",
1519
- type: "camera"
1520
- },
1521
- {
1522
- name: "\u4ECE\u76F8\u518C\u9009\u62E9",
1523
- type: "album"
1524
- },
1525
- {
1526
- name: "\u4ECE\u804A\u5929\u4F1A\u8BDD\u9009\u62E9",
1527
- type: "message"
1528
- }
1529
- ];
1530
- if (Taro.getEnv() === "WEB") {
1531
- actionSheetMenus.pop();
1532
- }
1533
- async function chooseImages(item) {
1534
- if (["camera", "album"].includes(item.type)) {
1535
- const csRes = await chooseMedia({
1536
- count: 1,
1537
- sourceType: [item.type],
1538
- // "camera" | "album"
1539
- maxDuration: 60
1540
- // 使用duration属性判断是图片还是视频,图片没有该属性
1541
- });
1542
- onUploadFile(csRes);
1543
- } else {
1544
- const csRes = await chooseMessageFile({
1545
- count: 1,
1546
- type: "image"
1547
- });
1548
- onUploadFile(csRes);
1549
- }
1362
+ });
1550
1363
  }
1551
- async function onUpload() {
1552
- if (props.disabled) return;
1553
- if (Taro.getEnv() === "WEB") {
1554
- const csRes = await chooseMedia({
1555
- count: 1,
1556
- sourceType: ["album"],
1557
- // "camera" | "album"
1558
- maxDuration: 60
1559
- // 使用duration属性判断是图片还是视频,图片没有该属性
1560
- });
1561
- onUploadFile(csRes);
1562
- return;
1364
+ function getCompressQuality(size) {
1365
+ let quality = 100;
1366
+ const curSize = size / (1024 * 1024);
1367
+ if (curSize > 6) {
1368
+ quality = quality - (curSize - 6) / curSize * 100;
1563
1369
  }
1564
- activeSheetVisible.value = true;
1370
+ return quality;
1565
1371
  }
1566
- __expose({
1567
- onUpload
1568
- });
1569
- return (_ctx, _cache) => {
1570
- const _component_nut_action_sheet = ActionSheet;
1571
- const _directive_track_click = resolveDirective("track-click");
1572
- return openBlock(), createElementBlock(
1573
- Fragment,
1574
- null,
1575
- [
1576
- withDirectives((openBlock(), createElementBlock(
1577
- "div",
1578
- {
1579
- class: normalizeClass(["ocr-bank", [__props.disabled ? "disabled" : ""]]),
1580
- onClick: _cache[0] || (_cache[0] = ($event) => !__props.customClick ? onUpload() : null)
1581
- },
1582
- [
1583
- renderSlot(_ctx.$slots, "icon", {}, () => [
1584
- createVNode(unref(NsIcon), { name: "https://cdn.ddjf.com/static/images/beidouxing/ocr-icon.png" })
1585
- ])
1586
- ],
1587
- 2
1588
- /* CLASS */
1589
- )), [
1590
- [_directive_track_click, "\u94F6\u884C\u5361\u8BC6\u522B-\u70B9\u51FB"]
1591
- ]),
1592
- createVNode(_component_nut_action_sheet, {
1593
- visible: activeSheetVisible.value,
1594
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => activeSheetVisible.value = $event),
1595
- "menu-items": actionSheetMenus,
1596
- onChoose: chooseImages,
1597
- "cancel-txt": "\u53D6\u6D88"
1598
- }, null, 8, ["visible"])
1599
- ],
1600
- 64
1601
- /* STABLE_FRAGMENT */
1602
- );
1603
- };
1604
- }
1605
- });
1606
-
1607
- script$H.__file = "src/shared/components/OcrBank.vue";
1608
-
1609
- var script$G = /* @__PURE__ */ defineComponent({
1610
- __name: "OcrBusinessLicense",
1611
- props: {
1612
- disabled: { type: Boolean, required: true, default: false },
1613
- customClick: { type: Boolean, required: false, default: false }
1614
- },
1615
- emits: ["complete"],
1616
- setup(__props, { expose: __expose, emit: __emit }) {
1617
- const appKitOptions = useAppKitOptions();
1618
- const emits = __emit;
1619
- const props = __props;
1620
1372
  function allTrim(str) {
1621
1373
  return str.replace(/\s+/g, "");
1622
1374
  }
1623
- async function onUpload() {
1375
+ async function onIconClick() {
1624
1376
  if (props.disabled) {
1625
1377
  return;
1626
1378
  }
1379
+ console.log("===onIconClick");
1627
1380
  let result = null;
1628
1381
  try {
1629
1382
  const csRes = await chooseMedia({
@@ -1631,334 +1384,76 @@ var script$G = /* @__PURE__ */ defineComponent({
1631
1384
  sourceType: ["album", "camera"]
1632
1385
  });
1633
1386
  let { size, tempFilePath } = csRes.tempFiles[0];
1634
- const compressImg = await compressImage(tempFilePath, getCompressQuality(size)) || {};
1635
- const filePath = compressImg.tempFilePath;
1636
- showLoading({ title: "\u8425\u4E1A\u6267\u7167\u8BC6\u522B\u4E2D..", mask: true });
1637
- const session = appKitOptions.token();
1638
- const baseUrl = appKitOptions.baseUrl();
1639
- const upRes = await uploadFile({
1640
- url: baseUrl + "/promoact/common/parseBusinessLicense",
1641
- filePath,
1642
- name: "file",
1643
- formData: {
1644
- objectNo: `min${Date.now()}`,
1645
- appCode: appKitOptions.app()
1646
- },
1647
- header: {
1648
- token: session || ""
1649
- }
1650
- });
1651
- hideLoading();
1652
- const res = JSON.parse(upRes.data);
1653
- if (res.code === "200") {
1654
- const faceInfo = res.result || {};
1655
- result = {
1656
- companyName: allTrim(faceInfo.companyName || ""),
1657
- idCardNo: allTrim(faceInfo.idCardNo || ""),
1658
- legalPersonName: allTrim(faceInfo.legalPersonName || ""),
1659
- fileId: faceInfo.fileId,
1660
- originalUrl: faceInfo.originalUrl,
1661
- downloadUrl: faceInfo.downloadUrl
1662
- };
1663
- console.log("===\u8BC6\u522B", result);
1664
- if (!result.companyName && !result.idCardNo) {
1665
- showToast({ title: "\u8BC6\u522B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5", icon: "none" });
1666
- }
1387
+ let filePath;
1388
+ if (Taro.getEnv() !== "WEB") {
1389
+ const compressImg = await taroImgCompress(tempFilePath, getCompressQuality(size)) || {};
1390
+ filePath = compressImg.tempFilePath;
1667
1391
  } else {
1668
- showToast({
1669
- title: res.msg,
1670
- icon: "error"
1671
- });
1672
- }
1673
- } catch (err) {
1674
- hideLoading();
1675
- console.log(err);
1676
- }
1677
- emits("complete", result);
1678
- }
1679
- __expose({
1680
- onUpload
1681
- });
1682
- return (_ctx, _cache) => {
1683
- const _directive_track_click = resolveDirective("track-click");
1684
- return withDirectives((openBlock(), createElementBlock(
1685
- "div",
1686
- {
1687
- class: normalizeClass([["ocr-business-license", __props.disabled ? "disabled" : ""], "ocr-icon"]),
1688
- onClick: _cache[0] || (_cache[0] = ($event) => !__props.customClick ? onUpload() : null)
1689
- },
1690
- [
1691
- renderSlot(_ctx.$slots, "icon", {}, () => [
1692
- createVNode(unref(NsIcon), { name: "https://cdn.ddjf.com/static/images/beidouxing/ocr-icon.png" })
1693
- ])
1694
- ],
1695
- 2
1696
- /* CLASS */
1697
- )), [
1698
- [_directive_track_click, "\u8425\u4E1A\u6267\u7167\u8BC6\u522B-\u70B9\u51FB"]
1699
- ]);
1700
- };
1701
- }
1702
- });
1703
-
1704
- script$G.__file = "src/shared/components/OcrBusinessLicense.vue";
1705
-
1706
- var script$F = /* @__PURE__ */ defineComponent({
1707
- __name: "OcrInvoice",
1708
- props: {
1709
- disabled: { type: Boolean, required: false, default: false },
1710
- side: { type: String, required: false, default: "face" },
1711
- className: { type: String, required: false, default: "" },
1712
- customUpload: { type: Function, required: false },
1713
- uploadUrl: { type: String, required: false, default: "/hkbase/file/uploadFile" },
1714
- customClick: { type: Boolean, required: false, default: false }
1715
- },
1716
- emits: ["complete"],
1717
- setup(__props, { expose: __expose, emit: __emit }) {
1718
- const appKitOptions = useAppKitOptions();
1719
- const $http = useHttp$3(), $n = useNutshell();
1720
- const emits = __emit;
1721
- const props = __props;
1722
- function getFileType(filePath, fileName) {
1723
- const lowerPath = filePath.toLowerCase();
1724
- const lowerName = (fileName || "").toLowerCase();
1725
- if (lowerPath.endsWith(".pdf") || lowerName.endsWith(".pdf")) {
1726
- return "pdf";
1727
- }
1728
- const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"];
1729
- if (imageExtensions.some((ext) => lowerPath.endsWith(ext) || lowerName.endsWith(ext))) {
1730
- return "img";
1731
- }
1732
- return "img";
1733
- }
1734
- async function onUploadFile(csRes, fileType) {
1735
- try {
1736
- let { path, size, tempFilePath, name } = csRes.tempFiles[0];
1737
- const originalPath = path || tempFilePath;
1738
- const detectedFileType = fileType || getFileType(originalPath, name);
1739
- let filePath = originalPath;
1740
- if (detectedFileType === "img") {
1741
- const compressImg = await compressImage(originalPath, getCompressQuality(size)) || {};
1742
- filePath = compressImg.tempFilePath || originalPath;
1743
- }
1744
- if (props.customUpload) {
1745
- props.customUpload(filePath, detectedFileType);
1746
- return;
1392
+ filePath = tempFilePath;
1747
1393
  }
1748
- showLoading({ title: "\u53D1\u7968\u8BC6\u522B\u4E2D..", mask: true });
1394
+ showLoading({ title: "\u8425\u4E1A\u6267\u7167\u8BC6\u522B\u4E2D.." });
1749
1395
  const session = appKitOptions.token();
1750
1396
  const baseUrl = appKitOptions.baseUrl();
1751
1397
  const upRes = await uploadFile({
1752
- url: `${baseUrl}${props.uploadUrl}`,
1398
+ url: baseUrl + "/promoact/common/parseBusinessLicense",
1753
1399
  filePath,
1754
1400
  name: "file",
1755
1401
  formData: {
1756
- objectNo: `min${Date.now()}`,
1757
- appCode: appKitOptions.app()
1402
+ objectNo: `min${Date.now()}`
1758
1403
  },
1759
1404
  header: {
1760
1405
  token: session || ""
1761
1406
  }
1762
1407
  });
1763
- const res = JSON.parse(upRes.data);
1764
- if (res.code === "200") {
1765
- await getOcrInfo(res.result, detectedFileType);
1766
- } else {
1767
- hideLoading();
1768
- showToast({
1769
- title: res.msg,
1770
- icon: "error"
1771
- });
1772
- }
1773
- } catch (err) {
1774
1408
  hideLoading();
1775
- console.log(err);
1776
- }
1777
- }
1778
- async function getOcrInfo(file, fileType = "img") {
1779
- try {
1780
- const fileUrl = typeof file === "string" ? file : file.originalUrl;
1781
- const res = await $http.get("/hkbase/common/vatInvoice", {
1782
- fileUrl,
1783
- fileType
1784
- });
1785
- hideLoading();
1786
- if (!res?.purchaserRegisterNum) {
1787
- $n.dialog({
1788
- title: "\u8BC6\u522B\u5931\u8D25",
1789
- message: `\u60A8\u4E0A\u4F20\u7684${fileType === "pdf" ? "\u6587\u4EF6" : "\u56FE\u7247"}\u53EF\u80FD\u4E0D\u591F\u6E05\u6670\u6216\u4E0E\u5F53\u524D\u529F\u80FD\u4E0D\u7B26\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u4E00\u5F20\u6E05\u6670\u3001\u5B8C\u6574\u7684${fileType === "pdf" ? "PDF\u6587\u4EF6" : "\u56FE\u7247"}\u3002\u8C22\u8C22\uFF01`,
1790
- okText: "\u6211\u77E5\u9053\u4E86",
1791
- cancelText: ""
1792
- });
1793
- return;
1794
- }
1795
- emits("complete", {
1796
- invoiceDate: res?.invoiceDate,
1797
- invoiceNum: res?.invoiceNum,
1798
- invoiceNumConfirm: res?.invoiceNumConfirm,
1799
- invoiceType: res?.invoiceType,
1800
- noteDrawer: res?.noteDrawer,
1801
- purchaserBank: res?.purchaserBank,
1802
- purchaserName: res?.purchaserName,
1803
- purchaserRegisterNum: res?.purchaserRegisterNum,
1804
- remarks: res?.remarks,
1805
- sellerName: res?.sellerName,
1806
- sellerRegisterNum: res?.sellerRegisterNum,
1807
- serviceType: res?.serviceType,
1808
- totalAmount: res?.totalAmount,
1809
- totalTax: res?.totalTax,
1810
- fileUrl,
1811
- fileType,
1812
- fileKey: typeof file === "string" ? file : file.fileId
1813
- });
1814
- } catch (err) {
1815
- hideLoading();
1816
- }
1817
- }
1818
- const activeSheetVisible = ref(false);
1819
- const actionSheetMenus = [
1820
- {
1821
- name: "\u62CD\u6444",
1822
- type: "camera"
1823
- },
1824
- {
1825
- name: "\u4ECE\u76F8\u518C\u9009\u62E9",
1826
- type: "album"
1827
- },
1828
- {
1829
- name: "\u4ECE\u804A\u5929\u4F1A\u8BDD\u9009\u62E9",
1830
- type: "message"
1831
- },
1832
- {
1833
- name: "\u9009\u62E9\u6587\u4EF6",
1834
- type: "file"
1835
- }
1836
- ];
1837
- if (Taro.getEnv() === "WEB") {
1838
- actionSheetMenus.splice(2, 1);
1839
- }
1840
- async function chooseImages(item) {
1841
- if (["camera", "album"].includes(item.type)) {
1842
- const csRes = await chooseMedia({
1843
- count: 1,
1844
- sourceType: [item.type],
1845
- // "camera" | "album"
1846
- maxDuration: 60
1847
- // 使用duration属性判断是图片还是视频,图片没有该属性
1848
- });
1849
- onUploadFile(csRes);
1850
- } else if (item.type === "message") {
1851
- const csRes = await chooseMessageFile({
1852
- count: 1,
1853
- type: "image"
1854
- });
1855
- onUploadFile(csRes);
1856
- } else if (item.type === "file") {
1857
- const csRes = await chooseMessageFile({
1858
- count: 1,
1859
- type: "file"
1860
- });
1861
- onUploadFile(csRes);
1862
- }
1863
- }
1864
- function chooseFileInWeb() {
1865
- return new Promise((resolve, reject) => {
1866
- const input = document.createElement("input");
1867
- input.type = "file";
1868
- input.accept = "image/*,.pdf";
1869
- input.style.display = "none";
1870
- input.onchange = async (e) => {
1871
- const file = e.target?.files?.[0];
1872
- if (!file) {
1873
- document.body.removeChild(input);
1874
- resolve();
1875
- return;
1876
- }
1877
- let fileType = "img";
1878
- if (file.type === "application/pdf" || file.name.toLowerCase().endsWith(".pdf")) {
1879
- fileType = "pdf";
1880
- }
1881
- const filePath = URL.createObjectURL(file);
1882
- try {
1883
- const csRes = {
1884
- tempFiles: [{
1885
- path: filePath,
1886
- tempFilePath: filePath,
1887
- size: file.size,
1888
- name: file.name
1889
- }]
1890
- };
1891
- await onUploadFile(csRes, fileType);
1892
- resolve();
1893
- } catch (error) {
1894
- reject(error);
1895
- } finally {
1896
- document.body.removeChild(input);
1897
- URL.revokeObjectURL(filePath);
1409
+ const res = JSON.parse(upRes.data);
1410
+ if (res.code === "200") {
1411
+ const faceInfo = res.result || {};
1412
+ result = {
1413
+ companyName: allTrim(faceInfo.companyName || ""),
1414
+ idCardNo: allTrim(faceInfo.idCardNo || ""),
1415
+ legalPersonName: allTrim(faceInfo.legalPersonName || ""),
1416
+ fileId: faceInfo.fileId,
1417
+ originalUrl: faceInfo.originalUrl,
1418
+ downloadUrl: faceInfo.downloadUrl
1419
+ };
1420
+ console.log("===\u8BC6\u522B", result);
1421
+ if (!result.companyName && !result.idCardNo) {
1422
+ showToast({ title: "\u8BC6\u522B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5", icon: "none" });
1898
1423
  }
1899
- };
1900
- input.oncancel = () => {
1901
- document.body.removeChild(input);
1902
- resolve();
1903
- };
1904
- document.body.appendChild(input);
1905
- input.click();
1906
- });
1907
- }
1908
- async function onUpload() {
1909
- if (props.disabled) return;
1910
- if (Taro.getEnv() === "WEB") {
1911
- try {
1912
- await chooseFileInWeb();
1913
- } catch (err) {
1914
- console.error("\u6587\u4EF6\u9009\u62E9\u5931\u8D25:", err);
1424
+ } else {
1425
+ showToast({
1426
+ title: res.msg,
1427
+ icon: "error"
1428
+ });
1915
1429
  }
1916
- return;
1430
+ } catch (err) {
1431
+ hideLoading();
1432
+ console.log(err);
1917
1433
  }
1918
- activeSheetVisible.value = true;
1434
+ emits("complete", result);
1919
1435
  }
1920
- __expose({
1921
- onUpload
1922
- });
1923
1436
  return (_ctx, _cache) => {
1924
- const _component_nut_action_sheet = ActionSheet;
1925
1437
  const _directive_track_click = resolveDirective("track-click");
1926
- return openBlock(), createElementBlock(
1927
- Fragment,
1928
- null,
1438
+ return withDirectives((openBlock(), createElementBlock(
1439
+ "div",
1440
+ {
1441
+ class: normalizeClass([["ocr-business-license", __props.disabled ? "disabled" : ""], "ocr-icon"]),
1442
+ onClick: onIconClick
1443
+ },
1929
1444
  [
1930
- withDirectives((openBlock(), createElementBlock(
1931
- "div",
1932
- {
1933
- class: normalizeClass(["ocr-invoice", [__props.disabled ? "disabled" : "", __props.className]]),
1934
- onClick: _cache[0] || (_cache[0] = ($event) => !__props.customClick ? onUpload() : null)
1935
- },
1936
- [
1937
- renderSlot(_ctx.$slots, "icon", {}, () => [
1938
- createVNode(unref(NsIcon), { name: "https://cdn.ddjf.com/static/images/beidouxing/ocr-icon.png" })
1939
- ])
1940
- ],
1941
- 2
1942
- /* CLASS */
1943
- )), [
1944
- [_directive_track_click, "\u53D1\u7968\u8BC6\u522B-\u70B9\u51FB"]
1945
- ]),
1946
- createVNode(_component_nut_action_sheet, {
1947
- visible: activeSheetVisible.value,
1948
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => activeSheetVisible.value = $event),
1949
- "menu-items": actionSheetMenus,
1950
- onChoose: chooseImages,
1951
- "cancel-txt": "\u53D6\u6D88"
1952
- }, null, 8, ["visible"])
1445
+ createVNode(unref(NsIcon), { name: "https://cdn.ddjf.com/static/images/beidouxing/ocr-icon.png" })
1953
1446
  ],
1954
- 64
1955
- /* STABLE_FRAGMENT */
1956
- );
1447
+ 2
1448
+ /* CLASS */
1449
+ )), [
1450
+ [_directive_track_click, "\u8425\u4E1A\u6267\u7167\u8BC6\u522B-\u70B9\u51FB"]
1451
+ ]);
1957
1452
  };
1958
1453
  }
1959
1454
  });
1960
1455
 
1961
- script$F.__file = "src/shared/components/OcrInvoice.vue";
1456
+ script$F.__file = "src/shared/components/OcrBusinessLicense.vue";
1962
1457
 
1963
1458
  var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
1964
1459
  HttpMethod2["get"] = "GET";
@@ -2006,7 +1501,6 @@ const request = (config) => {
2006
1501
  }
2007
1502
  }).catch((e) => {
2008
1503
  console.log("request.catch===", e);
2009
- reject(e);
2010
1504
  });
2011
1505
  });
2012
1506
  };
@@ -2514,6 +2008,7 @@ class TrackingSDK {
2514
2008
  * 发送埋点数据
2515
2009
  */
2516
2010
  async flush() {
2011
+ console.log(this.eventQueue.length, "this.eventQueue.length");
2517
2012
  if (this.eventQueue.length === 0) return;
2518
2013
  const events = [...this.eventQueue];
2519
2014
  this.eventQueue = [];
@@ -3151,7 +2646,8 @@ const endpointsList$2 = {
3151
2646
  translate: (data) => ({
3152
2647
  appCode: data.app,
3153
2648
  // caseCode: 'recharge', // 这个参数可以不要
3154
- tenantId: data.tenant
2649
+ tenantId: data.tenant,
2650
+ scene: data.scene
3155
2651
  }),
3156
2652
  transform: (data) => data.amountList.map((d) => ({
3157
2653
  token: d.desc,
@@ -3184,6 +2680,9 @@ const endpointsList$2 = {
3184
2680
  return {
3185
2681
  json,
3186
2682
  // 拉起微信支付用的JSON串
2683
+ paymentType: data.paymentType,
2684
+ prePayStr: data.prePayStr,
2685
+ thirdPayId: data.thirdPayId,
3187
2686
  paymentId: data.payId
3188
2687
  // 查询用支付ID
3189
2688
  };
@@ -3199,11 +2698,9 @@ const endpointsList$2 = {
3199
2698
  certificateNo: params.user,
3200
2699
  accountAuthFlag: params.accountAuthFlag || false,
3201
2700
  channelCode: params.channelCode || null,
3202
- payFinishJumpUrl: params.payFinishJumpUrl || null,
3203
- useCloudBean: params.useCloudBean || false
2701
+ payFinishJumpUrl: params.payFinishJumpUrl || null
3204
2702
  }),
3205
2703
  transform: (data) => {
3206
- console.log(data, "data-----");
3207
2704
  let json = null;
3208
2705
  try {
3209
2706
  json = JSON.parse(data.prePayStr);
@@ -3212,6 +2709,9 @@ const endpointsList$2 = {
3212
2709
  return {
3213
2710
  json,
3214
2711
  // 拉起微信支付用的JSON串
2712
+ paymentType: data.paymentType,
2713
+ prePayStr: data.prePayStr,
2714
+ thirdPayId: data.thirdPayId,
3215
2715
  paymentId: data.payId
3216
2716
  // 查询用支付ID
3217
2717
  };
@@ -3220,6 +2720,13 @@ const endpointsList$2 = {
3220
2720
  \u83B7\u53D6\u589E\u503C\u6743\u76CA\u7C7B\u76EE: {
3221
2721
  path: "/payment/paymentCaseConfig/getBalanceAndRiskQueryPriceConfig",
3222
2722
  transform: (data) => data
2723
+ },
2724
+ \u83B7\u53D6\u652F\u4ED8\u7ED3\u679C: {
2725
+ path: "/payment/outer/payment/getPayResult",
2726
+ translate: (data) => ({
2727
+ thirdPayId: data.thirdPayId
2728
+ }),
2729
+ transform: (data) => data
3223
2730
  }
3224
2731
  };
3225
2732
  const endpoints$1 = Object.fromEntries(
@@ -3271,7 +2778,6 @@ const vendor$2 = {
3271
2778
  title: data.msg,
3272
2779
  icon: "none"
3273
2780
  });
3274
- reject(data.msg);
3275
2781
  }
3276
2782
  }).catch((e) => {
3277
2783
  reject(e);
@@ -3284,7 +2790,7 @@ function useHttp$2(defaultHeader) {
3284
2790
  const headers = {
3285
2791
  Token: appkitOptions.tempToken() || appkitOptions.token(),
3286
2792
  Appcode: defaultHeader?.Appcode || appkitOptions.app(),
3287
- tid: defaultHeader?.Tenant || appkitOptions.tenant(),
2793
+ cookie: `tid=${defaultHeader?.Tenant || appkitOptions.tenant()}`,
3288
2794
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
3289
2795
  };
3290
2796
  const $http = createHttp({
@@ -3435,8 +2941,6 @@ const requestBrandWCPayByBean = (params, Appcode = "") => {
3435
2941
  }
3436
2942
  });
3437
2943
  }
3438
- }).catch(() => {
3439
- resolve(false);
3440
2944
  });
3441
2945
  });
3442
2946
  };
@@ -3455,17 +2959,41 @@ function isWechat() {
3455
2959
  let ua = window.navigator.userAgent.toLowerCase();
3456
2960
  return ua.includes("micromessenger");
3457
2961
  }
2962
+ function isAlipay() {
2963
+ let ua = window.navigator.userAgent.toLowerCase();
2964
+ return ua.includes("alipayclient");
2965
+ }
3458
2966
  const isIOS = () => {
3459
2967
  if (typeof window !== "undefined") {
3460
2968
  return /iPhone|iPad|iPod/i.test(window.navigator.userAgent);
3461
2969
  }
3462
2970
  return false;
3463
2971
  };
2972
+ const isAndroid = () => {
2973
+ if (typeof window !== "undefined") {
2974
+ return /Android/i.test(window.navigator.userAgent);
2975
+ }
2976
+ return false;
2977
+ };
2978
+ function getBrowser() {
2979
+ if (typeof window === "undefined") return "other";
2980
+ const ua = window.navigator.userAgent.toLowerCase();
2981
+ if (/edg\/|edge\//.test(ua) || /opr\/|opera/.test(ua)) return "other";
2982
+ if (/chrome\/|crios\//.test(ua)) return "chrome";
2983
+ if (/safari\//.test(ua) && !/chrome|crios/.test(ua)) return "safari";
2984
+ return "other";
2985
+ }
2986
+ function isSafari() {
2987
+ return getBrowser() === "safari";
2988
+ }
2989
+ function isChrome() {
2990
+ return getBrowser() === "chrome";
2991
+ }
3464
2992
 
3465
2993
  const _hoisted_1$B = { class: "view recharge-view" };
3466
2994
  const _hoisted_2$r = { class: "flex-grow" };
3467
2995
  const _hoisted_3$l = { class: "amount-footer" };
3468
- const _hoisted_4$h = { class: "agreement" };
2996
+ const _hoisted_4$g = { class: "agreement" };
3469
2997
  var script$E = /* @__PURE__ */ defineComponent({
3470
2998
  __name: "RechargeView",
3471
2999
  props: {
@@ -3474,7 +3002,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3474
3002
  payFinishJumpUrl: { type: String, required: false }
3475
3003
  },
3476
3004
  emits: ["complete", "agree", "loaded"],
3477
- setup(__props, { emit: __emit }) {
3005
+ setup(__props, { expose: __expose, emit: __emit }) {
3478
3006
  const props = __props;
3479
3007
  const { params } = useRouter();
3480
3008
  const emit = __emit;
@@ -3482,7 +3010,8 @@ var script$E = /* @__PURE__ */ defineComponent({
3482
3010
  agreed: false,
3483
3011
  selected: 0,
3484
3012
  agreementOpen: false,
3485
- buttonLoading: false
3013
+ buttonLoading: false,
3014
+ thirdPayId: ""
3486
3015
  });
3487
3016
  const amounts = ref([]);
3488
3017
  const onAgreementLinkClick = (e) => {
@@ -3497,7 +3026,8 @@ var script$E = /* @__PURE__ */ defineComponent({
3497
3026
  const $http = useHttp$2({ Appcode: props.app !== "cloudkitPro" ? props.app : "", Tenant: props.tenant });
3498
3027
  $http.get(endpoints$1.\u83B7\u53D6\u5145\u503C\u91D1\u989D\u5217\u8868, {
3499
3028
  app: props.app,
3500
- tenant: props.tenant
3029
+ tenant: props.tenant,
3030
+ scene: isWechat() ? "" : "APP"
3501
3031
  }).then((response) => {
3502
3032
  amounts.value = response;
3503
3033
  emit("loaded");
@@ -3513,28 +3043,22 @@ var script$E = /* @__PURE__ */ defineComponent({
3513
3043
  }
3514
3044
  state.buttonLoading = true;
3515
3045
  if (Taro.getEnv() === "WEB") {
3516
- if (!isWechat()) {
3517
- showToast({
3518
- title: "\u8BF7\u4F7F\u7528\u5FAE\u4FE1\u6D4F\u89C8\u5668\u6253\u5F00",
3519
- icon: "none"
3520
- });
3521
- state.buttonLoading = false;
3522
- return false;
3523
- }
3524
3046
  requestBrandWCPay({
3525
3047
  amount: amounts.value[state.selected].amount,
3526
3048
  app: "loankitMp",
3527
3049
  tenant: props.tenant,
3528
3050
  accountAuthFlag: false,
3529
- channelCode: "centergzh",
3051
+ channelCode: getChannelCode(),
3530
3052
  payFinishJumpUrl: props.payFinishJumpUrl,
3531
3053
  fromMini: !!params.from,
3532
3054
  clientInfo: "H5"
3533
3055
  }).then((result) => {
3534
- console.log(result, "------requestBrandWCPay");
3535
3056
  state.buttonLoading = false;
3536
3057
  if (typeof result === "boolean" && result) {
3537
3058
  window.location.href = props.payFinishJumpUrl;
3059
+ } else if (typeof result === "object" && result?.paymentType === "H5" && result?.prePayStr) {
3060
+ state.thirdPayId = result?.thirdPayId || "";
3061
+ window.location.href = result?.prePayStr;
3538
3062
  } else {
3539
3063
  emit("complete", result);
3540
3064
  }
@@ -3557,13 +3081,36 @@ var script$E = /* @__PURE__ */ defineComponent({
3557
3081
  });
3558
3082
  }
3559
3083
  };
3084
+ function getChannelCode() {
3085
+ if (isWechat()) {
3086
+ return "centergzh";
3087
+ } else if (isAlipay() || isAndroid() || isIOS() && !isChrome() && !isSafari()) {
3088
+ return "YundouZfb";
3089
+ } else {
3090
+ return "distributor";
3091
+ }
3092
+ }
3093
+ const payResultCheck = () => {
3094
+ if (!state.thirdPayId) return;
3095
+ const $http = useHttp$2();
3096
+ $http.get(endpoints$1.\u83B7\u53D6\u652F\u4ED8\u7ED3\u679C, {
3097
+ thirdPayId: state.thirdPayId
3098
+ }).then((response) => {
3099
+ if (response.payStatus === "paid") {
3100
+ emit("complete", true);
3101
+ }
3102
+ });
3103
+ };
3104
+ __expose({
3105
+ payResultCheck
3106
+ });
3560
3107
  return (_ctx, _cache) => {
3561
3108
  const _component_nut_checkbox = Checkbox;
3562
3109
  const _component_nut_button = Button;
3563
3110
  const _directive_track_click = resolveDirective("track-click");
3564
3111
  return openBlock(), createElementBlock("view", _hoisted_1$B, [
3565
3112
  createElementVNode("view", _hoisted_2$r, [
3566
- createVNode(script$O, {
3113
+ createVNode(script$M, {
3567
3114
  items: amounts.value,
3568
3115
  selected: state.selected,
3569
3116
  onChange: onAmountSelect
@@ -3571,7 +3118,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3571
3118
  renderSlot(_ctx.$slots, "banner")
3572
3119
  ]),
3573
3120
  createElementVNode("view", _hoisted_3$l, [
3574
- createElementVNode("view", _hoisted_4$h, [
3121
+ createElementVNode("view", _hoisted_4$g, [
3575
3122
  createVNode(_component_nut_checkbox, {
3576
3123
  modelValue: state.agreed,
3577
3124
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.agreed = $event)
@@ -3644,7 +3191,7 @@ const _hoisted_3$k = {
3644
3191
  key: 0,
3645
3192
  class: "caption"
3646
3193
  };
3647
- const _hoisted_4$g = {
3194
+ const _hoisted_4$f = {
3648
3195
  key: 1,
3649
3196
  class: "caption"
3650
3197
  };
@@ -3685,7 +3232,7 @@ var script$C = /* @__PURE__ */ defineComponent({
3685
3232
  ),
3686
3233
  __props.payMethod == "bean" ? (openBlock(), createElementBlock("div", _hoisted_3$k, "\u6743\u76CA\u5DF2\u5230\u8D26")) : (openBlock(), createElementBlock(
3687
3234
  "div",
3688
- _hoisted_4$g,
3235
+ _hoisted_4$f,
3689
3236
  toDisplayString(views[__props.type][1]) + "\u5C06\u57281\u5206\u949F\u4E4B\u5185\u5230\u8D26",
3690
3237
  1
3691
3238
  /* TEXT */
@@ -3832,8 +3379,8 @@ const _hoisted_3$i = {
3832
3379
  key: 0,
3833
3380
  class: "bean-buy"
3834
3381
  };
3835
- const _hoisted_4$f = { class: "left" };
3836
- const _hoisted_5$d = {
3382
+ const _hoisted_4$e = { class: "left" };
3383
+ const _hoisted_5$c = {
3837
3384
  key: 0,
3838
3385
  class: "amount"
3839
3386
  };
@@ -3843,36 +3390,27 @@ const _hoisted_6$9 = {
3843
3390
  };
3844
3391
  const _hoisted_7$6 = { class: "amount" };
3845
3392
  const _hoisted_8$5 = ["src"];
3846
- const _hoisted_9$4 = {
3847
- key: 0,
3848
- class: "balance-warning"
3849
- };
3393
+ const _hoisted_9$4 = { class: "amount-footer" };
3850
3394
  const _hoisted_10$3 = {
3851
- key: 1,
3852
- class: "balance-warning-tip"
3853
- };
3854
- const _hoisted_11$3 = { class: "amount-footer" };
3855
- const _hoisted_12$3 = {
3856
3395
  key: 0,
3857
3396
  class: "agreement"
3858
3397
  };
3859
- const _hoisted_13$2 = { class: "buy-amount" };
3860
- const _hoisted_14$2 = { class: "left" };
3861
- const _hoisted_15$2 = { class: "amount" };
3398
+ const _hoisted_11$3 = { class: "buy-amount" };
3399
+ const _hoisted_12$3 = { class: "left" };
3400
+ const _hoisted_13$2 = { class: "amount" };
3401
+ const _hoisted_14$2 = { class: "item" };
3402
+ const _hoisted_15$2 = { class: "item" };
3862
3403
  const _hoisted_16$2 = { class: "item" };
3863
- const _hoisted_17$2 = { class: "item" };
3864
- const _hoisted_18$2 = { class: "item" };
3865
3404
  var script$A = /* @__PURE__ */ defineComponent({
3866
3405
  __name: "TradeView",
3867
3406
  props: {
3868
3407
  headerApp: { type: String, required: true },
3869
3408
  app: { type: String, required: true },
3870
3409
  tenant: { type: String, required: true },
3871
- payFinishJumpUrl: { type: String, required: false },
3872
- apps: { type: String, required: false }
3410
+ payFinishJumpUrl: { type: String, required: false }
3873
3411
  },
3874
3412
  emits: ["complete", "agree", "loaded"],
3875
- setup(__props, { emit: __emit }) {
3413
+ setup(__props, { expose: __expose, emit: __emit }) {
3876
3414
  const props = __props;
3877
3415
  const { formatAmount } = useAmount();
3878
3416
  const { params } = useRouter();
@@ -3881,7 +3419,8 @@ var script$A = /* @__PURE__ */ defineComponent({
3881
3419
  agreed: false,
3882
3420
  selected: 0,
3883
3421
  // agreementOpen: false,
3884
- buttonLoading: false
3422
+ buttonLoading: false,
3423
+ thirdPayId: ""
3885
3424
  });
3886
3425
  const balance = ref(0);
3887
3426
  const amounts = ref([]);
@@ -3895,33 +3434,14 @@ var script$A = /* @__PURE__ */ defineComponent({
3895
3434
  state.selected = selected;
3896
3435
  selectBean.value = false;
3897
3436
  };
3898
- const extraPaymentAmount = computed(() => {
3899
- if (!selectBean.value || !amounts.value[state.selected]) {
3900
- return 0;
3901
- }
3902
- const paymentAmount = amounts.value[state.selected].paymentAmount || 0;
3903
- const currentBalance = balance.value || 0;
3904
- return Math.max(0, paymentAmount - currentBalance);
3905
- });
3906
3437
  const currentAmount = computed(() => {
3907
- if (!amounts.value[state.selected]) {
3908
- return 0;
3909
- }
3910
- if (selectBean.value) {
3911
- if (balance.value < amounts.value[state.selected].paymentAmount) {
3912
- return extraPaymentAmount.value;
3913
- }
3914
- return 0;
3915
- }
3916
- return amounts.value[state.selected].paymentAmount || 0;
3917
- });
3918
- const isCombinedPayment = computed(() => {
3919
- return selectBean.value && amounts.value[state.selected] && balance.value < amounts.value[state.selected].paymentAmount;
3438
+ return amounts.value[state.selected] && !selectBean.value ? amounts.value[state.selected].paymentAmount : 0;
3920
3439
  });
3921
3440
  onMounted(() => {
3922
3441
  const $http = useHttp$2({ Appcode: props.headerApp, Tenant: props.tenant });
3923
3442
  $http.get(endpoints$1.\u83B7\u53D6\u589E\u503C\u6743\u76CA\u7C7B\u76EE, {
3924
- rightCode: props.app === "corporateStar" ? "riskQueryCompany" : "riskQueryMulti"
3443
+ rightCode: props.app === "corporateStar" ? "riskQueryCompany" : "riskQueryMulti",
3444
+ scene: isWechat() ? "" : "APP"
3925
3445
  }).then((res) => {
3926
3446
  balance.value = res.balance;
3927
3447
  amounts.value = res.paymentCaseConfigVOS;
@@ -3931,28 +3451,24 @@ var script$A = /* @__PURE__ */ defineComponent({
3931
3451
  const showDialog = ref(false);
3932
3452
  async function beanPay() {
3933
3453
  const $http = useHttp$2({ Appcode: props.headerApp, Tenant: props.tenant });
3934
- try {
3935
- const response = await $http.post(
3936
- `/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`
3937
- );
3454
+ $http.post(`/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`).then((response) => {
3938
3455
  if (response) {
3939
3456
  showDialog.value = false;
3940
3457
  emit("complete", { result: response, type: "bean" });
3941
3458
  } else {
3942
3459
  showToast({
3943
- title: response?.message || "\u652F\u4ED8\u5931\u8D25",
3460
+ title: response.message,
3944
3461
  icon: "none"
3945
3462
  });
3946
3463
  }
3947
- } catch (error) {
3948
- showToast({
3949
- title: error?.message || "\u652F\u4ED8\u5931\u8D25",
3950
- icon: "none"
3951
- });
3952
- }
3464
+ });
3953
3465
  }
3954
- function proceedWechatPayment() {
3955
- if (!state.agreed) {
3466
+ const onPayClick = () => {
3467
+ if (selectBean.value) {
3468
+ showDialog.value = true;
3469
+ return;
3470
+ }
3471
+ if (!selectBean.value && !state.agreed) {
3956
3472
  showToast({
3957
3473
  title: "\u8BF7\u52FE\u9009\u300A\u5927\u9053\u4E91\u5E73\u53F0\u4E91\u8C46\u5145\u503C\u534F\u8BAE\u300B",
3958
3474
  icon: "none"
@@ -3961,119 +3477,71 @@ var script$A = /* @__PURE__ */ defineComponent({
3961
3477
  }
3962
3478
  state.buttonLoading = true;
3963
3479
  if (Taro.getEnv() === "WEB") {
3964
- if (!isWechat()) {
3965
- showToast({
3966
- title: "\u8BF7\u4F7F\u7528\u5FAE\u4FE1\u6D4F\u89C8\u5668\u6253\u5F00",
3967
- icon: "none"
3968
- });
3969
- state.buttonLoading = false;
3970
- return false;
3971
- }
3972
3480
  requestBrandWCPayByBean({
3973
3481
  caseConfigId: amounts.value[state.selected].id,
3974
- amount: currentAmount.value,
3482
+ amount: amounts.value[state.selected].paymentAmount,
3975
3483
  app: "loankitMp",
3976
3484
  tenant: props.tenant,
3977
3485
  accountAuthFlag: false,
3978
- channelCode: "centergzh",
3486
+ channelCode: getChannelCode(),
3979
3487
  payFinishJumpUrl: props.payFinishJumpUrl,
3980
- fromMini: !!params.from,
3981
- useCloudBean: isCombinedPayment.value
3488
+ fromMini: !!params.from
3982
3489
  }).then((result) => {
3983
3490
  state.buttonLoading = false;
3984
3491
  if (typeof result === "boolean" && result) {
3985
3492
  window.location.href = props.payFinishJumpUrl;
3493
+ } else if (typeof result === "object" && result?.paymentType === "H5" && result?.prePayStr) {
3494
+ state.thirdPayId = result?.thirdPayId || "";
3495
+ window.location.href = result?.prePayStr;
3986
3496
  } else {
3987
- emit("complete", {
3988
- result,
3989
- type: isCombinedPayment.value ? "combined" : "wePay"
3990
- });
3497
+ emit("complete", { result, type: "wePay" });
3991
3498
  }
3992
- }).catch((error) => {
3993
- state.buttonLoading = false;
3994
- showToast({
3995
- title: error.message || "\u652F\u4ED8\u5931\u8D25",
3996
- icon: "none"
3997
- });
3998
3499
  });
3999
3500
  } else {
4000
3501
  wx.login({
4001
3502
  success({ code }) {
4002
- requestPaymentByBean(
4003
- {
4004
- caseConfigId: amounts.value[state.selected].id,
4005
- amount: currentAmount.value,
4006
- app: props.app,
4007
- tenant: props.tenant,
4008
- user: code
4009
- },
4010
- props.headerApp
4011
- ).then((result) => {
3503
+ requestPaymentByBean({
3504
+ caseConfigId: amounts.value[state.selected].id,
3505
+ amount: amounts.value[state.selected].paymentAmount,
3506
+ app: props.app,
3507
+ tenant: props.tenant,
3508
+ user: code
3509
+ }, props.headerApp).then((result) => {
4012
3510
  state.buttonLoading = false;
4013
3511
  if (result) {
4014
- emit("complete", {
4015
- result: true,
4016
- type: isCombinedPayment.value ? "combined" : "wePay"
4017
- });
3512
+ emit("complete", { result: true, type: "wePay" });
4018
3513
  }
4019
- }).catch((error) => {
4020
- state.buttonLoading = false;
4021
- showToast({
4022
- title: error.message || "\u652F\u4ED8\u5931\u8D25",
4023
- icon: "none"
4024
- });
4025
- });
4026
- },
4027
- fail() {
4028
- state.buttonLoading = false;
4029
- showToast({
4030
- title: "\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
4031
- icon: "none"
4032
3514
  });
4033
3515
  }
4034
3516
  });
4035
3517
  }
4036
- }
4037
- const onPayClick = async () => {
4038
- if (selectBean.value && !isCombinedPayment.value) {
4039
- showDialog.value = true;
4040
- return;
4041
- }
4042
- if (isCombinedPayment.value) {
4043
- const res = await checkBalance();
4044
- if (!res) return;
4045
- }
4046
- proceedWechatPayment();
4047
3518
  };
4048
- async function checkBalance() {
3519
+ function getChannelCode() {
3520
+ if (isWechat()) {
3521
+ return "centergzh";
3522
+ } else if (isAlipay() || isAndroid() || isIOS() && !isChrome() && !isSafari()) {
3523
+ return "YundouZfb";
3524
+ } else {
3525
+ return "distributor";
3526
+ }
3527
+ }
3528
+ const payResultCheck = () => {
3529
+ if (!state.thirdPayId) return;
4049
3530
  const $http = useHttp$2();
4050
- return new Promise((resolve, reject) => {
4051
- state.buttonLoading = true;
4052
- $http.get(endpoints$2.\u83B7\u53D6\u4F59\u989D\u660E\u7EC6, {
4053
- app: props.apps
4054
- }).then((data) => {
4055
- state.buttonLoading = false;
4056
- if (data.commonAccount < balance.value) {
4057
- showModal({
4058
- title: "\u6E29\u99A8\u63D0\u793A",
4059
- content: "\u4E91\u8C46\u4E0D\u8DB3\uFF0C\u8BF7\u5237\u65B0\u540E\u518D\u6B21\u786E\u8BA4",
4060
- showCancel: false,
4061
- confirmText: "\u5237\u65B0",
4062
- confirmColor: "#017fff",
4063
- success: () => {
4064
- balance.value = data.commonAccount;
4065
- }
4066
- });
4067
- resolve(false);
4068
- } else {
4069
- resolve(true);
4070
- }
4071
- }).catch((error) => {
4072
- state.buttonLoading = false;
4073
- resolve(false);
4074
- });
3531
+ $http.get(endpoints$1.\u83B7\u53D6\u652F\u4ED8\u7ED3\u679C, {
3532
+ thirdPayId: state.thirdPayId
3533
+ }).then((response) => {
3534
+ if (response.payStatus === "paid") {
3535
+ emit("complete", {
3536
+ result: true,
3537
+ type: "wePay"
3538
+ });
3539
+ }
4075
3540
  });
4076
- }
3541
+ };
3542
+ __expose({
3543
+ payResultCheck
3544
+ });
4077
3545
  return (_ctx, _cache) => {
4078
3546
  const _component_nut_checkbox = Checkbox;
4079
3547
  const _component_nut_button = Button;
@@ -4087,7 +3555,7 @@ var script$A = /* @__PURE__ */ defineComponent({
4087
3555
  onChange: onAmountSelect
4088
3556
  }, null, 8, ["items", "selected"]),
4089
3557
  amounts.value[state.selected] ? (openBlock(), createElementBlock("div", _hoisted_3$i, [
4090
- createElementVNode("div", _hoisted_4$f, [
3558
+ createElementVNode("div", _hoisted_4$e, [
4091
3559
  _cache[4] || (_cache[4] = createElementVNode(
4092
3560
  "div",
4093
3561
  { class: "title" },
@@ -4095,28 +3563,29 @@ var script$A = /* @__PURE__ */ defineComponent({
4095
3563
  -1
4096
3564
  /* CACHED */
4097
3565
  )),
4098
- !selectBean.value || isCombinedPayment.value ? (openBlock(), createElementBlock(
3566
+ !selectBean.value ? (openBlock(), createElementBlock(
4099
3567
  "div",
4100
- _hoisted_5$d,
4101
- " \u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value || 0)),
3568
+ _hoisted_5$c,
3569
+ "\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value || 0)),
4102
3570
  1
4103
3571
  /* TEXT */
4104
3572
  )) : (openBlock(), createElementBlock(
4105
3573
  "div",
4106
3574
  _hoisted_6$9,
4107
- " \u6263\u51CF\u540E\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3575
+ "\u6263\u51CF\u540E\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
4108
3576
  1
4109
3577
  /* TEXT */
4110
3578
  ))
4111
3579
  ]),
4112
- createElementVNode("div", {
3580
+ balance.value >= amounts.value[state.selected].paymentAmount ? (openBlock(), createElementBlock("div", {
3581
+ key: 0,
4113
3582
  class: "right",
4114
3583
  onClick: _cache[0] || (_cache[0] = ($event) => selectBean.value = !selectBean.value)
4115
3584
  }, [
4116
3585
  createElementVNode(
4117
3586
  "div",
4118
3587
  _hoisted_7$6,
4119
- " -" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3588
+ "-" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
4120
3589
  1
4121
3590
  /* TEXT */
4122
3591
  ),
@@ -4124,20 +3593,12 @@ var script$A = /* @__PURE__ */ defineComponent({
4124
3593
  class: "icon",
4125
3594
  src: selectBean.value ? "https://cdn.ddjf.com/static/images/appkit/select.svg" : "https://cdn.ddjf.com/static/images/appkit/not-select.svg"
4126
3595
  }, null, 8, _hoisted_8$5)
4127
- ]),
4128
- isCombinedPayment.value ? (openBlock(), createElementBlock(
4129
- "div",
4130
- _hoisted_9$4,
4131
- " \u4E91\u8C46\u4F59\u989D\u4E0D\u8DB3,\u8FD8\u9700\u989D\u5916\u652F\u4ED8" + toDisplayString(unref(formatAmount)(extraPaymentAmount.value)) + "\u5143 ",
4132
- 1
4133
- /* TEXT */
4134
- )) : createCommentVNode("v-if", true)
3596
+ ])) : createCommentVNode("v-if", true)
4135
3597
  ])) : createCommentVNode("v-if", true),
4136
- isCombinedPayment.value ? (openBlock(), createElementBlock("div", _hoisted_10$3, " \u8BF7\u5728\u652F\u4ED8\u5B8C\u6210\u524D\u786E\u4FDD\u5143\u8C46\u4F59\u989D\u4E0D\u88AB\u6D88\u8017,\u5426\u5219\u672C\u6B21\u6743\u76CA\u53EF\u80FD\u8D2D\u4E70\u5931\u8D25 ")) : createCommentVNode("v-if", true),
4137
3598
  renderSlot(_ctx.$slots, "banner")
4138
3599
  ]),
4139
- createElementVNode("view", _hoisted_11$3, [
4140
- !selectBean.value || isCombinedPayment.value ? (openBlock(), createElementBlock("view", _hoisted_12$3, [
3600
+ createElementVNode("view", _hoisted_9$4, [
3601
+ !selectBean.value ? (openBlock(), createElementBlock("view", _hoisted_10$3, [
4141
3602
  createVNode(_component_nut_checkbox, {
4142
3603
  modelValue: state.agreed,
4143
3604
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.agreed = $event)
@@ -4165,14 +3626,14 @@ var script$A = /* @__PURE__ */ defineComponent({
4165
3626
  /* STABLE */
4166
3627
  }, 8, ["modelValue"])
4167
3628
  ])) : createCommentVNode("v-if", true),
4168
- createElementVNode("div", _hoisted_13$2, [
4169
- createElementVNode("div", _hoisted_14$2, [
3629
+ createElementVNode("div", _hoisted_11$3, [
3630
+ createElementVNode("div", _hoisted_12$3, [
4170
3631
  _cache[8] || (_cache[8] = createTextVNode(
4171
3632
  " \u5F85\u652F\u4ED8\uFF1A ",
4172
3633
  -1
4173
3634
  /* CACHED */
4174
3635
  )),
4175
- createElementVNode("span", _hoisted_15$2, [
3636
+ createElementVNode("span", _hoisted_13$2, [
4176
3637
  _cache[7] || (_cache[7] = createElementVNode(
4177
3638
  "i",
4178
3639
  null,
@@ -4223,22 +3684,22 @@ var script$A = /* @__PURE__ */ defineComponent({
4223
3684
  [
4224
3685
  createElementVNode(
4225
3686
  "div",
4226
- _hoisted_16$2,
4227
- " \u4E91\u8C46\u6263\u51CF\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3687
+ _hoisted_14$2,
3688
+ "\u4E91\u8C46\u6263\u51CF\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
4228
3689
  1
4229
3690
  /* TEXT */
4230
3691
  ),
4231
3692
  createElementVNode(
4232
3693
  "div",
4233
- _hoisted_17$2,
4234
- " \u6743\u76CA\u589E\u52A0\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].priceRightNum || 0)) + "\u7B14 ",
3694
+ _hoisted_15$2,
3695
+ "\u6743\u76CA\u589E\u52A0\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].priceRightNum || 0)) + "\u7B14",
4235
3696
  1
4236
3697
  /* TEXT */
4237
3698
  ),
4238
3699
  createElementVNode(
4239
3700
  "div",
4240
- _hoisted_18$2,
4241
- " \u6263\u51CF\u540E\u4E91\u8C46\u4F59\u989D\uFF1A" + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3701
+ _hoisted_16$2,
3702
+ "\u6263\u51CF\u540E\u4E91\u8C46\u4F59\u989D\uFF1A" + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
4242
3703
  1
4243
3704
  /* TEXT */
4244
3705
  )
@@ -4258,7 +3719,7 @@ var script$A = /* @__PURE__ */ defineComponent({
4258
3719
  script$A.__file = "src/payment/components/TradeView.vue";
4259
3720
 
4260
3721
  const components = {
4261
- AmountPicker: script$O,
3722
+ AmountPicker: script$M,
4262
3723
  RechargeView: script$E,
4263
3724
  UserAgreement: script$D,
4264
3725
  RechargeResult: script$C,
@@ -4268,8 +3729,8 @@ const components = {
4268
3729
  const _hoisted_1$w = { class: "account-card" };
4269
3730
  const _hoisted_2$n = { class: "card" };
4270
3731
  const _hoisted_3$h = { class: "card-row" };
4271
- const _hoisted_4$e = { class: "card-row-left" };
4272
- const _hoisted_5$c = { class: "bean-nums number" };
3732
+ const _hoisted_4$d = { class: "card-row-left" };
3733
+ const _hoisted_5$b = { class: "bean-nums number" };
4273
3734
  const _hoisted_6$8 = { class: "card-row-right" };
4274
3735
  var script$z = /* @__PURE__ */ defineComponent({
4275
3736
  __name: "BalanceCard",
@@ -4316,7 +3777,7 @@ var script$z = /* @__PURE__ */ defineComponent({
4316
3777
  return openBlock(), createElementBlock("div", _hoisted_1$w, [
4317
3778
  createElementVNode("div", _hoisted_2$n, [
4318
3779
  createElementVNode("div", _hoisted_3$h, [
4319
- createElementVNode("div", _hoisted_4$e, [
3780
+ createElementVNode("div", _hoisted_4$d, [
4320
3781
  _cache[0] || (_cache[0] = createElementVNode(
4321
3782
  "div",
4322
3783
  { class: "bean-box" },
@@ -4334,7 +3795,7 @@ var script$z = /* @__PURE__ */ defineComponent({
4334
3795
  )),
4335
3796
  createElementVNode(
4336
3797
  "div",
4337
- _hoisted_5$c,
3798
+ _hoisted_5$b,
4338
3799
  toDisplayString(unref(formatAmount)(balance.value.total || 0)),
4339
3800
  1
4340
3801
  /* TEXT */
@@ -4396,8 +3857,8 @@ const consumptionDirections = ["\u5168\u90E8", "\u6536\u5165", "\u652F\u51FA"];
4396
3857
  const _hoisted_1$v = { class: "consumption-filter" };
4397
3858
  const _hoisted_2$m = { class: "consumption-filter-content" };
4398
3859
  const _hoisted_3$g = { class: "title" };
4399
- const _hoisted_4$d = { class: "info" };
4400
- const _hoisted_5$b = ["onClick"];
3860
+ const _hoisted_4$c = { class: "info" };
3861
+ const _hoisted_5$a = ["onClick"];
4401
3862
  const _hoisted_6$7 = { class: "consumption-filter-btn spa-between" };
4402
3863
  var script$y = /* @__PURE__ */ defineComponent({
4403
3864
  __name: "ConsumptionFilter",
@@ -4476,7 +3937,7 @@ var script$y = /* @__PURE__ */ defineComponent({
4476
3937
  1
4477
3938
  /* TEXT */
4478
3939
  ),
4479
- createElementVNode("div", _hoisted_4$d, [
3940
+ createElementVNode("div", _hoisted_4$c, [
4480
3941
  (openBlock(true), createElementBlock(
4481
3942
  Fragment,
4482
3943
  null,
@@ -4485,7 +3946,7 @@ var script$y = /* @__PURE__ */ defineComponent({
4485
3946
  onClick: () => onFilterSectionClick(index, it.code),
4486
3947
  class: normalizeClass([getItemClass(index, it.code), "info-item"]),
4487
3948
  key: i
4488
- }, toDisplayString(typeof it === "string" ? it : it.name), 11, _hoisted_5$b);
3949
+ }, toDisplayString(typeof it === "string" ? it : it.name), 11, _hoisted_5$a);
4489
3950
  }),
4490
3951
  128
4491
3952
  /* KEYED_FRAGMENT */
@@ -4535,7 +3996,7 @@ script$y.__file = "src/balance/components/ConsumptionFilter.vue";
4535
3996
  const _hoisted_1$u = { class: "appkit-date-filter" };
4536
3997
  const _hoisted_2$l = { class: "content" };
4537
3998
  const _hoisted_3$f = { class: "time" };
4538
- const _hoisted_4$c = { class: "buttons spa-between" };
3999
+ const _hoisted_4$b = { class: "buttons spa-between" };
4539
4000
  var script$x = /* @__PURE__ */ defineComponent({
4540
4001
  __name: "DateFilter",
4541
4002
  props: {
@@ -4658,7 +4119,7 @@ var script$x = /* @__PURE__ */ defineComponent({
4658
4119
  )
4659
4120
  ])
4660
4121
  ]),
4661
- createElementVNode("div", _hoisted_4$c, [
4122
+ createElementVNode("div", _hoisted_4$b, [
4662
4123
  createElementVNode("div", {
4663
4124
  class: "btn",
4664
4125
  onClick: reset
@@ -4834,8 +4295,8 @@ script$u.__file = "src/balance/components/Tip.vue";
4834
4295
  const _hoisted_1$q = { class: "account-view" };
4835
4296
  const _hoisted_2$k = { class: "scroll-content" };
4836
4297
  const _hoisted_3$e = { class: "row jusify-right" };
4837
- const _hoisted_4$b = { class: "balance" };
4838
- const _hoisted_5$a = { class: "bean-box spa-between" };
4298
+ const _hoisted_4$a = { class: "balance" };
4299
+ const _hoisted_5$9 = { class: "bean-box spa-between" };
4839
4300
  const _hoisted_6$6 = { class: "bean-counts spa-between" };
4840
4301
  const _hoisted_7$5 = { class: "counts number" };
4841
4302
  const _hoisted_8$4 = {
@@ -5076,7 +4537,7 @@ var script$t = /* @__PURE__ */ defineComponent({
5076
4537
  [
5077
4538
  createElementVNode("div", _hoisted_1$q, [
5078
4539
  createElementVNode("div", _hoisted_2$k, [
5079
- createVNode(unref(script$N), {
4540
+ createVNode(unref(script$L), {
5080
4541
  title: unref(Taro).getEnv() !== "WEB" ? "\u6211\u7684\u8D26\u6237" : "",
5081
4542
  class: normalizeClass({ "with-background": scrolled.value > 0 }),
5082
4543
  onClose: onPageHeaderClose
@@ -5097,8 +4558,8 @@ var script$t = /* @__PURE__ */ defineComponent({
5097
4558
  [_directive_track_click]
5098
4559
  ])
5099
4560
  ]),
5100
- createElementVNode("div", _hoisted_4$b, [
5101
- createElementVNode("div", _hoisted_5$a, [
4561
+ createElementVNode("div", _hoisted_4$a, [
4562
+ createElementVNode("div", _hoisted_5$9, [
5102
4563
  _cache[9] || (_cache[9] = createElementVNode(
5103
4564
  "div",
5104
4565
  { class: "bean-img" },
@@ -5381,7 +4842,7 @@ var script$t = /* @__PURE__ */ defineComponent({
5381
4842
  _: 1
5382
4843
  /* STABLE */
5383
4844
  }, 8, ["visible"]),
5384
- createVNode(unref(script$M), {
4845
+ createVNode(unref(script$K), {
5385
4846
  modelValue: secondBalanceOpen.value,
5386
4847
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => secondBalanceOpen.value = $event),
5387
4848
  title: "\u6536\u652F\u660E\u7EC6"
@@ -5571,8 +5032,8 @@ script$t.__file = "src/balance/components/AccountView.vue";
5571
5032
  const _hoisted_1$p = { class: "balance-reminder" };
5572
5033
  const _hoisted_2$j = { class: "body" };
5573
5034
  const _hoisted_3$d = { class: "footer" };
5574
- const _hoisted_4$a = { class: "col" };
5575
- const _hoisted_5$9 = { class: "col" };
5035
+ const _hoisted_4$9 = { class: "col" };
5036
+ const _hoisted_5$8 = { class: "col" };
5576
5037
  var script$s = /* @__PURE__ */ defineComponent({
5577
5038
  __name: "BalanceReminder",
5578
5039
  props: {
@@ -5613,7 +5074,7 @@ var script$s = /* @__PURE__ */ defineComponent({
5613
5074
  )
5614
5075
  ]),
5615
5076
  createElementVNode("div", _hoisted_3$d, [
5616
- createElementVNode("div", _hoisted_4$a, [
5077
+ createElementVNode("div", _hoisted_4$9, [
5617
5078
  createVNode(_component_nut_button, {
5618
5079
  class: "cancel-button",
5619
5080
  onClick: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", false)),
@@ -5630,7 +5091,7 @@ var script$s = /* @__PURE__ */ defineComponent({
5630
5091
  /* STABLE */
5631
5092
  })
5632
5093
  ]),
5633
- createElementVNode("div", _hoisted_5$9, [
5094
+ createElementVNode("div", _hoisted_5$8, [
5634
5095
  withDirectives((openBlock(), createBlock(_component_nut_button, {
5635
5096
  block: "",
5636
5097
  class: "recharge-button",
@@ -5768,8 +5229,8 @@ script$r.__file = "src/balance/components/DateRange.vue";
5768
5229
  const _hoisted_1$n = { class: "list-filter-picker" };
5769
5230
  const _hoisted_2$i = { class: "list-filter-picker-content" };
5770
5231
  const _hoisted_3$c = { class: "title" };
5771
- const _hoisted_4$9 = { class: "info" };
5772
- const _hoisted_5$8 = ["onClick"];
5232
+ const _hoisted_4$8 = { class: "info" };
5233
+ const _hoisted_5$7 = ["onClick"];
5773
5234
  const _hoisted_6$5 = { class: "list-filter-picker-btn spa-between" };
5774
5235
  var script$q = /* @__PURE__ */ defineComponent({
5775
5236
  __name: "ListFilterPicker",
@@ -5846,7 +5307,7 @@ var script$q = /* @__PURE__ */ defineComponent({
5846
5307
  1
5847
5308
  /* TEXT */
5848
5309
  ),
5849
- createElementVNode("div", _hoisted_4$9, [
5310
+ createElementVNode("div", _hoisted_4$8, [
5850
5311
  (openBlock(true), createElementBlock(
5851
5312
  Fragment,
5852
5313
  null,
@@ -5855,7 +5316,7 @@ var script$q = /* @__PURE__ */ defineComponent({
5855
5316
  onClick: () => onFilterSectionClick(item.name, it.value),
5856
5317
  class: normalizeClass([getItemClass(item.name, it.value), "info-item"]),
5857
5318
  key: i
5858
- }, toDisplayString(typeof it === "string" ? it : it.label), 11, _hoisted_5$8);
5319
+ }, toDisplayString(typeof it === "string" ? it : it.label), 11, _hoisted_5$7);
5859
5320
  }),
5860
5321
  128
5861
5322
  /* KEYED_FRAGMENT */
@@ -5971,8 +5432,8 @@ const _hoisted_1$m = {
5971
5432
  };
5972
5433
  const _hoisted_2$h = { class: "promoter-card-hd-num number" };
5973
5434
  const _hoisted_3$b = ["src"];
5974
- const _hoisted_4$8 = { class: "promoter-card-ft" };
5975
- const _hoisted_5$7 = {
5435
+ const _hoisted_4$7 = { class: "promoter-card-ft" };
5436
+ const _hoisted_5$6 = {
5976
5437
  key: 0,
5977
5438
  class: "promoter-card-ft-item"
5978
5439
  };
@@ -6068,7 +5529,6 @@ var script$o = /* @__PURE__ */ defineComponent({
6068
5529
  showModal({
6069
5530
  content: toastMap[type],
6070
5531
  showCancel: false,
6071
- confirmColor: "#017fff",
6072
5532
  confirmText: "\u77E5\u9053\u4E86"
6073
5533
  });
6074
5534
  }
@@ -6131,8 +5591,8 @@ var script$o = /* @__PURE__ */ defineComponent({
6131
5591
  ])), [
6132
5592
  [_directive_track_click]
6133
5593
  ]) : createCommentVNode("v-if", true),
6134
- createElementVNode("div", _hoisted_4$8, [
6135
- __props.applyRecord.accessCheckStatus === "Y" ? (openBlock(), createElementBlock("div", _hoisted_5$7, [
5594
+ createElementVNode("div", _hoisted_4$7, [
5595
+ __props.applyRecord.accessCheckStatus === "Y" ? (openBlock(), createElementBlock("div", _hoisted_5$6, [
6136
5596
  __props.\u663E\u793A\u4E0B\u7EA7\u5206\u9500\u5546 ? (openBlock(), createElementBlock(
6137
5597
  Fragment,
6138
5598
  { key: 0 },
@@ -6574,8 +6034,8 @@ script$l.__file = "src/components/dd-selector/index.vue";
6574
6034
  const _hoisted_1$j = { class: "self-registration" };
6575
6035
  const _hoisted_2$f = { class: "self-registration-body" };
6576
6036
  const _hoisted_3$a = ["src"];
6577
- const _hoisted_4$7 = { class: "self-registration__input" };
6578
- const _hoisted_5$6 = { class: "self-registration-bottom" };
6037
+ const _hoisted_4$6 = { class: "self-registration__input" };
6038
+ const _hoisted_5$5 = { class: "self-registration-bottom" };
6579
6039
  var script$k = /* @__PURE__ */ defineComponent({
6580
6040
  __name: "SelfRegistration",
6581
6041
  props: {
@@ -6735,7 +6195,7 @@ var script$k = /* @__PURE__ */ defineComponent({
6735
6195
  required: ""
6736
6196
  }, {
6737
6197
  default: withCtx(() => [
6738
- createElementVNode("div", _hoisted_4$7, [
6198
+ createElementVNode("div", _hoisted_4$6, [
6739
6199
  withDirectives(createElementVNode(
6740
6200
  "input",
6741
6201
  {
@@ -6751,10 +6211,7 @@ var script$k = /* @__PURE__ */ defineComponent({
6751
6211
  ), [
6752
6212
  [vModelText, formState.name]
6753
6213
  ]),
6754
- createVNode(script$I, {
6755
- "has-upload-vo": false,
6756
- onComplete: onOCRInfo
6757
- }, {
6214
+ createVNode(script$G, { onComplete: onOCRInfo }, {
6758
6215
  icon: withCtx(() => [..._cache[9] || (_cache[9] = [
6759
6216
  createElementVNode(
6760
6217
  "img",
@@ -6889,7 +6346,7 @@ var script$k = /* @__PURE__ */ defineComponent({
6889
6346
  /* STABLE */
6890
6347
  })
6891
6348
  ]),
6892
- createElementVNode("div", _hoisted_5$6, [
6349
+ createElementVNode("div", _hoisted_5$5, [
6893
6350
  withDirectives((openBlock(), createBlock(_component_nut_button, {
6894
6351
  block: "",
6895
6352
  type: "primary",
@@ -7011,7 +6468,7 @@ function useHttp$1() {
7011
6468
  const headers = {
7012
6469
  Token: appkitOptions.tempToken() || appkitOptions.token(),
7013
6470
  Appcode: appkitOptions.app(),
7014
- tid: appkitOptions.tenant(),
6471
+ cookie: `tid=${appkitOptions.tenant()}`,
7015
6472
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
7016
6473
  };
7017
6474
  const $http = createHttp({
@@ -7325,7 +6782,7 @@ var script$i = /* @__PURE__ */ defineComponent({
7325
6782
  Fragment,
7326
6783
  null,
7327
6784
  renderList(bannerMessages.value, (item, key) => {
7328
- return withDirectives((openBlock(), createBlock(script$K, {
6785
+ return withDirectives((openBlock(), createBlock(script$I, {
7329
6786
  class: normalizeClass({ show: key === activeKey.value }),
7330
6787
  key,
7331
6788
  showClose: item.noticeType === 0,
@@ -7596,8 +7053,7 @@ function useCommonList(api, query, loading = true, method = "GET") {
7596
7053
  const isLoading = ref(false);
7597
7054
  async function fetchData(loading2) {
7598
7055
  loading2 && showLoading({
7599
- title: "\u52A0\u8F7D\u4E2D...",
7600
- mask: true
7056
+ title: "\u52A0\u8F7D\u4E2D..."
7601
7057
  });
7602
7058
  isLoading.value = true;
7603
7059
  const $http = useHttp$1();
@@ -7654,8 +7110,8 @@ const _hoisted_3$7 = {
7654
7110
  key: 0,
7655
7111
  class: "wrapper"
7656
7112
  };
7657
- const _hoisted_4$6 = ["onClick"];
7658
- const _hoisted_5$5 = { class: "time" };
7113
+ const _hoisted_4$5 = ["onClick"];
7114
+ const _hoisted_5$4 = { class: "time" };
7659
7115
  const _hoisted_6$3 = {
7660
7116
  key: 0,
7661
7117
  class: "notice-list-label"
@@ -7788,7 +7244,7 @@ var script$f = /* @__PURE__ */ defineComponent({
7788
7244
  createElementVNode("div", null, [
7789
7245
  createElementVNode(
7790
7246
  "div",
7791
- _hoisted_5$5,
7247
+ _hoisted_5$4,
7792
7248
  toDisplayString(formatMinutes(item.receiveTime)),
7793
7249
  1
7794
7250
  /* TEXT */
@@ -7845,7 +7301,7 @@ var script$f = /* @__PURE__ */ defineComponent({
7845
7301
  /* CLASS */
7846
7302
  )
7847
7303
  ])
7848
- ], 10, _hoisted_4$6)), [
7304
+ ], 10, _hoisted_4$5)), [
7849
7305
  [_directive_track_click, "\u6D88\u606F\u8BE6\u60C5"]
7850
7306
  ]);
7851
7307
  }),
@@ -7887,21 +7343,16 @@ var script$f = /* @__PURE__ */ defineComponent({
7887
7343
 
7888
7344
  script$f.__file = "src/notice/components/NoticeList.vue";
7889
7345
 
7890
- const _hoisted_1$d = ["onClick"];
7891
- const _hoisted_2$9 = {
7892
- key: 0,
7893
- class: "custom-title-dot"
7894
- };
7895
- const _hoisted_3$6 = {
7346
+ const _hoisted_1$d = {
7896
7347
  key: 0,
7897
7348
  class: "read-all"
7898
7349
  };
7899
- const _hoisted_4$5 = {
7350
+ const _hoisted_2$9 = {
7900
7351
  key: 0,
7901
7352
  class: "news-item-title-icon",
7902
- src: "https://cdn.ddjf.com/static/images/fnfundkit/ic_msg_system_notice.png"
7353
+ src: "https://cdn.ddjf.com/static/images/loan-manage-app/ic_msg_system_notice.webp"
7903
7354
  };
7904
- const _hoisted_5$4 = { class: "news-item-time" };
7355
+ const _hoisted_3$6 = { class: "news-item-time" };
7905
7356
  var script$e = /* @__PURE__ */ defineComponent({
7906
7357
  __name: "NoticeList2",
7907
7358
  props: {
@@ -7912,28 +7363,9 @@ var script$e = /* @__PURE__ */ defineComponent({
7912
7363
  emits: ["itemClick"],
7913
7364
  setup(__props, { expose: __expose, emit: __emit }) {
7914
7365
  const props = __props;
7915
- const tabList = ref([
7916
- {
7917
- label: "\u5168\u90E8",
7918
- value: "\u5168\u90E8"
7919
- },
7920
- {
7921
- label: "\u4E1A\u52A1\u6D88\u606F",
7922
- value: "\u4E1A\u52A1\u6D88\u606F"
7923
- },
7924
- {
7925
- label: "\u7CFB\u7EDF\u516C\u544A",
7926
- value: "\u7CFB\u7EDF\u516C\u544A"
7927
- },
7928
- {
7929
- label: "\u672A\u8BFB",
7930
- value: "\u672A\u8BFB"
7931
- }
7932
- ]);
7933
7366
  const $http = useHttp$1(), \u663E\u793A\u9AA8\u67B6\u5C4F = ref(true);
7934
7367
  useDidShow(() => {
7935
7368
  nextPage(1);
7936
- getNotice();
7937
7369
  });
7938
7370
  const state = reactive({
7939
7371
  search: "",
@@ -7986,7 +7418,6 @@ var script$e = /* @__PURE__ */ defineComponent({
7986
7418
  }
7987
7419
  function itemClick(item) {
7988
7420
  read(item);
7989
- getNotice();
7990
7421
  emits("itemClick", item);
7991
7422
  }
7992
7423
  function read(item) {
@@ -7999,8 +7430,7 @@ var script$e = /* @__PURE__ */ defineComponent({
7999
7430
  async function readAll() {
8000
7431
  try {
8001
7432
  showLoading({
8002
- title: "\u8BF7\u7A0D\u540E...",
8003
- mask: true
7433
+ title: "\u8BF7\u7A0D\u540E..."
8004
7434
  });
8005
7435
  const appkitOptions = useAppKitOptions();
8006
7436
  const ep = endpoints["\u5168\u90E8\u5DF2\u8BFB"];
@@ -8015,26 +7445,9 @@ var script$e = /* @__PURE__ */ defineComponent({
8015
7445
  });
8016
7446
  });
8017
7447
  } finally {
8018
- setTimeout(() => {
8019
- getNotice();
8020
- }, 300);
8021
7448
  hideLoading();
8022
7449
  }
8023
7450
  }
8024
- const noticeShow = ref(false);
8025
- async function getNotice() {
8026
- const appkitOptions = useAppKitOptions();
8027
- const $http2 = useHttp$1();
8028
- $http2.get("/cas/msg/count-unread", {
8029
- deviceType: 2,
8030
- appCode: props.app,
8031
- tenantId: appkitOptions.tenant(),
8032
- userId: props.userId
8033
- }).then((result) => {
8034
- if (typeof result === "object") return;
8035
- noticeShow.value = result > 0;
8036
- });
8037
- }
8038
7451
  const emits = __emit;
8039
7452
  __expose({
8040
7453
  readAll
@@ -8050,7 +7463,7 @@ var script$e = /* @__PURE__ */ defineComponent({
8050
7463
  class: normalizeClass(["tabContainer", { inH5: unref(isWeb)() }])
8051
7464
  },
8052
7465
  [
8053
- createCommentVNode(' <ns-tabs\n v-model="state.tab"\n fill="#fff"\n square\n size="xl"\n style="height: 46px"\n @change="onTabChange"\n >\n <ns-tabs-item key="\u5168\u90E8" tab="\u5168\u90E8"></ns-tabs-item>\n <ns-tabs-item key="\u4E1A\u52A1\u6D88\u606F" tab="\u4E1A\u52A1\u6D88\u606F"></ns-tabs-item>\n <ns-tabs-item key="\u7CFB\u7EDF\u516C\u544A" tab="\u7CFB\u7EDF\u516C\u544A"></ns-tabs-item>\n <ns-tabs-item key="\u672A\u8BFB" tab="\u672A\u8BFB"></ns-tabs-item>\n </ns-tabs> '),
7466
+ createCommentVNode(' <ns-search\n v-track-search="{\n trackInput: false,\n trackSubmit: true,\n minLength: 2,\n }"\n style="margin: 0 12px"\n placeholder="\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22"\n v-model="state.search"\n ></ns-search> '),
8054
7467
  createVNode(unref(NsTabs), {
8055
7468
  modelValue: state.tab,
8056
7469
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.tab = $event),
@@ -8058,50 +7471,30 @@ var script$e = /* @__PURE__ */ defineComponent({
8058
7471
  square: "",
8059
7472
  size: "xl",
8060
7473
  style: { "height": "46px" },
8061
- class: "news-tab",
8062
- items: tabList.value
7474
+ onChange: onTabChange
8063
7475
  }, {
8064
- titles: withCtx(() => [
8065
- (openBlock(true), createElementBlock(
8066
- Fragment,
8067
- null,
8068
- renderList(tabList.value, (item) => {
8069
- return openBlock(), createElementBlock("div", {
8070
- class: normalizeClass([{ customLine: state.tab === item.value }, "nut-tabs__titles-item custom-tab-item"]),
8071
- key: item.value,
8072
- onClick: ($event) => {
8073
- state.tab = item.value;
8074
- onTabChange();
8075
- }
8076
- }, [
8077
- createElementVNode(
8078
- "div",
8079
- {
8080
- class: normalizeClass(["custom-title", { active: state.tab === item.value }])
8081
- },
8082
- [
8083
- createElementVNode(
8084
- "div",
8085
- null,
8086
- toDisplayString(item.label),
8087
- 1
8088
- /* TEXT */
8089
- ),
8090
- item.value === "\u672A\u8BFB" && noticeShow.value ? (openBlock(), createElementBlock("div", _hoisted_2$9, " \u2022\u2022\u2022 ")) : createCommentVNode("v-if", true)
8091
- ],
8092
- 2
8093
- /* CLASS */
8094
- )
8095
- ], 10, _hoisted_1$d);
8096
- }),
8097
- 128
8098
- /* KEYED_FRAGMENT */
8099
- ))
7476
+ default: withCtx(() => [
7477
+ createVNode(unref(NsTabsItem), {
7478
+ key: "\u5168\u90E8",
7479
+ tab: "\u5168\u90E8"
7480
+ }),
7481
+ createVNode(unref(NsTabsItem), {
7482
+ key: "\u4E1A\u52A1\u6D88\u606F",
7483
+ tab: "\u4E1A\u52A1\u6D88\u606F"
7484
+ }),
7485
+ createVNode(unref(NsTabsItem), {
7486
+ key: "\u7CFB\u7EDF\u516C\u544A",
7487
+ tab: "\u7CFB\u7EDF\u516C\u544A"
7488
+ }),
7489
+ createVNode(unref(NsTabsItem), {
7490
+ key: "\u672A\u8BFB",
7491
+ tab: "\u672A\u8BFB"
7492
+ })
8100
7493
  ]),
8101
7494
  _: 1
8102
7495
  /* STABLE */
8103
- }, 8, ["modelValue", "items"]),
8104
- state.list.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
7496
+ }, 8, ["modelValue"]),
7497
+ state.list.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
8105
7498
  withDirectives((openBlock(), createElementBlock("div", {
8106
7499
  class: "btn",
8107
7500
  onClick: readAll
@@ -8158,7 +7551,7 @@ var script$e = /* @__PURE__ */ defineComponent({
8158
7551
  class: "news-item-title"
8159
7552
  },
8160
7553
  [
8161
- item.\u662F\u516C\u544A ? (openBlock(), createElementBlock("img", _hoisted_4$5)) : createCommentVNode("v-if", true),
7554
+ item.\u662F\u516C\u544A ? (openBlock(), createElementBlock("img", _hoisted_2$9)) : createCommentVNode("v-if", true),
8162
7555
  createTextVNode(
8163
7556
  " " + toDisplayString(item.\u6807\u9898),
8164
7557
  1
@@ -8179,7 +7572,7 @@ var script$e = /* @__PURE__ */ defineComponent({
8179
7572
  }, null, 8, ["style", "content"]),
8180
7573
  createElementVNode(
8181
7574
  "div",
8182
- _hoisted_5$4,
7575
+ _hoisted_3$6,
8183
7576
  toDisplayString(item.\u65F6\u95F4),
8184
7577
  1
8185
7578
  /* TEXT */
@@ -8460,7 +7853,7 @@ function useHttp() {
8460
7853
  const headers = {
8461
7854
  Token: appkitOptions.tempToken() || appkitOptions.token(),
8462
7855
  Appcode: appkitOptions.app(),
8463
- tid: appkitOptions.tenant(),
7856
+ cookie: `tid=${appkitOptions.tenant()}`,
8464
7857
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
8465
7858
  };
8466
7859
  const $http = createHttp({
@@ -8636,8 +8029,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8636
8029
  }
8637
8030
  async function updateImage(filePath) {
8638
8031
  showLoading({
8639
- title: "\u4E0A\u4F20\u4E2D...",
8640
- mask: true
8032
+ title: "\u4E0A\u4F20\u4E2D..."
8641
8033
  });
8642
8034
  const appkitOptions = useAppKitOptions();
8643
8035
  const $http = useHttp();
@@ -8750,7 +8142,6 @@ var script$b = /* @__PURE__ */ defineComponent({
8750
8142
  title: "\u63D0\u793A",
8751
8143
  content: "\u786E\u5B9A\u8981\u9000\u51FA\u767B\u5F55\u5417\uFF1F",
8752
8144
  confirmText: "\u786E\u5B9A",
8753
- confirmColor: "#017fff",
8754
8145
  success: async (e) => {
8755
8146
  if (e.confirm) {
8756
8147
  emits("logout");
@@ -10614,8 +10005,7 @@ var script$6 = /* @__PURE__ */ defineComponent({
10614
10005
  const $http = useHttp();
10615
10006
  const appkitOptions = useAppKitOptions();
10616
10007
  showLoading({
10617
- title: "\u53CD\u9988\u4E2D...",
10618
- mask: true
10008
+ title: "\u53CD\u9988\u4E2D..."
10619
10009
  });
10620
10010
  const attachment = JSON.parse(
10621
10011
  JSON.stringify(
@@ -11325,9 +10715,8 @@ var script$2 = /* @__PURE__ */ defineComponent({
11325
10715
  rules: ["required"]
11326
10716
  }, {
11327
10717
  append: withCtx(() => [
11328
- !\u5DF2\u8BA4\u8BC1.value ? (openBlock(), createBlock(unref(script$I), {
10718
+ !\u5DF2\u8BA4\u8BC1.value ? (openBlock(), createBlock(unref(script$G), {
11329
10719
  key: 0,
11330
- "has-upload-vo": false,
11331
10720
  onComplete: onOcrComplete
11332
10721
  })) : createCommentVNode("v-if", true)
11333
10722
  ]),
@@ -11936,4 +11325,4 @@ const AppKit = {
11936
11325
  }
11937
11326
  };
11938
11327
 
11939
- export { script$t as AccountView, script$O as AmountPicker, script$M as AppDrawer, script$L as AppVerify, script$z as BalanceCard, script$s as BalanceReminder, script$r as DateRange, script$J as DeviceVersion, script$p as ListFilter, script$4 as LoginSetting, script$i as NoticeBanner, script$h as NoticeEntry, script$f as NoticeList, script$e as NoticeList2, script$H as OcrBank, script$G as OcrBusinessLicense, script$I as OcrIcon, script$F as OcrInvoice, script$N as PageHeader, script$o as PromoterCard, script$C as RechargeResult, script$E as RechargeView, script$k as SelfRegistration, script as SharePoster, script$A as TradeView, script$D as UserAgreement, script$2 as UserAuth, script$a as UserBinding, script$9 as UserBindingSuccess, script$d as UserEntry, script$6 as UserFeedback, script$5 as UserFeedbackEntry, script$7 as UserHeadCrop, script$b as UserInfo, script$3 as UserResourceEmpty, components, compressImage, compressImageWithCanvas, createHttp, AppKit as default, defaultCryptoConfig, generateUniqueId, getCompressQuality, getSdkConfig, initTracking, installTrackingPlugin, jssdkServices, requestPayment$2 as requestPayment, requestWxH5Pay, services$1 as services, trackingSDK, useAppKit, useCountdown, useCrypto, useEncode, useLogger, usePageTracking, useSafeArea, useTabbar, useUpload, useValidator, useWxAuth };
11328
+ export { script$t as AccountView, script$M as AmountPicker, script$K as AppDrawer, script$J as AppVerify, script$z as BalanceCard, script$s as BalanceReminder, script$r as DateRange, script$H as DeviceVersion, script$p as ListFilter, script$4 as LoginSetting, script$i as NoticeBanner, script$h as NoticeEntry, script$f as NoticeList, script$e as NoticeList2, script$F as OcrBusinessLicense, script$G as OcrIcon, script$L as PageHeader, script$o as PromoterCard, script$C as RechargeResult, script$E as RechargeView, script$k as SelfRegistration, script as SharePoster, script$A as TradeView, script$D as UserAgreement, script$2 as UserAuth, script$a as UserBinding, script$9 as UserBindingSuccess, script$d as UserEntry, script$6 as UserFeedback, script$5 as UserFeedbackEntry, script$7 as UserHeadCrop, script$b as UserInfo, script$3 as UserResourceEmpty, components, createHttp, AppKit as default, defaultCryptoConfig, generateUniqueId, getSdkConfig, initTracking, installTrackingPlugin, jssdkServices, requestPayment$2 as requestPayment, requestWxH5Pay, services$1 as services, trackingSDK, useAppKit, useCountdown, useCrypto, useEncode, useLogger, usePageTracking, useSafeArea, useTabbar, useUpload, useValidator, useWxAuth };