Browse Source

feat: 配置服务器

黎海 2 years ago
parent
commit
b44f5eed45
9 changed files with 413 additions and 21382 deletions
  1. 42 21207
      package-lock.json
  2. 1 0
      package.json
  3. 18 16
      public/index.html
  4. 216 113
      src/pages/confirmOrder/details/index.vue
  5. 64 4
      src/pages/confirmOrder/index.vue
  6. 6 6
      src/router/index.js
  7. 18 0
      src/server/home.js
  8. 13 1
      src/server/urls.js
  9. 35 35
      vue.config.js

File diff suppressed because it is too large
+ 42 - 21207
package-lock.json


+ 1 - 0
package.json

@@ -15,6 +15,7 @@
15 15
     "crypto-js": "^3.1.9-1",
16 16
     "element-ui": "^2.8.2",
17 17
     "js-cookie": "^3.0.1",
18
+    "qrcodejs2": "0.0.2",
18 19
     "vue": "^2.6.6",
19 20
     "vue-router": "^3.0.1",
20 21
     "vuex": "^3.0.1"

+ 18 - 16
public/index.html

@@ -1,18 +1,20 @@
1 1
 <!DOCTYPE html>
2 2
 <html lang="en">
3
-  <head>
4
-    <meta charset="utf-8">
5
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
-    <title>玖哩仪器操作平台</title>
8
-  </head>
9
-  <body>
10
-    <noscript>
11
-      <strong>您的浏览器版本较低,请升级最新版浏览器</strong>
12
-    </noscript>
13
-    <div id="app"></div>
14
-    <script src="https://ydcommon.51yund.com/vue/axios.min.js"></script>
15
-    <script src="https://ydcommon.51yund.com/vue/yd_collect2.js"></script>
16
-    <!-- built files will be auto injected -->
17
-  </body>
18
-</html>
3
+
4
+<head>
5
+  <meta charset="utf-8">
6
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+  <meta name="viewport" content="width=device-width,initial-scale=1.0">
8
+  <title>玖哩仪器操作平台</title>
9
+</head>
10
+
11
+<body>
12
+  <noscript>
13
+    <strong>您的浏览器版本较低,请升级最新版浏览器</strong>
14
+  </noscript>
15
+  <div id="app"></div>
16
+  <script src="https://ydcommon.51yund.com/vue/axios.min.js"></script>
17
+  <!-- built files will be auto injected -->
18
+</body>
19
+
20
+</html>

+ 216 - 113
src/pages/confirmOrder/details/index.vue

@@ -12,7 +12,8 @@
12 12
         </div>
13 13
       </div>
14 14
       <div class="user-record">
15
-        <div class="fraction">
15
+        <div class="fraction"
16
+             @click="isPore=true">
16 17
           <div class="title">肌肤得分</div>
17 18
           <div class="num">{{userInfo.score}}分</div>
18 19
         </div>
@@ -82,7 +83,7 @@
82 83
       </div>
83 84
       <div class="project">
84 85
         <div class="project-title">
85
-          <div>共<span>{{order_data.project_list.length}}个</span>项目</div>
86
+          <div>共<span>{{order_data.project_list?order_data.project_list.length:0}}个</span>项目</div>
86 87
           <div class="add-project"
87 88
                @click="addProject">添加</div>
88 89
         </div>
@@ -116,21 +117,27 @@
116 117
            v-if="!isChange">
117 118
         <div class="cost-title">
118 119
           <div>预约费用</div>
119
-          <div>¥399</div>
120
+          <div>¥{{reservationPrice}}</div>
120 121
         </div>
121 122
         <div class="cost-coupon-list">
122
-          <div class="coupon">
123
+          <div class="coupon"
124
+               @click="onCoupon">
123 125
             <div class="coupon-tips">
124 126
               <div class="coupon-icon"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/couponIcon.png"
125 127
                      alt=""></div>
126 128
               <div class="coupon-title">优惠卷</div>
127
-              <div class="coupon-tip">已选推荐优惠</div>
129
+              <div class="coupon-tip"
130
+                   v-if="order_data.coupon_list&&order_data.coupon_list.length>0">已选推荐优惠</div>
128 131
             </div>
129 132
             <div class="on-icon">></div>
130 133
           </div>
131
-          <div class="coupon-ps">
132
-            <div>【敏感维稳】多元修护加乘维稳</div>
133
-            <div class="cou-price">-¥100</div>
134
+          <div v-if="order_data.coupon_list&&order_data.coupon_list.length>0">
135
+            <div class="coupon-ps"
136
+                 v-for="item,index in order_data.coupon_list"
137
+                 :key="index">
138
+              <div>{{item.coupon_name}}</div>
139
+              <div class="cou-price">-¥{{price}}</div>
140
+            </div>
134 141
           </div>
135 142
         </div>
136 143
         <div class="over-price">
@@ -147,35 +154,37 @@
147 154
              @click="isCoupun=false"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
148 155
                alt=""></div>
149 156
         <div class="coupon-pupop-title">选择优惠券</div>
150
-        <div class="coupon-lists">
151
-          <div class="coupon-info">
157
+        <ul class="coupon-lists"
158
+            infinite-scroll-distance="10"
159
+            style="overflow:auto"
160
+            v-infinite-scroll="onCoupon">
161
+          <li class="coupon-info"
162
+              v-for="item,index in couponList"
163
+              :key="index">
152 164
             <div class="top">
153
-              <div v-if="false"
154
-                   class="all-free">全免</div>
155
-              <div v-else
156
-                   class="discount">
165
+              <div class="discount">
157 166
                 <div class="price-num"><span class="size">¥</span>10<span class="size">.00</span></div>
158 167
                 <div class="price-tips">满100元可用</div>
159 168
               </div>
160 169
               <div class="coupon-tip">
161
-                <div class="tips-title">仅限指定商品使用</div>
162
-                <div class="tips-ts">有效期至2022.02.07</div>
170
+                <div class="tips-title">{{item.full_price}}</div>
171
+                <div class="tips-ts">有效期至{{item.ex_time}}</div>
163 172
               </div>
164 173
               <div class="choice-icon"><img :src="select"></div>
165 174
             </div>
166 175
             <div class="bottom">
167 176
               <div class="coupon-notes">
168 177
                 <div class="notes-text min-size">
169
-                  <span v-if="!isOver">{{'优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目' |ellipsis(20)}}</span>
170
-                  <span v-else>优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目</span>
178
+                  <span v-if="!isOver">{{item.coupon_desc |ellipsis(20)}}</span>
179
+                  <span v-else>{{item.coupon_desc}}</span>
171 180
                 </div>
172 181
                 <div class="notes-icon"
173 182
                      @click="isOver=!isOver"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/openNotes.png"
174 183
                        alt=""></div>
175 184
               </div>
176 185
             </div>
177
-          </div>
178
-        </div>
186
+          </li>
187
+        </ul>
179 188
       </div>
180 189
     </mine-pupop>
181 190
     <!-- 选择项目 -->
@@ -225,19 +234,45 @@
225 234
         <div class="ts-content">
226 235
           <ul class="ts-table">
227 236
             <li v-for="item,index in tsTableList"
228
-                :key="index">
237
+                :key="index"
238
+                @click="changetsTable(index)"
239
+                :class="tsTableIndex==index?'ts-table-active':''">
229 240
               <div>{{item.text}}</div>
230 241
               <div>{{item.ts}}</div>
231 242
             </li>
232 243
           </ul>
233
-          <ul class="ts-boty">
234
-            <li v-for="item,index in tsBodyList"
235
-                :key="index">
236
-              <div>{{item.ts}}</div>
237
-            </li>
238
-          </ul>
244
+          <div v-if="tsBodyList.day">
245
+            <div class="time-slot">
246
+              <div class="day"
247
+                   @click="changeActive(1)"
248
+                   :style="active==1?'color: #333333;font-weight: 600;':''">{{ tsBodyList.day.name}}</div>
249
+              <div class="night"
250
+                   @click="changeActive(0)"
251
+                   :style="active==0?'color: #333333;font-weight: 600;':''">{{tsBodyList.night.name}}</div>
252
+            </div>
253
+            <ul class="ts-boty"
254
+                v-if="active==1">
255
+              <li v-for="item,index in tsBodyList.day.list"
256
+                  :key="index">
257
+                <div :style="item.status==0?'color: #D3D3D3;':''"
258
+                     @click="selectTime(item)"
259
+                     :class="timeIndexText==item.order_time?'time-active':''">{{item.order_time}}</div>
260
+              </li>
261
+            </ul>
262
+            <ul class="ts-boty"
263
+                v-else>
264
+              <li v-for="item,index in tsBodyList.night.list"
265
+                  :key="index">
266
+                <div :style="item.status==0?'color: #D3D3D3;':''"
267
+                     @click="selectTime(item)"
268
+                     :class="timeIndexText==item.order_time?'time-active':''">{{item.order_time}}</div>
269
+              </li>
270
+            </ul>
271
+          </div>
239 272
         </div>
240
-        <div class="ts-button">确认</div>
273
+        <el-button class="ts-button"
274
+                   :style="this.timeIndexText.length == 0?'background: rgb(211, 211, 211);':''"
275
+                   @click="comfigTs">确认</el-button>
241 276
       </div>
242 277
     </mine-pupop>
243 278
     <!-- 皮肤状态 -->
@@ -253,17 +288,18 @@
253 288
                 :key="index">
254 289
               <div class="pore-top">
255 290
                 <div class="pore-title">
256
-                  <div>RGB毛孔:</div>
257
-                  <div class="pore-medium">粗大毛孔个数{{item.medium}}</div>
291
+                  <div>{{item.name}}</div>
292
+                  <div class="pore-medium"
293
+                       v-if="item.main_item">{{item.main_item.name}}{{item.main_item.num}}</div>
258 294
                 </div>
259 295
                 <div class="pore-over">
260
-                  <div class="min-size">粗大毛孔个数:{{item.medium}}个</div>
261
-                  <div class="min-size">中等毛孔个数:{{item.small}}个</div>
262
-                  <div class="min-size">细小毛孔个数:{{item.mini}}个</div>
296
+                  <div class="min-size"
297
+                       v-for="value,index in item.items"
298
+                       :key="index">{{value.name}}{{value.num}}个</div>
263 299
                 </div>
264 300
               </div>
265 301
               <div class="pore-bottom min-size">
266
-                {{'皮肤状态一般,污物阻塞导致,油脂分泌旺盛,皮肤状态一般,污物阻塞导致,油脂分泌旺盛皮肤状态一般,污物阻塞导致,油脂分泌旺盛,皮肤状态一般,污物阻塞导致,油脂分泌旺盛油脂分泌旺盛油脂分泌旺盛旺…' |ellipsis(85)}}
302
+                {{item.suggest | ellipsis(85)}}
267 303
               </div>
268 304
             </li>
269 305
           </ul>
@@ -295,75 +331,12 @@ export default {
295 331
       //升级包列表
296 332
       productsList: [],
297 333
       //时间列表(头部)
298
-      tsTableList: [
299
-        {
300
-          text: '今天',
301
-          ts: '10-27',
302
-        },
303
-        {
304
-          text: '今天',
305
-          ts: '10-27',
306
-        },
307
-        {
308
-          text: '今天',
309
-          ts: '10-27',
310
-        },
311
-        {
312
-          text: '今天',
313
-          ts: '10-27',
314
-        },
315
-        {
316
-          text: '今天',
317
-          ts: '10-27',
318
-        },
319
-        {
320
-          text: '今天',
321
-          ts: '10-27',
322
-        },
323
-        {
324
-          text: '今天',
325
-          ts: '10-27',
326
-        },
327
-      ],
334
+      tsTableList: [],
335
+      tsTableIndex: 0,
336
+      active: 1,
328 337
       //时间列表(body)
329
-      tsBodyList: [
330
-        {
331
-          id: 0,
332
-          ts: '10:00'
333
-        },
334
-        {
335
-          id: 0,
336
-          ts: '10:00'
337
-        },
338
-        {
339
-          id: 0,
340
-          ts: '10:00'
341
-        },
342
-        {
343
-          id: 0,
344
-          ts: '10:00'
345
-        },
346
-        {
347
-          id: 0,
348
-          ts: '10:00'
349
-        },
350
-        {
351
-          id: 0,
352
-          ts: '10:00'
353
-        },
354
-        {
355
-          id: 0,
356
-          ts: '10:00'
357
-        },
358
-        {
359
-          id: 0,
360
-          ts: '10:00'
361
-        },
362
-        {
363
-          id: 0,
364
-          ts: '10:00'
365
-        },
366
-      ],
338
+      tsBodyList: {
339
+      },
367 340
       //皮肤状态列表
368 341
       poreList: [
369 342
         {
@@ -382,15 +355,12 @@ export default {
382 355
           mini: 242
383 356
         }
384 357
       ],
385
-
386
-      couponList: [
387
-        {
388
-
389
-        }
390
-      ],
358
+      couponList: [],
391 359
       timesInfo: '',
360
+      reservationPrice: 0,//预约费用
392 361
       projectInfo: '',
393 362
       productsInfo: '',
363
+      timeIndexText: "",//当前选择的时间
394 364
       weekInfo: '',
395 365
       programmeIndex: '',
396 366
       remarks: '',
@@ -402,6 +372,8 @@ export default {
402 372
       id: 0,//订单id
403 373
       isChange: false,//项目是否有改变
404 374
       isEditProject: false,//是否编辑项目
375
+      page: 1,
376
+      limit: 10,
405 377
     };
406 378
   },
407 379
   computed: {
@@ -417,6 +389,8 @@ export default {
417 389
         this.remarks = res.data.remark
418 390
         this.programmeList = res.data.scheme_list
419 391
         this.order_data = res.data.order_data
392
+        this.poreList = res.data.detail_list
393
+        this.calculationPrice()
420 394
       })
421 395
     },
422 396
     getProjectList () {
@@ -470,6 +444,7 @@ export default {
470 444
                   e.price = Number(e.price) + Number(item.price)
471 445
                   this.isProject = false
472 446
                   this.isEditProject = false
447
+                  this.calculationPrice()
473 448
                 }
474 449
               })
475 450
             }
@@ -521,14 +496,118 @@ export default {
521 496
         this.order_data.project_list.push(projectInfo)
522 497
         this.isChange = true
523 498
         this.isProject = false
499
+        this.calculationPrice()
500
+      }
501
+    },
502
+    //获取最近七天的时间
503
+    getWeekDate () {
504
+      //获取系统当前时间
505
+      let now = new Date();
506
+      let nowTime = now.getTime();
507
+      let oneDayTime = 24 * 60 * 60 * 1000;
508
+      let tsTableList = []
509
+      for (let i = 0; i < 7; i++) {
510
+        //显示周一
511
+        let ShowTime = nowTime + (i + 1) * oneDayTime;
512
+        //初始化日期时间
513
+        let myDate = new Date(ShowTime);
514
+        let year = myDate.getFullYear();
515
+        let month = myDate.getMonth() + 1;
516
+        let date = myDate.getDate();
517
+        console.log(year + "-" + month + "-" + date)
518
+        let str = "周" + "日一二三四五六".charAt(myDate.getDay());
519
+        let tsTableInfo = {}
520
+        tsTableInfo['text'] = i == 0 ? '今天' : i == 1 ? '明天' : str
521
+        tsTableInfo['ts'] = month + "-" + date
522
+        tsTableInfo['order_day'] = year + "-" + month + "-" + date
523
+        tsTableList.push(tsTableInfo)
524
+        console.log(str)
524 525
       }
526
+      this.tsTableList = tsTableList
525 527
     },
526 528
     //确定订单&支付
527
-    determine () { 
528
-      if (condition) {
529
-        
529
+    determine () {
530
+      if (this.isChange) {
531
+        this.getWeekDate()
532
+        this.getOrderTime()
533
+        this.order_time = ''
534
+        this.tsTableIndex = 0
535
+        this.isTs = true
536
+      } else {
537
+        debugger
538
+      }
539
+    },
540
+    //确定时间选择
541
+    comfigTs () {
542
+      if (this.timeIndexText.length == 0) return
543
+      let order_data = [], order_data_info = {}
544
+      this.order_data.project_list.forEach(item => {
545
+        order_data_info['id'] = item.id
546
+        if (item.product_ids != "") {
547
+          order_data_info['product_id'] = item.product_ids
548
+        }
549
+        order_data.push(order_data_info)
550
+      })
551
+      let params = {
552
+        id: this.id,
553
+        order_data: JSON.stringify(order_data),
554
+        order_day: this.tsTableList[this.tsTableIndex].order_day,
555
+        order_time: this.timeIndexText
530 556
       }
557
+      api.setOrderUpdate(params).then(res => {
558
+        if (res.code == 200) {
559
+          this.getOrderInfo()
560
+          this.isTs = false
561
+          this.isChange = false
562
+        }
563
+      })
564
+      console.log(ids, 'ids');
565
+    },
566
+    //计算预约费用
567
+    calculationPrice () {
568
+      this.order_data.project_list.forEach(res => {
569
+        this.reservationPrice += Number(res.price)
570
+      })
571
+    },
572
+    onCoupon () {
573
+      let params = {
574
+        id: this.id,
575
+        page: this.page,
576
+        limit: this.limit
577
+      }
578
+      api.getOrderCoupon(params).then(res => {
579
+        this.couponList = res.data.list
580
+      })
581
+      this.isCoupun = true
582
+    },
583
+    changeActive (e) {
584
+      console.log(e, 'eeeeeee');
585
+      this.active = e
586
+      console.log(this.active, 'this.active');
531 587
     },
588
+    selectTime (item) {
589
+      if (item.status == 0) return
590
+      this.timeIndexText = item.order_time
591
+    },
592
+    changetsTable (index) {
593
+      this.tsTableIndex = index
594
+      this.getOrderTime()
595
+    },
596
+    getOrderTime () {
597
+      let ids = '', idsList = []
598
+      this.order_data.project_list.forEach(res => {
599
+        idsList.push(res.id)
600
+      })
601
+      ids = idsList.toString()
602
+      let params = {
603
+        ids: ids,
604
+        order_day: this.tsTableList[this.tsTableIndex].order_day
605
+      }
606
+      api.getOrderTime(params).then(res => {
607
+        this.tsBodyList = res.data
608
+      })
609
+    },
610
+
532 611
     onOperation (index) {
533 612
       if (this.programmeList[index].onSelect) {
534 613
         this.$set(this.programmeList[index], 'onSelect', !this.programmeList[index].onSelect)
@@ -1143,7 +1222,7 @@ export default {
1143 1222
   }
1144 1223
   .ts-block {
1145 1224
     width: 540px;
1146
-    height: 400px;
1225
+    height: 420px;
1147 1226
     background: #ffffff;
1148 1227
     border-radius: 8px;
1149 1228
     position: relative;
@@ -1178,15 +1257,32 @@ export default {
1178 1257
         li {
1179 1258
           text-align: center;
1180 1259
         }
1260
+        .ts-table-active {
1261
+          color: #fa7d22;
1262
+          border-bottom: 4px solid #fa4622;
1263
+        }
1264
+      }
1265
+
1266
+      .time-slot {
1267
+        margin-top: 20px;
1268
+        display: flex;
1269
+        justify-content: space-between;
1270
+        font-size: 16px;
1271
+        font-family: PingFangSC-Regular, PingFang SC;
1272
+        font-weight: 400;
1273
+        color: #999999;
1274
+        line-height: 22px;
1181 1275
       }
1182 1276
       .ts-boty {
1183 1277
         margin-top: 10px;
1278
+        margin-left: -19px;
1184 1279
         display: flex;
1185
-        justify-content: space-between;
1280
+        justify-content: unset;
1186 1281
         flex-wrap: wrap;
1187 1282
         li {
1188 1283
           margin-top: 10px;
1189 1284
           width: 68px;
1285
+          margin-left: 19px;
1190 1286
           height: 30px;
1191 1287
           line-height: 30px;
1192 1288
           text-align: center;
@@ -1197,11 +1293,18 @@ export default {
1197 1293
           font-weight: 400;
1198 1294
           color: #333333;
1199 1295
         }
1296
+        .time-active {
1297
+          background: #fff0e6;
1298
+          border: 1px solid #fa7d22;
1299
+          font-weight: 500;
1300
+          color: #fa7d22;
1301
+        }
1200 1302
       }
1201 1303
     }
1202 1304
     .ts-button {
1203 1305
       position: absolute;
1204 1306
       bottom: 42px;
1307
+      padding: 0;
1205 1308
       left: 50%;
1206 1309
       transform: translateX(-50%);
1207 1310
       width: 176px;

+ 64 - 4
src/pages/confirmOrder/index.vue

@@ -1,30 +1,90 @@
1 1
 <template>
2 2
   <div class="mine">
3 3
     <div class="qr-code">
4
-      <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/orderQrCode.png"
5
-           alt="">
4
+      <div id="qrCode"
5
+           ref="qrCodeDiv"></div>
6 6
     </div>
7 7
   </div>
8 8
 </template>
9 9
 
10 10
 <script>
11
+import QRCode from 'qrcodejs2'
12
+import api from '../../server/home'
11 13
 export default {
12 14
   components: {},
13 15
   data () {
14
-    return {};
16
+    return {
17
+      qrcode_string: '',
18
+      ticket: '',
19
+      checkCodeInterval: null,
20
+      checkCodeTimeout: null,
21
+    };
15 22
   },
16 23
   computed: {},
17 24
   watch: {},
18 25
 
19
-  methods: {},
26
+  methods: {
27
+    getAuthCode () {
28
+      api.getAuthCode().then(res => {
29
+        this.qrcode_string = res.data.qrcode_string
30
+        this.ticket = res.data.ticket
31
+        this.$nextTick(() => {
32
+          this.bindQRCode();
33
+          // this.checkCode()
34
+        })
35
+      })
36
+    },
37
+    checkCode () {
38
+      this.checkCodeInterval = setInterval(e => {
39
+        api.checkCode({ ticket: this.ticket }).then(res => {
40
+          if (res.data.status == 1) {
41
+            clearInterval(this.checkCodeInterval)
42
+          }
43
+        })
44
+      }, 1000)
45
+      //十分钟强制清除,防止页面崩溃
46
+      this.checkCodeTimeout = setTimeout(() => {
47
+        clearTimeout(this.checkCodeTimeout)
48
+      }, 600000)
49
+    },
50
+    getOrderByCode () {
51
+      api.getOrderByCode({ ticket: this.ticket }).then(res => {
52
+        if (res.code == 200) {
53
+          this.$router.push({
54
+            path: '/confirmOrder/details',
55
+            query: {
56
+              id: res.order_id
57
+            }
58
+          })
59
+        }
60
+      })
61
+    },
62
+    bindQRCode () {
63
+      new QRCode(this.$refs.qrCodeDiv, {
64
+        text: this.qrcode_string,
65
+        width: 200,
66
+        height: 200,
67
+        colorDark: "#333333", //二维码颜色
68
+        colorLight: "#ffffff", //二维码背景色
69
+        correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H
70
+      })
71
+    }
72
+  },
20 73
 
21 74
   created () {
75
+    this.getAuthCode()
22 76
 
23 77
   },
24 78
 
25 79
   mounted () {
26 80
 
27 81
   },
82
+  destroyed () {
83
+    if (this.checkCodeInterval) {
84
+      clearInterval(this.checkCodeInterval)
85
+      clearTimeout(this.checkCodeTimeout)
86
+    }
87
+  }
28 88
 }
29 89
 
30 90
 </script>

+ 6 - 6
src/router/index.js

@@ -7,10 +7,10 @@ import login from "./map/login";
7 7
 Vue.use(Router)
8 8
 
9 9
 export default new Router({
10
-    mode: 'history',
11
-    base: process.env.BASE_URL,
12
-    routes: [
13
-        home,
14
-        ...login
15
-    ]
10
+  mode: 'hash',
11
+  base: process.env.BASE_URL,
12
+  routes: [
13
+    home,
14
+    ...login
15
+  ]
16 16
 })

+ 18 - 0
src/server/home.js

@@ -42,6 +42,24 @@ export default class Home {
42 42
   static getProducts (parms) {
43 43
     return $http.get(url.getProducts, parms);
44 44
   }
45
+  static getOrderTime (parms) {
46
+    return $http.get(url.getOrderTime, parms);
47
+  }
48
+  static setOrderUpdate (parms) {
49
+    return $http.post(url.setOrderUpdate, parms);
50
+  }
51
+  static getOrderCoupon (parms) {
52
+    return $http.get(url.getOrderCoupon, parms);
53
+  }
54
+  static getAuthCode (parms) {
55
+    return $http.get(url.getAuthCode, parms);
56
+  }
57
+  static checkCode (parms) {
58
+    return $http.get(url.checkCode, parms);
59
+  }
60
+  static getOrderByCode (parms) {
61
+    return $http.get(url.getOrderByCode, parms);
62
+  }
45 63
 
46 64
   // 获取历史订单
47 65
   static getOrderList (parms) {

+ 13 - 1
src/server/urls.js

@@ -20,7 +20,19 @@ export default {
20 20
   //获取项目列表
21 21
   getProjectList: '/v2/pad/project/list',
22 22
   //获取升级包
23
-  getProducts:'/v2/pad/project/product',
23
+  getProducts: '/v2/pad/project/product',
24
+  //获取当天的时间段
25
+  getOrderTime: '/v2/pad/order/order_time',
26
+  //保存、修改订单
27
+  setOrderUpdate: '/v2/pad/order/update',
28
+  //获取订单可用优惠券
29
+  getOrderCoupon: '/v2/pad/order/coupon',
30
+  //获取授权码
31
+  getAuthCode: '/v2/pad/order/get_auth_code',
32
+  //检查是否授权
33
+  checkCode: '/v2/pad/order/check_code',
34
+  //通过授权码获取未支付订单
35
+  getOrderByCode: '/v2/pad/order/get_order_by_code',
24 36
 
25 37
   /**
26 38
    *  by ListKer

+ 35 - 35
vue.config.js

@@ -3,40 +3,40 @@
3 3
 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4 4
 
5 5
 module.exports = {
6
-    publicPath: process.env.env_config === 'prod' ? 'https://ydcommon.51yund.com/' : 
7
-    process.env.env_config === 'test' ? '/vapps/calory/' : '/', 
8
-    // 设置跨域
9
-    crossorigin: 'anonymous',
10
-    /**
11
-       * 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
12
-       *  map文件的作用在于:项目打包后,代码都是经过压缩加密的,如果运行时报错,输出的错误信息无法准确得知是哪里的代码报错。
13
-       *  有了map就可以像未加密的代码一样,准确的输出是哪一行哪一列有错。
14
-       * */
15
-    productionSourceMap: false,
16
-    transpileDependencies: ['swiper', 'dom7'],
17
- 
18
-    // 它支持webPack-dev-server的所有选项
19
-    devServer: {
20
-        host: "0.0.0.0",
21
-        port: 8083, // 端口号
22
-        https: false, // https:{type:Boolean}
23
-        open: true, //配置自动启动浏览器
24
-        proxy: '' // 配置跨域处理
25
-    },
26
-    configureWebpack: {
27
-        externals: {
28
-            'axios': "axios"
29
-        }
30
-        // 这是七牛找不到资源时的紧急处理方法,通过修改hash位数修改编译后的资源文件名
31
-        // output: { 
32
-        //     filename: `js/[name].[hash:6].js`,
33
-        //     chunkFilename: `js/[name].[hash:6].js`
34
-        // },
35
-        // plugins: [
36
-        //     new MiniCssExtractPlugin({
37
-        //         filename: `css/[name].[hash:6].css`,
38
-        //         chunkFilename: `css/[name].[hash:6].css`
39
-        //     })
40
-        // ]
6
+  publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/dist' :
7
+    process.env.env_config === 'test' ? '/vapps/calory/' : '/dist/',
8
+  // 设置跨域
9
+  crossorigin: 'anonymous',
10
+  /**
11
+     * 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
12
+     *  map文件的作用在于:项目打包后,代码都是经过压缩加密的,如果运行时报错,输出的错误信息无法准确得知是哪里的代码报错。
13
+     *  有了map就可以像未加密的代码一样,准确的输出是哪一行哪一列有错。
14
+     * */
15
+  productionSourceMap: false,
16
+  transpileDependencies: ['swiper', 'dom7'],
17
+
18
+  // 它支持webPack-dev-server的所有选项
19
+  devServer: {
20
+    host: "0.0.0.0",
21
+    port: 8083, // 端口号
22
+    https: false, // https:{type:Boolean}
23
+    open: true, //配置自动启动浏览器
24
+    proxy: '' // 配置跨域处理
25
+  },
26
+  configureWebpack: {
27
+    externals: {
28
+      'axios': "axios"
41 29
     }
30
+    // 这是七牛找不到资源时的紧急处理方法,通过修改hash位数修改编译后的资源文件名
31
+    // output: { 
32
+    //     filename: `js/[name].[hash:6].js`,
33
+    //     chunkFilename: `js/[name].[hash:6].js`
34
+    // },
35
+    // plugins: [
36
+    //     new MiniCssExtractPlugin({
37
+    //         filename: `css/[name].[hash:6].css`,
38
+    //         chunkFilename: `css/[name].[hash:6].css`
39
+    //     })
40
+    // ]
41
+  }
42 42
 }