@uxda/appkit 4.2.24 → 4.2.26
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/.eslintrc.mjs +7 -7
- package/README.md +187 -187
- package/babel.config.js +12 -12
- package/dist/appkit.css +3 -3
- package/dist/index.js +8 -8
- package/package.json +79 -79
- package/project.config.json +15 -15
- package/project.tt.json +13 -13
- package/rollup.config.mjs +67 -67
- package/src/Appkit.ts +66 -66
- package/src/balance/api/endpoints.ts +133 -133
- package/src/balance/api/index.ts +106 -106
- package/src/balance/components/AccountView.vue +760 -760
- package/src/balance/components/BalanceCard.vue +215 -215
- package/src/balance/components/BalanceReminder.vue +85 -85
- package/src/balance/components/ConsumptionFilter.vue +218 -218
- package/src/balance/components/ConsumptionRules.vue +68 -68
- package/src/balance/components/DateFilter.vue +250 -250
- package/src/balance/components/DateRange.vue +80 -80
- package/src/balance/components/ListFilter.vue +62 -62
- package/src/balance/components/ListFilterPicker.vue +191 -191
- package/src/balance/components/PromoterCard.vue +237 -237
- package/src/balance/components/SecondBalance.vue +71 -71
- package/src/balance/components/Tip.vue +45 -45
- package/src/balance/components/index.ts +8 -8
- package/src/balance/types.ts +97 -97
- package/src/components/bt-cropper/index.vue +730 -774
- package/src/components/bt-cropper/utils/calcCropper.js +42 -42
- package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
- package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
- package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
- package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
- package/src/components/bt-cropper/utils/ratio.js +3 -3
- package/src/components/bt-cropper/utils/tools.js +25 -25
- package/src/components/dd-area/index.vue +225 -225
- package/src/components/dd-icon/doc.md +21 -21
- package/src/components/dd-icon/index.vue +23 -23
- package/src/components/dd-notice-bar/index.vue +78 -78
- package/src/components/dd-search/doc.md +34 -34
- package/src/components/dd-search/index.vue +168 -168
- package/src/components/dd-selector/index.vue +124 -124
- package/src/components/dd-skeleton/doc.md +19 -19
- package/src/components/dd-skeleton/index.vue +36 -36
- package/src/global.ts +6 -6
- package/src/index.ts +89 -89
- package/src/main.scss +1 -1
- package/src/notice/api/endpoints.ts +17 -17
- package/src/notice/api/index.ts +106 -106
- package/src/notice/components/NoticeBanner.vue +243 -243
- package/src/notice/components/NoticeEntry.vue +99 -99
- package/src/notice/components/NoticeList.vue +315 -315
- package/src/notice/components/NoticePopup.vue +162 -162
- package/src/notice/components/index.ts +5 -5
- package/src/notice/components/useCommonList.ts +86 -86
- package/src/notice/components/useNotice.ts +35 -35
- package/src/notice/index.ts +1 -1
- package/src/notice/types.ts +25 -25
- package/src/payment/api/config.ts +7 -7
- package/src/payment/api/endpoints.ts +103 -103
- package/src/payment/api/index.ts +100 -100
- package/src/payment/components/AmountPicker.vue +90 -90
- package/src/payment/components/RechargeResult.vue +69 -69
- package/src/payment/components/RechargeView.vue +155 -155
- package/src/payment/components/RightsPicker.vue +105 -105
- package/src/payment/components/TradeView.vue +317 -317
- package/src/payment/components/UserAgreement.vue +234 -234
- package/src/payment/components/index.ts +22 -22
- package/src/payment/index.ts +5 -5
- package/src/payment/services/index.ts +16 -16
- package/src/payment/services/invoke-recharge.ts +25 -25
- package/src/payment/services/request-payment.ts +58 -58
- package/src/payment/types.ts +28 -28
- package/src/register/components/SelfRegistration.vue +233 -233
- package/src/register/components/index.ts +2 -2
- package/src/shared/components/AppDrawer.vue +54 -54
- package/src/shared/components/AppVerify.vue +128 -128
- package/src/shared/components/DeviceVersion.vue +63 -68
- package/src/shared/components/EmptyView.vue +33 -33
- package/src/shared/components/OcrBusinessLicense.vue +130 -130
- package/src/shared/components/OcrIcon.vue +202 -202
- package/src/shared/components/PageHeader.vue +84 -84
- package/src/shared/components/index.ts +8 -8
- package/src/shared/composables/index.ts +8 -8
- package/src/shared/composables/useAmount.ts +46 -46
- package/src/shared/composables/useCountdown.ts +46 -46
- package/src/shared/composables/useCrypto.ts +76 -76
- package/src/shared/composables/useDragBox.ts +97 -97
- package/src/shared/composables/useEncode.ts +43 -43
- package/src/shared/composables/useLogger.ts +124 -124
- package/src/shared/composables/useSafeArea.ts +46 -46
- package/src/shared/composables/useTabbar.ts +24 -24
- package/src/shared/composables/useUpload.ts +54 -54
- package/src/shared/composables/useValidator.ts +32 -32
- package/src/shared/http/Http.ts +136 -136
- package/src/shared/http/index.ts +1 -1
- package/src/shared/http/types.ts +157 -157
- package/src/shared/index.ts +3 -3
- package/src/shared/weixin/payment.ts +38 -38
- package/src/styles/vars.scss +3 -3
- package/src/user/api/endpoints.ts +17 -17
- package/src/user/api/index.ts +111 -111
- package/src/user/components/LoginSetting.vue +114 -114
- package/src/user/components/UserAuth.vue +257 -257
- package/src/user/components/UserBinding.vue +307 -307
- package/src/user/components/UserBindingSuccess.vue +80 -80
- package/src/user/components/UserEntry.vue +133 -133
- package/src/user/components/UserFeedback.vue +431 -431
- package/src/user/components/UserFeedbackEntry.vue +175 -192
- package/src/user/components/UserHeadCrop.vue +65 -65
- package/src/user/components/UserInfo.vue +826 -826
- package/src/user/components/UserResourceEmpty.vue +75 -75
- package/src/user/components/index.ts +23 -23
- package/src/user/index.ts +1 -1
- package/tsconfig.json +30 -30
- package/types/global.d.ts +21 -21
- package/types/vue.d.ts +10 -10
package/.eslintrc.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
'./.eslintrc-auto-import.json'
|
|
4
|
-
],
|
|
5
|
-
rules: {
|
|
6
|
-
ident: ['error', 2]
|
|
7
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'./.eslintrc-auto-import.json'
|
|
4
|
+
],
|
|
5
|
+
rules: {
|
|
6
|
+
ident: ['error', 2]
|
|
7
|
+
}
|
|
8
8
|
}
|
package/README.md
CHANGED
|
@@ -1,188 +1,188 @@
|
|
|
1
|
-
# AppKit
|
|
2
|
-
|
|
3
|
-
小程序应用开发包
|
|
4
|
-
|
|
5
|
-
向诸小程序提供供用的组件及基础设施
|
|
6
|
-
|
|
7
|
-
模块:
|
|
8
|
-
* payment 支付
|
|
9
|
-
* balance 账户、代币(云豆)余额
|
|
10
|
-
* auth 登录及会话状态 (待定)
|
|
11
|
-
|
|
12
|
-
## 将 AppKit 加入应用项目
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
git clone git@10.1.108.137:fed/appkit.git
|
|
16
|
-
cd appkit
|
|
17
|
-
yarn link
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
然后 cd 到(周转)小程序根目录执行:
|
|
21
|
-
```bash
|
|
22
|
-
yarn link @uxda/appkit
|
|
23
|
-
```
|
|
24
|
-
完成 npm link
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## 用法
|
|
28
|
-
```typescript
|
|
29
|
-
import AppKit from '@uxda/appkit'
|
|
30
|
-
import '@uxda/appkit/appkit.css'
|
|
31
|
-
```
|
|
32
|
-
## AppKit 初始化
|
|
33
|
-
|
|
34
|
-
在应用入口页调用(示例)
|
|
35
|
-
```typescript
|
|
36
|
-
const App = createApp({})
|
|
37
|
-
App.use(AppKit, {
|
|
38
|
-
app: () => 'cloudkitPro',
|
|
39
|
-
tenant: () => '1',
|
|
40
|
-
token: () => localStorage.getItem('token'),
|
|
41
|
-
baseUrl: () => process.env.TARO_APP_BASE_URL,
|
|
42
|
-
401: () => {
|
|
43
|
-
// 登录态丢失时的处理
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
```
|
|
47
|
-
为 AppKit 的运行提供必需的 API 参数
|
|
48
|
-
* app: 当前的 app code (嵌入接口调用的 header 参数)
|
|
49
|
-
* tenant: 租户ID 需要提供以便调用接口
|
|
50
|
-
* token: 用户登录态 token
|
|
51
|
-
* baseUrl: 调用 API 的URL域名
|
|
52
|
-
* 401: 登录态丢失异常处理 (通常要跳转登录页)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
## UI组件
|
|
56
|
-
### 1️⃣ 充值用户界面 <recharge-view>
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
import { RechargeView } from '@uxda/appkit'
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
```html
|
|
63
|
-
<template>
|
|
64
|
-
<recharge-view
|
|
65
|
-
app="crm"
|
|
66
|
-
tenant="1"
|
|
67
|
-
@complete="onRechargeComplete" />
|
|
68
|
-
</template>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
#### 属性 props
|
|
72
|
-
|
|
73
|
-
#### 事件 emits
|
|
74
|
-
|
|
75
|
-
* @complete: 充值完成时发生
|
|
76
|
-
|
|
77
|
-
### 2️⃣ 账户页 <account-view>
|
|
78
|
-
```
|
|
79
|
-
import { AccountView } from '@uxda/appkit'
|
|
80
|
-
```
|
|
81
|
-
```html
|
|
82
|
-
<template>
|
|
83
|
-
<account-view app="crm" @recharge=onAccountViewRecharge />
|
|
84
|
-
<template>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### 事件 emits
|
|
88
|
-
* @recharge 点击充值按钮时发生
|
|
89
|
-
|
|
90
|
-
### 3️⃣ 账户卡片 <balance-card>
|
|
91
|
-
|
|
92
|
-
```typescript
|
|
93
|
-
import { BalanceCard } from '@uxda/appkit'
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
```html
|
|
97
|
-
<template>
|
|
98
|
-
<balance-card app="crm" @drill="onBalanceCardDrill" @recharge="onBalanceCardRecharge" />
|
|
99
|
-
<template>
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
#### 事件 emits
|
|
103
|
-
* app 配置到组件上的 app code
|
|
104
|
-
* @drill 点击账户详情时发生
|
|
105
|
-
* @recharge 点击充值按钮时发生
|
|
106
|
-
|
|
107
|
-
场景端需定义以上跳转逻辑:
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
function onBalanceCardDrill () {
|
|
111
|
-
//...
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function onBalanceCardRecharge () {
|
|
115
|
-
//...
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### 方法 methods
|
|
120
|
-
* reload() 刷新数据
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### 4️⃣ 余额不足提示框 <balance-reminder>
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
import { BalanceReminder } from '@uxda/appkit'
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
```html
|
|
131
|
-
<balance-reminder v-model="balanceReminderOpen"
|
|
132
|
-
@recharge="onBalanceReminderRecharge" />
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
#### 事件 emits
|
|
136
|
-
* @recharge 点击充值按钮时发生
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
## 公共API
|
|
140
|
-
### 1️⃣ 唤起充值(跳支付中心小程序) $app.invokeRecharge()
|
|
141
|
-
|
|
142
|
-
```typescript
|
|
143
|
-
import { useAppKit } from '@uxda/appkit'
|
|
144
|
-
const $app = useAppKit()
|
|
145
|
-
$app.invokeRecharge({
|
|
146
|
-
app: 'crm',
|
|
147
|
-
tenant: '1',
|
|
148
|
-
})
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### 2️⃣ 唤起充值(小程序内直接支付、不跳) $app.requestPayment()
|
|
152
|
-
|
|
153
|
-
```typescript
|
|
154
|
-
import { useAppKit } from '@uxda/appkit'
|
|
155
|
-
const $app = useAppKit()
|
|
156
|
-
$app.requestPayment({
|
|
157
|
-
app: 'crm',
|
|
158
|
-
tenant: '1',
|
|
159
|
-
amount: 100,
|
|
160
|
-
user: '' // wx.login 之后得到的用户临时凭证
|
|
161
|
-
})
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Hooks (Vue Composables)
|
|
165
|
-
|
|
166
|
-
### useTabbar
|
|
167
|
-
用于获取或设置 custom tab bar
|
|
168
|
-
|
|
169
|
-
```typescript
|
|
170
|
-
import { useTabbar } from '@uxda/appkit-next'
|
|
171
|
-
|
|
172
|
-
onMounted(() => {
|
|
173
|
-
const { setTab } = useTabbar()
|
|
174
|
-
setTab('home')
|
|
175
|
-
})
|
|
176
|
-
```
|
|
177
|
-
以上代码用于切换到 /pages/home/index 时, 设置 tab bar 选中项为 'home'
|
|
178
|
-
在 custom-tab-bar/index.vue 需要做以下设置
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
import { useSafeArea, useTabbar } from '@uxda/appkit-next'
|
|
182
|
-
|
|
183
|
-
const { onTabChange } = useTabbar()
|
|
184
|
-
onTabChange((value: string) => {
|
|
185
|
-
selected.value = value
|
|
186
|
-
})
|
|
187
|
-
```
|
|
1
|
+
# AppKit
|
|
2
|
+
|
|
3
|
+
小程序应用开发包
|
|
4
|
+
|
|
5
|
+
向诸小程序提供供用的组件及基础设施
|
|
6
|
+
|
|
7
|
+
模块:
|
|
8
|
+
* payment 支付
|
|
9
|
+
* balance 账户、代币(云豆)余额
|
|
10
|
+
* auth 登录及会话状态 (待定)
|
|
11
|
+
|
|
12
|
+
## 将 AppKit 加入应用项目
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git clone git@10.1.108.137:fed/appkit.git
|
|
16
|
+
cd appkit
|
|
17
|
+
yarn link
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
然后 cd 到(周转)小程序根目录执行:
|
|
21
|
+
```bash
|
|
22
|
+
yarn link @uxda/appkit
|
|
23
|
+
```
|
|
24
|
+
完成 npm link
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 用法
|
|
28
|
+
```typescript
|
|
29
|
+
import AppKit from '@uxda/appkit'
|
|
30
|
+
import '@uxda/appkit/appkit.css'
|
|
31
|
+
```
|
|
32
|
+
## AppKit 初始化
|
|
33
|
+
|
|
34
|
+
在应用入口页调用(示例)
|
|
35
|
+
```typescript
|
|
36
|
+
const App = createApp({})
|
|
37
|
+
App.use(AppKit, {
|
|
38
|
+
app: () => 'cloudkitPro',
|
|
39
|
+
tenant: () => '1',
|
|
40
|
+
token: () => localStorage.getItem('token'),
|
|
41
|
+
baseUrl: () => process.env.TARO_APP_BASE_URL,
|
|
42
|
+
401: () => {
|
|
43
|
+
// 登录态丢失时的处理
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
为 AppKit 的运行提供必需的 API 参数
|
|
48
|
+
* app: 当前的 app code (嵌入接口调用的 header 参数)
|
|
49
|
+
* tenant: 租户ID 需要提供以便调用接口
|
|
50
|
+
* token: 用户登录态 token
|
|
51
|
+
* baseUrl: 调用 API 的URL域名
|
|
52
|
+
* 401: 登录态丢失异常处理 (通常要跳转登录页)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## UI组件
|
|
56
|
+
### 1️⃣ 充值用户界面 <recharge-view>
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { RechargeView } from '@uxda/appkit'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<template>
|
|
64
|
+
<recharge-view
|
|
65
|
+
app="crm"
|
|
66
|
+
tenant="1"
|
|
67
|
+
@complete="onRechargeComplete" />
|
|
68
|
+
</template>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### 属性 props
|
|
72
|
+
|
|
73
|
+
#### 事件 emits
|
|
74
|
+
|
|
75
|
+
* @complete: 充值完成时发生
|
|
76
|
+
|
|
77
|
+
### 2️⃣ 账户页 <account-view>
|
|
78
|
+
```
|
|
79
|
+
import { AccountView } from '@uxda/appkit'
|
|
80
|
+
```
|
|
81
|
+
```html
|
|
82
|
+
<template>
|
|
83
|
+
<account-view app="crm" @recharge=onAccountViewRecharge />
|
|
84
|
+
<template>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### 事件 emits
|
|
88
|
+
* @recharge 点击充值按钮时发生
|
|
89
|
+
|
|
90
|
+
### 3️⃣ 账户卡片 <balance-card>
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { BalanceCard } from '@uxda/appkit'
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```html
|
|
97
|
+
<template>
|
|
98
|
+
<balance-card app="crm" @drill="onBalanceCardDrill" @recharge="onBalanceCardRecharge" />
|
|
99
|
+
<template>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### 事件 emits
|
|
103
|
+
* app 配置到组件上的 app code
|
|
104
|
+
* @drill 点击账户详情时发生
|
|
105
|
+
* @recharge 点击充值按钮时发生
|
|
106
|
+
|
|
107
|
+
场景端需定义以上跳转逻辑:
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
function onBalanceCardDrill () {
|
|
111
|
+
//...
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function onBalanceCardRecharge () {
|
|
115
|
+
//...
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 方法 methods
|
|
120
|
+
* reload() 刷新数据
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### 4️⃣ 余额不足提示框 <balance-reminder>
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { BalanceReminder } from '@uxda/appkit'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
```html
|
|
131
|
+
<balance-reminder v-model="balanceReminderOpen"
|
|
132
|
+
@recharge="onBalanceReminderRecharge" />
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### 事件 emits
|
|
136
|
+
* @recharge 点击充值按钮时发生
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## 公共API
|
|
140
|
+
### 1️⃣ 唤起充值(跳支付中心小程序) $app.invokeRecharge()
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { useAppKit } from '@uxda/appkit'
|
|
144
|
+
const $app = useAppKit()
|
|
145
|
+
$app.invokeRecharge({
|
|
146
|
+
app: 'crm',
|
|
147
|
+
tenant: '1',
|
|
148
|
+
})
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 2️⃣ 唤起充值(小程序内直接支付、不跳) $app.requestPayment()
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { useAppKit } from '@uxda/appkit'
|
|
155
|
+
const $app = useAppKit()
|
|
156
|
+
$app.requestPayment({
|
|
157
|
+
app: 'crm',
|
|
158
|
+
tenant: '1',
|
|
159
|
+
amount: 100,
|
|
160
|
+
user: '' // wx.login 之后得到的用户临时凭证
|
|
161
|
+
})
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Hooks (Vue Composables)
|
|
165
|
+
|
|
166
|
+
### useTabbar
|
|
167
|
+
用于获取或设置 custom tab bar
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { useTabbar } from '@uxda/appkit-next'
|
|
171
|
+
|
|
172
|
+
onMounted(() => {
|
|
173
|
+
const { setTab } = useTabbar()
|
|
174
|
+
setTab('home')
|
|
175
|
+
})
|
|
176
|
+
```
|
|
177
|
+
以上代码用于切换到 /pages/home/index 时, 设置 tab bar 选中项为 'home'
|
|
178
|
+
在 custom-tab-bar/index.vue 需要做以下设置
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
import { useSafeArea, useTabbar } from '@uxda/appkit-next'
|
|
182
|
+
|
|
183
|
+
const { onTabChange } = useTabbar()
|
|
184
|
+
onTabChange((value: string) => {
|
|
185
|
+
selected.value = value
|
|
186
|
+
})
|
|
187
|
+
```
|
|
188
188
|
以上代码设置响应页面内的 setTab() 动作
|
package/babel.config.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// babel-preset-taro 更多选项和默认值:
|
|
2
|
-
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
|
|
3
|
-
module.exports = {
|
|
4
|
-
presets: [
|
|
5
|
-
['taro', {
|
|
6
|
-
framework: 'vue3',
|
|
7
|
-
ts: true
|
|
8
|
-
}]
|
|
9
|
-
],
|
|
10
|
-
plugins: [
|
|
11
|
-
],
|
|
12
|
-
}
|
|
1
|
+
// babel-preset-taro 更多选项和默认值:
|
|
2
|
+
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
|
|
3
|
+
module.exports = {
|
|
4
|
+
presets: [
|
|
5
|
+
['taro', {
|
|
6
|
+
framework: 'vue3',
|
|
7
|
+
ts: true
|
|
8
|
+
}]
|
|
9
|
+
],
|
|
10
|
+
plugins: [
|
|
11
|
+
],
|
|
12
|
+
}
|
package/dist/appkit.css
CHANGED
|
@@ -446,9 +446,9 @@
|
|
|
446
446
|
color: #353535;
|
|
447
447
|
background: linear-gradient(90deg, #FFEBC1 0%, #FFB875 100%);
|
|
448
448
|
}
|
|
449
|
-
page {
|
|
450
|
-
--text-color: #333;
|
|
451
|
-
--text-color-dark-mode: #eee;
|
|
449
|
+
page {
|
|
450
|
+
--text-color: #333;
|
|
451
|
+
--text-color-dark-mode: #eee;
|
|
452
452
|
}
|
|
453
453
|
.account-card .card {
|
|
454
454
|
background: linear-gradient(90deg, #FFEBC1 0%, #FFB875 100%);
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ 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, createCommentVNode, renderSlot, createVNode, unref, isRef, normalizeStyle, onMounted, createStaticVNode, watch, resolveComponent, withDirectives, vShow, useModel, mergeModels, 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, { useDidShow, useRouter } from '@tarojs/taro';
|
|
7
|
+
import Taro, { getSystemInfoSync, getMenuButtonBoundingClientRect, 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';
|
|
@@ -117,7 +117,7 @@ function requestPayment$2(json) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
function useSafeArea() {
|
|
120
|
-
const systemInfo =
|
|
120
|
+
const systemInfo = getSystemInfoSync(), capsule = Taro.getEnv() === "WEAPP" ? getMenuButtonBoundingClientRect() : { top: 0, height: 0 };
|
|
121
121
|
const status = systemInfo.statusBarHeight || 0, gap = capsule.top - status, nav = capsule.height + gap * 2, safeAreaBottom = (systemInfo.safeArea || {}).bottom || 0, bottom = systemInfo.screenHeight - safeAreaBottom;
|
|
122
122
|
return {
|
|
123
123
|
status,
|
|
@@ -367,7 +367,7 @@ function useLogger(options) {
|
|
|
367
367
|
const enable = options.enable === void 0 ? true : options.enable;
|
|
368
368
|
const { miniProgram } = Taro.getEnv() === "WEAPP" ? Taro.getAccountInfoSync() : { miniProgram: { version: "" } };
|
|
369
369
|
const systemInfo = JSON.stringify({
|
|
370
|
-
...
|
|
370
|
+
...getSystemInfoSync(),
|
|
371
371
|
appVersion: miniProgram?.version
|
|
372
372
|
}) || "\u672A\u77E5";
|
|
373
373
|
function send(params) {
|
|
@@ -934,7 +934,7 @@ var script$E = /* @__PURE__ */ defineComponent({
|
|
|
934
934
|
}, 100);
|
|
935
935
|
onMounted(async () => {
|
|
936
936
|
await getPropertieByCode();
|
|
937
|
-
const systemInfo =
|
|
937
|
+
const systemInfo = getSystemInfoSync();
|
|
938
938
|
const version = systemInfo.SDKVersion;
|
|
939
939
|
function compareVersion(v1, v2) {
|
|
940
940
|
const v1Arr = v1.split(".").map(Number);
|
|
@@ -2238,7 +2238,7 @@ var script$w = /* @__PURE__ */ defineComponent({
|
|
|
2238
2238
|
]))
|
|
2239
2239
|
])
|
|
2240
2240
|
]),
|
|
2241
|
-
createCommentVNode(' <div class="line"></div>\n <div class="card-row">\n <div class="card-row-left desc">\u6743\u76CA\u4F7F\u7528\u65F6\u81EA\u52A8\u6263\u51CF\u4E91\u8C46</div>\n <div class="card-row-right">\n <div class="pay" @click="gotoRecharge">\n <div>\u5145\u503C</div>\n <img\n class="pay-icon"\n src="https://cdn.ddjf.com/static/images/bpms-workBench/bean-right.png"\n />\n </div>\n </div>\n </div> ')
|
|
2241
|
+
createCommentVNode(' <div class="line"></div>\r\n <div class="card-row">\r\n <div class="card-row-left desc">\u6743\u76CA\u4F7F\u7528\u65F6\u81EA\u52A8\u6263\u51CF\u4E91\u8C46</div>\r\n <div class="card-row-right">\r\n <div class="pay" @click="gotoRecharge">\r\n <div>\u5145\u503C</div>\r\n <img\r\n class="pay-icon"\r\n src="https://cdn.ddjf.com/static/images/bpms-workBench/bean-right.png"\r\n />\r\n </div>\r\n </div>\r\n </div> ')
|
|
2242
2242
|
])
|
|
2243
2243
|
]);
|
|
2244
2244
|
};
|
|
@@ -6940,7 +6940,7 @@ var script$6 = {
|
|
|
6940
6940
|
}, 200);
|
|
6941
6941
|
},
|
|
6942
6942
|
async getContainer() {
|
|
6943
|
-
const systemInfo =
|
|
6943
|
+
const systemInfo = getSystemInfoSync();
|
|
6944
6944
|
this.windowWidth = systemInfo.windowWidth;
|
|
6945
6945
|
this.dpr = systemInfo.pixelRatio;
|
|
6946
6946
|
return new Promise((resolve) => {
|
|
@@ -7890,7 +7890,7 @@ function useDragBox() {
|
|
|
7890
7890
|
// 纵向拖动限制范围
|
|
7891
7891
|
});
|
|
7892
7892
|
function initDragData(data) {
|
|
7893
|
-
const res =
|
|
7893
|
+
const res = getSystemInfoSync();
|
|
7894
7894
|
dragData.screenWidth = res.windowWidth;
|
|
7895
7895
|
dragData.screenHeight = res.windowHeight;
|
|
7896
7896
|
if (!data) data = {};
|
|
@@ -7994,7 +7994,7 @@ var script$3 = /* @__PURE__ */ defineComponent({
|
|
|
7994
7994
|
onDragEnd1();
|
|
7995
7995
|
}
|
|
7996
7996
|
onMounted(async () => {
|
|
7997
|
-
const systemInfo =
|
|
7997
|
+
const systemInfo = getSystemInfoSync();
|
|
7998
7998
|
const safeHeight = (systemInfo.safeArea || {}).height || systemInfo.screenHeight;
|
|
7999
7999
|
const height = safeHeight > 620 ? 620 : safeHeight - 80;
|
|
8000
8000
|
const navbarHeight = safeArea.nav + safeArea.status;
|
package/package.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@uxda/appkit",
|
|
3
|
-
"version": "4.2.
|
|
4
|
-
"description": "小程序应用开发包",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.ts",
|
|
7
|
-
"moduleResolution": "node",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dev": "rollup -c rollup.config.mjs --watch",
|
|
10
|
-
"build": "rollup -c rollup.config.mjs"
|
|
11
|
-
},
|
|
12
|
-
"exports": {
|
|
13
|
-
".": "./dist/index.js",
|
|
14
|
-
"./appkit.css": "./dist/appkit.css"
|
|
15
|
-
},
|
|
16
|
-
"browserslist": [
|
|
17
|
-
"last 3 versions",
|
|
18
|
-
"Android >= 4.1",
|
|
19
|
-
"ios >= 8"
|
|
20
|
-
],
|
|
21
|
-
"author": "",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@babel/runtime": "^7.25.6",
|
|
24
|
-
"@nutui/auto-import-resolver": "^1.0.0",
|
|
25
|
-
"@nutui/icons-vue-taro": "^0.0.9",
|
|
26
|
-
"@nutui/nutui-taro": "^4.3.11",
|
|
27
|
-
"@tarojs/components": "^4.0.0",
|
|
28
|
-
"@tarojs/helper": "^4.0.0",
|
|
29
|
-
"@tarojs/plugin-framework-vue3": "^4.0.0",
|
|
30
|
-
"@tarojs/plugin-html": "^4.0.0",
|
|
31
|
-
"@tarojs/plugin-platform-weapp": "^4.0.0",
|
|
32
|
-
"@tarojs/router": "^4.0.0",
|
|
33
|
-
"@tarojs/runtime": "^4.0.0",
|
|
34
|
-
"@tarojs/shared": "^4.0.0",
|
|
35
|
-
"@tarojs/taro": "^4.0.0",
|
|
36
|
-
"@types/wechat-miniprogram": "^3.4.7",
|
|
37
|
-
"dayjs": "^1.11.10",
|
|
38
|
-
"lodash-es": "^4.17.21",
|
|
39
|
-
"validator": "^13.12.0",
|
|
40
|
-
"vue": "^3.5.0"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@babel/core": "^7.8.0",
|
|
44
|
-
"@tarojs/cli": "^4.0.0",
|
|
45
|
-
"@tarojs/taro-loader": "^4.0.0",
|
|
46
|
-
"@tarojs/webpack5-runner": "^4.0.0",
|
|
47
|
-
"@types/node": "^22.5.0",
|
|
48
|
-
"@types/webpack-env": "^1.13.6",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^8.2.0",
|
|
50
|
-
"@typescript-eslint/parser": "^8.2.0",
|
|
51
|
-
"@vue/babel-plugin-jsx": "^1.0.6",
|
|
52
|
-
"@vue/compiler-sfc": "^3.2.40",
|
|
53
|
-
"babel-preset-taro": "^4.0.4",
|
|
54
|
-
"css-loader": "^7.1.2",
|
|
55
|
-
"eslint": "^9.9.0",
|
|
56
|
-
"eslint-config-taro": "^4.0.4",
|
|
57
|
-
"eslint-plugin-vue": "^9.27.0",
|
|
58
|
-
"postcss": "^8.4.32",
|
|
59
|
-
"postcss-import": "^16.1.0",
|
|
60
|
-
"rollup": "^4.6.1",
|
|
61
|
-
"rollup-plugin-css-only": "^4.5.2",
|
|
62
|
-
"rollup-plugin-dts": "^6.1.0",
|
|
63
|
-
"rollup-plugin-esbuild": "^6.1.0",
|
|
64
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
65
|
-
"rollup-plugin-scss": "^4.0.0",
|
|
66
|
-
"rollup-plugin-visualizer": "^5.12.0",
|
|
67
|
-
"rollup-plugin-vue": "^6.0.0",
|
|
68
|
-
"style-loader": "^4.0.0",
|
|
69
|
-
"stylelint": "^16.8.2",
|
|
70
|
-
"ts-node": "^10.9.1",
|
|
71
|
-
"typescript": "^5.0.0",
|
|
72
|
-
"unplugin-auto-import": "^0.18.2",
|
|
73
|
-
"unplugin-vue-components": "^0.27.3",
|
|
74
|
-
"webpack": "^5.78.0"
|
|
75
|
-
},
|
|
76
|
-
"peerDependencies": {
|
|
77
|
-
"@uxda/nutshell": "^1.0.0"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@uxda/appkit",
|
|
3
|
+
"version": "4.2.26",
|
|
4
|
+
"description": "小程序应用开发包",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.ts",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "rollup -c rollup.config.mjs --watch",
|
|
10
|
+
"build": "rollup -c rollup.config.mjs"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./dist/index.js",
|
|
14
|
+
"./appkit.css": "./dist/appkit.css"
|
|
15
|
+
},
|
|
16
|
+
"browserslist": [
|
|
17
|
+
"last 3 versions",
|
|
18
|
+
"Android >= 4.1",
|
|
19
|
+
"ios >= 8"
|
|
20
|
+
],
|
|
21
|
+
"author": "",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@babel/runtime": "^7.25.6",
|
|
24
|
+
"@nutui/auto-import-resolver": "^1.0.0",
|
|
25
|
+
"@nutui/icons-vue-taro": "^0.0.9",
|
|
26
|
+
"@nutui/nutui-taro": "^4.3.11",
|
|
27
|
+
"@tarojs/components": "^4.0.0",
|
|
28
|
+
"@tarojs/helper": "^4.0.0",
|
|
29
|
+
"@tarojs/plugin-framework-vue3": "^4.0.0",
|
|
30
|
+
"@tarojs/plugin-html": "^4.0.0",
|
|
31
|
+
"@tarojs/plugin-platform-weapp": "^4.0.0",
|
|
32
|
+
"@tarojs/router": "^4.0.0",
|
|
33
|
+
"@tarojs/runtime": "^4.0.0",
|
|
34
|
+
"@tarojs/shared": "^4.0.0",
|
|
35
|
+
"@tarojs/taro": "^4.0.0",
|
|
36
|
+
"@types/wechat-miniprogram": "^3.4.7",
|
|
37
|
+
"dayjs": "^1.11.10",
|
|
38
|
+
"lodash-es": "^4.17.21",
|
|
39
|
+
"validator": "^13.12.0",
|
|
40
|
+
"vue": "^3.5.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/core": "^7.8.0",
|
|
44
|
+
"@tarojs/cli": "^4.0.0",
|
|
45
|
+
"@tarojs/taro-loader": "^4.0.0",
|
|
46
|
+
"@tarojs/webpack5-runner": "^4.0.0",
|
|
47
|
+
"@types/node": "^22.5.0",
|
|
48
|
+
"@types/webpack-env": "^1.13.6",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.2.0",
|
|
50
|
+
"@typescript-eslint/parser": "^8.2.0",
|
|
51
|
+
"@vue/babel-plugin-jsx": "^1.0.6",
|
|
52
|
+
"@vue/compiler-sfc": "^3.2.40",
|
|
53
|
+
"babel-preset-taro": "^4.0.4",
|
|
54
|
+
"css-loader": "^7.1.2",
|
|
55
|
+
"eslint": "^9.9.0",
|
|
56
|
+
"eslint-config-taro": "^4.0.4",
|
|
57
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
58
|
+
"postcss": "^8.4.32",
|
|
59
|
+
"postcss-import": "^16.1.0",
|
|
60
|
+
"rollup": "^4.6.1",
|
|
61
|
+
"rollup-plugin-css-only": "^4.5.2",
|
|
62
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
63
|
+
"rollup-plugin-esbuild": "^6.1.0",
|
|
64
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
65
|
+
"rollup-plugin-scss": "^4.0.0",
|
|
66
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
67
|
+
"rollup-plugin-vue": "^6.0.0",
|
|
68
|
+
"style-loader": "^4.0.0",
|
|
69
|
+
"stylelint": "^16.8.2",
|
|
70
|
+
"ts-node": "^10.9.1",
|
|
71
|
+
"typescript": "^5.0.0",
|
|
72
|
+
"unplugin-auto-import": "^0.18.2",
|
|
73
|
+
"unplugin-vue-components": "^0.27.3",
|
|
74
|
+
"webpack": "^5.78.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"@uxda/nutshell": "^1.0.0"
|
|
78
|
+
}
|
|
79
|
+
}
|