曹冬冬 5 år sedan
förälder
incheckning
b32352aef2

BIN
src/assets/images/qrcode-copy.png


BIN
src/assets/images/share-close.png


+ 249 - 0
src/components/ShareSetting.vue

@@ -0,0 +1,249 @@
+<template>
+  <div class="share">
+    <div class="preview">
+      <div class="preview-area"></div>
+    </div>
+    <div class="setting">
+      <img class="share-close" src="../assets/images/share-close.png" alt="" @click="closeBtn">
+      <div class="share-title">分享设置</div>
+      <div class="share-titleBox">
+        <div class="top">
+          <span class="title">h5测试分享标题</span><span class="count">8/30</span>
+        </div>
+        <div class="content">
+          <el-input class="input" type="textarea" :rows="3" placeholder="请输入内容" v-model="textarea" maxlength="30"
+            show-word-limit>
+          </el-input>
+          <img class="cover" src="" alt="" @click="closeBtn">
+          <div class="cover-title">更换封面</div>
+        </div>
+      </div>
+      <div class="qrcode-title">渠道二维码</div>
+      <div class="qrcode">
+        <el-input v-model="input" placeholder="请输入内容"></el-input>
+        <img class="qrcode-img" src="" alt="">
+        <div class="qrcode-btn">
+          <div class="qrcode-download" @click="save">下载二维码</div>
+          <div class="qrcode-copy" @click="save">
+            <img class="qrcode-copy-img" src="../assets/images/qrcode-copy.png" alt="">
+            复制链接</div>
+        </div>
+      </div>
+      <div class="qrcode-add">添加渠道</div>
+      <div class="share-save" @click="save">确定</div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      textarea: ""
+    };
+  },
+  props: {
+    close: {
+      type: Function,
+      default: null
+    }
+  },
+  methods: {
+    closeBtn() {
+      this.close();
+    },
+    save() {
+      console.log("XXXX");
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.share {
+  z-index: 1000;
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background: rgba(0, 0, 0, 0.6);
+  display: flex;
+  flex-direction: row;
+  .preview {
+    flex-grow: 2;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    .preview-area {
+      width: 340px;
+      height: 530px;
+      border: 1px solid #d6d6d6;
+      background: red;
+    }
+  }
+  .setting {
+    overflow: auto;
+    width: 446px;
+    height: 100%;
+    background: #fff;
+    .share-close {
+      z-index: 1001;
+      position: absolute;
+      top: 0px;
+      right: 0px;
+      width: 63px;
+      height: 57px;
+      cursor: pointer;
+    }
+    .share-title {
+      margin: 80px 0px 10px 18px;
+      font-size: 16px;
+      font-family: PingFangSC-Regular;
+      font-weight: 400;
+      color: rgba(0, 0, 0, 1);
+      line-height: 22px;
+    }
+    .share-titleBox {
+      margin: 0px 12px;
+      height: 130px;
+      border-radius: 4px;
+      border: 1px solid rgba(204, 204, 204, 1);
+      .top {
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+        margin: 10px;
+        .title {
+          font-size: 14px;
+          font-family: MicrosoftYaHei;
+          color: rgba(51, 51, 51, 1);
+          line-height: 19px;
+        }
+        .count {
+          font-size: 14px;
+          font-family: MicrosoftYaHei;
+          color: rgba(153, 160, 182, 1);
+          line-height: 19px;
+        }
+      }
+      .content {
+        display: flex;
+        position: relative;
+        .input {
+          width: 326px;
+          margin-left: 10px;
+        }
+        .cover {
+          width: 70px;
+          height: 70px;
+          background: rgba(239, 239, 239, 1);
+          margin: 0px 10px;
+          cursor: pointer;
+        }
+        .cover-title {
+          position: absolute;
+          bottom: 0px;
+          right: 10px;
+          width: 70px;
+          height: 20px;
+          background: rgba(0, 0, 0, 0.8);
+          color: #fff;
+          font-size: 12px;
+          line-height: 20px;
+          text-align: center;
+        }
+      }
+    }
+    .qrcode-title {
+      margin: 28px 0px 10px 18px;
+      font-size: 16px;
+      font-family: PingFangSC-Regular;
+      font-weight: 400;
+      color: rgba(0, 0, 0, 1);
+      line-height: 22px;
+    }
+    .qrcode {
+      margin-left: 18px;
+      margin-bottom: 10px;
+      width: 408px;
+      height: 283px;
+      border: 1px solid rgba(204, 204, 204, 1);
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      .el-input {
+        margin-top: 16px;
+        width: 265px;
+      }
+      .qrcode-img {
+        margin-top: 16px;
+        width: 140px;
+        height: 140px;
+        background: rgba(239, 239, 239, 1);
+      }
+      .qrcode-btn {
+        display: flex;
+        justify-content: space-between;
+        width: 250px;
+        height: 31px;
+        margin-top: 20px;
+        font-size: 14px;
+        font-family: PingFangSC-Regular;
+        font-weight: 400;
+        color: rgba(78, 93, 255, 1);
+        line-height: 30px;
+        text-align: center;
+        .qrcode-download {
+          width: 91px;
+          height: 30px;
+          background: rgba(230, 237, 255, 1);
+          border-radius: 15px;
+          cursor: pointer;
+        }
+        .qrcode-copy {
+          width: 125px;
+          height: 30px;
+          background: rgba(230, 237, 255, 1);
+          border-radius: 15px;
+          cursor: pointer;
+          .qrcode-copy-img {
+            width: 16px;
+            height: 16px;
+            vertical-align: middle;
+          }
+        }
+      }
+    }
+    .qrcode-add {
+      margin-left: 18px;
+      margin-top: 20px;
+      width: 408px;
+      height: 44px;
+      background: rgba(241, 241, 241, 1);
+      border: 1px dotted rgba(192, 192, 192, 1);
+      line-height: 44px;
+      text-align: center;
+      font-size: 14px;
+      font-weight: 400;
+      color: rgba(78, 93, 255, 1);
+      cursor: pointer;
+    }
+    .share-save {
+      text-align: center;
+      width: 105px;
+      height: 34px;
+      background: rgba(78, 93, 255, 1);
+      border-radius: 19px;
+      margin-top: 40px;
+      margin-bottom: 94px;
+      margin-left: 174px;
+      font-weight: 500;
+      color: rgba(255, 255, 255, 1);
+      line-height: 34px;
+      font-size: 14px;
+      cursor: pointer;
+    }
+  }
+}
+</style>

+ 4 - 0
src/routers.js

@@ -9,6 +9,10 @@ const router = new Router({
     path: '/',
     name: 'myHistoryTest',
     component: require('./views/myHistoryTest/myHistoryTest.vue')
+  }, {
+    path: '/myHistoryTest',
+    name: 'myHistoryTest',
+    component: require('./views/myHistoryTest/myHistoryTest.vue')
   }, {
     path: '/login',
     name: 'login',

+ 4 - 2
src/views/h5editor/index.vue

@@ -412,12 +412,14 @@ export default {
           .then(() => {
             window.hasSaveFlag = true;
             return Promise.resolve().then(() =>
-              this.$router.replace("themeList")
+              this.$router.replace("myHistoryTest")
             );
           })
           .catch(() => {});
       } else {
-        return Promise.resolve().then(() => this.$router.replace("themeList"));
+        return Promise.resolve().then(() =>
+          this.$router.replace("myHistoryTest")
+        );
       }
     },
     getPicList(_id) {

+ 6 - 4
src/views/myHistoryTest/myHistoryTest.html

@@ -25,7 +25,7 @@
       </el-dropdown>
     </div>
     <div class="right">
-      <el-button type="primary" icon="el-icon-circle-plus-outline">创建测试</el-button>
+      <el-button type="primary" icon="el-icon-circle-plus-outline" @click="createTest">创建测试</el-button>
     </div>
   </div>
   <!-- 列表 -->
@@ -34,8 +34,8 @@
       <div class="tools">
         <img class="item-img delete" src="" alt="" @click="deleteTest(index)">
         <img class="item-img copy" src="" alt="" @click="copyTest">
-        <img class="item-img share" src="" alt="">
-        <img class="item-img edit" src="" alt="" style="float:right;margin-right:10px;">
+        <img class="item-img share" src="" alt="" @click="shareTest()">
+        <img class="item-img edit" src="" alt="" @click="editTest" style="float:right;margin-right:10px;">
       </div>
       <img class="item-img" mode="" src="https://dm.static.elab-plus.com/diaoyanbao/coverImg/GT95_preview.jpg" alt="">
       <div class="title">定制你的家具香气{{item.index}}</div>
@@ -45,9 +45,11 @@
         <span>1天前</span>
       </div>
     </div>
-    <div class="item add">
+    <div class="item add" @click="createTest">
       <i class="el-icon-circle-plus add-icon"></i>
       <span>创建测试</span>
     </div>
   </div>
+  <!-- 分享设置 -->
+  <ShareSetting v-show="isShareSetting" :close="closeShare"></ShareSetting>
 </div>

+ 26 - 1
src/views/myHistoryTest/myHistoryTest.js

@@ -1,11 +1,13 @@
 import HeaderMain from "../../components/HeaderMain";
+import ShareSetting from "../../components/ShareSetting";
 export default {
   components: {
-    HeaderMain
+    HeaderMain, ShareSetting
   },
   data() {
     return {
       isCopy: false,
+      isShareSetting: false,
       cities: [{
         value: 'Beijing',
         label: '北京'
@@ -29,7 +31,21 @@ export default {
       lists: [{ index: 0 }, { index: 1 }, { index: 2 }, { index: 3 }, { index: 4 }, { index: 5 }, { index: 6 }, { index: 7 }, { index: 8 }, { index: 9 }, { index: 10 }, { index: 11 }, { index: 12 }, { index: 13 }, { index: 14 }, { index: 15 }, { index: 16 }, { index: 17 }, { index: 18 }, { index: 19 }]
     }
   },
+  watch: {
+    isShareSetting: function (val) {
+      var mo = function (e) { e.preventDefault(); };
+      document.body.style.overflow = val ? 'hidden' : '';
+      if (val) {
+        document.addEventListener("touchmove", mo, false);
+      } else {
+        document.removeEventListener("touchmove", mo, false);
+      }
+    }
+  },
   methods: {
+    createTest() {
+      this.$router.push({ path: '/cncTestLists' });
+    },
     deleteTest(index) {
       const h = this.$createElement;
       this.$msgbox({
@@ -70,6 +86,15 @@ export default {
       setTimeout(() => {
         this.isCopy = false;
       }, 2000);
+    },
+    editTest() {
+      this.$router.replace({ path: '/h5editor', query: { itemId: 0 } })
+    },
+    shareTest() {
+      this.isShareSetting = true;
+    },
+    closeShare() {
+      this.isShareSetting = false;
     }
   },
 }

+ 1 - 0
src/views/myHistoryTest/myHistoryTest.scss

@@ -157,6 +157,7 @@
     color:rgba(78,93,255,1);
     line-height:22px;
     text-align: center;
+    cursor:pointer;
     .add-icon {
       font-size:28px;
       margin-bottom: 10px;