浏览代码

付费用户页面&&预约表页面&&客户管理详情页

yuhao 2 年之前
父节点
当前提交
04bb892eef

+ 14 - 2
src/pages/confirmOrder/details/index.vue

@@ -197,7 +197,7 @@
197 197
           <div v-if="1==1">
198 198
             <div>
199 199
               <div class="coupon-ps"
200
-                   v-for="item,index in isSelectCoup"
200
+                   v-for="item,index in isSelectCoupList"
201 201
                    :key="index">
202 202
                 <div>{{item.coupon_name}}</div>
203 203
                 <div class="cou-price"
@@ -296,7 +296,7 @@
296 296
           </li>
297 297
         </ul>
298 298
         <div class="coupon-confirm"
299
-             @click="isCoupun=false">确认</div>
299
+             @click="isCoupunConfirm">确认</div>
300 300
       </div>
301 301
     </mine-pupop>
302 302
     <!-- 选择项目 -->
@@ -628,6 +628,7 @@ export default {
628 628
       coupSelectType: '',
629 629
       productDiscount: '',
630 630
       isSelectCoup: [], // 选择的优惠券
631
+      isSelectCoupList:[], //选择的优惠券列表
631 632
       // 下面是支付的数据
632 633
       showMoney: 0, // 价值总额
633 634
       discountPrice: 0,//活动后金额
@@ -651,6 +652,17 @@ export default {
651 652
   watch: {},
652 653
 
653 654
   methods: {
655
+        // 选择优惠券确认
656
+    isCoupunConfirm(){
657
+      this.isCoupun = false
658
+      let list = []
659
+      this.isSelectCoup.forEach(item=>{
660
+        if(item.isSelect) {
661
+          list.push(item)
662
+          }
663
+      })
664
+          this.isSelectCoupList = list
665
+    },
654 666
     toHome () {
655 667
       this.$router.replace('/home')
656 668
     },

+ 1 - 0
src/pages/coupon/index.vue

@@ -14,6 +14,7 @@
14 14
         class="coupon-select"
15 15
         v-model="coupon"
16 16
         size="mini"
17
+        filterable
17 18
         placeholder="选择优惠券"
18 19
       >
19 20
         <el-option

+ 113 - 52
src/pages/customerMan/details/index.vue

@@ -172,56 +172,74 @@
172 172
       </div>
173 173
       <div class="right-bottom">
174 174
         <div class="programme">
175
-          <div class="tab">
176
-            <div class="tab-title">执行方案</div>
177
-          </div>
178
-          <div class="programmeList" v-if="programmeList.length > 0">
179
-            <div class="programmeWeek">
180
-              <div
181
-                class="programmeItem"
182
-                v-for="(item, index) in programmeList"
183
-                :key="index"
184
-              >
185
-                <div
186
-                  :class="selectWeek == index ? 'weekItemSelect' : 'weekItem'"
187
-                  @click="weekSelect(index)"
188
-                >
189
-                  {{ item.name }}
175
+          <div class="consume">
176
+            <div class="consume-box">
177
+              <div class="consume-title">总消费</div>
178
+              <div class="consume-content">
179
+                <div class="consume-one">
180
+                  <div class="consume-type">
181
+                    总消费金额:<span class="consume-price">999</span>
182
+                  </div>
183
+                  <div class="consume-type">
184
+                    项目叠加次数:<span class="consume-price">999</span>
185
+                  </div>
186
+                </div>
187
+                <div class="consume-two">
188
+                  <div class="consume-type">
189
+                    总储值金额:<span class="consume-price">999</span>
190
+                  </div>
191
+
192
+                  <div class="consume-type">
193
+                    转化次数:<span class="consume-price">999</span>
194
+                  </div>
190 195
                 </div>
191
-                <div class="weekLine" v-if="index == 3 ? false : true"></div>
192 196
               </div>
193 197
             </div>
194
-            <div class="doTime">{{ programmeList[selectWeek].time }}</div>
195
-            <div class="weekDetails" v-if="programmeList.length > 0">
196
-              <div
197
-                class="contentItem"
198
-                v-for="(item, index1) in programmeList[selectWeek].list"
199
-                :key="index1"
200
-              >
201
-                <div class="itemTitle">
202
-                  <div>{{ item.name }}</div>
203
-                  <div>{{ item.classify_name }}</div>
204
-                  <!-- <div>{{item.time}}</div> -->
198
+            <div class="consume-title">最近消费记录</div>
199
+            <div class="consume-record">
200
+              <div class="record-item">
201
+                <div class="record-title">项目</div>
202
+                :
203
+                <div class="record-name">
204
+                  【进店必做】寡肽小气泡温和清洁拔出黑头…
205 205
                 </div>
206
-                <div
207
-                  class="itemContent"
208
-                  v-for="(items, index2) in item.list"
209
-                  :key="index2"
210
-                >
211
-                  <img class="itemContent-img" :src="items.cover_url" />
212
-                  <div class="itemContent-right">
213
-                    <div class="right-content">
214
-                      <div class="right-name">
215
-                        {{ items.name | ellipsis(14) }}
216
-                      </div>
217
-                      <div class="right-price">
218
-                        {{ items.price | doubleNum(2) }}
219
-                      </div>
220
-                    </div>
221
-                    <div class="right-project">{{ items.product_name }}</div>
222
-                  </div>
206
+                <div>2022.10.13 12:12</div>
207
+              </div>
208
+              <div class="record-item">
209
+                <div class="record-title">次卡</div>
210
+                :
211
+                <div class="record-name">
212
+                  【进店必做】寡肽小气泡温和清洁拔出黑头…
213
+                </div>
214
+                <div>2022.10.13 12:12</div>
215
+              </div>
216
+              <div class="record-item">
217
+                <div class="record-title">美妆产品</div>
218
+                :
219
+                <div class="record-name">
220
+                  【进店必做】寡肽小气泡温和清洁拔出黑头…
221
+                </div>
222
+                <div>2022.10.13 12:12</div>
223
+              </div>
224
+              <div class="record-item">
225
+                <div class="record-title">充值</div>
226
+                :
227
+                <div class="record-name">
228
+                  【进店必做】寡肽小气泡温和清洁拔出黑头…
223 229
                 </div>
230
+                <div>2022.10.13 12:12</div>
231
+              </div>
232
+            </div>
233
+            <div class="consume-title">最近消耗</div>
234
+            <div class="card-record">
235
+                          <div class="record-item">
236
+              <div class="record-title">消耗次卡</div>
237
+              :
238
+              <div class="record-name">
239
+                【进店必做】寡肽小气泡温和清洁拔出黑头…
224 240
               </div>
241
+              <div>2022.10.13 12:12</div>
242
+            </div>
225 243
             </div>
226 244
           </div>
227 245
         </div>
@@ -377,8 +395,8 @@ export default {
377 395
         activeName = "third";
378 396
       } else if (index == 2) {
379 397
         activeName = "second";
380
-      }else if(index==4){
381
-        activeName = 'fourth'
398
+      } else if (index == 4) {
399
+        activeName = "fourth";
382 400
       }
383 401
       this.$router.push({
384 402
         path: "/customerMan/projectOrder",
@@ -874,17 +892,60 @@ export default {
874 892
             color: #ffc630;
875 893
           }
876 894
         }
877
-        .tab {
878
-          display: flex;
879
-          align-items: center;
880
-          justify-content: space-between;
881
-          .tab-title {
895
+        .consume {
896
+          .consume-box {
897
+            display: flex;
898
+          }
899
+          .consume-title {
882 900
             font-size: 14px;
883 901
             font-family: PingFangSC-Medium, PingFang SC;
884
-            font-weight: 500;
902
+            font-weight: 700;
885 903
             color: #333333;
886 904
             line-height: 20px;
887 905
           }
906
+          .consume-content {
907
+            display: flex;
908
+            justify-content: space-between;
909
+            flex-wrap: wrap;
910
+            .consume-two {
911
+              margin-left: 90px;
912
+            }
913
+            .consume-type {
914
+              line-height: 25px;
915
+              width: 160px;
916
+              font-size: 13px;
917
+              color: #999999;
918
+              margin-left: 20px;
919
+            }
920
+            .consume-price {
921
+              font-size: 13px;
922
+              color: #333333;
923
+              margin-left: 14px;
924
+            }
925
+          }
926
+          .consume-record,.card-record {
927
+            .record-item {
928
+              display: flex;
929
+              font-size: 13px;
930
+              color: #666666;
931
+              margin-top: 15px;
932
+              .record-title {
933
+                width: 65px;
934
+                text-align: justify;
935
+                text-justify: distribute-all-lines;
936
+                text-align-last: justify;
937
+              }
938
+              .record-name {
939
+                color: #333333;
940
+                width: 260px;
941
+                margin-left: 36px;
942
+                margin-right: 36px;
943
+              }
944
+            }
945
+            .record-item:last-child {
946
+              margin-bottom: 15px;
947
+            }
948
+          }
888 949
         }
889 950
         .programme-list {
890 951
           margin-top: 10px;

+ 10 - 0
src/pages/customerMan/index.vue

@@ -13,6 +13,7 @@
13 13
           v-model="silence"
14 14
           active-color="#fa7d22"
15 15
           inactive-color="#e7e7e7"
16
+          @change="showSilence"
16 17
         >
17 18
         </el-switch>
18 19
       </div>
@@ -22,6 +23,7 @@
22 23
           v-model="face"
23 24
           active-color="#fa7d22"
24 25
           inactive-color="#e7e7e7"
26
+          @change="showFace"
25 27
         >
26 28
         </el-switch>
27 29
       </div>
@@ -110,6 +112,14 @@ export default {
110 112
   watch: {},
111 113
 
112 114
   methods: {
115
+    // 筛选沉默用户
116
+    showSilence(e){
117
+      console.log(e);
118
+    },
119
+    // 筛选未面诊用户
120
+    showFace(e){
121
+      console.log(e);
122
+    },
113 123
     // 打开筛选条件弹框
114 124
     openFilterPop() {
115 125
       this.dialogVisible = true;

+ 24 - 6
src/pages/customerMan/selectPop/index.vue

@@ -2,8 +2,9 @@
2 2
   <div>
3 3
     <div class="filterPop">
4 4
       <el-dialog
5
+      top="130px"
5 6
         :visible.sync="visible"
6
-        width="48.5%"
7
+        width="52.5%"
7 8
         :close-on-click-modal="false"
8 9
       >
9 10
         <span slot="title" class="slot-title">
@@ -171,10 +172,19 @@ export default {
171 172
   },
172 173
   methods: {
173 174
     // 重置筛选条件
174
-    reset() {},
175
+    reset() {
176
+      // 重置data里的值
177
+      Object.assign(this.$data, this.$options.data.call(this))
178
+    },
175 179
     // 保存筛选条件
176 180
     save() {
177
-      console.log(this.conditionList);
181
+      let selectList = []
182
+      selectList.push(this.conditionList.customerKey)
183
+      selectList.push(this.conditionList.couponKey)
184
+      selectList.push(this.conditionList.cardKey)
185
+      selectList.push(this.conditionList.latelyKey)
186
+      console.log(selectList);
187
+      this.$emit("update:visible", false);
178 188
     },
179 189
     // 关闭弹窗
180 190
     closeFilterPop() {
@@ -198,6 +208,12 @@ export default {
198 208
       this.$set(this.conditionList, "latelyKey", item);
199 209
     },
200 210
   },
211
+  watch:{
212
+    visible(newValue,oldValue){
213
+      // 关闭打开弹框重置数据
214
+      this.reset()
215
+    }
216
+  }
201 217
 };
202 218
 </script>
203 219
 
@@ -213,7 +229,7 @@ export default {
213 229
       font-size: 24px;
214 230
       color: #666666;
215 231
       margin-left: 22px;
216
-      margin-right: 165px;
232
+      margin-right: 175px;
217 233
     }
218 234
   }
219 235
   // 筛选条件
@@ -353,7 +369,8 @@ export default {
353 369
   }
354 370
   /deep/.el-dialog {
355 371
     border-radius: 8px;
356
-    height: 400px;
372
+    height: 500px;
373
+    margin-left: 300px;
357 374
     position: relative;
358 375
   }
359 376
   /deep/.el-dialog__header {
@@ -365,11 +382,12 @@ export default {
365 382
   }
366 383
   /deep/.el-dialog__body {
367 384
     overflow: hidden;
368
-    height: 250px;
385
+    height: 350px;
369 386
     padding-left: 38px;
370 387
     padding-top: 0;
371 388
     color: #333;
372 389
     overflow-y: auto; // 设置滚动条
390
+    padding-bottom: 60px;
373 391
   }
374 392
   .slot-footer {
375 393
     padding: 0;

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

@@ -0,0 +1,147 @@
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>

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

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

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

@@ -1,164 +1,261 @@
1 1
 <template>
2 2
   <div class="container">
3
-    <div class="row" ref="row" v-for="(orderListItem, index) in orderList" :key="index">
3
+    <div
4
+      class="row"
5
+      ref="row"
6
+      v-for="(orderListItem, index) in orderList"
7
+      :key="index"
8
+    >
4 9
       <div class="time" :style="{ height: `${rowHeightList[index]}px` }">
5
-        <span>{{orderListItem.time.start}}</span>
10
+        <span>{{ orderListItem.time.start }}</span>
6 11
         <span>-</span>
7
-        <span>{{orderListItem.time.end}}</span>
12
+        <span>{{ orderListItem.time.end }}</span>
8 13
       </div>
9 14
       <div class="project-wrapper">
10
-        <div class="project"
11
-          v-for="(projectItem, index) in orderListItem.list" 
15
+        <div
16
+          class="project"
17
+          v-for="(projectItem, index) in orderListItem.list"
12 18
           :key="index"
13 19
           @click="toOrderDetail(projectItem)"
14 20
           :style="{
15 21
             color: getStyleByOrderStatus(projectItem).color,
16 22
             borderLeft: '1px solid',
17
-            backgroundColor: getStyleByOrderStatus(projectItem).backgroundColor
23
+            backgroundColor: getStyleByOrderStatus(projectItem).backgroundColor,
18 24
           }"
19 25
         >
20
-          <div class="name">{{projectItem.nickname}}</div>
26
+          <div class="name">{{ projectItem.nickname }}</div>
21 27
           <div class="project-time">
22
-            <span>{{projectItem.start}}</span>
28
+            <span>{{ projectItem.start }}</span>
23 29
             <span>-</span>
24
-            <span>{{projectItem.end}}</span>
30
+            <span>{{ projectItem.end }}</span>
25 31
           </div>
26 32
         </div>
33
+        <!-- 添加订单 -->
34
+        <i
35
+          class="el-icon-plus"
36
+          @click="orderCreate(orderListItem.time)"
37
+          v-if="nowTime < orderListItem.time.end"
38
+        ></i>
27 39
       </div>
28 40
     </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>
29 58
   </div>
30 59
 </template>
31 60
 
32 61
 <script>
33
-import api from '@/server/home'
34
-
62
+import api from "@/server/home";
63
+import calendarPop from "../calendarPop/index.vue";
64
+import createOrder from "../createOrder/index.vue";
35 65
 export default {
66
+  components: { calendarPop, createOrder },
36 67
   data() {
37 68
     return {
38 69
       orderList: [],
39 70
       timeList: [],
40 71
       rowHeightList: [],
41 72
       colorStyleList: [
42
-        { orderStatus: [3, 5], color: '#A3A3A3', backgroundColor: '#F0F0F0' },
43
-        { orderStatus: [2], color: '#FA7D22', backgroundColor: '#FEF4ED' },
44
-        { orderStatus: [0, 1], color: '#42D351', backgroundColor: '#F5FCF5' },
73
+        { orderStatus: [3, 5], color: "#A3A3A3", backgroundColor: "#F0F0F0" },
74
+        { orderStatus: [2], color: "#FA7D22", backgroundColor: "#FEF4ED" },
75
+        { orderStatus: [0, 1], color: "#42D351", backgroundColor: "#F5FCF5" },
45 76
       ],
46
-      timer: null
77
+      timer: null,
78
+      visible: false, //控制日历
79
+      orderShow: false, //控制创建订单弹窗
80
+      nowTime: "", //当前小时分钟
81
+      toTime: "", //点击加号创建订单时传过去的时间
47 82
     };
48 83
   },
49
-  created () {
50
-    this.fetchOrderList()
84
+  created() {
85
+    this.nowTime = `${new Date().getHours()}:${new Date().getMinutes()}`;
86
+    this.fetchOrderList();
51 87
     this.timer = setInterval(() => {
52
-      this.fetchOrderList()
53
-    }, 10000)
88
+      this.fetchOrderList();
89
+    }, 10000);
54 90
   },
55
-  mounted () {
91
+  mounted() {
56 92
     if (this.$refs.row) {
57 93
       this.$refs.row.forEach((item) => {
58
-        this.rowHeightList.push(item.clientHeight)
59
-      })
94
+        this.rowHeightList.push(item.clientHeight);
95
+      });
60 96
     }
61 97
   },
62
-  destroyed () {
98
+  destroyed() {
63 99
     if (this.timer) {
64
-      clearInterval(this.timer)
65
-      this.timer = null
100
+      clearInterval(this.timer);
101
+      this.timer = null;
66 102
     }
67 103
   },
68 104
   methods: {
69
-    async fetchOrderList () {
70
-      let resp = await api.reservedRecords()
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();
71 122
       if (resp.code === 200) {
72
-        this.orderList = resp.data
123
+        console.log(resp);
124
+        this.orderList = resp.data;
125
+        console.log(this.orderList);
73 126
       }
74 127
     },
75
-    getStyleByOrderStatus (orderSource) {
76
-      let style = null
128
+    getStyleByOrderStatus(orderSource) {
129
+      let style = null;
77 130
       // 订单状态,0已预约,未支付,1已支付,待使用,2正在使用,3已结算,5已取消
78
-      switch(orderSource.status) {
131
+      switch (orderSource.status) {
79 132
         case 0:
80
-          style = this.colorStyleList[2]
81
-        break;
133
+          style = this.colorStyleList[2];
134
+          break;
82 135
         case 1:
83
-          style = this.colorStyleList[2]
84
-        break;
136
+          style = this.colorStyleList[2];
137
+          break;
85 138
         case 2:
86
-          style = this.colorStyleList[1]
87
-        break;
139
+          style = this.colorStyleList[1];
140
+          break;
88 141
         case 3:
89
-          style = this.colorStyleList[0]
90
-        break;
142
+          style = this.colorStyleList[0];
143
+          break;
91 144
         case 5:
92
-          style = this.colorStyleList[0]
93
-        break;
145
+          style = this.colorStyleList[0];
146
+          break;
94 147
       }
95
-      return style
148
+      return style;
96 149
     },
97
-    toOrderDetail (source) {
150
+    toOrderDetail(source) {
98 151
       if (source.status === 0) {
99
-        this.$router.push({ 
100
-          path: '/confirmOrder/details',
152
+        this.$router.push({
153
+          path: "/confirmOrder/details",
101 154
           query: {
102
-            id: source.order_id
103
-          } 
104
-        })
155
+            id: source.order_id,
156
+          },
157
+        });
105 158
       } else {
106 159
         this.$router.push({
107 160
           path: "/historicalOrder/details",
108 161
           query: {
109
-            id: source.order_id
110
-          }
111
-        })
162
+            id: source.order_id,
163
+          },
164
+        });
112 165
       }
113
-    }
114
-  }
166
+    },
167
+  },
115 168
 };
116 169
 </script>
117 170
 
118 171
 <style lang="less" scoped>
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 {
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;
127 186
       display: flex;
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;
136
-      }
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
-          }
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;
160 214
         }
161 215
       }
216
+      .el-icon-plus {
217
+        color: #ededed;
218
+        font-size: 32px;
219
+        line-height: 80px;
220
+        margin-left: 29px;
221
+      }
162 222
     }
163 223
   }
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
+}
164 261
 </style>

+ 4 - 4
vue.config.js

@@ -4,11 +4,11 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4 4
 
5 5
 module.exports = {
6 6
   // 测试
7
-  // publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/test_pad/dist' :
8
-  //   process.env.env_config === 'test' ? '/vapps/calory/' : '/dist/',
9
-  // 正式
10
-  publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/dist' :
7
+  publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/test_pad/dist' :
11 8
     process.env.env_config === 'test' ? '/vapps/calory/' : '/dist/',
9
+  // 正式
10
+  // publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/dist' :
11
+  //   process.env.env_config === 'test' ? '/vapps/calory/' : '/dist/',
12 12
   // 设置跨域
13 13
   crossorigin: 'anonymous',
14 14
   /**