瀏覽代碼

优化会员付费管理

yuhao 2 年之前
父節點
當前提交
14f84d8964

+ 29 - 28
src/pages/customerMan/index.vue

@@ -109,6 +109,14 @@ export default {
109 109
       face: false, //未面诊用户开关
110 110
       silence: false, //沉默用户开关
111 111
       dialogVisible: false, // 控制筛选弹框
112
+      // 筛选框内的变量内容
113
+      customerKey: 0,
114
+      couponKey: 0,
115
+      cardKey: 0,
116
+      latelyKey: 0,
117
+      superpositionNum: 0,
118
+      StoredPrice: 0,
119
+      transitionNum: 0,
112 120
     };
113 121
   },
114 122
   computed: {},
@@ -125,15 +133,14 @@ export default {
125 133
       StoredPrice,
126 134
       transitionNum
127 135
     ) {
128
-      this.getUserList(
129
-        customerKey,
130
-        couponKey,
131
-        cardKey,
132
-        latelyKey,
133
-        superpositionNum,
134
-        StoredPrice,
135
-        transitionNum
136
-      );
136
+      (this.customerKey = customerKey),
137
+        (this.couponKey = couponKey),
138
+        (this.cardKey = cardKey),
139
+        (this.latelyKey = cardKey),
140
+        (this.superpositionNum = superpositionNum),
141
+        (this.StoredPrice = StoredPrice),
142
+        (this.transitionNum = transitionNum),
143
+        this.getUserList();
137 144
     },
138 145
     // 筛选沉默用户
139 146
     showSilence(e) {
@@ -148,39 +155,33 @@ export default {
148 155
       this.dialogVisible = true;
149 156
     },
150 157
     // 获取订单列表
151
-    getUserList(
152
-      customerKey,
153
-      couponKey,
154
-      cardKey,
155
-      latelyKey,
156
-      superpositionNum,
157
-      StoredPrice,
158
-      transitionNum
159
-    ) {
160
-      console.log(customerKey);
158
+    getUserList() {
161 159
       let params = {
162 160
         page: this.currentPage1,
163 161
         limit: this.limit,
164 162
         keywords: this.searchText,
165 163
         silence_user: this.silence ? 1 : 0, //沉默付费用户1是显示 0是不显示
166 164
         face_user: this.face ? 1 : 0, //显示未面诊付费用户 1是显示 0是不显示
167
-        tag:customerKey,
168
-        coupon_days:couponKey,
169
-        card_days:cardKey,
170
-        buying_time:latelyKey,
171
-        project_add:superpositionNum,
172
-        balance_money:StoredPrice,
173
-        change_add:transitionNum
165
+        tag: this.customerKey,
166
+        coupon_days: this.couponKey,
167
+        card_days: this.cardKey,
168
+        buying_time: this.latelyKey,
169
+        project_add: this.superpositionNum,
170
+        balance_money: this.StoredPrice,
171
+        change_add: this.transitionNum,
174 172
       };
175 173
       api.getUserList(params).then((res) => {
176 174
         if (res.code == 200) {
177 175
           // 将用户手机号中间四位变成****
178 176
           res.data.list.map((item) => {
179
-            item.mobile =
180
-              item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
177
+            if (item.mobile) {
178
+              item.mobile =
179
+                item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
180
+            }
181 181
           });
182 182
           this.tableData = res.data.list;
183 183
           this.total = res.data.total;
184
+          console.log(this.tableData);
184 185
         }
185 186
       });
186 187
     },

+ 88 - 3
src/pages/customerMan/selectPop/index.vue

@@ -82,6 +82,7 @@
82 82
               v-model="superpositionNum"
83 83
               :min="0"
84 84
               size="mini"
85
+              @change="superpositionChange"
85 86
             ></el-input-number>
86 87
           </div>
87 88
           <div class="transition">
@@ -90,6 +91,7 @@
90 91
               v-model="transitionNum"
91 92
               :min="0"
92 93
               size="mini"
94
+              @change="transitionChange"
93 95
             ></el-input-number>
94 96
           </div>
95 97
           <!-- <div class="consumePrice">
@@ -103,14 +105,23 @@
103 105
           <div class="StoredPrice">
104 106
             <div class="StoredPrice-title">总储值金额</div>
105 107
             <div class="StoredPrice-content">
106
-              <el-input v-model="minStoredPricePrice"></el-input>
108
+              <el-input
109
+                @change="minChange"
110
+                v-model="minStoredPricePrice"
111
+              ></el-input>
107 112
               <div>-</div>
108
-              <el-input v-model="maxStoredPricePrice"></el-input>
113
+              <el-input
114
+                @change="maxChange"
115
+                v-model="maxStoredPricePrice"
116
+              ></el-input>
109 117
             </div>
110 118
           </div>
111 119
         </div>
112 120
         <div class="slot-footer" slot="footer">
113
-          <div class="item-title">共有<i>50</i>位用户</div>
121
+          <div class="item-title">
122
+            共有<i>{{ total }}</i
123
+            >位用户
124
+          </div>
114 125
           <div>
115 126
             <button @click="reset">重置</button>
116 127
             <button @click="save">保存</button>
@@ -122,10 +133,13 @@
122 133
 </template>
123 134
 
124 135
 <script>
136
+import api from "../../../server/home";
125 137
 export default {
126 138
   props: ["visible"],
127 139
   data() {
128 140
     return {
141
+      total: 0,
142
+      currentPage1: 1,
129 143
       customerSource: {
130 144
         name: "客户来源",
131 145
         title: [
@@ -172,6 +186,38 @@ export default {
172 186
     };
173 187
   },
174 188
   methods: {
189
+    // 获取订单列表
190
+    getUserList() {
191
+      let StoredPrice = [];
192
+      StoredPrice.push(this.minStoredPricePrice);
193
+      StoredPrice.push(this.maxStoredPricePrice);
194
+      let params = {
195
+        page: this.currentPage1,
196
+        limit: this.limit,
197
+        tag: this.customerKey.length == 0 ? 0 : this.customerKey,
198
+        coupon_days: this.couponKey.length == 0 ? 0 : this.couponKey,
199
+        card_days: this.cardKey.length == 0 ? 0 : this.cardKey,
200
+        buying_time: this.latelyKey.length == 0 ? 0 : this.latelyKey,
201
+        project_add: this.superpositionNum,
202
+        balance_money:
203
+          this.maxStoredPricePrice.length == 0 ? 0 : StoredPrice.toString(),
204
+        change_add: this.transitionNum,
205
+      };
206
+      api.getUserList(params).then((res) => {
207
+        if (
208
+          this.customerKey.length == 0 &&
209
+          this.couponKey.length == 0 &&
210
+          this.cardKey.length == 0 &&
211
+          this.latelyKey.length == 0 &&
212
+          this.superpositionNum == 0 &&
213
+          this.maxStoredPricePrice.length == 0
214
+        ) {
215
+          this.total = 0;
216
+          return;
217
+        }
218
+        this.total = res.data.total;
219
+      });
220
+    },
175 221
     // 重置筛选条件
176 222
     reset() {
177 223
       // 重置data里的值
@@ -198,31 +244,70 @@ export default {
198 244
     closeFilterPop() {
199 245
       this.$emit("update:visible", false);
200 246
     },
247
+    // 最小值改变
248
+    minChange() {
249
+      this.getUserList();
250
+    },
251
+    // 最大值改变
252
+    maxChange() {
253
+      this.getUserList();
254
+    },
255
+    // 项目叠加事件
256
+    superpositionChange() {
257
+      this.getUserList();
258
+    },
259
+    // 转换次数事件
260
+    transitionChange() {
261
+      this.getUserList();
262
+    },
201 263
     // 选择
202 264
     customerFilter(item, index) {
203 265
       if (this.customerSelect.indexOf(index) != -1) {
204 266
         this.customerSelect.splice(this.customerSelect.indexOf(index), 1);
205 267
         this.customerKey.splice(this.customerKey.indexOf(index), 1);
268
+        this.getUserList();
206 269
         return;
207 270
       }
208 271
       this.customerSelect.push(index);
209 272
       // 0 无1线下进店 2种子用户 3美团/大众 4抖音 5达人探店 6霸王餐 7老带新/转介绍,多个使用数组
210 273
       this.customerKey.push(index + 1);
274
+      this.getUserList();
211 275
     },
212 276
     // 选择优惠券快过期付费用户
213 277
     couponFilter(item, index) {
278
+      if (this.couponSelect == index) {
279
+        this.couponSelect = 99;
280
+        this.couponKey = "";
281
+        this.getUserList();
282
+        return;
283
+      }
214 284
       this.couponSelect = index;
215 285
       this.couponKey = this.couponSource.day[index];
286
+      this.getUserList();
216 287
     },
217 288
     // 选择此卡快过期下标
218 289
     cardFilter(item, index) {
290
+      if (this.cardSelect == index) {
291
+        this.cardSelect = 99;
292
+        this.cardKey = "";
293
+        this.getUserList();
294
+        return;
295
+      }
219 296
       this.cardSelect = index;
220 297
       this.cardKey = this.cardSource.day[index];
298
+      this.getUserList();
221 299
     },
222 300
     // 选择距离最近消费时间
223 301
     latelyFilter(item, index) {
302
+      if (this.latelySelect == index) {
303
+        this.latelySelect = 99;
304
+        this.latelyKey = "";
305
+        this.getUserList();
306
+        return;
307
+      }
224 308
       this.latelySelect = index;
225 309
       this.latelyKey = this.latelySource.day[index];
310
+      this.getUserList();
226 311
     },
227 312
   },
228 313
   watch: {

+ 0 - 147
src/pages/home/calendarPop/index.vue

@@ -1,147 +0,0 @@
1
-<template>
2
-  <div>
3
-    <div class="filterPop">
4
-      <el-dialog
5
-        top="100px"
6
-        :visible.sync="visible"
7
-        width="56.5%"
8
-        :close-on-click-modal="false"
9
-      >
10
-        <span slot="title" class="slot-title">
11
-          <i @click="closeFilterPop" class="el-icon-arrow-left"></i>
12
-          10月客户预约表
13
-        </span>
14
-        <!-- 日历 -->
15
-        <el-calendar v-model="value">
16
-          <template slot="dateCell" slot-scope="{ data }">
17
-            <div>
18
-              <div class="status">已预约</div>
19
-              <div class="Data-bottom">
20
-                <div class="order-sum">0</div>
21
-                <div class="date">
22
-                  {{ data.day.split("-").slice(2).join("-") }}日
23
-                </div>
24
-              </div>
25
-            </div>
26
-          </template>
27
-        </el-calendar>
28
-      </el-dialog>
29
-    </div>
30
-  </div>
31
-</template>
32
-
33
-<script>
34
-export default {
35
-  props: ["visible"],
36
-  data() {
37
-    return {
38
-      value:''
39
-    };
40
-  },
41
-  methods: {
42
-    closeFilterPop() {
43
-      this.$emit("update:visible", false);
44
-    },
45
-  },
46
-};
47
-</script>
48
-
49
-<style lang='less' scoped>
50
-// 弹窗
51
-.filterPop {
52
-  .slot-title {
53
-    display: inline-block;
54
-    font-size: 14px;
55
-    margin-top: 24px;
56
-    font-weight: 600;
57
-    color: #333333;
58
-    i {
59
-      font-size: 24px;
60
-      color: #666666;
61
-      margin-left: 22px;
62
-      margin-right: 180px;
63
-    }
64
-  }
65
-  // 筛选条件
66
-  /deep/.el-dialog {
67
-    border-radius: 8px;
68
-    height: 500px;
69
-    position: relative;
70
-    margin-left: 300px;
71
-    overflow: hidden;
72
-  }
73
-  /deep/.el-dialog__header {
74
-    padding: 0;
75
-    padding-bottom: 10px;
76
-  }
77
-  /deep/button.el-dialog__headerbtn {
78
-    display: none;
79
-  }
80
-  /deep/.el-dialog__body {
81
-    padding: 0;
82
-  }
83
-  // 日历样式
84
-  .status {
85
-    font-size: 8px;
86
-    color: #333;
87
-    margin-bottom: 3px;
88
-  }
89
-  .Data-bottom {
90
-    display: flex;
91
-    align-items: center;
92
-    justify-content: space-between;
93
-    .order-sum {
94
-      font-size: 27px;
95
-      color: #333333 !important;
96
-    }
97
-    .date {
98
-      font-size: 10px;
99
-      color: #333333 ;
100
-    }
101
-  }
102
-
103
-  /deep/.el-calendar__header {
104
-    display: none;
105
-  }
106
-  /deep/.el-calendar-table .el-calendar-day {
107
-    width: 90px;
108
-    height: 60px;
109
-  }
110
-  /deep/td.prev,
111
-  /deep/td.next {
112
-    pointer-events: none;
113
-    visibility:hidden;
114
-  }
115
-  /deep/td.current .el-calendar-day {
116
-    padding: 8px 20px 8px 15px;
117
-  }
118
-  /deep/td.current {
119
-    border: none;
120
-    margin-top: 6px;
121
-    position: relative;
122
-}
123
-
124
-  /deep/td.current::after {
125
-    content: '';
126
-    position: absolute;
127
-    right: 0;
128
-    top: 10px;
129
-    height: 40px;
130
-    background-color: #EDEDED;
131
-    width: 1px;
132
-}
133
-  /deep/td.current:nth-child(7)::after{
134
-    display: none;
135
-  }
136
-/deep/table.el-calendar-table {
137
-    border: 1px solid #F5F5F5;
138
-    border-top: none;
139
-    border-radius: 8px;
140
-    overflow: hidden;
141
-}
142
-/deep/thead {
143
-    background-color: #f5f5f5;
144
-    border-radius:8px !important;
145
-}
146
-}
147
-</style>

+ 0 - 278
src/pages/home/createOrder/index.vue

@@ -1,278 +0,0 @@
1
-<template>
2
-  <div>
3
-    <div class="filterPop">
4
-      <el-dialog
5
-        top="130px"
6
-        :visible.sync="orderShow"
7
-        width="52.5%"
8
-        :close-on-click-modal="false"
9
-      >
10
-        <span slot="title" class="slot-title">
11
-          <i @click="closeFilterPop" class="el-icon-arrow-left"></i>
12
-          创建订单
13
-        </span>
14
-        <!-- 创建订单内容 -->
15
-        <div class="create-content">
16
-          <div class="create-title">预约时间:</div>
17
-          <div class="filter-top">
18
-            <el-date-picker
19
-              :picker-options="pickerOptions"
20
-              :editable="false"
21
-              v-model="value1"
22
-              type="date"
23
-              placeholder="选择日期"
24
-            >
25
-            </el-date-picker>
26
-            <el-time-select
27
-              :editable="false"
28
-              :disabled="value1 == '' ? true : false"
29
-              placeholder="起始时间"
30
-              v-model="startTime"
31
-              :picker-options="{
32
-                start: '10:00',
33
-                step: '00:5',
34
-                end: '23:00',
35
-                minTime: this.nowTime,
36
-              }"
37
-            >
38
-            </el-time-select>
39
-            <el-time-select
40
-              :editable="false"
41
-              :disabled="startTime == '' ? true : false"
42
-              placeholder="结束时间"
43
-              v-model="endTime"
44
-              :picker-options="{
45
-                start: '10:00',
46
-                step: '00:5',
47
-                end: '23:00',
48
-                minTime: startTime,
49
-              }"
50
-            >
51
-            </el-time-select>
52
-          </div>
53
-          <div class="create-title">选择用户:</div>
54
-          <div class="filter-center">
55
-            <el-input
56
-              placeholder="用户手机号、用户id、用户昵称、用户真实姓名"
57
-              class="search"
58
-              v-model="searchText"
59
-            >
60
-              <i slot="prefix" class="el-input__icon el-icon-search"></i>
61
-            </el-input>
62
-            <el-button type="primary" class="searchButton">搜索</el-button>
63
-          </div>
64
-          <div class="filter-bottom">
65
-            <div class="bottom-item">
66
-              <div class="left"></div>
67
-              <div class="right">
68
-                <div class="right-content">
69
-                  <div class="nickname">
70
-                    神经蛙 <span class="name">孙桂祥</span>
71
-                  </div>
72
-                  <div class="userID">id: 123456</div>
73
-                  <div class="phone">电话: 1234567890</div>
74
-                </div>
75
-              </div>
76
-              <img class="radio" :src="unSelect" alt="" />
77
-            </div>
78
-          </div>
79
-        </div>
80
-        <div class="slot-footer" slot="footer">
81
-          <button class="cancel" @click="closeFilterPop">取消</button>
82
-          <button class="affirm" @click="affirm">确认</button>
83
-        </div>
84
-      </el-dialog>
85
-    </div>
86
-  </div>
87
-</template>
88
-
89
-<script>
90
-export default {
91
-  props: ["visible", "orderShow", "toTime"],
92
-  data() {
93
-    return {
94
-      select:
95
-        "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/select.png",
96
-      unSelect:
97
-        "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/unSelect.png",
98
-      value1: "", //日期
99
-      startTime: "", //开始时间
100
-      endTime: "", //结束时间
101
-      searchText: "", //搜索框内容
102
-      nowTime: "", //当前的(小时分钟)时间
103
-      pickerOptions: {
104
-        disabledDate(time) {
105
-          let times = Date.now() - 24 * 60 * 60 * 1000;
106
-          return time.getTime() < times;
107
-        },
108
-      }, //限制只能选择今天及以后的时间
109
-    };
110
-  },
111
-  methods: {
112
-    // 取消&&返回按钮关闭弹窗
113
-    closeFilterPop() {
114
-      this.$emit("update:orderShow", false);
115
-    },
116
-    // 确认按钮
117
-    affirm() {
118
-      this.$emit("update:orderShow", false);
119
-    },
120
-  },
121
-  watch: {
122
-    // 获取父组件赋值的时间
123
-    toTime(newValue, oldValue) {
124
-      if (newValue.isClick) {
125
-        this.startTime = newValue.start;
126
-        this.endTime = newValue.end;
127
-        let date = new Date();
128
-        this.value1 = `${date.getFullYear()}-${
129
-          date.getMonth() + 1
130
-        }-${date.getDate()}`;
131
-      } else {
132
-        this.startTime = "";
133
-        this.endTime = "";
134
-        this.value1 = "";
135
-      }
136
-    },
137
-  },
138
-  created() {
139
-    let date = new Date();
140
-    // 限制选择的时间截止到当前之后
141
-    this.nowTime = `${date.getHours() - 1}:59`;
142
-  },
143
-};
144
-</script>
145
-
146
-<style lang='less' scoped>
147
-// 弹窗
148
-.filterPop {
149
-  .slot-title {
150
-    display: inline-block;
151
-    font-size: 14px;
152
-    margin-top: 24px;
153
-    font-weight: 600;
154
-    i {
155
-      font-size: 24px;
156
-      color: #666666;
157
-      margin-left: 22px;
158
-      margin-right: 175px;
159
-    }
160
-  }
161
-  // 创建订单内容
162
-  .create-content {
163
-    .create-title {
164
-      font-size: 14px;
165
-      color: #333333;
166
-    }
167
-    .filter-top {
168
-      margin-top: 10px;
169
-      margin-bottom: 15px;
170
-    }
171
-    .filter-center {
172
-      margin-top: 15px;
173
-      .search {
174
-        width: 338px;
175
-      }
176
-      .searchButton {
177
-        margin-left: 10px;
178
-        width: 68px;
179
-        background: #fa7d22;
180
-        border-radius: 2px;
181
-        border-color: #fa7d22;
182
-      }
183
-    }
184
-    .filter-bottom {
185
-      margin-top: 12px;
186
-      height: 70px;
187
-      width: 416px;
188
-      .bottom-item {
189
-        height: 100%;
190
-        width: 203px;
191
-        background-color: #f5f5f5;
192
-        border-radius: 8px;
193
-        display: flex;
194
-        align-items: center;
195
-        .left {
196
-          width: 70px;
197
-          height: 70px;
198
-          border-radius: 8px;
199
-          margin-right: 8px;
200
-          background-color: #fa7d22;
201
-        }
202
-        .right {
203
-          width: 90px;
204
-          height: 100%;
205
-          .right-content {
206
-            width: 98px;
207
-            height: 100%;
208
-            display: flex;
209
-            flex-direction: column;
210
-            justify-content: space-evenly;
211
-            .nickname {
212
-              font-size: 14px;
213
-              color: #333;
214
-              .name {
215
-                font-size: 10px;
216
-              }
217
-            }
218
-            .userID,
219
-            .phone {
220
-              font-size: 10px;
221
-              color: #666666;
222
-            }
223
-          }
224
-        }
225
-        .radio {
226
-          width: 24px;
227
-          height: 24px;
228
-          margin-right: 10px;
229
-        }
230
-      }
231
-    }
232
-  }
233
-  .slot-footer {
234
-    margin-top: 48px;
235
-    display: flex;
236
-    justify-content: center;
237
-    button {
238
-      width: 176px;
239
-      height: 28px;
240
-      border-radius: 14px;
241
-      background-color: #fff;
242
-      border: none;
243
-    }
244
-    .cancel {
245
-      border: 1px solid #fa7d22;
246
-      color: #fa7d22;
247
-    }
248
-    .affirm {
249
-      background-color: #fa7d22;
250
-      color: #fff;
251
-      margin-left: 15px;
252
-    }
253
-  }
254
-  /deep/.el-date-editor.el-input.el-input--prefix.el-input--suffix.el-date-editor--date {
255
-    width: 180px;
256
-  }
257
-  /deep/.el-date-editor.el-input.el-input--prefix.el-input--suffix.el-date-editor--time-select {
258
-    width: 150px;
259
-    margin-left: 10px;
260
-  }
261
-  /deep/.el-dialog__body {
262
-    padding: 0 0 0 56px;
263
-  }
264
-  /deep/.el-dialog {
265
-    border-radius: 8px;
266
-    height: 500px;
267
-    margin-left: 300px;
268
-    position: relative;
269
-  }
270
-  /deep/button.el-dialog__headerbtn {
271
-    display: none;
272
-  }
273
-  /deep/.el-dialog__header {
274
-    padding: 0;
275
-    padding-bottom: 20px;
276
-  }
277
-}
278
-</style>

+ 93 - 190
src/pages/home/detailList/index.vue

@@ -1,261 +1,164 @@
1 1
 <template>
2 2
   <div class="container">
3
-    <div
4
-      class="row"
5
-      ref="row"
6
-      v-for="(orderListItem, index) in orderList"
7
-      :key="index"
8
-    >
3
+    <div class="row" ref="row" v-for="(orderListItem, index) in orderList" :key="index">
9 4
       <div class="time" :style="{ height: `${rowHeightList[index]}px` }">
10
-        <span>{{ orderListItem.time.start }}</span>
5
+        <span>{{orderListItem.time.start}}</span>
11 6
         <span>-</span>
12
-        <span>{{ orderListItem.time.end }}</span>
7
+        <span>{{orderListItem.time.end}}</span>
13 8
       </div>
14 9
       <div class="project-wrapper">
15
-        <div
16
-          class="project"
17
-          v-for="(projectItem, index) in orderListItem.list"
10
+        <div class="project"
11
+          v-for="(projectItem, index) in orderListItem.list" 
18 12
           :key="index"
19 13
           @click="toOrderDetail(projectItem)"
20 14
           :style="{
21 15
             color: getStyleByOrderStatus(projectItem).color,
22 16
             borderLeft: '1px solid',
23
-            backgroundColor: getStyleByOrderStatus(projectItem).backgroundColor,
17
+            backgroundColor: getStyleByOrderStatus(projectItem).backgroundColor
24 18
           }"
25 19
         >
26
-          <div class="name">{{ projectItem.nickname }}</div>
20
+          <div class="name">{{projectItem.nickname}}</div>
27 21
           <div class="project-time">
28
-            <span>{{ projectItem.start }}</span>
22
+            <span>{{projectItem.start}}</span>
29 23
             <span>-</span>
30
-            <span>{{ projectItem.end }}</span>
24
+            <span>{{projectItem.end}}</span>
31 25
           </div>
32 26
         </div>
33
-        <!-- 添加订单 -->
34
-        <i
35
-          class="el-icon-plus"
36
-          @click="orderCreate(orderListItem.time)"
37
-          v-if="nowTime < orderListItem.time.end"
38
-        ></i>
39 27
       </div>
40 28
     </div>
41
-    <!-- 侧边图标 -->
42
-    <div class="calendar" @click="openCalendar">
43
-      <i class="el-icon-date"></i>
44
-      <span>日历</span>
45
-    </div>
46
-    <div class="setUp" @click="orderCreate">
47
-      <i class="el-icon-circle-plus-outline"></i>
48
-      <span>创建预约</span>
49
-    </div>
50
-    <div class="backNow">
51
-      <i class="el-icon-refresh-right"></i>
52
-      <span>返回今天</span>
53
-    </div>
54
-    <!-- 日历弹窗 -->
55
-    <calendar-pop :visible.sync="visible"></calendar-pop>
56
-    <!-- 创建订单弹窗 -->
57
-    <create-order :toTime="toTime" :orderShow.sync="orderShow"></create-order>
58 29
   </div>
59 30
 </template>
60 31
 
61 32
 <script>
62
-import api from "@/server/home";
63
-import calendarPop from "../calendarPop/index.vue";
64
-import createOrder from "../createOrder/index.vue";
33
+import api from '@/server/home'
34
+
65 35
 export default {
66
-  components: { calendarPop, createOrder },
67 36
   data() {
68 37
     return {
69 38
       orderList: [],
70 39
       timeList: [],
71 40
       rowHeightList: [],
72 41
       colorStyleList: [
73
-        { orderStatus: [3, 5], color: "#A3A3A3", backgroundColor: "#F0F0F0" },
74
-        { orderStatus: [2], color: "#FA7D22", backgroundColor: "#FEF4ED" },
75
-        { orderStatus: [0, 1], color: "#42D351", backgroundColor: "#F5FCF5" },
42
+        { orderStatus: [3, 5], color: '#A3A3A3', backgroundColor: '#F0F0F0' },
43
+        { orderStatus: [2], color: '#FA7D22', backgroundColor: '#FEF4ED' },
44
+        { orderStatus: [0, 1], color: '#42D351', backgroundColor: '#F5FCF5' },
76 45
       ],
77
-      timer: null,
78
-      visible: false, //控制日历
79
-      orderShow: false, //控制创建订单弹窗
80
-      nowTime: "", //当前小时分钟
81
-      toTime: "", //点击加号创建订单时传过去的时间
46
+      timer: null
82 47
     };
83 48
   },
84
-  created() {
85
-    this.nowTime = `${new Date().getHours()}:${new Date().getMinutes()}`;
86
-    this.fetchOrderList();
49
+  created () {
50
+    this.fetchOrderList()
87 51
     this.timer = setInterval(() => {
88
-      this.fetchOrderList();
89
-    }, 10000);
52
+      this.fetchOrderList()
53
+    }, 10000)
90 54
   },
91
-  mounted() {
55
+  mounted () {
92 56
     if (this.$refs.row) {
93 57
       this.$refs.row.forEach((item) => {
94
-        this.rowHeightList.push(item.clientHeight);
95
-      });
58
+        this.rowHeightList.push(item.clientHeight)
59
+      })
96 60
     }
97 61
   },
98
-  destroyed() {
62
+  destroyed () {
99 63
     if (this.timer) {
100
-      clearInterval(this.timer);
101
-      this.timer = null;
64
+      clearInterval(this.timer)
65
+      this.timer = null
102 66
     }
103 67
   },
104 68
   methods: {
105
-    // 创建订单  打开创建订单弹窗
106
-    orderCreate(e) {
107
-      if (e.end) {
108
-        e.isClick = true;
109
-        this.toTime = e;
110
-      } else {
111
-        e.isClick = false;
112
-        this.toTime = e;
113
-      }
114
-      this.orderShow = true;
115
-    },
116
-    // 打开日历弹窗
117
-    openCalendar() {
118
-      this.visible = true;
119
-    },
120
-    async fetchOrderList() {
121
-      let resp = await api.reservedRecords();
69
+    async fetchOrderList () {
70
+      let resp = await api.reservedRecords()
122 71
       if (resp.code === 200) {
123
-        console.log(resp);
124
-        this.orderList = resp.data;
125
-        console.log(this.orderList);
72
+        this.orderList = resp.data
126 73
       }
127 74
     },
128
-    getStyleByOrderStatus(orderSource) {
129
-      let style = null;
75
+    getStyleByOrderStatus (orderSource) {
76
+      let style = null
130 77
       // 订单状态,0已预约,未支付,1已支付,待使用,2正在使用,3已结算,5已取消
131
-      switch (orderSource.status) {
78
+      switch(orderSource.status) {
132 79
         case 0:
133
-          style = this.colorStyleList[2];
134
-          break;
80
+          style = this.colorStyleList[2]
81
+        break;
135 82
         case 1:
136
-          style = this.colorStyleList[2];
137
-          break;
83
+          style = this.colorStyleList[2]
84
+        break;
138 85
         case 2:
139
-          style = this.colorStyleList[1];
140
-          break;
86
+          style = this.colorStyleList[1]
87
+        break;
141 88
         case 3:
142
-          style = this.colorStyleList[0];
143
-          break;
89
+          style = this.colorStyleList[0]
90
+        break;
144 91
         case 5:
145
-          style = this.colorStyleList[0];
146
-          break;
92
+          style = this.colorStyleList[0]
93
+        break;
147 94
       }
148
-      return style;
95
+      return style
149 96
     },
150
-    toOrderDetail(source) {
97
+    toOrderDetail (source) {
151 98
       if (source.status === 0) {
152
-        this.$router.push({
153
-          path: "/confirmOrder/details",
99
+        this.$router.push({ 
100
+          path: '/confirmOrder/details',
154 101
           query: {
155
-            id: source.order_id,
156
-          },
157
-        });
102
+            id: source.order_id
103
+          } 
104
+        })
158 105
       } else {
159 106
         this.$router.push({
160 107
           path: "/historicalOrder/details",
161 108
           query: {
162
-            id: source.order_id,
163
-          },
164
-        });
109
+            id: source.order_id
110
+          }
111
+        })
165 112
       }
166
-    },
167
-  },
113
+    }
114
+  }
168 115
 };
169 116
 </script>
170 117
 
171 118
 <style lang="less" scoped>
172
-.container {
173
-  width: 100%;
174
-  height: 100%;
175
-  background-color: #ffffff;
176
-  overflow: hidden;
177
-  overflow-y: auto;
178
-  border-radius: 8px;
179
-  position: relative;
180
-  .row {
181
-    display: flex;
182
-    .time,
183
-    .project-wrapper .project {
184
-      width: 77px;
185
-      height: 80px;
119
+  .container {
120
+    width: 100%;
121
+    height: 100%;
122
+    background-color: #FFFFFF;
123
+    overflow: hidden;
124
+    overflow-y: auto;
125
+    border-radius: 8px;
126
+    .row {
186 127
       display: flex;
187
-      flex-direction: column;
188
-      justify-content: center;
189
-      align-items: center;
190
-      font-family: PingFangSC-Medium, PingFang SC;
191
-    }
192
-    .time {
193
-      border-bottom: 2px #f5f5f5 solid;
194
-    }
195
-    .project-wrapper {
196
-      flex: 1;
197
-      display: flex;
198
-      flex-wrap: wrap;
199
-      .project {
200
-        padding: 3px;
201
-        box-sizing: border-box;
202
-        .name {
203
-          width: 100%;
204
-          text-align: center;
205
-          font-size: 14px;
206
-          margin-bottom: 3px;
207
-          overflow: hidden;
208
-          white-space: nowrap;
209
-          text-overflow: ellipsis;
210
-        }
211
-        .project-time {
212
-          display: flex;
213
-          font-size: 10px;
214
-        }
128
+      .time, .project-wrapper .project {
129
+        width: 77px;
130
+        height: 80px;
131
+        display: flex;
132
+        flex-direction: column;
133
+        justify-content: center;
134
+        align-items: center;
135
+        font-family: PingFangSC-Medium, PingFang SC;
215 136
       }
216
-      .el-icon-plus {
217
-        color: #ededed;
218
-        font-size: 32px;
219
-        line-height: 80px;
220
-        margin-left: 29px;
137
+      .time {
138
+        border-bottom: 2px #f5f5f5 solid;
139
+      }
140
+      .project-wrapper {
141
+        flex: 1;
142
+        display: flex;
143
+        flex-wrap: wrap;
144
+        .project {
145
+          padding: 3px;
146
+          box-sizing: border-box;
147
+          .name {
148
+            width: 100%;
149
+            text-align: center;
150
+            font-size: 14px;
151
+            margin-bottom: 3px;
152
+            overflow: hidden;
153
+            white-space: nowrap;
154
+            text-overflow: ellipsis;
155
+          }
156
+          .project-time {
157
+            display: flex;
158
+            font-size: 10px;
159
+          }
160
+        }
221 161
       }
222 162
     }
223 163
   }
224
-  // 侧边图表样式
225
-  .calendar,
226
-  .setUp,
227
-  .backNow {
228
-    position: fixed;
229
-    height: 42px;
230
-    width: 125px;
231
-    border-radius: 100px 0px 0px 100px;
232
-    right: 20px;
233
-    background-color: #fff;
234
-    box-shadow: 0px 0px 4px 0px rgba(228, 228, 228, 0.5);
235
-    line-height: 42px;
236
-    color: #333333;
237
-    font-size: 16px;
238
-    i {
239
-      font-size: 20px;
240
-      margin-left: 15px;
241
-      margin-right: 15px;
242
-    }
243
-  }
244
-  .calendar {
245
-    top: 102px;
246
-    span {
247
-      width: 64px;
248
-      display: inline-block;
249
-      text-align: justify;
250
-      text-justify: distribute-all-lines;
251
-      text-align-last: justify;
252
-    }
253
-  }
254
-  .setUp {
255
-    top: 154px;
256
-  }
257
-  .backNow {
258
-    top: 206px;
259
-  }
260
-}
261 164
 </style>