yuantianjiao преди 6 години
родител
ревизия
8ec8dcf0ee

+ 5
- 2
src/components/myCard/myCard.vue Целия файл

1
 <template>
1
 <template>
2
   <div class="card-content flex-l" :class="{invalid: data.invalid || isgrey}">
2
   <div class="card-content flex-l" :class="{invalid: data.invalid || isgrey}">
3
-    <div class="card-top flex-h">
3
+    <div class="card-top flex-h" @click="detail">
4
       <div>
4
       <div>
5
         <img :src="logo" class="logo">
5
         <img :src="logo" class="logo">
6
         <span>¥ <span> {{data.price}} </span> 元</span>
6
         <span>¥ <span> {{data.price}} </span> 元</span>
12
         <span>{{data.startDate}}-{{data.endDate}}</span>
12
         <span>{{data.startDate}}-{{data.endDate}}</span>
13
       </div>
13
       </div>
14
     </div>
14
     </div>
15
-    <div class="card-main flex-h">
15
+    <div class="card-main flex-h" @click="detail">
16
       <img :src="line">
16
       <img :src="line">
17
       <div class="flex-h">
17
       <div class="flex-h">
18
         <span>总数量</span>
18
         <span>总数量</span>
73
           this.$emit('share', this.data)
73
           this.$emit('share', this.data)
74
         }
74
         }
75
       }
75
       }
76
+    },
77
+    detail () {
78
+      this.$emit('detail', this.data)
76
     }
79
     }
77
   }
80
   }
78
 }
81
 }

+ 5
- 2
src/pages/sales/cardAndCouponNum/index.vue Целия файл

1
 <template>
1
 <template>
2
-  <div class="mainPage flex-v" v-if="data">
2
+  <div class="mainPage flex-v" v-if="showPage">
3
     <div class="top flex-h">
3
     <div class="top flex-h">
4
       <span>¥<em>{{parseInt(data.Price)}}</em>元</span>
4
       <span>¥<em>{{parseInt(data.Price)}}</em>元</span>
5
       <div class="flex-item">
5
       <div class="flex-item">
72
   name: '',
72
   name: '',
73
   data () {
73
   data () {
74
     return {
74
     return {
75
-      data: {}
75
+      data: {},
76
+      showPage: false
76
     }
77
     }
77
   },
78
   },
78
   created () {
79
   created () {
81
         this.getSales({ type: 'sales' }).then(() => {
82
         this.getSales({ type: 'sales' }).then(() => {
82
           this.data = this.cardAndCoupon
83
           this.data = this.cardAndCoupon
83
           this.data.CustomerCard = this.data.CustomerCard || []
84
           this.data.CustomerCard = this.data.CustomerCard || []
85
+          this.showPage = true
84
         })
86
         })
85
       })
87
       })
86
     } else {
88
     } else {
88
         this.getSales({ type: 'sales' }).then(() => {
90
         this.getSales({ type: 'sales' }).then(() => {
89
           this.data = this.cardAndCoupon
91
           this.data = this.cardAndCoupon
90
           this.data.CustomerCard = this.data.CustomerCoupon || []
92
           this.data.CustomerCard = this.data.CustomerCoupon || []
93
+          this.showPage = true
91
         })
94
         })
92
       })
95
       })
93
     }
96
     }

+ 1
- 1
src/pages/sales/customerSearch/index.vue Целия файл

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName"></topCaseInfo>
5
     </div>
5
     </div>
6
     <div class="content flex-item">
6
     <div class="content flex-item">
7
       <div>
7
       <div>

+ 1
- 1
src/pages/sales/getRecord/index.vue Целия файл

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showSelect = true"></topCaseInfo>
5
     </div>
5
     </div>
6
     <div class="info">
6
     <div class="info">
7
       <span><em>姓名:</em>{{user.name}}</span>
7
       <span><em>姓名:</em>{{user.name}}</span>

+ 1
- 1
src/pages/sales/login/index.vue Целия файл

8
 
8
 
9
           <div class="mobile">
9
           <div class="mobile">
10
             <i class="iconfont icon-dianhua"></i>
10
             <i class="iconfont icon-dianhua"></i>
11
-            <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
11
+            <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
12
           </div>
12
           </div>
13
 
13
 
14
           <div class="sms" style="margin-top:.2rem;">
14
           <div class="sms" style="margin-top:.2rem;">

+ 3
- 3
src/pages/sales/salesGiveOutDetail/index.vue Целия файл

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showVanPicker"></topCaseInfo>
5
     </div>
5
     </div>
6
     <div class="flex-item flex-v body" v-if="data.allCard">
6
     <div class="flex-item flex-v body" v-if="data.allCard">
7
       <span>销售姓名:<em>{{data.RealName}}</em></span>
7
       <span>销售姓名:<em>{{data.RealName}}</em></span>
37
             </li>
37
             </li>
38
             <li :hidden="activeIndex === 0">
38
             <li :hidden="activeIndex === 0">
39
               <ul class="list">
39
               <ul class="list">
40
-                <router-link tag="li" class="flex-h" v-for="(item,index) in data.allCard" :key="index" :to="{name: 'cardAndCouponNum', query: { id: item.CardId || item.CouponId, type:item.CardId ? 'card' : 'coupon' }}">
40
+                <li class="flex-h" v-for="(item,index) in data.allCard" :key="index" >
41
                   <div class="flex-item">
41
                   <div class="flex-item">
42
                     <div>
42
                     <div>
43
                       <span>{{item.CustomerCardName || item.CustomerCouponName}}</span>
43
                       <span>{{item.CustomerCardName || item.CustomerCouponName}}</span>
49
                     </div>
49
                     </div>
50
                   </div>
50
                   </div>
51
                   <span>{{toolClass.dateFormat(item.ReceiveDate, 'yyyy/MM/dd hh:mm')}}</span>
51
                   <span>{{toolClass.dateFormat(item.ReceiveDate, 'yyyy/MM/dd hh:mm')}}</span>
52
-                </router-link>
52
+                </li>
53
               </ul>
53
               </ul>
54
             </li>
54
             </li>
55
           </ul>
55
           </ul>

+ 1
- 1
src/pages/sales/salesRecord/index.vue Целия файл

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showVanPicker"></topCaseInfo>
5
     </div>
5
     </div>
6
     <div class="flex-item body">
6
     <div class="flex-item body">
7
       <div>
7
       <div>

+ 1
- 1
src/pages/user/bindMobile/bindMobile.vue Целия файл

7
 
7
 
8
         <div class="mobile">
8
         <div class="mobile">
9
           <i class="iconfont icon-dianhua"></i>
9
           <i class="iconfont icon-dianhua"></i>
10
-          <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
10
+          <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
11
         </div>
11
         </div>
12
 
12
 
13
         <div class="recommend">
13
         <div class="recommend">

+ 8
- 8
src/pages/user/card/index.vue Целия файл

122
     this.getCardList().then((res) => {
122
     this.getCardList().then((res) => {
123
       if (res) {
123
       if (res) {
124
         for (var n = 0; n < res.length; n++) {
124
         for (var n = 0; n < res.length; n++) {
125
-          let useType
125
+          let useType = '已使用'
126
           let nowDate = new Date().valueOf()
126
           let nowDate = new Date().valueOf()
127
           let endDate = new Date(res[n].EndDate).valueOf()
127
           let endDate = new Date(res[n].EndDate).valueOf()
128
-          if (res[n].Status === 2) {
129
-            useType = '已使用'
130
-          } else if (res[n].Status === 1 && nowDate > endDate) {
131
-            useType = '已失效'
132
-          } else {
133
-            useType = '未使用'
134
-          }
128
+          // if (res[n].Status === 2) {
129
+          //   useType = '已使用'
130
+          // } else if (res[n].Status === 1 && nowDate > endDate) {
131
+          //   useType = '已失效'
132
+          // } else {
133
+          //   useType = '未使用'
134
+          // }
135
           this.data[0].list.push({
135
           this.data[0].list.push({
136
             title: res[n].CustomerCardName,
136
             title: res[n].CustomerCardName,
137
             desc: res[n].Share.CardUseRule,
137
             desc: res[n].Share.CardUseRule,

+ 1
- 1
src/pages/user/cardDetail/index.vue Целия файл

14
       </div>
14
       </div>
15
       <div class="rule">
15
       <div class="rule">
16
         <div>使用规则</div>
16
         <div>使用规则</div>
17
-        <pre style="white-space: pre;">{{info.Share.CardUseInstruction}}</pre>
17
+        <pre style="white-space: pre-wrap;word-wrap: break-word;">{{info.Share.CardUseInstruction}}</pre>
18
       </div>
18
       </div>
19
       <div class="line">
19
       <div class="line">
20
         <img :src="Artboard" alt="" width="100%">
20
         <img :src="Artboard" alt="" width="100%">

+ 1
- 1
src/pages/user/coupons/index.vue Целия файл

60
           }
60
           }
61
           this.list.push({
61
           this.list.push({
62
             title: res[n].Coupon.CouponName,
62
             title: res[n].Coupon.CouponName,
63
-            desc: res[n].Coupon.Share.UseInstruction,
63
+            desc: res[n].Coupon.Share.CouponShareInfo,
64
             time: this.toolClass.dateFormat(res[n].EndDate),
64
             time: this.toolClass.dateFormat(res[n].EndDate),
65
             useType: useType,
65
             useType: useType,
66
             tag: res[n].Coupon.CouponType === 'course' ? '课程' : '商品',
66
             tag: res[n].Coupon.CouponType === 'course' ? '课程' : '商品',

+ 1
- 1
src/pages/user/couponsDetail/index.vue Целия файл

13
       </div>
13
       </div>
14
       <div class="rule">
14
       <div class="rule">
15
         <div>使用规则</div>
15
         <div>使用规则</div>
16
-        <pre style="white-space: pre;">{{info.Share.UseInstruction}}</pre>
16
+        <pre style="white-space: pre-wrap;word-wrap: break-word;">{{info.Share.UseInstruction}}</pre>
17
         <!-- <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
17
         <!-- <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
18
         <div>2. 此卡不可多人使用,一人记一次。 </div>
18
         <div>2. 此卡不可多人使用,一人记一次。 </div>
19
         <div>3. 非会员可凭此卡享受对应课程。 </div>
19
         <div>3. 非会员可凭此卡享受对应课程。 </div>

+ 1
- 1
src/pages/user/fiveA/index.vue Целия файл

125
       if (item.ForwardType === 'url') {
125
       if (item.ForwardType === 'url') {
126
         window.location.href = item.ForwardUrl
126
         window.location.href = item.ForwardUrl
127
       } else if (item.ForwardType === 'course') {
127
       } else if (item.ForwardType === 'course') {
128
-        this.$router.push({ name: '', query: { id: item.ForwardResourceId } }) // 此处去课程详情
128
+        this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
129
       } else {
129
       } else {
130
         window.location.href = item.InfoUrl
130
         window.location.href = item.InfoUrl
131
       }
131
       }

+ 13
- 6
src/pages/user/lessonOrder/index.vue Целия файл

2
   <div class="mainPage">
2
   <div class="mainPage">
3
     <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='courseOrderList.list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
3
     <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='courseOrderList.list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
4
       <div class="box">
4
       <div class="box">
5
-        <div class="order-card flex-h" v-for="(item,index) in courseOrderList.list" :key='index' :class="{'opacity' : item.IsDone === 1}" @click="toDetail(item)">
5
+        <div class="order-card flex-h" v-for="(item,index) in courseOrderList.list" :key='index' :class="{'opacity' : item.IsDone === 1 || (item.IsDone === 0 && now > time(item.EndDate)) }" @click="toDetail(item)">
6
           <div class="card-pic">
6
           <div class="card-pic">
7
-            <div :class="{'gray-location' : item.status === 1}"><span>{{returnLocationName(item.LocationId)}}</span></div>
7
+            <div :class="{'gray-location' : item.IsDone === 1 || (item.IsDone === 0 && now > time(item.EndDate)) }"><span>{{returnLocationName(item.LocationId)}}</span></div>
8
             <img :src="item.CourseImg" class="cover" width="100%" height="100%" alt="">
8
             <img :src="item.CourseImg" class="cover" width="100%" height="100%" alt="">
9
           </div>
9
           </div>
10
           <div class="card-msg">
10
           <div class="card-msg">
16
           </div>
16
           </div>
17
           <div class="card-price">
17
           <div class="card-price">
18
             <div class="price" style="white-space: nowrap;">¥ {{item.Price}}</div>
18
             <div class="price" style="white-space: nowrap;">¥ {{item.Price}}</div>
19
-            <div class="type" :class="{'un-use' : item.IsDone === 0}">{{item.IsDone === 0 ? '未使用' : '已使用'}}</div>
19
+            <div class="type un-use" v-if="item.IsDone === 0 && now < time(item.EndDate)">未使用</div>
20
+            <div class="type" v-if="item.IsDone === 1">已使用</div>
21
+            <div class="type" v-if="item.IsDone === 0 && now > time(item.EndDate)">已失效</div>
20
           </div>
22
           </div>
21
         </div>
23
         </div>
22
         <noMore v-if="noData"></noMore>
24
         <noMore v-if="noData"></noMore>
43
       page: 1,
45
       page: 1,
44
       isloading: true,
46
       isloading: true,
45
       hasMore: true,
47
       hasMore: true,
46
-      list: []
48
+      list: [],
49
+      now: ''
47
     }
50
     }
48
   },
51
   },
49
   components: {
52
   components: {
51
     noMore
54
     noMore
52
   },
55
   },
53
   created () {
56
   created () {
57
+    this.now = Date.now()
54
     var _that = this
58
     var _that = this
55
     this.getCourseLocationList().then((res) => {
59
     this.getCourseLocationList().then((res) => {
56
       // console.log(JSON.stringify(res))
60
       // console.log(JSON.stringify(res))
57
       this.getCourseOrderList({ page: this.page }).then((res) => {
61
       this.getCourseOrderList({ page: this.page }).then((res) => {
58
         // console.log(JSON.stringify(res))
62
         // console.log(JSON.stringify(res))
59
-        if(res.list === null){
63
+        if (res.list === null) {
60
           this.noData = true
64
           this.noData = true
61
         }
65
         }
62
       })
66
       })
111
       }
115
       }
112
     },
116
     },
113
     toDetail (item) {
117
     toDetail (item) {
114
-      this.$router.push({ name: 'lessonDetail', query: {id: item.CustomerCourseId} })
118
+      this.$router.push({ name: 'lessonDetail', query: { id: item.CustomerCourseId } })
119
+    },
120
+    time (time) {
121
+      return new Date(time).getTime()
115
     }
122
     }
116
   }
123
   }
117
 }
124
 }

+ 21
- 3
src/pages/user/mainPage/coffeeIndex/index.vue Целия файл

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
5
     </div>
5
     </div>
6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
7
       <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" v-if="userInfo.customer.UserTypeId !== 'manager' || item.id !== '4'" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
7
       <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" v-if="userInfo.customer.UserTypeId !== 'manager' || item.id !== '4'" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
59
                   </div>
59
                   </div>
60
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
60
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
61
                 </div>
61
                 </div>
62
-                <myCard v-for="(item,index) in data[1].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCard'></myCard>
62
+                <myCard v-for="(item,index) in data[1].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCard' @detail='toCardNumDetail'></myCard>
63
                 <noMore v-if="data[1].hasPic"></noMore>
63
                 <noMore v-if="data[1].hasPic"></noMore>
64
               </div>
64
               </div>
65
             </li>
65
             </li>
74
                   </div>
74
                   </div>
75
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
75
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
76
                 </div>
76
                 </div>
77
-                <myCard v-for="(item,index) in data[2].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCoupon'></myCard>
77
+                <myCard v-for="(item,index) in data[2].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCoupon' @detail='toCouponNumDetail'></myCard>
78
                 <noMore v-if="data[2].hasPic"></noMore>
78
                 <noMore v-if="data[2].hasPic"></noMore>
79
               </div>
79
               </div>
80
             </li>
80
             </li>
371
       const _that = this
371
       const _that = this
372
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
372
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
373
     },
373
     },
374
+    checkCanOrder () {
375
+      const _that = this
376
+      return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'goods').length > 0
377
+    },
378
+    toCardNumDetail (item) {
379
+      if (this.userInfo.customer.UserTypeId === 'manager') {
380
+        window.location.href = `${this.getUrl('cardAndCouponNum')}?id=${item.CardId}&type=card`
381
+      }
382
+    },
383
+    toCouponNumDetail (item) {
384
+      if (this.userInfo.customer.UserTypeId === 'manager') {
385
+        window.location.href = `${this.getUrl('cardAndCouponNum')}?id=${item.CardId}&type=coupon`
386
+      }
387
+    },
374
     returnInvalid (item, type) {
388
     returnInvalid (item, type) {
375
       for (var n = 0; n < this.forbidList.length; n++) {
389
       for (var n = 0; n < this.forbidList.length; n++) {
376
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
390
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
524
     toOrders (subItem, item) {
538
     toOrders (subItem, item) {
525
       const _that = this
539
       const _that = this
526
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
540
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
541
+        if (this.checkCanOrder()){
542
+          _that.$toast('您的点单功能已被关闭!')
543
+          return
544
+        }
527
         if (res.Status === 1) {
545
         if (res.Status === 1) {
528
           this.$router.push({ name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(_that.topCaseInfoData.caseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName) } })
546
           this.$router.push({ name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(_that.topCaseInfoData.caseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName) } })
529
         } else {
547
         } else {

+ 1
- 1
src/pages/user/mainPage/userCenter/index.vue Целия файл

110
       this.$router.push({ name: 'orderList' })
110
       this.$router.push({ name: 'orderList' })
111
     },
111
     },
112
     toBodyCheck () {
112
     toBodyCheck () {
113
-      window.location.href = `${window.location.origin}/c-v2/bodyCheck.html#/`
113
+      window.location.href = `${window.location.origin}/bodyCheck.html#/`
114
     },
114
     },
115
     toLuckdraw () {
115
     toLuckdraw () {
116
       // ^参数约定为97
116
       // ^参数约定为97

+ 1
- 1
src/pages/user/majorProjectsDetail/index.vue Целия файл

133
       this.courseDetail.CourseImgs = this.courseDetail.CourseImgs || []
133
       this.courseDetail.CourseImgs = this.courseDetail.CourseImgs || []
134
       this.topImage = this.courseDetail.CourseImgs.length > 0 ? this.courseDetail.CourseImgs[0].ImgUrl : ""
134
       this.topImage = this.courseDetail.CourseImgs.length > 0 ? this.courseDetail.CourseImgs[0].ImgUrl : ""
135
       if (this.courseDetail.CourseImgs.length > 0) {
135
       if (this.courseDetail.CourseImgs.length > 0) {
136
-        this.detailImage = this.courseDetail.CourseImgs.slice(1)
136
+        this.detailImage = this.courseDetail.CourseImgs
137
       }
137
       }
138
       console.log(this.detailImage)
138
       console.log(this.detailImage)
139
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
139
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })

+ 6
- 1
src/pages/user/placeOrder/index.vue Целия файл

266
     },
266
     },
267
     reback () { // 返回桌位选择
267
     reback () { // 返回桌位选择
268
       this.$dialog.confirm({
268
       this.$dialog.confirm({
269
-        title: '提示',
270
         message: '返回页面将清空当前选择的商品,确定要返回吗?'
269
         message: '返回页面将清空当前选择的商品,确定要返回吗?'
271
       }).then(() => {
270
       }).then(() => {
272
         // this.$router.push({ name: 'coffeeIndex' })
271
         // this.$router.push({ name: 'coffeeIndex' })
385
 <style lang="scss" scoped>
384
 <style lang="scss" scoped>
386
 @import 'page.scss';
385
 @import 'page.scss';
387
 </style>
386
 </style>
387
+
388
+<style>
389
+.van-dialog__message {
390
+  text-align: center;
391
+}
392
+</style>

+ 3
- 2
src/pages/user/placeOrderDetail/index.vue Целия файл

130
       // console.log(JSON.stringify(res))
130
       // console.log(JSON.stringify(res))
131
       var id = JSON.parse(this.$route.query.info)[0].id, arr = [], nowDate = Date.now()
131
       var id = JSON.parse(this.$route.query.info)[0].id, arr = [], nowDate = Date.now()
132
       for (var n = 0; n < res.length; n++) {
132
       for (var n = 0; n < res.length; n++) {
133
+        res[n].Coupon.Targets = res[n].Coupon.Targets || []
133
         if (res[n].Coupon.CouponType === 'goods' && res[n].Status === 1) {
134
         if (res[n].Coupon.CouponType === 'goods' && res[n].Status === 1) {
134
-          if (res[n].Coupon.IsAll) {
135
+          if (res[n].Coupon.IsAll && nowDate >= new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime()) {
135
             this.couponList.push({
136
             this.couponList.push({
136
               title: res[n].Coupon.CouponName,
137
               title: res[n].Coupon.CouponName,
137
               desc: res[n].Coupon.Share.UseInstruction,
138
               desc: res[n].Coupon.Share.UseInstruction,
241
         // })
242
         // })
242
       })
243
       })
243
     },
244
     },
244
-    
245
+
245
     popBack () {
246
     popBack () {
246
       this.showSuccessPopup = false
247
       this.showSuccessPopup = false
247
       window.history.go(-2)
248
       window.history.go(-2)

+ 3
- 2
src/pages/user/placeOrderForCourse/index.vue Целия файл

29
                   </div>
29
                   </div>
30
                 </div>
30
                 </div>
31
                 <!-- <span v-if="courseTimeList.length">{{returnCourseTime(courseTimeList[0].BeginDate,courseTimeList[0].EndDate)}}</span> -->
31
                 <!-- <span v-if="courseTimeList.length">{{returnCourseTime(courseTimeList[0].BeginDate,courseTimeList[0].EndDate)}}</span> -->
32
-                <span v-if="courseTimeList.length">{{toolClass.dateFormat(courseTimeList[0].BeginDate,'yyyy-MM-dd') + ' ~ ' + toolClass.dateFormat(courseTimeList[0].EndDate, 'yyyy-MM-dd')}}</span>
32
+                <span v-if="courseTimeList.length">{{toolClass.dateFormat(courseDetail.BeginDate,'yyyy-MM-dd') + ' ~ ' + toolClass.dateFormat(courseDetail.EndDate, 'yyyy-MM-dd')}}</span>
33
               </li>
33
               </li>
34
               <li class="flex-h">
34
               <li class="flex-h">
35
                 <div class="flex-item">
35
                 <div class="flex-item">
169
         var id = this.$route.query.id, arr = [], nowDate = Date.now()
169
         var id = this.$route.query.id, arr = [], nowDate = Date.now()
170
         for (var n = 0; n < res.length; n++) {
170
         for (var n = 0; n < res.length; n++) {
171
           // console.log(res[n])
171
           // console.log(res[n])
172
+          res[n].Coupon.Targets = res[n].Coupon.Targets || []
172
           if (res[n].Coupon.CouponType === 'course' && res[n].Status === 1) {
173
           if (res[n].Coupon.CouponType === 'course' && res[n].Status === 1) {
173
-            if (res[n].Coupon.IsAll && res[n].CaseId === caseid) {
174
+            if (res[n].Coupon.IsAll && res[n].CaseId === caseid && nowDate > new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime()) {
174
               this.couponList.push({
175
               this.couponList.push({
175
                 title: res[n].Coupon.CouponName,
176
                 title: res[n].Coupon.CouponName,
176
                 desc: res[n].Coupon.Share.UseInstruction,
177
                 desc: res[n].Coupon.Share.UseInstruction,

+ 18
- 7
src/util/ajax.js Целия файл

29
 
29
 
30
 Axios.interceptors.request.use((config) => {
30
 Axios.interceptors.request.use((config) => {
31
   config.headers.authorization = token()
31
   config.headers.authorization = token()
32
+  // config.urlData = { ...config.urlData,  }
32
   // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
33
   // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
33
-  config.urlData = { ...config.urlData, org: 'MQ' }
34
+  let urlData = qs.stringify(config.urlData)
34
   let queryData = qs.stringify(config.queryData)
35
   let queryData = qs.stringify(config.queryData)
35
-  // 判断是通过斜杠传参还是通过query传参
36
+  // 判断是通过斜杠传参
36
   if (config.url.indexOf(':') > -1) {
37
   if (config.url.indexOf(':') > -1) {
37
     if (typeof config.urlData === 'object') {
38
     if (typeof config.urlData === 'object') {
38
-      config.url = Object.keys(config.urlData).reduce((url, k) => { // 此方法对每个元素进行处理
39
-        const re = new RegExp(`:${k}(?!w)`, 'i')
40
-        return url.replace(re, config.urlData[k])
41
-      }, config.url)
39
+      config.url = replaceURLParams(config.url, config.urlData)
40
+    } else {
41
+      config.url = config.url.slice(0, config.url.indexOf(':')) + urlData
42
     }
42
     }
43
   }
43
   }
44
   if (queryData) {
44
   if (queryData) {
47
   let fm = new FormData()
47
   let fm = new FormData()
48
   for (let k in config.data) {
48
   for (let k in config.data) {
49
     if (Array.isArray(config.data[k])) {
49
     if (Array.isArray(config.data[k])) {
50
-      fm.append(k, ...config.data[k].map(v => `${k}=${encodeURIComponent(v)}`))
50
+      config.data[k].forEach((v) => {
51
+        fm.append(k, v)
52
+      })
51
     } else {
53
     } else {
52
       fm.append(k, config.data[k])
54
       fm.append(k, config.data[k])
53
     }
55
     }
98
 }
100
 }
99
 
101
 
100
 export default ajax
102
 export default ajax
103
+
104
+export function replaceURLParams (url, params) {
105
+  const args = { ...(params || {}), org: 'MQ' }
106
+
107
+  return Object.keys(args).reduce((acc, k) => { // 此方法对每个元素进行处理
108
+    const re = new RegExp(`:${k}(?!w)`, 'i')
109
+    return acc.replace(re, args[k])
110
+  }, url)
111
+}