yuantianjiao пре 6 година
родитељ
комит
c81684aa28

+ 1
- 1
public/index.html Прегледај датотеку

@@ -6,7 +6,7 @@
6 6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
8 8
     charset="utf-8" />
9
-  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_q841vrk4ihm.css">
9
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_s109s6ry4gl.css">
10 10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
11 11
   <title>
12 12
     <%= htmlWebpackPlugin.options.title %>

+ 4
- 0
src/common/css/reset.css Прегледај датотеку

@@ -79,6 +79,10 @@ select option {
79 79
 	display: none;
80 80
 }
81 81
 
82
+.van-dialog__message {
83
+  text-align: center;
84
+}
85
+
82 86
 .van-dialog__message .van-dialog__message--has-title{
83 87
 	text-align: center;
84 88
 }

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


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

@@ -13,8 +13,13 @@
13 13
       </div>
14 14
       <div>
15 15
         <div @click="record">领取记录</div>
16
+        <div @click="history">历史备注</div>
16 17
       </div>
17 18
     </div>
19
+    <div class="card-bottom">
20
+      <span>备注:{{data.remark}}</span>
21
+      <span @click="remark">+ 添加备注</span>
22
+    </div>
18 23
   </div>
19 24
 </template>
20 25
 
@@ -37,6 +42,12 @@ export default {
37 42
     record () {
38 43
       this.$emit('record', this.data)
39 44
     },
45
+    remark () {
46
+      this.$emit('remark', this.data)
47
+    },
48
+    history () {
49
+      this.$emit('history', this.data)
50
+    }
40 51
   }
41 52
 }
42 53
 </script>

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

@@ -4,6 +4,8 @@
4 4
       <span>{{data.caseName}}</span>
5 5
       <a v-if="data.ShowSelect" @click="selectCase">请选择</a>
6 6
       <div class="flex-item">
7
+        <span v-if="data.recommendCode">我的推荐码{{data.recommendCode}}</span>
8
+        <span v-else></span>
7 9
         <span>{{userName}}您好!</span>
8 10
       </div>
9 11
   </div>

+ 4
- 2
src/components/topCaseInfo/page.scss Прегледај датотеку

@@ -20,8 +20,10 @@
20 20
     margin-left: .2rem;
21 21
   }
22 22
   &>div{
23
-    text-align: right;
24
-    margin-right: .2rem;
23
+    display: flex;
24
+    justify-content: space-between;
25
+    align-items: center;
26
+    margin: 0 .2rem 0 .1rem;
25 27
     font-size: 0;
26 28
     span{
27 29
       font-size: .12rem;

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

@@ -8,7 +8,7 @@
8 8
         <ul>
9 9
           <li class="customer-card">
10 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' @history='history' @remark='remark'></customerCard>
12 12
               <!-- <span class="noData" v-if="ajaxOff && !cardList.length">暂无数据</span> -->
13 13
               <noMore v-if="ajaxOff && hasPic"></noMore>
14 14
             </div>
@@ -24,6 +24,18 @@
24 24
       </div>
25 25
       <div class="mask-bottom"></div>
26 26
     </div>
27
+    <van-dialog
28
+      v-model="showDialog"
29
+      show-cancel-button
30
+      title='添加备注'
31
+      :before-close="beforeClose">
32
+      <van-field
33
+        v-model="message"
34
+        type="textarea"
35
+        placeholder="请输入备注"
36
+        rows="3"
37
+        autosize/>
38
+    </van-dialog>
27 39
   </div>
28 40
 </template>
29 41
 
@@ -58,6 +70,7 @@ export default {
58 70
       mask: true,
59 71
       checked: true,
60 72
       cardList: [],
73
+      showDialog: false
61 74
     }
62 75
   },
63 76
   computed: {
@@ -102,6 +115,14 @@ export default {
102 115
       // console.log(item)
103 116
       this.$router.push({ name: 'getRecord', query: { name: item.Name, phone: item.Phone, id: item.CustomerId } })
104 117
     },
118
+    remark (item) {
119
+      // console.log(item)
120
+      this.showDialog = true
121
+    },
122
+    history (item) {
123
+      // console.log(item)
124
+      window.location.href = this.getUrl('history')
125
+    },
105 126
     searchMask () {
106 127
       this.getCustomerList({
107 128
         page: 1,

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

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName"></topCaseInfo>
5 5
     </div>
6 6
     <div class="info">
7 7
       <span><em>姓名</em>:顶顶顶</span>
@@ -21,7 +21,8 @@
21 21
 
22 22
 <script>
23 23
 import topCaseInfo from '../../../components/topCaseInfo/index'
24
-
24
+import { mapState, createNamespacedHelpers } from 'vuex'
25
+const { mapActions: actions } = createNamespacedHelpers('app')
25 26
 export default {
26 27
   name: '',
27 28
   data () {
@@ -30,19 +31,33 @@ export default {
30 31
       topCaseInfoData: {
31 32
         caseName: '',
32 33
         caseId: '',
33
-        showSelect: false,
34
-        userName: 'xxx'
34
+        ShowSelect: false,
35 35
       },
36 36
     }
37 37
   },
38 38
   components: {
39 39
     topCaseInfo,
40 40
   },
41
+  computed: {
42
+    ...mapState({
43
+      userInfo: x => x.userCenter.userInfo,
44
+      CaseList: x => x.app.CaseList,
45
+    }),
46
+  },
41 47
   created () {
42
-
48
+    this.getCaseList().then((res) => {
49
+      this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
50
+      for (let i = 0; i < this.CaseList.length; i++) {
51
+        if (this.CaseList[i].CaseId === this.topCaseInfoData.caseId) {
52
+          this.topCaseInfoData.caseName = this.CaseList[i].CaseName
53
+        }
54
+      }
55
+    })
43 56
   },
44 57
   methods: {
45
-    
58
+    ...actions([
59
+      'getCaseList',
60
+    ])
46 61
   }
47 62
 }
48 63
 </script>

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

@@ -22,6 +22,11 @@
22 22
           </div>
23 23
         </div> -->
24 24
 
25
+        <div class="mobile">
26
+          <i class="iconfont icon-zhanghu"></i>
27
+          <input type="tel" placeholder="推荐码" v-model="postData.recommendCode">
28
+        </div>
29
+
25 30
         <div class="sms">
26 31
           <i class="iconfont icon-mima"></i>
27 32
           <input type="tel" maxlength="6" placeholder="验证码" v-model="postData.captcha">
@@ -29,11 +34,6 @@
29 34
           <div class="sand" v-else>{{seconds}}后可重发</div>
30 35
         </div>
31 36
 
32
-        <div class="mobile">
33
-          <i class="iconfont icon-mima"></i>
34
-          <input type="tel" maxlength="11" placeholder="推荐码" v-model="postData.recommend">
35
-        </div>
36
-
37 37
         <div class="submit" @click="submit">
38 38
           <div>提交</div>
39 39
         </div>
@@ -84,10 +84,10 @@ export default {
84 84
       seconds: 61,
85 85
       postData: {
86 86
         phone: '',
87
-        case: '',
88
-        sales: '',
89
-        captcha: '',
90
-        recommend: ''
87
+        // case: '',
88
+        // sales: '',
89
+        recommendCode: '',
90
+        captcha: ''
91 91
       }
92 92
     }
93 93
   },
@@ -106,6 +106,7 @@ export default {
106 106
     ...actions(['getCaseInfo']),
107 107
     ...actions(['getCaptcha']),
108 108
     ...actions(['submitData']),
109
+    ...actions(['recommendCode']),
109 110
     // onConfirmC (value, index) {
110 111
     //   this.caseName = value.CaseName
111 112
     //   this.postData.case = value.CaseId
@@ -156,9 +157,24 @@ export default {
156 157
         this.$toast('请先填写手机号')
157 158
         return
158 159
       }
159
-      this.getCaptcha(this.postData.phone)
160
-      this.seconds = 60
161
-      this.runTime()
160
+      if (this.postData.recommendCode) {
161
+        this.recommendCode({ recommendCode: this.postData.recommendCode }).then((res) => {
162
+          if (res) {
163
+            this.getCaptcha(this.postData.phone)
164
+            this.seconds = 60
165
+            this.runTime()
166
+          } else {
167
+            this.$toast('推荐码不正确,请与案场人员核对')
168
+            return
169
+          }
170
+        }).catch((err) => {
171
+          return
172
+        })
173
+      } else {
174
+        this.getCaptcha(this.postData.phone)
175
+        this.seconds = 60
176
+        this.runTime()
177
+      }
162 178
     },
163 179
     runTime () {
164 180
       setTimeout(() => {
@@ -171,7 +187,7 @@ export default {
171 187
       }, 1000)
172 188
     },
173 189
     submit () {
174
-      if (!canSubmit){
190
+      if (!canSubmit) {
175 191
         return
176 192
       }
177 193
       canSubmit = false

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

@@ -27,7 +27,7 @@
27 27
     }
28 28
     .box{
29 29
       width: 3.25rem;
30
-      height: 3.34rem;
30
+      height: 3.5rem;
31 31
       background:rgba(255,255,255,1);
32 32
       border-radius:8px;
33 33
       padding: .2rem;
@@ -36,7 +36,6 @@
36 36
         font-size: .16rem;
37 37
         font-weight: bold;
38 38
         text-align: center;
39
-        padding-bottom: .24rem;
40 39
       }
41 40
       .mobile,.sms{
42 41
         width: 2.85rem;
@@ -47,6 +46,7 @@
47 46
         display: flex;
48 47
         align-items: center;
49 48
         position: relative;
49
+        margin-top: .2rem;
50 50
         i{
51 51
           color: rgba(168,182,200,1);
52 52
           padding: .14rem;
@@ -107,7 +107,7 @@
107 107
         }
108 108
       }
109 109
       .submit{
110
-        margin-top: .24rem;
110
+        margin-top: .2rem;
111 111
         width: 2.85rem;
112 112
         height: .48rem;
113 113
         border-radius:25px;

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

@@ -4,7 +4,7 @@
4 4
       <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== '' && fromPage === 'sales'">
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" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
8 8
     </nav>
9 9
       <div class="content">
10 10
         <div>
@@ -93,7 +93,7 @@
93 93
                   </van-checkbox>
94 94
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
95 95
                 </div>
96
-                <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record'></customerCard>
96
+                <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record' @history='history' @remark='remark'></customerCard>
97 97
                 <noMore v-if="data[3].hasPic"></noMore>
98 98
               </div>
99 99
             </li>
@@ -195,6 +195,7 @@ export default {
195 195
         caseName: '',
196 196
         caseId: '',
197 197
         ShowSelect: false,
198
+        recommendCode: 3066
198 199
       },
199 200
       caseInfo: {
200 201
         value: '',

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

@@ -30,7 +30,8 @@
30 30
           <span>卡券</span>
31 31
           <span>0张未使用</span>
32 32
         </div>
33
-        <div class="flex-item privilege-item" @click="toVip">
33
+        <div class="flex-item privilege-item" @click="toVipDetail">
34
+          <i class="iconfont icon-01" @click.stop="toVip"></i>
34 35
           <div class="img-box">
35 36
             <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
36 37
           </div>
@@ -101,6 +102,9 @@ export default {
101 102
     toVip () {
102 103
       this.$router.push({ name: 'vip' })
103 104
     },
105
+    toVipDetail() {
106
+      this.$router.push({ name: 'vipDetail' })
107
+    },
104 108
     toCard () {
105 109
       this.$router.push({ name: 'card' })
106 110
     },

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

@@ -84,12 +84,18 @@
84 84
   box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
85 85
   border-radius:8px;
86 86
   box-sizing: border-box;
87
-
88 87
   .privilege-item {
89 88
     display: flex;
90 89
     flex-flow: column nowrap;
91 90
     justify-content: center;
92 91
     align-items: center;
92
+    position: relative;
93
+    .icon-01{
94
+      position: absolute;
95
+      top: .05rem;
96
+      right: .05rem;
97
+      font-size: .18rem;
98
+    }
93 99
     .img-box {
94 100
       width: 0.24rem;
95 101
       height: 0.18rem;

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

@@ -394,10 +394,4 @@ export default {
394 394
 <!-- Add "scoped" attribute to limit CSS to this component only -->
395 395
 <style lang="scss" scoped>
396 396
 @import 'page.scss';
397
-</style>
398
-
399
-<style>
400
-.van-dialog__message {
401
-  text-align: center;
402
-}
403
-</style>
397
+</style>

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

@@ -295,10 +295,4 @@ export default {
295 295
 <!-- Add "scoped" attribute to limit CSS to this component only -->
296 296
 <style lang="scss" scoped>
297 297
 @import 'page.scss';
298
-</style>
299
-
300
-<style lang="scss">
301
-.van-dialog{
302
-  width: 60% !important;
303
-}
304
-</style>
298
+</style>

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

@@ -114,6 +114,11 @@ export default {
114 114
           this.sdk(this.data.Share.CouponShareInfo)
115 115
         })
116 116
       }
117
+      if (this.$route.query.isAuto === 'auto') {
118
+        setTimeout(() => {
119
+          this.receive()
120
+        }, 1000)
121
+      }
117 122
     },
118 123
     receive () {
119 124
       if (this.$route.query.type === 'card') {

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

@@ -15,6 +15,7 @@ import userCenter from './mainPage/userCenter/index' // 个人中心
15 15
 import bindMobile from './bindMobile/bindMobile' // 绑定手机号
16 16
 import lessonOrder from './lessonOrder/index' // 我的订单
17 17
 import vip from './vip/index' // vip卡说明
18
+import vipDetail from './vipDetail/index' // vip卡说明
18 19
 import card from './card/index' // 卡
19 20
 import coupons from './coupons/index' // 优惠券
20 21
 import lessonDetail from './lessonDetail/index' // 课程详情
@@ -24,6 +25,7 @@ import couponsDetail from './couponsDetail/index' // 体验券详情
24 25
 import receive from './receive/index' // 领取页面
25 26
 import receiveResults from './receiveResults/index' // 领取结果页面
26 27
 import receiveChannel from './receiveChannel/index' // 渠道领取页面
28
+import rush from './rush/index' // 抢购
27 29
 
28 30
 Vue.use(Router)
29 31
 
@@ -98,6 +100,11 @@ const router = new Router({
98 100
     name: 'vip',
99 101
     component: vip,
100 102
     children: []
103
+  }, { // vip卡详情
104
+    path: '/vipDetail',
105
+    name: 'vipDetail',
106
+    component: vipDetail,
107
+    children: []
101 108
   }, { // 卡
102 109
     path: '/card',
103 110
     name: 'card',
@@ -151,6 +158,10 @@ const router = new Router({
151 158
     path: '/receiveChannelShared/:id/:type/:sharetype',
152 159
     name: 'receiveChannel',
153 160
     component: receiveChannel
161
+  }, { // 抢购
162
+    path: '/rush',
163
+    name: 'rush',
164
+    component: rush
154 165
   }],
155 166
   linkActiveClass: 'active',
156 167
 })

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

@@ -0,0 +1,97 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="top-time" v-if="timeStatus<2">
4
+      <span v-if="timeStatus === 0">距抢购开始</span>
5
+      <span v-if="timeStatus === 1">距抢购结束</span>
6
+      <span class="time">{{day}}</span>
7
+      <span>天</span>
8
+      <span class="time">{{hour}}</span>
9
+      <span>时</span>
10
+      <span class="time">{{minute}}</span>
11
+      <span>分</span>
12
+      <span class="time">{{second}}</span>
13
+      <span>秒</span>
14
+    </div>
15
+    <div class="content">
16
+      <div class="title">悦见山咖啡抽奖活动</div>
17
+      <div class="video-or-cover">
18
+        <video v-if="video" width="100%" height="100%" preload="auto" x5-playsinline="true" controls="controls" :poster="type === 'card' ? data.Images[0].CardImageUrl : data.Images[0].CouponImageUrl">
19
+          <source :src="data.VideoUrl" type="video/mp4">
20
+          <source :src="data.VideoUrl" type="video/avi">
21
+          <source :src="data.VideoUrl" type="video/wma">
22
+          <source :src="data.VideoUrl" type="video/rmvb">
23
+          <source :src="data.VideoUrl" type="video/rm">
24
+        </video>
25
+        <img v-else src="" width="100%" height="100%">
26
+      </div>
27
+      <pre class="rule"></pre>
28
+      <div class="scope-of-time">
29
+        <div>活动时间</div>
30
+        <div></div>
31
+      </div>
32
+    </div>
33
+    <div class="submit">
34
+      <div :class="{light:timeStatus === 1}">{{btnText[timeStatus]}}</div>
35
+    </div>
36
+  </div>
37
+</template>
38
+
39
+<script>
40
+export default {
41
+  data () {
42
+    return {
43
+      day: '00',
44
+      hour: '00',
45
+      minute: '00',
46
+      second: '00',
47
+      hasTime: false,
48
+      timeStatus: 0, // 0、未开始 1、进行中 2、已结束 3、已抢购
49
+      btnText: ['立即抢购', '立即抢购', '已结束', '已抢购'],
50
+      Interval: null
51
+    }
52
+  },
53
+  created () {
54
+    let start = 1540275765202
55
+    let end = 1540481765202
56
+    console.log(this)
57
+    this.timing(start, end)
58
+  },
59
+  computed: {
60
+
61
+  },
62
+  methods: {
63
+    timing (startTime, endTime) {
64
+      this.Interval = setInterval(() => {
65
+        let nowTime = new Date().getTime()
66
+        if (nowTime > endTime) {
67
+          clearInterval(this.Interval)
68
+          this.timeStatus = 2
69
+          return
70
+        } else if (nowTime < startTime) {
71
+          let time = Math.floor((startTime - nowTime) / 1000)
72
+          this.getTime(time)
73
+          this.timeStatus = 0
74
+        } else if (nowTime > startTime && nowTime < endTime) {
75
+          let time = Math.floor((endTime - nowTime) / 1000)
76
+          this.getTime(time)
77
+          this.timeStatus = 1
78
+        }
79
+      }, 1000)
80
+    },
81
+    getTime (time) {
82
+      let second = time % 60
83
+      let minute = ((time % (60 * 60)) - second) / 60
84
+      let hour = ((time % (60 * 60 * 24)) - (minute * 60) - second) / (60 * 60)
85
+      let day = Math.floor(time / (60 * 60 * 24))
86
+      this.second = second < 10 ? '0' + second : second
87
+      this.minute = minute < 10 ? '0' + minute : minute
88
+      this.hour = hour < 10 ? '0' + hour : hour
89
+      this.day = day < 10 ? '0' + day : day
90
+    }
91
+  }
92
+}
93
+</script>
94
+
95
+<style lang="scss" scoped>
96
+@import 'page.scss';
97
+</style>

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

@@ -0,0 +1,82 @@
1
+.top-time{
2
+  height: .4rem;
3
+  width: 100%;
4
+  background: #fff;
5
+  box-shadow:0px 0px 14px 0px rgba(199,199,199,0.5);
6
+  display: flex;
7
+  justify-content: center;
8
+  align-items: center;
9
+  span{
10
+    margin: .02rem;
11
+    padding: .02rem .05rem;
12
+    display: block;
13
+  }
14
+  .time{
15
+    background: #69563F;
16
+    border-radius: 2px;
17
+    color: #fff;
18
+  }
19
+}
20
+.content{
21
+  padding: .24rem .2rem .6rem;
22
+  box-sizing: border-box;
23
+  .title{
24
+    text-align: center;
25
+    font-size: .16rem;
26
+    color: #9D876D;
27
+    padding-bottom: .2rem
28
+  }
29
+  .video-or-cover{
30
+    width: 100%;
31
+    height: 2.22rem;
32
+    margin-bottom: .1rem;
33
+  }
34
+  .rule{
35
+    padding-bottom: .2rem;
36
+    white-space:pre-line;
37
+    text-align: left;
38
+    line-height: .18rem;
39
+    color: #585858;
40
+  }
41
+  .scope-of-time{
42
+    div:nth-of-type(1){
43
+      width: .66rem;
44
+      height: .26rem;
45
+      background:rgba(157,135,109,.3);
46
+      border-radius:.13rem;
47
+      text-align: center;
48
+      line-height: .26rem;
49
+      font-size: .12rem;
50
+      color: #69563F;
51
+      margin-bottom: .05rem;
52
+    }
53
+    div:nth-of-type(2){
54
+      color: #585858;
55
+      font-size: .14rem;
56
+    }
57
+  }
58
+}
59
+.submit{
60
+  display: flex;
61
+  justify-content: center;
62
+  align-items: center;
63
+  position: fixed;
64
+  bottom: 0;
65
+  left: 0;
66
+  z-index: 2;
67
+  width: 100%;
68
+  height: .6rem;
69
+  div{
70
+    width: 3.35rem;
71
+    height: .4rem;
72
+    color: #fff;
73
+    font-size: .16rem;
74
+    background: #aaa;
75
+    text-align: center;
76
+    line-height: .4rem;
77
+    border-radius: .2rem;
78
+  }
79
+  .light{
80
+    background: #9D876D;
81
+  }
82
+}

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

@@ -0,0 +1,84 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <swiper :options="swiperOption" ref="mySwiper" class="inner">
4
+      <swiper-slide class="swiper-slide" v-for="(item,index) in detail" :key="index">
5
+        <div class="vip-box">
6
+          <div class="vip-header">
7
+            <img :src='vipBg' width="100%" height="100%">
8
+            <div>
9
+              <span class="balance">¥ <span>{{item.Balance}}</span></span>
10
+              <span class="date">vip有效日期:{{toolClass.dateFormat(item.BeginDate, 'yyyy-MM-dd')}} ~ {{toolClass.dateFormat(item.BeginDate, 'yyyy-MM-dd')}}</span>
11
+            </div>
12
+          </div>
13
+          <div class="vip-detail-list">
14
+            <div class="title">账单明细</div>
15
+            <div class="list-box">
16
+              <div class="list" v-for="(items,indexs) in item.Changes" :key="indexs">
17
+                <span>{{items.ChangeSource === 'recharge' ? '充值' : items.SourceName}}</span>
18
+                <span>{{items.FloatType}}{{items.Amount}}</span>
19
+                <span class="date">{{toolClass.dateFormat(items.CreateDate)}}</span>
20
+              </div>
21
+            </div>
22
+          </div>
23
+        </div>
24
+      </swiper-slide>
25
+    </swiper>
26
+    <div class="swiper-pagination"></div>
27
+  </div>
28
+</template>
29
+
30
+<script>
31
+import vipBg from '../../../common/icon/vipBg.jpg'
32
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
33
+import 'swiper/dist/css/swiper.css'
34
+import { createNamespacedHelpers } from 'vuex'
35
+const { mapState: mapVipState, mapActions: mapVipActions } = createNamespacedHelpers('vip')
36
+export default {
37
+  data () {
38
+    return {
39
+      vipBg,
40
+      swiperOption: {
41
+        observer: true,
42
+        pagination: {
43
+          el: '.swiper-pagination',
44
+          type: 'bullets',
45
+          //type: 'fraction',
46
+          //type : 'progressbar',
47
+          //type : 'custom',
48
+          clickable: true, //此参数设置为true时,点击分页器的指示点分页器会控制Swiper切换。
49
+        },
50
+      }
51
+    }
52
+  },
53
+  components: {
54
+    swiper,
55
+    swiperSlide,
56
+  },
57
+  created () {
58
+    this.getVipDetail().then((res) => {
59
+      console.log(this.detail)
60
+    })
61
+  },
62
+  computed: {
63
+    MySwiper () {
64
+      return this.$refs.mySwiper.swiper
65
+    },
66
+    ...mapVipState({
67
+      detail: item => item.vipDetails
68
+    })
69
+  },
70
+  methods: {
71
+    ...mapVipActions(['getVipDetail'])
72
+  }
73
+}
74
+</script>
75
+
76
+<style lang="scss" scoped>
77
+@import 'page.scss';
78
+</style>
79
+
80
+<style>
81
+.swiper-pagination > span{
82
+  margin: 0 0.025rem;
83
+}
84
+</style>

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

@@ -0,0 +1,82 @@
1
+.inner{
2
+  height: 100%;
3
+}
4
+.vip-box{
5
+  width: 100%;
6
+  height: 100%;
7
+  padding: .25rem .2rem;
8
+  box-sizing: border-box;
9
+  display: flex;
10
+  flex-flow: column nowrap;
11
+  .vip-header{
12
+    width: 100%;
13
+    position: relative;
14
+    margin-bottom: .4rem;
15
+    box-shadow: 0 0 .05rem .05rem #eee;
16
+    border-radius: .1rem;
17
+    height: 1.8rem;
18
+    overflow: hidden;
19
+    img{
20
+      position: absolute;
21
+      top: 0;
22
+      left: 0;
23
+    }
24
+    div{
25
+      position: absolute;
26
+      bottom: .2rem;
27
+      left: .2rem;
28
+      width: 80%;
29
+      display: flex;
30
+      flex-flow: column nowrap;
31
+      justify-content: center;
32
+      align-items: flex-start;
33
+      .balance{
34
+        color: #FC6243;
35
+        padding-bottom: .1rem;
36
+        font-weight: bold;
37
+        span{
38
+          font-size: .24rem;
39
+          font-weight: bold;
40
+          color: #FC6243;
41
+        }
42
+      }
43
+      .date{
44
+        color: #6D6D6D;
45
+      }
46
+    }
47
+  }
48
+  .vip-detail-list{
49
+    flex: 1;
50
+    display: flex;
51
+    flex-flow: column nowrap;
52
+    .title{
53
+      font-size: .16rem;
54
+      font-weight: bold;
55
+      padding-bottom: .15rem;
56
+    }
57
+    .list-box{
58
+      flex: 1;
59
+      overflow-y: scroll;
60
+      overflow-x: hidden;
61
+      .list{
62
+        display: flex;
63
+        align-items: center;
64
+        padding: .05rem 0 ;
65
+        border-bottom: 1px solid rgba(242,242,242,1);
66
+        span{
67
+          width: 30%;
68
+        }
69
+        .date{
70
+          color: #999;
71
+          text-align: right;
72
+          flex: 1;
73
+        }
74
+      }
75
+    }
76
+  }
77
+}
78
+.swiper-pagination{
79
+  bottom: .2rem;
80
+  left: 50%;
81
+  transform: translateX(-50%);
82
+}

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

@@ -25,6 +25,7 @@ export const modules = {
25 25
   forbid: () => require('./forbid/index').default,
26 26
   share: () => require('./share/index').default,
27 27
   bodyCheck: () => require('./bodyCheck/index').default,
28
+  vip: () => require('./vip/index').default,
28 29
 }
29 30
 
30 31
 Object.keys(modules).forEach((modKey) => {

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

@@ -239,8 +239,21 @@ export default {
239 239
         })
240 240
       })
241 241
     },
242
+    recommendCode (context, data) {
243
+      console.log(data)
244
+      return new Promise((resolve) => {
245
+        Ajax({
246
+          ...api.user.recommendCode, 
247
+          urlData: { ...data }
248
+        }).then(res => {
249
+          resolve(res)
250
+        }).catch((err) => {
251
+          reject(err)
252
+        })
253
+      })
254
+    },
242 255
     submitData (context, data) {
243
-      return new Promise((resolve,reject) => {
256
+      return new Promise((resolve, reject) => {
244 257
         http.submitData(data).then((res) => {
245 258
           resolve(res)
246 259
         }).catch(() => {

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

@@ -0,0 +1,30 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    vipDetails: []
9
+  },
10
+  mutations: {
11
+    setVip (state, data) {
12
+      state.vipDetails = data || []
13
+    }
14
+  },
15
+  actions: {
16
+    getVipDetail (context) {
17
+      console.log(context)
18
+      return new Promise((resolve, reject) => {
19
+        Ajax({
20
+          ...api.user.getVip
21
+        }).then(res => {
22
+          context.commit('setVip', res)
23
+          resolve(res)
24
+        }).catch((err) => {
25
+          reject(err)
26
+        })
27
+      })
28
+    }
29
+  }
30
+}

+ 8
- 0
src/util/api.js Прегледај датотеку

@@ -105,6 +105,10 @@ const $api = {
105 105
       method: 'get',
106 106
       url: `${baseUrl}${guest}/captcha`
107 107
     },
108
+    recommendCode: { // 验证推荐码
109
+      method: 'get',
110
+      url: `${baseUrl}${guest}/customerremark/:recommendCode`
111
+    },
108 112
     getCaseList: { // 获取案场信息
109 113
       method: 'get',
110 114
       url: `${baseUrl}${guest}/case`
@@ -132,6 +136,10 @@ const $api = {
132 136
     getNum: { // 获取卡券数
133 137
       method: 'get',
134 138
       url: `${baseUrl}${wechat}/customer/info`
139
+    },
140
+    getVip: { // vip卡详情
141
+      method: 'get',
142
+      url: `${baseUrl}${wechat}/vip`
135 143
     }
136 144
   },
137 145
   director: {