Преглед изворни кода

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/wechat into dev

许成详 пре 6 година
родитељ
комит
9c158c9b49
46 измењених фајлова са 601 додато и 313 уклоњено
  1. BIN
      src/common/icon/bottomMsg.png
  2. 3
    3
      src/components/calcMenu/index.vue
  3. 2
    2
      src/components/discounts/discounts.vue
  4. 11
    4
      src/components/myCard/myCard.vue
  5. 1
    1
      src/pages/bodyCheck/index/index.vue
  6. 55
    52
      src/pages/sales/cardAndCouponNum/index.vue
  7. 22
    7
      src/pages/sales/customerSearch/index.vue
  8. 2
    2
      src/pages/sales/customerSearch/page.scss
  9. 3
    3
      src/pages/sales/getRecord/index.vue
  10. 16
    10
      src/pages/sales/login/index.vue
  11. 11
    5
      src/pages/sales/salesGiveOutDetail/index.vue
  12. 1
    1
      src/pages/sales/salesRecord/index.vue
  13. 7
    7
      src/pages/user/App.vue
  14. 2
    0
      src/pages/user/app.js
  15. 12
    2
      src/pages/user/bindMobile/bindMobile.vue
  16. 2
    2
      src/pages/user/bindMobile/page.scss
  17. 12
    2
      src/pages/user/card/index.vue
  18. 1
    2
      src/pages/user/cardDetail/index.vue
  19. 13
    3
      src/pages/user/coupons/index.vue
  20. 4
    3
      src/pages/user/couponsDetail/index.vue
  21. 29
    15
      src/pages/user/fiveA/index.vue
  22. 1
    1
      src/pages/user/gymCardDetail/index.vue
  23. 9
    7
      src/pages/user/lessonDetail/index.vue
  24. 6
    1
      src/pages/user/lessonDetail/page.scss
  25. 13
    6
      src/pages/user/lessonOrder/index.vue
  26. 33
    6
      src/pages/user/mainPage/coffeeIndex/index.vue
  27. 1
    1
      src/pages/user/mainPage/index.vue
  28. 16
    4
      src/pages/user/mainPage/indexPage/index.vue
  29. 7
    4
      src/pages/user/mainPage/userCenter/index.vue
  30. 14
    55
      src/pages/user/majorProjects/index.vue
  31. 11
    5
      src/pages/user/majorProjectsDetail/index.vue
  32. 31
    10
      src/pages/user/placeOrder/index.vue
  33. 39
    0
      src/pages/user/placeOrder/page.scss
  34. 60
    37
      src/pages/user/placeOrderDetail/index.vue
  35. 39
    0
      src/pages/user/placeOrderDetail/page.scss
  36. 22
    12
      src/pages/user/placeOrderForCourse/index.vue
  37. 11
    12
      src/pages/user/receive/index.vue
  38. 4
    0
      src/pages/user/receive/page.scss
  39. 29
    11
      src/pages/user/receiveChannel/index.vue
  40. 7
    0
      src/pages/user/receiveChannel/page.scss
  41. 5
    0
      src/store/index/index.js
  42. 7
    3
      src/store/login/login.js
  43. 3
    1
      src/store/placeOrderForCoffee/index.js
  44. 3
    1
      src/store/userCenter/userCenter.js
  45. 20
    9
      src/util/ajax.js
  46. 1
    1
      src/util/share.js

BIN
src/common/icon/bottomMsg.png Прегледај датотеку


+ 3
- 3
src/components/calcMenu/index.vue Прегледај датотеку

@@ -26,7 +26,7 @@
26 26
               <span>备注:</span>
27 27
               <div class="flex-item">
28 28
                 <div>
29
-                  <textarea cols="30" rows="3"></textarea>
29
+                  <textarea cols="30" rows="3" v-model="Remark"></textarea>
30 30
                 </div>
31 31
               </div>
32 32
             </div>
@@ -48,7 +48,7 @@ export default {
48 48
   props: ['show', 'data', 'totalNum'],
49 49
   data () {
50 50
     return {
51
-
51
+      Remark:''
52 52
     }
53 53
   },
54 54
   computed: {
@@ -65,7 +65,7 @@ export default {
65 65
       this.$emit('closeCalcMenu')
66 66
     },
67 67
     placeOrder () { // 点单
68
-      this.$emit('placeOrder')
68
+      this.$emit('placeOrder',this.Remark)
69 69
     },
70 70
   }
71 71
 }

+ 2
- 2
src/components/discounts/discounts.vue Прегледај датотеку

@@ -18,8 +18,8 @@
18 18
       </div>
19 19
     </div>
20 20
     <div class="useType">
21
-      <img :src="used" alt="已使用" v-if="data.useType == '已使用'" width="100%" height="100%">
22
-      <img :src="failure" alt="已失效" v-if="data.useType == '已失效'" width="100%" height="100%">
21
+      <img :src="used" v-if="data.useType == '已使用'" width="100%" height="100%">
22
+      <img :src="failure" v-if="data.useType == '已失效'" width="100%" height="100%">
23 23
     </div>
24 24
   </div>
25 25
 </template>

+ 11
- 4
src/components/myCard/myCard.vue Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 <template>
2 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 4
       <div>
5 5
         <img :src="logo" class="logo">
6 6
         <span>¥ <span> {{data.price}} </span> 元</span>
@@ -12,7 +12,7 @@
12 12
         <span>{{data.startDate}}-{{data.endDate}}</span>
13 13
       </div>
14 14
     </div>
15
-    <div class="card-main flex-h">
15
+    <div class="card-main flex-h" @click="detail">
16 16
       <img :src="line">
17 17
       <div class="flex-h">
18 18
         <span>总数量</span>
@@ -24,11 +24,11 @@
24 24
       </div>
25 25
       <div>
26 26
         <span>用户领取</span>
27
-        <span>{{data.SentCount}}</span>
27
+        <span>{{ismanager?data.SentCount:data.CustomerList.length}}</span>
28 28
       </div>
29 29
       <div>
30 30
         <span>用户使用</span>
31
-        <span>{{data.usedCount}}</span>
31
+        <span>{{ismanager?data.usedCount:data.CustomerList.filter(x => x.Status===2).length}}</span>
32 32
       </div>
33 33
     </div>
34 34
     <div class="card-bottom" @click.stop="share">
@@ -58,6 +58,10 @@ export default {
58 58
     isgrey: {
59 59
       type: Boolean,
60 60
       default: false
61
+    },
62
+    ismanager: {
63
+      type: Boolean,
64
+      default: false
61 65
     }
62 66
   },
63 67
   methods: {
@@ -69,6 +73,9 @@ export default {
69 73
           this.$emit('share', this.data)
70 74
         }
71 75
       }
76
+    },
77
+    detail () {
78
+      this.$emit('detail', this.data)
72 79
     }
73 80
   }
74 81
 }

+ 1
- 1
src/pages/bodyCheck/index/index.vue Прегледај датотеку

@@ -27,7 +27,7 @@
27 27
       </div>
28 28
     </div>
29 29
     <div v-else class="nodata">
30
-        暂无体检数据 .
30
+        暂无体检数据
31 31
     </div>
32 32
     <div class="bg-white" :hidden="ishidden">
33 33
     </div>

+ 55
- 52
src/pages/sales/cardAndCouponNum/index.vue Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="mainPage flex-v" v-if="data">
2
+  <div class="mainPage flex-v" v-if="showPage">
3 3
     <div class="top flex-h">
4 4
       <span>¥<em>{{parseInt(data.Price)}}</em>元</span>
5 5
       <div class="flex-item">
@@ -44,19 +44,19 @@
44 44
               <span>销售名称</span>
45 45
               <div class="flex-item">
46 46
                 <div>
47
-                  <span>实际使用</span>
47
+                  <span>用户领取</span>
48 48
                 </div>
49 49
               </div>
50
-              <span>用户领取</span>
50
+              <span>实际使用</span>
51 51
             </li>
52 52
             <li class="flex-h" v-for="(item,index) in data.CustomerCard" :key="index">
53
-              <span>{{salesData(item).name}}</span>
53
+              <span>{{item.RealName}}</span>
54 54
               <div class="flex-item">
55 55
                 <div>
56
-                  <span>{{salesData(item).receive}}</span>
56
+                  <span>{{item.ReceiveNum}}</span>
57 57
                 </div>
58 58
               </div>
59
-              <span>{{salesData(item).used}}</span>
59
+              <span>{{item.UsedNum}}</span>
60 60
             </li>
61 61
           </ul>
62 62
         </div>
@@ -72,72 +72,75 @@ export default {
72 72
   name: '',
73 73
   data () {
74 74
     return {
75
-      data: {}
75
+      data: {},
76
+      showPage: false
76 77
     }
77 78
   },
78 79
   created () {
79 80
     if (this.$route.query.type === 'card') {
80 81
       this.getCardNum({ id: this.$route.query.id }).then(() => {
81
-        this.getSales({ type: 'sales' }).then(() => {
82
-          this.data = this.cardAndCoupon
83
-          this.data.CustomerCard = this.data.CustomerCard || []
84
-        })
82
+        // this.getSales({ type: 'sales' }).then(() => {
83
+        this.data = this.cardAndCoupon
84
+        this.data.CustomerCard = this.data.CustomerCard || []
85
+        this.showPage = true
86
+        // })
85 87
       })
86 88
     } else {
87 89
       this.getCouponNum({ id: this.$route.query.id }).then(() => {
88
-        this.getSales({ type: 'sales' }).then(() => {
90
+        // this.getSales({ type: 'sales' }).then(() => {
89 91
           this.data = this.cardAndCoupon
90 92
           this.data.CustomerCard = this.data.CustomerCoupon || []
91
-        })
93
+          this.showPage = true
94
+        // })
92 95
       })
93 96
     }
94 97
   },
95 98
   computed: {
96 99
     ...mapForbidState({
97
-      salesList: x => x.salesList,
100
+      // salesList: x => x.salesList,
98 101
       cardAndCoupon: x => x.cardAndCoupon
99 102
     })
100 103
   },
101 104
   methods: {
102
-    ...mapForbidActions(['getCardNum', 'getCouponNum', 'getSales']),
103
-    salesData (item) {
104
-      let receive = 0
105
-      let used = 0
106
-      let name
107
-      if (this.$route.query.type === 'card') {
108
-        for (let i = 0; i < this.salesList.length; i++) {
109
-          this.salesList[i].CustomerCard = this.salesList[i].CustomerCard || []
110
-          for (let j = 0; j < this.salesList[i].CustomerCard.length; j++) {
111
-            if (this.salesList[i].CustomerCard[j].SalesId === item.SalesId) {
112
-              name = this.salesList[i].RealName
113
-              receive++
114
-              if (!item.VerifyStatus) {
115
-                used++
116
-              }
117
-            }
118
-          }
119
-        }
120
-      } else {
121
-        for (let i = 0; i < this.salesList.length; i++) {
122
-          this.salesList[i].CustomerCoupon = this.salesList[i].CustomerCoupon || []
123
-          for (let j = 0; j < this.salesList[i].CustomerCoupon.length; j++) {
124
-            if (this.salesList[i].CustomerCoupon[j].SalesId === item.SalesId) {
125
-              name = this.salesList[i].RealName
126
-              receive++
127
-              if (!item.VerifyStatus) {
128
-                used++
129
-              }
130
-            }
131
-          }
132
-        }
133
-      }
105
+    ...mapForbidActions(['getCardNum', 'getCouponNum']),
106
+    // salesData (item) {
107
+    //   let receive = 0
108
+    //   let used = 0
109
+    //   let name
110
+    //   if (this.$route.query.type === 'card') {
111
+    //     for (let i = 0; i < this.salesList.length; i++) {
112
+    //       this.salesList[i].CustomerCard = this.salesList[i].CustomerCard || []
113
+    //       for (let j = 0; j < this.salesList[i].CustomerCard.length; j++) {
114
+    //         if (this.salesList[i].CustomerCard[j].SalesId === item.SalesId) {
115
+    //           name = this.salesList[i].RealName
116
+    //           receive++
117
+    //           if (!item.VerifyStatus) {
118
+    //             used++
119
+    //           }
120
+    //         }
121
+    //       }
122
+    //     }
123
+    //   } else {
124
+    //     for (let i = 0; i < this.salesList.length; i++) {
125
+    //       this.salesList[i].CustomerCoupon = this.salesList[i].CustomerCoupon || []
126
+    //       for (let j = 0; j < this.salesList[i].CustomerCoupon.length; j++) {
127
+    //         if (this.salesList[i].CustomerCoupon[j].SalesId === item.SalesId) {
128
+    //           name = this.salesList[i].RealName
129
+    //           receive++
130
+    //           if (!item.VerifyStatus) {
131
+    //             used++
132
+    //           }
133
+    //         }
134
+    //       }
135
+    //     }
136
+    //   }
134 137
 
135
-      return {
136
-        'name': name,
137
-        'receive': receive,
138
-        'used': used
139
-      }
140
-    },
138
+    //   return {
139
+    //     'name': name,
140
+    //     'receive': receive,
141
+    //     'used': used
142
+    //   }
143
+    // },
141 144
   }
142 145
 }
143 146
 </script>

+ 22
- 7
src/pages/sales/customerSearch/index.vue Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.Name : ''"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName"></topCaseInfo>
5 5
     </div>
6 6
     <div class="content flex-item">
7 7
       <div>
@@ -9,7 +9,8 @@
9 9
           <li class="customer-card">
10 10
             <div class="list-box">
11 11
               <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @record='record'></customerCard>
12
-              <span class="noData" v-if="ajaxOff && !cardList.length">暂无数据</span>
12
+              <!-- <span class="noData" v-if="ajaxOff && !cardList.length">暂无数据</span> -->
13
+              <noMore v-if="ajaxOff && hasPic"></noMore>
13 14
             </div>
14 15
           </li>
15 16
         </ul>
@@ -31,6 +32,7 @@ import customerCard from '../../../components/customerCard/customerCard'
31 32
 import active from '../../../common/icon/check-box-checked.png'
32 33
 import normal from '../../../common/icon/check-box-empty.png'
33 34
 import topCaseInfo from '../../../components/topCaseInfo/index'
35
+import noMore from '../../../components/noMore/noMore'
34 36
 import { mapState, createNamespacedHelpers } from 'vuex'
35 37
 const { mapActions: actions } = createNamespacedHelpers('app')
36 38
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
@@ -51,6 +53,7 @@ export default {
51 53
         normal: normal
52 54
       },
53 55
       ajaxOff: false,
56
+      hasPic: false,
54 57
       key: '',
55 58
       mask: true,
56 59
       checked: true,
@@ -70,6 +73,7 @@ export default {
70 73
   components: {
71 74
     customerCard,
72 75
     topCaseInfo,
76
+    noMore
73 77
   },
74 78
   created () {
75 79
     this.getCaseList().then((res) => {
@@ -96,7 +100,7 @@ export default {
96 100
     ]),
97 101
     record (item) {
98 102
       // console.log(item)
99
-      this.$router.push({ name: 'getRecord', query: {name: item.Name, phone: item.Phone, id: item.CustomerId} })
103
+      this.$router.push({ name: 'getRecord', query: { name: item.Name, phone: item.Phone, id: item.CustomerId } })
100 104
     },
101 105
     searchMask () {
102 106
       this.getCustomerList({
@@ -105,11 +109,22 @@ export default {
105 109
         isrecommend: false,
106 110
         key: this.key,
107 111
       }).then((res) => {
108
-        // console.log(JSON.stringify(res))
109
-        res = res || []
110
-        for (var n = 0; n < res.length; n++) {
111
-          this.cardList.push({...res[n], invalid: false})
112
+        if (res) {
113
+          for (var n = 0; n < res.length; n++) {
114
+            if (res[n].RecommendId === this.userInfo.customer.MapUser) {
115
+              res[n].showTag = true
116
+            } else {
117
+              res[n].showTag = false
118
+            }
119
+            this.cardList.push(res[n])
120
+          }
121
+        } else {
122
+          this.hasPic = true
112 123
         }
124
+        // res = res || []
125
+        // for (var n = 0; n < res.length; n++) {
126
+        //   this.cardList.push({...res[n], invalid: false})
127
+        // }
113 128
         this.mask = false
114 129
         this.ajaxOff = true
115 130
       })

+ 2
- 2
src/pages/sales/customerSearch/page.scss Прегледај датотеку

@@ -90,8 +90,8 @@
90 90
         background: #eee;
91 91
         border-radius: .08rem;
92 92
         padding-left: .3rem;
93
-        line-height: .3rem;
94
-        padding-top: .03rem;
93
+        line-height: .13rem;
94
+        // padding-top: .03rem;
95 95
       }
96 96
       i{
97 97
         font-size: .16rem;

+ 3
- 3
src/pages/sales/getRecord/index.vue Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.Name : ''" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showSelect = true"></topCaseInfo>
5 5
     </div>
6 6
     <div class="info">
7 7
       <span><em>姓名:</em>{{user.name}}</span>
@@ -24,7 +24,7 @@
24 24
               <div class="list-detail" v-for="(item,index) in cardList" :key="index">
25 25
                 <span>{{item.CustomerCardName}}</span>
26 26
                 <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
27
-                <span>已使用</span>
27
+                <span>{{item.VerifyStatus === "useable"?"未使用":"已使用"}}</span>
28 28
               </div>
29 29
               <span class="noData" v-if="cardAjaxOff && !cardList.length">暂无数据</span>
30 30
             </div>
@@ -32,7 +32,7 @@
32 32
               <div class="list-detail" v-for="(item,index) in couponList" :key="index">
33 33
                 <span>{{item.CustomerCouponName}}</span>
34 34
                 <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
35
-                <span>已使用</span>
35
+                <span>{{item.Status === 2?"已使用":"未使用"}}</span>
36 36
               </div>
37 37
               <span class="noData" v-if="couponAjaxOff && !couponList.length">暂无数据</span>
38 38
             </div>

+ 16
- 10
src/pages/sales/login/index.vue Прегледај датотеку

@@ -1,19 +1,18 @@
1 1
 <template>
2 2
   <div class="mainPage" v-if="showPage">
3 3
     <div class="mask">
4
-      <!-- <img :src="logo" class="logo" alt=""> -->
5 4
       <div class="centerLabel" style="width:100%;">
6 5
         <div class="box" style="margin:0 auto;">
7 6
           <div class="title">登录</div>
8 7
 
9 8
           <div class="mobile">
10 9
             <i class="iconfont icon-dianhua"></i>
11
-            <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
10
+            <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
12 11
           </div>
13 12
 
14 13
           <div class="sms" style="margin-top:.2rem;">
15 14
             <i class="iconfont icon-mima"></i>
16
-            <input type="number" maxlength="6" placeholder="验证码" v-model="postData.captcha">
15
+            <input type="tel" maxlength="6" placeholder="验证码" v-model="postData.captcha">
17 16
             <div class="sand color" v-if="seconds === 61" @click="sandMsg">发送验证码</div>
18 17
             <div class="sand" v-else>{{seconds}}后可重发</div>
19 18
           </div>
@@ -52,15 +51,14 @@
52 51
 </template>
53 52
 
54 53
 <script>
55
-import logo from '../../../common/icon/logo.png'
56 54
 import { createNamespacedHelpers } from 'vuex'
57 55
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
58 56
 const { mapActions: mapLoginActions } = createNamespacedHelpers('login')
59 57
 const { mapState: mapUserState } = createNamespacedHelpers('userCenter')
58
+let canSubmit
60 59
 export default {
61 60
   data () {
62 61
     return {
63
-      logo,
64 62
       showPage: false,
65 63
       showCase: false,
66 64
       showSales: false,
@@ -108,28 +106,36 @@ export default {
108 106
       return url.replace('sales.html', 'user.html') + '#/' + val + '?hideTabbar=1'
109 107
     },
110 108
     submit () {
109
+      if (!canSubmit) {
110
+        return
111
+      }
112
+      canSubmit = false
111 113
       if (!this.postData.captcha) {
112 114
         this.$toast('请填写验证码')
115
+        canSubmit = true
113 116
         return
114 117
       }
115 118
       let reg = /^[0-9]{6}$/
116 119
       if (!reg.test(this.postData.captcha)) {
117 120
         this.$toast('验证码格式不正确')
121
+        canSubmit = true
118 122
         return
119 123
       }
120
-      // console.log(this.postData)
121 124
       this.submitData(this.postData).then((res) => {
122
-        // this.$toast(res)
123 125
         setTimeout(() => {
124
-          window.location.href = this.getUrl('mainPage/coffeeIndex')
126
+          window.location.replace(this.getUrl('mainPage/coffeeIndex'))
125 127
         }, 2000)
128
+      }).catch(() => {
129
+        console.log(111)
130
+        canSubmit = true
126 131
       })
127 132
     }
128 133
   },
129 134
   created () {
135
+    canSubmit = true
130 136
     if (this.userInfo.customer.MapUser) {
131
-      window.location.href = this.getUrl('mainPage/coffeeIndex')
132
-      return
137
+      // this.showPage = true
138
+      window.location.replace(this.getUrl('mainPage/coffeeIndex'))
133 139
     } else {
134 140
       this.showPage = true
135 141
     }

+ 11
- 5
src/pages/sales/salesGiveOutDetail/index.vue Прегледај датотеку

@@ -1,14 +1,14 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.Name : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 6
     <div class="flex-item flex-v body" v-if="data.allCard">
7 7
       <span>销售姓名:<em>{{data.RealName}}</em></span>
8 8
       <ul class="flex-h">
9 9
         <li class="flex-item" :class="{'active': activeIndex === 0}" @click="cutNav(0)">
10 10
           <span>饮品</span>
11
-          <span>(已赠送{{data.OrdersDetail.length}}杯)</span>  
11
+          <span>(已赠送{{drinkNumber}}杯)</span>  
12 12
         </li> 
13 13
         <li class="flex-item" :class="{'active': activeIndex === 1}" @click="cutNav(1)">
14 14
           <span>卡券</span>
@@ -37,7 +37,7 @@
37 37
             </li>
38 38
             <li :hidden="activeIndex === 0">
39 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 41
                   <div class="flex-item">
42 42
                     <div>
43 43
                       <span>{{item.CustomerCardName || item.CustomerCouponName}}</span>
@@ -49,7 +49,7 @@
49 49
                     </div>
50 50
                   </div>
51 51
                   <span>{{toolClass.dateFormat(item.ReceiveDate, 'yyyy/MM/dd hh:mm')}}</span>
52
-                </router-link>
52
+                </li>
53 53
               </ul>
54 54
             </li>
55 55
           </ul>
@@ -75,7 +75,8 @@ export default {
75 75
         caseId: '',
76 76
         showSelect: false
77 77
       },
78
-      data: {}
78
+      data: {},
79
+      drinkNumber: 0
79 80
     }
80 81
   },
81 82
   computed: {
@@ -105,6 +106,11 @@ export default {
105 106
       this.data.CustomerCoupon = this.data.CustomerCoupon ? this.data.CustomerCoupon : []
106 107
       this.data.OrdersDetail = this.data.OrdersDetail ? this.data.OrdersDetail : []
107 108
       this.data.allCard = this.data.CustomerCard.concat(this.data.CustomerCoupon)
109
+      let num = 0
110
+      for (let i = 0; i < this.data.OrdersDetail.length; i++) {
111
+        num += this.data.OrdersDetail[i].Number
112
+      }
113
+      this.drinkNumber = num
108 114
     })
109 115
   },
110 116
   methods: {

+ 1
- 1
src/pages/sales/salesRecord/index.vue Прегледај датотеку

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

+ 7
- 7
src/pages/user/App.vue Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div id="app" v-if="showPage">
3
-    <router-view ></router-view>
3
+    <router-view></router-view>
4 4
   </div>
5 5
 </template>
6 6
 
@@ -34,12 +34,12 @@ export default {
34 34
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
35 35
       this.showPage = true
36 36
     })
37
-    wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
38
-      title: '城的空间',
39
-      desc: '城的空间',
40
-      link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
41
-      thu_image: `${window.location.origin}${window.location.pathname}${logo}`
42
-    })
37
+    // wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
38
+    //   title: '城的空间',
39
+    //   desc: '城的空间',
40
+    //   link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
41
+    //   thu_image: `https://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/citymini%2Findexlogo.jpg`
42
+    // })
43 43
   },
44 44
   methods: {
45 45
     ...actions(['getUserInfo'])

+ 2
- 0
src/pages/user/app.js Прегледај датотеку

@@ -8,11 +8,13 @@ import Vuex from 'vuex'
8 8
 import Ajax from '../../util/ajax'
9 9
 import api from '../../util/api'
10 10
 import toolClass from '../../util/util'
11
+const Base64 = require('js-base64').Base64
11 12
 
12 13
 Vue.use(Vant)
13 14
 Vue.use(Vuex)
14 15
 Vue.prototype.$api = api
15 16
 Vue.prototype.$ajax = Ajax
17
+Vue.prototype.Base64 = Base64
16 18
 Vue.prototype.toolClass = toolClass
17 19
 /* eslint-disable no-new */
18 20
 new Vue({

+ 12
- 2
src/pages/user/bindMobile/bindMobile.vue Прегледај датотеку

@@ -7,7 +7,7 @@
7 7
 
8 8
         <div class="mobile">
9 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 11
         </div>
12 12
 
13 13
         <div class="recommend">
@@ -24,7 +24,7 @@
24 24
 
25 25
         <div class="sms">
26 26
           <i class="iconfont icon-mima"></i>
27
-          <input type="number" maxlength="6" placeholder="验证码" v-model="postData.captcha">
27
+          <input type="tel" maxlength="6" placeholder="验证码" v-model="postData.captcha">
28 28
           <div class="sand color" v-if="seconds === 61" @click="sandMsg">发送验证码</div>
29 29
           <div class="sand" v-else>{{seconds}}后可重发</div>
30 30
         </div>
@@ -65,6 +65,7 @@
65 65
 import logo from '../../../common/icon/logo.png'
66 66
 import { mapState, createNamespacedHelpers } from 'vuex'
67 67
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
68
+let canSubmit
68 69
 export default {
69 70
   data () {
70 71
     return {
@@ -90,6 +91,7 @@ export default {
90 91
     })
91 92
   },
92 93
   created () {
94
+    canSubmit = true
93 95
     this.getCaseInfo(1).then(() => {
94 96
       this.columns = this.caseInfo.cases
95 97
     })
@@ -163,8 +165,13 @@ export default {
163 165
       }, 1000)
164 166
     },
165 167
     submit () {
168
+      if (!canSubmit){
169
+        return
170
+      }
171
+      canSubmit = false
166 172
       if (!this.postData.captcha) {
167 173
         this.$toast('请填写验证码')
174
+        canSubmit = true
168 175
         return
169 176
       }
170 177
       // if (!this.postData.case) {
@@ -187,6 +194,9 @@ export default {
187 194
             window.history.go(-1)
188 195
           }, 2000)
189 196
         }
197
+      }).catch(() => {
198
+        console.log(111)
199
+        canSubmit = true
190 200
       })
191 201
     }
192 202
   }

+ 2
- 2
src/pages/user/bindMobile/page.scss Прегледај датотеку

@@ -82,10 +82,10 @@
82 82
         justify-content: space-between;
83 83
         span{
84 84
           color: rgba(168,182,200,1);
85
+          white-space: nowrap;
85 86
         }
86 87
         i{
87 88
           color: rgba(168,182,200,1);
88
-          padding-left: .14rem;
89 89
           font-size: .12rem;
90 90
         }
91 91
         div{
@@ -99,7 +99,7 @@
99 99
           padding: .1rem;
100 100
           box-sizing: border-box;
101 101
           span{
102
-            width: 70%;
102
+            width: 85%;
103 103
             overflow:hidden;
104 104
             text-overflow:ellipsis;
105 105
             white-space:nowrap;

+ 12
- 2
src/pages/user/card/index.vue Прегледај датотеку

@@ -122,18 +122,28 @@ export default {
122 122
     this.getCardList().then((res) => {
123 123
       if (res) {
124 124
         for (var n = 0; n < res.length; n++) {
125
+          let useType = '已使用'
126
+          let nowDate = new Date().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
+          // }
125 135
           this.data[0].list.push({
126 136
             title: res[n].CustomerCardName,
127 137
             desc: res[n].Share.CardUseRule,
128 138
             time: this.toolClass.dateFormat(res[n].EndDate, 'yyyy-MM-dd'),
129
-            useType: res[n].Status === 1 ? '未使用' : '已使用',
139
+            useType: useType,
130 140
             tag: '共享',
131 141
             CustomerCourseId: res[n].CustomerCourseId,
132 142
             CustomerCardId: res[n].CustomerCardId
133 143
           })
134 144
         }
135 145
       } else {
136
-        this.data[this.active].hasPic
146
+        this.data[this.active].hasPic = true
137 147
       }
138 148
     })
139 149
   },

+ 1
- 2
src/pages/user/cardDetail/index.vue Прегледај датотеку

@@ -5,7 +5,6 @@
5 5
       <div class="message">
6 6
         <div>
7 7
           <span>{{info.CustomerCardName}}</span>
8
-          <!-- <span class="sub">(可在银城会所健身房和游泳池使用)</span> -->
9 8
         </div>
10 9
         <div>
11 10
           <span>有效时间</span>
@@ -14,7 +13,7 @@
14 13
       </div>
15 14
       <div class="rule">
16 15
         <div>使用规则</div>
17
-        <div>{{info.Share.CardUseInstruction}}</div>
16
+        <pre style="white-space: pre-wrap;word-wrap: break-word;">{{info.Share.CardUseInstruction}}</pre>
18 17
       </div>
19 18
       <div class="line">
20 19
         <img :src="Artboard" alt="" width="100%">

+ 13
- 3
src/pages/user/coupons/index.vue Прегледај датотеку

@@ -34,7 +34,7 @@ export default {
34 34
       hasPic: false,
35 35
       hasMore: true,
36 36
       list: [],
37
-      line
37
+      line 
38 38
     }
39 39
   },
40 40
   components: {
@@ -48,11 +48,21 @@ export default {
48 48
       // console.log(JSON.stringify(this.couponList))
49 49
       if (res) {
50 50
         for (var n = 0; n < res.length; n++) {
51
+          let useType
52
+          let nowDate = new Date().valueOf()
53
+          let endDate = new Date(res[n].EndDate).valueOf()
54
+          if (res[n].Status === 2) {
55
+            useType = '已使用'
56
+          } else if (res[n].Status === 1 && nowDate > endDate) {
57
+            useType = '已失效'
58
+          } else {
59
+            useType = '未使用'
60
+          }
51 61
           this.list.push({
52 62
             title: res[n].Coupon.CouponName,
53
-            desc: res[n].Coupon.Share.UseInstruction,
63
+            desc: res[n].Coupon.Share.UseRule,
54 64
             time: this.toolClass.dateFormat(res[n].EndDate),
55
-            useType: res[n].Status === 1 ? '未使用' : '已使用',
65
+            useType: useType,
56 66
             tag: res[n].Coupon.CouponType === 'course' ? '课程' : '商品',
57 67
             customercouponid: res[n].CustomerCouponId,
58 68
             couponid: res[n].Coupon.CouponId,

+ 4
- 3
src/pages/user/couponsDetail/index.vue Прегледај датотеку

@@ -8,15 +8,16 @@
8 8
         </div>
9 9
         <div>
10 10
           <span>有效时间:</span>
11
-          <div class="time">{{toolClass.dateFormat(info.EndDate)}}</div>
11
+          <div class="time">{{toolClass.dateFormat(info.StartDate) + ' ~ ' + toolClass.dateFormat(info.EndDate)}}</div>
12 12
         </div>
13 13
       </div>
14 14
       <div class="rule">
15 15
         <div>使用规则</div>
16
-        <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
16
+        <pre style="white-space: pre-wrap;word-wrap: break-word;">{{info.Share.UseInstruction}}</pre>
17
+        <!-- <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
17 18
         <div>2. 此卡不可多人使用,一人记一次。 </div>
18 19
         <div>3. 非会员可凭此卡享受对应课程。 </div>
19
-        <div>4. 截止日期至{{toolClass.dateFormat(info.EndDate)}}。 </div>
20
+        <div>4. 截止日期至{{toolClass.dateFormat(info.EndDate)}}。 </div> -->
20 21
       </div>
21 22
       <div class="line">
22 23
         <img :src="Artboard" alt="" width="100%">

+ 29
- 15
src/pages/user/fiveA/index.vue Прегледај датотеку

@@ -25,12 +25,12 @@
25 25
             <!-- <span v-if="fiveANoData" style="width:100%;line-height:.3rem;display:block;text-align:center;color:#ccc;margin-bottom:.1rem;">暂无数据</span> -->
26 26
           </div>
27 27
           <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
28
-          <h5>{{item.Consult}}</h5>
28
+          <h5>{{item.Consult || '资讯'}}</h5>
29 29
           <div class="newsList flex-h">
30 30
             <ul class="flex-item">
31
-              <router-link tag="li" :to="{name:'',query:{}}" v-for="(newinfo,nindex) in item.News" :key="nindex">
32
-                <newsItem :data="newinfo" @jump='jump'></newsItem>
33
-              </router-link>
31
+              <li tag="li" @click="jump(newinfo)" v-for="(newinfo,nindex) in item.News" :key="nindex">
32
+                <newsItem :data="newinfo"></newsItem>
33
+              </li>
34 34
             </ul>
35 35
           </div>
36 36
         </div>
@@ -58,6 +58,7 @@ export default {
58 58
       swiperOption: {
59 59
         observer: true,
60 60
         loop: true,
61
+        speed: 1000,
61 62
         autoplay: {
62 63
           disableOnInteraction: false,
63 64
         }
@@ -83,6 +84,15 @@ export default {
83 84
     const _that = this
84 85
     this.getLocationDetails().then(res => {
85 86
       _that.locations = res
87
+      let id = _that.$route.query.id
88
+      let index = 0
89
+      for (let i = 0; i < _that.locations.length; i++) {
90
+        if (_that.locations[i].LocationId === id) {
91
+          index = i
92
+        }
93
+      }
94
+      console.log(index)
95
+      _that.changeLocation(id, index)
86 96
     })
87 97
   },
88 98
   methods: {
@@ -94,16 +104,16 @@ export default {
94 104
     },
95 105
     courseInfo (course) {
96 106
       return {
97
-          id: course.CourseId,
98
-          title: course.CourseName,
99
-          img: course.CourseImg,
100
-          remark: course.Remark,
101
-          address: course.CaseAddress,
102
-          tag: course.CourseTags || [],
103
-          courseType: '',
104
-          defaultPrice: course.Price + '/节',
105
-          getWay: 'ticket'
106
-        }
107
+        id: course.CourseId,
108
+        title: course.CourseName,
109
+        img: course.CourseImg,
110
+        remark: course.Remark,
111
+        address: course.CaseAddress,
112
+        tag: course.CourseTags || [],
113
+        courseType: '',
114
+        defaultPrice: course.Price + '/节',
115
+        getWay: 'ticket'
116
+      }
107 117
     },
108 118
     // returnCourseList (arr) { // 转换课程列表格式
109 119
     //   for (var n = 0; n < arr.length; n++) {
@@ -116,7 +126,11 @@ export default {
116 126
       if (item.ForwardType === 'url') {
117 127
         window.location.href = item.ForwardUrl
118 128
       } else if (item.ForwardType === 'course') {
119
-        this.$router.push({ name: '', query: { id: item.ForwardResourceId } }) // 此处去课程详情
129
+        if (item.ForwardResourceId){
130
+          this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
131
+        } else {
132
+          this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardCourseId } }) // 此处去课程详情
133
+        }
120 134
       } else {
121 135
         window.location.href = item.InfoUrl
122 136
       }

+ 1
- 1
src/pages/user/gymCardDetail/index.vue Прегледај датотеку

@@ -5,7 +5,7 @@
5 5
       <div class="message">
6 6
         <div>
7 7
           <span>会所健身体验卡</span>
8
-          <span class="sub">(可在银城会所健身房和游泳池使用)</span>
8
+          <span class="sub">(可在城的空间健身房和游泳池使用)</span>
9 9
         </div>
10 10
         <div>
11 11
           <span>有效时间</span>

+ 9
- 7
src/pages/user/lessonDetail/index.vue Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage" v-if="showPage">
3 3
     <div class="title">课程详情</div>
4
-    <div class="content" :class="{'opacity' : courseOrderDetail.IsDone === 1, 'gray': courseOrderDetail.IsDone === 1}">
4
+    <div class="content" :class="{'opacity' : courseOrderDetail.IsDone === 1 || (courseOrderDetail.IsDone === 0 && now > time(courseOrderDetail.EndDate)), 'gray': courseOrderDetail.IsDone === 1 || (courseOrderDetail.IsDone === 0 && now > time(courseOrderDetail.EndDate))}">
5 5
       <div class="list-item flex-h">
6 6
         <span>订单编号</span>
7 7
         <span class="flex-item" style="font-size:.11rem;">{{courseOrderDetail.OrdersNo !== undefined ? courseOrderDetail.OrdersNo : ''}}</span>
@@ -46,11 +46,12 @@
46 46
       </div>
47 47
       <div class="qr-code" v-if="courseOrderDetail.IsDone === 0">
48 48
         <qrCode v-if="showQrCode" :msg="courseOrderDetail.QrCodeString"></qrCode>
49
+        <div>{{courseOrderDetail.QrCodeString}}</div>
49 50
       </div>
50 51
     </div>
51 52
     <div class="useType">
52 53
       <img :src="used" alt="已使用" v-if="courseOrderDetail.IsDone === 1" width="100%" height="100%">
53
-      <!-- <img :src="failure" alt="已失效" v-if="useType == '已失效'" width="100%" height="100%"> -->
54
+      <img :src="failure" alt="已失效" v-if="courseOrderDetail.IsDone === 0 && now > time(courseOrderDetail.EndDate)" width="100%" height="100%">
54 55
     </div>
55 56
   </div>
56 57
 </template>
@@ -65,18 +66,16 @@ const { mapActions: mapUserActions, mapState: mapUserState } = createNamespacedH
65 66
 export default {
66 67
   data () {
67 68
     return {
68
-      msg: {
69
-        course_type: 800,
70
-        orderNo: '342897789334'
71
-      },
72 69
       useType: '未使用',
73 70
       used,
74 71
       failure,
75 72
       showQrCode: false,
76
-      showPage: false
73
+      showPage: false,
74
+      now: ''
77 75
     }
78 76
   },
79 77
   created () {
78
+    this.now = Date.now()
80 79
     this.getCourseLocationList().then(() => {
81 80
       this.getCaseList().then(() => {
82 81
         this.getCourseOrderDetail({
@@ -120,6 +119,9 @@ export default {
120 119
         }
121 120
       }
122 121
     },
122
+    time (time) {
123
+      return new Date(time).getTime()
124
+    }
123 125
   },
124 126
   components: {
125 127
     qrCode,

+ 6
- 1
src/pages/user/lessonDetail/page.scss Прегледај датотеку

@@ -66,7 +66,7 @@
66 66
   }
67 67
   .useType{
68 68
     position: absolute;
69
-    bottom: 3.2rem;
69
+    top: 3.3rem;
70 70
     right: .5rem;
71 71
     width: .76rem;
72 72
     height: .76rem;
@@ -75,4 +75,9 @@
75 75
     font-size: .12rem;
76 76
     color: #FC6243 !important;
77 77
   }
78
+  .qr-code{
79
+    div{
80
+      text-align: center;
81
+    }
82
+  }
78 83
 }

+ 13
- 6
src/pages/user/lessonOrder/index.vue Прегледај датотеку

@@ -2,9 +2,9 @@
2 2
   <div class="mainPage">
3 3
     <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='courseOrderList.list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
4 4
       <div class="box">
5
-        <div class="order-card flex-h" v-for="(item,index) in courseOrderList.list" :key='index' :class="{'opacity' : item.status === 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 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 8
             <img :src="item.CourseImg" class="cover" width="100%" height="100%" alt="">
9 9
           </div>
10 10
           <div class="card-msg">
@@ -16,7 +16,9 @@
16 16
           </div>
17 17
           <div class="card-price">
18 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 22
           </div>
21 23
         </div>
22 24
         <noMore v-if="noData"></noMore>
@@ -43,7 +45,8 @@ export default {
43 45
       page: 1,
44 46
       isloading: true,
45 47
       hasMore: true,
46
-      list: []
48
+      list: [],
49
+      now: ''
47 50
     }
48 51
   },
49 52
   components: {
@@ -51,12 +54,13 @@ export default {
51 54
     noMore
52 55
   },
53 56
   created () {
57
+    this.now = Date.now()
54 58
     var _that = this
55 59
     this.getCourseLocationList().then((res) => {
56 60
       // console.log(JSON.stringify(res))
57 61
       this.getCourseOrderList({ page: this.page }).then((res) => {
58 62
         // console.log(JSON.stringify(res))
59
-        if(res.list === null){
63
+        if (res.list === null) {
60 64
           this.noData = true
61 65
         }
62 66
       })
@@ -111,7 +115,10 @@ export default {
111 115
       }
112 116
     },
113 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
 }

+ 33
- 6
src/pages/user/mainPage/coffeeIndex/index.vue Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.Name : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
7 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,7 +59,7 @@
59 59
                   </div>
60 60
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
61 61
                 </div>
62
-                <myCard v-for="(item,index) in data[1].list" :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 63
                 <noMore v-if="data[1].hasPic"></noMore>
64 64
               </div>
65 65
             </li>
@@ -74,7 +74,7 @@
74 74
                   </div>
75 75
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
76 76
                 </div>
77
-                <myCard v-for="(item,index) in data[2].list" :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 78
                 <noMore v-if="data[2].hasPic"></noMore>
79 79
               </div>
80 80
             </li>
@@ -250,7 +250,7 @@ export default {
250 250
     }),
251 251
     ...mapCardState({
252 252
       cardList: x => x.cardList
253
-    })
253
+    }),
254 254
   },
255 255
   components: {
256 256
     topCaseInfo,
@@ -300,6 +300,7 @@ export default {
300 300
                 SentCount: res.list[n].SentCount,
301 301
                 usedCount: res.list[n].UsedCount,
302 302
                 CardId: res.list[n].CouponId,
303
+                CustomerList: res.list[n].CustomerCoupon || []
303 304
               })
304 305
             }
305 306
             var count = 0
@@ -327,7 +328,8 @@ export default {
327 328
                 totalCount: res.list[n].TotalCount,
328 329
                 SentCount: res.list[n].SentCount,
329 330
                 usedCount: res.list[n].UsedCount,
330
-                CardId: res.list[n].CardId
331
+                CardId: res.list[n].CardId,
332
+                CustomerList: res.list[n].CustomerCard || []
331 333
               })
332 334
             }
333 335
             var count = 0
@@ -369,6 +371,20 @@ export default {
369 371
       const _that = this
370 372
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
371 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
+    },
372 388
     returnInvalid (item, type) {
373 389
       for (var n = 0; n < this.forbidList.length; n++) {
374 390
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
@@ -461,6 +477,12 @@ export default {
461 477
       // that.topCaseInfoData.caseName = that.CaseList[0].CaseName
462 478
       // that.topCaseInfoData.caseId = that.CaseList[0].CaseId
463 479
       if (this.userInfo.customer.MapUser !== '') {
480
+        wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
481
+          title: '城的空间',
482
+          desc: '城的空间',
483
+          link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
484
+          thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
485
+        })
464 486
         this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
465 487
         for (let i = 0; i < this.CaseList.length; i++) {
466 488
           if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
@@ -480,7 +502,7 @@ export default {
480 502
           title: '城的空间',
481 503
           desc: '城的空间',
482 504
           link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
483
-          thu_image: `${window.location.origin}${window.location.pathname}${logo}`
505
+          thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
484 506
         }).then(() => {
485 507
           wx.getLocation({
486 508
             type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
@@ -505,6 +527,7 @@ export default {
505 527
                 }
506 528
               }
507 529
               if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
530
+                that.$toast('当前位置无案场')
508 531
                 that.topCaseInfoData.caseName = '当前位置无案场'
509 532
               }
510 533
             }
@@ -522,6 +545,10 @@ export default {
522 545
     toOrders (subItem, item) {
523 546
       const _that = this
524 547
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
548
+        if (this.checkCanOrder()) {
549
+          _that.$toast('您的点单功能已被关闭!')
550
+          return
551
+        }
525 552
         if (res.Status === 1) {
526 553
           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) } })
527 554
         } else {

+ 1
- 1
src/pages/user/mainPage/index.vue Прегледај датотеку

@@ -26,7 +26,7 @@ export default {
26 26
     return {
27 27
       tabBar: [{
28 28
         pathName: 'indexPage',
29
-        name: '会所'
29
+        name: '城的空间'
30 30
       }, {
31 31
         pathName: 'coffeeIndex',
32 32
         name: '城咖啡'

+ 16
- 4
src/pages/user/mainPage/indexPage/index.vue Прегледај датотеку

@@ -59,9 +59,9 @@
59 59
     </div>
60 60
     <div class="flex-h">
61 61
       <ul class="newsList flex-item">
62
-        <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in newsList" :key="index">
63
-          <newsItem :data="item" @jump='jump'></newsItem>
64
-        </router-link>
62
+        <li @click="jump(item)" v-for="(item,index) in newsList" :key="index">
63
+          <newsItem :data="item"></newsItem>
64
+        </li>
65 65
       </ul>
66 66
     </div>
67 67
   </div>
@@ -84,6 +84,7 @@ export default {
84 84
       locationId: '',
85 85
       swiperOption: {
86 86
         observer: true,
87
+        loop: true,
87 88
         speed: 1000,
88 89
         autoplay: {
89 90
           disableOnInteraction: false,
@@ -91,8 +92,11 @@ export default {
91 92
       },
92 93
       swiperOptionMsg: {
93 94
         observer: true,
95
+        observeParents:true,
96
+        // slidesPerView: 3,
94 97
         direction: 'vertical',
95 98
         speed: 1000,
99
+        // loop: true,
96 100
         autoplay: {
97 101
           disableOnInteraction: false,
98 102
         }
@@ -151,10 +155,18 @@ export default {
151 155
       item.ForwardType = item.ForwardType || ''
152 156
       if (item.ForwardType === 'url') {
153 157
         window.location.href = item.ForwardUrl
158
+        return
154 159
       } else if (item.ForwardType === 'course') {
155
-        this.$router.push({ name: '', query: { id: item.ForwardResourceId } }) // 此处去课程详情
160
+        if (item.ForwardResourceId){
161
+          this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
162
+          return
163
+        } else {
164
+          this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardCourseId } }) // 此处去课程详情
165
+          return
166
+        }
156 167
       } else {
157 168
         window.location.href = item.InfoUrl
169
+        return
158 170
       }
159 171
     }
160 172
   }

+ 7
- 4
src/pages/user/mainPage/userCenter/index.vue Прегледај датотеку

@@ -28,7 +28,7 @@
28 28
             <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
29 29
           </div>
30 30
           <span>卡券</span>
31
-          <span>{{Nums.cardsnum || 0}}张未使用</span>
31
+          <span>0张未使用</span>
32 32
         </div>
33 33
         <div class="flex-item privilege-item" @click="toVip">
34 34
           <div class="img-box">
@@ -84,7 +84,9 @@ export default {
84 84
   mounted () {
85 85
     this.getUserInfo({ org: this.org }).then(() => {
86 86
       this.user = this.userInfo.customer
87
-      this.AccountInfo = JSON.parse(this.user.AccountInfo)
87
+      if (this.user.AccountInfo) {
88
+        this.AccountInfo = JSON.parse(this.user.AccountInfo)
89
+      }
88 90
       this.headimgurl = this.user.Headimgurl
89 91
     })
90 92
     this.getNum()
@@ -110,14 +112,15 @@ export default {
110 112
       this.$router.push({ name: 'orderList' })
111 113
     },
112 114
     toBodyCheck () {
113
-      window.location.href = `${window.location.origin}/c-v2/bodyCheck.html#/`
115
+      var url = window.location.pathname
116
+      window.location.href = url.replace('user.html', 'bodyCheck.html') + '#/'
114 117
     },
115 118
     toLuckdraw () {
116 119
       // ^参数约定为97
117 120
       let userid = this.userInfo.customer.CustomerId
118 121
       let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
119 122
       num = num >= 1000 ? 999 : num
120
-      userid = parseInt(`${userid}${num}`) ^ 97
123
+      userid = `${userid}${num}`
121 124
       window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
122 125
     }
123 126
   }

+ 14
- 55
src/pages/user/majorProjects/index.vue Прегледај датотеку

@@ -68,57 +68,7 @@ export default {
68 68
         }
69 69
       },
70 70
       courseList: [], // 课程列表
71
-      initList: [
72
-        // { // 初始化课程列表
73
-        //   id: '',
74
-        //   title: '课程名称',
75
-        //   img: '',
76
-        //   time: '2018.04.04 18:30-20:00',
77
-        //   address: '南京南',
78
-        //   tag: ['儿童教育', '小小外交官'],
79
-        //   courseType: '团体课',
80
-        //   defaultPrice: '168/节',
81
-        //   getWay: 'ticket',
82
-        //   startDate: 1514779200000,
83
-        //   endDate: 1514781600000,
84
-        // }, {
85
-        //   id: '',
86
-        //   title: '课程名称',
87
-        //   img: '',
88
-        //   time: '2018.04.04 18:30-20:00',
89
-        //   address: '南京南',
90
-        //   tag: ['儿童教育', '小小外交官'],
91
-        //   courseType: '团体课',
92
-        //   defaultPrice: '168/节',
93
-        //   getWay: 'ticket',
94
-        //   startDate: 1514779200000,
95
-        //   endDate: 1514781600000,
96
-        // }, {
97
-        //   id: '',
98
-        //   title: '课程名称',
99
-        //   img: '',
100
-        //   time: '2018.04.04 18:30-20:00',
101
-        //   address: '南京南',
102
-        //   tag: ['儿童教育', '小小外交官'],
103
-        //   courseType: '团体课',
104
-        //   defaultPrice: '168/节',
105
-        //   getWay: 'ticket',
106
-        //   startDate: 1517460000000,
107
-        //   endDate: 1517467200000,
108
-        // }, {
109
-        //   id: '',
110
-        //   title: '课程名称',
111
-        //   img: '',
112
-        //   time: '2018.04.04 18:30-20:00',
113
-        //   address: '南京南',
114
-        //   tag: ['儿童教育', '小小外交官'],
115
-        //   courseType: '团体课',
116
-        //   defaultPrice: '168/节',
117
-        //   getWay: 'ticket',
118
-        //   startDate: 1517460000000,
119
-        //   endDate: 1517467200000,
120
-        // }
121
-      ],
71
+      initList: [],
122 72
     }
123 73
   },
124 74
   computed: {
@@ -151,6 +101,9 @@ export default {
151 101
     ]),
152 102
     returnTag (arr) {
153 103
       var aArr = []
104
+      if (!arr) {
105
+        arr = []
106
+      }
154 107
       for (var n = 0; n < arr.length; n++) {
155 108
         aArr.push(arr[n].TagName)
156 109
       }
@@ -167,18 +120,20 @@ export default {
167 120
       this.getProjectInfo({ id: this.$route.query.id }).then((res) => {
168 121
         // console.log(JSON.stringify(res))
169 122
         // this.initList
170
-        if (res.Courses === null) {
123
+        if (!res.Courses) {
171 124
           res.Courses = []
172 125
         }
173 126
         var aArr = []
174 127
         for (var n = 0; n < res.Courses.length; n++) {
128
+          console.log(this.returnTag(res.Courses[n].CourseTags))
129
+          let tag = res.Courses[n].CourseTags
175 130
           aArr.push({
176 131
             id: res.Courses[n].CourseId,
177 132
             title: res.Courses[n].CourseName,
178 133
             img: res.Courses[n].CourseImg,
179
-            time: this.returnDate(res.Courses[n].BeginDate) + '至' + this.returnDate(res.Courses[n].EndDate),
180
-            address: res.CaseAddress == undefined ? '暂无数据' : res.CaseAddress,
181
-            tag: this.returnTag(res.Courses[n].CourseTags),
134
+            remark: this.toolClass.dateFormat(res.Courses[n].BeginDate, 'yyyy-MM-dd') + '至' + this.toolClass.dateFormat(res.Courses[n].EndDate, 'yyyy-MM-dd'),
135
+            address: res.Courses[n].CaseInfo.CaseAddress,
136
+            tag: tag,
182 137
             courseType: '团体课',
183 138
             defaultPrice: res.Courses[n].Price + '/节',
184 139
             getWay: 'ticket',
@@ -186,12 +141,16 @@ export default {
186 141
             endDate: new Date(res.Courses[n].EndDate).getTime(),
187 142
           })
188 143
         }
144
+        console.log(aArr)
189 145
         this.initList = aArr
190 146
         this.calcArr()
191 147
       })
192 148
     },
193 149
     calcArr () {
194 150
       let arr = []
151
+      if (!this.initList){
152
+        this.initList = []
153
+      }
195 154
       for (var n = 0; n < this.initList.length; n++) {
196 155
         arr.push(new Date(this.initList[n].startDate).getMonth())
197 156
       }

+ 11
- 5
src/pages/user/majorProjectsDetail/index.vue Прегледај датотеку

@@ -4,7 +4,7 @@
4 4
       <div class="content">
5 5
         <div class="banner">
6 6
           <div class="scrollImg">
7
-            <img :src='topImage' class="cover" alt="">
7
+            <img :src='courseDetail.CourseImg' class="cover" alt="">
8 8
             <!-- <swiper :options="swiperOption" ref="mySwiper">
9 9
               <swiper-slide class="swiper-slide" v-for="(item,index) in courseDetail.CourseImgs" :key="index">
10 10
                 <img :src='item.ImgUrl' class="cover" alt="">
@@ -131,14 +131,15 @@ export default {
131 131
         arr = []
132 132
       }
133 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 135
       if (this.courseDetail.CourseImgs.length > 0) {
136
-        this.detailImage = this.courseDetail.CourseImgs.slice(1)
136
+        this.courseDetail.CourseImgs.sort(this.getSortFun('asc', 'Sort'))
137
+        this.detailImage = this.courseDetail.CourseImgs
137 138
       }
138 139
       console.log(this.detailImage)
139 140
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
140 141
       let nowDate = Date.now()
141
-      let endData = new Date(this.courseDetail.CourseDetail[0].EndDate).getTime()
142
+      let endData = new Date(this.courseDetail.EndDate).getTime()
142 143
       if (nowDate > endData) {
143 144
         this.gray = true
144 145
       }
@@ -153,6 +154,11 @@ export default {
153 154
     ...mapProjectActions([
154 155
       'getCourseDetailInfo',
155 156
     ]),
157
+    getSortFun (order, sortBy) {
158
+      var ordAlpah = (order == 'asc') ? '>' : '<'
159
+      var sortFun = new Function('a', 'b', 'return a.' + sortBy + ordAlpah + 'b.' + sortBy + '?1:-1')
160
+      return sortFun
161
+    },
156 162
     returnCourseTime (val, endVal) { // 返回课时时间
157 163
       val = new Date(val)
158 164
       endVal = new Date(endVal)
@@ -186,7 +192,7 @@ export default {
186 192
         title: '城的空间',
187 193
         desc: '城的空间',
188 194
         link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
189
-        thu_image: `${window.location.origin}${window.location.pathname}${logo}`
195
+        thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
190 196
       }).then(() => {
191 197
         let result = this.courseDetail.CaseInfo.Coordinate.split(",")
192 198
         let latitude = parseFloat(result[0])

+ 31
- 10
src/pages/user/placeOrder/index.vue Прегледај датотеку

@@ -9,7 +9,7 @@
9 9
               <span>项目名称:{{caseName}}</span>
10 10
             </div>
11 11
           </div>
12
-          <span>{{userInfo.customer != undefined ? userInfo.customer.CustomerName : ''}}您好!</span>
12
+          <span>{{userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name}}您好!</span>
13 13
         </div>
14 14
       </div>
15 15
       <div class="tableInfo flex-h">
@@ -70,6 +70,13 @@
70 70
     </div>
71 71
     <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
72 72
     <calcMenu :show="showCalcMenu" :totalNum="sumNum + caseTotal.total" :data="selGoods" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
73
+    <div class="successPopup" v-if="showSuccessPopup">
74
+      <div>
75
+        <i class="iconfont icon-gou"></i>
76
+        <div class="text">出单成功</div>
77
+        <div class="back" @click="popBack">返回等待</div>
78
+      </div>
79
+    </div>
73 80
   </div>
74 81
 </template>
75 82
 
@@ -136,6 +143,7 @@ export default {
136 143
         freeModeMomentumVelocityRatio: 2,
137 144
       },
138 145
       selGoods: [],
146
+      showSuccessPopup: false
139 147
     }
140 148
   },
141 149
   computed: {
@@ -258,18 +266,19 @@ export default {
258 266
     },
259 267
     reback () { // 返回桌位选择
260 268
       this.$dialog.confirm({
261
-        title: '提示',
262 269
         message: '返回页面将清空当前选择的商品,确定要返回吗?'
263 270
       }).then(() => {
264 271
         // this.$router.push({ name: 'coffeeIndex' })
265
-        window.history.go(-1)
272
+        // window.history.go(-1)
273
+        this.$router.go(-1)
266 274
       })
267 275
     },
268
-    placeOrder () { // 下单
276
+    placeOrder (Remark) { // 下单
269 277
       this.postData.info.OrgId = this.orgId
270 278
       this.postData.info.UserId = this.userInfo.CustomerId
271 279
       this.postData.info.UserName = this.userInfo.customer.CustomerName
272 280
       this.postData.info.PayType = 'sys user'
281
+      this.postData.info.Remark = Remark
273 282
       var orderInfo = this.selGoods
274 283
       this.postData.detail = []
275 284
       var amount = 0
@@ -294,14 +303,20 @@ export default {
294 303
         detail: JSON.stringify(this.postData.detail),
295 304
         coupon: JSON.stringify(this.postData.coupon)
296 305
       }).then((res) => {
297
-        this.$dialog.alert({
298
-          message: '下单成功!',
299
-          confirmButtonText: '返回等待'
300
-        }).then(() => {
301
-          this.$router.push({ name: 'orderList' })
302
-        })
306
+        this.showCalcMenu = false
307
+        this.showSuccessPopup = true
308
+        // this.$dialog.alert({
309
+        //   message: '下单成功!',
310
+        //   confirmButtonText: '返回等待'
311
+        // }).then(() => {
312
+
313
+        // })
303 314
       })
304 315
     },
316
+    popBack () {
317
+      this.showSuccessPopup = false
318
+      this.$router.push({ name: 'orderList' })
319
+    },
305 320
     closeCalcMenu () { // 关闭已选菜单
306 321
       this.showCalcMenu = false
307 322
     },
@@ -370,3 +385,9 @@ export default {
370 385
 <style lang="scss" scoped>
371 386
 @import 'page.scss';
372 387
 </style>
388
+
389
+<style>
390
+.van-dialog__message {
391
+  text-align: center;
392
+}
393
+</style>

+ 39
- 0
src/pages/user/placeOrder/page.scss Прегледај датотеку

@@ -238,4 +238,43 @@
238 238
       }
239 239
     }
240 240
   }
241
+  .successPopup{
242
+    width: 100%;
243
+    height: 100%;
244
+    position: fixed;
245
+    top: 0;
246
+    left: 0;
247
+    z-index: 2;
248
+    background: rgba(0, 0, 0, .35);
249
+    >div{
250
+      position: absolute;
251
+      top: 50%;
252
+      left: 50%;
253
+      transform: translate(-50%,-50%);
254
+      width: 2.6rem;
255
+      height: 1.7rem;
256
+      background:rgba(255,255,255,1);
257
+      box-shadow:0px 2px 4px 0px rgba(194,194,194,0.5);
258
+      border-radius:4px;
259
+      display: flex;
260
+      flex-flow: column nowrap;
261
+      justify-content: center;
262
+      align-items: center;
263
+      padding: .2rem;
264
+      i{
265
+        color: #000;
266
+        font-size: .36rem;
267
+        margin-bottom: .2rem;
268
+      }
269
+      .text{
270
+        font-size: .16rem;
271
+        margin-bottom: .2rem;
272
+      }
273
+      .back{
274
+        padding: .07rem .3rem;
275
+        border: 1px solid black;
276
+        border-radius: 4px;
277
+      }
278
+    }
279
+  }
241 280
 }

+ 60
- 37
src/pages/user/placeOrderDetail/index.vue Прегледај датотеку

@@ -35,7 +35,7 @@
35 35
       <div class="remark flex-h">
36 36
         <div class="flex-item flex-h">
37 37
           <div class="flex-h">
38
-            <textarea class="flex-item" cols="30" rows="10" v-model="postData.info.Remark"></textarea>
38
+            <textarea class="flex-item" cols="30" rows="6" v-model="postData.info.Remark"></textarea>
39 39
           </div>
40 40
         </div>
41 41
       </div>
@@ -43,6 +43,7 @@
43 43
       <div class="bottom">
44 44
         <a @click="cancel">取消</a>
45 45
         <a @click="toPayer">确定</a>
46
+        <div style="width: 100%;position: absolute;left: 0;bottom: 0;top: 0;" v-if="!ajaxoff"></div>
46 47
       </div>
47 48
     </div>
48 49
     <div class="selectCouponLayer" :class="{'show': showSelectCouponLayer}">
@@ -65,6 +66,13 @@
65 66
         <a @click="sureSelectCoupon">确定</a>
66 67
       </div>
67 68
     </div>
69
+    <div class="successPopup" v-if="showSuccessPopup">
70
+      <div>
71
+        <i class="iconfont icon-gou"></i>
72
+        <div class="text">出单成功</div>
73
+        <div class="back" @click="popBack">返回等待</div>
74
+      </div>
75
+    </div>
68 76
   </div>
69 77
 </template>
70 78
 
@@ -72,15 +80,16 @@
72 80
 import { mapState, createNamespacedHelpers } from 'vuex'
73 81
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
74 82
 import discounts from '../../../components/discounts/discounts'
75
-
76 83
 export default {
77 84
   name: '',
78 85
   data () {
79 86
     var _self = this
80 87
     return {
88
+      ajaxoff: true,
81 89
       showSelectCouponLayer: false,
82 90
       getCouponOff: false,
83 91
       couponList: [], // 优惠券列表
92
+      showSuccessPopup: false,
84 93
       postData: {
85 94
         info: {
86 95
           CaseId: decodeURI(_self.$route.query.caseid),
@@ -122,11 +131,12 @@ export default {
122 131
       // console.log(JSON.stringify(res))
123 132
       var id = JSON.parse(this.$route.query.info)[0].id, arr = [], nowDate = Date.now()
124 133
       for (var n = 0; n < res.length; n++) {
134
+        res[n].Coupon.Targets = res[n].Coupon.Targets || []
125 135
         if (res[n].Coupon.CouponType === 'goods' && res[n].Status === 1) {
126
-          if (res[n].Coupon.IsAll) {
136
+          if (res[n].Coupon.IsAll && nowDate >= new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime() && res[n].CaseId === this.$route.query.caseid) {
127 137
             this.couponList.push({
128 138
               title: res[n].Coupon.CouponName,
129
-              desc: res[n].Coupon.Share.UseInstruction,
139
+              desc: res[n].Coupon.Share.UseRule,
130 140
               time: this.toolClass.dateFormat(res[n].EndDate),
131 141
               useType: '未使用',
132 142
               tag: '商品',
@@ -197,43 +207,56 @@ export default {
197 207
       return [amount, num]
198 208
     },
199 209
     toPayer () { // 下单
200
-      this.postData.info.OrgId = this.orgId
201
-      this.postData.info.UserId = this.userInfo.CustomerId
202
-      this.postData.info.UserName = this.userInfo.customer.CustomerName
203
-      this.postData.info.PayType = this.postData.customercouponid === '' ? 'coupon' : 'vip'
204
-      var orderInfo = JSON.parse(this.$route.query.info)
205
-      this.postData.detail = []
206
-      var amount = 0
207
-      var num = 0
208
-      for (var n = 0; n < orderInfo.length; n++) {
209
-        this.postData.detail.push({
210
-          GoodsId: orderInfo[n].id,
211
-          GoodsName: orderInfo[n].name,
212
-          SpecId: orderInfo[n].spec,
213
-          SpecName: orderInfo[n].specname,
214
-          Number: orderInfo[n].num - 0,
215
-          Price: String(orderInfo[n].price - 0),
210
+      if (this.ajaxoff) {
211
+        this.ajaxoff = false
212
+        this.postData.info.OrgId = this.orgId
213
+        this.postData.info.UserId = this.userInfo.CustomerId
214
+        this.postData.info.UserName = this.userInfo.customer.CustomerName
215
+        this.postData.info.PayType = this.postData.customercouponid === '' ? 'coupon' : 'vip'
216
+        var orderInfo = JSON.parse(this.$route.query.info)
217
+        this.postData.detail = []
218
+        var amount = 0
219
+        var num = 0
220
+        for (var n = 0; n < orderInfo.length; n++) {
221
+          this.postData.detail.push({
222
+            GoodsId: orderInfo[n].id,
223
+            GoodsName: orderInfo[n].name,
224
+            SpecId: orderInfo[n].spec,
225
+            SpecName: orderInfo[n].specname,
226
+            Number: orderInfo[n].num - 0,
227
+            Price: String(orderInfo[n].price - 0),
228
+          })
229
+          amount += (orderInfo[n].price - 0) * orderInfo[n].num
230
+          num += orderInfo[n].num - 0
231
+        }
232
+        this.postData.info.Amount = String(amount)
233
+        this.postData.info.OrdersNum = num
234
+        console.log(JSON.stringify(this.postData))
235
+        this.toPay({
236
+          info: JSON.stringify(this.postData.info),
237
+          detail: JSON.stringify(this.postData.detail),
238
+          customercouponid: this.postData.customercouponid
239
+        }).then((res) => {
240
+          this.showSuccessPopup = true
241
+          // this.$dialog.alert({
242
+          //   message: '下单成功!'
243
+          // }).then(() => {
244
+          //   window.history.go(-2)
245
+          // })
246
+        }).catch(() => {
247
+          this.ajaxoff = true
216 248
         })
217
-        amount += (orderInfo[n].price - 0) * orderInfo[n].num
218
-        num += orderInfo[n].num - 0
219 249
       }
220
-      this.postData.info.Amount = String(amount)
221
-      this.postData.info.OrdersNum = num
222
-      console.log(JSON.stringify(this.postData))
223
-      this.toPay({
224
-        info: JSON.stringify(this.postData.info),
225
-        detail: JSON.stringify(this.postData.detail),
226
-        customercouponid: this.postData.customercouponid
227
-      }).then((res) => {
228
-        this.$dialog.alert({
229
-          message: '下单成功!'
230
-        }).then(() => {
231
-          window.history.go(-2)
232
-        })
233
-      })
250
+    },
251
+
252
+    popBack () {
253
+      this.showSuccessPopup = false
254
+      // window.history.go(-2)
255
+      this.$router.push({name: 'coffeeIndex'})
234 256
     },
235 257
     cancel () {
236
-      window.history.go(-1)
258
+      // window.history.go(-1)
259
+      this.$router.push({name: 'coffeeIndex'})
237 260
     },
238 261
   }
239 262
 }

+ 39
- 0
src/pages/user/placeOrderDetail/page.scss Прегледај датотеку

@@ -299,4 +299,43 @@
299 299
     //   }
300 300
     // }
301 301
   }
302
+  .successPopup{
303
+    width: 100%;
304
+    height: 100%;
305
+    position: fixed;
306
+    top: 0;
307
+    left: 0;
308
+    z-index: 2;
309
+    background: rgba(0, 0, 0, .35);
310
+    >div{
311
+      position: absolute;
312
+      top: 50%;
313
+      left: 50%;
314
+      transform: translate(-50%,-50%);
315
+      width: 2.6rem;
316
+      height: 1.7rem;
317
+      background:rgba(255,255,255,1);
318
+      box-shadow:0px 2px 4px 0px rgba(194,194,194,0.5);
319
+      border-radius:4px;
320
+      display: flex;
321
+      flex-flow: column nowrap;
322
+      justify-content: center;
323
+      align-items: center;
324
+      padding: .2rem;
325
+      i{
326
+        color: #000;
327
+        font-size: .36rem;
328
+        margin-bottom: .2rem;
329
+      }
330
+      .text{
331
+        font-size: .16rem;
332
+        margin-bottom: .2rem;
333
+      }
334
+      .back{
335
+        padding: .07rem .3rem;
336
+        border: 1px solid black;
337
+        border-radius: 4px;
338
+      }
339
+    }
340
+  }
302 341
 }

+ 22
- 12
src/pages/user/placeOrderForCourse/index.vue Прегледај датотеку

@@ -28,7 +28,8 @@
28 28
                     <span>时间描述</span>
29 29
                   </div>
30 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(courseDetail.BeginDate,'yyyy-MM-dd') + ' ~ ' + toolClass.dateFormat(courseDetail.EndDate, 'yyyy-MM-dd')}}</span>
32 33
               </li>
33 34
               <li class="flex-h">
34 35
                 <div class="flex-item">
@@ -73,17 +74,19 @@
73 74
               <div class="flex-h">
74 75
                 <div class="flex-item">
75 76
                   <div>
76
-                    <span>同意《银城精品团课服务协议》</span>
77
+                    <span>同意《城的空间课程服务协议》</span>
77 78
                   </div>
78 79
                 </div>
79 80
                 <i class="iconfont icon-gouxuan" :class="{'active': agreementOff}" @click="agreement"></i>
80 81
               </div>
81 82
             </div>
82 83
             <div class="protocol">
83
-              <div>1. 甲方具有为乙方更换教练的权利及责任。(当甲方为乙方安排的教练因故离职或乙方认 为甲方的教练无法胜任对其的指导工作时,甲方应为乙方另行安排教练)。</div>
84
-              <div>2. 甲方必须保证乙方享有与教练一对多的指导,甲方教练上课中出现违规时乙方有权投诉。</div>
85
-              <div>3. 乙方承诺其身体状况已被医疗机构确认良好,适宜接受本协议约定的训练课程,即身体 状况完全正常,不存在运动风险及潜在运动风险。如若隐瞒,出现后果由乙方自负。</div>
86
-              <div>4. 乙方承诺其身体状况完全符合使用甲方器械以及完成课程内容的条件和能力。若因乙方 未提供既往病史或谎报病史而引起的运动伤害,后果由乙方自负。</div>
84
+              <div>1. 参与城的空间课程的用户,具有完全的法律行为能力,同意遵守相关管理规章制度,应接受城的空间课程的相关服务协议,并已知晓有关的活动、健身规则与警示,承诺遵守城的空间课程的相关规定。</div>
85
+              <div>2. 在确认本协议前,用户应了解自身身体情况,以确保用户具备参与城的空间课程的身体条件,并且没有任何不宜运动的疾病、损伤和其他缺陷。因用户自身的任何疾病、损伤和其他缺陷导致用户在接收服务时发生任何损害的,城的空间不承担任何法律责任。。</div>
86
+              <div>3. 以下人群不能参加城的空间健身课程:手术后3月内的人群、有心血管疾病者、不能剧烈运动伤者、孕妇及哺乳期女性、产后不足6月内的人群,上课时如有隐瞒,所发生的一切后果及对他人产生的后果城的空间课程及教练均不负任何责任。如因此造成第三人损害的,由其承担赔偿责任。在课程中感到任何不适的,请及时告知课程教练,否则,如果发生身体损害,城的空间不承担法律责任。</div>
87
+              <div>4. 为了用户的健身安全,用户训练时需穿着专业的运动服、运动鞋及运动装备。运动期间,不得参与违反国家法律法规的活动、不得穿着违反道德规范的服饰进行运动。</div>
88
+              <div>5. 用户在参加健身锻炼时请勿携带珠宝饰品等贵重物品,以免丢失或造成意外。物品遗失概不负责。</div>
89
+              <div>6. 请您认真阅读以上内容,报名成功即认为您同意此服务协议。</div>
87 90
             </div>
88 91
           </div>
89 92
         </div>
@@ -162,14 +165,15 @@ export default {
162 165
   created () {
163 166
     this.getCouponList().then((res) => {
164 167
       this.getCourseDetailInfo({ id: this.$route.query.id }).then((result) => {
165
-        var arr = result.CourseDetail
166
-        console.log(arr)
168
+        var arr = result.CourseDetail, caseid = result.CaseId
169
+        // console.log(arr)
167 170
         this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
168 171
         var id = this.$route.query.id, arr = [], nowDate = Date.now()
169 172
         for (var n = 0; n < res.length; n++) {
170
-          console.log(res[n])
173
+          // console.log(res[n])
174
+          res[n].Coupon.Targets = res[n].Coupon.Targets || []
171 175
           if (res[n].Coupon.CouponType === 'course' && res[n].Status === 1) {
172
-            if (res[n].Coupon.IsAll) {
176
+            if (res[n].Coupon.IsAll && res[n].CaseId === caseid && nowDate > new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime()) {
173 177
               this.couponList.push({
174 178
                 title: res[n].Coupon.CouponName,
175 179
                 desc: res[n].Coupon.Share.UseInstruction,
@@ -182,7 +186,7 @@ export default {
182 186
               })
183 187
             } else {
184 188
               for (var a = 0; a < res[n].Coupon.Targets.length; a++) {
185
-                if (res[n].Coupon.Targets[a].TargetId === id && nowDate >= new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime()) {
189
+                if (res[n].Coupon.Targets[a].TargetId === id && nowDate > new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime() && res[n].CaseId === caseid) {
186 190
                   this.couponList.push({
187 191
                     title: res[n].Coupon.CouponName,
188 192
                     desc: res[n].Coupon.Share.UseInstruction,
@@ -250,7 +254,7 @@ export default {
250 254
       }).then((res) => {
251 255
         // console.log(JSON.stringify(res))
252 256
         this.$dialog.alert({
253
-          message: '下单成功!'
257
+          title: '下单成功!'
254 258
         }).then(() => {
255 259
           // this.$router.push({name: 'majorProjects'})
256 260
           window.history.go(-2)
@@ -292,3 +296,9 @@ export default {
292 296
 <style lang="scss" scoped>
293 297
 @import 'page.scss';
294 298
 </style>
299
+
300
+<style lang="scss">
301
+.van-dialog{
302
+  width: 60% !important;
303
+}
304
+</style>

+ 11
- 12
src/pages/user/receive/index.vue Прегледај датотеку

@@ -1,21 +1,20 @@
1 1
 <template>
2 2
   <div class="mainPage" v-if="show">
3
-    <!-- <div class="residue">
4
-      <i class="iconfont icon-gantanhao"></i>
5
-      <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
6
-    </div>
7
-    <div class="logo">
8
-      <img :src="logo" alt="">
9
-    </div> -->
10 3
     <div class="banner"  v-if="!video">
11
-      <img :src="data.Images[0].CardImageUrl" alt="" width="100%" height="100%" v-if="type === 'card'">
12
-      <img :src="data.Images[0].CouponImageUrl" alt="" width="100%" height="100%" v-if="type === 'coupon'">
4
+      <img :src="data.Images[0].CardImageUrl" alt="" v-if="type === 'card'">
5
+      <img :src="data.Images[0].CouponImageUrl" alt="" v-if="type === 'coupon'">
13 6
     </div>
14 7
     <div class="content">
15 8
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
16 9
       <div class="title" v-else>{{data.CouponName}}</div>
17 10
       <div class="video" v-if='video'>
18
-        <video :src="data.VideoUrl" width="100%" height="100%"></video>
11
+        <video width="100%" height="100%" preload="auto" controls="controls" x5-playsinline="true" :poster="type === 'card' ? data.Images[0].CardImageUrl : data.Images[0].CouponImageUrl">
12
+          <source :src="data.VideoUrl" type="video/mp4">
13
+          <source :src="data.VideoUrl" type="video/avi">
14
+          <source :src="data.VideoUrl" type="video/wma">
15
+          <source :src="data.VideoUrl" type="video/rmvb">
16
+          <source :src="data.VideoUrl" type="video/rm">
17
+        </video>
19 18
       </div>
20 19
       <div class="text">
21 20
         <div>
@@ -136,10 +135,10 @@ export default {
136 135
     sdk (info) {
137 136
       let logo, title
138 137
       if (this.$route.query.type === 'card') {
139
-        logo = this.data.Images[0].CardImageUrl
138
+        logo = this.data.Images[0].CardImageUrl + '?x-oss-process=style/wxicon'
140 139
         title = this.data.CardName
141 140
       } else {
142
-        logo = this.data.Images[0].CouponImageUrl
141
+        logo = this.data.Images[0].CouponImageUrl + '?x-oss-process=style/wxicon'
143 142
         title = this.data.CouponName
144 143
       }
145 144
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {

+ 4
- 0
src/pages/user/receive/page.scss Прегледај датотеку

@@ -18,6 +18,10 @@
18 18
   .banner{
19 19
     width: 100%;
20 20
     height: 1.8rem;
21
+    text-align: center;
22
+    img{
23
+      height: 100%;
24
+    }
21 25
   }
22 26
   .content{
23 27
     padding: .2rem;

+ 29
- 11
src/pages/user/receiveChannel/index.vue Прегледај датотеку

@@ -1,21 +1,29 @@
1 1
 <template>
2 2
   <div class="mainPage" v-if="show">
3
+    <!-- <video :src="data.VideoUrl" height="100%" width="100%" preload="auto" ></video> -->
3 4
     <div class="residue">
4 5
       <i class="iconfont icon-gantanhao"></i>
5
-      <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
6
+      <span>仅剩{{data.TotalCount - data.SentCount}}张券可以领取!</span>
6 7
     </div>
7 8
     <div class="logo">
8 9
       <img :src="logo" alt="">
9 10
     </div>
10 11
     <div class="banner"  v-if="!video">
11
-      <img :src="data.Images[0].CardImageUrl" alt="" width="100%" height="100%" v-if="type === 'card'">
12
-      <img :src="data.Images[0].CouponImageUrl" alt="" width="100%" height="100%" v-if="type === 'coupon'">
12
+      <img :src="data.Images[0].CardImageUrl" alt="" v-if="type === 'card'">
13
+      <img :src="data.Images[0].CouponImageUrl" alt="" v-if="type === 'coupon'">
13 14
     </div>
14 15
     <div class="content">
15 16
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
16 17
       <div class="title" v-else>{{data.CouponName}}</div>
17 18
       <div class="video" v-if='video'>
18
-        <video :src="data.VideoUrl" width="100%" height="100%"></video>
19
+
20
+        <video width="100%" height="100%" preload="auto" x5-playsinline="true" controls="controls" :poster="type === 'card' ? data.Images[0].CardImageUrl : data.Images[0].CouponImageUrl">
21
+          <source :src="data.VideoUrl" type="video/mp4">
22
+          <source :src="data.VideoUrl" type="video/avi">
23
+          <source :src="data.VideoUrl" type="video/wma">
24
+          <source :src="data.VideoUrl" type="video/rmvb">
25
+          <source :src="data.VideoUrl" type="video/rm">
26
+        </video>
19 27
       </div>
20 28
       <div class="text">
21 29
         <div>
@@ -30,7 +38,8 @@
30 38
           <i class="icon-kaquan iconfont"></i>
31 39
           <span>卡券有效期</span>
32 40
         </div>
33
-        <pre>有效期至{{toolClass.dateFormat(data.EndDate,'yyyy-MM-dd')}},请在有效期结束前使用, 过期作废;</pre>
41
+        <pre v-if="data.ValidDays>0">领取后{{data.ValidDays}}天有效,请在有效期结束前使用, 过期作废;</pre>
42
+        <pre v-else>有效期至{{toolClass.dateFormat(data.EndDate,'yyyy-MM-dd')}},请在有效期结束前使用, 过期作废;</pre>
34 43
       </div>
35 44
       <div class="text">
36 45
         <div>
@@ -39,8 +48,9 @@
39 48
         </div>
40 49
         <pre>{{data.address}}</pre>
41 50
       </div>
42
-      <div class="submit" v-if="button" @click="receive">确认领取</div>
43
-      <div class="submit" v-else>点击右上角分享给客户</div>
51
+      <div class="submit" v-if="button && data.TotalCount - data.SentCount > 0" @click="receive">确认领取</div>
52
+      <div class="submit grays" v-if="button && data.TotalCount - data.SentCount <= 0">优惠券已领完</div>
53
+      <div class="submit" v-if="!button">点击右上角分享给客户</div>
44 54
     </div>
45 55
   </div>
46 56
 </template>
@@ -97,7 +107,11 @@ export default {
97 107
       if (this.$route.query.type === 'card') {
98 108
         this.getCardShare({ id: this.$route.query.id }).then(() => {
99 109
           this.data = this.cardShare.Card
100
-          this.data.address = this.caseList.filter(x => x.CaseId === this.data.CaseId)[0].CaseAddress
110
+          let arr = this.caseList.filter(x => x.CaseId === this.data.CaseId)
111
+          if (arr.length <= 0) {
112
+            arr.push({ CaseAddress: '' })
113
+          }
114
+          this.data.address = arr[0].CaseAddress
101 115
           if (!this.data.VideoUrl) {
102 116
             this.video = false
103 117
           }
@@ -107,7 +121,11 @@ export default {
107 121
       } else {
108 122
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
109 123
           this.data = this.couponShare.coupon
110
-          this.data.address = this.caseList.filter(x => x.CaseId === this.data.CaseId)[0].CaseAddress
124
+          let arr = this.caseList.filter(x => x.CaseId === this.data.CaseId)
125
+          if (arr.length <= 0) {
126
+            arr.push({ CaseAddress: '' })
127
+          }
128
+          this.data.address = arr[0].CaseAddress
111 129
           if (!this.data.VideoUrl) {
112 130
             this.video = false
113 131
           }
@@ -136,10 +154,10 @@ export default {
136 154
     sdk (info) {
137 155
       let logo, title
138 156
       if (this.$route.query.type === 'card') {
139
-        logo = this.data.Images[0].CardImageUrl
157
+        logo = this.data.Images[0].CardImageUrl + '?x-oss-process=style/wxicon'
140 158
         title = this.data.CardName
141 159
       } else {
142
-        logo = this.data.Images[0].CouponImageUrl
160
+        logo = this.data.Images[0].CouponImageUrl + '?x-oss-process=style/wxicon'
143 161
         title = this.data.CouponName
144 162
       }
145 163
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {

+ 7
- 0
src/pages/user/receiveChannel/page.scss Прегледај датотеку

@@ -18,6 +18,10 @@
18 18
   .banner{
19 19
     width: 100%;
20 20
     height: 1.8rem;
21
+    text-align: center;
22
+    img{
23
+      height: 100%;
24
+    }
21 25
   }
22 26
   .content{
23 27
     padding: .2rem;
@@ -59,5 +63,8 @@
59 63
       font-size: .16rem;
60 64
       color: #fff;
61 65
     }
66
+    .grays{
67
+      background: #585858;
68
+    }
62 69
   }
63 70
 }

+ 5
- 0
src/store/index/index.js Прегледај датотеку

@@ -94,12 +94,15 @@ export default {
94 94
   },
95 95
   mutations: {
96 96
     setBanner (state, data) { // 获取首页轮播图
97
+      data = data || []
97 98
       state.banner = data
98 99
     },
99 100
     setFiveA (state, data) { // 获取5A
101
+      data = data || []
100 102
       state.fiveA = data
101 103
     },
102 104
     setMessage (state, data) { // 获取首页消息
105
+      data = data || []
103 106
       if (data.length > 3) {
104 107
         state.message = data.slice(0,3)
105 108
       } else {
@@ -107,9 +110,11 @@ export default {
107 110
       }
108 111
     },
109 112
     setProject (state, data) { // 获取项目专题
113
+      data = data || []
110 114
       state.project = data
111 115
     },
112 116
     setCms (state, data) { // 获取cms
117
+      data = data || []
113 118
       state.cms = data
114 119
     }
115 120
   },

+ 7
- 3
src/store/login/login.js Прегледај датотеку

@@ -38,16 +38,20 @@ export default {
38 38
   mutations: {},
39 39
   actions: {
40 40
     getCaptcha ({ commit }, data) {
41
-      return new Promise((resolve) => {
41
+      return new Promise((resolve, reject) => {
42 42
         http.getCaptcha(data).then((res) => {
43 43
           resolve(res)
44
+        }).catch((err) => {
45
+          reject(err)
44 46
         })
45 47
       })
46 48
     },
47
-    submitData({ commit }, data) {
48
-      return new Promise((resolve) => {
49
+    submitData ({ commit }, data) {
50
+      return new Promise((resolve, reject) => {
49 51
         http.submitData(data).then((res) => {
50 52
           resolve(res)
53
+        }).catch((err) => {
54
+          reject(err)
51 55
         })
52 56
       })
53 57
     }

+ 3
- 1
src/store/placeOrderForCoffee/index.js Прегледај датотеку

@@ -64,7 +64,7 @@ export default {
64 64
       })
65 65
     },
66 66
     toPay (context, { info, detail, customercouponid }) { // 下单
67
-      return new Promise((resolve) => {
67
+      return new Promise((resolve, reject) => {
68 68
         Ajax(api.caseForCoffee.placeGoodsOrder.url, {
69 69
           method: api.caseForCoffee.placeGoodsOrder.method,
70 70
           data: {
@@ -74,6 +74,8 @@ export default {
74 74
           },
75 75
         }).then(res => {
76 76
           resolve(res)
77
+        }).catch(() => {
78
+          reject()
77 79
         })
78 80
       })
79 81
     },

+ 3
- 1
src/store/userCenter/userCenter.js Прегледај датотеку

@@ -240,9 +240,11 @@ export default {
240 240
       })
241 241
     },
242 242
     submitData (context, data) {
243
-      return new Promise((resolve) => {
243
+      return new Promise((resolve,reject) => {
244 244
         http.submitData(data).then((res) => {
245 245
           resolve(res)
246
+        }).catch(() => {
247
+          reject()
246 248
         })
247 249
       })
248 250
     }

+ 20
- 9
src/util/ajax.js Прегледај датотеку

@@ -5,12 +5,12 @@ import router from '../pages/user/router'
5 5
 import { Toast } from '../../node_modules/vant';
6 6
 
7 7
 const token = function (headers) {
8
-  let JWT
8
+  let JWT = ''
9 9
   if (headers) {
10 10
     localStorage.setItem('JWT', headers.authorization)
11 11
     JWT = headers.authorization
12 12
   }
13
-  const token = JWT ? JWT : localStorage.getItem('JWT')
13
+  const token = JWT ? JWT : localStorage.getItem('JWT') // eslint-disable-line
14 14
 
15 15
   return !token ? '' : token
16 16
 }
@@ -29,16 +29,16 @@ const Axios = axios.create({
29 29
 
30 30
 Axios.interceptors.request.use((config) => {
31 31
   config.headers.authorization = token()
32
+  // config.urlData = { ...config.urlData,  }
32 33
   // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
33
-  config.urlData = { ...config.urlData, org: 'MQ' }
34
+  let urlData = qs.stringify(config.urlData)
34 35
   let queryData = qs.stringify(config.queryData)
35
-  // 判断是通过斜杠传参还是通过query传参
36
+  // 判断是通过斜杠传参
36 37
   if (config.url.indexOf(':') > -1) {
37 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 44
   if (queryData) {
@@ -47,7 +47,9 @@ Axios.interceptors.request.use((config) => {
47 47
   let fm = new FormData()
48 48
   for (let k in config.data) {
49 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 53
     } else {
52 54
       fm.append(k, config.data[k])
53 55
     }
@@ -98,3 +100,12 @@ const ajax = (...args) => {
98 100
 }
99 101
 
100 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
+}

+ 1
- 1
src/util/share.js Прегледај датотеку

@@ -3,7 +3,7 @@ import api from './api'
3 3
 
4 4
 function wxsdk (params, config) {
5 5
   const wx = require('weixin-js-sdk')
6
-
6
+  console.log(config)
7 7
   const shareData = {
8 8
     title: config.title, // 分享标题
9 9
     desc: config.desc, // 分享标题