@uxda/appkit 4.1.52 → 4.1.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.1.52",
3
+ "version": "4.1.56",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -1,11 +1,8 @@
1
1
  <template>
2
2
  <div class="date-range" @click="openDateRangePicker">
3
3
  <div class="text">{{ dateRangeDisplay }}</div>
4
- <img
5
- style="margin-top: -2px"
6
- class="time-icon"
7
- src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-down.png"
8
- />
4
+ <img style="margin-top: -2px" class="time-icon"
5
+ src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-down.png" />
9
6
  </div>
10
7
  </template>
11
8
 
@@ -35,6 +32,7 @@ const openDateRangePicker = () => {
35
32
  const child = ref()
36
33
  $n.sheet({
37
34
  component: DateFilter,
35
+ class: 'ns-sheet-reset',
38
36
  ref: child,
39
37
  props: {
40
38
  from: model.value.from,
@@ -42,7 +40,7 @@ const openDateRangePicker = () => {
42
40
  },
43
41
  modal: true, // 不允许点击 overlay 关闭弹窗
44
42
  mask: true,
45
- onComplete (result: any) {
43
+ onComplete(result: any) {
46
44
  model.value = {
47
45
  from: result.from,
48
46
  to: result.to
@@ -66,10 +64,12 @@ const dateRangeDisplay = computed(() => {
66
64
  flex: 1;
67
65
  display: flex;
68
66
  align-items: center;
67
+
69
68
  .text {
70
69
  width: fit-content;
71
70
  white-space: nowrap;
72
71
  }
72
+
73
73
  .time-icon {
74
74
  display: block;
75
75
  font-size: 0;
@@ -1,10 +1,7 @@
1
1
  <template>
2
2
  <div class="list-filter" @click="openPicker">
3
3
  <span class="text">筛选</span>
4
- <img
5
- class="icon"
6
- src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-select-icon.png"
7
- />
4
+ <img class="icon" src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-select-icon.png" />
8
5
  </div>
9
6
  </template>
10
7
 
@@ -16,8 +13,8 @@ import ListFilterPicker from './ListFilterPicker.vue'
16
13
  const $n = useNutshell()
17
14
 
18
15
  export type ListFilterValue = {
19
- type: string,
20
- }
16
+ type: string,
17
+ }
21
18
 
22
19
  const model = defineModel({
23
20
  type: Object as PropType<ListFilterValue>,
@@ -35,6 +32,7 @@ const emit = defineEmits<{
35
32
  const openPicker = () => {
36
33
  $n.sheet({
37
34
  component: ListFilterPicker,
35
+ class: 'ns-sheet-reset',
38
36
  props: {
39
37
  modelValue: model,
40
38
  onComplete: (result) => {
@@ -53,6 +51,7 @@ const openPicker = () => {
53
51
  align-items: center;
54
52
  height: 22px;
55
53
  padding-left: 5px;
54
+
56
55
  .icon {
57
56
  display: block;
58
57
  font-size: 0;
@@ -103,7 +103,6 @@ const onOkClick = () => {
103
103
  &-title {
104
104
  position: relative;
105
105
  height: 44px;
106
- line-height: 44px;
107
106
  font-size: 17px;
108
107
  color: #353535;
109
108
  background: #f5f5f5;
@@ -57,7 +57,7 @@ type PromoterCardProps = {
57
57
  const props = withDefaults(defineProps<PromoterCardProps>(), {
58
58
  useCase: '',
59
59
  applyRecord: {},
60
- isAdmin: true
60
+ isAdmin: false
61
61
  })
62
62
 
63
63
  const { formatAmount } = useAmount()
@@ -118,9 +118,10 @@ const toastMap = {
118
118
  rebate: '推荐朋友使用北斗星、企明星获取,返佣收益= 返佣基数 * 返佣比例',
119
119
  }
120
120
  function onHelpClick(type: string) {
121
- Taro.showToast({
122
- title: toastMap[type],
123
- icon: 'none',
121
+ Taro.showModal({
122
+ content: toastMap[type],
123
+ showCancel: false,
124
+ confirmText: '知道了',
124
125
  })
125
126
  }
126
127
  </script>
@@ -206,12 +207,12 @@ function onHelpClick(type: string) {
206
207
  right: 13px;
207
208
  border-radius: 4px;
208
209
  overflow: hidden;
210
+ background: rgba(204, 204, 204, 0.2);
209
211
 
210
212
  &-item {
211
213
  display: inline-flex;
212
214
  align-items: center;
213
215
  justify-content: center;
214
- background: rgba(53, 53, 53, 0.1);
215
216
  height: 29px;
216
217
  width: 90px;
217
218
  box-sizing: border-box;
@@ -72,7 +72,6 @@ const props = defineProps<AppVerifyProps>();
72
72
  h2 {
73
73
  font-size: 16px;
74
74
  font-weight: bold;
75
- margin: 10px;
76
75
  }
77
76
 
78
77
  .caption {
@@ -0,0 +1,216 @@
1
+ <template>
2
+ <ns-page class="user-auth">
3
+ <ns-page-content>
4
+ <ns-card fill="#fff">
5
+ <ns-form ref="formRef" v-model="formData">
6
+ <ns-input
7
+ label="你的姓名"
8
+ name="姓名"
9
+ v-model="formData.姓名"
10
+ placeholder="请输入或拍照识别"
11
+ :maxlength="30"
12
+ :rules="['required']"
13
+ >
14
+ <template #append>
15
+ <ocr-icon @complete="onOcrComplete" />
16
+ </template>
17
+ </ns-input>
18
+ <ns-input
19
+ label="身份证号码"
20
+ name="身份证号码"
21
+ placeholder="请输入身份证号码"
22
+ :maxlength="30"
23
+ v-model="formData.身份证号码"
24
+ :rules="[
25
+ 'required',
26
+ {
27
+ name: 'function',
28
+ message: '请输入正确格式的证件号码',
29
+ method: (value: string) => isIdentityCard(value, 'zh-CN')
30
+ }
31
+ ]"
32
+ />
33
+ <ns-input
34
+ label="电话号码"
35
+ name="电话号码"
36
+ placeholder="请输入电话号码"
37
+ :maxlength="11"
38
+ v-model="formData.电话号码"
39
+ :rules="[
40
+ {
41
+ name: 'function',
42
+ message: '请输入正确格式的电话号码',
43
+ method: (value: string) => isMobilePhone(value, 'zh-CN')
44
+ }
45
+ ]"
46
+ />
47
+ </ns-form>
48
+ </ns-card>
49
+
50
+ <div class="user-auth-footer">
51
+ <div v-if="!已认证" class="checkbox-row">
52
+ <ns-checkbox style="font-size: 11px" v-model="formData.同意"
53
+ >我已阅读并同意</ns-checkbox
54
+ >
55
+ <span @click="showAgreement" class="book">《个人信息授权协议》</span>
56
+ </div>
57
+ <ns-button
58
+ v-if="!已认证"
59
+ class="btn"
60
+ color="primary"
61
+ type="primary"
62
+ @click="toSubmit"
63
+ >立即认证</ns-button
64
+ >
65
+ <ns-button
66
+ v-else
67
+ class="btn"
68
+ color="primary"
69
+ type="primary"
70
+ @click="toBack"
71
+ >返回</ns-button
72
+ >
73
+ </div>
74
+ </ns-page-content>
75
+ </ns-page>
76
+ </template>
77
+
78
+ <script lang="ts" setup>
79
+ import { reactive, ref } from "vue";
80
+ import {
81
+ NsForm,
82
+ NsInput,
83
+ NsCard,
84
+ NsPage,
85
+ NsPageContent,
86
+ NsButton,
87
+ NsCheckbox,
88
+ } from "@uxda/nutshell/taro";
89
+ import { OcrIcon } from "../../shared/components";
90
+ import Taro from "@tarojs/taro";
91
+ import { useNutshell } from "@uxda/nutshell/taro";
92
+ import { isIdentityCard, isMobilePhone } from "validator";
93
+ import { useHttp } from "../api";
94
+
95
+ const props = withDefaults(
96
+ defineProps<{
97
+ userId: string;
98
+ }>(),
99
+ {
100
+ userId: "",
101
+ }
102
+ );
103
+
104
+ const formRef = ref(),
105
+ $n = useNutshell();
106
+
107
+ const formData = reactive({
108
+ 姓名: "",
109
+ 身份证号码: "",
110
+ 电话号码: "",
111
+ 同意: false,
112
+ });
113
+
114
+ const 已认证 = ref(false);
115
+
116
+ const onOcrComplete = (result) => {
117
+ formData.姓名 = result?.faceInfo.name;
118
+ formData.身份证号码 = result?.faceInfo.certNo;
119
+ };
120
+
121
+ // 查看协议
122
+ function showAgreement() {
123
+ emits("toAgreement");
124
+ }
125
+
126
+ // 返回
127
+ function toBack() {
128
+ Taro.navigateBack();
129
+ }
130
+
131
+ // 认证
132
+ async function toSubmit() {
133
+ const res = await formRef.value.validate();
134
+ if (!res.valid) {
135
+ return $n.toast(res.errors[0].message, {});
136
+ }
137
+
138
+ if (!formData.同意) {
139
+ return $n.toast("请先阅读并同意协议", {});
140
+ }
141
+ const $http = useHttp();
142
+
143
+ $http
144
+ .post("/cas/sysAccount/verifyId3", {
145
+ // appCode:
146
+ idCard: formData.身份证号码,
147
+ mobile: formData.电话号码,
148
+ name: formData.姓名,
149
+ tenantId: props.userId,
150
+ })
151
+ .then(() => {
152
+ Taro.showToast({ title: "认证成功", icon: "none" });
153
+ // 提交认证信息,成功后返回
154
+ toBack();
155
+ })
156
+ .catch((err) => {
157
+ Taro.showToast({ title: err?.errMsg || "认证失败", icon: "none" });
158
+ });
159
+ }
160
+
161
+ const emits = defineEmits(["toAgreement"]);
162
+ </script>
163
+
164
+ <style lang="scss">
165
+ .user-auth {
166
+ height: 100vh;
167
+
168
+ &-footer {
169
+ position: fixed;
170
+ z-index: 10;
171
+ bottom: 0;
172
+ left: 0;
173
+ width: 100%;
174
+ min-height: 63px;
175
+ background: #ffffff;
176
+ box-shadow: 0 -3px 11px 0 rgba(224, 224, 224, 0.5);
177
+ padding: 10px 12px calc(8px + var(--safe-bottom-height));
178
+ display: flex;
179
+ justify-content: space-between;
180
+ box-sizing: border-box;
181
+
182
+ .btn {
183
+ width: 100%;
184
+ }
185
+
186
+ .checkbox-row {
187
+ --nut-primary-color: #017fff;
188
+ position: absolute;
189
+ top: -36px;
190
+ left: 50%;
191
+ transform: translateX(-50%);
192
+ white-space: nowrap;
193
+ display: flex;
194
+ align-items: center;
195
+
196
+ .nut-checkbox__label {
197
+ margin-left: 2px;
198
+ font-size: 11px;
199
+ }
200
+
201
+ .nut-icon-check-normal {
202
+ margin-top: 0 !important;
203
+ }
204
+
205
+ .nut-icon-checked {
206
+ font-size: 11px;
207
+ }
208
+
209
+ .book {
210
+ font-size: 11px;
211
+ color: #007aff;
212
+ }
213
+ }
214
+ }
215
+ }
216
+ </style>