瀏覽代碼

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

许成详 6 年之前
父節點
當前提交
9c158c9b49
共有 46 個檔案被更改,包括 601 行新增313 行删除
  1. 二進制
      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

二進制
src/common/icon/bottomMsg.png 查看文件


+ 3
- 3
src/components/calcMenu/index.vue 查看文件

26
               <span>备注:</span>
26
               <span>备注:</span>
27
               <div class="flex-item">
27
               <div class="flex-item">
28
                 <div>
28
                 <div>
29
-                  <textarea cols="30" rows="3"></textarea>
29
+                  <textarea cols="30" rows="3" v-model="Remark"></textarea>
30
                 </div>
30
                 </div>
31
               </div>
31
               </div>
32
             </div>
32
             </div>
48
   props: ['show', 'data', 'totalNum'],
48
   props: ['show', 'data', 'totalNum'],
49
   data () {
49
   data () {
50
     return {
50
     return {
51
-
51
+      Remark:''
52
     }
52
     }
53
   },
53
   },
54
   computed: {
54
   computed: {
65
       this.$emit('closeCalcMenu')
65
       this.$emit('closeCalcMenu')
66
     },
66
     },
67
     placeOrder () { // 点单
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
       </div>
18
       </div>
19
     </div>
19
     </div>
20
     <div class="useType">
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
     </div>
23
     </div>
24
   </div>
24
   </div>
25
 </template>
25
 </template>

+ 11
- 4
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>
24
       </div>
24
       </div>
25
       <div>
25
       <div>
26
         <span>用户领取</span>
26
         <span>用户领取</span>
27
-        <span>{{data.SentCount}}</span>
27
+        <span>{{ismanager?data.SentCount:data.CustomerList.length}}</span>
28
       </div>
28
       </div>
29
       <div>
29
       <div>
30
         <span>用户使用</span>
30
         <span>用户使用</span>
31
-        <span>{{data.usedCount}}</span>
31
+        <span>{{ismanager?data.usedCount:data.CustomerList.filter(x => x.Status===2).length}}</span>
32
       </div>
32
       </div>
33
     </div>
33
     </div>
34
     <div class="card-bottom" @click.stop="share">
34
     <div class="card-bottom" @click.stop="share">
58
     isgrey: {
58
     isgrey: {
59
       type: Boolean,
59
       type: Boolean,
60
       default: false
60
       default: false
61
+    },
62
+    ismanager: {
63
+      type: Boolean,
64
+      default: false
61
     }
65
     }
62
   },
66
   },
63
   methods: {
67
   methods: {
69
           this.$emit('share', this.data)
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
       </div>
27
       </div>
28
     </div>
28
     </div>
29
     <div v-else class="nodata">
29
     <div v-else class="nodata">
30
-        暂无体检数据 .
30
+        暂无体检数据
31
     </div>
31
     </div>
32
     <div class="bg-white" :hidden="ishidden">
32
     <div class="bg-white" :hidden="ishidden">
33
     </div>
33
     </div>

+ 55
- 52
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">
44
               <span>销售名称</span>
44
               <span>销售名称</span>
45
               <div class="flex-item">
45
               <div class="flex-item">
46
                 <div>
46
                 <div>
47
-                  <span>实际使用</span>
47
+                  <span>用户领取</span>
48
                 </div>
48
                 </div>
49
               </div>
49
               </div>
50
-              <span>用户领取</span>
50
+              <span>实际使用</span>
51
             </li>
51
             </li>
52
             <li class="flex-h" v-for="(item,index) in data.CustomerCard" :key="index">
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
               <div class="flex-item">
54
               <div class="flex-item">
55
                 <div>
55
                 <div>
56
-                  <span>{{salesData(item).receive}}</span>
56
+                  <span>{{item.ReceiveNum}}</span>
57
                 </div>
57
                 </div>
58
               </div>
58
               </div>
59
-              <span>{{salesData(item).used}}</span>
59
+              <span>{{item.UsedNum}}</span>
60
             </li>
60
             </li>
61
           </ul>
61
           </ul>
62
         </div>
62
         </div>
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 () {
79
     if (this.$route.query.type === 'card') {
80
     if (this.$route.query.type === 'card') {
80
       this.getCardNum({ id: this.$route.query.id }).then(() => {
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
     } else {
88
     } else {
87
       this.getCouponNum({ id: this.$route.query.id }).then(() => {
89
       this.getCouponNum({ id: this.$route.query.id }).then(() => {
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 || []
91
-        })
93
+          this.showPage = true
94
+        // })
92
       })
95
       })
93
     }
96
     }
94
   },
97
   },
95
   computed: {
98
   computed: {
96
     ...mapForbidState({
99
     ...mapForbidState({
97
-      salesList: x => x.salesList,
100
+      // salesList: x => x.salesList,
98
       cardAndCoupon: x => x.cardAndCoupon
101
       cardAndCoupon: x => x.cardAndCoupon
99
     })
102
     })
100
   },
103
   },
101
   methods: {
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
 </script>
146
 </script>

+ 22
- 7
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.Name : ''"></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>
9
           <li class="customer-card">
9
           <li class="customer-card">
10
             <div class="list-box">
10
             <div class="list-box">
11
               <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @record='record'></customerCard>
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
             </div>
14
             </div>
14
           </li>
15
           </li>
15
         </ul>
16
         </ul>
31
 import active from '../../../common/icon/check-box-checked.png'
32
 import active from '../../../common/icon/check-box-checked.png'
32
 import normal from '../../../common/icon/check-box-empty.png'
33
 import normal from '../../../common/icon/check-box-empty.png'
33
 import topCaseInfo from '../../../components/topCaseInfo/index'
34
 import topCaseInfo from '../../../components/topCaseInfo/index'
35
+import noMore from '../../../components/noMore/noMore'
34
 import { mapState, createNamespacedHelpers } from 'vuex'
36
 import { mapState, createNamespacedHelpers } from 'vuex'
35
 const { mapActions: actions } = createNamespacedHelpers('app')
37
 const { mapActions: actions } = createNamespacedHelpers('app')
36
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
38
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
51
         normal: normal
53
         normal: normal
52
       },
54
       },
53
       ajaxOff: false,
55
       ajaxOff: false,
56
+      hasPic: false,
54
       key: '',
57
       key: '',
55
       mask: true,
58
       mask: true,
56
       checked: true,
59
       checked: true,
70
   components: {
73
   components: {
71
     customerCard,
74
     customerCard,
72
     topCaseInfo,
75
     topCaseInfo,
76
+    noMore
73
   },
77
   },
74
   created () {
78
   created () {
75
     this.getCaseList().then((res) => {
79
     this.getCaseList().then((res) => {
96
     ]),
100
     ]),
97
     record (item) {
101
     record (item) {
98
       // console.log(item)
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
     searchMask () {
105
     searchMask () {
102
       this.getCustomerList({
106
       this.getCustomerList({
105
         isrecommend: false,
109
         isrecommend: false,
106
         key: this.key,
110
         key: this.key,
107
       }).then((res) => {
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
         this.mask = false
128
         this.mask = false
114
         this.ajaxOff = true
129
         this.ajaxOff = true
115
       })
130
       })

+ 2
- 2
src/pages/sales/customerSearch/page.scss 查看文件

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

+ 3
- 3
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.Name : ''" @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>
24
               <div class="list-detail" v-for="(item,index) in cardList" :key="index">
24
               <div class="list-detail" v-for="(item,index) in cardList" :key="index">
25
                 <span>{{item.CustomerCardName}}</span>
25
                 <span>{{item.CustomerCardName}}</span>
26
                 <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
26
                 <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
27
-                <span>已使用</span>
27
+                <span>{{item.VerifyStatus === "useable"?"未使用":"已使用"}}</span>
28
               </div>
28
               </div>
29
               <span class="noData" v-if="cardAjaxOff && !cardList.length">暂无数据</span>
29
               <span class="noData" v-if="cardAjaxOff && !cardList.length">暂无数据</span>
30
             </div>
30
             </div>
32
               <div class="list-detail" v-for="(item,index) in couponList" :key="index">
32
               <div class="list-detail" v-for="(item,index) in couponList" :key="index">
33
                 <span>{{item.CustomerCouponName}}</span>
33
                 <span>{{item.CustomerCouponName}}</span>
34
                 <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
34
                 <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
35
-                <span>已使用</span>
35
+                <span>{{item.Status === 2?"已使用":"未使用"}}</span>
36
               </div>
36
               </div>
37
               <span class="noData" v-if="couponAjaxOff && !couponList.length">暂无数据</span>
37
               <span class="noData" v-if="couponAjaxOff && !couponList.length">暂无数据</span>
38
             </div>
38
             </div>

+ 16
- 10
src/pages/sales/login/index.vue 查看文件

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

+ 11
- 5
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.Name : ''" @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>
8
       <ul class="flex-h">
8
       <ul class="flex-h">
9
         <li class="flex-item" :class="{'active': activeIndex === 0}" @click="cutNav(0)">
9
         <li class="flex-item" :class="{'active': activeIndex === 0}" @click="cutNav(0)">
10
           <span>饮品</span>
10
           <span>饮品</span>
11
-          <span>(已赠送{{data.OrdersDetail.length}}杯)</span>  
11
+          <span>(已赠送{{drinkNumber}}杯)</span>  
12
         </li> 
12
         </li> 
13
         <li class="flex-item" :class="{'active': activeIndex === 1}" @click="cutNav(1)">
13
         <li class="flex-item" :class="{'active': activeIndex === 1}" @click="cutNav(1)">
14
           <span>卡券</span>
14
           <span>卡券</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>
75
         caseId: '',
75
         caseId: '',
76
         showSelect: false
76
         showSelect: false
77
       },
77
       },
78
-      data: {}
78
+      data: {},
79
+      drinkNumber: 0
79
     }
80
     }
80
   },
81
   },
81
   computed: {
82
   computed: {
105
       this.data.CustomerCoupon = this.data.CustomerCoupon ? this.data.CustomerCoupon : []
106
       this.data.CustomerCoupon = this.data.CustomerCoupon ? this.data.CustomerCoupon : []
106
       this.data.OrdersDetail = this.data.OrdersDetail ? this.data.OrdersDetail : []
107
       this.data.OrdersDetail = this.data.OrdersDetail ? this.data.OrdersDetail : []
107
       this.data.allCard = this.data.CustomerCard.concat(this.data.CustomerCoupon)
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
   methods: {
116
   methods: {

+ 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.Name : ''" @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>

+ 7
- 7
src/pages/user/App.vue 查看文件

1
 <template>
1
 <template>
2
   <div id="app" v-if="showPage">
2
   <div id="app" v-if="showPage">
3
-    <router-view ></router-view>
3
+    <router-view></router-view>
4
   </div>
4
   </div>
5
 </template>
5
 </template>
6
 
6
 
34
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
34
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
35
       this.showPage = true
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
   methods: {
44
   methods: {
45
     ...actions(['getUserInfo'])
45
     ...actions(['getUserInfo'])

+ 2
- 0
src/pages/user/app.js 查看文件

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

+ 12
- 2
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">
24
 
24
 
25
         <div class="sms">
25
         <div class="sms">
26
           <i class="iconfont icon-mima"></i>
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
           <div class="sand color" v-if="seconds === 61" @click="sandMsg">发送验证码</div>
28
           <div class="sand color" v-if="seconds === 61" @click="sandMsg">发送验证码</div>
29
           <div class="sand" v-else>{{seconds}}后可重发</div>
29
           <div class="sand" v-else>{{seconds}}后可重发</div>
30
         </div>
30
         </div>
65
 import logo from '../../../common/icon/logo.png'
65
 import logo from '../../../common/icon/logo.png'
66
 import { mapState, createNamespacedHelpers } from 'vuex'
66
 import { mapState, createNamespacedHelpers } from 'vuex'
67
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
67
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
68
+let canSubmit
68
 export default {
69
 export default {
69
   data () {
70
   data () {
70
     return {
71
     return {
90
     })
91
     })
91
   },
92
   },
92
   created () {
93
   created () {
94
+    canSubmit = true
93
     this.getCaseInfo(1).then(() => {
95
     this.getCaseInfo(1).then(() => {
94
       this.columns = this.caseInfo.cases
96
       this.columns = this.caseInfo.cases
95
     })
97
     })
163
       }, 1000)
165
       }, 1000)
164
     },
166
     },
165
     submit () {
167
     submit () {
168
+      if (!canSubmit){
169
+        return
170
+      }
171
+      canSubmit = false
166
       if (!this.postData.captcha) {
172
       if (!this.postData.captcha) {
167
         this.$toast('请填写验证码')
173
         this.$toast('请填写验证码')
174
+        canSubmit = true
168
         return
175
         return
169
       }
176
       }
170
       // if (!this.postData.case) {
177
       // if (!this.postData.case) {
187
             window.history.go(-1)
194
             window.history.go(-1)
188
           }, 2000)
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
         justify-content: space-between;
82
         justify-content: space-between;
83
         span{
83
         span{
84
           color: rgba(168,182,200,1);
84
           color: rgba(168,182,200,1);
85
+          white-space: nowrap;
85
         }
86
         }
86
         i{
87
         i{
87
           color: rgba(168,182,200,1);
88
           color: rgba(168,182,200,1);
88
-          padding-left: .14rem;
89
           font-size: .12rem;
89
           font-size: .12rem;
90
         }
90
         }
91
         div{
91
         div{
99
           padding: .1rem;
99
           padding: .1rem;
100
           box-sizing: border-box;
100
           box-sizing: border-box;
101
           span{
101
           span{
102
-            width: 70%;
102
+            width: 85%;
103
             overflow:hidden;
103
             overflow:hidden;
104
             text-overflow:ellipsis;
104
             text-overflow:ellipsis;
105
             white-space:nowrap;
105
             white-space:nowrap;

+ 12
- 2
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 = '已使用'
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
           this.data[0].list.push({
135
           this.data[0].list.push({
126
             title: res[n].CustomerCardName,
136
             title: res[n].CustomerCardName,
127
             desc: res[n].Share.CardUseRule,
137
             desc: res[n].Share.CardUseRule,
128
             time: this.toolClass.dateFormat(res[n].EndDate, 'yyyy-MM-dd'),
138
             time: this.toolClass.dateFormat(res[n].EndDate, 'yyyy-MM-dd'),
129
-            useType: res[n].Status === 1 ? '未使用' : '已使用',
139
+            useType: useType,
130
             tag: '共享',
140
             tag: '共享',
131
             CustomerCourseId: res[n].CustomerCourseId,
141
             CustomerCourseId: res[n].CustomerCourseId,
132
             CustomerCardId: res[n].CustomerCardId
142
             CustomerCardId: res[n].CustomerCardId
133
           })
143
           })
134
         }
144
         }
135
       } else {
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
       <div class="message">
5
       <div class="message">
6
         <div>
6
         <div>
7
           <span>{{info.CustomerCardName}}</span>
7
           <span>{{info.CustomerCardName}}</span>
8
-          <!-- <span class="sub">(可在银城会所健身房和游泳池使用)</span> -->
9
         </div>
8
         </div>
10
         <div>
9
         <div>
11
           <span>有效时间</span>
10
           <span>有效时间</span>
14
       </div>
13
       </div>
15
       <div class="rule">
14
       <div class="rule">
16
         <div>使用规则</div>
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
       </div>
17
       </div>
19
       <div class="line">
18
       <div class="line">
20
         <img :src="Artboard" alt="" width="100%">
19
         <img :src="Artboard" alt="" width="100%">

+ 13
- 3
src/pages/user/coupons/index.vue 查看文件

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

+ 4
- 3
src/pages/user/couponsDetail/index.vue 查看文件

8
         </div>
8
         </div>
9
         <div>
9
         <div>
10
           <span>有效时间:</span>
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
         </div>
12
         </div>
13
       </div>
13
       </div>
14
       <div class="rule">
14
       <div class="rule">
15
         <div>使用规则</div>
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
         <div>2. 此卡不可多人使用,一人记一次。 </div>
18
         <div>2. 此卡不可多人使用,一人记一次。 </div>
18
         <div>3. 非会员可凭此卡享受对应课程。 </div>
19
         <div>3. 非会员可凭此卡享受对应课程。 </div>
19
-        <div>4. 截止日期至{{toolClass.dateFormat(info.EndDate)}}。 </div>
20
+        <div>4. 截止日期至{{toolClass.dateFormat(info.EndDate)}}。 </div> -->
20
       </div>
21
       </div>
21
       <div class="line">
22
       <div class="line">
22
         <img :src="Artboard" alt="" width="100%">
23
         <img :src="Artboard" alt="" width="100%">

+ 29
- 15
src/pages/user/fiveA/index.vue 查看文件

25
             <!-- <span v-if="fiveANoData" style="width:100%;line-height:.3rem;display:block;text-align:center;color:#ccc;margin-bottom:.1rem;">暂无数据</span> -->
25
             <!-- <span v-if="fiveANoData" style="width:100%;line-height:.3rem;display:block;text-align:center;color:#ccc;margin-bottom:.1rem;">暂无数据</span> -->
26
           </div>
26
           </div>
27
           <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
27
           <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
28
-          <h5>{{item.Consult}}</h5>
28
+          <h5>{{item.Consult || '资讯'}}</h5>
29
           <div class="newsList flex-h">
29
           <div class="newsList flex-h">
30
             <ul class="flex-item">
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
             </ul>
34
             </ul>
35
           </div>
35
           </div>
36
         </div>
36
         </div>
58
       swiperOption: {
58
       swiperOption: {
59
         observer: true,
59
         observer: true,
60
         loop: true,
60
         loop: true,
61
+        speed: 1000,
61
         autoplay: {
62
         autoplay: {
62
           disableOnInteraction: false,
63
           disableOnInteraction: false,
63
         }
64
         }
83
     const _that = this
84
     const _that = this
84
     this.getLocationDetails().then(res => {
85
     this.getLocationDetails().then(res => {
85
       _that.locations = res
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
   methods: {
98
   methods: {
94
     },
104
     },
95
     courseInfo (course) {
105
     courseInfo (course) {
96
       return {
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
     // returnCourseList (arr) { // 转换课程列表格式
118
     // returnCourseList (arr) { // 转换课程列表格式
109
     //   for (var n = 0; n < arr.length; n++) {
119
     //   for (var n = 0; n < arr.length; n++) {
116
       if (item.ForwardType === 'url') {
126
       if (item.ForwardType === 'url') {
117
         window.location.href = item.ForwardUrl
127
         window.location.href = item.ForwardUrl
118
       } else if (item.ForwardType === 'course') {
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
       } else {
134
       } else {
121
         window.location.href = item.InfoUrl
135
         window.location.href = item.InfoUrl
122
       }
136
       }

+ 1
- 1
src/pages/user/gymCardDetail/index.vue 查看文件

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

+ 9
- 7
src/pages/user/lessonDetail/index.vue 查看文件

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

+ 6
- 1
src/pages/user/lessonDetail/page.scss 查看文件

66
   }
66
   }
67
   .useType{
67
   .useType{
68
     position: absolute;
68
     position: absolute;
69
-    bottom: 3.2rem;
69
+    top: 3.3rem;
70
     right: .5rem;
70
     right: .5rem;
71
     width: .76rem;
71
     width: .76rem;
72
     height: .76rem;
72
     height: .76rem;
75
     font-size: .12rem;
75
     font-size: .12rem;
76
     color: #FC6243 !important;
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
   <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.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
           <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
 }

+ 33
- 6
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.Name : ''" @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" :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" :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>
250
     }),
250
     }),
251
     ...mapCardState({
251
     ...mapCardState({
252
       cardList: x => x.cardList
252
       cardList: x => x.cardList
253
-    })
253
+    }),
254
   },
254
   },
255
   components: {
255
   components: {
256
     topCaseInfo,
256
     topCaseInfo,
300
                 SentCount: res.list[n].SentCount,
300
                 SentCount: res.list[n].SentCount,
301
                 usedCount: res.list[n].UsedCount,
301
                 usedCount: res.list[n].UsedCount,
302
                 CardId: res.list[n].CouponId,
302
                 CardId: res.list[n].CouponId,
303
+                CustomerList: res.list[n].CustomerCoupon || []
303
               })
304
               })
304
             }
305
             }
305
             var count = 0
306
             var count = 0
327
                 totalCount: res.list[n].TotalCount,
328
                 totalCount: res.list[n].TotalCount,
328
                 SentCount: res.list[n].SentCount,
329
                 SentCount: res.list[n].SentCount,
329
                 usedCount: res.list[n].UsedCount,
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
             var count = 0
335
             var count = 0
369
       const _that = this
371
       const _that = this
370
       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
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
     returnInvalid (item, type) {
388
     returnInvalid (item, type) {
373
       for (var n = 0; n < this.forbidList.length; n++) {
389
       for (var n = 0; n < this.forbidList.length; n++) {
374
         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) {
461
       // that.topCaseInfoData.caseName = that.CaseList[0].CaseName
477
       // that.topCaseInfoData.caseName = that.CaseList[0].CaseName
462
       // that.topCaseInfoData.caseId = that.CaseList[0].CaseId
478
       // that.topCaseInfoData.caseId = that.CaseList[0].CaseId
463
       if (this.userInfo.customer.MapUser !== '') {
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
         this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
486
         this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
465
         for (let i = 0; i < this.CaseList.length; i++) {
487
         for (let i = 0; i < this.CaseList.length; i++) {
466
           if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
488
           if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
480
           title: '城的空间',
502
           title: '城的空间',
481
           desc: '城的空间',
503
           desc: '城的空间',
482
           link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
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
         }).then(() => {
506
         }).then(() => {
485
           wx.getLocation({
507
           wx.getLocation({
486
             type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
508
             type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
505
                 }
527
                 }
506
               }
528
               }
507
               if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
529
               if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName) {
530
+                that.$toast('当前位置无案场')
508
                 that.topCaseInfoData.caseName = '当前位置无案场'
531
                 that.topCaseInfoData.caseName = '当前位置无案场'
509
               }
532
               }
510
             }
533
             }
522
     toOrders (subItem, item) {
545
     toOrders (subItem, item) {
523
       const _that = this
546
       const _that = this
524
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
547
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
548
+        if (this.checkCanOrder()) {
549
+          _that.$toast('您的点单功能已被关闭!')
550
+          return
551
+        }
525
         if (res.Status === 1) {
552
         if (res.Status === 1) {
526
           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) } })
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
         } else {
554
         } else {

+ 1
- 1
src/pages/user/mainPage/index.vue 查看文件

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

+ 16
- 4
src/pages/user/mainPage/indexPage/index.vue 查看文件

59
     </div>
59
     </div>
60
     <div class="flex-h">
60
     <div class="flex-h">
61
       <ul class="newsList flex-item">
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
       </ul>
65
       </ul>
66
     </div>
66
     </div>
67
   </div>
67
   </div>
84
       locationId: '',
84
       locationId: '',
85
       swiperOption: {
85
       swiperOption: {
86
         observer: true,
86
         observer: true,
87
+        loop: true,
87
         speed: 1000,
88
         speed: 1000,
88
         autoplay: {
89
         autoplay: {
89
           disableOnInteraction: false,
90
           disableOnInteraction: false,
91
       },
92
       },
92
       swiperOptionMsg: {
93
       swiperOptionMsg: {
93
         observer: true,
94
         observer: true,
95
+        observeParents:true,
96
+        // slidesPerView: 3,
94
         direction: 'vertical',
97
         direction: 'vertical',
95
         speed: 1000,
98
         speed: 1000,
99
+        // loop: true,
96
         autoplay: {
100
         autoplay: {
97
           disableOnInteraction: false,
101
           disableOnInteraction: false,
98
         }
102
         }
151
       item.ForwardType = item.ForwardType || ''
155
       item.ForwardType = item.ForwardType || ''
152
       if (item.ForwardType === 'url') {
156
       if (item.ForwardType === 'url') {
153
         window.location.href = item.ForwardUrl
157
         window.location.href = item.ForwardUrl
158
+        return
154
       } else if (item.ForwardType === 'course') {
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
       } else {
167
       } else {
157
         window.location.href = item.InfoUrl
168
         window.location.href = item.InfoUrl
169
+        return
158
       }
170
       }
159
     }
171
     }
160
   }
172
   }

+ 7
- 4
src/pages/user/mainPage/userCenter/index.vue 查看文件

28
             <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
28
             <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
29
           </div>
29
           </div>
30
           <span>卡券</span>
30
           <span>卡券</span>
31
-          <span>{{Nums.cardsnum || 0}}张未使用</span>
31
+          <span>0张未使用</span>
32
         </div>
32
         </div>
33
         <div class="flex-item privilege-item" @click="toVip">
33
         <div class="flex-item privilege-item" @click="toVip">
34
           <div class="img-box">
34
           <div class="img-box">
84
   mounted () {
84
   mounted () {
85
     this.getUserInfo({ org: this.org }).then(() => {
85
     this.getUserInfo({ org: this.org }).then(() => {
86
       this.user = this.userInfo.customer
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
       this.headimgurl = this.user.Headimgurl
90
       this.headimgurl = this.user.Headimgurl
89
     })
91
     })
90
     this.getNum()
92
     this.getNum()
110
       this.$router.push({ name: 'orderList' })
112
       this.$router.push({ name: 'orderList' })
111
     },
113
     },
112
     toBodyCheck () {
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
     toLuckdraw () {
118
     toLuckdraw () {
116
       // ^参数约定为97
119
       // ^参数约定为97
117
       let userid = this.userInfo.customer.CustomerId
120
       let userid = this.userInfo.customer.CustomerId
118
       let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
121
       let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
119
       num = num >= 1000 ? 999 : num
122
       num = num >= 1000 ? 999 : num
120
-      userid = parseInt(`${userid}${num}`) ^ 97
123
+      userid = `${userid}${num}`
121
       window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
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
         }
68
         }
69
       },
69
       },
70
       courseList: [], // 课程列表
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
   computed: {
74
   computed: {
151
     ]),
101
     ]),
152
     returnTag (arr) {
102
     returnTag (arr) {
153
       var aArr = []
103
       var aArr = []
104
+      if (!arr) {
105
+        arr = []
106
+      }
154
       for (var n = 0; n < arr.length; n++) {
107
       for (var n = 0; n < arr.length; n++) {
155
         aArr.push(arr[n].TagName)
108
         aArr.push(arr[n].TagName)
156
       }
109
       }
167
       this.getProjectInfo({ id: this.$route.query.id }).then((res) => {
120
       this.getProjectInfo({ id: this.$route.query.id }).then((res) => {
168
         // console.log(JSON.stringify(res))
121
         // console.log(JSON.stringify(res))
169
         // this.initList
122
         // this.initList
170
-        if (res.Courses === null) {
123
+        if (!res.Courses) {
171
           res.Courses = []
124
           res.Courses = []
172
         }
125
         }
173
         var aArr = []
126
         var aArr = []
174
         for (var n = 0; n < res.Courses.length; n++) {
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
           aArr.push({
130
           aArr.push({
176
             id: res.Courses[n].CourseId,
131
             id: res.Courses[n].CourseId,
177
             title: res.Courses[n].CourseName,
132
             title: res.Courses[n].CourseName,
178
             img: res.Courses[n].CourseImg,
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
             courseType: '团体课',
137
             courseType: '团体课',
183
             defaultPrice: res.Courses[n].Price + '/节',
138
             defaultPrice: res.Courses[n].Price + '/节',
184
             getWay: 'ticket',
139
             getWay: 'ticket',
186
             endDate: new Date(res.Courses[n].EndDate).getTime(),
141
             endDate: new Date(res.Courses[n].EndDate).getTime(),
187
           })
142
           })
188
         }
143
         }
144
+        console.log(aArr)
189
         this.initList = aArr
145
         this.initList = aArr
190
         this.calcArr()
146
         this.calcArr()
191
       })
147
       })
192
     },
148
     },
193
     calcArr () {
149
     calcArr () {
194
       let arr = []
150
       let arr = []
151
+      if (!this.initList){
152
+        this.initList = []
153
+      }
195
       for (var n = 0; n < this.initList.length; n++) {
154
       for (var n = 0; n < this.initList.length; n++) {
196
         arr.push(new Date(this.initList[n].startDate).getMonth())
155
         arr.push(new Date(this.initList[n].startDate).getMonth())
197
       }
156
       }

+ 11
- 5
src/pages/user/majorProjectsDetail/index.vue 查看文件

4
       <div class="content">
4
       <div class="content">
5
         <div class="banner">
5
         <div class="banner">
6
           <div class="scrollImg">
6
           <div class="scrollImg">
7
-            <img :src='topImage' class="cover" alt="">
7
+            <img :src='courseDetail.CourseImg' class="cover" alt="">
8
             <!-- <swiper :options="swiperOption" ref="mySwiper">
8
             <!-- <swiper :options="swiperOption" ref="mySwiper">
9
               <swiper-slide class="swiper-slide" v-for="(item,index) in courseDetail.CourseImgs" :key="index">
9
               <swiper-slide class="swiper-slide" v-for="(item,index) in courseDetail.CourseImgs" :key="index">
10
                 <img :src='item.ImgUrl' class="cover" alt="">
10
                 <img :src='item.ImgUrl' class="cover" alt="">
131
         arr = []
131
         arr = []
132
       }
132
       }
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.courseDetail.CourseImgs.sort(this.getSortFun('asc', 'Sort'))
137
+        this.detailImage = this.courseDetail.CourseImgs
137
       }
138
       }
138
       console.log(this.detailImage)
139
       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 })
140
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
140
       let nowDate = Date.now()
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
       if (nowDate > endData) {
143
       if (nowDate > endData) {
143
         this.gray = true
144
         this.gray = true
144
       }
145
       }
153
     ...mapProjectActions([
154
     ...mapProjectActions([
154
       'getCourseDetailInfo',
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
     returnCourseTime (val, endVal) { // 返回课时时间
162
     returnCourseTime (val, endVal) { // 返回课时时间
157
       val = new Date(val)
163
       val = new Date(val)
158
       endVal = new Date(endVal)
164
       endVal = new Date(endVal)
186
         title: '城的空间',
192
         title: '城的空间',
187
         desc: '城的空间',
193
         desc: '城的空间',
188
         link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
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
       }).then(() => {
196
       }).then(() => {
191
         let result = this.courseDetail.CaseInfo.Coordinate.split(",")
197
         let result = this.courseDetail.CaseInfo.Coordinate.split(",")
192
         let latitude = parseFloat(result[0])
198
         let latitude = parseFloat(result[0])

+ 31
- 10
src/pages/user/placeOrder/index.vue 查看文件

9
               <span>项目名称:{{caseName}}</span>
9
               <span>项目名称:{{caseName}}</span>
10
             </div>
10
             </div>
11
           </div>
11
           </div>
12
-          <span>{{userInfo.customer != undefined ? userInfo.customer.CustomerName : ''}}您好!</span>
12
+          <span>{{userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name}}您好!</span>
13
         </div>
13
         </div>
14
       </div>
14
       </div>
15
       <div class="tableInfo flex-h">
15
       <div class="tableInfo flex-h">
70
     </div>
70
     </div>
71
     <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
71
     <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
72
     <calcMenu :show="showCalcMenu" :totalNum="sumNum + caseTotal.total" :data="selGoods" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
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
   </div>
80
   </div>
74
 </template>
81
 </template>
75
 
82
 
136
         freeModeMomentumVelocityRatio: 2,
143
         freeModeMomentumVelocityRatio: 2,
137
       },
144
       },
138
       selGoods: [],
145
       selGoods: [],
146
+      showSuccessPopup: false
139
     }
147
     }
140
   },
148
   },
141
   computed: {
149
   computed: {
258
     },
266
     },
259
     reback () { // 返回桌位选择
267
     reback () { // 返回桌位选择
260
       this.$dialog.confirm({
268
       this.$dialog.confirm({
261
-        title: '提示',
262
         message: '返回页面将清空当前选择的商品,确定要返回吗?'
269
         message: '返回页面将清空当前选择的商品,确定要返回吗?'
263
       }).then(() => {
270
       }).then(() => {
264
         // this.$router.push({ name: 'coffeeIndex' })
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
       this.postData.info.OrgId = this.orgId
277
       this.postData.info.OrgId = this.orgId
270
       this.postData.info.UserId = this.userInfo.CustomerId
278
       this.postData.info.UserId = this.userInfo.CustomerId
271
       this.postData.info.UserName = this.userInfo.customer.CustomerName
279
       this.postData.info.UserName = this.userInfo.customer.CustomerName
272
       this.postData.info.PayType = 'sys user'
280
       this.postData.info.PayType = 'sys user'
281
+      this.postData.info.Remark = Remark
273
       var orderInfo = this.selGoods
282
       var orderInfo = this.selGoods
274
       this.postData.detail = []
283
       this.postData.detail = []
275
       var amount = 0
284
       var amount = 0
294
         detail: JSON.stringify(this.postData.detail),
303
         detail: JSON.stringify(this.postData.detail),
295
         coupon: JSON.stringify(this.postData.coupon)
304
         coupon: JSON.stringify(this.postData.coupon)
296
       }).then((res) => {
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
     closeCalcMenu () { // 关闭已选菜单
320
     closeCalcMenu () { // 关闭已选菜单
306
       this.showCalcMenu = false
321
       this.showCalcMenu = false
307
     },
322
     },
370
 <style lang="scss" scoped>
385
 <style lang="scss" scoped>
371
 @import 'page.scss';
386
 @import 'page.scss';
372
 </style>
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
       }
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
       <div class="remark flex-h">
35
       <div class="remark flex-h">
36
         <div class="flex-item flex-h">
36
         <div class="flex-item flex-h">
37
           <div class="flex-h">
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
           </div>
39
           </div>
40
         </div>
40
         </div>
41
       </div>
41
       </div>
43
       <div class="bottom">
43
       <div class="bottom">
44
         <a @click="cancel">取消</a>
44
         <a @click="cancel">取消</a>
45
         <a @click="toPayer">确定</a>
45
         <a @click="toPayer">确定</a>
46
+        <div style="width: 100%;position: absolute;left: 0;bottom: 0;top: 0;" v-if="!ajaxoff"></div>
46
       </div>
47
       </div>
47
     </div>
48
     </div>
48
     <div class="selectCouponLayer" :class="{'show': showSelectCouponLayer}">
49
     <div class="selectCouponLayer" :class="{'show': showSelectCouponLayer}">
65
         <a @click="sureSelectCoupon">确定</a>
66
         <a @click="sureSelectCoupon">确定</a>
66
       </div>
67
       </div>
67
     </div>
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
   </div>
76
   </div>
69
 </template>
77
 </template>
70
 
78
 
72
 import { mapState, createNamespacedHelpers } from 'vuex'
80
 import { mapState, createNamespacedHelpers } from 'vuex'
73
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
81
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
74
 import discounts from '../../../components/discounts/discounts'
82
 import discounts from '../../../components/discounts/discounts'
75
-
76
 export default {
83
 export default {
77
   name: '',
84
   name: '',
78
   data () {
85
   data () {
79
     var _self = this
86
     var _self = this
80
     return {
87
     return {
88
+      ajaxoff: true,
81
       showSelectCouponLayer: false,
89
       showSelectCouponLayer: false,
82
       getCouponOff: false,
90
       getCouponOff: false,
83
       couponList: [], // 优惠券列表
91
       couponList: [], // 优惠券列表
92
+      showSuccessPopup: false,
84
       postData: {
93
       postData: {
85
         info: {
94
         info: {
86
           CaseId: decodeURI(_self.$route.query.caseid),
95
           CaseId: decodeURI(_self.$route.query.caseid),
122
       // console.log(JSON.stringify(res))
131
       // console.log(JSON.stringify(res))
123
       var id = JSON.parse(this.$route.query.info)[0].id, arr = [], nowDate = Date.now()
132
       var id = JSON.parse(this.$route.query.info)[0].id, arr = [], nowDate = Date.now()
124
       for (var n = 0; n < res.length; n++) {
133
       for (var n = 0; n < res.length; n++) {
134
+        res[n].Coupon.Targets = res[n].Coupon.Targets || []
125
         if (res[n].Coupon.CouponType === 'goods' && res[n].Status === 1) {
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
             this.couponList.push({
137
             this.couponList.push({
128
               title: res[n].Coupon.CouponName,
138
               title: res[n].Coupon.CouponName,
129
-              desc: res[n].Coupon.Share.UseInstruction,
139
+              desc: res[n].Coupon.Share.UseRule,
130
               time: this.toolClass.dateFormat(res[n].EndDate),
140
               time: this.toolClass.dateFormat(res[n].EndDate),
131
               useType: '未使用',
141
               useType: '未使用',
132
               tag: '商品',
142
               tag: '商品',
197
       return [amount, num]
207
       return [amount, num]
198
     },
208
     },
199
     toPayer () { // 下单
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
     cancel () {
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
     //   }
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
                     <span>时间描述</span>
28
                     <span>时间描述</span>
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(courseDetail.BeginDate,'yyyy-MM-dd') + ' ~ ' + toolClass.dateFormat(courseDetail.EndDate, 'yyyy-MM-dd')}}</span>
32
               </li>
33
               </li>
33
               <li class="flex-h">
34
               <li class="flex-h">
34
                 <div class="flex-item">
35
                 <div class="flex-item">
73
               <div class="flex-h">
74
               <div class="flex-h">
74
                 <div class="flex-item">
75
                 <div class="flex-item">
75
                   <div>
76
                   <div>
76
-                    <span>同意《银城精品团课服务协议》</span>
77
+                    <span>同意《城的空间课程服务协议》</span>
77
                   </div>
78
                   </div>
78
                 </div>
79
                 </div>
79
                 <i class="iconfont icon-gouxuan" :class="{'active': agreementOff}" @click="agreement"></i>
80
                 <i class="iconfont icon-gouxuan" :class="{'active': agreementOff}" @click="agreement"></i>
80
               </div>
81
               </div>
81
             </div>
82
             </div>
82
             <div class="protocol">
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
             </div>
90
             </div>
88
           </div>
91
           </div>
89
         </div>
92
         </div>
162
   created () {
165
   created () {
163
     this.getCouponList().then((res) => {
166
     this.getCouponList().then((res) => {
164
       this.getCourseDetailInfo({ id: this.$route.query.id }).then((result) => {
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
         this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
170
         this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
168
         var id = this.$route.query.id, arr = [], nowDate = Date.now()
171
         var id = this.$route.query.id, arr = [], nowDate = Date.now()
169
         for (var n = 0; n < res.length; n++) {
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
           if (res[n].Coupon.CouponType === 'course' && res[n].Status === 1) {
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
               this.couponList.push({
177
               this.couponList.push({
174
                 title: res[n].Coupon.CouponName,
178
                 title: res[n].Coupon.CouponName,
175
                 desc: res[n].Coupon.Share.UseInstruction,
179
                 desc: res[n].Coupon.Share.UseInstruction,
182
               })
186
               })
183
             } else {
187
             } else {
184
               for (var a = 0; a < res[n].Coupon.Targets.length; a++) {
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
                   this.couponList.push({
190
                   this.couponList.push({
187
                     title: res[n].Coupon.CouponName,
191
                     title: res[n].Coupon.CouponName,
188
                     desc: res[n].Coupon.Share.UseInstruction,
192
                     desc: res[n].Coupon.Share.UseInstruction,
250
       }).then((res) => {
254
       }).then((res) => {
251
         // console.log(JSON.stringify(res))
255
         // console.log(JSON.stringify(res))
252
         this.$dialog.alert({
256
         this.$dialog.alert({
253
-          message: '下单成功!'
257
+          title: '下单成功!'
254
         }).then(() => {
258
         }).then(() => {
255
           // this.$router.push({name: 'majorProjects'})
259
           // this.$router.push({name: 'majorProjects'})
256
           window.history.go(-2)
260
           window.history.go(-2)
292
 <style lang="scss" scoped>
296
 <style lang="scss" scoped>
293
 @import 'page.scss';
297
 @import 'page.scss';
294
 </style>
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
 <template>
1
 <template>
2
   <div class="mainPage" v-if="show">
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
     <div class="banner"  v-if="!video">
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
     </div>
6
     </div>
14
     <div class="content">
7
     <div class="content">
15
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
8
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
16
       <div class="title" v-else>{{data.CouponName}}</div>
9
       <div class="title" v-else>{{data.CouponName}}</div>
17
       <div class="video" v-if='video'>
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
       </div>
18
       </div>
20
       <div class="text">
19
       <div class="text">
21
         <div>
20
         <div>
136
     sdk (info) {
135
     sdk (info) {
137
       let logo, title
136
       let logo, title
138
       if (this.$route.query.type === 'card') {
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
         title = this.data.CardName
139
         title = this.data.CardName
141
       } else {
140
       } else {
142
-        logo = this.data.Images[0].CouponImageUrl
141
+        logo = this.data.Images[0].CouponImageUrl + '?x-oss-process=style/wxicon'
143
         title = this.data.CouponName
142
         title = this.data.CouponName
144
       }
143
       }
145
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
144
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {

+ 4
- 0
src/pages/user/receive/page.scss 查看文件

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

+ 29
- 11
src/pages/user/receiveChannel/index.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="mainPage" v-if="show">
2
   <div class="mainPage" v-if="show">
3
+    <!-- <video :src="data.VideoUrl" height="100%" width="100%" preload="auto" ></video> -->
3
     <div class="residue">
4
     <div class="residue">
4
       <i class="iconfont icon-gantanhao"></i>
5
       <i class="iconfont icon-gantanhao"></i>
5
-      <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
6
+      <span>仅剩{{data.TotalCount - data.SentCount}}张券可以领取!</span>
6
     </div>
7
     </div>
7
     <div class="logo">
8
     <div class="logo">
8
       <img :src="logo" alt="">
9
       <img :src="logo" alt="">
9
     </div>
10
     </div>
10
     <div class="banner"  v-if="!video">
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
     </div>
14
     </div>
14
     <div class="content">
15
     <div class="content">
15
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
16
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
16
       <div class="title" v-else>{{data.CouponName}}</div>
17
       <div class="title" v-else>{{data.CouponName}}</div>
17
       <div class="video" v-if='video'>
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
       </div>
27
       </div>
20
       <div class="text">
28
       <div class="text">
21
         <div>
29
         <div>
30
           <i class="icon-kaquan iconfont"></i>
38
           <i class="icon-kaquan iconfont"></i>
31
           <span>卡券有效期</span>
39
           <span>卡券有效期</span>
32
         </div>
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
       </div>
43
       </div>
35
       <div class="text">
44
       <div class="text">
36
         <div>
45
         <div>
39
         </div>
48
         </div>
40
         <pre>{{data.address}}</pre>
49
         <pre>{{data.address}}</pre>
41
       </div>
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
     </div>
54
     </div>
45
   </div>
55
   </div>
46
 </template>
56
 </template>
97
       if (this.$route.query.type === 'card') {
107
       if (this.$route.query.type === 'card') {
98
         this.getCardShare({ id: this.$route.query.id }).then(() => {
108
         this.getCardShare({ id: this.$route.query.id }).then(() => {
99
           this.data = this.cardShare.Card
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
           if (!this.data.VideoUrl) {
115
           if (!this.data.VideoUrl) {
102
             this.video = false
116
             this.video = false
103
           }
117
           }
107
       } else {
121
       } else {
108
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
122
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
109
           this.data = this.couponShare.coupon
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
           if (!this.data.VideoUrl) {
129
           if (!this.data.VideoUrl) {
112
             this.video = false
130
             this.video = false
113
           }
131
           }
136
     sdk (info) {
154
     sdk (info) {
137
       let logo, title
155
       let logo, title
138
       if (this.$route.query.type === 'card') {
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
         title = this.data.CardName
158
         title = this.data.CardName
141
       } else {
159
       } else {
142
-        logo = this.data.Images[0].CouponImageUrl
160
+        logo = this.data.Images[0].CouponImageUrl + '?x-oss-process=style/wxicon'
143
         title = this.data.CouponName
161
         title = this.data.CouponName
144
       }
162
       }
145
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
163
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {

+ 7
- 0
src/pages/user/receiveChannel/page.scss 查看文件

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

+ 5
- 0
src/store/index/index.js 查看文件

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

+ 7
- 3
src/store/login/login.js 查看文件

38
   mutations: {},
38
   mutations: {},
39
   actions: {
39
   actions: {
40
     getCaptcha ({ commit }, data) {
40
     getCaptcha ({ commit }, data) {
41
-      return new Promise((resolve) => {
41
+      return new Promise((resolve, reject) => {
42
         http.getCaptcha(data).then((res) => {
42
         http.getCaptcha(data).then((res) => {
43
           resolve(res)
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
         http.submitData(data).then((res) => {
51
         http.submitData(data).then((res) => {
50
           resolve(res)
52
           resolve(res)
53
+        }).catch((err) => {
54
+          reject(err)
51
         })
55
         })
52
       })
56
       })
53
     }
57
     }

+ 3
- 1
src/store/placeOrderForCoffee/index.js 查看文件

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

+ 3
- 1
src/store/userCenter/userCenter.js 查看文件

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

+ 20
- 9
src/util/ajax.js 查看文件

5
 import { Toast } from '../../node_modules/vant';
5
 import { Toast } from '../../node_modules/vant';
6
 
6
 
7
 const token = function (headers) {
7
 const token = function (headers) {
8
-  let JWT
8
+  let JWT = ''
9
   if (headers) {
9
   if (headers) {
10
     localStorage.setItem('JWT', headers.authorization)
10
     localStorage.setItem('JWT', headers.authorization)
11
     JWT = headers.authorization
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
   return !token ? '' : token
15
   return !token ? '' : token
16
 }
16
 }
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
+}

+ 1
- 1
src/util/share.js 查看文件

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