yuantianjiao hace 6 años
padre
commit
04b52db78a

BIN
src/common/icon/Artboard.png Ver fichero


+ 132
- 16
src/components/discounts/discounts.vue Ver fichero

@@ -1,17 +1,25 @@
1 1
 <template>
2
-  <div class="discounts flex-h">
3
-    <div class="card-left">
4
-      <div class="title">
5
-        <i class="iconfont icon-youhuiquan"></i>
6
-        <div>小小外交官体验卡</div>
2
+  <div class="discounts">
3
+    <div class="flex-h" :class="{'opacity' : data.useType == '已失效' || data.useType == '已使用', 'gray': data.useType == '已使用'}" @click="toDetail">
4
+      <div class="card-left">
5
+        <div class="title">
6
+          <i class="iconfont icon-youhuiquan"></i>
7
+          <div>{{data.title}}</div>
8
+        </div>
9
+        <div class="desc">{{data.desc}}</div>
10
+        <div class="time">有效期至{{data.time}}</div>
11
+      </div>
12
+      <div class="card-right">
13
+        <img :src="logo" alt="" width="100%" height="100%">
14
+        <div class="btn" @click.stop="toUse" v-if="data.useType == '未使用'">去使用</div>
15
+      </div>
16
+      <div class="tag" :class="{'gray-location' : data.useType == '已使用'}">
17
+        <span>{{data.tag}}</span>
7 18
       </div>
8
-      <div class="desc">凭此体验券可让一位小朋友体验一次 适用于小小外交官课程</div>
9
-      <div class="time">有效期至2018年8月17日</div>
10 19
     </div>
11
-    <div class="card-right">
12
-      <img :src="logo" alt="">
13
-      <div class="btn">去使用</div>
14
-      <div>共享</div>
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%">
15 23
     </div>
16 24
   </div>
17 25
 </template>
@@ -21,25 +29,133 @@ import logo from '../../common/icon/logo-t.png'
21 29
 import used from '../../common/icon/already.png'
22 30
 import failure from '../../common/icon/inv.png'
23 31
 export default {
32
+  props: ['data'],
24 33
   data () {
25 34
     return {
26 35
       logo,
27 36
       used,
28 37
       failure
29 38
     }
39
+  },
40
+  methods: {
41
+    toUse () {
42
+      this.$emit('toUse', this.data)
43
+    },
44
+    toDetail () {
45
+      this.$emit('toDetail', this.data)
46
+    }
30 47
   }
31 48
 }
32 49
 </script>
33 50
 
34 51
 <style lang="scss" scoped>
35
-.discounts{
36
-  padding: .15rem .2rem;
52
+.discounts {
53
+  padding: 0.15rem 0.2rem;
37 54
   box-sizing: border-box;
38
-  .card-left{
55
+  background: rgba(255, 255, 255, 1);
56
+  box-shadow: 0px 2px 0.1rem 0px rgba(193, 204, 217, 0.5);
57
+  border-radius: 0.08rem;
58
+  margin-bottom: 0.2rem;
59
+  position: relative;
60
+  overflow: hidden;
61
+  .flex-h {
62
+    &.opacity {
63
+      opacity: 0.5;
64
+    }
65
+    &.gray {
66
+      filter: grayscale(100%);
67
+    }
68
+    .card-left {
69
+      flex: 1;
70
+      display: flex;
71
+      flex-flow: column nowrap;
72
+      .title {
73
+        display: flex;
74
+        align-items: center;
75
+        i {
76
+          padding-right: 0.08rem;
77
+          color: #ff7c1c;
78
+          font-weight: bold;
79
+          font-size: 0.2rem;
80
+        }
81
+        div {
82
+          font-size: 0.16rem;
83
+          font-weight: bold;
84
+          color: rgba(50, 54, 69, 1);
85
+        }
86
+      }
87
+      .desc {
88
+        flex: 1;
89
+        display: flex;
90
+        align-items: center;
91
+        font-size: 0.12rem;
92
+        color: rgba(128, 128, 128, 1);
93
+      }
94
+      .time {
95
+        font-size: 0.12rem;
96
+        color: rgba(128, 128, 128, 1);
97
+      }
98
+    }
99
+    .card-right {
100
+      width: 0.9rem;
101
+      height: 0.9rem;
102
+      position: relative;
103
+      .btn {
104
+        position: absolute;
105
+        top: 50%;
106
+        left: 50%;
107
+        transform: translate(-25%, -50%);
108
+        color: #ff7c1c;
109
+        width: 0.62rem;
110
+        text-align: center;
111
+        padding-bottom: 0.02rem;
112
+        border: 1px solid #ff7c1c;
113
+        border-radius: 0.2rem;
114
+        z-index: 2;
115
+      }
116
+    }
39 117
 
118
+    .tag {
119
+      position: absolute;
120
+      background: linear-gradient(
121
+        45deg,
122
+        rgba(255, 105, 0, 1) 0%,
123
+        rgba(255, 136, 0, 0.76) 100%
124
+      );
125
+      opacity: 0.85;
126
+      width: 0.6rem;
127
+      height: 0.6rem;
128
+      transform: rotate(45deg);
129
+      bottom: -0.3rem;
130
+      right: -0.3rem;
131
+      &.gray-location {
132
+        background: rgba(189, 189, 189, 1);
133
+      }
134
+      span {
135
+        position: absolute;
136
+        top: 0.22rem;
137
+        left: -0.03rem;
138
+        font-size: 0.12rem;
139
+        color: #fff;
140
+        transform: rotate(-90deg);
141
+      }
142
+    }
143
+  }
144
+  .useType {
145
+    position: absolute;
146
+    bottom: 0.25rem;
147
+    right: 0.25rem;
148
+    width: 0.76rem;
149
+    height: 0.76rem;
40 150
   }
41
-  .card-right{
42
-    width: .9rem;
151
+}
152
+
153
+@media screen and (max-width: 320px) {
154
+  .tag {
155
+    span {
156
+      top: 0.2rem !important;
157
+      left: -0.05rem !important;
158
+    }
43 159
   }
44 160
 }
45 161
 </style>

+ 65
- 0
src/components/qrCodeCard/qrCodeCard.vue Ver fichero

@@ -0,0 +1,65 @@
1
+<template>
2
+  <div class="codeLayout">
3
+    <div id="QRcode"></div>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+import QRCode from 'qrcodejs2'
9
+export default {
10
+  name: 'qrCodeCard',
11
+  props: {
12
+    msg: {
13
+      type: Object,
14
+      default: () => {}
15
+    }
16
+  },
17
+  data () {
18
+    return {
19
+      lessonType: {
20
+        800: '1012-',
21
+        801: '1012-',
22
+        802: '1011-',
23
+        803: '1010-',
24
+        804: '1013-'
25
+      }
26
+    }
27
+  },
28
+  methods: {
29
+    InitCodeRules (info) {
30
+      let codeText
31
+      for (var Key in this.lessonType
32
+      ) {
33
+        if (parseInt(Key) === this.msg.course_type) {
34
+          codeText = this.lessonType[Key] + '-1'
35
+        }
36
+      }
37
+      const ele = document.querySelector('#QRcode')
38
+      this.qrCode = new QRCode(ele, {
39
+        text: codeText,
40
+        width: '100',
41
+        height: '100',
42
+        colorDark: '#000000',
43
+        colorLight: '#ffffff',
44
+        correctLevel: QRCode.CorrectLevel.H
45
+      })
46
+    }
47
+  },
48
+  components: {
49
+    QRCode
50
+  },
51
+  mounted () {
52
+    this.InitCodeRules()
53
+  }
54
+}
55
+</script>
56
+
57
+<style lang="scss" scoped>
58
+.codeLayout{
59
+  display: flex;
60
+  flex-flow: column nowrap;
61
+  justify-content: center;
62
+  align-items: center;
63
+  padding-bottom: .1rem;
64
+}
65
+</style>

+ 72
- 43
src/module/user/card/index.vue Ver fichero

@@ -3,42 +3,47 @@
3 3
     <nav class="flex-h">
4 4
       <a class="flex-item" v-for="(item,index) in nav" :key="index" :class="{'active':index==active}" @click="change(item,index)">{{item}}</a>
5 5
     </nav>
6
-    <div class="box">
7
-      <div v-if="active == 0">
8
-        <discounts v-for="(item,index) in data[0].list" :key='index'></discounts>
9
-      </div>
10
-      <div v-if="active == 1">
11
-        <div class="fitness-card" v-for="(item,index) in data[1].list" :key='index' :class="{'opacity' : item.useType == '已失效' || item.useType == '已使用', 'gray': item.useType == '已使用'}">
12
-          <div class="card-top">
13
-            <div class="top-left">
14
-              <img :src="logo" alt="">
15
-              <div class="price">
16
-                <span>¥</span>
17
-                <h1>{{item.price}}</h1>
18
-                <span>元</span>
6
+    <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='data[active].list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
7
+      <div class="box">
8
+        <div v-if="active == 0">
9
+          <discounts v-for="(item,index) in data[0].list" :key='index' @toUse='toUse' :data='item' @toDetail="toCouponsDetail(item)"></discounts>
10
+          <noMore v-if="data[active].hasPic"></noMore>
11
+        </div>
12
+        <div v-if="active == 1">
13
+          <div class="fitness-card" v-for="(item,index) in data[1].list" :key='index'>
14
+            <div :class="{'opacity' : item.useType == '已失效' || item.useType == '已使用', 'gray': item.useType == '已使用'}" @click="toCardDetail(item)">
15
+              <div class="card-top">
16
+                <div class="top-left">
17
+                  <img :src="logo" alt="">
18
+                  <div class="price">
19
+                    <span>¥</span>
20
+                    <h1>{{item.price}}</h1>
21
+                    <span>元</span>
22
+                  </div>
23
+                </div>
24
+                <div class="top-right">
25
+                  <img :src="Line3" alt="">
26
+                  <div>{{item.title}}</div>
27
+                  <div>{{item.desc}}</div>
28
+                </div>
29
+              </div>
30
+              <div class="card-bottom">
31
+                <img :src="line" alt="">
32
+                <div class="time">有效期:{{item.time}}</div>
33
+                <div class="status" :class="{'gray-location' : item.useType == '已使用'}">
34
+                  <span>{{item.tag}}</span>
35
+                </div>
19 36
               </div>
20 37
             </div>
21
-            <div class="top-right">
22
-              <img :src="Line3" alt="">
23
-              <div>{{item.title}}</div>
24
-              <div>{{item.desc}}</div>
25
-            </div>
26
-          </div>
27
-          <div class="card-bottom">
28
-            <img :src="line" alt="">
29
-            <div class="time">有效期:{{item.time}}</div>
30
-            <div class="status" :class="{'gray-location' : item.useType == '已使用'}">
31
-              <span>次卡</span>
38
+            <div class="useType">
39
+              <img :src="used" alt="已使用" v-if="item.useType == '已使用'" width="100%" height="100%">
40
+              <img :src="failure" alt="已失效" v-if="item.useType == '已失效'" width="100%" height="100%">
32 41
             </div>
33 42
           </div>
34
-          <div class="useType">
35
-            <img :src="used" alt="已使用" v-if="item.useType == '已使用'" width="100%" height="100%">
36
-            <img :src="failure" alt="已失效" v-if="item.useType == '已失效'" width="100%" height="100%">
37
-          </div>
43
+          <noMore v-if="data[active].hasPic"></noMore>
38 44
         </div>
39
-        <noMore v-if="data[active].hasPic"></noMore>
40 45
       </div>
41
-    </div>
46
+    </scroll>
42 47
   </div>
43 48
 </template>
44 49
 
@@ -69,46 +74,58 @@ export default {
69 74
       data: [
70 75
         {
71 76
           hasPic: false,
77
+          hasMore: true,
72 78
           list: [
73 79
             {
74
-              title: '会所健身体验卡',
75
-              desc: '适用于游泳',
76
-              time: '2018年02月17日-2018年3月17日',
77
-              price: '120',
78
-              useType: '未使用'
80
+              title: '小小外交官体验卡',
81
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
82
+              time: '2018年02月17日',
83
+              useType: '未使用',
84
+              tag: '共享'
79 85
             },
80 86
             {
81
-              title: '会所健身体验卡',
82
-              desc: '适用于游泳',
83
-              time: '2018年02月17日-2018年3月17日',
84
-              price: '120',
85
-              useType: '未使用'
87
+              title: '小小外交官体验卡',
88
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
89
+              time: '2018年02月17日',
90
+              useType: '已使用',
91
+              tag: '商品'
92
+            },
93
+            {
94
+              title: '小小外交官体验卡',
95
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
96
+              time: '2018年02月17日',
97
+              useType: '已失效',
98
+              tag: '商品'
86 99
             }
87 100
           ]
88 101
         },
89 102
         {
90 103
           hasPic: false,
104
+          hasMore: true,
91 105
           list: [
92 106
             {
93 107
               title: '会所健身体验卡',
94 108
               desc: '适用于游泳',
95 109
               time: '2018年02月17日-2018年3月17日',
96 110
               price: '120',
97
-              useType: '未使用'
111
+              useType: '未使用',
112
+              tag: '年卡'
98 113
             },
99 114
             {
100 115
               title: '会所健身体验卡',
101 116
               desc: '适用于游泳',
102 117
               time: '2018年02月17日-2018年3月17日',
103 118
               price: '120',
104
-              useType: '已使用'
119
+              useType: '已使用',
120
+              tag: '季卡'
105 121
             },
106 122
             {
107 123
               title: '会所健身体验卡',
108 124
               desc: '适用于游泳',
109 125
               time: '2018年02月17日-2018年3月17日',
110 126
               price: '120',
111
-              useType: '已失效'
127
+              useType: '已失效',
128
+              tag: '次卡'
112 129
             }
113 130
           ]
114 131
         }
@@ -137,6 +154,18 @@ export default {
137 154
   methods: {
138 155
     change (item, index) {
139 156
       this.active = index
157
+    },
158
+    toUse (item) {
159
+      console.log(item)
160
+    },
161
+    getList () {
162
+      console.log(111)
163
+    },
164
+    toCardDetail (item) {
165
+      this.$router.push({ name: 'cardDetail' })
166
+    },
167
+    toCouponsDetail () {
168
+      this.$router.push({ name: 'couponsDetail' })
140 169
     }
141 170
   }
142 171
 }

+ 3
- 3
src/module/user/card/page.scss Ver fichero

@@ -37,10 +37,10 @@
37 37
       border-radius: 8px;
38 38
       margin-bottom: .2rem;
39 39
       position: relative;
40
-      &.opacity {
40
+      .opacity {
41 41
         opacity: .5;
42 42
       }
43
-      &.gray {
43
+      .gray {
44 44
         filter: grayscale(100%);
45 45
       }
46 46
       .card-top{
@@ -160,4 +160,4 @@
160 160
       }
161 161
     }
162 162
   }
163
-}
163
+}

+ 57
- 0
src/module/user/cardDetail/index.vue Ver fichero

@@ -0,0 +1,57 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="title">体验卡详情</div>
4
+    <div class="content">
5
+      <div class="message">
6
+        <div>
7
+          <span>会所健身体验卡</span>
8
+          <span class="sub">(可在银城会所健身房和游泳池使用)</span>
9
+        </div>
10
+        <div>
11
+          <span>有效时间</span>
12
+          <span>{{time}}</span>
13
+        </div>
14
+      </div>
15
+      <div class="rule">
16
+        <div>使用规则</div>
17
+        <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
18
+        <div>2. 此卡不可多人使用,一人记一次。 </div>
19
+        <div>3. 非会员可凭此卡享受对应课程。 </div>
20
+        <div>4. 截止日期至{{time}}。 </div>
21
+      </div>
22
+      <div class="line">
23
+        <img :src="Artboard" alt="" width="100%">
24
+      </div>
25
+      <div class="qr-code" style="margin-top:.1rem;">
26
+        <div class="number">核销编码: 3423487682734</div>
27
+        <qrCode :msg='msg'></qrCode>
28
+      </div>
29
+    </div>
30
+  </div>
31
+</template>
32
+
33
+<script>
34
+import qrCode from '../../../components/qrCodeCard/qrCodeCard'
35
+import Artboard from '../../../common/icon/Artboard.png'
36
+export default {
37
+  data () {
38
+    return {
39
+      msg: {
40
+        course_type: 800
41
+      },
42
+      Artboard,
43
+      time: '2018年3月17日'
44
+    }
45
+  },
46
+  methods: {
47
+
48
+  },
49
+  components: {
50
+    qrCode
51
+  }
52
+}
53
+</script>
54
+
55
+<style lang="scss" scoped>
56
+@import "page.scss";
57
+</style>

+ 60
- 0
src/module/user/cardDetail/page.scss Ver fichero

@@ -0,0 +1,60 @@
1
+.mainPage{
2
+  padding: .3rem .16rem .45rem;
3
+  box-sizing: border-box;
4
+  .title{
5
+    font-size: .18rem;
6
+    font-weight: bold;
7
+    padding-bottom: .14rem;
8
+    padding-left: .2rem;
9
+  }
10
+  .content{
11
+    background:#fff;
12
+    box-shadow:0px .08rem .37rem 0px rgba(202,202,202,0.42);
13
+    border-radius:.1rem;
14
+    padding: .12rem 0;
15
+    .message{
16
+      padding: 0 .22rem;
17
+      div{
18
+        margin-bottom: .2rem;
19
+        display: flex;
20
+        justify-content: space-between;
21
+        align-items: center;
22
+        span:nth-of-type(1){
23
+          font-size: .14rem;
24
+        }
25
+        span:nth-last-of-type(1){
26
+          text-align: right;
27
+        }
28
+        .sub{
29
+          color: #FA2A00;
30
+          font-size: .12rem;
31
+        }
32
+      }
33
+    }
34
+    .rule{
35
+      padding: 0 .22rem;
36
+      div:nth-of-type(1){
37
+        margin-bottom: .2rem;
38
+        font-size: .14rem;
39
+        color: #000;
40
+      }
41
+      div{
42
+        font-size: .12rem;
43
+        color: rgba(174,174,174,1);
44
+        margin-bottom: .1rem;
45
+      }
46
+    }
47
+  }
48
+  .number{
49
+    text-align: center;
50
+    color:rgba(143,143,143,1);
51
+    margin-bottom: .2rem;
52
+  }
53
+  .useType{
54
+    position: absolute;
55
+    bottom: 1.6rem;
56
+    right: .8rem;
57
+    width: .76rem;
58
+    height: .76rem;
59
+  }
60
+}

+ 98
- 0
src/module/user/coupons/index.vue Ver fichero

@@ -0,0 +1,98 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
4
+      <div class="box">
5
+        <discounts v-for="(item,index) in list" :key='index' @toUse='toUse' :data='item'></discounts>
6
+        <noMore v-if="hasPic"></noMore>
7
+      </div>
8
+    </scroll>
9
+  </div>
10
+</template>
11
+
12
+<script>
13
+import line from '../../../common/icon/cicyle.png'
14
+import logo from '../../../common/icon/logo-t.png'
15
+import Line3 from '../../../common/icon/Line3.png'
16
+import used from '../../../common/icon/already.png'
17
+import failure from '../../../common/icon/inv.png'
18
+// 上拉加载组件
19
+import scroll from '../../../components/scroll/scroll'
20
+import noMore from '../../../components/noMore/noMore'
21
+import discounts from '../../../components/discounts/discounts'
22
+export default {
23
+  data () {
24
+    return {
25
+      nav: ['课程体验卡', '健身卡'],
26
+      active: 0,
27
+      logo,
28
+      Line3,
29
+      used,
30
+      failure,
31
+      pullUpLoad: true,
32
+      pullUpLoadThreshold: 40,
33
+      startY: 0,
34
+      isloading: true,
35
+      hasMore: true,
36
+      hasPic: false,
37
+      hasMore: true,
38
+      list: [
39
+        {
40
+          title: '小小外交官体验卡',
41
+          desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
42
+          time: '2018年02月17日',
43
+          useType: '未使用',
44
+          tag: '共享'
45
+        },
46
+        {
47
+          title: '小小外交官体验卡',
48
+          desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
49
+          time: '2018年02月17日',
50
+          useType: '已使用',
51
+          tag: '商品'
52
+        },
53
+        {
54
+          title: '小小外交官体验卡',
55
+          desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
56
+          time: '2018年02月17日',
57
+          useType: '已失效',
58
+          tag: '商品'
59
+        }
60
+      ],
61
+      line
62
+    }
63
+  },
64
+  components: {
65
+    scroll,
66
+    noMore,
67
+    discounts
68
+  },
69
+  computed: {
70
+    pullUpLoadObj: function () {
71
+      return this.pullUpLoad
72
+        ? {
73
+          threshold: parseInt(this.pullUpLoadThreshold),
74
+          txt: {
75
+            more: this.pullUpLoadMoreTxt,
76
+            noMore: this.pullUpLoadNoMoreTxt
77
+          }
78
+        }
79
+        : false
80
+    }
81
+  },
82
+  methods: {
83
+    change (item, index) {
84
+      this.active = index
85
+    },
86
+    toUse (item) {
87
+      console.log(item)
88
+    },
89
+    getList () {
90
+      console.log(111)
91
+    }
92
+  }
93
+}
94
+</script>
95
+
96
+<style lang="scss" scoped>
97
+@import "page.scss";
98
+</style>

+ 7
- 0
src/module/user/coupons/page.scss Ver fichero

@@ -0,0 +1,7 @@
1
+.mainPage{
2
+  background: #fff;
3
+  .box{
4
+    padding: .25rem;
5
+    box-sizing: border-box;
6
+  }
7
+}

+ 56
- 0
src/module/user/couponsDetail/index.vue Ver fichero

@@ -0,0 +1,56 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="title">体验券详情</div>
4
+    <div class="content">
5
+      <div class="message">
6
+        <div>
7
+          <span>体验券名称:小小外交官体验券</span>
8
+        </div>
9
+        <div>
10
+          <span>有效时间:</span>
11
+          <div class="time">{{time}}</div>
12
+        </div>
13
+      </div>
14
+      <div class="rule">
15
+        <div>使用规则</div>
16
+        <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
17
+        <div>2. 此卡不可多人使用,一人记一次。 </div>
18
+        <div>3. 非会员可凭此卡享受对应课程。 </div>
19
+        <div>4. 截止日期至{{time}}。 </div>
20
+      </div>
21
+      <div class="line">
22
+        <img :src="Artboard" alt="" width="100%">
23
+      </div>
24
+      <div class="qr-code" style="margin-top:.1rem;">
25
+        <div class="number">核销编码: 3423487682734</div>
26
+        <qrCode :msg='msg'></qrCode>
27
+      </div>
28
+    </div>
29
+  </div>
30
+</template>
31
+
32
+<script>
33
+import qrCode from '../../../components/qrCodeCard/qrCodeCard'
34
+import Artboard from '../../../common/icon/Artboard.png'
35
+export default {
36
+  data () {
37
+    return {
38
+      msg: {
39
+        course_type: 800
40
+      },
41
+      Artboard,
42
+      time: '2018年3月17日'
43
+    }
44
+  },
45
+  methods: {
46
+
47
+  },
48
+  components: {
49
+    qrCode
50
+  }
51
+}
52
+</script>
53
+
54
+<style lang="scss" scoped>
55
+@import "page.scss";
56
+</style>

+ 58
- 0
src/module/user/couponsDetail/page.scss Ver fichero

@@ -0,0 +1,58 @@
1
+.mainPage{
2
+  padding: .3rem .16rem .45rem;
3
+  box-sizing: border-box;
4
+  .title{
5
+    font-size: .18rem;
6
+    font-weight: bold;
7
+    padding-bottom: .14rem;
8
+    padding-left: .2rem;
9
+  }
10
+  .content{
11
+    background:#fff;
12
+    box-shadow:0px .08rem .37rem 0px rgba(202,202,202,0.42);
13
+    border-radius:.1rem;
14
+    padding: .12rem 0;
15
+    .message{
16
+      padding: 0 .22rem;
17
+      div{
18
+        margin-bottom: .2rem;
19
+        span:nth-of-type(1){
20
+          font-size: .14rem;
21
+        }
22
+        span:nth-last-of-type(1){
23
+          text-align: right;
24
+        }
25
+        .time{
26
+          margin-top: .1rem;
27
+          color: rgba(174,174,174,1);
28
+          font-size: .14rem;
29
+        }
30
+      }
31
+    }
32
+    .rule{
33
+      padding: 0 .22rem;
34
+      div:nth-of-type(1){
35
+        margin-bottom: .2rem;
36
+        font-size: .14rem;
37
+        color: #000;
38
+      }
39
+      div{
40
+        font-size: .12rem;
41
+        color: rgba(174,174,174,1);
42
+        margin-bottom: .1rem;
43
+      }
44
+    }
45
+  }
46
+  .number{
47
+    text-align: center;
48
+    color:rgba(143,143,143,1);
49
+    margin-bottom: .2rem;
50
+  }
51
+  .useType{
52
+    position: absolute;
53
+    bottom: 1.6rem;
54
+    right: .8rem;
55
+    width: .76rem;
56
+    height: .76rem;
57
+  }
58
+}

+ 84
- 0
src/module/user/lessonDetail/index.vue Ver fichero

@@ -0,0 +1,84 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="title">课程详情</div>
4
+    <div class="content" :class="{'opacity' : useType == '已失效' || useType == '已使用', 'gray': useType == '已使用' || useType == '已失效'}">
5
+      <div class="list-item">
6
+        <span>订单编号</span>
7
+        <span>144215646445464</span>
8
+      </div>
9
+      <div class="list-item">
10
+        <span>订单名称</span>
11
+        <span>拉伸柔韧度</span>
12
+      </div>
13
+      <div class="list-item">
14
+        <span>节课数</span>
15
+        <span>2节课</span>
16
+      </div>
17
+      <div class="list-item">
18
+        <span>类型</span>
19
+        <span>健身</span>
20
+      </div>
21
+      <div class="list-item">
22
+        <span>商品价格</span>
23
+        <span>¥1999</span>
24
+      </div>
25
+      <div class="list-item">
26
+        <span>下单时间</span>
27
+        <span>2018/04/12 14:26:09</span>
28
+      </div>
29
+      <div class="list-item">
30
+        <span>课程时间</span>
31
+        <span>2018/04/12 12:00至14:00 计划备注(每周六 19:30)</span>
32
+      </div>
33
+      <div class="list-item">
34
+        <span>地点</span>
35
+        <span>悦见山G99</span>
36
+      </div>
37
+      <div class="list-item">
38
+        <span>付款方式</span>
39
+        <span>优惠券抵用 <div class="coupon-name">小拉伸柔韧度体验券</div></span>
40
+      </div>
41
+      <div class="half-cic">
42
+        <span></span>
43
+        <span></span>
44
+      </div>
45
+      <div class="qr-code">
46
+        <qrCode :msg='msg'></qrCode>
47
+        <div class="number">32237489123</div>
48
+      </div>
49
+    </div>
50
+    <div class="useType">
51
+      <img :src="used" alt="已使用" v-if="useType == '已使用'" width="100%" height="100%">
52
+      <img :src="failure" alt="已失效" v-if="useType == '已失效'" width="100%" height="100%">
53
+    </div>
54
+  </div>
55
+</template>
56
+
57
+<script>
58
+import qrCode from '../../../components/qrCodeCard/qrCodeCard'
59
+import used from '../../../common/icon/already.png'
60
+import failure from '../../../common/icon/inv.png'
61
+export default {
62
+  data () {
63
+    return {
64
+      msg: {
65
+        course_type: 800,
66
+        orderNo: '342897789334'
67
+      },
68
+      useType: '未使用',
69
+      used,
70
+      failure,
71
+    }
72
+  },
73
+  methods: {
74
+
75
+  },
76
+  components: {
77
+    qrCode
78
+  }
79
+}
80
+</script>
81
+
82
+<style lang="scss" scoped>
83
+@import "page.scss";
84
+</style>

+ 73
- 0
src/module/user/lessonDetail/page.scss Ver fichero

@@ -0,0 +1,73 @@
1
+.mainPage{
2
+  padding: .3rem .16rem .45rem;
3
+  box-sizing: border-box;
4
+  .title{
5
+    font-size: .18rem;
6
+    font-weight: bold;
7
+    padding-bottom: .14rem;
8
+    padding-left: .2rem;
9
+  }
10
+  .content{
11
+    background:#fff;
12
+    box-shadow:0px .08rem .37rem 0px rgba(202,202,202,0.42);
13
+    border-radius:.1rem;
14
+    padding: .12rem 0;
15
+    &.opacity {
16
+      opacity: .5;
17
+    }
18
+    &.gray {
19
+      filter: grayscale(100%);
20
+    }
21
+    .list-item{
22
+      display: flex;
23
+      justify-content: space-between;
24
+      align-items: flex-start;
25
+      padding: 0 .22rem;
26
+      margin-bottom: .1rem;
27
+      span{
28
+        display: block;
29
+        color: #666;
30
+      }
31
+      span:nth-of-type(2){
32
+        width: 60%;
33
+        text-align: right;
34
+        color: #000;
35
+        .coupon-name{
36
+          color: #FF2B00;
37
+          font-size: .12rem;
38
+        }
39
+      }
40
+    }
41
+    .half-cic{
42
+      height: .25rem;
43
+      display: flex;
44
+      justify-content: space-between;
45
+      overflow: hidden;
46
+      span{
47
+        display: block;
48
+        width: .25rem;
49
+        height: .25rem;
50
+        border-radius: 50%;
51
+        background: rgba(202,202,202,0.2);
52
+      }
53
+      span:nth-of-type(1){
54
+        transform: translateX(-50%);
55
+      }
56
+      span:nth-of-type(2){
57
+        transform: translateX(50%);
58
+      }
59
+    }
60
+    .number{
61
+      text-align: center;
62
+      color:rgba(143,143,143,1);
63
+      margin-top: .2rem;
64
+    }
65
+  }
66
+  .useType{
67
+    position: absolute;
68
+    bottom: 1.6rem;
69
+    right: .8rem;
70
+    width: .76rem;
71
+    height: .76rem;
72
+  }
73
+}

+ 4
- 1
src/module/user/lessonOrder/index.vue Ver fichero

@@ -2,7 +2,7 @@
2 2
   <div class="mainPage">
3 3
     <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
4 4
       <div class="box">
5
-        <div class="order-card flex-h" v-for="(item,index) in list" :key='index' :class="{'opacity' : item.useType == '已失效'}">
5
+        <div class="order-card flex-h" v-for="(item,index) in list" :key='index' :class="{'opacity' : item.useType == '已失效'}" @click="toDetail(item)">
6 6
           <div class="card-pic">
7 7
             <div :class="{'gray-location' : item.useType == '已失效'}"><span>{{item.LocationName}}</span></div>
8 8
             <img src="" class="cover" width="100%" height="100%" alt="">
@@ -123,6 +123,9 @@ export default {
123 123
         this.$refs.scroll.forceUpdate()
124 124
         return false
125 125
       }
126
+    },
127
+    toDetail () {
128
+      this.$router.push({name: 'lessonDetail'})
126 129
     }
127 130
   }
128 131
 }

+ 5
- 2
src/module/user/mainPage/userCenter/index.vue Ver fichero

@@ -18,14 +18,14 @@
18 18
         </div>
19 19
       </div>
20 20
       <div class="vip-privilege flex-h">
21
-        <div class="flex-item privilege-item">
21
+        <div class="flex-item privilege-item" @click="toCoupons">
22 22
           <div class="img-box">
23 23
             <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
24 24
           </div>
25 25
           <span>优惠券</span>
26 26
           <span>2张未使用</span>
27 27
         </div>
28
-        <div class="flex-item privilege-item"  @click="toCard">
28
+        <div class="flex-item privilege-item" @click="toCard">
29 29
           <div class="img-box">
30 30
             <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
31 31
           </div>
@@ -103,6 +103,9 @@ export default {
103 103
     },
104 104
     toCard () {
105 105
       this.$router.push({ name: 'card' })
106
+    },
107
+    toCoupons () {
108
+      this.$router.push({ name: 'coupons' })
106 109
     }
107 110
   }
108 111
 }

+ 24
- 0
src/module/user/router.js Ver fichero

@@ -12,6 +12,10 @@ import bindMobile from './bindMobile/bindMobile' // 绑定手机号
12 12
 import lessonOrder from './lessonOrder/index' // 我的订单
13 13
 import vip from './vip/index' // vip卡说明
14 14
 import card from './card/index' // 卡
15
+import coupons from './coupons/index' // 优惠券
16
+import lessonDetail from './lessonDetail/index' // 课程详情
17
+import cardDetail from './cardDetail/index' // 体验卡详情
18
+import couponsDetail from './couponsDetail/index' // 体验券详情
15 19
 
16 20
 Vue.use(Router)
17 21
 
@@ -71,6 +75,26 @@ const router = new Router({
71 75
     name: 'card',
72 76
     component: card,
73 77
     children: []
78
+  },{ // 优惠券
79
+    path: '/coupons',
80
+    name: 'coupons',
81
+    component: coupons,
82
+    children: []
83
+  },{ // 课程详情
84
+    path: '/lessonDetail',
85
+    name: 'lessonDetail',
86
+    component: lessonDetail,
87
+    children: []
88
+  },{ // 体验卡详情
89
+    path: '/cardDetail',
90
+    name: 'cardDetail',
91
+    component: cardDetail,
92
+    children: []
93
+  },{ // 体验券详情
94
+    path: '/couponsDetail',
95
+    name: 'couponsDetail',
96
+    component: couponsDetail,
97
+    children: []
74 98
   }],
75 99
   linkActiveClass: 'active',
76 100
 })