@uxda/appkit 1.2.72 → 1.2.75
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/appkit.css +1862 -1559
- package/dist/assets/asset-BnRbHhKf +88 -0
- package/dist/index.js +3041 -558
- package/package.json +2 -1
- package/src/balance/api/endpoints.ts +44 -44
- package/src/balance/types.ts +42 -42
- package/src/components/bt-cropper/index.vue +774 -0
- package/src/components/bt-cropper/utils/calcCropper.js +42 -0
- package/src/components/bt-cropper/utils/calcImagePosition.js +23 -0
- package/src/components/bt-cropper/utils/calcImageSize.js +37 -0
- package/src/components/bt-cropper/utils/calcPointDistance.js +12 -0
- package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -0
- package/src/components/bt-cropper/utils/ratio.js +3 -0
- package/src/components/bt-cropper/utils/tools.js +25 -0
- package/src/components/dd-search/index.vue +3 -3
- package/src/index.ts +1 -0
- package/src/notice/components/NoticeBanner.vue +1 -1
- package/src/notice/components/NoticeList.vue +4 -4
- package/src/notice/components/index.ts +1 -2
- package/src/shared/components/DeviceVersion.vue +3 -2
- package/src/shared/composables/index.ts +3 -0
- package/src/shared/composables/useCountdown.ts +46 -0
- package/src/shared/composables/useDragBox.ts +88 -0
- package/src/shared/composables/useEncode.ts +43 -0
- package/src/shared/composables/useValidator.ts +31 -0
- package/src/shared/http/Http.ts +4 -3
- package/src/user/api/endpoints.ts +17 -0
- package/src/user/api/index.ts +86 -0
- package/src/{notice → user}/components/LoginSetting.vue +1 -0
- package/src/user/components/UserBinding.vue +300 -0
- package/src/user/components/UserBindingSuccess.vue +80 -0
- package/src/user/components/UserEntry.vue +129 -0
- package/src/user/components/UserFeedback.vue +410 -0
- package/src/user/components/UserFeedbackEntry.vue +137 -0
- package/src/user/components/UserHeadCrop.vue +65 -0
- package/src/user/components/UserInfo.vue +612 -0
- package/src/user/components/UserResourceEmpty.vue +74 -0
- package/src/user/components/index.ts +21 -0
- package/src/user/index.ts +1 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-feedback" :class="{ isSuccess }">
|
|
3
|
+
<div v-if="!isSuccess" class="user-feedback-wrap">
|
|
4
|
+
<div class="user-feedback-head">
|
|
5
|
+
<div class="user-feedback-head-info">1.系统使用过程中,遇到系统问题可通过此途径反馈。</div>
|
|
6
|
+
<div class="user-feedback-head-info">
|
|
7
|
+
2.尽量在出问题的页面直接点击“问题反馈”,系统将后台获取当前页面信息,以便快速定位问题页。
|
|
8
|
+
</div>
|
|
9
|
+
<div class="user-feedback-head-info">
|
|
10
|
+
3.问题描述请尽可能详细描述操作步骤,如涉及订单或客户信息,尽量附上订单编号/客户姓名等关键信息,以便快速定位问题。
|
|
11
|
+
</div>
|
|
12
|
+
<div class="user-feedback-head-info">4.问题描述支持上传图片及截图,视频不能超过50M。</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="user-feedback-tit">补充描述</div>
|
|
16
|
+
<div class="user-feedback-body">
|
|
17
|
+
<editor
|
|
18
|
+
id="myEditor"
|
|
19
|
+
:show-img-resize="true"
|
|
20
|
+
class="user-feedback-editor"
|
|
21
|
+
placeholder="请输入补充描述"
|
|
22
|
+
/>
|
|
23
|
+
<div class="user-feedback-handle">
|
|
24
|
+
<div
|
|
25
|
+
class="user-feedback-handle-item"
|
|
26
|
+
v-for="(item, key) in formState.attachment"
|
|
27
|
+
:key="key"
|
|
28
|
+
>
|
|
29
|
+
<img
|
|
30
|
+
v-if="item.type === 'image'"
|
|
31
|
+
class="user-feedback-handle-item-img"
|
|
32
|
+
mode="aspectFit"
|
|
33
|
+
:src="item.url"
|
|
34
|
+
/>
|
|
35
|
+
<video class="user-feedback-handle-item-img" :src="item.url" v-else />
|
|
36
|
+
<div class="user-feedback-handle-item-close" @click="onDelete(key)">
|
|
37
|
+
<img
|
|
38
|
+
class="user-feedback-handle-item-close-img"
|
|
39
|
+
src="https://cdn.ddjf.com/static/images/customer-center/close-filled.png"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="user-feedback-handle-item" @click="toUpload">+</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="user-feedback-footer">
|
|
48
|
+
<nut-button class="user-feedback-footer-btn" plain type="primary" @click="onCancel"
|
|
49
|
+
>最小化</nut-button
|
|
50
|
+
>
|
|
51
|
+
<nut-button class="user-feedback-footer-btn" type="primary" @click="onOk">反馈</nut-button>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="user-feedback-wrap" v-else>
|
|
55
|
+
<img
|
|
56
|
+
class="user-feedback-success-img"
|
|
57
|
+
mode="aspectFit"
|
|
58
|
+
src="https://cdn.ddjf.com/static/images/customer-center/success-icon.png"
|
|
59
|
+
/>
|
|
60
|
+
<div class="user-feedback-success-info">提交成功</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script lang="ts" setup>
|
|
66
|
+
import Taro from '@tarojs/taro'
|
|
67
|
+
import { onMounted, reactive, ref } from 'vue'
|
|
68
|
+
import { useAppKitOptions } from '../../Appkit'
|
|
69
|
+
import { useHttp } from '../api'
|
|
70
|
+
|
|
71
|
+
interface FormStateType {
|
|
72
|
+
content: string
|
|
73
|
+
attachment: any[]
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const props = withDefaults(
|
|
77
|
+
defineProps<{
|
|
78
|
+
app?: string
|
|
79
|
+
traceIds: string
|
|
80
|
+
value?: FormStateType | null
|
|
81
|
+
captureScreen?: any
|
|
82
|
+
}>(),
|
|
83
|
+
{
|
|
84
|
+
app: '',
|
|
85
|
+
traceIds: '',
|
|
86
|
+
value: null,
|
|
87
|
+
captureScreen: () => {},
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
onMounted(() => {
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
initEditor()
|
|
94
|
+
}, 500)
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const formState = reactive<FormStateType>({
|
|
98
|
+
content: '',
|
|
99
|
+
attachment: [],
|
|
100
|
+
})
|
|
101
|
+
const isSuccess = ref(false) // 反馈提交成功标记
|
|
102
|
+
|
|
103
|
+
const editorCtx = ref()
|
|
104
|
+
// 编辑器初始化
|
|
105
|
+
function initEditor() {
|
|
106
|
+
const query = Taro.createSelectorQuery()
|
|
107
|
+
query
|
|
108
|
+
.select('#myEditor')
|
|
109
|
+
.context((res) => {
|
|
110
|
+
editorCtx.value = res.context
|
|
111
|
+
|
|
112
|
+
if (props.value) {
|
|
113
|
+
if (props.value.content) {
|
|
114
|
+
formState.content = props.value.content
|
|
115
|
+
editorCtx.value.setContents({
|
|
116
|
+
html: props.value.content,
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
if (props.value.attachment && props.value.attachment.length) {
|
|
120
|
+
formState.attachment = props.value.attachment
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
.exec()
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 上传图片、视频
|
|
128
|
+
function toUpload() {
|
|
129
|
+
if (formState.attachment.length >= 20) {
|
|
130
|
+
return Taro.showToast({
|
|
131
|
+
title: '最多上传20份附件',
|
|
132
|
+
icon: 'none',
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
Taro.chooseMedia({
|
|
136
|
+
count: 20 - formState.attachment.length,
|
|
137
|
+
mediaType: ['mix'],
|
|
138
|
+
maxDuration: 60,
|
|
139
|
+
success: async (res) => {
|
|
140
|
+
console.log(res.tempFiles, 'res.tempFiles')
|
|
141
|
+
for (const item of res.tempFiles) {
|
|
142
|
+
if (item.fileType === 'video') {
|
|
143
|
+
if (item.size > 1024 * 1024 * 50) {
|
|
144
|
+
return Taro.showToast({
|
|
145
|
+
title: '视频大小不能超过50M',
|
|
146
|
+
icon: 'none',
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
await uploadFile(item)
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 文件上传请求
|
|
158
|
+
async function uploadFile(item: any) {
|
|
159
|
+
const appkitOptions = useAppKitOptions()
|
|
160
|
+
const token = appkitOptions.tempToken() || appkitOptions.token()
|
|
161
|
+
|
|
162
|
+
let Res: any = await Taro.uploadFile({
|
|
163
|
+
url: `${appkitOptions.baseUrl()}/saas-base/file/upload`,
|
|
164
|
+
filePath: item.tempFilePath,
|
|
165
|
+
name: 'file',
|
|
166
|
+
formData: {
|
|
167
|
+
objectNo: `${token}${Date.now()}`,
|
|
168
|
+
objectTypeCode: `PROBLEM_FEEDBACK_MINI`,
|
|
169
|
+
},
|
|
170
|
+
header: { token },
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
const res = JSON.parse(Res.data)
|
|
174
|
+
if (res.success) {
|
|
175
|
+
formState.attachment.push({
|
|
176
|
+
url: res.result,
|
|
177
|
+
type: item.fileType,
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// 删除附件
|
|
183
|
+
function onDelete(index: number) {
|
|
184
|
+
formState.attachment.splice(index, 1)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 点击最小化
|
|
188
|
+
function onCancel() {
|
|
189
|
+
editorCtx.value.getContents({
|
|
190
|
+
success: (res) => {
|
|
191
|
+
const html = res.html
|
|
192
|
+
formState.content = html
|
|
193
|
+
|
|
194
|
+
if (html && html !== '<p><br></p>') {
|
|
195
|
+
formState.content = html
|
|
196
|
+
}
|
|
197
|
+
emits('minimize', formState)
|
|
198
|
+
Taro.navigateBack()
|
|
199
|
+
},
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 点击确定反馈时
|
|
204
|
+
function onOk() {
|
|
205
|
+
editorCtx.value.getContents({
|
|
206
|
+
success: (res) => {
|
|
207
|
+
const html = res.html
|
|
208
|
+
if (html === '<p><br></p>' || !html) {
|
|
209
|
+
Taro.showToast({
|
|
210
|
+
title: '请输入问题描述',
|
|
211
|
+
icon: 'none',
|
|
212
|
+
})
|
|
213
|
+
} else {
|
|
214
|
+
formState.content = html
|
|
215
|
+
requestFeedback()
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// 请求反馈接口
|
|
222
|
+
function requestFeedback() {
|
|
223
|
+
const $http = useHttp()
|
|
224
|
+
const appkitOptions = useAppKitOptions()
|
|
225
|
+
|
|
226
|
+
Taro.showLoading({
|
|
227
|
+
title: '反馈中...',
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
const attachment = JSON.parse(JSON.stringify(formState.attachment))
|
|
231
|
+
if (props.captureScreen && Object.keys(props.captureScreen).length) {
|
|
232
|
+
attachment.push({
|
|
233
|
+
captureScreen: props.captureScreen,
|
|
234
|
+
})
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const sendData = {
|
|
238
|
+
appCode: props.app || appkitOptions.app(),
|
|
239
|
+
content: formState.content,
|
|
240
|
+
id: '',
|
|
241
|
+
remarks: '',
|
|
242
|
+
title: '',
|
|
243
|
+
traceIds: props.traceIds,
|
|
244
|
+
device: 'MINI',
|
|
245
|
+
attachment: JSON.stringify(attachment),
|
|
246
|
+
}
|
|
247
|
+
console.log(sendData, 'sendData')
|
|
248
|
+
$http
|
|
249
|
+
.post('/saas-base/problemFeedback/add', sendData)
|
|
250
|
+
.then(() => {
|
|
251
|
+
Taro.hideLoading()
|
|
252
|
+
emits('success')
|
|
253
|
+
// Taro.showToast({ title: '反馈提交成功', icon: 'none' })
|
|
254
|
+
// Taro.navigateBack()
|
|
255
|
+
isSuccess.value = true
|
|
256
|
+
clearFormState()
|
|
257
|
+
})
|
|
258
|
+
.catch(() => {
|
|
259
|
+
Taro.hideLoading()
|
|
260
|
+
})
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// 反馈成功后,清空反馈内容
|
|
264
|
+
function clearFormState() {
|
|
265
|
+
formState.content = ''
|
|
266
|
+
formState.attachment = []
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// 父组件事件
|
|
270
|
+
const emits = defineEmits(['minimize', 'success'])
|
|
271
|
+
</script>
|
|
272
|
+
|
|
273
|
+
<style lang="scss">
|
|
274
|
+
.user-feedback {
|
|
275
|
+
margin: 10px 12px;
|
|
276
|
+
padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
|
|
277
|
+
min-height: 100vh;
|
|
278
|
+
box-sizing: border-box;
|
|
279
|
+
overflow: hidden;
|
|
280
|
+
&.isSuccess {
|
|
281
|
+
margin: 0;
|
|
282
|
+
padding: 0;
|
|
283
|
+
height: 100%;
|
|
284
|
+
.user-feedback-wrap {
|
|
285
|
+
height: 100vh;
|
|
286
|
+
align-items: center;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
&-wrap {
|
|
290
|
+
min-height: calc(100vh - calc(75px + env(safe-area-inset-bottom, 0px)));
|
|
291
|
+
height: 100%;
|
|
292
|
+
background: #fff;
|
|
293
|
+
display: flex;
|
|
294
|
+
flex-direction: column;
|
|
295
|
+
box-sizing: border-box;
|
|
296
|
+
padding: 10px;
|
|
297
|
+
border-radius: 5px;
|
|
298
|
+
}
|
|
299
|
+
&-head {
|
|
300
|
+
background: #f2f9ff;
|
|
301
|
+
padding: 15px;
|
|
302
|
+
border-radius: 2px;
|
|
303
|
+
font-size: 12px;
|
|
304
|
+
margin-bottom: 8px;
|
|
305
|
+
&-info {
|
|
306
|
+
padding-left: 9px;
|
|
307
|
+
text-indent: -9px;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
&-tit {
|
|
311
|
+
height: 44px;
|
|
312
|
+
display: flex;
|
|
313
|
+
align-items: center;
|
|
314
|
+
color: #1a1a1a;
|
|
315
|
+
font-weight: 500;
|
|
316
|
+
font-size: 17px;
|
|
317
|
+
}
|
|
318
|
+
&-body {
|
|
319
|
+
border-radius: 4px 4px 0px 0px;
|
|
320
|
+
display: flex;
|
|
321
|
+
flex-direction: column;
|
|
322
|
+
overflow: hidden;
|
|
323
|
+
}
|
|
324
|
+
&-editor {
|
|
325
|
+
padding: 10px;
|
|
326
|
+
font-size: 14px;
|
|
327
|
+
background: #f5f5f5;
|
|
328
|
+
overflow-y: auto;
|
|
329
|
+
min-height: 165px;
|
|
330
|
+
}
|
|
331
|
+
&-handle {
|
|
332
|
+
display: flex;
|
|
333
|
+
align-items: center;
|
|
334
|
+
flex-wrap: wrap;
|
|
335
|
+
margin-top: 10px;
|
|
336
|
+
margin-right: -4px;
|
|
337
|
+
&-item {
|
|
338
|
+
position: relative;
|
|
339
|
+
border-radius: 2px;
|
|
340
|
+
display: flex;
|
|
341
|
+
align-items: center;
|
|
342
|
+
justify-content: center;
|
|
343
|
+
width: 79px;
|
|
344
|
+
height: 79px;
|
|
345
|
+
background: #f5f5f5;
|
|
346
|
+
font-size: 30px;
|
|
347
|
+
color: rgba(53, 53, 53, 0.3);
|
|
348
|
+
margin-right: 4px;
|
|
349
|
+
margin-bottom: 4px;
|
|
350
|
+
&-img {
|
|
351
|
+
max-width: 100%;
|
|
352
|
+
max-height: 100%;
|
|
353
|
+
}
|
|
354
|
+
&-close {
|
|
355
|
+
position: absolute;
|
|
356
|
+
top: -2px;
|
|
357
|
+
right: -2px;
|
|
358
|
+
width: 20px;
|
|
359
|
+
height: 20px;
|
|
360
|
+
display: flex;
|
|
361
|
+
justify-content: center;
|
|
362
|
+
align-items: center;
|
|
363
|
+
&-img {
|
|
364
|
+
width: 10px;
|
|
365
|
+
height: 10px;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
.ql-editor.ql-blank:before {
|
|
371
|
+
color: rgba(0, 0, 0, 0.3);
|
|
372
|
+
font-style: normal;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
&-footer {
|
|
376
|
+
position: fixed;
|
|
377
|
+
z-index: 10;
|
|
378
|
+
bottom: 0;
|
|
379
|
+
left: 0;
|
|
380
|
+
width: 100%;
|
|
381
|
+
min-height: 63px;
|
|
382
|
+
background: #ffffff;
|
|
383
|
+
box-shadow: 0 -3px 11px 0 rgba(224, 224, 224, 0.5);
|
|
384
|
+
padding: 10px 12px calc(8px + env(safe-area-inset-bottom, 0px));
|
|
385
|
+
display: flex;
|
|
386
|
+
justify-content: space-between;
|
|
387
|
+
box-sizing: border-box;
|
|
388
|
+
&-btn {
|
|
389
|
+
flex: 1;
|
|
390
|
+
&:first-child {
|
|
391
|
+
margin-right: 10px;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
&-success {
|
|
397
|
+
&-img {
|
|
398
|
+
width: 87px;
|
|
399
|
+
height: 90px;
|
|
400
|
+
margin-top: 110px;
|
|
401
|
+
margin-bottom: 20px;
|
|
402
|
+
}
|
|
403
|
+
&-info {
|
|
404
|
+
color: #353535;
|
|
405
|
+
font-size: 16px;
|
|
406
|
+
font-weight: 500;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
</style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="dragStyle"
|
|
4
|
+
@touchstart="onDragStart"
|
|
5
|
+
@touchmove="onDragMove"
|
|
6
|
+
@touchend="onDragEnd"
|
|
7
|
+
class="user-feedback-entry"
|
|
8
|
+
@click="onJump"
|
|
9
|
+
v-if="!hasStorage"
|
|
10
|
+
>
|
|
11
|
+
<img
|
|
12
|
+
class="user-feedback-entry-icon"
|
|
13
|
+
mode="aspectFit"
|
|
14
|
+
src="https://cdn.ddjf.com/static/images/customer-center/feedback.png"
|
|
15
|
+
/>
|
|
16
|
+
<div>反馈</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="user-feedback-entry hasStorage" v-else>
|
|
19
|
+
<img
|
|
20
|
+
class="user-feedback-entry-icon"
|
|
21
|
+
@click="onJump"
|
|
22
|
+
mode="aspectFit"
|
|
23
|
+
src="https://cdn.ddjf.com/static/images/customer-center/feedback-icon.png"
|
|
24
|
+
/>
|
|
25
|
+
<div class="user-feedback-entry-close" @click="onClose">
|
|
26
|
+
<img
|
|
27
|
+
class="user-feedback-entry-close-img"
|
|
28
|
+
src="https://cdn.ddjf.com/static/images/customer-center/close-filled.png"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import { computed, onMounted } from 'vue'
|
|
36
|
+
import { useDragBox } from '../../shared/composables/useDragBox'
|
|
37
|
+
import { useSafeArea } from '../../shared/composables'
|
|
38
|
+
|
|
39
|
+
const props = withDefaults(
|
|
40
|
+
defineProps<{
|
|
41
|
+
hasStorage?: boolean
|
|
42
|
+
withNavbar?: boolean
|
|
43
|
+
}>(),
|
|
44
|
+
{
|
|
45
|
+
hasStorage: false,
|
|
46
|
+
withNavbar: false,
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
// 点击关闭
|
|
51
|
+
function onClose() {
|
|
52
|
+
console.log('close')
|
|
53
|
+
emits('close')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 点击跳转
|
|
57
|
+
function onJump() {
|
|
58
|
+
emits('jump')
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const safeArea = useSafeArea()
|
|
62
|
+
/** 浮动按钮拖拽功能 */
|
|
63
|
+
const { dragData, initDragData, onDragStart, onDragMove, onDragEnd } = useDragBox()
|
|
64
|
+
const dragStyle = computed(() => {
|
|
65
|
+
return `left:${dragData.left}px; top:${dragData.top}px; width:${dragData.width}px; height:${dragData.height}px;`
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
onMounted(async () => {
|
|
69
|
+
// 初始化拖拽元素
|
|
70
|
+
initDragData({
|
|
71
|
+
width: 40,
|
|
72
|
+
height: 40,
|
|
73
|
+
left: 324,
|
|
74
|
+
top: props.withNavbar ? 620 - safeArea.nav - safeArea.status : 620,
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// 父组件事件
|
|
79
|
+
const emits = defineEmits(['close', 'jump'])
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="scss">
|
|
83
|
+
.user-feedback-entry {
|
|
84
|
+
position: fixed;
|
|
85
|
+
z-index: 10;
|
|
86
|
+
right: 12px;
|
|
87
|
+
bottom: calc(120px + env(safe-area-inset-bottom, 0px));
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
background: #fff;
|
|
93
|
+
box-shadow: 0px 2px 5px 0px #006ee51a;
|
|
94
|
+
width: 40px;
|
|
95
|
+
height: 40px;
|
|
96
|
+
border-radius: 50%;
|
|
97
|
+
color: rgba(0, 0, 0, 0.5);
|
|
98
|
+
font-size: 10px;
|
|
99
|
+
&-icon {
|
|
100
|
+
width: 13px;
|
|
101
|
+
height: 13px;
|
|
102
|
+
margin-bottom: 1px;
|
|
103
|
+
}
|
|
104
|
+
&:active {
|
|
105
|
+
background: rgba(255, 255, 255, 0.7);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.hasStorage {
|
|
109
|
+
width: 92px;
|
|
110
|
+
height: 43px;
|
|
111
|
+
background: transparent;
|
|
112
|
+
box-shadow: none;
|
|
113
|
+
.user-feedback-entry-icon {
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100%;
|
|
116
|
+
}
|
|
117
|
+
&:active {
|
|
118
|
+
background: transparent;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.user-feedback-entry-close {
|
|
122
|
+
position: absolute;
|
|
123
|
+
top: -6px;
|
|
124
|
+
right: -6px;
|
|
125
|
+
width: 20px;
|
|
126
|
+
height: 20px;
|
|
127
|
+
display: flex;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
align-items: center;
|
|
130
|
+
&-img {
|
|
131
|
+
width: 10px;
|
|
132
|
+
height: 10px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-head-crop">
|
|
3
|
+
<bt-cropper ref="cropperRef" :imageSrc="params.src" :ratio="1">
|
|
4
|
+
<div class="user-head-crop-btns">
|
|
5
|
+
<div class="cbtn" @click="onCancel">取消</div>
|
|
6
|
+
<div class="cbtn comfirmBtn" @click="onConfirm">确定</div>
|
|
7
|
+
</div>
|
|
8
|
+
</bt-cropper>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import Taro, { useRouter } from '@tarojs/taro'
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
import btCropper from '../../components/bt-cropper/index.vue'
|
|
16
|
+
|
|
17
|
+
const { params } = useRouter()
|
|
18
|
+
const cropperRef = ref()
|
|
19
|
+
|
|
20
|
+
// 取消
|
|
21
|
+
function onCancel() {
|
|
22
|
+
Taro.navigateBack({
|
|
23
|
+
delta: 1,
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 确认裁剪
|
|
28
|
+
async function onConfirm() {
|
|
29
|
+
const [err, res] = await cropperRef.value.crop()
|
|
30
|
+
if (err) {
|
|
31
|
+
Taro.showModal({
|
|
32
|
+
title: '温馨提示',
|
|
33
|
+
content: err.message,
|
|
34
|
+
confirmColor: '#017fff',
|
|
35
|
+
})
|
|
36
|
+
} else {
|
|
37
|
+
Taro.eventCenter.trigger('USER-HEAD-CROP-OK', res.tempFilePath)
|
|
38
|
+
onCancel()
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style lang="scss">
|
|
44
|
+
.user-head-crop {
|
|
45
|
+
height: 100vh;
|
|
46
|
+
&-btns {
|
|
47
|
+
position: absolute;
|
|
48
|
+
bottom: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 50px;
|
|
52
|
+
padding: 0 20px;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
line-height: 50px;
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
}
|
|
58
|
+
.cbtn {
|
|
59
|
+
color: #fff;
|
|
60
|
+
}
|
|
61
|
+
.comfirmBtn {
|
|
62
|
+
color: var(--app-primary-color, #017fff);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</style>
|