瀏覽代碼

编辑器:开场动画添加开关

任一存 2 年之前
父節點
當前提交
712bd65894

+ 1 - 0
packages/qjkankan-editor/README.md

@@ -59,6 +59,7 @@ npm run build-testprod
   "id": "",
   "remindTime": 1,
   "status": 0,
+  "isShowOpeningAnimation": true,
   "openingAnimationType": "小行星开场", // 开场动画类型
   "backgroundMusic": { // 背景音乐
     "id": "",

+ 1 - 0
packages/qjkankan-editor/someData.json

@@ -38,6 +38,7 @@
   "id": "",
   "remindTime": 1,
   "status": 0,
+  "isShowOpeningAnimation": true,
   "openingAnimationType": "小行星开场",
   "backgroundMusic": {
     "id": "",

+ 1 - 0
packages/qjkankan-editor/src/lang/_zh.json

@@ -727,6 +727,7 @@
     "mask_size": "建议500*500px,<br/>支持jpg/png格式",
     "bottom_mask": "地面遮罩",
     "opening_setting": "设置开场动画",
+    "opening_animation_show": "显示开场动画",
     "opening_tips_setting": "提示设置",
     "opening_tips": "开场提示仅适用于全景图。若初始场景为三维模\n型,以下开场提示不适用。",
     "pc": "PC端",

+ 23 - 0
packages/qjkankan-editor/src/views/base/openingAnimationSettings.vue

@@ -2,6 +2,10 @@
   <div class="opening-animation-settings">
     <span class="title">{{$i18n.t(`edit_settings.opening_setting`)}}</span>
     <br>
+    <div class="switch-wrapper">
+      <span class="label">{{$i18n.t('edit_settings.opening_animation_show')}}</span>
+      <Switcher :value="info.isShowOpeningAnimation" @change="onSwitcherChange"></Switcher>
+    </div>
     <div class="btns-and-video">
       <div class="btn-wrapper">
         <button v-for="item of openingTypeList" :key="item" class="opening-selection-btn"
@@ -21,9 +25,11 @@
 
 <script>
 import { mapGetters } from "vuex";
+import Switcher from "@/components/shared/Switcher";
 
 export default {
   components: {
+    Switcher,
   },
   data() {
     return {
@@ -45,9 +51,15 @@ export default {
   methods: {
     bofang(){
       this.$refs.opvideo.play()
+    },
+    onSwitcherChange(data) {
+      this.info.isShowOpeningAnimation = data
     }
   },
   mounted() {
+    if (this.info.isShowOpeningAnimation === undefined) {
+      this.$set(this.info, 'isShowOpeningAnimation', true)
+    }
     if (!this.info.openingAnimationType) {
       this.$set(this.info, 'openingAnimationType', this.openingTypeList[0])
     }
@@ -78,6 +90,17 @@ export default {
     color: #FFFFFF;
   }
 
+  .switch-wrapper {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin-top: 18px;
+    .label {
+      color: rgba(255, 255, 255, 0.6);
+      font-size: 14px;
+    }
+  }
+
   .btns-and-video {
     margin-top: 16px;
     display: flex;