Procházet zdrojové kódy

编辑器-基础:删除无用的旧文件;让旧版本时创建的作品能够使用自定义按钮功能。

任一存 před 3 roky
rodič
revize
f0be592e4d

+ 0 - 87
packages/code/src/views/base/EditPanel/index.vue

@@ -1,87 +0,0 @@
-<template>
-  <transition
-    appear
-    name="custom-classes-transition"
-    enter-active-class="animated slideInRight speed"
-    leave-active-class="animated slideOutRight speed"
-  >
-  <div class="base-panel" v-show="show">
-    <div class="ui-between header" app-border dir-bottom>
-      <span>{{show.name}}</span>
-      <i class="iconfont icon_close" @click="cancel"></i>
-    </div>
-    <div class="content">
-      <component :select="select" @openMaterial="$emit('openMaterial')" :is="component"></component>
-    </div>
-    <div class="ui-between footer" app-border dir-top>
-      <button class="ui-button submit" @click="save">完成</button>
-    </div>
-  </div>
-  </transition>
-</template>
-<script>
-import { mapGetters } from "vuex";
-
-export default {
-  props: ['show','data','editTitle','select'],
-  data(){
-    return {
-
-    }
-  },
-  computed:{
-    ...mapGetters({
-      info:'info',
-      backupInfo:'backupInfo'
-    }),
-    component(){
-      let page = this.show;
-      return () => import(`./${page.id}.vue`);
-    }
-  },
-  
-  methods:{
-    cancel(){
-      this.$store.commit("SetInfo", this.backupInfo);
-      this.$emit("close");
-    },
-    save(){
-      this.$store.commit("SetInfo", this.info);
-      this.$emit("close");
-    }
-  }
-};
-</script>
-<style lang="less" scoped>
-.base-panel {
-  position: fixed;
-  right: 0;
-  top: 0;
-  height: 100%;
-  width: 236px;
-  background: rgba(38, 39, 41, 1);
-  box-shadow: 0px 0px 20px #090909;
-  z-index: 10;
-  display: flex;
-  flex-direction: column;
-  .header {
-    height: 51px;
-    padding: 0 10px;
-    display: flex;
-    .icon_close {
-      cursor: pointer;
-    }
-  }
-  .footer {
-    padding: 15px;
-    position: absolute;
-    bottom: 0;
-    width: 100%;
-    left: 0;
-    .ui-button {
-      width: 100%;
-    }
-  }
-  
-}
-</style>

+ 0 - 105
packages/code/src/views/base/EditPanel/logo.vue

@@ -1,105 +0,0 @@
-<template>
-  <div class="plate">
-    <div>
-      <ul>
-        <li app-border dir-bottom>
-          <div class="preview-con">
-            <div class="preview">
-              <img :src="info.logo||require('@/assets/images/default/img_logo_default.png')" alt="" />
-            </div>
-            <div class="upload-con">
-              <button
-                class="ui-button submit"
-                @click="$emit('openMaterial'), (param = 'logo')"
-              >
-                选择图片
-              </button>
-              <div class="ui-remark">
-                建议300*300px,600kb以内,支持jpg/png格式
-              </div>
-            </div>
-          </div>
-        </li>
-        <li>
-          <div class="title">显示设置</div>
-          <div class="switch-con">
-            <span class="title">显示logo</span>
-            <switcher
-              name="pano"
-              :value="info.isLogo"
-              @change="onSwitcherChange"
-            ></switcher>
-          </div>
-        </li>
-      </ul>
-    </div>
-  </div>
-</template>
-
-<script>
-import Switcher from "@/components/shared/Switcher";
-import { mapGetters } from "vuex";
-
-export default {
-  props: ["select"],
-  components: {
-    Switcher,
-  },
-  computed: {
-    ...mapGetters({
-      info: "info",
-    }),
-  },
-  watch: {
-    select(newVal) {
-      if (newVal) {
-        this.info[this.param] = newVal;
-        this.info.logoChange = true
-        this.select = "";
-      }
-    },
-  },
-
-  data() {
-    return {
-      param: "",
-    };
-  },
-  methods: {
-    onFileChange() {},
-    onSwitcherChange(data) {
-      this.info.isLogo = data;
-    },
-  },
-};
-</script>
-<style lang="less" src="./style.less"></style>
-
-<style lang="less" scoped>
-.preview-con {
-  display: flex;
-  .preview {
-    width: 100px;
-    height: 100px;
-    overflow: hidden;
-    >img{
-      max-width: 100px;
-      max-height: 100px;
-    }
-  }
-  .upload-con {
-    flex: 1;
-    .ui-button {
-      width: 100%;
-    }
-    .ui-remark {
-      margin-top: 10px;
-      width: 100%;
-      word-break: keep-all;
-    }
-  }
-  .bars {
-  }
-}
-</style>
-

+ 0 - 129
packages/code/src/views/base/EditPanel/opening.vue

@@ -1,129 +0,0 @@
-<template>
-  <div class="plate">
-    <div>
-      <ul>
-        <li app-border dir-bottom>
-          <div class="ui-remark">开场提示仅适用于全景图。若初始场景为三维模型,以下开场提示不适用。</div>
-          <div class="title">PC端</div>
-          <div class="preview-con">
-            <div class="preview">
-              <img :src="info.pcIcon||require('@/assets/images/default/img_tipspc_default.png')" alt="">
-            </div>
-            <div class="upload-con">
-              <button class="ui-button submit" @click="$emit('openMaterial'),param='pcIcon'"> 选择图片</button>
-              <div class="ui-remark">建议300*300px,600kb以内,支持jpg/png格式</div>
-            </div>
-          </div>
-          <div class="title">移动端</div>
-          <div class="preview-con">
-            <div class="preview">
-              <img :src="info.appIcon||require('@/assets/images/default/img_tipsmb_default.png')" alt="">
-            </div>
-            <div class="upload-con">
-              <button class="ui-button submit" @click="$emit('openMaterial'),param='appIcon'"> 选择图片</button>
-              <div class="ui-remark">建议300*300px,600kb以内,支持jpg/png格式</div>
-            </div>
-          </div>
-        </li>
-        <li>
-          <div class="title">显示设置</div>
-          <div class="switch-con">
-              <span class="title">仅首次打开链接时,提示</span>
-              <switcher name="pano" :value="info.isRemind" @change="onSwitcherChange"></switcher>
-          </div>
-          <div class="bars">
-              <RangeItem :value="rang" @input="onRangeChange" />
-          </div>
-        </li>
-      </ul>
-    </div>
-  </div>
-</template>
-
-<script>
-import Switcher from "@/components/shared/Switcher";
-import RangeItem from "@/components/rangeItem";
-
-import { mapGetters } from "vuex";
-
-export default {
-    props:['select'],
-    components:{
-      Switcher,
-      RangeItem
-    },
-    watch:{
-      info:{
-        immediate:true,
-        deep:true,
-        handler:function (newVal) {
-          this.rang.value = newVal.remindTime
-        }
-      },
-      select(newVal){
-        if (newVal) {
-          this.info[this.param] = newVal
-          this.select = ''
-        }
-      }
-    },
-    computed: {
-      ...mapGetters({
-        info:'info'
-      })
-    },
-    data(){
-      return {
-        img:'',
-        param:'',
-        isShow:false,
-        rang: {
-            label: '显示时间',
-            unit: "秒",
-            value: 1,
-            min: 0,
-            max: 3,
-            gradient: 1,
-            tip:true
-        }
-      }
-    },
-    methods:{
-      onFileChange(){
-      },
-      onRangeChange(data) {
-        console.log(data.value);
-        this.info.remindTime = parseInt(data.value)
-      },
-      onSwitcherChange(data){
-        this.info.isRemind = data
-      }
-    }
-}
-</script>
-<style lang="less" src="./style.less"></style>
-
-<style lang="less" scoped>
-.preview-con{
-  display: flex;
-  .preview{
-    width: 100px;
-    height: 100px;
-    overflow: hidden;
-  }
-  .upload-con{
-    flex: 1;
-    .ui-button{
-      width: 100%;
-    }
-    .ui-remark{
-      margin-top: 10px;
-      width: 100%;
-      word-break: keep-all;
-    }
-  }
-  .bars{
-  }
-}
-</style>
-

+ 0 - 59
packages/code/src/views/base/EditPanel/password.vue

@@ -1,59 +0,0 @@
-<template>
-  <div class="plate">
-    <div>
-      <ul>
-        <li app-border dir-bottom>
-          <div class="title">设置访问密码</div>
-          <div class="password">
-              <input
-                :type="cansee?'text':'password'"
-                class="ui-input"
-                placeholder="请输入访问密码,限20位"
-                :maxlength="20"
-                oninput="value=value.replace(/\s+/g,'')"
-                v-model="info.password"
-              />
-            <i class="iconfont icon_eye" @click="cansee=!cansee" :class="{'iconedit_input_unvisible':!cansee}"></i>
-          </div>
-        </li>
-      
-      </ul>
-    </div>
-  </div>
-</template>
-
-<script>
-import { mapGetters } from "vuex";
-
-export default {
-    computed: {
-      ...mapGetters({
-        info:'info'
-      })
-    },
-    data(){
-      return {
-        password:'',
-        cansee:false
-      }
-    },
-    methods:{
-     
-    }
-}
-</script>
-<style lang="less" src="./style.less"></style>
-
-<style lang="less" scoped>
-.password{
-  position: relative;
-  .icon_eye{
-    right: 10px;
-    top: 50%;
-    transform: translateY(-50%);
-    position: absolute;
-    font-size: 18px;
-  }
-}
-</style>
-

+ 0 - 59
packages/code/src/views/base/EditPanel/style.less

@@ -1,59 +0,0 @@
-.plate{
-  display: flex;
-  flex: 1;
-  overflow: hidden;
-  > div {
-    width: 100%;
-    height: 100%;
-  }
-  ul {
-      width: 100%;
-      &.lock {
-        li {
-          pointer-events: none;
-          opacity: 0.5;
-        }
-        li.position {
-          pointer-events: auto;
-          opacity: 1;
-        }
-      }
-    }
-    li {
-      padding: 15px 10px;
-      > div {
-        margin-bottom: 15px;
-        &:last-child {
-          margin-bottom: 0;
-        }
-        &.title {
-          margin-bottom: 10px;
-        }
-        label {
-          color: #ababab;
-          font-size: 12px;
-        }
-      }
-      &:last-child {
-        border: none;
-        &::after {
-          display: none;
-        }
-      }
-      .link-button {
-        display: flex;
-        justify-content: space-between;
-        button {
-          width: 45%;
-        }
-      }
-      .switch-con{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        >span{
-          font-size: 12px;
-        }
-      }
-    }
-}

+ 0 - 49
packages/code/src/views/base/EditPanel/xy.vue

@@ -1,49 +0,0 @@
-<template>
-  <div class="plate">
-    <div>
-      <ul>
-        <li>
-          <div class="xy-con">
-              <span class="title">进入全景图自动巡游</span>
-              <switcher name="pano" :value="info.isAuto" @change="onSwitcherChange"></switcher>
-          </div>
-        </li>
-      </ul>
-    </div>
-  </div>
-</template>
-
-<script>
-import Switcher from "@/components/shared/Switcher";
-import { mapGetters } from "vuex";
-
-export default {
-    components:{
-      Switcher
-    },
-    computed: {
-      ...mapGetters({
-        info:'info'
-      })
-    },
-    data(){
-      return {
-      }
-    },
-    methods:{
-      onSwitcherChange(data){
-        this.info.isAuto = data
-      }
-    }
-}
-</script>
-<style lang="less" src="./style.less"></style>
-
-<style lang="less" scoped>
-.xy-con{
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-  }
-</style>
-

+ 19 - 0
packages/code/src/views/base/customButtonSettings.vue

@@ -193,6 +193,25 @@ export default {
       }
     },
   },
+  beforeMount() {
+    if (!this.info.customButton) {
+      // 这是在v1.2版之前创建的作品,还没设置过自定义按钮,所以还没有customButton字段
+      this.info.customButton = [
+        {
+          "type": "电话",
+          "name": "电话",
+          "value": "",
+          "isShow": false
+        },
+        {
+          "type": "链接",
+          "name": "链接",
+          "value": "",
+          "isShow": false
+        }
+      ]
+    }
+  },
   methods: {
     onRequestForChangeExpandStatus(index) {
       this.$set(this.expandStatus, index, !this.expandStatus[index])