huangmp před 1 rokem
rodič
revize
b676c17684

+ 1 - 1
src/components/order-card-item/index.vue

@@ -52,7 +52,7 @@
           <el-button v-if="item.flag==1 && mode=='view'" type="warning" size="mini" style="margin-right: 5px" @click="handleFlag(item, index)">已标记</el-button>
           <el-button v-if="mode=='view'" type="text" size="mini" @click="openOrgPicForm(item, index)">原图</el-button>
             <el-button v-if="mode=='view' && (orderItem.prodName.indexOf('简约') !== -1 || orderItem.prodName.indexOf('高阶') !== -1)" type="text" size="mini" @click="openCanvasParamPicForm(item, index)">工艺</el-button>
-          <el-button v-if="item.prodName.indexOf('语音') !== -1 && mode=='view'" type="text" size="mini" @click="openYYForm(item, index)">查看语音</el-button>
+          <el-button v-if="(item.prodName.indexOf('语音') !== -1 || item.prodName.toLowerCase().indexOf('ar') !== -1) && mode=='view'" type="text" size="mini" @click="openYYForm(item, index)">查看语音</el-button>
           <el-button v-if="mode==='edit'" type="primary" size="mini" style="margin-right: 5px" @click="addOrUpdateCardItem(item)">保存</el-button>
           <el-button v-if="mode==='edit' && item.cardItemId" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(item, index)">删除</el-button>
         </span>

+ 43 - 4
src/components/yuyin-preview/index.vue

@@ -42,13 +42,18 @@
           </el-form-item>
         </el-col>
         <el-col :span="dataForm.cardNote.type === 'AI' ? 12 : 8">
-          <el-form-item label="语音内容">
-            <el-button size="mini" @click="changeAudio">更换音频</el-button>
+          <el-form-item label="语音/视频内容">
+            <el-button size="mini" @click="changeAudio" v-if="dataForm.cardNote.type === 'AI' || dataForm.cardNote.type === 'NORMAL'">更换音频</el-button>
+            <el-button size="mini" @click="changeAudio" v-if="dataForm.cardNote.type === 'AR'">更换视频</el-button>
             <br/>
             <video v-if="dataForm.cardNote.audioUrl"
               style="width: 300px; height: 210px"
               :src="resourcesUrl + dataForm.cardNote.audioUrl"
               controls="controls"/>
+            <video v-if="dataForm.cardNote.videoUrl"
+                   style="width: 300px; height: 210px"
+                   :src="resourcesUrl + dataForm.cardNote.videoUrl"
+                   controls="controls"/>
           </el-form-item>
         </el-col>
         <el-col :span="dataForm.cardNote.type === 'AI' ? 12 : 8" v-if="newAudioUrl">
@@ -60,10 +65,20 @@
               controls="controls"/>
           </el-form-item>
         </el-col>
+        <el-col :span="dataForm.cardNote.type === 'AR' ? 12 : 8" v-if="newVideoUrl">
+          <el-form-item label="新视频">
+            <br/>
+            <video
+              style="width: 300px; height: 210px"
+              :src="resourcesUrl + newVideoUrl"
+              controls="controls"/>
+          </el-form-item>
+        </el-col>
       </el-row>
       <el-form-item>
         <div style="width: 100%; text-align: center;">
-          <el-button v-if="!(dataForm.cardNote.type === 'AI')" type="primary" size="large" @click="repairVideo">转换语音</el-button>
+          <el-button v-if="(dataForm.cardNote.type === 'AI' || dataForm.cardNote.type === 'NORMAL')" type="primary" size="large" @click="repairVideo">转换语音</el-button>
+          <el-button v-if="dataForm.cardNote.type === 'AR'" type="primary" size="large" @click="adjustVideo">调整视频</el-button>
           <el-button type="success" size="large" @click="confirmChangeVideo">确认更换</el-button>
           <el-button type="success" size="large" @click="onSave">保存</el-button>
         </div>
@@ -88,6 +103,7 @@
         visible: false,
         dataForm:{cardNote:{}, qrNoteMapping:{}},
         newAudioUrl: null,
+        newVideoUrl:null,
         resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
         transLoading: false
       };
@@ -196,8 +212,30 @@
           })
         });
       },
+      adjustVideo() {
+        this.$confirm('确定要调整视频吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$http({
+            url: this.$http.adornUrl('/qrNoteMapping/adjustVideoResolution'),
+            method: 'POST',
+            data: this.dataForm.cardNote
+          }).then(({ data }) =>{
+            if(data){
+              this.newVideoUrl = data.newVideoUrl
+            }
+          })
+        });
+      },
       confirmChangeVideo(){
-        this.dataForm.cardNote.audioUrl = this.newAudioUrl;
+        if(this.newAudioUrl){
+          this.dataForm.cardNote.audioUrl = this.newAudioUrl;
+        }
+        if(this.newVideoUrl){
+          this.dataForm.cardNote.videoUrl = this.newVideoUrl;
+        }
         /*this.$confirm('确定要保存新语音吗?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -221,6 +259,7 @@
         this.visible = false
         this.dataForm = {cardNote:{}, qrNoteMapping:{}}
         this.newAudioUrl = null
+        this.newVideoUrl = null
       }
     },
   }

+ 5 - 3
src/views/modules/order/qrcode-card-note-add-or-update.vue

@@ -41,7 +41,8 @@
         </el-col>
         <el-col :span="dataForm.cardNote.type === 'AI' ? 12 : 8">
           <el-form-item label="语音内容">
-            <el-button size="mini" @click="changeAudio">更换音频</el-button>
+            <el-button size="mini" @click="changeAudio" v-if="dataForm.cardNote.type === 'AI' || dataForm.cardNote.type === 'NORMAL'">更换音频</el-button>
+            <el-button size="mini" @click="changeAudio" v-if="dataForm.cardNote.type === 'AR'">更换视频</el-button>
             <br/>
             <video v-if="dataForm.cardNote.audioUrl"
                    style="width: 300px; height: 210px"
@@ -61,7 +62,8 @@
       </el-row>
       <el-form-item>
         <div style="width: 100%; text-align: center;">
-          <el-button v-if="!(dataForm.cardNote.type === 'AI')" type="primary" size="large" @click="repairVideo">转换语音</el-button>
+          <el-button v-if="(dataForm.cardNote.type === 'AI' || dataForm.cardNote.type === 'NORMAL')" type="primary" size="large" @click="repairVideo">转换语音</el-button>
+          <el-button v-if="(dataForm.cardNote.type === 'AR')" type="primary" size="large" @click="repairVideo">调整视频</el-button>
           <el-button type="success" size="large" @click="confirmChangeVideo">确认更换</el-button>
           <el-button type="success" size="large" @click="onSave">保存</el-button>
         </div>
@@ -204,7 +206,7 @@
         }).then(() => {
           this.dataForm.cardNote.newAudioUrl = this.newAudioUrl;
           this.$http({
-            url: this.$http.adornUrl('/qrNoteMapping/changeVideo'),
+            url: this.$http.adornUrl('/qrNoteMapping/changeAudio'),
             method: 'POST',
             data: this.dataForm.cardNote
           }).then(({ data }) =>{