jufubao-forms 1.0.4-beta3 → 1.0.4-beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
:show-center-play-btn="false"
|
|
105
105
|
@pause="handleVideoPause(item)"
|
|
106
106
|
@ended="handleVideoPause(item)"
|
|
107
|
+
@click="handleVideoPlay(item)"
|
|
107
108
|
></video>
|
|
108
109
|
<view v-if="!formPaly[item.field_value + '_play']" class="video_cover">
|
|
109
110
|
<image :src="formPaly[item.field_value + '_cover']" style="width: 100%;height: 100%;" mode="aspectFit"></image>
|
|
@@ -481,18 +482,20 @@
|
|
|
481
482
|
console.log('chooseImage',res);
|
|
482
483
|
this.$xdShowLoading({});
|
|
483
484
|
for(let i = 0; i < res.tempFiles.length; i++){
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
485
|
+
if(i < Number(item.media_count)){
|
|
486
|
+
let file = res.tempFiles[i];
|
|
487
|
+
//文件file不能大于item.media_size(MB)
|
|
488
|
+
if(file.size > item.media_size * 1024 * 1024){
|
|
489
|
+
uni.showToast({
|
|
490
|
+
title: '图片大小不能超过' + item.media_size + 'MB',
|
|
491
|
+
duration: 2000,
|
|
492
|
+
icon: "none"
|
|
493
|
+
});
|
|
494
|
+
this.$xdHideLoading();
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
await this.uploadOneImage(file, item);
|
|
494
498
|
}
|
|
495
|
-
await this.uploadOneImage(file, item);
|
|
496
499
|
}
|
|
497
500
|
this.$xdHideLoading();
|
|
498
501
|
}
|
|
@@ -505,8 +508,13 @@
|
|
|
505
508
|
handleVideoPlay(item){
|
|
506
509
|
let videoContext = uni.createVideoContext('video_' + item.field_value, this);
|
|
507
510
|
if(videoContext){
|
|
508
|
-
|
|
509
|
-
|
|
511
|
+
if(!this.formPaly[item.field_value + '_play']){
|
|
512
|
+
this.$set(this.formPaly, item.field_value + '_play', true)
|
|
513
|
+
videoContext.play();
|
|
514
|
+
}else{
|
|
515
|
+
this.$set(this.formPaly, item.field_value + '_play', false)
|
|
516
|
+
videoContext.pause();
|
|
517
|
+
}
|
|
510
518
|
}
|
|
511
519
|
},
|
|
512
520
|
handleVideoPause(item){
|
|
@@ -536,6 +544,12 @@
|
|
|
536
544
|
this.handleClearError(item);
|
|
537
545
|
this.$xdHideLoading();
|
|
538
546
|
}catch(err){
|
|
547
|
+
uni.showToast({
|
|
548
|
+
title: '上传失败,重新上传',
|
|
549
|
+
duration: 2000,
|
|
550
|
+
icon: "none"
|
|
551
|
+
});
|
|
552
|
+
this.form[item.field_value] = [];
|
|
539
553
|
this.$xdHideLoading();
|
|
540
554
|
}
|
|
541
555
|
}
|
|
@@ -567,7 +581,7 @@
|
|
|
567
581
|
resolve(`/${res.key}`);
|
|
568
582
|
},
|
|
569
583
|
fail:(err)=>{
|
|
570
|
-
|
|
584
|
+
reject(err);
|
|
571
585
|
console.error(err)
|
|
572
586
|
}
|
|
573
587
|
});
|
|
@@ -910,6 +924,8 @@
|
|
|
910
924
|
margin-bottom: 20rpx;
|
|
911
925
|
position: relative;
|
|
912
926
|
overflow: hidden;
|
|
927
|
+
display: flex;
|
|
928
|
+
align-items: center;
|
|
913
929
|
.video_cover{
|
|
914
930
|
position: absolute;
|
|
915
931
|
z-index: 2;
|