绿满眶商城微信小程序-uniapp
zxl
2025-07-14 1629d48c881f9fd138e6902f9c0185afa8f7ea4d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
<template>
    <view class="add-user-container">
        <!-- 表单区域 -->
        <view class="form-card">
            <u-form :model="form" ref="uForm" label-width="150rpx" :rules="rules" style="width: 100%;">
 
                <!-- 活动名称 -->
                <u-form-item label="活动名称" prop="activityName" borderBottom required>
                    <u-input v-model="form.activityName" placeholder="请输入活动名称" border="none" />
                </u-form-item>
 
                <!-- 活动类型 -->
                <u-form-item label="活动类型" prop="activityType" borderBottom required>
                    <u-radio-group v-model="form.activityType" placement="column">
                        <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in activityTypes"
                            :key="index" :label="item.value" :name="item.value" @change="activityTypeRadioChange">
                            <span>{{item.label}}</span>
                        </u-radio>
                    </u-radio-group>
                </u-form-item>
 
                <!-- 报名时间范围 -->
                <u-form-item label="报名开始时间" prop="reportStartTime" borderBottom required label-width="200rpx">
                    <uni-datetime-picker type="datetime" v-model="form.reportStartTime"
                        @change="handleReportStartTimeChange" />
                </u-form-item>
 
                <u-form-item label="报名结束时间" prop="reportEndTime" borderBottom required label-width="200rpx">
                    <uni-datetime-picker type="datetime" v-model="form.reportEndTime" :start="form.reportStartTime"
                        @change="handleReportEndTimeChange" />
                </u-form-item>
 
                <!-- 活动时间范围 -->
                <u-form-item label="活动开始时间" prop="startTime" borderBottom required label-width="200rpx">
                    <uni-datetime-picker type="datetime" v-model="form.startTime" :start="form.reportEndTime"
                        @change="handleStartTimeChange" />
                </u-form-item>
 
                <u-form-item label="活动结束时间" prop="endTime" borderBottom required label-width="200rpx">
                    <uni-datetime-picker type="datetime" v-model="form.endTime" :start="form.startTime"
                        @change="handleEndTimeChange" />
                </u-form-item>
 
                <!-- 封面类型 -->
                <u-form-item label="封面类型" prop="coverType" borderBottom required>
                    <u-radio-group v-model="coverType" placement="column">
                        <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in coverTypes" :key="index"
                            :label="item.value" :name="item.value" @change="coverTypeRadioChange">
                            <span>{{item.label}}</span>
                        </u-radio>
                    </u-radio-group>
 
                </u-form-item>
 
 
                <!-- 活动封面 -->
                <u-form-item label="活动封面" prop="cover" borderBottom required>
                    <u-input v-if="coverType === 'text'" v-model="form.cover" placeholder="请输入封面文字" border="none" />
                    <u-upload v-else :fileList="coverList" @delete="deleteCover" name="cover" :maxCount="1"
                        uploadText="上传封面" :action="uploadUrl" @success="handleSuccess"></u-upload>
                </u-form-item>
 
                <!-- 人数限制 -->
                <u-form-item label="人数限制" prop="limitUserNum" borderBottom required>
                    <u-number-box v-model="form.limitUserNum" :min="0" :max="1000" integer></u-number-box>
                    <text style="margin-left: 20rpx;color: #999">0表示不限制</text>
                </u-form-item>
 
                <!-- 活动地点 -->
                <u-form-item label="活动地点" prop="activityLocation" borderBottom v-if="form.activityType === 'offline'"
                    required>
                    <u-input v-model="form.activityLocation" placeholder="请输入活动地点" border="none" />
                </u-form-item>
 
                <!-- 活动内容 -->
                <u-form-item label="活动内容" prop="activityContent" borderBottom required>
 
                </u-form-item>
                <sp-editor style="max-width: 70%;" :toolbar-config="{
                               excludeKeys: ['direction', 'date', 'lineHeight', 'letterSpacing', 'listCheck'],
                               iconSize: '15px'
                             }" @init="initEditor" @input="inputOver" @overMax="overMax" @upinImage="upinImage"
                    @upinVideo="upinVideo"></sp-editor>
            </u-form>
 
            <!-- 提交按钮 -->
            <view class="submit-btn">
                <u-button type="primary" shape="circle" @click="submitForm" :loading="loading">提交</u-button>
            </view>
        </view>
    </view>
</template>
 
<script>
    import {
        convertImgStylesToAttributes,
        handleHtmlWithVideo
    } from '@/uni_modules/sp-editor/utils'
    import '@/components/uview-components/uview-ui';
    import {
        addActivityByBuyer
    } from '@/api/activity.js'
 
    export default {
        data() {
            return {
                uploadUrl: 'http://127.0.0.1:8890/common/lmk/file/upload',
                coverType: 'file',
 
 
                isImage: false, // 是否是图片
 
                editorIns: null,
 
                loading: false,
                coverList: [],
                activityTypes: [{
                        label: '线上',
                        value: 'online'
                    },
                    {
                        label: '线下',
                        value: 'offline'
                    }
                ],
                coverTypes: [{
                        label: '文件',
                        value: 'file'
                    },
                    {
                        label: '文字',
                        value: 'text'
                    }
                ],
                form: {
                    activityName: '',
                    activityType: 'online', // 默认线上
                    reportStartTime: '',
                    reportEndTime: '', // 默认明天
                    startTime: '', // 默认后天
                    endTime: '', // 默认大后天
                    cover: '',
                    coverType: 'file',
                    limitUserNum: 0,
                    activityLocation: '',
                    activityContent: ''
                },
                rules: {
                    activityName: [{
                            required: true,
                            message: '请输入活动名称',
                            trigger: 'blur'
                        },
                        {
                            min: 2,
                            max: 50,
                            message: '长度在2到50个字符',
                            trigger: 'blur'
                        }
                    ],
                    activityType: [{
                        required: true,
                        message: '请选择活动类型',
                        trigger: 'change'
                    }],
                    coverType: [{
                        required: true,
                        message: '请选择封面类型',
                        trigger: 'change'
                    }],
                    cover: [{
                        required: true,
                        message: '请上传活动封面',
                        trigger: 'change'
                    }],
                    reportStartTime: [{
                        required: true,
                        message: '请选择报名开始时间',
                        trigger: 'blur'
                    }],
                    reportEndTime: [{
                            required: true,
                            message: '请选择报名结束时间',
                            trigger: 'change'
                        },
                        {
                            validator: this.validateReportTime,
                            trigger: 'change'
                        }
                    ],
                    startTime: [{
                            required: true,
                            message: '请选择活动开始时间',
                            trigger: 'change'
                        },
                        {
                            validator: this.validateStartTime,
                            trigger: 'change'
                        }
                    ],
                    endTime: [{
                            required: true,
                            message: '请选择活动结束时间',
                            trigger: 'change'
                        },
                        {
                            validator: this.validateEndTime,
                            trigger: 'change'
                        }
                    ],
                    limitUserNum: [{
                            required: true,
                            message: '请输入人数',
                            trigger: 'change',
                            validator: this.numValidate,
                        },
 
                    ],
                    activityContent: [{
                            required: true,
                            message: '请输入活动内容',
                            trigger: 'blur'
                        },
                        {
                            min: 10,
                            message: '至少输入10个字符',
                            trigger: 'blur'
                        }
                    ]
                },
            }
        },
        onReady() {
            // 微信小程序需要用此写法
        },
        onLoad() {
            setTimeout(() => {
                this.$refs.uForm.setRules(this.rules)
            }, 500)
        },
        methods: {
            /**
             * 直接运行示例工程插入图片无法正常显示的看这里
             * 因为插件默认采用云端存储图片的方式
             * 以$emit('upinImage', tempFiles, this.editorCtx)的方式回调
             * @param {Object} tempFiles
             * @param {Object} editorCtx
             */
            async upinImage(tempFiles, editorCtx) {
                /**
                 * 本地临时插入图片预览
                 * 注意:这里仅是示例本地图片预览,因为需要将图片先上传到云端,再将图片插入到编辑器中
                 * 正式开发时,还请将此处注释,并解开下面 使用 uniCloud.uploadFile 上传图片的示例方法 的注释
                 * @tutorial https://uniapp.dcloud.net.cn/api/media/editor-context.html#editorcontext-insertimage
                 */
                let data = await this.upload(tempFiles);
                console.log(data)
                // #ifdef MP-WEIXIN
                // 注意微信小程序的图片路径是在tempFilePath字段中
                editorCtx.insertImage({
                    src: data.data.url, //富文本内容
                    width: '80%', // 默认不建议铺满宽度100%,预留一点空隙以便用户编辑
                    alt: data.data.url +'|'+data.data.fileKey,
                    success: function() {}
                })
                // #endif
 
                // #ifndef MP-WEIXIN
                editorCtx.insertImage({
                    src: data.data.url, //富文本内容
                    width: '80%', // 默认不建议铺满宽度100%,预留一点空隙以便用户编辑
                    success: function() {}
                })
                // #endif
            },
            async upinVideo(tempFiles, editorCtx) {
                let data = await this.uploadVideo(tempFiles);
                await editorCtx.insertImage({
                    src: 'https://img.zcool.cn/community/01055859b8e37fa8012075341db67f.gif', //富文本内容
                    width: '80%', // 默认不建议铺满宽度100%,预留一点空隙以便用户编辑
                    alt: data.data.url +'|'+data.data.fileKey,
                })
 
            },
            async upload(tempFiles) {
                uni.showLoading({
                    title: '加载上传中...',
                    mask: true
                });
 
                try {
                    const res = await new Promise((resolve, reject) => {
                        uni.uploadFile({
                            url: 'http://127.0.0.1:8890/common/lmk/file/upload',
                            filePath: tempFiles[0].tempFilePath,
                            name: 'file',
                            success: (uploadRes) => {
                                if (uploadRes.statusCode === 200) {
                                    try {
                                        const parsedData = JSON.parse(uploadRes.data);
                                        resolve(parsedData);
                                    } catch (e) {
                                        reject(new Error('解析响应数据失败'));
                                    }
                                } else {
                                    reject(new Error(`上传失败: ${uploadRes.statusCode}`));
                                }
                            },
                            fail: (err) => {
                                const errMsg = typeof err === 'object' ? JSON.stringify(err) :
                                    String(err);
                                reject(new Error(`上传失败: ${errMsg}`));
                            }
                        });
                    });
 
                    uni.hideLoading();
                    return res;
                } catch (error) {
                    uni.hideLoading();
                    uni.showToast({
                        title: error.message,
                        icon: 'none'
                    });
                    throw error; // 可以选择继续抛出错误或返回null
                }
            },
 
 
            async uploadVideo(tempFiles) {
                uni.showLoading({
                    title: '加载上传中...',
                    mask: true
                });
 
                try {
                    const res = await new Promise((resolve, reject) => {
                        uni.uploadFile({
                            url: 'http://127.0.0.1:8890/common/lmk/file/upload',
                            filePath: tempFiles,
                            name: 'file',
                            success: (uploadRes) => {
                                if (uploadRes.statusCode === 200) {
                                    try {
                                        const parsedData = JSON.parse(uploadRes.data);
                                        resolve(parsedData);
                                    } catch (e) {
                                        reject(new Error('解析响应数据失败'));
                                    }
                                } else {
                                    reject(new Error(`上传失败: ${uploadRes.statusCode}`));
                                }
                            },
                            fail: (err) => {
                                const errMsg = typeof err === 'object' ? JSON.stringify(err) :
                                    String(err);
                                reject(new Error(`上传失败: ${errMsg}`));
                            }
                        });
                    });
 
                    uni.hideLoading();
                    return res;
                } catch (error) {
                    uni.hideLoading();
                    uni.showToast({
                        title: error.message,
                        icon: 'none'
                    });
                    throw error; // 可以选择继续抛出错误或返回null
                }
            },
            /**
             * 获取输入内容
             * @param {Object} e {html,text} 内容的html文本,和text文本
             */
            inputOver(e) {
                // 可以在此处获取到编辑器已编辑的内容
                console.log('==== inputOver :', e)
                this.form.activityContent = e.html;
            },
            /**
             * 超出最大内容限制
             * @param {Object} e {html,text} 内容的html文本,和text文本
             */
            overMax(e) {
                // 若设置了最大字数限制,可在此处触发超出限制的回调
                console.log('==== overMax :', e)
            },
            /**
             * 编辑器就绪
             * @param {Object} editor 编辑器实例,你可以自定义调用editor实例的方法
             * @tutorial editor组件 https://uniapp.dcloud.net.cn/component/editor.html#editor-%E7%BB%84%E4%BB%B6
             * @tutorial 相关api https://uniapp.dcloud.net.cn/api/media/editor-context.html
             */
            initEditor(editor) {
                this.editorIns = editor // 保存编辑器实例
                // 保存编辑器实例后,可以在此处获取后端数据,并赋值给编辑器初始化内容
                this.preRender()
            },
            preRender() {
                setTimeout(() => {
                    // 异步获取后端数据后,初始化编辑器内容
                    this.editorIns.setContents({
                        html: ``
                    })
                }, 1000)
            },
            // 时间选择变化处理
            handleReportStartTimeChange(val) {
                this.form = {
                    ...this.form,
                    reportStartTime: val
                }; // 解构赋值触发响应式
                // 如果报名结束时间早于开始时间,则重置
                if (new Date(this.form.reportEndTime) < new Date(val)) {
                    this.form.reportEndTime = '';
                }
            },
            handleReportEndTimeChange(val) {
                this.form.reportEndTime = val;
                // 如果活动开始时间早于报名结束时间,则重置
                if (new Date(this.form.startTime) < new Date(val)) {
                    this.form.startTime = '';
                }
            },
            handleStartTimeChange(val) {
                this.form.startTime = val;
                // 如果活动结束时间早于开始时间,则重置
                if (new Date(this.form.endTime) < new Date(val)) {
                    this.form.endTime = '';
                }
            },
            handleEndTimeChange(val) {
                this.form.endTime = val;
            },
            activityTypeRadioChange(n) {
                console.log('radioChange', n);
                this.form.activityType = n;
            },
            coverTypeRadioChange(n) {
                console.log('radioChange', n);
                this.coverType = n;
 
            },
            // 图片上传处理
            // 新增图片
            afterRead(event) {
                const {
                    file
                } = event;
                console.log('文件类型:', file.type);
            },
            // 删除封面
            deleteCover() {
                this.coverList = []
                this.form.cover = ''
            },
            handleSuccess(data, index, lists, fileType) {
                //表单赋值
                this.form.coverType = fileType;
                this.form.cover = data.data.fileKey;
            },
            // 验证报名时间
            validateReportTime(rule, value, callback) {
                if (!value) {
                    callback(new Error('请选择报名结束时间'))
                } else if (new Date(value) <= new Date(this.form.reportStartTime)) {
                    callback(new Error('报名结束时间必须晚于开始时间'))
                } else {
                    callback()
                }
            },
 
            // 验证活动开始时间
            validateStartTime(rule, value, callback) {
                if (!value) {
                    callback(new Error('请选择活动开始时间'))
                } else if (new Date(value) <= new Date(this.form.reportEndTime)) {
                    callback(new Error('活动开始时间必须晚于报名结束时间'))
                } else {
                    callback()
                }
            },
            numValidate(rule, value, callback) {
                console.log(value)
                if (value <= 0 || value > 1000) {
                    callback(new Error('人数范围1-1000'));
                } else {
                    callback();
                }
            },
            // 验证活动结束时间
            validateEndTime(rule, value, callback) {
                if (!value) {
                    callback(new Error('请选择活动结束时间'))
                } else if (new Date(value) <= new Date(this.form.startTime)) {
                    callback(new Error('活动结束时间必须晚于开始时间'))
                } else {
                    callback()
                }
            },
// "<p><img src="https://img.zcool.cn/community/01055859b8e37fa8012075341db67f.gif" alt="https://lmk-1356772813.cos.ap-chengdu.myqcloud.com/video/2025071011124230197.mp4|video/2025071011124230197.mp4" width="80%"><img src="https://lmk-1356772813.cos.ap-chengdu.myqcloud.com/image/2025071011130152914.jpg" alt="https://lmk-1356772813.cos.ap-chengdu.myqcloud.com/image/2025071011130152914.jpg|image/2025071011130152914.jpg" width="80%"></p><p><br></p><p><br></p>"
            buildTag(html) {
              return html.replace(/<img([^>]*)>/gi, (imgTag) => {
                const srcMatch = imgTag.match(/src="([^"]*)"/i);
                const altMatch = imgTag.match(/alt="([^"]*)"/i);
                const widthMatch = imgTag.match(/width="([^"]*)"/i);
            
                if (!srcMatch && !altMatch) return imgTag;
            
                // 分割 alt 内容(格式:左边|右边)
                let newSrc = srcMatch ? srcMatch[1] : '';
                let newAlt = altMatch ? altMatch[1] : '';
                
                if (altMatch && altMatch[1].includes('|')) {
                  const [leftPart, rightPart] = altMatch[1].split('|');
                  newSrc = leftPart.trim();  // | 左侧作为 src
                  newAlt = rightPart.trim(); // | 右侧作为 alt
                }
            
                const width = widthMatch ? widthMatch[1] : "80%";
            
                // 检测是否为视频(基于新的 src)
                const isVideo = /\.(mp4|webm|ogg|mov)$/i.test(newSrc);
            
                if (isVideo) {
                  const extension = newSrc.split('.').pop().toLowerCase();
                  return `<video width="${width}" alt="${newAlt}" src="${newSrc}" height="auto" controls="controls"></video>`;
                }
            
                // 非视频:更新 src 和 alt
                return `<img src="${newSrc}" alt="${newAlt}" width="${width}">`;
              });
            },
            escapeStringHTML(str) {
                if (!str) return str;
                str = str.replace(/&lt;/g, '<');
                str = str.replace(/&gt;/g, '>');
                return str;
              },
            // 提交表单
            async submitForm() {
                // let html = '"<p><img src="https://img.zcool.cn/community/01055859b8e37fa8012075341db67f.gif" alt="video/2025070811142279476.mp4" width="80%"><img src="https://lmk-1356772813.cos.ap-chengdu.myqcloud.com/image/2025070811142783043.jpg" alt="image/2025070811142783043.jpg" width="80%">测试活动内容</p><p><br></p><p><br></p>"'
                // const temphtml2  = this.buildTag(html)
                const temphtml2 = this.buildTag(this.form.activityContent)
                this.form.activityContent = temphtml2;
                this.$refs.uForm.validate(valid => {
                    if (valid) {
                        console.log("通过")
                        if (this.coverType === 'text') {
                            this.form.coverType = 'text';
                        }
                        
                        this.loading = true
                        // 调用API
                        addActivityByBuyer(this.form).then(res => {
                            console.log(res)
                            if (res.statusCode === 200) {
                                this.loading = false
                                uni.showToast({
                                    title: res.data.msg, // 提示文字
                                    icon: 'none', // 图标类型(success/loading/none)
                                    mask: true // 是否显示透明蒙层(防止触摸穿透)
                                });
                                setTimeout(() => {
                                    uni.$emit('refreshParentPage');
                                    uni.navigateBack();
                                }, 1500);
 
                            }
                        })
 
 
                    }
                })
 
            }
 
 
        }
    }
</script>
 
<style lang="scss" scoped>
    .add-user-container {
        width: 100%;
        padding: 20rpx;
        background-color: #f5f7fa;
        min-height: 100vh;
    }
 
    .form-card {
        background-color: #fff;
        border-radius: 24rpx;
        padding: 40rpx;
        box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08);
        margin-bottom: 40rpx;
 
        /* 表单标题样式 */
        .form-title {
            font-size: 36rpx;
            font-weight: 600;
            color: #333;
            margin-bottom: 40rpx;
            text-align: center;
            position: relative;
 
            &:after {
                content: '';
                display: block;
                width: 80rpx;
                height: 6rpx;
                background: linear-gradient(to right, #2979ff, #00bcd4);
                margin: 20rpx auto 0;
                border-radius: 3rpx;
            }
        }
    }
 
    /* 表单项样式 */
    .u-form-item {
        padding: 28rpx 0;
        margin-bottom: 10rpx;
 
        /* 标签样式 */
        ::v-deep .u-form-item__body__left__content__label {
            font-size: 30rpx;
            color: #606266;
            font-weight: 500;
        }
 
        /* 输入框样式 */
        .u-input {
            background-color: #f8f9fa;
            border-radius: 12rpx;
            padding: 20rpx 24rpx !important;
 
            &__content__field-wrapper__field {
                color: #333;
                font-size: 28rpx;
            }
        }
 
        /* 单选组样式 */
        .u-radio-group {
            margin-top: 10rpx;
        }
 
        .u-radio {
            margin-bottom: 16rpx;
 
            &__label {
                font-size: 28rpx;
                color: #606266;
            }
        }
 
        /* 数字输入框样式 */
        .u-number-box {
            margin-right: 20rpx;
        }
    }
 
    /* 时间选择器样式 */
    .uni-datetime-picker {
        width: 100%;
 
        ::v-deep .uniui-calendar {
            color: #2979ff;
        }
 
        ::v-deep .uni-datetime-picker-btn-cancel {
            color: #999;
        }
 
        ::v-deep .uni-datetime-picker-btn-confirm {
            color: #2979ff;
        }
    }
 
    /* 上传组件样式 */
    .u-upload {
        ::v-deep .u-upload__wrap {
            padding: 0;
        }
 
        ::v-deep .u-upload__button {
            background-color: #f8f9fa;
            border-radius: 12rpx;
            color: #2979ff;
            font-size: 28rpx;
            height: 160rpx;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1rpx dashed #dcdfe6;
 
            &:active {
                background-color: #f1f5f9;
            }
        }
 
        ::v-deep .u-upload__preview {
            border-radius: 12rpx;
            overflow: hidden;
        }
    }
 
    /* 提交按钮样式 */
    .submit-btn {
        margin-top: 80rpx;
        padding: 0 80rpx;
 
        .u-button {
            height: 90rpx;
            font-size: 32rpx;
            font-weight: 500;
            letter-spacing: 2rpx;
            background: linear-gradient(to right, #2979ff, #00bcd4);
            box-shadow: 0 8rpx 24rpx rgba(41, 121, 255, 0.3);
            transition: all 0.3s;
 
            &:active {
                transform: translateY(2rpx);
                box-shadow: 0 4rpx 12rpx rgba(41, 121, 255, 0.3);
            }
        }
    }
 
    /* 底部说明文字 */
    .form-tips {
        font-size: 24rpx;
        color: #999;
        text-align: center;
        margin-top: 40rpx;
        line-height: 1.6;
    }
</style>