tremble 4 年 前
コミット
153b421b6f

+ 66 - 1
backstage/src/pages/content/Spirit.vue

@@ -171,6 +171,33 @@
                 {{item}}
               </p>
             </el-form-item>
+
+             <el-form-item
+             v-if="form.type!='video'"
+              label="音频解说:"
+              :label-width="formLabelWidth"
+            >
+            <el-upload
+                class="upload-demo"
+                :action="uploadUrl+'audio'"
+                :headers="{ token }"
+                :on-error="handleError"
+                :on-success="handleAudioSuccess"
+                :before-upload="beforeAudioUpload"
+                :show-file-list="false"
+              >
+                <el-button size="small" type="primary">点击上传</el-button>
+            </el-upload>
+              <template v-if="form.audioPath">
+                <div>音频名称:{{form.audioName}} <el-button size="small" style="margin-left:20px;" @click="form.audioName='',form.audioPath=''" type='text'>删除</el-button></div>
+                <audio style="margin-top:10px;" v-if="form.audioPath" :src="form.audioPath" controls></audio>
+              </template>
+              <p style="color:#999;line-height:1;margin-top:20px">格式要求:</p>
+              <p style="color:#999;" > 
+                1、支持mp3,wav,wma格式 <br/>
+                2、最大为50M大小。
+              </p>
+            </el-form-item>
           </el-form>
         </div>
         <div class="add-right">
@@ -305,6 +332,8 @@ export default {
         thumb: "",
         type: 'model',
         filePath:'',
+        audioPath:'',
+        audioName:'',
         zoneId: "",
         fileName:'',
         description:''
@@ -339,6 +368,8 @@ export default {
           this.changeType = false
           this.form.filePath = ''
           this.form.fileName = ''
+          this.form.audioPath = ''
+          this.form.audioName = ''
           setTimeout(() => {
             this.changeType = true 
           });
@@ -401,7 +432,7 @@ export default {
       this.form.fileName = data.fileName;
     },
     beforefileUpload(file){
-      let typeArr = this.form.type === 'img' ? ['.png','jpeg','gif','jpg'] : (this.form.type === 'video'? ['avi','mov','rmvb','rm','flv','mp4','3gp']:['4dage'])
+      let typeArr = this.form.type === 'img' ? ['png','jpeg','gif','jpg'] : (this.form.type === 'video'? ['avi','mov','rmvb','rm','flv','mp4','3gp']:['4dage'])
       let type = this.isTypeBySend(file.name,typeArr);
       if (!type) {
         this.$message.error('只允许指定文件格式的文件');
@@ -417,6 +448,34 @@ export default {
       }
       this.loading = this.$loading(this.loadOption)
     },
+
+    handleAudioSuccess(res){
+      this.loading.close()
+      let { data } = res;
+      this.form.audioPath = data.filePath;
+      this.form.audioName = data.fileName;
+    },
+
+    beforeAudioUpload(file) {
+      let typeArr = ['mp3','wav','wma']
+      let type = this.isTypeBySend(file.name,typeArr);
+      if (!type) {
+        this.$message.error('只允许mp3,wav,wma等格式的音频文件');
+        return type
+      }
+      if (!type) {
+        this.$message.error('只允许mp3,wav,wma等格式的音频文件');
+        return type
+      }
+      const isLt2M = file.size / 1024 / 1024 < 50;
+
+      if (!isLt2M) {
+        this.$message.error("上传头像图片大小不能超过 50MB!");
+        return isLt2M;
+      }
+      this.loading = this.$loading(this.loadOption)
+    },
+
     beforeAvatarUpload(file) {
       let type = this.isImage(file.name);
       if (!type) {
@@ -471,6 +530,8 @@ export default {
         type: 'model',
         filePath:'',
         zoneId: "",
+        audioPath:'',
+        audioName:'',
         fileName:'',
         description:''
       };
@@ -525,6 +586,8 @@ export default {
             type,
             filePath,
             fileName,
+            audioPath,
+            audioName,
             description,
             zoneId
           } = this.form;
@@ -540,6 +603,8 @@ export default {
             id,
             filePath,
             fileName,
+            audioPath,
+            audioName,
             description,
             name,
             zoneId,

+ 2 - 2
web/public/static/js/myShow.js

@@ -1,7 +1,7 @@
 var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
-// var g_Prefix="http://192.168.1.101:8080/";
+var g_Prefix="http://8.135.106.227:8009/";
 // https://super.4dage.com/
-var g_Prefix=window.location.origin+'/';
+// var g_Prefix=window.location.origin+'/';
 
 var s = window.location.href.split('/');
 s.pop();

BIN
web/src/assets/video/welcome.mp4


+ 12 - 1
web/src/components/popupLayout/Broadcast.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="wrapper">
+    <audio :src="item.audioPath" ref="bgaudio" class="bgAudio" v-if="item.audioPath" autoplay></audio>
     <div class="ui-broadcast" @click="close">
       <div class="ui-con" @click.stop>
         <div class="title">{{item.name}}</div>
@@ -46,7 +47,11 @@ export default {
     };
   },
   mounted(){
-    console.log(this.item);
+    this.$nextTick(()=>{
+      setTimeout(() => {
+        (this.$refs.bgaudio&&this.item.audioPath)&&this.$refs.bgaudio.play();
+      });
+    })
   },
   methods:{
     getLastName(data){
@@ -62,6 +67,12 @@ export default {
 
 <style lang="less" scoped>
 @import '../../assets/style/globalVars.less';
+.bgAudio{
+  position: fixed;
+  top: -100px;
+  left: -100px;
+  opacity: 0;
+}
 
 .ui-broadcast{
   height: 100%;

+ 1 - 1
web/src/components/svg.vue

@@ -158,7 +158,7 @@ export default {
       tour:false,
       modeActive:'panorama',
       active:'',
-      showPull:true,
+      showPull:false,
       disableChange:false,
       tourStatus:false
     }

+ 1 - 1
web/src/pages/Home.vue

@@ -239,7 +239,7 @@ export default {
   data(){
       return {
         key:'',
-        showPull:true,
+        showPull:false,
         showMenu:false,
         isShow:false,
         isShowFile:false,

+ 2 - 2
web/src/views/gui/newguide.vue

@@ -13,7 +13,7 @@
           v-for="(item, i) in mapData"
           :key="i"
         >
-          <div :class="{'slActive':item.activemin<=guideActive&& item.activemax>=guideActive,hoverCls: item.toIdx===hoverIdx}">
+          <div :class="{'slActive':item.toIdx==guideActive,hoverCls: item.toIdx===hoverIdx}">
             <img @click="gotoLight(item)" @mouseleave="hoverOutHandle(item,i)" @mouseenter="hoverHandle(item,i)" :src="(item.locations?item.locations[0].thumbnail_signed_src : item.thumbnail_signed_src)" :alt="item.name" />
             <span :title="item.name">{{item.name}}</span>
           </div>
@@ -199,7 +199,7 @@ export default {
         }]
         this.guide.list.forEach((item,i)=>{
           let tmp = fixArr.find(sub=>sub.idx ==i)
-          if (tmp) {
+          if (true) {
             this.mapData.push({
               ...item,
               ...tmp,