@uxda/appkit 4.3.15 → 4.3.17

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 (32) hide show
  1. package/dist/appkit.css +105 -12
  2. package/dist/index.js +1110 -414
  3. package/package.json +2 -5
  4. package/src/balance/api/index.ts +2 -2
  5. package/src/balance/components/PromoterCard.vue +1 -0
  6. package/src/notice/api/index.ts +2 -2
  7. package/src/notice/components/NoticeList2.vue +234 -73
  8. package/src/notice/components/useCommonList.ts +1 -0
  9. package/src/payment/api/endpoints.ts +2 -0
  10. package/src/payment/api/index.ts +4 -2
  11. package/src/payment/components/RechargeResult.vue +0 -1
  12. package/src/payment/components/TradeView.vue +313 -108
  13. package/src/payment/services/request-payment.ts +9 -3
  14. package/src/payment/types.ts +1 -0
  15. package/src/register/components/SelfRegistration.vue +1 -1
  16. package/src/shared/components/AppVerify.vue +15 -6
  17. package/src/shared/components/OcrBank.vue +202 -0
  18. package/src/shared/components/OcrBusinessLicense.vue +20 -37
  19. package/src/shared/components/OcrIcon.vue +105 -67
  20. package/src/shared/components/OcrInvoice.vue +322 -0
  21. package/src/shared/components/index.ts +3 -1
  22. package/src/shared/composables/index.ts +1 -0
  23. package/src/shared/composables/useCompress.ts +64 -0
  24. package/src/shared/composables/useUpload.ts +96 -51
  25. package/src/shared/http/Http.ts +1 -0
  26. package/src/shared/tracking/tracking-sdk.ts +0 -1
  27. package/src/shared/weixin/jssdk.ts +1 -0
  28. package/src/user/api/index.ts +2 -2
  29. package/src/user/components/UserAuth.vue +1 -1
  30. package/src/user/components/UserFeedback.vue +1 -0
  31. package/src/user/components/UserInfo.vue +2 -0
  32. package/types/global.d.ts +2 -0
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, 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';
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';
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, NsIcon, usePopup, useNutshell, NsButtonGroup, usePaging, NsPage, NsTabs, NsTabsItem, NsPageContent, NsSkeleton, NsRepeator, NsCard, NsEmpty, NsCheckbox } from '@uxda/nutshell/taro';
12
+ import { NsForm, NsInput, NsButton, useNutshell, NsIcon, usePopup, NsButtonGroup, usePaging, NsPage, NsTabs, 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$M = /* @__PURE__ */ defineComponent({
37
+ var script$O = /* @__PURE__ */ defineComponent({
38
38
  __name: "AmountPicker",
39
39
  props: {
40
40
  items: { type: Array, required: true, default: () => [] },
@@ -107,7 +107,7 @@ var script$M = /* @__PURE__ */ defineComponent({
107
107
  }
108
108
  });
109
109
 
110
- script$M.__file = "src/payment/components/AmountPicker.vue";
110
+ script$O.__file = "src/payment/components/AmountPicker.vue";
111
111
 
112
112
  const getSdkConfig = (appCode, url) => {
113
113
  return new Promise((resolve, reject) => {
@@ -128,6 +128,7 @@ 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",
131
132
  success: () => {
132
133
  }
133
134
  });
@@ -310,71 +311,84 @@ function useEncode() {
310
311
  };
311
312
  }
312
313
 
313
- const globalData = {};
314
-
315
- const appKitOptions = {
316
- app: () => "",
317
- tenant: () => "",
318
- token: () => "",
319
- tempToken: () => "",
320
- baseUrl: () => "",
321
- 401() {
322
- },
323
- gray: () => ""
324
- };
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]));
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
+ });
343
359
  };
344
- const useUpload = (config) => {
345
- const appkitOptions = useAppKitOptions();
346
- const upload = (url, file) => {
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 {
347
370
  return new Promise((resolve, reject) => {
348
- uploadFile({
349
- url: config.baseUrl + url,
350
- filePath: file.path,
351
- name: "file",
352
- formData: {
353
- objectNo: `min${Date.now()}`
354
- },
355
- header: {
356
- ...config.headers,
357
- token: appkitOptions.tempToken() || appkitOptions.token()
371
+ Taro.compressImage({
372
+ src,
373
+ quality,
374
+ success: (res) => {
375
+ resolve(res);
358
376
  },
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
- }
377
+ fail: (res) => {
378
+ reject(res);
370
379
  }
371
380
  });
372
381
  });
373
- };
374
- return {
375
- upload
376
- };
377
- };
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
+ }
378
392
 
379
393
  const defaultCryptoConfig = {
380
394
  maskField: "mask",
@@ -415,6 +429,25 @@ function useCrypto(config) {
415
429
  };
416
430
  }
417
431
 
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
+
418
451
  const defaultLogOptions = {
419
452
  projectName: "ddyk-dev",
420
453
  logStore: "ddjf-internet-web",
@@ -548,11 +581,59 @@ function useWxAuth() {
548
581
  };
549
582
  }
550
583
 
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
+
551
632
  const _hoisted_1$F = {
552
633
  key: 0,
553
634
  class: "page-title"
554
635
  };
555
- var script$L = /* @__PURE__ */ defineComponent({
636
+ var script$N = /* @__PURE__ */ defineComponent({
556
637
  __name: "PageHeader",
557
638
  props: {
558
639
  title: { type: String, required: false, default: "" },
@@ -609,10 +690,10 @@ var script$L = /* @__PURE__ */ defineComponent({
609
690
  }
610
691
  });
611
692
 
612
- script$L.__file = "src/shared/components/PageHeader.vue";
693
+ script$N.__file = "src/shared/components/PageHeader.vue";
613
694
 
614
695
  const _hoisted_1$E = { class: "drawer-body" };
615
- var script$K = /* @__PURE__ */ defineComponent({
696
+ var script$M = /* @__PURE__ */ defineComponent({
616
697
  __name: "AppDrawer",
617
698
  props: {
618
699
  modelValue: { type: Boolean, required: true },
@@ -636,7 +717,7 @@ var script$K = /* @__PURE__ */ defineComponent({
636
717
  "onUpdate:visible": onVisibleChange
637
718
  }, {
638
719
  default: withCtx(() => [
639
- createVNode(script$L, {
720
+ createVNode(script$N, {
640
721
  title: __props.title,
641
722
  style: normalizeStyle(unref(Taro).getEnv() !== "WEB" ? "" : "--height: 40px"),
642
723
  onClose: onPageHeaderClose
@@ -652,18 +733,18 @@ var script$K = /* @__PURE__ */ defineComponent({
652
733
  }
653
734
  });
654
735
 
655
- script$K.__file = "src/shared/components/AppDrawer.vue";
736
+ script$M.__file = "src/shared/components/AppDrawer.vue";
656
737
 
657
738
  const _hoisted_1$D = { class: "app-verify column" };
658
739
  const _hoisted_2$s = { class: "caption" };
659
740
  const _hoisted_3$m = { class: "number" };
660
- const _hoisted_4$h = { class: "form-btn" };
661
- const _hoisted_5$d = {
741
+ const _hoisted_4$i = { class: "form-btn" };
742
+ const _hoisted_5$e = {
662
743
  key: 1,
663
744
  class: "caption"
664
745
  };
665
746
  const _hoisted_6$a = { class: "row buttons" };
666
- var script$J = /* @__PURE__ */ defineComponent({
747
+ var script$L = /* @__PURE__ */ defineComponent({
667
748
  __name: "AppVerify",
668
749
  props: {
669
750
  phone: { type: String, required: true },
@@ -738,7 +819,7 @@ var script$J = /* @__PURE__ */ defineComponent({
738
819
  method: (value) => value.length === 6
739
820
  }]
740
821
  }, null, 8, ["modelValue", "rules"]),
741
- createElementVNode("div", _hoisted_4$h, [
822
+ createElementVNode("div", _hoisted_4$i, [
742
823
  !sent.value ? withDirectives((openBlock(), createBlock(
743
824
  unref(NsButton),
744
825
  {
@@ -757,7 +838,7 @@ var script$J = /* @__PURE__ */ defineComponent({
757
838
  ]) : createCommentVNode("v-if", true),
758
839
  sent.value ? (openBlock(), createElementBlock(
759
840
  "div",
760
- _hoisted_5$d,
841
+ _hoisted_5$e,
761
842
  toDisplayString(countdown.value) + "s\u540E\u91CD\u65B0\u53D1\u9001",
762
843
  1
763
844
  /* TEXT */
@@ -770,6 +851,7 @@ var script$J = /* @__PURE__ */ defineComponent({
770
851
  createElementVNode("div", _hoisted_6$a, [
771
852
  withDirectives((openBlock(), createBlock(unref(NsButton), {
772
853
  class: "cancel-btn",
854
+ r: 20,
773
855
  onClick: _cache[2] || (_cache[2] = ($event) => emits("cancel"))
774
856
  }, {
775
857
  default: withCtx(() => [..._cache[3] || (_cache[3] = [
@@ -786,6 +868,7 @@ var script$J = /* @__PURE__ */ defineComponent({
786
868
  ]),
787
869
  withDirectives((openBlock(), createBlock(unref(NsButton), {
788
870
  color: "primary",
871
+ r: 20,
789
872
  onClick: onOk
790
873
  }, {
791
874
  default: withCtx(() => [..._cache[4] || (_cache[4] = [
@@ -806,10 +889,10 @@ var script$J = /* @__PURE__ */ defineComponent({
806
889
  }
807
890
  });
808
891
 
809
- script$J.__file = "src/shared/components/AppVerify.vue";
892
+ script$L.__file = "src/shared/components/AppVerify.vue";
810
893
 
811
894
  const _hoisted_1$C = { key: 0 };
812
- var script$I = /* @__PURE__ */ defineComponent({
895
+ var script$K = /* @__PURE__ */ defineComponent({
813
896
  __name: "index",
814
897
  props: {
815
898
  text: { type: String, required: false },
@@ -876,7 +959,7 @@ var script$I = /* @__PURE__ */ defineComponent({
876
959
  }
877
960
  });
878
961
 
879
- script$I.__file = "src/components/dd-notice-bar/index.vue";
962
+ script$K.__file = "src/components/dd-notice-bar/index.vue";
880
963
 
881
964
  const typeMappings = {
882
965
  CZ: "\u5145\u503C",
@@ -1016,7 +1099,7 @@ const vendor$3 = {
1016
1099
  traceId: header.traceId,
1017
1100
  duration: endTime - startTime
1018
1101
  });
1019
- if (data.success) {
1102
+ if (data.success || data.code === "401") {
1020
1103
  resolve({
1021
1104
  status: +data.code,
1022
1105
  message: data.msg,
@@ -1039,7 +1122,7 @@ function useHttp$3() {
1039
1122
  const headers = {
1040
1123
  Token: appkitOptions.tempToken() || appkitOptions.token(),
1041
1124
  Appcode: appkitOptions.app(),
1042
- cookie: `tid=${appkitOptions.tenant()}`,
1125
+ tid: appkitOptions.tenant(),
1043
1126
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
1044
1127
  };
1045
1128
  const $http = createHttp({
@@ -1081,7 +1164,7 @@ function useHttp$3() {
1081
1164
  return $http;
1082
1165
  }
1083
1166
 
1084
- var script$H = /* @__PURE__ */ defineComponent({
1167
+ var script$J = /* @__PURE__ */ defineComponent({
1085
1168
  __name: "DeviceVersion",
1086
1169
  props: {
1087
1170
  versions: { type: String, required: false, default: "{}" }
@@ -1128,7 +1211,7 @@ var script$H = /* @__PURE__ */ defineComponent({
1128
1211
  }
1129
1212
  });
1130
1213
  return (_ctx, _cache) => {
1131
- return showAlert.value ? (openBlock(), createBlock(script$I, {
1214
+ return showAlert.value ? (openBlock(), createBlock(script$K, {
1132
1215
  key: 0,
1133
1216
  showClose: "",
1134
1217
  style: normalizeStyle(topStype.value),
@@ -1139,102 +1222,83 @@ var script$H = /* @__PURE__ */ defineComponent({
1139
1222
  }
1140
1223
  });
1141
1224
 
1142
- script$H.__file = "src/shared/components/DeviceVersion.vue";
1225
+ script$J.__file = "src/shared/components/DeviceVersion.vue";
1143
1226
 
1144
- var script$G = /* @__PURE__ */ defineComponent({
1227
+ var script$I = /* @__PURE__ */ defineComponent({
1145
1228
  __name: "OcrIcon",
1146
1229
  props: {
1147
1230
  disabled: { type: Boolean, required: false, default: false },
1148
1231
  side: { type: String, required: false, default: "face" },
1149
- class: { type: String, required: false, default: "" }
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 }
1150
1237
  },
1151
1238
  emits: ["complete"],
1152
- setup(__props, { emit: __emit }) {
1239
+ setup(__props, { expose: __expose, emit: __emit }) {
1153
1240
  const appKitOptions = useAppKitOptions();
1241
+ const $http = useHttp$3(), $n = useNutshell();
1154
1242
  const emits = __emit;
1155
1243
  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
- }
1182
1244
  function allTrim(str) {
1183
1245
  return str.replace(/\s+/g, "");
1184
1246
  }
1185
1247
  async function onUploadFile(csRes) {
1186
1248
  let result = null;
1187
1249
  try {
1188
- console.log("===\u4E0A\u4F20", csRes);
1189
1250
  let { path, size, tempFilePath } = csRes.tempFiles[0];
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;
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;
1196
1256
  }
1197
- console.log(filePath, "filePath");
1198
- showLoading({ title: "\u8EAB\u4EFD\u8BC1\u8BC6\u522B\u4E2D.." });
1257
+ showLoading({ title: "\u8EAB\u4EFD\u8BC1\u8BC6\u522B\u4E2D..", mask: true });
1199
1258
  const session = appKitOptions.token();
1200
1259
  const baseUrl = appKitOptions.baseUrl();
1201
1260
  const upRes = await uploadFile({
1202
- url: baseUrl + "/hkapprove/ocr/idcard",
1261
+ url: `${baseUrl}${!props.hasUploadVo ? props.uploadUrl : "/hkapprove/ocr/idcard"}`,
1203
1262
  filePath,
1204
1263
  name: "file",
1205
1264
  formData: {
1206
1265
  objectNo: `min${Date.now()}`,
1207
- side: props.side
1266
+ side: props.side,
1267
+ appCode: appKitOptions.app()
1208
1268
  },
1209
1269
  header: {
1210
1270
  token: session || ""
1211
1271
  }
1212
1272
  });
1213
- hideLoading();
1214
1273
  const res = JSON.parse(upRes.data);
1215
1274
  if (res.code === "200") {
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" });
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);
1236
1299
  }
1237
1300
  } else {
1301
+ hideLoading();
1238
1302
  showToast({
1239
1303
  title: res.msg,
1240
1304
  icon: "error"
@@ -1244,7 +1308,42 @@ var script$G = /* @__PURE__ */ defineComponent({
1244
1308
  hideLoading();
1245
1309
  console.log(err);
1246
1310
  }
1247
- emits("complete", result);
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
+ }
1248
1347
  }
1249
1348
  const activeSheetVisible = ref(false);
1250
1349
  const actionSheetMenus = [
@@ -1282,21 +1381,545 @@ var script$G = /* @__PURE__ */ defineComponent({
1282
1381
  onUploadFile(csRes);
1283
1382
  }
1284
1383
  }
1285
- async function onPhotograph() {
1384
+ async function onUpload() {
1385
+ if (props.disabled) return;
1386
+ if (Taro.getEnv() === "WEB") {
1387
+ const csRes = await chooseMedia({
1388
+ count: 1,
1389
+ sourceType: ["album"],
1390
+ // "camera" | "album"
1391
+ maxDuration: 60
1392
+ // 使用duration属性判断是图片还是视频,图片没有该属性
1393
+ });
1394
+ onUploadFile(csRes);
1395
+ return;
1396
+ }
1397
+ activeSheetVisible.value = true;
1398
+ }
1399
+ __expose({
1400
+ onUpload
1401
+ });
1402
+ return (_ctx, _cache) => {
1403
+ const _component_nut_action_sheet = ActionSheet;
1404
+ const _directive_track_click = resolveDirective("track-click");
1405
+ return openBlock(), createElementBlock(
1406
+ Fragment,
1407
+ null,
1408
+ [
1409
+ withDirectives((openBlock(), createElementBlock(
1410
+ "div",
1411
+ {
1412
+ class: normalizeClass(["ocr-icon", [__props.disabled ? "disabled" : "", __props.className]]),
1413
+ onClick: _cache[0] || (_cache[0] = ($event) => !__props.customClick ? onUpload() : null)
1414
+ },
1415
+ [
1416
+ renderSlot(_ctx.$slots, "icon", {}, () => [
1417
+ createVNode(unref(NsIcon), { name: "https://cdn.ddjf.com/static/images/beidouxing/ocr-icon.png" })
1418
+ ])
1419
+ ],
1420
+ 2
1421
+ /* CLASS */
1422
+ )), [
1423
+ [_directive_track_click, "\u8EAB\u4EFD\u8BC1\u8BC6\u522B-\u70B9\u51FB"]
1424
+ ]),
1425
+ createVNode(_component_nut_action_sheet, {
1426
+ visible: activeSheetVisible.value,
1427
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => activeSheetVisible.value = $event),
1428
+ "menu-items": actionSheetMenus,
1429
+ onChoose: chooseImages,
1430
+ "cancel-txt": "\u53D6\u6D88"
1431
+ }, null, 8, ["visible"])
1432
+ ],
1433
+ 64
1434
+ /* STABLE_FRAGMENT */
1435
+ );
1436
+ };
1437
+ }
1438
+ });
1439
+
1440
+ script$I.__file = "src/shared/components/OcrIcon.vue";
1441
+
1442
+ var script$H = /* @__PURE__ */ defineComponent({
1443
+ __name: "OcrBank",
1444
+ 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 }
1449
+ },
1450
+ emits: ["complete"],
1451
+ setup(__props, { expose: __expose, emit: __emit }) {
1452
+ const appKitOptions = useAppKitOptions();
1453
+ const $http = useHttp$3(), $n = useNutshell();
1454
+ const emits = __emit;
1455
+ 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()
1471
+ },
1472
+ header: {
1473
+ token: session || ""
1474
+ }
1475
+ });
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
+ }
1550
+ }
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;
1563
+ }
1564
+ activeSheetVisible.value = true;
1565
+ }
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
+ function allTrim(str) {
1621
+ return str.replace(/\s+/g, "");
1622
+ }
1623
+ async function onUpload() {
1624
+ if (props.disabled) {
1625
+ return;
1626
+ }
1627
+ let result = null;
1628
+ try {
1629
+ const csRes = await chooseMedia({
1630
+ count: 1,
1631
+ sourceType: ["album", "camera"]
1632
+ });
1633
+ 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
+ }
1667
+ } 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;
1747
+ }
1748
+ showLoading({ title: "\u53D1\u7968\u8BC6\u522B\u4E2D..", mask: true });
1749
+ const session = appKitOptions.token();
1750
+ const baseUrl = appKitOptions.baseUrl();
1751
+ const upRes = await uploadFile({
1752
+ url: `${baseUrl}${props.uploadUrl}`,
1753
+ filePath,
1754
+ name: "file",
1755
+ formData: {
1756
+ objectNo: `min${Date.now()}`,
1757
+ appCode: appKitOptions.app()
1758
+ },
1759
+ header: {
1760
+ token: session || ""
1761
+ }
1762
+ });
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
+ 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);
1898
+ }
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() {
1286
1909
  if (props.disabled) return;
1287
1910
  if (Taro.getEnv() === "WEB") {
1288
- const csRes = await chooseMedia({
1289
- count: 1,
1290
- sourceType: ["album"],
1291
- // "camera" | "album"
1292
- maxDuration: 60
1293
- // 使用duration属性判断是图片还是视频,图片没有该属性
1294
- });
1295
- onUploadFile(csRes);
1911
+ try {
1912
+ await chooseFileInWeb();
1913
+ } catch (err) {
1914
+ console.error("\u6587\u4EF6\u9009\u62E9\u5931\u8D25:", err);
1915
+ }
1296
1916
  return;
1297
1917
  }
1298
1918
  activeSheetVisible.value = true;
1299
1919
  }
1920
+ __expose({
1921
+ onUpload
1922
+ });
1300
1923
  return (_ctx, _cache) => {
1301
1924
  const _component_nut_action_sheet = ActionSheet;
1302
1925
  const _directive_track_click = resolveDirective("track-click");
@@ -1307,8 +1930,8 @@ var script$G = /* @__PURE__ */ defineComponent({
1307
1930
  withDirectives((openBlock(), createElementBlock(
1308
1931
  "div",
1309
1932
  {
1310
- class: normalizeClass(["ocr-icon", [__props.disabled ? "disabled" : ""]]),
1311
- onClick: onPhotograph
1933
+ class: normalizeClass(["ocr-invoice", [__props.disabled ? "disabled" : "", __props.className]]),
1934
+ onClick: _cache[0] || (_cache[0] = ($event) => !__props.customClick ? onUpload() : null)
1312
1935
  },
1313
1936
  [
1314
1937
  renderSlot(_ctx.$slots, "icon", {}, () => [
@@ -1318,11 +1941,11 @@ var script$G = /* @__PURE__ */ defineComponent({
1318
1941
  2
1319
1942
  /* CLASS */
1320
1943
  )), [
1321
- [_directive_track_click, "\u8EAB\u4EFD\u8BC1\u8BC6\u522B-\u70B9\u51FB"]
1944
+ [_directive_track_click, "\u53D1\u7968\u8BC6\u522B-\u70B9\u51FB"]
1322
1945
  ]),
1323
1946
  createVNode(_component_nut_action_sheet, {
1324
1947
  visible: activeSheetVisible.value,
1325
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => activeSheetVisible.value = $event),
1948
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => activeSheetVisible.value = $event),
1326
1949
  "menu-items": actionSheetMenus,
1327
1950
  onChoose: chooseImages,
1328
1951
  "cancel-txt": "\u53D6\u6D88"
@@ -1335,125 +1958,7 @@ var script$G = /* @__PURE__ */ defineComponent({
1335
1958
  }
1336
1959
  });
1337
1960
 
1338
- script$G.__file = "src/shared/components/OcrIcon.vue";
1339
-
1340
- var script$F = /* @__PURE__ */ defineComponent({
1341
- __name: "OcrBusinessLicense",
1342
- props: {
1343
- disabled: { type: Boolean, required: true }
1344
- },
1345
- emits: ["complete"],
1346
- setup(__props, { emit: __emit }) {
1347
- const appKitOptions = useAppKitOptions();
1348
- const emits = __emit;
1349
- const props = __props;
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);
1357
- },
1358
- fail: (res) => {
1359
- reject(res);
1360
- }
1361
- });
1362
- });
1363
- }
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;
1369
- }
1370
- return quality;
1371
- }
1372
- function allTrim(str) {
1373
- return str.replace(/\s+/g, "");
1374
- }
1375
- async function onIconClick() {
1376
- if (props.disabled) {
1377
- return;
1378
- }
1379
- console.log("===onIconClick");
1380
- let result = null;
1381
- try {
1382
- const csRes = await chooseMedia({
1383
- count: 1,
1384
- sourceType: ["album", "camera"]
1385
- });
1386
- let { size, tempFilePath } = csRes.tempFiles[0];
1387
- let filePath;
1388
- if (Taro.getEnv() !== "WEB") {
1389
- const compressImg = await taroImgCompress(tempFilePath, getCompressQuality(size)) || {};
1390
- filePath = compressImg.tempFilePath;
1391
- } else {
1392
- filePath = tempFilePath;
1393
- }
1394
- showLoading({ title: "\u8425\u4E1A\u6267\u7167\u8BC6\u522B\u4E2D.." });
1395
- const session = appKitOptions.token();
1396
- const baseUrl = appKitOptions.baseUrl();
1397
- const upRes = await uploadFile({
1398
- url: baseUrl + "/promoact/common/parseBusinessLicense",
1399
- filePath,
1400
- name: "file",
1401
- formData: {
1402
- objectNo: `min${Date.now()}`
1403
- },
1404
- header: {
1405
- token: session || ""
1406
- }
1407
- });
1408
- hideLoading();
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" });
1423
- }
1424
- } else {
1425
- showToast({
1426
- title: res.msg,
1427
- icon: "error"
1428
- });
1429
- }
1430
- } catch (err) {
1431
- hideLoading();
1432
- console.log(err);
1433
- }
1434
- emits("complete", result);
1435
- }
1436
- return (_ctx, _cache) => {
1437
- const _directive_track_click = resolveDirective("track-click");
1438
- return withDirectives((openBlock(), createElementBlock(
1439
- "div",
1440
- {
1441
- class: normalizeClass([["ocr-business-license", __props.disabled ? "disabled" : ""], "ocr-icon"]),
1442
- onClick: onIconClick
1443
- },
1444
- [
1445
- createVNode(unref(NsIcon), { name: "https://cdn.ddjf.com/static/images/beidouxing/ocr-icon.png" })
1446
- ],
1447
- 2
1448
- /* CLASS */
1449
- )), [
1450
- [_directive_track_click, "\u8425\u4E1A\u6267\u7167\u8BC6\u522B-\u70B9\u51FB"]
1451
- ]);
1452
- };
1453
- }
1454
- });
1455
-
1456
- script$F.__file = "src/shared/components/OcrBusinessLicense.vue";
1961
+ script$F.__file = "src/shared/components/OcrInvoice.vue";
1457
1962
 
1458
1963
  var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
1459
1964
  HttpMethod2["get"] = "GET";
@@ -1501,6 +2006,7 @@ const request = (config) => {
1501
2006
  }
1502
2007
  }).catch((e) => {
1503
2008
  console.log("request.catch===", e);
2009
+ reject(e);
1504
2010
  });
1505
2011
  });
1506
2012
  };
@@ -2008,7 +2514,6 @@ class TrackingSDK {
2008
2514
  * 发送埋点数据
2009
2515
  */
2010
2516
  async flush() {
2011
- console.log(this.eventQueue.length, "this.eventQueue.length");
2012
2517
  if (this.eventQueue.length === 0) return;
2013
2518
  const events = [...this.eventQueue];
2014
2519
  this.eventQueue = [];
@@ -2698,9 +3203,11 @@ const endpointsList$2 = {
2698
3203
  certificateNo: params.user,
2699
3204
  accountAuthFlag: params.accountAuthFlag || false,
2700
3205
  channelCode: params.channelCode || null,
2701
- payFinishJumpUrl: params.payFinishJumpUrl || null
3206
+ payFinishJumpUrl: params.payFinishJumpUrl || null,
3207
+ useCloudBean: params.useCloudBean || false
2702
3208
  }),
2703
3209
  transform: (data) => {
3210
+ console.log(data, "data-----");
2704
3211
  let json = null;
2705
3212
  try {
2706
3213
  json = JSON.parse(data.prePayStr);
@@ -2767,7 +3274,7 @@ const vendor$2 = {
2767
3274
  traceId: header.traceId,
2768
3275
  duration: endTime - startTime
2769
3276
  });
2770
- if (data.success) {
3277
+ if (data.success || data.code === "401") {
2771
3278
  resolve({
2772
3279
  status: +data.code,
2773
3280
  message: data.msg,
@@ -2778,6 +3285,7 @@ const vendor$2 = {
2778
3285
  title: data.msg,
2779
3286
  icon: "none"
2780
3287
  });
3288
+ reject(data.msg);
2781
3289
  }
2782
3290
  }).catch((e) => {
2783
3291
  reject(e);
@@ -2790,7 +3298,7 @@ function useHttp$2(defaultHeader) {
2790
3298
  const headers = {
2791
3299
  Token: appkitOptions.tempToken() || appkitOptions.token(),
2792
3300
  Appcode: defaultHeader?.Appcode || appkitOptions.app(),
2793
- cookie: `tid=${defaultHeader?.Tenant || appkitOptions.tenant()}`,
3301
+ tid: defaultHeader?.Tenant || appkitOptions.tenant(),
2794
3302
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
2795
3303
  };
2796
3304
  const $http = createHttp({
@@ -2799,6 +3307,7 @@ function useHttp$2(defaultHeader) {
2799
3307
  headers,
2800
3308
  interceptors: [
2801
3309
  (raw) => {
3310
+ console.log(raw, "=======raw");
2802
3311
  if (raw.status == 401) {
2803
3312
  appkitOptions[401]();
2804
3313
  return true;
@@ -2895,12 +3404,14 @@ const requestBrandWCPay = (params, Appcode = "") => {
2895
3404
  $http.post(endpoints$1.\u83B7\u53D6\u5FAE\u4FE1\u652F\u4ED8\u53C2\u6570\u5305, {
2896
3405
  ...params
2897
3406
  }).then((response) => {
2898
- if (!response.json) {
3407
+ if (!response.json && !response.prePayStr) {
2899
3408
  showToast({
2900
3409
  title: response.message,
2901
3410
  icon: "none"
2902
3411
  });
2903
3412
  resolve(false);
3413
+ } else if (!response.json && response.prePayStr) {
3414
+ resolve(response);
2904
3415
  } else if (params.fromMini) {
2905
3416
  resolve(response.json);
2906
3417
  } else {
@@ -2924,12 +3435,14 @@ const requestBrandWCPayByBean = (params, Appcode = "") => {
2924
3435
  $http.post(endpoints$1.\u83B7\u53D6\u6743\u76CA\u5FAE\u4FE1\u652F\u4ED8, {
2925
3436
  ...params
2926
3437
  }).then((response) => {
2927
- if (!response.json) {
3438
+ if (!response.json && !response.prePayStr) {
2928
3439
  showToast({
2929
3440
  title: response.message,
2930
3441
  icon: "none"
2931
3442
  });
2932
3443
  resolve(false);
3444
+ } else if (!response.json && response.prePayStr) {
3445
+ resolve(response);
2933
3446
  } else if (params.fromMini) {
2934
3447
  resolve(response.json);
2935
3448
  } else {
@@ -2941,6 +3454,8 @@ const requestBrandWCPayByBean = (params, Appcode = "") => {
2941
3454
  }
2942
3455
  });
2943
3456
  }
3457
+ }).catch(() => {
3458
+ resolve(false);
2944
3459
  });
2945
3460
  });
2946
3461
  };
@@ -2993,7 +3508,7 @@ function isChrome() {
2993
3508
  const _hoisted_1$B = { class: "view recharge-view" };
2994
3509
  const _hoisted_2$r = { class: "flex-grow" };
2995
3510
  const _hoisted_3$l = { class: "amount-footer" };
2996
- const _hoisted_4$g = { class: "agreement" };
3511
+ const _hoisted_4$h = { class: "agreement" };
2997
3512
  var script$E = /* @__PURE__ */ defineComponent({
2998
3513
  __name: "RechargeView",
2999
3514
  props: {
@@ -3110,7 +3625,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3110
3625
  const _directive_track_click = resolveDirective("track-click");
3111
3626
  return openBlock(), createElementBlock("view", _hoisted_1$B, [
3112
3627
  createElementVNode("view", _hoisted_2$r, [
3113
- createVNode(script$M, {
3628
+ createVNode(script$O, {
3114
3629
  items: amounts.value,
3115
3630
  selected: state.selected,
3116
3631
  onChange: onAmountSelect
@@ -3118,7 +3633,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3118
3633
  renderSlot(_ctx.$slots, "banner")
3119
3634
  ]),
3120
3635
  createElementVNode("view", _hoisted_3$l, [
3121
- createElementVNode("view", _hoisted_4$g, [
3636
+ createElementVNode("view", _hoisted_4$h, [
3122
3637
  createVNode(_component_nut_checkbox, {
3123
3638
  modelValue: state.agreed,
3124
3639
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.agreed = $event)
@@ -3191,7 +3706,7 @@ const _hoisted_3$k = {
3191
3706
  key: 0,
3192
3707
  class: "caption"
3193
3708
  };
3194
- const _hoisted_4$f = {
3709
+ const _hoisted_4$g = {
3195
3710
  key: 1,
3196
3711
  class: "caption"
3197
3712
  };
@@ -3232,7 +3747,7 @@ var script$C = /* @__PURE__ */ defineComponent({
3232
3747
  ),
3233
3748
  __props.payMethod == "bean" ? (openBlock(), createElementBlock("div", _hoisted_3$k, "\u6743\u76CA\u5DF2\u5230\u8D26")) : (openBlock(), createElementBlock(
3234
3749
  "div",
3235
- _hoisted_4$f,
3750
+ _hoisted_4$g,
3236
3751
  toDisplayString(views[__props.type][1]) + "\u5C06\u57281\u5206\u949F\u4E4B\u5185\u5230\u8D26",
3237
3752
  1
3238
3753
  /* TEXT */
@@ -3379,8 +3894,8 @@ const _hoisted_3$i = {
3379
3894
  key: 0,
3380
3895
  class: "bean-buy"
3381
3896
  };
3382
- const _hoisted_4$e = { class: "left" };
3383
- const _hoisted_5$c = {
3897
+ const _hoisted_4$f = { class: "left" };
3898
+ const _hoisted_5$d = {
3384
3899
  key: 0,
3385
3900
  class: "amount"
3386
3901
  };
@@ -3390,24 +3905,33 @@ const _hoisted_6$9 = {
3390
3905
  };
3391
3906
  const _hoisted_7$6 = { class: "amount" };
3392
3907
  const _hoisted_8$5 = ["src"];
3393
- const _hoisted_9$4 = { class: "amount-footer" };
3908
+ const _hoisted_9$4 = {
3909
+ key: 0,
3910
+ class: "balance-warning"
3911
+ };
3394
3912
  const _hoisted_10$3 = {
3913
+ key: 1,
3914
+ class: "balance-warning-tip"
3915
+ };
3916
+ const _hoisted_11$3 = { class: "amount-footer" };
3917
+ const _hoisted_12$3 = {
3395
3918
  key: 0,
3396
3919
  class: "agreement"
3397
3920
  };
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" };
3921
+ const _hoisted_13$2 = { class: "buy-amount" };
3922
+ const _hoisted_14$2 = { class: "left" };
3923
+ const _hoisted_15$2 = { class: "amount" };
3403
3924
  const _hoisted_16$2 = { class: "item" };
3925
+ const _hoisted_17$2 = { class: "item" };
3926
+ const _hoisted_18$2 = { class: "item" };
3404
3927
  var script$A = /* @__PURE__ */ defineComponent({
3405
3928
  __name: "TradeView",
3406
3929
  props: {
3407
3930
  headerApp: { type: String, required: true },
3408
3931
  app: { type: String, required: true },
3409
3932
  tenant: { type: String, required: true },
3410
- payFinishJumpUrl: { type: String, required: false }
3933
+ payFinishJumpUrl: { type: String, required: false },
3934
+ apps: { type: String, required: false }
3411
3935
  },
3412
3936
  emits: ["complete", "agree", "loaded"],
3413
3937
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3434,8 +3958,28 @@ var script$A = /* @__PURE__ */ defineComponent({
3434
3958
  state.selected = selected;
3435
3959
  selectBean.value = false;
3436
3960
  };
3961
+ const extraPaymentAmount = computed(() => {
3962
+ if (!selectBean.value || !amounts.value[state.selected]) {
3963
+ return 0;
3964
+ }
3965
+ const paymentAmount = amounts.value[state.selected].paymentAmount || 0;
3966
+ const currentBalance = balance.value || 0;
3967
+ return Math.max(0, paymentAmount - currentBalance);
3968
+ });
3437
3969
  const currentAmount = computed(() => {
3438
- return amounts.value[state.selected] && !selectBean.value ? amounts.value[state.selected].paymentAmount : 0;
3970
+ if (!amounts.value[state.selected]) {
3971
+ return 0;
3972
+ }
3973
+ if (selectBean.value) {
3974
+ if (balance.value < amounts.value[state.selected].paymentAmount) {
3975
+ return extraPaymentAmount.value;
3976
+ }
3977
+ return 0;
3978
+ }
3979
+ return amounts.value[state.selected].paymentAmount || 0;
3980
+ });
3981
+ const isCombinedPayment = computed(() => {
3982
+ return selectBean.value && amounts.value[state.selected] && balance.value < amounts.value[state.selected].paymentAmount;
3439
3983
  });
3440
3984
  onMounted(() => {
3441
3985
  const $http = useHttp$2({ Appcode: props.headerApp, Tenant: props.tenant });
@@ -3451,24 +3995,28 @@ var script$A = /* @__PURE__ */ defineComponent({
3451
3995
  const showDialog = ref(false);
3452
3996
  async function beanPay() {
3453
3997
  const $http = useHttp$2({ Appcode: props.headerApp, Tenant: props.tenant });
3454
- $http.post(`/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`).then((response) => {
3998
+ try {
3999
+ const response = await $http.post(
4000
+ `/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`
4001
+ );
3455
4002
  if (response) {
3456
4003
  showDialog.value = false;
3457
4004
  emit("complete", { result: response, type: "bean" });
3458
4005
  } else {
3459
4006
  showToast({
3460
- title: response.message,
4007
+ title: response?.message || "\u652F\u4ED8\u5931\u8D25",
3461
4008
  icon: "none"
3462
4009
  });
3463
4010
  }
3464
- });
3465
- }
3466
- const onPayClick = () => {
3467
- if (selectBean.value) {
3468
- showDialog.value = true;
3469
- return;
4011
+ } catch (error) {
4012
+ showToast({
4013
+ title: error?.message || "\u652F\u4ED8\u5931\u8D25",
4014
+ icon: "none"
4015
+ });
3470
4016
  }
3471
- if (!selectBean.value && !state.agreed) {
4017
+ }
4018
+ function proceedWechatPayment() {
4019
+ if (!state.agreed) {
3472
4020
  showToast({
3473
4021
  title: "\u8BF7\u52FE\u9009\u300A\u5927\u9053\u4E91\u5E73\u53F0\u4E91\u8C46\u5145\u503C\u534F\u8BAE\u300B",
3474
4022
  icon: "none"
@@ -3479,13 +4027,14 @@ var script$A = /* @__PURE__ */ defineComponent({
3479
4027
  if (Taro.getEnv() === "WEB") {
3480
4028
  requestBrandWCPayByBean({
3481
4029
  caseConfigId: amounts.value[state.selected].id,
3482
- amount: amounts.value[state.selected].paymentAmount,
4030
+ amount: currentAmount.value,
3483
4031
  app: "loankitMp",
3484
4032
  tenant: props.tenant,
3485
4033
  accountAuthFlag: false,
3486
4034
  channelCode: getChannelCode(),
3487
4035
  payFinishJumpUrl: props.payFinishJumpUrl,
3488
- fromMini: !!params.from
4036
+ fromMini: !!params.from,
4037
+ useCloudBean: isCombinedPayment.value
3489
4038
  }).then((result) => {
3490
4039
  state.buttonLoading = false;
3491
4040
  if (typeof result === "boolean" && result) {
@@ -3494,28 +4043,56 @@ var script$A = /* @__PURE__ */ defineComponent({
3494
4043
  state.thirdPayId = result?.thirdPayId || "";
3495
4044
  window.location.href = result?.prePayStr;
3496
4045
  } else {
3497
- emit("complete", { result, type: "wePay" });
4046
+ emit("complete", {
4047
+ result,
4048
+ type: isCombinedPayment.value ? "combined" : "wePay"
4049
+ });
3498
4050
  }
4051
+ }).catch((error) => {
4052
+ state.buttonLoading = false;
4053
+ showToast({
4054
+ title: error.message || "\u652F\u4ED8\u5931\u8D25",
4055
+ icon: "none"
4056
+ });
3499
4057
  });
3500
4058
  } else {
3501
4059
  wx.login({
3502
4060
  success({ code }) {
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) => {
4061
+ requestPaymentByBean(
4062
+ {
4063
+ caseConfigId: amounts.value[state.selected].id,
4064
+ amount: currentAmount.value,
4065
+ app: props.app,
4066
+ tenant: props.tenant,
4067
+ user: code
4068
+ },
4069
+ props.headerApp
4070
+ ).then((result) => {
3510
4071
  state.buttonLoading = false;
3511
4072
  if (result) {
3512
- emit("complete", { result: true, type: "wePay" });
4073
+ emit("complete", {
4074
+ result: true,
4075
+ type: isCombinedPayment.value ? "combined" : "wePay"
4076
+ });
3513
4077
  }
4078
+ }).catch((error) => {
4079
+ state.buttonLoading = false;
4080
+ showToast({
4081
+ title: error.message || "\u652F\u4ED8\u5931\u8D25",
4082
+ icon: "none"
4083
+ });
4084
+ });
4085
+ },
4086
+ fail() {
4087
+ state.buttonLoading = false;
4088
+ showToast({
4089
+ title: "\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
4090
+ icon: "none"
3514
4091
  });
3515
4092
  }
3516
4093
  });
3517
4094
  }
3518
- };
4095
+ }
3519
4096
  function getChannelCode() {
3520
4097
  if (isWechat()) {
3521
4098
  return "centergzh";
@@ -3525,6 +4102,46 @@ var script$A = /* @__PURE__ */ defineComponent({
3525
4102
  return "distributor";
3526
4103
  }
3527
4104
  }
4105
+ const onPayClick = async () => {
4106
+ if (selectBean.value && !isCombinedPayment.value) {
4107
+ showDialog.value = true;
4108
+ return;
4109
+ }
4110
+ if (isCombinedPayment.value) {
4111
+ const res = await checkBalance();
4112
+ if (!res) return;
4113
+ }
4114
+ proceedWechatPayment();
4115
+ };
4116
+ async function checkBalance() {
4117
+ const $http = useHttp$2();
4118
+ return new Promise((resolve, reject) => {
4119
+ state.buttonLoading = true;
4120
+ $http.get(endpoints$2.\u83B7\u53D6\u4F59\u989D\u660E\u7EC6, {
4121
+ app: props.apps
4122
+ }).then((data) => {
4123
+ state.buttonLoading = false;
4124
+ if (data.commonAccount < balance.value) {
4125
+ showModal({
4126
+ title: "\u6E29\u99A8\u63D0\u793A",
4127
+ content: "\u4E91\u8C46\u4E0D\u8DB3\uFF0C\u8BF7\u5237\u65B0\u540E\u518D\u6B21\u786E\u8BA4",
4128
+ showCancel: false,
4129
+ confirmText: "\u5237\u65B0",
4130
+ confirmColor: "#017fff",
4131
+ success: () => {
4132
+ balance.value = data.commonAccount;
4133
+ }
4134
+ });
4135
+ resolve(false);
4136
+ } else {
4137
+ resolve(true);
4138
+ }
4139
+ }).catch((error) => {
4140
+ state.buttonLoading = false;
4141
+ resolve(false);
4142
+ });
4143
+ });
4144
+ }
3528
4145
  const payResultCheck = () => {
3529
4146
  if (!state.thirdPayId) return;
3530
4147
  const $http = useHttp$2();
@@ -3534,7 +4151,7 @@ var script$A = /* @__PURE__ */ defineComponent({
3534
4151
  if (response.payStatus === "paid") {
3535
4152
  emit("complete", {
3536
4153
  result: true,
3537
- type: "wePay"
4154
+ type: isCombinedPayment.value ? "combined" : "wePay"
3538
4155
  });
3539
4156
  }
3540
4157
  });
@@ -3555,7 +4172,7 @@ var script$A = /* @__PURE__ */ defineComponent({
3555
4172
  onChange: onAmountSelect
3556
4173
  }, null, 8, ["items", "selected"]),
3557
4174
  amounts.value[state.selected] ? (openBlock(), createElementBlock("div", _hoisted_3$i, [
3558
- createElementVNode("div", _hoisted_4$e, [
4175
+ createElementVNode("div", _hoisted_4$f, [
3559
4176
  _cache[4] || (_cache[4] = createElementVNode(
3560
4177
  "div",
3561
4178
  { class: "title" },
@@ -3563,29 +4180,28 @@ var script$A = /* @__PURE__ */ defineComponent({
3563
4180
  -1
3564
4181
  /* CACHED */
3565
4182
  )),
3566
- !selectBean.value ? (openBlock(), createElementBlock(
4183
+ !selectBean.value || isCombinedPayment.value ? (openBlock(), createElementBlock(
3567
4184
  "div",
3568
- _hoisted_5$c,
3569
- "\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value || 0)),
4185
+ _hoisted_5$d,
4186
+ " \u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value || 0)),
3570
4187
  1
3571
4188
  /* TEXT */
3572
4189
  )) : (openBlock(), createElementBlock(
3573
4190
  "div",
3574
4191
  _hoisted_6$9,
3575
- "\u6263\u51CF\u540E\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
4192
+ " \u6263\u51CF\u540E\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3576
4193
  1
3577
4194
  /* TEXT */
3578
4195
  ))
3579
4196
  ]),
3580
- balance.value >= amounts.value[state.selected].paymentAmount ? (openBlock(), createElementBlock("div", {
3581
- key: 0,
4197
+ createElementVNode("div", {
3582
4198
  class: "right",
3583
4199
  onClick: _cache[0] || (_cache[0] = ($event) => selectBean.value = !selectBean.value)
3584
4200
  }, [
3585
4201
  createElementVNode(
3586
4202
  "div",
3587
4203
  _hoisted_7$6,
3588
- "-" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
4204
+ " -" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3589
4205
  1
3590
4206
  /* TEXT */
3591
4207
  ),
@@ -3593,12 +4209,20 @@ var script$A = /* @__PURE__ */ defineComponent({
3593
4209
  class: "icon",
3594
4210
  src: selectBean.value ? "https://cdn.ddjf.com/static/images/appkit/select.svg" : "https://cdn.ddjf.com/static/images/appkit/not-select.svg"
3595
4211
  }, null, 8, _hoisted_8$5)
3596
- ])) : createCommentVNode("v-if", true)
4212
+ ]),
4213
+ isCombinedPayment.value ? (openBlock(), createElementBlock(
4214
+ "div",
4215
+ _hoisted_9$4,
4216
+ " \u4E91\u8C46\u4F59\u989D\u4E0D\u8DB3,\u8FD8\u9700\u989D\u5916\u652F\u4ED8" + toDisplayString(unref(formatAmount)(extraPaymentAmount.value)) + "\u5143 ",
4217
+ 1
4218
+ /* TEXT */
4219
+ )) : createCommentVNode("v-if", true)
3597
4220
  ])) : createCommentVNode("v-if", true),
4221
+ 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),
3598
4222
  renderSlot(_ctx.$slots, "banner")
3599
4223
  ]),
3600
- createElementVNode("view", _hoisted_9$4, [
3601
- !selectBean.value ? (openBlock(), createElementBlock("view", _hoisted_10$3, [
4224
+ createElementVNode("view", _hoisted_11$3, [
4225
+ !selectBean.value || isCombinedPayment.value ? (openBlock(), createElementBlock("view", _hoisted_12$3, [
3602
4226
  createVNode(_component_nut_checkbox, {
3603
4227
  modelValue: state.agreed,
3604
4228
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.agreed = $event)
@@ -3626,14 +4250,14 @@ var script$A = /* @__PURE__ */ defineComponent({
3626
4250
  /* STABLE */
3627
4251
  }, 8, ["modelValue"])
3628
4252
  ])) : createCommentVNode("v-if", true),
3629
- createElementVNode("div", _hoisted_11$3, [
3630
- createElementVNode("div", _hoisted_12$3, [
4253
+ createElementVNode("div", _hoisted_13$2, [
4254
+ createElementVNode("div", _hoisted_14$2, [
3631
4255
  _cache[8] || (_cache[8] = createTextVNode(
3632
4256
  " \u5F85\u652F\u4ED8\uFF1A ",
3633
4257
  -1
3634
4258
  /* CACHED */
3635
4259
  )),
3636
- createElementVNode("span", _hoisted_13$2, [
4260
+ createElementVNode("span", _hoisted_15$2, [
3637
4261
  _cache[7] || (_cache[7] = createElementVNode(
3638
4262
  "i",
3639
4263
  null,
@@ -3684,22 +4308,22 @@ var script$A = /* @__PURE__ */ defineComponent({
3684
4308
  [
3685
4309
  createElementVNode(
3686
4310
  "div",
3687
- _hoisted_14$2,
3688
- "\u4E91\u8C46\u6263\u51CF\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
4311
+ _hoisted_16$2,
4312
+ " \u4E91\u8C46\u6263\u51CF\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3689
4313
  1
3690
4314
  /* TEXT */
3691
4315
  ),
3692
4316
  createElementVNode(
3693
4317
  "div",
3694
- _hoisted_15$2,
3695
- "\u6743\u76CA\u589E\u52A0\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].priceRightNum || 0)) + "\u7B14",
4318
+ _hoisted_17$2,
4319
+ " \u6743\u76CA\u589E\u52A0\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].priceRightNum || 0)) + "\u7B14 ",
3696
4320
  1
3697
4321
  /* TEXT */
3698
4322
  ),
3699
4323
  createElementVNode(
3700
4324
  "div",
3701
- _hoisted_16$2,
3702
- "\u6263\u51CF\u540E\u4E91\u8C46\u4F59\u989D\uFF1A" + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
4325
+ _hoisted_18$2,
4326
+ " \u6263\u51CF\u540E\u4E91\u8C46\u4F59\u989D\uFF1A" + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3703
4327
  1
3704
4328
  /* TEXT */
3705
4329
  )
@@ -3719,7 +4343,7 @@ var script$A = /* @__PURE__ */ defineComponent({
3719
4343
  script$A.__file = "src/payment/components/TradeView.vue";
3720
4344
 
3721
4345
  const components = {
3722
- AmountPicker: script$M,
4346
+ AmountPicker: script$O,
3723
4347
  RechargeView: script$E,
3724
4348
  UserAgreement: script$D,
3725
4349
  RechargeResult: script$C,
@@ -3729,8 +4353,8 @@ const components = {
3729
4353
  const _hoisted_1$w = { class: "account-card" };
3730
4354
  const _hoisted_2$n = { class: "card" };
3731
4355
  const _hoisted_3$h = { class: "card-row" };
3732
- const _hoisted_4$d = { class: "card-row-left" };
3733
- const _hoisted_5$b = { class: "bean-nums number" };
4356
+ const _hoisted_4$e = { class: "card-row-left" };
4357
+ const _hoisted_5$c = { class: "bean-nums number" };
3734
4358
  const _hoisted_6$8 = { class: "card-row-right" };
3735
4359
  var script$z = /* @__PURE__ */ defineComponent({
3736
4360
  __name: "BalanceCard",
@@ -3777,7 +4401,7 @@ var script$z = /* @__PURE__ */ defineComponent({
3777
4401
  return openBlock(), createElementBlock("div", _hoisted_1$w, [
3778
4402
  createElementVNode("div", _hoisted_2$n, [
3779
4403
  createElementVNode("div", _hoisted_3$h, [
3780
- createElementVNode("div", _hoisted_4$d, [
4404
+ createElementVNode("div", _hoisted_4$e, [
3781
4405
  _cache[0] || (_cache[0] = createElementVNode(
3782
4406
  "div",
3783
4407
  { class: "bean-box" },
@@ -3795,7 +4419,7 @@ var script$z = /* @__PURE__ */ defineComponent({
3795
4419
  )),
3796
4420
  createElementVNode(
3797
4421
  "div",
3798
- _hoisted_5$b,
4422
+ _hoisted_5$c,
3799
4423
  toDisplayString(unref(formatAmount)(balance.value.total || 0)),
3800
4424
  1
3801
4425
  /* TEXT */
@@ -3857,8 +4481,8 @@ const consumptionDirections = ["\u5168\u90E8", "\u6536\u5165", "\u652F\u51FA"];
3857
4481
  const _hoisted_1$v = { class: "consumption-filter" };
3858
4482
  const _hoisted_2$m = { class: "consumption-filter-content" };
3859
4483
  const _hoisted_3$g = { class: "title" };
3860
- const _hoisted_4$c = { class: "info" };
3861
- const _hoisted_5$a = ["onClick"];
4484
+ const _hoisted_4$d = { class: "info" };
4485
+ const _hoisted_5$b = ["onClick"];
3862
4486
  const _hoisted_6$7 = { class: "consumption-filter-btn spa-between" };
3863
4487
  var script$y = /* @__PURE__ */ defineComponent({
3864
4488
  __name: "ConsumptionFilter",
@@ -3937,7 +4561,7 @@ var script$y = /* @__PURE__ */ defineComponent({
3937
4561
  1
3938
4562
  /* TEXT */
3939
4563
  ),
3940
- createElementVNode("div", _hoisted_4$c, [
4564
+ createElementVNode("div", _hoisted_4$d, [
3941
4565
  (openBlock(true), createElementBlock(
3942
4566
  Fragment,
3943
4567
  null,
@@ -3946,7 +4570,7 @@ var script$y = /* @__PURE__ */ defineComponent({
3946
4570
  onClick: () => onFilterSectionClick(index, it.code),
3947
4571
  class: normalizeClass([getItemClass(index, it.code), "info-item"]),
3948
4572
  key: i
3949
- }, toDisplayString(typeof it === "string" ? it : it.name), 11, _hoisted_5$a);
4573
+ }, toDisplayString(typeof it === "string" ? it : it.name), 11, _hoisted_5$b);
3950
4574
  }),
3951
4575
  128
3952
4576
  /* KEYED_FRAGMENT */
@@ -3996,7 +4620,7 @@ script$y.__file = "src/balance/components/ConsumptionFilter.vue";
3996
4620
  const _hoisted_1$u = { class: "appkit-date-filter" };
3997
4621
  const _hoisted_2$l = { class: "content" };
3998
4622
  const _hoisted_3$f = { class: "time" };
3999
- const _hoisted_4$b = { class: "buttons spa-between" };
4623
+ const _hoisted_4$c = { class: "buttons spa-between" };
4000
4624
  var script$x = /* @__PURE__ */ defineComponent({
4001
4625
  __name: "DateFilter",
4002
4626
  props: {
@@ -4119,7 +4743,7 @@ var script$x = /* @__PURE__ */ defineComponent({
4119
4743
  )
4120
4744
  ])
4121
4745
  ]),
4122
- createElementVNode("div", _hoisted_4$b, [
4746
+ createElementVNode("div", _hoisted_4$c, [
4123
4747
  createElementVNode("div", {
4124
4748
  class: "btn",
4125
4749
  onClick: reset
@@ -4295,8 +4919,8 @@ script$u.__file = "src/balance/components/Tip.vue";
4295
4919
  const _hoisted_1$q = { class: "account-view" };
4296
4920
  const _hoisted_2$k = { class: "scroll-content" };
4297
4921
  const _hoisted_3$e = { class: "row jusify-right" };
4298
- const _hoisted_4$a = { class: "balance" };
4299
- const _hoisted_5$9 = { class: "bean-box spa-between" };
4922
+ const _hoisted_4$b = { class: "balance" };
4923
+ const _hoisted_5$a = { class: "bean-box spa-between" };
4300
4924
  const _hoisted_6$6 = { class: "bean-counts spa-between" };
4301
4925
  const _hoisted_7$5 = { class: "counts number" };
4302
4926
  const _hoisted_8$4 = {
@@ -4537,7 +5161,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4537
5161
  [
4538
5162
  createElementVNode("div", _hoisted_1$q, [
4539
5163
  createElementVNode("div", _hoisted_2$k, [
4540
- createVNode(unref(script$L), {
5164
+ createVNode(unref(script$N), {
4541
5165
  title: unref(Taro).getEnv() !== "WEB" ? "\u6211\u7684\u8D26\u6237" : "",
4542
5166
  class: normalizeClass({ "with-background": scrolled.value > 0 }),
4543
5167
  onClose: onPageHeaderClose
@@ -4558,8 +5182,8 @@ var script$t = /* @__PURE__ */ defineComponent({
4558
5182
  [_directive_track_click]
4559
5183
  ])
4560
5184
  ]),
4561
- createElementVNode("div", _hoisted_4$a, [
4562
- createElementVNode("div", _hoisted_5$9, [
5185
+ createElementVNode("div", _hoisted_4$b, [
5186
+ createElementVNode("div", _hoisted_5$a, [
4563
5187
  _cache[9] || (_cache[9] = createElementVNode(
4564
5188
  "div",
4565
5189
  { class: "bean-img" },
@@ -4842,7 +5466,7 @@ var script$t = /* @__PURE__ */ defineComponent({
4842
5466
  _: 1
4843
5467
  /* STABLE */
4844
5468
  }, 8, ["visible"]),
4845
- createVNode(unref(script$K), {
5469
+ createVNode(unref(script$M), {
4846
5470
  modelValue: secondBalanceOpen.value,
4847
5471
  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => secondBalanceOpen.value = $event),
4848
5472
  title: "\u6536\u652F\u660E\u7EC6"
@@ -5032,8 +5656,8 @@ script$t.__file = "src/balance/components/AccountView.vue";
5032
5656
  const _hoisted_1$p = { class: "balance-reminder" };
5033
5657
  const _hoisted_2$j = { class: "body" };
5034
5658
  const _hoisted_3$d = { class: "footer" };
5035
- const _hoisted_4$9 = { class: "col" };
5036
- const _hoisted_5$8 = { class: "col" };
5659
+ const _hoisted_4$a = { class: "col" };
5660
+ const _hoisted_5$9 = { class: "col" };
5037
5661
  var script$s = /* @__PURE__ */ defineComponent({
5038
5662
  __name: "BalanceReminder",
5039
5663
  props: {
@@ -5074,7 +5698,7 @@ var script$s = /* @__PURE__ */ defineComponent({
5074
5698
  )
5075
5699
  ]),
5076
5700
  createElementVNode("div", _hoisted_3$d, [
5077
- createElementVNode("div", _hoisted_4$9, [
5701
+ createElementVNode("div", _hoisted_4$a, [
5078
5702
  createVNode(_component_nut_button, {
5079
5703
  class: "cancel-button",
5080
5704
  onClick: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", false)),
@@ -5091,7 +5715,7 @@ var script$s = /* @__PURE__ */ defineComponent({
5091
5715
  /* STABLE */
5092
5716
  })
5093
5717
  ]),
5094
- createElementVNode("div", _hoisted_5$8, [
5718
+ createElementVNode("div", _hoisted_5$9, [
5095
5719
  withDirectives((openBlock(), createBlock(_component_nut_button, {
5096
5720
  block: "",
5097
5721
  class: "recharge-button",
@@ -5229,8 +5853,8 @@ script$r.__file = "src/balance/components/DateRange.vue";
5229
5853
  const _hoisted_1$n = { class: "list-filter-picker" };
5230
5854
  const _hoisted_2$i = { class: "list-filter-picker-content" };
5231
5855
  const _hoisted_3$c = { class: "title" };
5232
- const _hoisted_4$8 = { class: "info" };
5233
- const _hoisted_5$7 = ["onClick"];
5856
+ const _hoisted_4$9 = { class: "info" };
5857
+ const _hoisted_5$8 = ["onClick"];
5234
5858
  const _hoisted_6$5 = { class: "list-filter-picker-btn spa-between" };
5235
5859
  var script$q = /* @__PURE__ */ defineComponent({
5236
5860
  __name: "ListFilterPicker",
@@ -5307,7 +5931,7 @@ var script$q = /* @__PURE__ */ defineComponent({
5307
5931
  1
5308
5932
  /* TEXT */
5309
5933
  ),
5310
- createElementVNode("div", _hoisted_4$8, [
5934
+ createElementVNode("div", _hoisted_4$9, [
5311
5935
  (openBlock(true), createElementBlock(
5312
5936
  Fragment,
5313
5937
  null,
@@ -5316,7 +5940,7 @@ var script$q = /* @__PURE__ */ defineComponent({
5316
5940
  onClick: () => onFilterSectionClick(item.name, it.value),
5317
5941
  class: normalizeClass([getItemClass(item.name, it.value), "info-item"]),
5318
5942
  key: i
5319
- }, toDisplayString(typeof it === "string" ? it : it.label), 11, _hoisted_5$7);
5943
+ }, toDisplayString(typeof it === "string" ? it : it.label), 11, _hoisted_5$8);
5320
5944
  }),
5321
5945
  128
5322
5946
  /* KEYED_FRAGMENT */
@@ -5432,8 +6056,8 @@ const _hoisted_1$m = {
5432
6056
  };
5433
6057
  const _hoisted_2$h = { class: "promoter-card-hd-num number" };
5434
6058
  const _hoisted_3$b = ["src"];
5435
- const _hoisted_4$7 = { class: "promoter-card-ft" };
5436
- const _hoisted_5$6 = {
6059
+ const _hoisted_4$8 = { class: "promoter-card-ft" };
6060
+ const _hoisted_5$7 = {
5437
6061
  key: 0,
5438
6062
  class: "promoter-card-ft-item"
5439
6063
  };
@@ -5529,6 +6153,7 @@ var script$o = /* @__PURE__ */ defineComponent({
5529
6153
  showModal({
5530
6154
  content: toastMap[type],
5531
6155
  showCancel: false,
6156
+ confirmColor: "#017fff",
5532
6157
  confirmText: "\u77E5\u9053\u4E86"
5533
6158
  });
5534
6159
  }
@@ -5591,8 +6216,8 @@ var script$o = /* @__PURE__ */ defineComponent({
5591
6216
  ])), [
5592
6217
  [_directive_track_click]
5593
6218
  ]) : createCommentVNode("v-if", true),
5594
- createElementVNode("div", _hoisted_4$7, [
5595
- __props.applyRecord.accessCheckStatus === "Y" ? (openBlock(), createElementBlock("div", _hoisted_5$6, [
6219
+ createElementVNode("div", _hoisted_4$8, [
6220
+ __props.applyRecord.accessCheckStatus === "Y" ? (openBlock(), createElementBlock("div", _hoisted_5$7, [
5596
6221
  __props.\u663E\u793A\u4E0B\u7EA7\u5206\u9500\u5546 ? (openBlock(), createElementBlock(
5597
6222
  Fragment,
5598
6223
  { key: 0 },
@@ -6034,8 +6659,8 @@ script$l.__file = "src/components/dd-selector/index.vue";
6034
6659
  const _hoisted_1$j = { class: "self-registration" };
6035
6660
  const _hoisted_2$f = { class: "self-registration-body" };
6036
6661
  const _hoisted_3$a = ["src"];
6037
- const _hoisted_4$6 = { class: "self-registration__input" };
6038
- const _hoisted_5$5 = { class: "self-registration-bottom" };
6662
+ const _hoisted_4$7 = { class: "self-registration__input" };
6663
+ const _hoisted_5$6 = { class: "self-registration-bottom" };
6039
6664
  var script$k = /* @__PURE__ */ defineComponent({
6040
6665
  __name: "SelfRegistration",
6041
6666
  props: {
@@ -6195,7 +6820,7 @@ var script$k = /* @__PURE__ */ defineComponent({
6195
6820
  required: ""
6196
6821
  }, {
6197
6822
  default: withCtx(() => [
6198
- createElementVNode("div", _hoisted_4$6, [
6823
+ createElementVNode("div", _hoisted_4$7, [
6199
6824
  withDirectives(createElementVNode(
6200
6825
  "input",
6201
6826
  {
@@ -6211,7 +6836,10 @@ var script$k = /* @__PURE__ */ defineComponent({
6211
6836
  ), [
6212
6837
  [vModelText, formState.name]
6213
6838
  ]),
6214
- createVNode(script$G, { onComplete: onOCRInfo }, {
6839
+ createVNode(script$I, {
6840
+ "has-upload-vo": false,
6841
+ onComplete: onOCRInfo
6842
+ }, {
6215
6843
  icon: withCtx(() => [..._cache[9] || (_cache[9] = [
6216
6844
  createElementVNode(
6217
6845
  "img",
@@ -6346,7 +6974,7 @@ var script$k = /* @__PURE__ */ defineComponent({
6346
6974
  /* STABLE */
6347
6975
  })
6348
6976
  ]),
6349
- createElementVNode("div", _hoisted_5$5, [
6977
+ createElementVNode("div", _hoisted_5$6, [
6350
6978
  withDirectives((openBlock(), createBlock(_component_nut_button, {
6351
6979
  block: "",
6352
6980
  type: "primary",
@@ -6445,7 +7073,7 @@ const vendor$1 = {
6445
7073
  traceId: header.traceId,
6446
7074
  duration: endTime - startTime
6447
7075
  });
6448
- if (data.success) {
7076
+ if (data.success || data.code === "401") {
6449
7077
  resolve({
6450
7078
  status: +data.code,
6451
7079
  message: data.msg,
@@ -6468,7 +7096,7 @@ function useHttp$1() {
6468
7096
  const headers = {
6469
7097
  Token: appkitOptions.tempToken() || appkitOptions.token(),
6470
7098
  Appcode: appkitOptions.app(),
6471
- cookie: `tid=${appkitOptions.tenant()}`,
7099
+ tid: appkitOptions.tenant(),
6472
7100
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
6473
7101
  };
6474
7102
  const $http = createHttp({
@@ -6782,7 +7410,7 @@ var script$i = /* @__PURE__ */ defineComponent({
6782
7410
  Fragment,
6783
7411
  null,
6784
7412
  renderList(bannerMessages.value, (item, key) => {
6785
- return withDirectives((openBlock(), createBlock(script$I, {
7413
+ return withDirectives((openBlock(), createBlock(script$K, {
6786
7414
  class: normalizeClass({ show: key === activeKey.value }),
6787
7415
  key,
6788
7416
  showClose: item.noticeType === 0,
@@ -7053,7 +7681,8 @@ function useCommonList(api, query, loading = true, method = "GET") {
7053
7681
  const isLoading = ref(false);
7054
7682
  async function fetchData(loading2) {
7055
7683
  loading2 && showLoading({
7056
- title: "\u52A0\u8F7D\u4E2D..."
7684
+ title: "\u52A0\u8F7D\u4E2D...",
7685
+ mask: true
7057
7686
  });
7058
7687
  isLoading.value = true;
7059
7688
  const $http = useHttp$1();
@@ -7110,8 +7739,8 @@ const _hoisted_3$7 = {
7110
7739
  key: 0,
7111
7740
  class: "wrapper"
7112
7741
  };
7113
- const _hoisted_4$5 = ["onClick"];
7114
- const _hoisted_5$4 = { class: "time" };
7742
+ const _hoisted_4$6 = ["onClick"];
7743
+ const _hoisted_5$5 = { class: "time" };
7115
7744
  const _hoisted_6$3 = {
7116
7745
  key: 0,
7117
7746
  class: "notice-list-label"
@@ -7244,7 +7873,7 @@ var script$f = /* @__PURE__ */ defineComponent({
7244
7873
  createElementVNode("div", null, [
7245
7874
  createElementVNode(
7246
7875
  "div",
7247
- _hoisted_5$4,
7876
+ _hoisted_5$5,
7248
7877
  toDisplayString(formatMinutes(item.receiveTime)),
7249
7878
  1
7250
7879
  /* TEXT */
@@ -7301,7 +7930,7 @@ var script$f = /* @__PURE__ */ defineComponent({
7301
7930
  /* CLASS */
7302
7931
  )
7303
7932
  ])
7304
- ], 10, _hoisted_4$5)), [
7933
+ ], 10, _hoisted_4$6)), [
7305
7934
  [_directive_track_click, "\u6D88\u606F\u8BE6\u60C5"]
7306
7935
  ]);
7307
7936
  }),
@@ -7343,16 +7972,21 @@ var script$f = /* @__PURE__ */ defineComponent({
7343
7972
 
7344
7973
  script$f.__file = "src/notice/components/NoticeList.vue";
7345
7974
 
7346
- const _hoisted_1$d = {
7975
+ const _hoisted_1$d = ["onClick"];
7976
+ const _hoisted_2$9 = {
7977
+ key: 0,
7978
+ class: "custom-title-dot"
7979
+ };
7980
+ const _hoisted_3$6 = {
7347
7981
  key: 0,
7348
7982
  class: "read-all"
7349
7983
  };
7350
- const _hoisted_2$9 = {
7984
+ const _hoisted_4$5 = {
7351
7985
  key: 0,
7352
7986
  class: "news-item-title-icon",
7353
- src: "https://cdn.ddjf.com/static/images/loan-manage-app/ic_msg_system_notice.webp"
7987
+ src: "https://cdn.ddjf.com/static/images/fnfundkit/ic_msg_system_notice.png"
7354
7988
  };
7355
- const _hoisted_3$6 = { class: "news-item-time" };
7989
+ const _hoisted_5$4 = { class: "news-item-time" };
7356
7990
  var script$e = /* @__PURE__ */ defineComponent({
7357
7991
  __name: "NoticeList2",
7358
7992
  props: {
@@ -7363,9 +7997,28 @@ var script$e = /* @__PURE__ */ defineComponent({
7363
7997
  emits: ["itemClick"],
7364
7998
  setup(__props, { expose: __expose, emit: __emit }) {
7365
7999
  const props = __props;
8000
+ const tabList = ref([
8001
+ {
8002
+ label: "\u5168\u90E8",
8003
+ value: "\u5168\u90E8"
8004
+ },
8005
+ {
8006
+ label: "\u4E1A\u52A1\u6D88\u606F",
8007
+ value: "\u4E1A\u52A1\u6D88\u606F"
8008
+ },
8009
+ {
8010
+ label: "\u7CFB\u7EDF\u516C\u544A",
8011
+ value: "\u7CFB\u7EDF\u516C\u544A"
8012
+ },
8013
+ {
8014
+ label: "\u672A\u8BFB",
8015
+ value: "\u672A\u8BFB"
8016
+ }
8017
+ ]);
7366
8018
  const $http = useHttp$1(), \u663E\u793A\u9AA8\u67B6\u5C4F = ref(true);
7367
8019
  useDidShow(() => {
7368
8020
  nextPage(1);
8021
+ getNotice();
7369
8022
  });
7370
8023
  const state = reactive({
7371
8024
  search: "",
@@ -7418,6 +8071,7 @@ var script$e = /* @__PURE__ */ defineComponent({
7418
8071
  }
7419
8072
  function itemClick(item) {
7420
8073
  read(item);
8074
+ getNotice();
7421
8075
  emits("itemClick", item);
7422
8076
  }
7423
8077
  function read(item) {
@@ -7430,7 +8084,8 @@ var script$e = /* @__PURE__ */ defineComponent({
7430
8084
  async function readAll() {
7431
8085
  try {
7432
8086
  showLoading({
7433
- title: "\u8BF7\u7A0D\u540E..."
8087
+ title: "\u8BF7\u7A0D\u540E...",
8088
+ mask: true
7434
8089
  });
7435
8090
  const appkitOptions = useAppKitOptions();
7436
8091
  const ep = endpoints["\u5168\u90E8\u5DF2\u8BFB"];
@@ -7445,9 +8100,26 @@ var script$e = /* @__PURE__ */ defineComponent({
7445
8100
  });
7446
8101
  });
7447
8102
  } finally {
8103
+ setTimeout(() => {
8104
+ getNotice();
8105
+ }, 300);
7448
8106
  hideLoading();
7449
8107
  }
7450
8108
  }
8109
+ const noticeShow = ref(false);
8110
+ async function getNotice() {
8111
+ const appkitOptions = useAppKitOptions();
8112
+ const $http2 = useHttp$1();
8113
+ $http2.get("/cas/msg/count-unread", {
8114
+ deviceType: 2,
8115
+ appCode: props.app,
8116
+ tenantId: appkitOptions.tenant(),
8117
+ userId: props.userId
8118
+ }).then((result) => {
8119
+ if (typeof result === "object") return;
8120
+ noticeShow.value = result > 0;
8121
+ });
8122
+ }
7451
8123
  const emits = __emit;
7452
8124
  __expose({
7453
8125
  readAll
@@ -7463,7 +8135,7 @@ var script$e = /* @__PURE__ */ defineComponent({
7463
8135
  class: normalizeClass(["tabContainer", { inH5: unref(isWeb)() }])
7464
8136
  },
7465
8137
  [
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> '),
8138
+ 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> '),
7467
8139
  createVNode(unref(NsTabs), {
7468
8140
  modelValue: state.tab,
7469
8141
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.tab = $event),
@@ -7471,30 +8143,50 @@ var script$e = /* @__PURE__ */ defineComponent({
7471
8143
  square: "",
7472
8144
  size: "xl",
7473
8145
  style: { "height": "46px" },
7474
- onChange: onTabChange
8146
+ class: "news-tab",
8147
+ items: tabList.value
7475
8148
  }, {
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
- })
8149
+ titles: withCtx(() => [
8150
+ (openBlock(true), createElementBlock(
8151
+ Fragment,
8152
+ null,
8153
+ renderList(tabList.value, (item) => {
8154
+ return openBlock(), createElementBlock("div", {
8155
+ class: normalizeClass([{ customLine: state.tab === item.value }, "nut-tabs__titles-item custom-tab-item"]),
8156
+ key: item.value,
8157
+ onClick: ($event) => {
8158
+ state.tab = item.value;
8159
+ onTabChange();
8160
+ }
8161
+ }, [
8162
+ createElementVNode(
8163
+ "div",
8164
+ {
8165
+ class: normalizeClass(["custom-title", { active: state.tab === item.value }])
8166
+ },
8167
+ [
8168
+ createElementVNode(
8169
+ "div",
8170
+ null,
8171
+ toDisplayString(item.label),
8172
+ 1
8173
+ /* TEXT */
8174
+ ),
8175
+ item.value === "\u672A\u8BFB" && noticeShow.value ? (openBlock(), createElementBlock("div", _hoisted_2$9, " \u2022\u2022\u2022 ")) : createCommentVNode("v-if", true)
8176
+ ],
8177
+ 2
8178
+ /* CLASS */
8179
+ )
8180
+ ], 10, _hoisted_1$d);
8181
+ }),
8182
+ 128
8183
+ /* KEYED_FRAGMENT */
8184
+ ))
7493
8185
  ]),
7494
8186
  _: 1
7495
8187
  /* STABLE */
7496
- }, 8, ["modelValue"]),
7497
- state.list.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
8188
+ }, 8, ["modelValue", "items"]),
8189
+ state.list.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
7498
8190
  withDirectives((openBlock(), createElementBlock("div", {
7499
8191
  class: "btn",
7500
8192
  onClick: readAll
@@ -7551,7 +8243,7 @@ var script$e = /* @__PURE__ */ defineComponent({
7551
8243
  class: "news-item-title"
7552
8244
  },
7553
8245
  [
7554
- item.\u662F\u516C\u544A ? (openBlock(), createElementBlock("img", _hoisted_2$9)) : createCommentVNode("v-if", true),
8246
+ item.\u662F\u516C\u544A ? (openBlock(), createElementBlock("img", _hoisted_4$5)) : createCommentVNode("v-if", true),
7555
8247
  createTextVNode(
7556
8248
  " " + toDisplayString(item.\u6807\u9898),
7557
8249
  1
@@ -7572,7 +8264,7 @@ var script$e = /* @__PURE__ */ defineComponent({
7572
8264
  }, null, 8, ["style", "content"]),
7573
8265
  createElementVNode(
7574
8266
  "div",
7575
- _hoisted_3$6,
8267
+ _hoisted_5$4,
7576
8268
  toDisplayString(item.\u65F6\u95F4),
7577
8269
  1
7578
8270
  /* TEXT */
@@ -7830,7 +8522,7 @@ const vendor = {
7830
8522
  traceId: header.traceId,
7831
8523
  duration: endTime - startTime
7832
8524
  });
7833
- if (data.success) {
8525
+ if (data.success || data.code === "401") {
7834
8526
  resolve({
7835
8527
  status: +data.code,
7836
8528
  message: data.msg,
@@ -7853,7 +8545,7 @@ function useHttp() {
7853
8545
  const headers = {
7854
8546
  Token: appkitOptions.tempToken() || appkitOptions.token(),
7855
8547
  Appcode: appkitOptions.app(),
7856
- cookie: `tid=${appkitOptions.tenant()}`,
8548
+ tid: appkitOptions.tenant(),
7857
8549
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
7858
8550
  };
7859
8551
  const $http = createHttp({
@@ -8029,7 +8721,8 @@ var script$b = /* @__PURE__ */ defineComponent({
8029
8721
  }
8030
8722
  async function updateImage(filePath) {
8031
8723
  showLoading({
8032
- title: "\u4E0A\u4F20\u4E2D..."
8724
+ title: "\u4E0A\u4F20\u4E2D...",
8725
+ mask: true
8033
8726
  });
8034
8727
  const appkitOptions = useAppKitOptions();
8035
8728
  const $http = useHttp();
@@ -8142,6 +8835,7 @@ var script$b = /* @__PURE__ */ defineComponent({
8142
8835
  title: "\u63D0\u793A",
8143
8836
  content: "\u786E\u5B9A\u8981\u9000\u51FA\u767B\u5F55\u5417\uFF1F",
8144
8837
  confirmText: "\u786E\u5B9A",
8838
+ confirmColor: "#017fff",
8145
8839
  success: async (e) => {
8146
8840
  if (e.confirm) {
8147
8841
  emits("logout");
@@ -10005,7 +10699,8 @@ var script$6 = /* @__PURE__ */ defineComponent({
10005
10699
  const $http = useHttp();
10006
10700
  const appkitOptions = useAppKitOptions();
10007
10701
  showLoading({
10008
- title: "\u53CD\u9988\u4E2D..."
10702
+ title: "\u53CD\u9988\u4E2D...",
10703
+ mask: true
10009
10704
  });
10010
10705
  const attachment = JSON.parse(
10011
10706
  JSON.stringify(
@@ -10715,8 +11410,9 @@ var script$2 = /* @__PURE__ */ defineComponent({
10715
11410
  rules: ["required"]
10716
11411
  }, {
10717
11412
  append: withCtx(() => [
10718
- !\u5DF2\u8BA4\u8BC1.value ? (openBlock(), createBlock(unref(script$G), {
11413
+ !\u5DF2\u8BA4\u8BC1.value ? (openBlock(), createBlock(unref(script$I), {
10719
11414
  key: 0,
11415
+ "has-upload-vo": false,
10720
11416
  onComplete: onOcrComplete
10721
11417
  })) : createCommentVNode("v-if", true)
10722
11418
  ]),
@@ -11325,4 +12021,4 @@ const AppKit = {
11325
12021
  }
11326
12022
  };
11327
12023
 
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 };
12024
+ 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 };