jufubao-forms 1.0.4-beta4 → 1.0.4-beta6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-forms",
3
- "version": "1.0.4-beta4",
3
+ "version": "1.0.4-beta6",
4
4
  "private": false,
5
5
  "description": "聚福宝表单业务插件库",
6
6
  "main": "index.js",
@@ -102,12 +102,14 @@
102
102
  :src="getServiceUrl(videoSrc)"
103
103
  :controls="false"
104
104
  :show-center-play-btn="false"
105
+ :autoplay="false"
106
+ :loop="false"
105
107
  @pause="handleVideoPause(item)"
106
108
  @ended="handleVideoPause(item)"
107
109
  @click="handleVideoPlay(item)"
108
110
  ></video>
109
111
  <view v-if="!formPaly[item.field_value + '_play']" class="video_cover">
110
- <image :src="formPaly[item.field_value + '_cover']" style="width: 100%;height: 100%;" mode="aspectFit"></image>
112
+ <image :src="formPaly[item.field_value + '_cover']" style="width: 100%;height: 100%;" mode="aspectFill"></image>
111
113
  <view class="video_play" @click="handleVideoPlay(item)">
112
114
  <xd-font-icon icon="iconplayright" color="#fff" size="60"></xd-font-icon>
113
115
  </view>
@@ -244,6 +246,7 @@
244
246
  emptyImage: getServiceUrl('/common/empty/qa.png'),
245
247
  uploadImgList: [],
246
248
  uploadVideoList: [],
249
+ imgHost: "",
247
250
 
248
251
  //面板
249
252
  submitPagePath: "",
@@ -291,6 +294,9 @@
291
294
  methods: {
292
295
  getServiceUrl,
293
296
  onJfbLoad(options) {
297
+ let imgHost = this.projectAttr['img_host'] || this.$settings.cdnUrl;
298
+ this.imgHost = imgHost;
299
+
294
300
  if (!this.isPreview){
295
301
  if(!options.form_id) {
296
302
  return uni.showToast({
@@ -506,7 +512,13 @@
506
512
  this.form[item.field_value].push(image);
507
513
  },
508
514
  handleVideoPlay(item){
509
- let videoContext = uni.createVideoContext('video_' + item.field_value, this);
515
+ let videoContext;
516
+ if(this.formPaly[item.field_value + '_context']){
517
+ videoContext = this.formPaly[item.field_value + '_context'];
518
+ }else{
519
+ videoContext = uni.createVideoContext('video_' + item.field_value, this);
520
+ this.formPaly[item.field_value + '_context'] = videoContext;
521
+ }
510
522
  if(videoContext){
511
523
  if(!this.formPaly[item.field_value + '_play']){
512
524
  this.$set(this.formPaly, item.field_value + '_play', true)
@@ -539,7 +551,7 @@
539
551
  let video = await this.uploadImage(file);
540
552
  let videoUrl = getVideoUrl(video);
541
553
  console.log("videoUrl", videoUrl);
542
- this.form[item.field_value].push(video);
554
+ this.form[item.field_value].push(videoUrl.url);
543
555
  this.formPaly[item.field_value + '_cover'] = videoUrl.url_cover;
544
556
  this.handleClearError(item);
545
557
  this.$xdHideLoading();
@@ -644,7 +656,8 @@
644
656
  contents,
645
657
  form_id: this.form_id,
646
658
  bucket: this.bucket,
647
- foreign_id: this.foreign_id
659
+ foreign_id: this.foreign_id,
660
+ domain: this.imgHost
648
661
  }
649
662
  }).then(res => {
650
663
  this.$xdHideLoading();