Sfoglia il codice sorgente

h5编辑 返回按钮 显示测试题名称

曹冬冬 5 anni fa
parent
commit
b1dca9b5d2

+ 3 - 2
src/components/HeaderEdit.vue

@@ -1,6 +1,6 @@
 <template>
   <header class="header">
-    <button class="reset-btn" @click="goback"><i class="el-icon-arrow-left"></i>返回作品</button>
+    <button class="reset-btn" @click="goback"><i class="el-icon-arrow-left"></i>{{title || '返回作品'}}</button>
     <div class="tools">
       <div class="next_return">
         <div class="return" title="撤销" @click="revocation" :style="`opacity:${operationList.length>1?'1':'.3'}`">
@@ -62,7 +62,8 @@ var time = null;
 export default {
   props: {
     goback: Function,
-    save: Function
+    save: Function,
+    title: ""
   },
   components: {
     ShareSetting

+ 7 - 1
src/components/HeaderMain.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="header">
-    <div class="logo">
+    <div class="logo" @click="home">
       <img class="logo-img" src="../assets/images/diaoyanbao-log.png" alt="">调研宝</div>
     <div class="right">
       <div class="operational-data">去“看板”查看测试运营数据</div>
@@ -19,6 +19,11 @@
 export default {
   data() {
     return {};
+  },
+  methods: {
+    home() {
+      this.$router.push({ path: "/" });
+    }
   }
 };
 </script>
@@ -41,6 +46,7 @@ export default {
     display: flex;
     flex-direction: row;
     line-height: 30px;
+    cursor: pointer;
     .logo-img {
       width: 30px;
       height: 30px;

+ 1 - 1
src/views/h5editor/index.vue

@@ -2,7 +2,7 @@
   <div class="editor">
     <!-- 头部 -->
     <HeaderMain></HeaderMain>
-    <HeaderEdit :goback="dialogSave" :save="save" @saveThemeSuccess="showPreView=true" />
+    <HeaderEdit :title="title" :goback="dialogSave" :save="save" @saveThemeSuccess="showPreView=true" />
     <!-- 内容区域 -->
     <section class="section">
       <!-- 左侧图层 -->

+ 1 - 0
src/vuex/editor/actions.js

@@ -145,6 +145,7 @@ export const getPageByThemeId = ({ dispatch, commit }, id) => {
     console.log("XXXXXXXXXXXXXXX", single);
     single.pages = single.pages || [];
     single.backgroundAudio = single.backgroundAudio || '';
+    single.title = res.single.title || '';
     single.pages.forEach((page) => {
       page.elements.forEach((element) => {
         element.animatedFont = element.animatedFont || ''