@uxda/appkit 4.2.82 → 4.2.84
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 +41 -3
- package/dist/index.js +994 -535
- package/package.json +81 -81
- package/project.config.json +15 -15
- package/project.tt.json +13 -13
- package/rollup.config.mjs +77 -77
- package/src/Appkit.ts +67 -67
- package/src/balance/api/endpoints.ts +133 -133
- package/src/balance/api/index.ts +112 -106
- package/src/balance/components/AccountView.vue +773 -773
- package/src/balance/components/BalanceCard.vue +210 -210
- package/src/balance/components/BalanceReminder.vue +84 -84
- package/src/balance/components/ConsumptionFilter.vue +218 -218
- package/src/balance/components/ConsumptionRules.vue +68 -68
- package/src/balance/components/DateFilter.vue +259 -259
- package/src/balance/components/DateRange.vue +111 -111
- package/src/balance/components/ListFilter.vue +62 -62
- package/src/balance/components/ListFilterPicker.vue +191 -191
- package/src/balance/components/PromoterCard.vue +310 -310
- package/src/balance/components/SecondBalance.vue +77 -77
- package/src/balance/components/Tip.vue +45 -45
- package/src/balance/components/index.ts +8 -8
- package/src/balance/types.ts +99 -99
- package/src/components/bt-cropper/index.vue +730 -730
- 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 +93 -93
- package/src/main.scss +1 -1
- package/src/notice/api/endpoints.ts +54 -17
- package/src/notice/api/index.ts +115 -106
- package/src/notice/components/NoticeBanner.vue +247 -247
- package/src/notice/components/NoticeEntry.vue +99 -99
- package/src/notice/components/NoticeList.vue +311 -311
- package/src/notice/components/NoticeList2.vue +243 -0
- package/src/notice/components/NoticePopup.vue +163 -163
- package/src/notice/components/index.ts +6 -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 +95 -95
- package/src/payment/api/index.ts +101 -101
- package/src/payment/components/AmountPicker.vue +90 -90
- package/src/payment/components/RechargeResult.vue +69 -69
- package/src/payment/components/RechargeView.vue +190 -190
- package/src/payment/components/RightsPicker.vue +105 -105
- package/src/payment/components/TradeView.vue +363 -363
- 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 +130 -130
- package/src/payment/types.ts +32 -32
- package/src/register/components/SelfRegistration.vue +233 -233
- package/src/register/components/index.ts +2 -2
- package/src/scenarios/components/SharePoster.vue +364 -364
- package/src/scenarios/components/index.ts +2 -2
- package/src/scenarios/components/poster-paste.vue +93 -93
- package/src/scenarios/components/share-poster.md +273 -273
- package/src/shared/components/AppDrawer.vue +53 -53
- package/src/shared/components/AppVerify.vue +128 -128
- package/src/shared/components/DeviceVersion.vue +78 -78
- package/src/shared/components/EmptyView.vue +33 -33
- package/src/shared/components/OcrBusinessLicense.vue +137 -137
- package/src/shared/components/OcrIcon.vue +229 -229
- package/src/shared/components/PageHeader.vue +84 -84
- package/src/shared/components/index.ts +8 -8
- package/src/shared/composables/index.ts +9 -9
- 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/useDeviceEnv.ts +11 -11
- package/src/shared/composables/useDragBox.ts +97 -97
- package/src/shared/composables/useEncode.ts +43 -43
- package/src/shared/composables/useLogger.ts +131 -131
- package/src/shared/composables/useSafeArea.ts +46 -46
- package/src/shared/composables/useTabbar.ts +24 -24
- package/src/shared/composables/useUpload.ts +61 -61
- package/src/shared/composables/useValidator.ts +32 -32
- package/src/shared/composables/useWxAuth.ts +48 -48
- package/src/shared/http/Http.ts +148 -146
- package/src/shared/http/index.ts +1 -1
- package/src/shared/http/types.ts +163 -160
- package/src/shared/index.ts +8 -8
- package/src/shared/weixin/index.ts +9 -9
- package/src/shared/weixin/jssdk.ts +103 -103
- 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 +117 -111
- package/src/user/components/LoginSetting.vue +114 -114
- package/src/user/components/UserAuth.vue +220 -220
- package/src/user/components/UserBinding.vue +277 -277
- package/src/user/components/UserBindingSuccess.vue +80 -80
- package/src/user/components/UserEntry.vue +139 -139
- package/src/user/components/UserFeedback.vue +427 -427
- package/src/user/components/UserFeedbackEntry.vue +175 -175
- package/src/user/components/UserHeadCrop.vue +65 -65
- package/src/user/components/UserInfo.vue +708 -708
- package/src/user/components/UserResourceEmpty.vue +75 -75
- package/src/user/components/index.ts +23 -23
- package/src/user/index.ts +1 -1
- package/src/utils/utils.ts +28 -28
- package/tsconfig.json +30 -30
- package/types/global.d.ts +22 -22
- package/types/vue.d.ts +10 -10
- /package/dist/assets/{asset-DcH8Kg-2 → asset-3B_CoPto} +0 -0
|
@@ -1,273 +1,273 @@
|
|
|
1
|
-
##### 组件说明:
|
|
2
|
-
|
|
3
|
-
该组件是一个海报分享组件,调用者传入图片数据
|
|
4
|
-
|
|
5
|
-
数据示例:
|
|
6
|
-
|
|
7
|
-
[
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
id:"10",
|
|
12
|
-
|
|
13
|
-
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-3.png",
|
|
14
|
-
|
|
15
|
-
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
16
|
-
|
|
17
|
-
qrH: 150,
|
|
18
|
-
|
|
19
|
-
qrW: 150,
|
|
20
|
-
|
|
21
|
-
qrX: 110,
|
|
22
|
-
|
|
23
|
-
qrY: 310,
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
id:"11",
|
|
30
|
-
|
|
31
|
-
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-1.png",
|
|
32
|
-
|
|
33
|
-
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
34
|
-
|
|
35
|
-
qrH: 150,
|
|
36
|
-
|
|
37
|
-
qrW: 150,
|
|
38
|
-
|
|
39
|
-
qrX: 110,
|
|
40
|
-
|
|
41
|
-
qrY: 310,
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
id:"12",
|
|
48
|
-
|
|
49
|
-
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-2.png",
|
|
50
|
-
|
|
51
|
-
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
52
|
-
|
|
53
|
-
qrH: 150,
|
|
54
|
-
|
|
55
|
-
qrW: 150,
|
|
56
|
-
|
|
57
|
-
qrX: 110,
|
|
58
|
-
|
|
59
|
-
qrY: 310,
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
id:"10",
|
|
66
|
-
|
|
67
|
-
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-3.png",
|
|
68
|
-
|
|
69
|
-
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
70
|
-
|
|
71
|
-
qrH: 150,
|
|
72
|
-
|
|
73
|
-
qrW: 150,
|
|
74
|
-
|
|
75
|
-
qrX: 110,
|
|
76
|
-
|
|
77
|
-
qrY: 310,
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
id:"11",
|
|
84
|
-
|
|
85
|
-
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-1.png",
|
|
86
|
-
|
|
87
|
-
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
88
|
-
|
|
89
|
-
qrH: 150,
|
|
90
|
-
|
|
91
|
-
qrW: 150,
|
|
92
|
-
|
|
93
|
-
qrX: 110,
|
|
94
|
-
|
|
95
|
-
qrY: 310,
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
id:"12",
|
|
102
|
-
|
|
103
|
-
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-2.png",
|
|
104
|
-
|
|
105
|
-
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
106
|
-
|
|
107
|
-
qrH: 150,
|
|
108
|
-
|
|
109
|
-
qrW: 150,
|
|
110
|
-
|
|
111
|
-
qrX: 110,
|
|
112
|
-
|
|
113
|
-
qrY: 310,
|
|
114
|
-
|
|
115
|
-
}]
|
|
116
|
-
|
|
117
|
-
注意的是, 获取数据后需要 2 倍传入。
|
|
118
|
-
|
|
119
|
-
##### 属性和方法
|
|
120
|
-
|
|
121
|
-

|
|
122
|
-
|
|
123
|
-
海报数据如上格式。(back 是海报, qr 是二维码, qrH、qrw 是宽高, qrX、qrY 是二维码坐标位置)
|
|
124
|
-
|
|
125
|
-
方法 share 是点击确认的回调。
|
|
126
|
-
|
|
127
|
-
通过 ref 拉起内容 shareRef.value?.openShareDialog()
|
|
128
|
-
|
|
129
|
-
##### h5 项目中,分享不能够直接弹出分享框,需要先上传到己方服务器,再根据线上的图片地址去分享,示例代码如下:
|
|
130
|
-
|
|
131
|
-
// h5 分享图片
|
|
132
|
-
|
|
133
|
-
lettempFilePath=''
|
|
134
|
-
|
|
135
|
-
lettempFilePath1=''
|
|
136
|
-
|
|
137
|
-
exportasyncfunctiondownloadImage(filePath:string, showTips1=false) {
|
|
138
|
-
|
|
139
|
-
if (!tempFilePath||tempFilePath1!==filePath) {
|
|
140
|
-
|
|
141
|
-
constloginStore=useLoginStore()
|
|
142
|
-
|
|
143
|
-
constsession=loginStore.getLoginSession()
|
|
144
|
-
|
|
145
|
-
constupRes=awaitTaro.uploadFile({
|
|
146
|
-
|
|
147
|
-
url: BASISAPIS.file_uploadImg,
|
|
148
|
-
|
|
149
|
-
filePath: filePath,
|
|
150
|
-
|
|
151
|
-
name: 'file',
|
|
152
|
-
|
|
153
|
-
formData: {
|
|
154
|
-
|
|
155
|
-
objectNo:`H5${USER_TYPE}${Date.now()}`
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
header: {
|
|
160
|
-
|
|
161
|
-
traceId: generateUniqueId('portal-weapp'),
|
|
162
|
-
|
|
163
|
-
token: session||''
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
constres=JSON.parse(upRes.data)
|
|
170
|
-
|
|
171
|
-
if (res.success) {
|
|
172
|
-
|
|
173
|
-
tempFilePath=res.result
|
|
174
|
-
|
|
175
|
-
createImage(tempFilePath, showTips1)
|
|
176
|
-
|
|
177
|
-
setTimeout(() => {
|
|
178
|
-
|
|
179
|
-
tempFilePath=''
|
|
180
|
-
|
|
181
|
-
tempFilePath1=''
|
|
182
|
-
|
|
183
|
-
}, 10000);
|
|
184
|
-
|
|
185
|
-
} else {
|
|
186
|
-
|
|
187
|
-
Taro.showToast({
|
|
188
|
-
|
|
189
|
-
title: '海报生成失败',
|
|
190
|
-
|
|
191
|
-
icon: 'none'
|
|
192
|
-
|
|
193
|
-
})
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
} else {
|
|
198
|
-
|
|
199
|
-
createImage(tempFilePath, showTips1)
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
tempFilePath1=filePath
|
|
204
|
-
|
|
205
|
-
// 创建图片预览弹窗
|
|
206
|
-
|
|
207
|
-
functioncreateImage(path:string, showTips1=false) {
|
|
208
|
-
|
|
209
|
-
constpreviewImage=document.createElement('div')
|
|
210
|
-
|
|
211
|
-
previewImage.style.cssText=`
|
|
212
|
-
|
|
213
|
-
position: fixed;
|
|
214
|
-
|
|
215
|
-
top: 0;
|
|
216
|
-
|
|
217
|
-
left: 0;
|
|
218
|
-
|
|
219
|
-
width: 100%;
|
|
220
|
-
|
|
221
|
-
height: 100%;
|
|
222
|
-
|
|
223
|
-
background: rgba(0,0,0,0.7);
|
|
224
|
-
|
|
225
|
-
z-index: 9999;
|
|
226
|
-
|
|
227
|
-
display: flex;
|
|
228
|
-
|
|
229
|
-
flex-direction: column;
|
|
230
|
-
|
|
231
|
-
align-items: center;
|
|
232
|
-
|
|
233
|
-
justify-content: center;
|
|
234
|
-
|
|
235
|
-
`
|
|
236
|
-
|
|
237
|
-
constimg=document.createElement('img')
|
|
238
|
-
|
|
239
|
-
img.src=path
|
|
240
|
-
|
|
241
|
-
img.style.cssText='max-width: 90%; max-height: 80%;'
|
|
242
|
-
|
|
243
|
-
consttips=document.createElement('div')
|
|
244
|
-
|
|
245
|
-
tips.innerText='长按转发或保存图片'
|
|
246
|
-
|
|
247
|
-
tips.style.cssText='color: #fff; margin-top: 15px; font-size: 16px;'
|
|
248
|
-
|
|
249
|
-
consttips1=document.createElement('div')
|
|
250
|
-
|
|
251
|
-
tips1.innerText='二维码 30 天有效'
|
|
252
|
-
|
|
253
|
-
tips1.style.cssText='color: #fff; margin-top: 5px; font-size: 12px;'
|
|
254
|
-
|
|
255
|
-
previewImage.appendChild(img)
|
|
256
|
-
|
|
257
|
-
previewImage.appendChild(tips)
|
|
258
|
-
|
|
259
|
-
showTips1&&previewImage.appendChild(tips1)
|
|
260
|
-
|
|
261
|
-
document.body.appendChild(previewImage)
|
|
262
|
-
|
|
263
|
-
// 点击空白处关闭
|
|
264
|
-
|
|
265
|
-
previewImage.onclick= () => {
|
|
266
|
-
|
|
267
|
-
document.body.removeChild(previewImage)
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
}
|
|
1
|
+
##### 组件说明:
|
|
2
|
+
|
|
3
|
+
该组件是一个海报分享组件,调用者传入图片数据
|
|
4
|
+
|
|
5
|
+
数据示例:
|
|
6
|
+
|
|
7
|
+
[
|
|
8
|
+
|
|
9
|
+
{
|
|
10
|
+
|
|
11
|
+
id:"10",
|
|
12
|
+
|
|
13
|
+
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-3.png",
|
|
14
|
+
|
|
15
|
+
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
16
|
+
|
|
17
|
+
qrH: 150,
|
|
18
|
+
|
|
19
|
+
qrW: 150,
|
|
20
|
+
|
|
21
|
+
qrX: 110,
|
|
22
|
+
|
|
23
|
+
qrY: 310,
|
|
24
|
+
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
{
|
|
28
|
+
|
|
29
|
+
id:"11",
|
|
30
|
+
|
|
31
|
+
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-1.png",
|
|
32
|
+
|
|
33
|
+
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
34
|
+
|
|
35
|
+
qrH: 150,
|
|
36
|
+
|
|
37
|
+
qrW: 150,
|
|
38
|
+
|
|
39
|
+
qrX: 110,
|
|
40
|
+
|
|
41
|
+
qrY: 310,
|
|
42
|
+
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
{
|
|
46
|
+
|
|
47
|
+
id:"12",
|
|
48
|
+
|
|
49
|
+
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-2.png",
|
|
50
|
+
|
|
51
|
+
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
52
|
+
|
|
53
|
+
qrH: 150,
|
|
54
|
+
|
|
55
|
+
qrW: 150,
|
|
56
|
+
|
|
57
|
+
qrX: 110,
|
|
58
|
+
|
|
59
|
+
qrY: 310,
|
|
60
|
+
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
|
|
65
|
+
id:"10",
|
|
66
|
+
|
|
67
|
+
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-3.png",
|
|
68
|
+
|
|
69
|
+
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
70
|
+
|
|
71
|
+
qrH: 150,
|
|
72
|
+
|
|
73
|
+
qrW: 150,
|
|
74
|
+
|
|
75
|
+
qrX: 110,
|
|
76
|
+
|
|
77
|
+
qrY: 310,
|
|
78
|
+
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
{
|
|
82
|
+
|
|
83
|
+
id:"11",
|
|
84
|
+
|
|
85
|
+
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-1.png",
|
|
86
|
+
|
|
87
|
+
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
88
|
+
|
|
89
|
+
qrH: 150,
|
|
90
|
+
|
|
91
|
+
qrW: 150,
|
|
92
|
+
|
|
93
|
+
qrX: 110,
|
|
94
|
+
|
|
95
|
+
qrY: 310,
|
|
96
|
+
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
{
|
|
100
|
+
|
|
101
|
+
id:"12",
|
|
102
|
+
|
|
103
|
+
back:"https://cdn.ddjf.com/static/images/approve_qmx/qmx-dist-post-bg-2.png",
|
|
104
|
+
|
|
105
|
+
qr: "https://cdn.ddjf.com/static/images/fnfundkit/orderNums-userInfo.png",
|
|
106
|
+
|
|
107
|
+
qrH: 150,
|
|
108
|
+
|
|
109
|
+
qrW: 150,
|
|
110
|
+
|
|
111
|
+
qrX: 110,
|
|
112
|
+
|
|
113
|
+
qrY: 310,
|
|
114
|
+
|
|
115
|
+
}]
|
|
116
|
+
|
|
117
|
+
注意的是, 获取数据后需要 2 倍传入。
|
|
118
|
+
|
|
119
|
+
##### 属性和方法
|
|
120
|
+
|
|
121
|
+

|
|
122
|
+
|
|
123
|
+
海报数据如上格式。(back 是海报, qr 是二维码, qrH、qrw 是宽高, qrX、qrY 是二维码坐标位置)
|
|
124
|
+
|
|
125
|
+
方法 share 是点击确认的回调。
|
|
126
|
+
|
|
127
|
+
通过 ref 拉起内容 shareRef.value?.openShareDialog()
|
|
128
|
+
|
|
129
|
+
##### h5 项目中,分享不能够直接弹出分享框,需要先上传到己方服务器,再根据线上的图片地址去分享,示例代码如下:
|
|
130
|
+
|
|
131
|
+
// h5 分享图片
|
|
132
|
+
|
|
133
|
+
lettempFilePath=''
|
|
134
|
+
|
|
135
|
+
lettempFilePath1=''
|
|
136
|
+
|
|
137
|
+
exportasyncfunctiondownloadImage(filePath:string, showTips1=false) {
|
|
138
|
+
|
|
139
|
+
if (!tempFilePath||tempFilePath1!==filePath) {
|
|
140
|
+
|
|
141
|
+
constloginStore=useLoginStore()
|
|
142
|
+
|
|
143
|
+
constsession=loginStore.getLoginSession()
|
|
144
|
+
|
|
145
|
+
constupRes=awaitTaro.uploadFile({
|
|
146
|
+
|
|
147
|
+
url: BASISAPIS.file_uploadImg,
|
|
148
|
+
|
|
149
|
+
filePath: filePath,
|
|
150
|
+
|
|
151
|
+
name: 'file',
|
|
152
|
+
|
|
153
|
+
formData: {
|
|
154
|
+
|
|
155
|
+
objectNo:`H5${USER_TYPE}${Date.now()}`
|
|
156
|
+
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
header: {
|
|
160
|
+
|
|
161
|
+
traceId: generateUniqueId('portal-weapp'),
|
|
162
|
+
|
|
163
|
+
token: session||''
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
constres=JSON.parse(upRes.data)
|
|
170
|
+
|
|
171
|
+
if (res.success) {
|
|
172
|
+
|
|
173
|
+
tempFilePath=res.result
|
|
174
|
+
|
|
175
|
+
createImage(tempFilePath, showTips1)
|
|
176
|
+
|
|
177
|
+
setTimeout(() => {
|
|
178
|
+
|
|
179
|
+
tempFilePath=''
|
|
180
|
+
|
|
181
|
+
tempFilePath1=''
|
|
182
|
+
|
|
183
|
+
}, 10000);
|
|
184
|
+
|
|
185
|
+
} else {
|
|
186
|
+
|
|
187
|
+
Taro.showToast({
|
|
188
|
+
|
|
189
|
+
title: '海报生成失败',
|
|
190
|
+
|
|
191
|
+
icon: 'none'
|
|
192
|
+
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
} else {
|
|
198
|
+
|
|
199
|
+
createImage(tempFilePath, showTips1)
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
tempFilePath1=filePath
|
|
204
|
+
|
|
205
|
+
// 创建图片预览弹窗
|
|
206
|
+
|
|
207
|
+
functioncreateImage(path:string, showTips1=false) {
|
|
208
|
+
|
|
209
|
+
constpreviewImage=document.createElement('div')
|
|
210
|
+
|
|
211
|
+
previewImage.style.cssText=`
|
|
212
|
+
|
|
213
|
+
position: fixed;
|
|
214
|
+
|
|
215
|
+
top: 0;
|
|
216
|
+
|
|
217
|
+
left: 0;
|
|
218
|
+
|
|
219
|
+
width: 100%;
|
|
220
|
+
|
|
221
|
+
height: 100%;
|
|
222
|
+
|
|
223
|
+
background: rgba(0,0,0,0.7);
|
|
224
|
+
|
|
225
|
+
z-index: 9999;
|
|
226
|
+
|
|
227
|
+
display: flex;
|
|
228
|
+
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
|
|
231
|
+
align-items: center;
|
|
232
|
+
|
|
233
|
+
justify-content: center;
|
|
234
|
+
|
|
235
|
+
`
|
|
236
|
+
|
|
237
|
+
constimg=document.createElement('img')
|
|
238
|
+
|
|
239
|
+
img.src=path
|
|
240
|
+
|
|
241
|
+
img.style.cssText='max-width: 90%; max-height: 80%;'
|
|
242
|
+
|
|
243
|
+
consttips=document.createElement('div')
|
|
244
|
+
|
|
245
|
+
tips.innerText='长按转发或保存图片'
|
|
246
|
+
|
|
247
|
+
tips.style.cssText='color: #fff; margin-top: 15px; font-size: 16px;'
|
|
248
|
+
|
|
249
|
+
consttips1=document.createElement('div')
|
|
250
|
+
|
|
251
|
+
tips1.innerText='二维码 30 天有效'
|
|
252
|
+
|
|
253
|
+
tips1.style.cssText='color: #fff; margin-top: 5px; font-size: 12px;'
|
|
254
|
+
|
|
255
|
+
previewImage.appendChild(img)
|
|
256
|
+
|
|
257
|
+
previewImage.appendChild(tips)
|
|
258
|
+
|
|
259
|
+
showTips1&&previewImage.appendChild(tips1)
|
|
260
|
+
|
|
261
|
+
document.body.appendChild(previewImage)
|
|
262
|
+
|
|
263
|
+
// 点击空白处关闭
|
|
264
|
+
|
|
265
|
+
previewImage.onclick= () => {
|
|
266
|
+
|
|
267
|
+
document.body.removeChild(previewImage)
|
|
268
|
+
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<nut-popup :pop-class="`app-drawer ${modelValue ? 'open' : ''}`" position="right" :visible="modelValue"
|
|
3
|
-
@update:visible="onVisibleChange">
|
|
4
|
-
<page-header :title="title" :style="Taro.getEnv() !== 'WEB' ? '' : '--height: 40px'" @close="onPageHeaderClose" />
|
|
5
|
-
<div class="drawer-body">
|
|
6
|
-
<slot></slot>
|
|
7
|
-
</div>
|
|
8
|
-
</nut-popup>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script lang="ts" setup>
|
|
12
|
-
import Taro from '@tarojs/taro'
|
|
13
|
-
|
|
14
|
-
// 右侧页面
|
|
15
|
-
// 模仿页面打开
|
|
16
|
-
// 假的标题栏和返回按钮
|
|
17
|
-
import PageHeader from './PageHeader.vue'
|
|
18
|
-
|
|
19
|
-
export interface AppDrawerProps {
|
|
20
|
-
modelValue: boolean,
|
|
21
|
-
title?: string,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const emit = defineEmits<{
|
|
25
|
-
(event: 'update:modelValue', value: boolean): void
|
|
26
|
-
}>()
|
|
27
|
-
|
|
28
|
-
const onVisibleChange = (value: boolean) => {
|
|
29
|
-
emit('update:modelValue', value)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
defineProps<AppDrawerProps>()
|
|
33
|
-
|
|
34
|
-
const onPageHeaderClose = () => {
|
|
35
|
-
emit('update:modelValue', false)
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<style lang="scss">
|
|
40
|
-
.app-drawer {
|
|
41
|
-
position: absolute;
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
|
|
45
|
-
&.open {
|
|
46
|
-
height: 100vh;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.drawer-body {
|
|
50
|
-
flex-grow: 1;
|
|
51
|
-
overflow: scroll;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<nut-popup :pop-class="`app-drawer ${modelValue ? 'open' : ''}`" position="right" :visible="modelValue"
|
|
3
|
+
@update:visible="onVisibleChange">
|
|
4
|
+
<page-header :title="title" :style="Taro.getEnv() !== 'WEB' ? '' : '--height: 40px'" @close="onPageHeaderClose" />
|
|
5
|
+
<div class="drawer-body">
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</nut-popup>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import Taro from '@tarojs/taro'
|
|
13
|
+
|
|
14
|
+
// 右侧页面
|
|
15
|
+
// 模仿页面打开
|
|
16
|
+
// 假的标题栏和返回按钮
|
|
17
|
+
import PageHeader from './PageHeader.vue'
|
|
18
|
+
|
|
19
|
+
export interface AppDrawerProps {
|
|
20
|
+
modelValue: boolean,
|
|
21
|
+
title?: string,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{
|
|
25
|
+
(event: 'update:modelValue', value: boolean): void
|
|
26
|
+
}>()
|
|
27
|
+
|
|
28
|
+
const onVisibleChange = (value: boolean) => {
|
|
29
|
+
emit('update:modelValue', value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
defineProps<AppDrawerProps>()
|
|
33
|
+
|
|
34
|
+
const onPageHeaderClose = () => {
|
|
35
|
+
emit('update:modelValue', false)
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="scss">
|
|
40
|
+
.app-drawer {
|
|
41
|
+
position: absolute;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
|
|
45
|
+
&.open {
|
|
46
|
+
height: 100vh;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.drawer-body {
|
|
50
|
+
flex-grow: 1;
|
|
51
|
+
overflow: scroll;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
54
|
</style>
|