@uxda/appkit 4.2.48 → 4.2.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +48 -26
- package/package.json +1 -1
- package/src/payment/components/RechargeView.vue +6 -8
- package/src/payment/types.ts +1 -0
- package/src/shared/components/OcrBusinessLicense.vue +18 -11
- package/src/shared/components/OcrIcon.vue +33 -17
- package/src/user/components/UserFeedback.vue +2 -2
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import '@nutui/nutui-taro/dist/packages/checkbox/style/css';
|
|
|
4
4
|
import { defineComponent, reactive, createBlock, openBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, ref, computed, onUnmounted, createCommentVNode, renderSlot, createVNode, normalizeStyle, unref, isRef, onMounted, createStaticVNode, watch, withDirectives, vShow, useModel, mergeModels, 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, { getSystemInfoSync, getMenuButtonBoundingClientRect, request as request$1, showToast, showLoading, hideLoading, useDidShow, useRouter } from '@tarojs/taro';
|
|
7
|
+
import Taro, { getSystemInfoSync, getMenuButtonBoundingClientRect, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, uploadFile, hideLoading, useDidShow, 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';
|
|
@@ -1041,18 +1041,22 @@ var script$D = /* @__PURE__ */ defineComponent({
|
|
|
1041
1041
|
const emits = __emit;
|
|
1042
1042
|
const props = __props;
|
|
1043
1043
|
async function taroImgCompress(src, quality = 80) {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1044
|
+
if (Taro.getEnv() === "WEB") {
|
|
1045
|
+
return src;
|
|
1046
|
+
} else {
|
|
1047
|
+
return new Promise((resolve, reject) => {
|
|
1048
|
+
Taro.compressImage({
|
|
1049
|
+
src,
|
|
1050
|
+
quality,
|
|
1051
|
+
success: (res) => {
|
|
1052
|
+
resolve(res);
|
|
1053
|
+
},
|
|
1054
|
+
fail: (res) => {
|
|
1055
|
+
reject(res);
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1054
1058
|
});
|
|
1055
|
-
}
|
|
1059
|
+
}
|
|
1056
1060
|
}
|
|
1057
1061
|
function getCompressQuality(size) {
|
|
1058
1062
|
let quality = 100;
|
|
@@ -1068,13 +1072,20 @@ var script$D = /* @__PURE__ */ defineComponent({
|
|
|
1068
1072
|
async function onUploadFile(csRes) {
|
|
1069
1073
|
let result = null;
|
|
1070
1074
|
try {
|
|
1075
|
+
console.log("===\u4E0A\u4F20", csRes);
|
|
1071
1076
|
let { path, size, tempFilePath } = csRes.tempFiles[0];
|
|
1072
|
-
|
|
1073
|
-
|
|
1077
|
+
let filePath;
|
|
1078
|
+
if (Taro.getEnv() !== "WEB") {
|
|
1079
|
+
const compressImg = await taroImgCompress(path || tempFilePath, getCompressQuality(size)) || {};
|
|
1080
|
+
filePath = compressImg.tempFilePath || path;
|
|
1081
|
+
} else {
|
|
1082
|
+
filePath = path || tempFilePath;
|
|
1083
|
+
}
|
|
1084
|
+
console.log(filePath, "filePath");
|
|
1074
1085
|
showLoading({ title: "\u8EAB\u4EFD\u8BC1\u8BC6\u522B\u4E2D.." });
|
|
1075
1086
|
const session = appKitOptions.token();
|
|
1076
1087
|
const baseUrl = appKitOptions.baseUrl();
|
|
1077
|
-
const upRes = await
|
|
1088
|
+
const upRes = await uploadFile({
|
|
1078
1089
|
url: baseUrl + "/hkapprove/ocr/idcard",
|
|
1079
1090
|
filePath,
|
|
1080
1091
|
name: "file",
|
|
@@ -1137,9 +1148,12 @@ var script$D = /* @__PURE__ */ defineComponent({
|
|
|
1137
1148
|
type: "message"
|
|
1138
1149
|
}
|
|
1139
1150
|
];
|
|
1151
|
+
if (Taro.getEnv() === "WEB") {
|
|
1152
|
+
actionSheetMenus.pop();
|
|
1153
|
+
}
|
|
1140
1154
|
async function chooseImages(item) {
|
|
1141
1155
|
if (["camera", "album"].includes(item.type)) {
|
|
1142
|
-
const csRes = await
|
|
1156
|
+
const csRes = await chooseMedia({
|
|
1143
1157
|
count: 1,
|
|
1144
1158
|
sourceType: [item.type],
|
|
1145
1159
|
// "camera" | "album"
|
|
@@ -1148,7 +1162,7 @@ var script$D = /* @__PURE__ */ defineComponent({
|
|
|
1148
1162
|
});
|
|
1149
1163
|
onUploadFile(csRes);
|
|
1150
1164
|
} else {
|
|
1151
|
-
const csRes = await
|
|
1165
|
+
const csRes = await chooseMessageFile({
|
|
1152
1166
|
count: 1,
|
|
1153
1167
|
type: "image"
|
|
1154
1168
|
});
|
|
@@ -1238,16 +1252,22 @@ var script$C = /* @__PURE__ */ defineComponent({
|
|
|
1238
1252
|
console.log("===onIconClick");
|
|
1239
1253
|
let result = null;
|
|
1240
1254
|
try {
|
|
1241
|
-
const csRes = await Taro.
|
|
1242
|
-
count: 1
|
|
1255
|
+
const csRes = await Taro.chooseMedia({
|
|
1256
|
+
count: 1,
|
|
1257
|
+
sourceType: ["album", "camera"]
|
|
1243
1258
|
});
|
|
1244
|
-
let {
|
|
1245
|
-
|
|
1246
|
-
|
|
1259
|
+
let { size, tempFilePath } = csRes.tempFiles[0];
|
|
1260
|
+
let filePath;
|
|
1261
|
+
if (Taro.getEnv() !== "WEB") {
|
|
1262
|
+
const compressImg = await taroImgCompress(tempFilePath, getCompressQuality(size)) || {};
|
|
1263
|
+
filePath = compressImg.tempFilePath;
|
|
1264
|
+
} else {
|
|
1265
|
+
filePath = tempFilePath;
|
|
1266
|
+
}
|
|
1247
1267
|
showLoading({ title: "\u8425\u4E1A\u6267\u7167\u8BC6\u522B\u4E2D.." });
|
|
1248
1268
|
const session = appKitOptions.token();
|
|
1249
1269
|
const baseUrl = appKitOptions.baseUrl();
|
|
1250
|
-
const upRes = await
|
|
1270
|
+
const upRes = await uploadFile({
|
|
1251
1271
|
url: baseUrl + "/promoact/common/parseBusinessLicense",
|
|
1252
1272
|
filePath,
|
|
1253
1273
|
name: "file",
|
|
@@ -1664,7 +1684,8 @@ var script$B = /* @__PURE__ */ defineComponent({
|
|
|
1664
1684
|
__name: "RechargeView",
|
|
1665
1685
|
props: {
|
|
1666
1686
|
app: { type: String, required: true },
|
|
1667
|
-
tenant: { type: String, required: true }
|
|
1687
|
+
tenant: { type: String, required: true },
|
|
1688
|
+
payFinishJumpUrl: { type: String, required: false }
|
|
1668
1689
|
},
|
|
1669
1690
|
emits: ["complete", "agree"],
|
|
1670
1691
|
setup(__props, { emit: __emit }) {
|
|
@@ -1709,7 +1730,8 @@ var script$B = /* @__PURE__ */ defineComponent({
|
|
|
1709
1730
|
app: "loankitMp",
|
|
1710
1731
|
tenant: props.tenant,
|
|
1711
1732
|
accountAuthFlag: false,
|
|
1712
|
-
channelCode: "centergzh"
|
|
1733
|
+
channelCode: "centergzh",
|
|
1734
|
+
payFinishJumpUrl: props.payFinishJumpUrl
|
|
1713
1735
|
}).then((result) => {
|
|
1714
1736
|
console.log(result);
|
|
1715
1737
|
});
|
|
@@ -7737,7 +7759,7 @@ var script$4 = /* @__PURE__ */ defineComponent({
|
|
|
7737
7759
|
icon: "none"
|
|
7738
7760
|
});
|
|
7739
7761
|
}
|
|
7740
|
-
|
|
7762
|
+
chooseMedia({
|
|
7741
7763
|
count: 20 - formState.attachment.length,
|
|
7742
7764
|
mediaType: ["mix"],
|
|
7743
7765
|
maxDuration: 60,
|
package/package.json
CHANGED
|
@@ -20,7 +20,6 @@ import AmountPicker from './AmountPicker.vue'
|
|
|
20
20
|
import { useHttp, endpoints } from '../api'
|
|
21
21
|
import { requestBrandWCPay, requestPayment } from '../services'
|
|
22
22
|
import Taro, { showToast } from '@tarojs/taro'
|
|
23
|
-
import { getSdkConfig } from '../../shared'
|
|
24
23
|
|
|
25
24
|
// 充值用户界面
|
|
26
25
|
// 配置了必须的属性后
|
|
@@ -38,7 +37,11 @@ export interface RechargeViewProps {
|
|
|
38
37
|
/**
|
|
39
38
|
* 租户
|
|
40
39
|
*/
|
|
41
|
-
tenant: string
|
|
40
|
+
tenant: string,
|
|
41
|
+
/**
|
|
42
|
+
* h5支付完成后跳转地址
|
|
43
|
+
*/
|
|
44
|
+
payFinishJumpUrl?: ''
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
const props = defineProps<RechargeViewProps>()
|
|
@@ -68,13 +71,7 @@ const onAmountSelect = (selected: number) => {
|
|
|
68
71
|
state.selected = selected
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
// const 公众号配置 = ref<any>()
|
|
72
|
-
|
|
73
74
|
onMounted(async () => {
|
|
74
|
-
// if (Taro.getEnv() === 'WEB') {
|
|
75
|
-
// 公众号配置.value = await getSdkConfig('loankitMp')
|
|
76
|
-
// }
|
|
77
|
-
|
|
78
75
|
const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' ? props.app : '', Tenant: props.tenant })
|
|
79
76
|
|
|
80
77
|
$http.get<any[]>(endpoints.获取充值金额列表, {
|
|
@@ -102,6 +99,7 @@ const onPayClick = () => {
|
|
|
102
99
|
tenant: props.tenant,
|
|
103
100
|
accountAuthFlag: false,
|
|
104
101
|
channelCode: 'centergzh',
|
|
102
|
+
payFinishJumpUrl: props.payFinishJumpUrl
|
|
105
103
|
}).then(result => {
|
|
106
104
|
console.log(result), 'result'
|
|
107
105
|
})
|
package/src/payment/types.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
|
-
import Taro, { showToast, showLoading, hideLoading } from '@tarojs/taro';
|
|
8
|
+
import Taro, { showToast, showLoading, hideLoading, uploadFile } from '@tarojs/taro';
|
|
9
9
|
import { NsIcon } from '@uxda/nutshell/taro';
|
|
10
10
|
import { useAppKitOptions } from '../../Appkit';
|
|
11
11
|
|
|
@@ -31,13 +31,13 @@ async function taroImgCompress(src: string, quality = 80) {
|
|
|
31
31
|
src: src,
|
|
32
32
|
quality: quality,
|
|
33
33
|
success: (res) => {
|
|
34
|
-
resolve(res)
|
|
34
|
+
resolve(res)
|
|
35
35
|
},
|
|
36
36
|
fail: (res) => {
|
|
37
|
-
reject(res)
|
|
37
|
+
reject(res)
|
|
38
38
|
},
|
|
39
|
-
})
|
|
40
|
-
})
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function getCompressQuality(size: number) {
|
|
@@ -60,17 +60,24 @@ async function onIconClick() {
|
|
|
60
60
|
console.log('===onIconClick');
|
|
61
61
|
let result: OcrResult | null = null;
|
|
62
62
|
try {
|
|
63
|
-
const csRes = await Taro.
|
|
63
|
+
const csRes = await Taro.chooseMedia({
|
|
64
64
|
count: 1,
|
|
65
|
+
sourceType: ['album', 'camera']
|
|
65
66
|
});
|
|
66
|
-
let {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
let { size, tempFilePath } = csRes.tempFiles[0];
|
|
68
|
+
let filePath
|
|
69
|
+
if (Taro.getEnv() !== 'WEB') {
|
|
70
|
+
const compressImg: any = (await taroImgCompress(tempFilePath, getCompressQuality(size))) || {}
|
|
71
|
+
filePath = compressImg.tempFilePath
|
|
72
|
+
} else {
|
|
73
|
+
filePath = tempFilePath
|
|
74
|
+
}
|
|
75
|
+
|
|
70
76
|
showLoading({ title: '营业执照识别中..' });
|
|
77
|
+
|
|
71
78
|
const session = appKitOptions.token();
|
|
72
79
|
const baseUrl = appKitOptions.baseUrl();
|
|
73
|
-
const upRes: any = await
|
|
80
|
+
const upRes: any = await uploadFile({
|
|
74
81
|
url: baseUrl + '/promoact/common/parseBusinessLicense',
|
|
75
82
|
filePath,
|
|
76
83
|
name: 'file',
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script lang="ts" setup>
|
|
13
|
-
import Taro, { showToast, showLoading, hideLoading } from '@tarojs/taro'
|
|
13
|
+
import Taro, { showToast, showLoading, hideLoading, chooseMedia, chooseMessageFile, uploadFile } from '@tarojs/taro'
|
|
14
14
|
import { NsIcon } from '@uxda/nutshell/taro'
|
|
15
15
|
import { useAppKitOptions } from '../../Appkit'
|
|
16
16
|
import { ref } from 'vue';
|
|
@@ -50,18 +50,22 @@ type OcrResultType = {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
async function taroImgCompress(src: string, quality = 80) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
if (Taro.getEnv() === 'WEB') {
|
|
54
|
+
return src;
|
|
55
|
+
} else {
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
Taro.compressImage({
|
|
58
|
+
src: src,
|
|
59
|
+
quality: quality,
|
|
60
|
+
success: (res) => {
|
|
61
|
+
resolve(res)
|
|
62
|
+
},
|
|
63
|
+
fail: (res) => {
|
|
64
|
+
reject(res)
|
|
65
|
+
},
|
|
66
|
+
})
|
|
63
67
|
})
|
|
64
|
-
}
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
function getCompressQuality(size: number) {
|
|
@@ -80,14 +84,22 @@ function allTrim(str: string) {
|
|
|
80
84
|
async function onUploadFile(csRes: any) {
|
|
81
85
|
let result: OcrResultType | null = null
|
|
82
86
|
try {
|
|
87
|
+
console.log('===上传', csRes)
|
|
83
88
|
let { path, size, tempFilePath } = csRes.tempFiles[0]
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
let filePath
|
|
90
|
+
if (Taro.getEnv() !== 'WEB') {
|
|
91
|
+
const compressImg: any = (await taroImgCompress(path || tempFilePath, getCompressQuality(size))) || {}
|
|
92
|
+
filePath = compressImg.tempFilePath || path
|
|
93
|
+
} else {
|
|
94
|
+
filePath = path || tempFilePath
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
console.log(filePath, 'filePath')
|
|
86
98
|
showLoading({ title: '身份证识别中..' })
|
|
87
99
|
|
|
88
100
|
const session = appKitOptions.token()
|
|
89
101
|
const baseUrl = appKitOptions.baseUrl()
|
|
90
|
-
const upRes: any = await
|
|
102
|
+
const upRes: any = await uploadFile({
|
|
91
103
|
url: baseUrl + '/hkapprove/ocr/idcard',
|
|
92
104
|
filePath,
|
|
93
105
|
name: 'file',
|
|
@@ -154,10 +166,14 @@ const actionSheetMenus = [
|
|
|
154
166
|
type: 'message',
|
|
155
167
|
},
|
|
156
168
|
]
|
|
169
|
+
if (Taro.getEnv() === 'WEB') {
|
|
170
|
+
actionSheetMenus.pop()
|
|
171
|
+
}
|
|
172
|
+
|
|
157
173
|
// 选择图像上传
|
|
158
174
|
async function chooseImages(item: any) {
|
|
159
175
|
if (['camera', 'album'].includes(item.type)) {
|
|
160
|
-
const csRes = await
|
|
176
|
+
const csRes = await chooseMedia({
|
|
161
177
|
count: 1,
|
|
162
178
|
sourceType: [item.type], // "camera" | "album"
|
|
163
179
|
maxDuration: 60, // 使用duration属性判断是图片还是视频,图片没有该属性
|
|
@@ -165,7 +181,7 @@ async function chooseImages(item: any) {
|
|
|
165
181
|
|
|
166
182
|
onUploadFile(csRes)
|
|
167
183
|
} else {
|
|
168
|
-
const csRes = await
|
|
184
|
+
const csRes = await chooseMessageFile({
|
|
169
185
|
count: 1,
|
|
170
186
|
type: 'image',
|
|
171
187
|
})
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script lang="ts" setup>
|
|
41
|
-
import Taro, { showToast, showLoading } from '@tarojs/taro'
|
|
41
|
+
import Taro, { showToast, showLoading, chooseMedia } from '@tarojs/taro'
|
|
42
42
|
import { onMounted, reactive, ref } from 'vue'
|
|
43
43
|
import { useAppKitOptions } from '../../Appkit'
|
|
44
44
|
import { useHttp } from '../api'
|
|
@@ -107,7 +107,7 @@ function toUpload() {
|
|
|
107
107
|
icon: 'none',
|
|
108
108
|
})
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
chooseMedia({
|
|
111
111
|
count: 20 - formState.attachment.length,
|
|
112
112
|
mediaType: ['mix'],
|
|
113
113
|
maxDuration: 60,
|