Quellcode durchsuchen

Merge branch 'master' of http://192.168.4.246:3000/zhangs/surveyMaker

zhangwf vor 5 Jahren
Ursprung
Commit
501c9a33b9

+ 9 - 0
src/api/test.js

@@ -0,0 +1,9 @@
+import * as http from '../util/http'
+
+const testList = (param) => {
+  return http.post('/testTheme/testList', param)
+}
+
+module.exports = {
+  testList
+}

BIN
src/assets/images/phone-model-bottom.png


BIN
src/assets/images/phone-model-center.png


BIN
src/assets/images/phone-model-status.png


BIN
src/assets/images/phone-model-top.png


+ 17 - 4
src/components/HeaderEdit.vue

@@ -48,22 +48,30 @@
 
       </form>
     </div> -->
+    <!-- 分享设置 -->
+    <ShareSetting v-show="isShareSetting" :close="closeShare"></ShareSetting>
   </header>
 </template>
 
 <script>
 import tools from "../util/tools";
 import api from "../api/editor";
+
+import ShareSetting from "./ShareSetting";
 var time = null;
 export default {
   props: {
     goback: Function
   },
+  components: {
+    ShareSetting
+  },
   data() {
     return {
       loading: false,
       operationList: [],
-      nextList: []
+      nextList: [],
+      isShareSetting: false
     };
   },
   beforeCreate() {
@@ -251,7 +259,12 @@ export default {
         that.$store.state.editor.editorPage.elements = res["pages"][0].elements;
       });
     },
-    shareSetting() {},
+    shareSetting() {
+      this.isShareSetting = true;
+    },
+    closeShare() {
+      this.isShareSetting = false;
+    },
     save() {}
   }
 };
@@ -266,11 +279,11 @@ export default {
   position: relative;
   .reset-btn {
     height: 100%;
-    padding: 0 20px;
+    padding: 0 50px;
     cursor: pointer;
   }
   .el-icon-arrow-left {
-    margin-right: 20px;
+    margin-right: 10px;
   }
   .right-panel {
     float: right;

+ 47 - 5
src/components/ShareSetting.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="share">
     <div class="preview">
-      <div class="preview-area"></div>
+      <div class="phone-top"></div>
+      <div class="phone-center"></div>
+      <div class="content">
+        <div class="phone-status"></div>
+        <div class="preview-area"></div>
+      </div>
+      <div class="phone-bottom"></div>
     </div>
     <div class="setting">
       <img class="share-close" src="../assets/images/share-close.png" alt="" @click="closeBtn">
@@ -81,13 +87,49 @@ export default {
   .preview {
     flex-grow: 2;
     display: flex;
+    flex-direction: column;
     justify-content: center;
     align-items: center;
-    .preview-area {
-      width: 340px;
+    .phone-top {
+      width: 341px;
+      height: 83px;
+      background: url(../assets/images/phone-model-top.png) center no-repeat;
+      background-size: cover;
+    }
+    .phone-center {
+      position: relative;
+      width: 346px;
+      height: 530px;
+      background: url(../assets/images/phone-model-center.png) repeat-y;
+      background-size: cover;
+    }
+    .content {
+      position: absolute;
+      width: 298px;
       height: 530px;
-      border: 1px solid #d6d6d6;
-      background: red;
+      .phone-status {
+        margin-left: -2px;
+        margin-top: -2px;
+        width: 300px;
+        height: 50px;
+        background: url(../assets/images/phone-model-status.png) repeat-y;
+        background-size: cover;
+      }
+      .preview-area {
+        position: relative;
+        margin-left: -1px;
+        width: 298px;
+        height: 480px;
+        border: 1px solid #000;
+        border-top: 0px;
+      }
+    }
+
+    .phone-bottom {
+      width: 342px;
+      height: 87px;
+      background: url(../assets/images/phone-model-bottom.png) center no-repeat;
+      background-size: cover;
     }
   }
   .setting {

+ 3 - 3
src/main.js

@@ -1,7 +1,7 @@
 // 全局插件
-window.hasSaveFlag=true;
-window.revocationFlag=false
-window.baseUrl='http://skyforest.static.elab-plus.com/h5maker/'
+window.hasSaveFlag = true;
+window.revocationFlag = false
+window.baseUrl = 'http://skyforest.static.elab-plus.com/h5maker/'
 import Vue from 'vue'
 import VueRouter from 'vue-router'
 import Vuex from 'vuex'

+ 3 - 2
src/model/Page.js

@@ -2,7 +2,8 @@
  * Created by zhengguorong on 2016/11/24.
  */
 export default class Page {
-  constructor (page = {}) {
-    this.elements = page.elements || []
+  constructor(page = {}) {
+    this.elements = page.elements || [];
+    this.position = 0;
   }
 }

Datei-Diff unterdrückt, da er zu groß ist
+ 804 - 803
src/views/h5editor/index.vue


Datei-Diff unterdrückt, da er zu groß ist
+ 508 - 507
src/views/h5editor/overview.vue


+ 3 - 3
src/vuex/editor/actions.js

@@ -69,10 +69,10 @@ export const addPage = ({ commit }) => {
   commit(types.ADD_PAGE, page)
   commit(types.SET_CUR_EDITOR_PAGE, page)
 }
-export const addPage1 = ({ commit }, position) => {
-  console.log("SSSSSSSSSSSSSSSS", position);
+export const addPagePosition = ({ commit }, position) => {
   var page = new Page()
-  commit(types.ADD_PAGE_POSITION, page, position)
+  page.position = position
+  commit(types.ADD_PAGE_POSITION, page)
   commit(types.SET_CUR_EDITOR_PAGE, page)
 }
 

+ 2 - 3
src/vuex/editor/mutations.js

@@ -57,9 +57,8 @@ const mutations = {
   [types.ADD_PAGE](state, page) {
     state.editorTheme.pages.push(page);
   },
-  [types.ADD_PAGE_POSITION](state, page, position) {
-    console.log("XXXXXXXXX", position);
-    state.editorTheme.pages.splice(2, 0, page);
+  [types.ADD_PAGE_POSITION](state, page) {
+    state.editorTheme.pages.splice(page.position, 0, page);
   },
   [types.DELETE_PAGE](state, data) {
     state.editorTheme.pages.findIndex((value, index, arr) => {