@uxda/appkit 4.1.60 → 4.2.0

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 CHANGED
@@ -6,14 +6,15 @@ import '@nutui/nutui-taro/dist/packages/grid/style/css';
6
6
  import '@nutui/nutui-taro/dist/packages/griditem/style/css';
7
7
  import Taro, { useDidShow, useRouter } from '@tarojs/taro';
8
8
  import '@nutui/nutui-taro/dist/packages/popup/style/css';
9
- import { isIdentityCard, isMobilePhone } from 'validator';
9
+ import isMobilePhone from 'validator/es/lib/isMobilePhone';
10
+ import isIdentityCard from 'validator/es/lib/isIdentityCard';
10
11
  import { NsForm, NsInput, NsButton, NsIcon, usePopup, useNutshell, NsPage, NsPageContent, NsCard, NsCheckbox } from '@uxda/nutshell/taro';
11
12
  import '@nutui/nutui-taro/dist/packages/actionsheet/style/css';
12
- import debounce from 'lodash/debounce';
13
+ import debounce from 'lodash-es/debounce';
13
14
  import '@nutui/nutui-taro/dist/packages/dialog/style/css';
14
15
  import '@nutui/nutui-taro/dist/packages/datepicker/style/css';
15
16
  import dayjs from 'dayjs';
16
- import groupBy from 'lodash/groupBy';
17
+ import groupBy from 'lodash-es/groupBy';
17
18
  import { IconFont } from '@nutui/icons-vue-taro';
18
19
  import '@nutui/nutui-taro/dist/packages/form/style/css';
19
20
  import '@nutui/nutui-taro/dist/packages/formitem/style/css';
@@ -5844,7 +5845,12 @@ var script$9 = /* @__PURE__ */ defineComponent({
5844
5845
  emits("binding", userInfo.value.mobile || "");
5845
5846
  }
5846
5847
  function toAuth() {
5847
- emits("auth", props.userId);
5848
+ emits(
5849
+ "auth",
5850
+ props.userId,
5851
+ userInfo.value?.verifyResult,
5852
+ userInfo.value?.mobile
5853
+ );
5848
5854
  }
5849
5855
  const emits = __emit;
5850
5856
  __expose({
@@ -5921,7 +5927,8 @@ var script$9 = /* @__PURE__ */ defineComponent({
5921
5927
  }, {
5922
5928
  desc: withCtx(() => [
5923
5929
  userInfo.value?.verifyResult == 1 ? (openBlock(), createElementBlock("span", _hoisted_5$2, "\u5DF2\u8BA4\u8BC1")) : createCommentVNode("v-if", true),
5924
- userInfo.value?.verifyResult == 0 ? (openBlock(), createElementBlock("span", _hoisted_6$1, "\u5DF2\u5931\u6548\uFF0C\u91CD\u65B0\u8BA4\u8BC1")) : (openBlock(), createElementBlock("span", _hoisted_7$1, "\u672A\u8BA4\u8BC1\uFF0C\u53BB\u8BA4\u8BC1"))
5930
+ userInfo.value?.verifyResult == 0 ? (openBlock(), createElementBlock("span", _hoisted_6$1, "\u5DF2\u5931\u6548\uFF0C\u91CD\u65B0\u8BA4\u8BC1")) : createCommentVNode("v-if", true),
5931
+ userInfo.value?.verifyResult != 0 && userInfo.value?.verifyResult != 1 ? (openBlock(), createElementBlock("span", _hoisted_7$1, "\u672A\u8BA4\u8BC1\uFF0C\u53BB\u8BA4\u8BC1")) : createCommentVNode("v-if", true)
5925
5932
  ]),
5926
5933
  _: 1
5927
5934
  /* STABLE */
@@ -8112,13 +8119,15 @@ const _hoisted_2 = {
8112
8119
  var script = /* @__PURE__ */ defineComponent({
8113
8120
  __name: "UserAuth",
8114
8121
  props: {
8115
- userId: { type: String, required: true, default: "" }
8122
+ userId: { type: String, required: true, default: "" },
8123
+ verifyResult: { type: Number, required: true, default: -1 },
8124
+ mobile: { type: String, required: true, default: "" }
8116
8125
  },
8117
8126
  emits: ["toAgreement"],
8118
8127
  setup(__props, { emit: __emit }) {
8119
8128
  const props = __props;
8120
8129
  const formRef = ref(), $n = useNutshell();
8121
- const formData = reactive({
8130
+ let formData = reactive({
8122
8131
  \u59D3\u540D: "",
8123
8132
  \u8EAB\u4EFD\u8BC1\u53F7\u7801: "",
8124
8133
  \u7535\u8BDD\u53F7\u7801: "",
@@ -8151,12 +8160,28 @@ var script = /* @__PURE__ */ defineComponent({
8151
8160
  name: formData.\u59D3\u540D,
8152
8161
  tenantId: props.userId
8153
8162
  }).then(() => {
8154
- Taro.showToast({ title: "\u8BA4\u8BC1\u6210\u529F", icon: "none" });
8163
+ Taro.showToast({ title: "\u5DF2\u63D0\u4EA4\u8BA4\u8BC1\u4FE1\u606F", icon: "none" });
8155
8164
  toBack();
8156
8165
  }).catch((err) => {
8157
8166
  Taro.showToast({ title: err?.errMsg || "\u8BA4\u8BC1\u5931\u8D25", icon: "none" });
8158
8167
  });
8159
8168
  }
8169
+ watch(
8170
+ () => props.verifyResult,
8171
+ () => {
8172
+ if (props.verifyResult == 1) {
8173
+ \u5DF2\u8BA4\u8BC1.value = true;
8174
+ }
8175
+ },
8176
+ { deep: true, immediate: true }
8177
+ );
8178
+ watch(
8179
+ () => props.mobile,
8180
+ () => {
8181
+ formData.\u7535\u8BDD\u53F7\u7801 = props.mobile;
8182
+ },
8183
+ { deep: true, immediate: true }
8184
+ );
8160
8185
  const emits = __emit;
8161
8186
  return (_ctx, _cache) => {
8162
8187
  return openBlock(), createBlock(unref(NsPage), { class: "user-auth" }, {
@@ -8168,21 +8193,24 @@ var script = /* @__PURE__ */ defineComponent({
8168
8193
  createVNode(unref(NsForm), {
8169
8194
  ref_key: "formRef",
8170
8195
  ref: formRef,
8171
- modelValue: formData,
8172
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => formData = $event)
8196
+ modelValue: unref(formData),
8197
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(formData) ? formData.value = $event : formData = $event)
8173
8198
  }, {
8174
8199
  default: withCtx(() => [
8175
8200
  createVNode(unref(NsInput), {
8176
8201
  label: "\u4F60\u7684\u59D3\u540D",
8177
8202
  name: "\u59D3\u540D",
8178
- modelValue: formData.\u59D3\u540D,
8179
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.\u59D3\u540D = $event),
8203
+ modelValue: unref(formData).\u59D3\u540D,
8204
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(formData).\u59D3\u540D = $event),
8180
8205
  placeholder: "\u8BF7\u8F93\u5165\u6216\u62CD\u7167\u8BC6\u522B",
8181
8206
  maxlength: 30,
8182
8207
  rules: ["required"]
8183
8208
  }, {
8184
8209
  append: withCtx(() => [
8185
- createVNode(unref(script$D), { onComplete: onOcrComplete })
8210
+ !\u5DF2\u8BA4\u8BC1.value ? (openBlock(), createBlock(unref(script$D), {
8211
+ key: 0,
8212
+ onComplete: onOcrComplete
8213
+ })) : createCommentVNode("v-if", true)
8186
8214
  ]),
8187
8215
  _: 1
8188
8216
  /* STABLE */
@@ -8192,8 +8220,8 @@ var script = /* @__PURE__ */ defineComponent({
8192
8220
  name: "\u8EAB\u4EFD\u8BC1\u53F7\u7801",
8193
8221
  placeholder: "\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7\u7801",
8194
8222
  maxlength: 30,
8195
- modelValue: formData.\u8EAB\u4EFD\u8BC1\u53F7\u7801,
8196
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formData.\u8EAB\u4EFD\u8BC1\u53F7\u7801 = $event),
8223
+ modelValue: unref(formData).\u8EAB\u4EFD\u8BC1\u53F7\u7801,
8224
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(formData).\u8EAB\u4EFD\u8BC1\u53F7\u7801 = $event),
8197
8225
  rules: [
8198
8226
  "required",
8199
8227
  {
@@ -8208,8 +8236,9 @@ var script = /* @__PURE__ */ defineComponent({
8208
8236
  name: "\u7535\u8BDD\u53F7\u7801",
8209
8237
  placeholder: "\u8BF7\u8F93\u5165\u7535\u8BDD\u53F7\u7801",
8210
8238
  maxlength: 11,
8211
- modelValue: formData.\u7535\u8BDD\u53F7\u7801,
8212
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.\u7535\u8BDD\u53F7\u7801 = $event),
8239
+ modelValue: unref(formData).\u7535\u8BDD\u53F7\u7801,
8240
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(formData).\u7535\u8BDD\u53F7\u7801 = $event),
8241
+ disabled: true,
8213
8242
  rules: [
8214
8243
  {
8215
8244
  name: "function",
@@ -8230,8 +8259,8 @@ var script = /* @__PURE__ */ defineComponent({
8230
8259
  !\u5DF2\u8BA4\u8BC1.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
8231
8260
  createVNode(unref(NsCheckbox), {
8232
8261
  style: { "font-size": "11px" },
8233
- modelValue: formData.\u540C\u610F,
8234
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => formData.\u540C\u610F = $event)
8262
+ modelValue: unref(formData).\u540C\u610F,
8263
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(formData).\u540C\u610F = $event)
8235
8264
  }, {
8236
8265
  default: withCtx(() => _cache[5] || (_cache[5] = [
8237
8266
  createTextVNode("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.1.60",
3
+ "version": "4.2.0",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -35,6 +35,7 @@
35
35
  "@tarojs/taro": "^4.0.0",
36
36
  "@types/wechat-miniprogram": "^3.4.7",
37
37
  "dayjs": "^1.11.10",
38
+ "lodash-es": "^4.17.21",
38
39
  "validator": "^13.12.0",
39
40
  "vue": "^3.5.0"
40
41
  },
@@ -62,6 +63,7 @@
62
63
  "rollup-plugin-esbuild": "^6.1.0",
63
64
  "rollup-plugin-postcss": "^4.0.2",
64
65
  "rollup-plugin-scss": "^4.0.0",
66
+ "rollup-plugin-visualizer": "^5.12.0",
65
67
  "rollup-plugin-vue": "^6.0.0",
66
68
  "style-loader": "^4.0.0",
67
69
  "stylelint": "^16.8.2",
package/rollup.config.mjs CHANGED
@@ -5,6 +5,7 @@ import postcss from 'rollup-plugin-postcss'
5
5
  import atImport from 'postcss-import'
6
6
  import NutUIResolver from '@nutui/auto-import-resolver'
7
7
  import Components from 'unplugin-vue-components/rollup'
8
+ import { visualizer } from "rollup-plugin-visualizer"
8
9
 
9
10
  export default [
10
11
  {
@@ -38,8 +39,18 @@ export default [
38
39
  Components({
39
40
  resolvers: [NutUIResolver({ taro: true })],
40
41
  }),
42
+ visualizer(),
43
+ ],
44
+ external: [
45
+ 'vue',
46
+ '@tarojs/components',
47
+ '@tarojs/shared',
48
+ '@nutui/nutui',
49
+ '@nutui/nutui-taro',
50
+ '@uxda/nutshell',
51
+ 'dayjs',
52
+ 'validator',
41
53
  ],
42
- external: ['vue', '@nutui/nutui-taro'],
43
54
  },
44
55
  // {
45
56
  // input: './src/main.scss',
@@ -129,7 +129,7 @@ import { AppDrawer, PageHeader, WithPaging } from '../../shared'
129
129
  import dayjs from 'dayjs'
130
130
  import EmptyView from '../../shared/components/EmptyView.vue'
131
131
  import Tip from './Tip.vue'
132
- import groupBy from 'lodash/groupBy'
132
+ import groupBy from 'lodash-es/groupBy'
133
133
  import { useAmount } from '../../shared/composables/useAmount'
134
134
 
135
135
  const refreshing = ref(false)
@@ -40,7 +40,7 @@ import DdNoticeBar from '../../components/dd-notice-bar/index.vue'
40
40
  import NoticePopup from './NoticePopup.vue'
41
41
  import Taro from '@tarojs/taro'
42
42
  import { useNotice } from './useNotice'
43
- import debounce from 'lodash/debounce'
43
+ import debounce from 'lodash-es/debounce'
44
44
  import { useSafeArea } from '../../shared/composables'
45
45
 
46
46
  const props = withDefaults(
@@ -15,7 +15,7 @@ import { ref } from 'vue'
15
15
  import { useHttp } from '../api'
16
16
  import { useAppKitOptions } from '../../Appkit'
17
17
  import Taro, { useDidShow } from '@tarojs/taro'
18
- import debounce from 'lodash/debounce'
18
+ import debounce from 'lodash-es/debounce'
19
19
 
20
20
  const props = withDefaults(
21
21
  defineProps<{
@@ -14,7 +14,7 @@ import DdNoticeBar from '../../components/dd-notice-bar/index.vue'
14
14
  import { useSafeArea } from '../composables'
15
15
  import Taro from '@tarojs/taro'
16
16
  import { useHttp } from '../../balance/api'
17
- import debounce from 'lodash/debounce'
17
+ import debounce from 'lodash-es/debounce'
18
18
 
19
19
  const showAlert = ref(false)
20
20
  const safeArea = useSafeArea()
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * 通用表单校验器
3
3
  */
4
- import { isMobilePhone, isIdentityCard } from 'validator'
4
+ import isMobilePhone from 'validator/es/lib/isMobilePhone'
5
+ import isIdentityCard from 'validator/es/lib/isIdentityCard'
5
6
 
6
7
  export function useValidator() {
7
8
  // 身份证号码校验
@@ -16,7 +16,7 @@ import { useHttp } from '../api'
16
16
  import { useAppKitOptions } from '../../Appkit'
17
17
  import { useSafeArea } from '../../shared/composables'
18
18
  import { useDidShow } from '@tarojs/taro'
19
- import debounce from 'lodash/debounce'
19
+ import debounce from 'lodash-es/debounce'
20
20
 
21
21
  const props = withDefaults(
22
22
  defineProps<{
@@ -12,7 +12,7 @@
12
12
  :rules="['required']"
13
13
  >
14
14
  <template #append>
15
- <ocr-icon @complete="onOcrComplete" />
15
+ <ocr-icon v-if="!已认证" @complete="onOcrComplete" />
16
16
  </template>
17
17
  </ns-input>
18
18
  <ns-input
@@ -36,6 +36,7 @@
36
36
  placeholder="请输入电话号码"
37
37
  :maxlength="11"
38
38
  v-model="formData.电话号码"
39
+ :disabled="true"
39
40
  :rules="[
40
41
  {
41
42
  name: 'function',
@@ -76,7 +77,7 @@
76
77
  </template>
77
78
 
78
79
  <script lang="ts" setup>
79
- import { reactive, ref } from "vue";
80
+ import { reactive, ref, watch } from "vue";
80
81
  import {
81
82
  NsForm,
82
83
  NsInput,
@@ -89,22 +90,27 @@ import {
89
90
  import { OcrIcon } from "../../shared/components";
90
91
  import Taro from "@tarojs/taro";
91
92
  import { useNutshell } from "@uxda/nutshell/taro";
92
- import { isIdentityCard, isMobilePhone } from "validator";
93
+ import isMobilePhone from 'validator/es/lib/isMobilePhone'
94
+ import isIdentityCard from 'validator/es/lib/isIdentityCard'
93
95
  import { useHttp } from "../api";
94
96
 
95
97
  const props = withDefaults(
96
98
  defineProps<{
97
99
  userId: string;
100
+ verifyResult: number;
101
+ mobile: string;
98
102
  }>(),
99
103
  {
104
+ verifyResult: -1,
100
105
  userId: "",
106
+ mobile: "",
101
107
  }
102
108
  );
103
109
 
104
110
  const formRef = ref(),
105
111
  $n = useNutshell();
106
112
 
107
- const formData = reactive({
113
+ let formData = reactive({
108
114
  姓名: "",
109
115
  身份证号码: "",
110
116
  电话号码: "",
@@ -149,7 +155,7 @@ async function toSubmit() {
149
155
  tenantId: props.userId,
150
156
  })
151
157
  .then(() => {
152
- Taro.showToast({ title: "认证成功", icon: "none" });
158
+ Taro.showToast({ title: "已提交认证信息", icon: "none" });
153
159
  // 提交认证信息,成功后返回
154
160
  toBack();
155
161
  })
@@ -157,6 +163,22 @@ async function toSubmit() {
157
163
  Taro.showToast({ title: err?.errMsg || "认证失败", icon: "none" });
158
164
  });
159
165
  }
166
+ watch(
167
+ () => props.verifyResult,
168
+ () => {
169
+ if (props.verifyResult == 1) {
170
+ 已认证.value = true;
171
+ }
172
+ },
173
+ { deep: true, immediate: true }
174
+ );
175
+ watch(
176
+ () => props.mobile,
177
+ () => {
178
+ formData.电话号码 = props.mobile;
179
+ },
180
+ { deep: true, immediate: true }
181
+ );
160
182
 
161
183
  const emits = defineEmits(["toAgreement"]);
162
184
  </script>
@@ -44,7 +44,11 @@
44
44
  <span v-if="userInfo?.verifyResult == 0" style="color: #e8523f"
45
45
  >已失效,重新认证</span
46
46
  >
47
- <span v-else style="color: #017fff">未认证,去认证</span>
47
+ <span
48
+ v-if="userInfo?.verifyResult != 0 && userInfo?.verifyResult != 1"
49
+ style="color: #017fff"
50
+ >未认证,去认证</span
51
+ >
48
52
  </template>
49
53
  </nut-cell>
50
54
  </div>
@@ -397,7 +401,12 @@ function toBinding() {
397
401
 
398
402
  // 去认证页
399
403
  function toAuth() {
400
- emits("auth", props.userId);
404
+ emits(
405
+ "auth",
406
+ props.userId,
407
+ userInfo.value?.verifyResult,
408
+ userInfo.value?.mobile
409
+ );
401
410
  }
402
411
 
403
412
  // 父组件事件