liyongli 3 年之前
父节点
当前提交
b04f999d28
共有 3 个文件被更改,包括 30 次插入21 次删除
  1. 4 4
      public/index.html
  2. 0 2
      src/views/Applyreal.vue
  3. 26 15
      src/views/Queue.vue

+ 4 - 4
public/index.html

@@ -10,11 +10,11 @@
     <script>eruda.init();</script>
     <script src="https://djweb.smcic.net/gouju/js/jquery-2.1.0.js"></script>
     <!--导入原生js库-->
-    <script src="http://cmp/v1.0.0/js/cordova/__CMPSHELL_PLATFORM__/cordova.js"></script>
-    <script src="http://cmp/v1.0.0/js/cordova/cordova-plugins.js"></script>
+    <!-- <script src="http://cmp/v1.0.0/js/cordova/__CMPSHELL_PLATFORM__/cordova.js"></script>
+    <script src="http://cmp/v1.0.0/js/cordova/cordova-plugins.js"></script> -->
     <!--导入cmp.js-->
-    <script src="http://cmp/v/js/cmp-i18n.js"></script>
-    <script src="http://cmp/v/js/cmp.js"></script>
+    <!-- <script src="http://cmp/v/js/cmp-i18n.js"></script>
+    <script src="http://cmp/v/js/cmp.js"></script> -->
     <title>
         <%= htmlWebpackPlugin.options.title %>
     </title>

+ 0 - 2
src/views/Applyreal.vue

@@ -72,8 +72,6 @@ export default {
     };
   },
   mounted() {
-    this.userphone = this.$route.query.phone || "";
-    this.username = this.$route.query.userName || "";
     goodsList().then(res => {
       this.goodsLi = res || [];
       this.radio = (this.goodsLi[0] || {}).id;

+ 26 - 15
src/views/Queue.vue

@@ -38,10 +38,7 @@
     </van-cell-group>
 
     <van-popup closeable v-model="open" position="right" class="open">
-      <van-checkbox-group
-        v-model="checkbox"
-        v-if="showPopover.length"
-      >
+      <van-checkbox-group v-model="checkbox" v-if="showPopover.length">
         <van-row v-for="(item, i) in weeks" :key="i">
           <van-col span="8">
             <van-checkbox :name="i" style="height: 2em">
@@ -109,7 +106,15 @@
           </van-col>
         </van-row>
         <br />
-        <van-button :loading="load" @click="upRulefun" round  type="info" loading-text="加载中..." block>保 存</van-button>
+        <van-button
+          :loading="load"
+          @click="upRulefun"
+          round
+          type="info"
+          loading-text="加载中..."
+          block
+          >保 存</van-button
+        >
       </van-checkbox-group>
     </van-popup>
   </div>
@@ -132,7 +137,9 @@ import {
   Tag as vanTag,
   Dialog,
   Notify,
+  Toast
 } from "vant";
+import "vant/lib/toast/style/index";
 import "vant/lib/tag/style/index";
 import "vant/lib/cell/style/index";
 import "vant/lib/cell-group/style/index";
@@ -170,7 +177,7 @@ export default {
       timerange: [],
       checkbox: [],
       weeks: [],
-      load: false
+      load: false,
     };
   },
   mounted() {
@@ -198,15 +205,17 @@ export default {
       this.closeTime(t);
     },
     upRulefun() {
-        this.load = true;
+      this.load = true;
       upRule({
-        week: this.formatRule()
-      }).then(r => {
-        console.log(r);
-        this.load = false;
-      }).catch(()=>{
-        this.load = false;
-      });
+        week: this.formatRule(),
+      })
+        .then(() => {
+          this.load = false;
+          Toast("保存成功")
+        })
+        .catch(() => {
+          this.load = false;
+        });
     },
     formatRule() {
       let li = [],
@@ -222,7 +231,8 @@ export default {
         check = this.checkbox.join(",");
       for (let i = 0; i < this.showPopover.length; i++) {
         const time = this.time[i],
-          time2 = this.time2[i], rex = new RegExp(i);
+          time2 = this.time2[i],
+          rex = new RegExp(i);
         li.push({
           week: week[this.weeks[i]],
           start: time,
@@ -341,6 +351,7 @@ export default {
 .queue {
   width: 1200px;
   height: 100%;
+  overflow-y: scroll;
   margin: 0 auto;
   background-color: #fff;
 }