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

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

@@ -73,4 +73,8 @@ select option {
73 73
 
74 74
 .van-toast i{
75 75
 	color: white;
76
+}
77
+
78
+::-webkit-scrollbar {
79
+	display: none;
76 80
 }

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

@@ -31,7 +31,7 @@
31 31
         <span>40</span>
32 32
       </div>
33 33
     </div>
34
-    <div class="card-bottom" @click.stop="share">
34
+    <div v-if='canShare' class="card-bottom" @click.stop="share">
35 35
       分享卡券
36 36
     </div>
37 37
   </div>
@@ -54,6 +54,10 @@ export default {
54 54
     data: {
55 55
       type: Object,
56 56
       default: () => { }
57
+    },
58
+    canShare: {
59
+      type: Boolean,
60
+      default: true
57 61
     }
58 62
   },
59 63
   methods: {
@@ -149,6 +153,7 @@ export default {
149 153
     background-color: #fc6243;
150 154
     text-align: center;
151 155
     color: #fff;
156
+    border-radius: 0 0 .08rem .08rem;
152 157
   }
153 158
 }
154 159
 </style>

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

@@ -7,7 +7,7 @@
7 7
       <slot name="pullup" v-if="isloading" :pullUpLoad="pullUpLoad" :isPullUpLoad="isPullUpLoad">
8 8
         <div class="pullup-wrapper" v-if="pullUpLoad">
9 9
           <div class="before-trigger" v-if="!isPullUpLoad">
10
-            <span>{{pullUpTxt}}</span>
10
+            <!-- <span>{{pullUpTxt}}</span> -->
11 11
           </div>
12 12
           <div class="after-trigger" v-else>
13 13
             <loading></loading>

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

@@ -11,33 +11,36 @@
11 11
         </div>
12 12
         <div v-if="active == 1">
13 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)">
14
+            <div :class="{'opacity' : item.CardStatus == 'expire' || item.CardStatus == 'used', 'gray': item.CardStatus == 'used'}" @click="toCardDetail(item)">
15 15
               <div class="card-top">
16 16
                 <div class="top-left">
17 17
                   <img :src="logo" alt="">
18 18
                   <div class="price">
19 19
                     <span>¥</span>
20
-                    <h1>{{item.price}}</h1>
20
+                    <h1>{{parseInt(item.Price)}}</h1>
21 21
                     <span>元</span>
22 22
                   </div>
23 23
                 </div>
24 24
                 <div class="top-right">
25 25
                   <img :src="Line3" alt="">
26
-                  <div>{{item.title}}</div>
27
-                  <div>{{item.desc}}</div>
26
+                  <div>{{item.CustomerGymName}}</div>
27
+                  <div>{{item.CardShareInfo}}</div>
28 28
                 </div>
29 29
               </div>
30 30
               <div class="card-bottom">
31 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>
32
+                <div class="time">有效期:{{toolClass.dateFormat(item.EndDate)}}</div>
33
+                <div class="status" :class="{'gray-location' : item.CardStatus == 'used'}">
34
+                  <span v-if="item.GymType == 'year'">年卡</span>
35
+                  <span v-if="item.GymType == 'quarter'">季卡</span>
36
+                  <span v-if="item.GymType == 'month'">月卡</span>
37
+                  <span v-if="item.GymType == 'once'">次卡</span>
35 38
                 </div>
36 39
               </div>
37 40
             </div>
38 41
             <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%">
42
+              <img :src="used" alt="已使用" v-if="item.CardStatus == 'used'" width="100%" height="100%">
43
+              <img :src="failure" alt="已失效" v-if="item.CardStatus == 'expire'" width="100%" height="100%">
41 44
             </div>
42 45
           </div>
43 46
           <noMore v-if="data[active].hasPic"></noMore>
@@ -57,6 +60,8 @@ import failure from '../../../common/icon/inv.png'
57 60
 import scroll from '../../../components/scroll/scroll'
58 61
 import noMore from '../../../components/noMore/noMore'
59 62
 import discounts from '../../../components/discounts/discounts'
63
+import { createNamespacedHelpers } from 'vuex'
64
+const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
60 65
 export default {
61 66
   data () {
62 67
     return {
@@ -70,11 +75,12 @@ export default {
70 75
       pullUpLoadThreshold: 40,
71 76
       startY: 0,
72 77
       isloading: true,
73
-      hasMore: true,
74 78
       data: [
75 79
         {
76 80
           hasPic: false,
77 81
           hasMore: true,
82
+          page: 1,
83
+          pageSize: 1,
78 84
           list: [
79 85
             {
80 86
               title: '小小外交官体验卡',
@@ -102,32 +108,9 @@ export default {
102 108
         {
103 109
           hasPic: false,
104 110
           hasMore: true,
105
-          list: [
106
-            {
107
-              title: '会所健身体验卡',
108
-              desc: '适用于游泳',
109
-              time: '2018年02月17日-2018年3月17日',
110
-              price: '120',
111
-              useType: '未使用',
112
-              tag: '年卡'
113
-            },
114
-            {
115
-              title: '会所健身体验卡',
116
-              desc: '适用于游泳',
117
-              time: '2018年02月17日-2018年3月17日',
118
-              price: '120',
119
-              useType: '已使用',
120
-              tag: '季卡'
121
-            },
122
-            {
123
-              title: '会所健身体验卡',
124
-              desc: '适用于游泳',
125
-              time: '2018年02月17日-2018年3月17日',
126
-              price: '120',
127
-              useType: '已失效',
128
-              tag: '次卡'
129
-            }
130
-          ]
111
+          page: 0,
112
+          pageSize: 10,
113
+          list: []
131 114
         }
132 115
       ],
133 116
       line
@@ -149,28 +132,54 @@ export default {
149 132
           }
150 133
         }
151 134
         : false
152
-    }
135
+    },
136
+    ...mapCardState({
137
+      gymCardList: x => x.gymCardList
138
+    })
139
+  },
140
+  created () {
141
+    this.change('', 0)
153 142
   },
154 143
   methods: {
144
+    ...mapCardActions(['getgymCardList']),
155 145
     change (item, index) {
156 146
       this.active = index
147
+      this.getList('change')
157 148
     },
158 149
     toUse (item) {
159 150
       // console.log(item)
160 151
     },
161
-    getList () {
162
-      // console.log(111)
152
+    getList (param) {
153
+      if (this.active === 0) {
154
+
155
+      } else {
156
+        if (param === 'change') {
157
+          this.data[this.active].page = 0
158
+        }
159
+        if (this.data[this.active].hasMore) {
160
+          this.getgymCardList({ page: this.data[this.active].page, pageSize: this.data[this.active].pageSize }).then((res) => {
161
+            this.data[this.active].list = this.data[this.active].list.concat(this.gymCardList)
162
+            this.data[this.active].page++
163
+            if (this.gymCardList.length < this.data[this.active].pageSize) {
164
+              this.data[this.active].hasMore = false
165
+            }
166
+            if (this.data[this.active].list.length <= 0) {
167
+              this.data[this.active].hasPic = true
168
+            }
169
+          })
170
+        }
171
+      }
163 172
     },
164 173
     toCardDetail (item) {
165
-      this.$router.push({ name: 'cardDetail' })
174
+      this.$router.push({ name: 'cardDetail', query: { CustomerGymId: item.CustomerGymId } })
166 175
     },
167 176
     toCouponsDetail () {
168
-      this.$router.push({ name: 'couponsDetail' })
177
+      this.$router.push({ name: 'couponsDetail'})
169 178
     }
170 179
   }
171 180
 }
172 181
 </script>
173 182
 
174 183
 <style lang="scss" scoped>
175
-@import "page.scss";
184
+@import 'page.scss';
176 185
 </style>

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

@@ -9,22 +9,18 @@
9 9
         </div>
10 10
         <div>
11 11
           <span>有效时间</span>
12
-          <span>{{time}}</span>
12
+          <span>{{toolClass.dateFormat(gymCardDetail.EndDate)}}</span>
13 13
         </div>
14 14
       </div>
15 15
       <div class="rule">
16 16
         <div>使用规则</div>
17
-        <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
18
-        <div>2. 此卡不可多人使用,一人记一次。 </div>
19
-        <div>3. 非会员可凭此卡享受对应课程。 </div>
20
-        <div>4. 截止日期至{{time}}。 </div>
17
+        <div>{{gymCardDetail.CardUseRule}}</div>
21 18
       </div>
22 19
       <div class="line">
23 20
         <img :src="Artboard" alt="" width="100%">
24 21
       </div>
25 22
       <div class="qr-code" style="margin-top:.1rem;">
26
-        <div class="number">核销编码: 3423487682734</div>
27
-        <qrCode :msg='msg'></qrCode>
23
+        <qrCode :msg='msg' v-if="msg"></qrCode>
28 24
       </div>
29 25
     </div>
30 26
   </div>
@@ -33,25 +29,38 @@
33 29
 <script>
34 30
 import qrCode from '../../../components/qrCodeCard/qrCodeCard'
35 31
 import Artboard from '../../../common/icon/Artboard.png'
32
+import { createNamespacedHelpers } from 'vuex'
33
+const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
36 34
 export default {
37 35
   data () {
38 36
     return {
39
-      msg: {
40
-        course_type: 800
41
-      },
37
+      msg: '',
42 38
       Artboard,
43 39
       time: '2018年3月17日'
44 40
     }
45 41
   },
46 42
   methods: {
47 43
 
44
+  },
45
+  computed: {
46
+    ...mapCardState({
47
+      gymCardDetail: x => x.gymCardDetail
48
+    })
48 49
   },
49 50
   components: {
50 51
     qrCode
52
+  },
53
+  created () {
54
+    this.getgymCardDetail({ customerGymId: this.$route.query.CustomerGymId }).then(() => {
55
+      this.msg = this.gymCardDetail.CustomerGymId
56
+    })
57
+  },
58
+  methods: {
59
+    ...mapCardActions(['getgymCardDetail'])
51 60
   }
52 61
 }
53 62
 </script>
54 63
 
55 64
 <style lang="scss" scoped>
56
-@import "page.scss";
65
+@import 'page.scss';
57 66
 </style>

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

@@ -22,8 +22,6 @@ import discounts from '../../../components/discounts/discounts'
22 22
 export default {
23 23
   data () {
24 24
     return {
25
-      nav: ['课程体验卡', '健身卡'],
26
-      active: 0,
27 25
       logo,
28 26
       Line3,
29 27
       used,

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

@@ -4,70 +4,99 @@
4 4
       <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.CustomerName : ''" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 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 !== '3'" :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>
8 8
     </nav>
9
-    <div class="content flex-item">
10
-      <div>
11
-        <ul>
12
-          <li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
13
-            <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== ''">
14
-              <div class="flex-item">
15
-                <div>
16
-                  <span>共计已使用:{{caseTotal.total}}杯</span>
9
+    <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='data[navActive].list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
10
+      <div class="content">
11
+        <div>
12
+          <ul>
13
+            <li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
14
+              <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== ''">
15
+                <div class="flex-item">
16
+                  <div>
17
+                    <span>共计已使用:{{caseTotal.total}}杯</span>
18
+                  </div>
19
+                </div>
20
+                <div class="flex-item">
21
+                  <div>
22
+                    <span>本月已用:{{caseTotal.monthtotal}}杯</span>
23
+                  </div>
17 24
                 </div>
25
+                <router-link :to="{name: 'orderList'}">点单记录</router-link>
18 26
               </div>
19
-              <div class="flex-item">
20
-                <div>
21
-                  <span>本月已用:{{caseTotal.monthtotal}}杯</span>
27
+              <div class="areaListParent flex-h">
28
+                <div class="flex-item">
29
+                  <div>
30
+                    <ul class="areaList">
31
+                      <li v-for="(item,index) in CaseTableList" :key="index">
32
+                        <div class="title">
33
+                          <i class="iconfont icon-yinchenglogo"></i>
34
+                          <span>{{item.AreaName}}</span>
35
+                        </div>
36
+                        <ul class="subAreaList flex-h">
37
+                          <router-link tag="li" class="flex-item flex-h" v-for="(subItem,subIndex) in item.Tables" :key="subIndex" :to="{name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(topCaseInfoData.CaseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName)}}">
38
+                            <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
39
+                          </router-link>
40
+                          <li class="flex-item noData" v-if="(item.Tables || []).length % 2 != 0"></li>
41
+                        </ul>
42
+                      </li>
43
+                    </ul>
44
+                  </div>
22 45
                 </div>
23 46
               </div>
24
-              <router-link :to="{name: 'orderList'}">点单记录</router-link>
25
-            </div>
26
-            <div class="areaListParent flex-h">
27
-              <div class="flex-item">
28
-                <div>
29
-                  <ul class="areaList">
30
-                    <li v-for="(item,index) in CaseTableList" :key="index">
31
-                      <div class="title">
32
-                        <i class="iconfont icon-yinchenglogo"></i>
33
-                        <span>{{item.AreaName}}</span>
34
-                      </div>
35
-                      <ul class="subAreaList flex-h">
36
-                        <router-link tag="li" class="flex-item flex-h" v-for="(subItem,subIndex) in item.Tables" :key="subIndex" :to="{name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(topCaseInfoData.CaseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName)}}">
37
-                          <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
38
-                        </router-link>
39
-                        <li class="flex-item noData" v-if="(item.Tables || []).length % 2 != 0"></li>
40
-                      </ul>
41
-                    </li>
42
-                  </ul>
47
+            </li>
48
+            <li :hidden="navActive !== 1" class="my-card">
49
+              <div class="list-box">
50
+                <div class="cardAndCouponInfo flex-h">
51
+                  <div class="flex-item">
52
+                    <div>
53
+                      <span>卡券货值总额:</span>
54
+                      <span>¥1000</span>
55
+                      <span>万</span>
56
+                    </div>
57
+                  </div>
58
+                  <a @click="toSalesHistory">销售记录</a>
43 59
                 </div>
60
+                <myCard v-for="(item,index) in data[1].list" :key="index" :data='item' @share='share'></myCard>
44 61
               </div>
45
-            </div>
46
-          </li>
47
-          <li :hidden="navActive !== 1" class="my-card">
48
-            <div class="list-box">
49
-              <div class="cardAndCouponInfo flex-h">
50
-                <div class="flex-item">
51
-                  <div>
52
-                    <span>卡券货值总额:</span>
53
-                    <span>¥1000</span>
54
-                    <span>万</span>
62
+            </li>
63
+            <li :hidden="navActive !== 2" class="my-card">
64
+              <div class="list-box">
65
+                <div class="cardAndCouponInfo flex-h">
66
+                  <div class="flex-item">
67
+                    <div>
68
+                      <span>卡券货值总额:</span>
69
+                      <span>¥1000</span>
70
+                      <span>万</span>
71
+                    </div>
55 72
                   </div>
73
+                  <a @click="toSalesHistory">销售记录</a>
74
+                </div>
75
+                <myCard v-for="(item,index) in data[2].list" :key="index" :data='item' @share='share'></myCard>
76
+              </div>
77
+            </li>
78
+            <li :hidden="navActive !== 3" class="customer-card">
79
+              <div class="list-box">
80
+                <div class="search-bar flex-h">
81
+                  <span>共15位客户</span>
82
+                  <van-checkbox v-model="checked">
83
+                    我推荐的客户(8人)
84
+                    <img
85
+                      slot="icon"
86
+                      slot-scope="props"
87
+                      :src="props.checked ? icon.active : icon.normal"
88
+                      style="width:.2rem;height:.2rem;bottom: .02rem;position: relative;"
89
+                    >
90
+                  </van-checkbox>
91
+                  <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
56 92
                 </div>
57
-                <a @click="toSalesHistory">销售记录</a>
58
-                <!-- <router-link :to="{name: 'salesRecord',query: {}}">销售记录</router-link> -->
93
+                <customerCard v-for="(item,index) in data[3].list" :key="index" :data='item' @share='share'></customerCard>
59 94
               </div>
60
-              <myCard v-for="(item,index) in cardList" :key="index" :data='item' @share='share'></myCard>
61
-            </div>
62
-          </li>
63
-          <li :hidden="navActive !== 2" class="customer-card">
64
-            <div class="list-box">
65
-              <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @share='share'></customerCard>
66
-            </div>
67
-          </li>
68
-        </ul>
95
+            </li>
96
+          </ul>
97
+        </div>
69 98
       </div>
70
-    </div>
99
+    </scroll>
71 100
     <div class="selectCase" :hidden="!showSelect"></div>
72 101
     <van-picker :hidden="!showSelect"
73 102
       show-toolbar
@@ -77,33 +106,66 @@
77 106
       @confirm="selectCase"
78 107
       value-key="CaseName"
79 108
     />
109
+    <van-dialog
110
+      v-model="showDialog"
111
+      show-cancel-button
112
+      title='添加备注'
113
+      :before-close="beforeClose">
114
+      <van-field
115
+        v-model="message"
116
+        type="textarea"
117
+        placeholder="请输入备注"
118
+        rows="3"
119
+        autosize/>
120
+    </van-dialog>
80 121
   </div>
81 122
 </template>
82 123
 
83 124
 <script>
125
+import scroll from '../../../../components/scroll/scroll'
84 126
 import caseTableItem from '../../../../components/caseTableItem/index'
85 127
 import topCaseInfo from '../../../../components/topCaseInfo/index'
86 128
 import myCard from '../../../../components/myCard/myCard'
87 129
 import customerCard from '../../../../components/customerCard/customerCard'
130
+import active from '../../../../common/icon/check-box-checked.png'
131
+import normal from '../../../../common/icon/check-box-empty.png'
88 132
 import { mapState, createNamespacedHelpers } from 'vuex'
89 133
 const { mapActions: actions } = createNamespacedHelpers('app')
90 134
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
91 135
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
136
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('myCustomer')
137
+const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
92 138
 
93 139
 export default {
94 140
   name: '',
95 141
   data () {
96 142
     return {
143
+      pullUpLoad: true,
144
+      pullUpLoadThreshold: 40,
145
+      startY: 0,
146
+      isloading: true,
147
+      icon: {
148
+        active: active,
149
+        normal: normal
150
+      },
151
+      active,
152
+      normal,
97 153
       navActive: 0,
154
+      checked: true,
155
+      showDialog: false,
156
+      message: '',
98 157
       cutNavList: [{
99 158
         value: '城咖啡',
100 159
         id: '1',
101 160
       }, {
102
-        value: '我的卡券',
161
+        value: '我的卡',
103 162
         id: '2',
104 163
       }, {
105
-        value: '我的客户',
164
+        value: '我的',
106 165
         id: '3',
166
+      }, {
167
+        value: '我的客户',
168
+        id: '4',
107 169
       }],
108 170
       topCaseInfoData: {
109 171
         CaseName: '',
@@ -122,20 +184,116 @@ export default {
122 184
         name: '案场名称2',
123 185
         list: [{}, {}, {}, {}, {}],
124 186
       }],
125
-      cardList: [
187
+      data: [
126 188
         {
127
-          invalid: true
189
+          hasPic: false,
190
+          hasMore: true,
191
+          page: 1,
192
+          pageSize: 1,
193
+          list: []
128 194
         },
129 195
         {
130
-          invalid: false
196
+          hasPic: false,
197
+          hasMore: true,
198
+          page: 1,
199
+          pageSize: 1,
200
+          list: [
201
+            {
202
+              title: '小小外交官体验卡',
203
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
204
+              time: '2018年02月17日',
205
+              useType: '未使用',
206
+              tag: '共享'
207
+            },
208
+            {
209
+              title: '小小外交官体验卡',
210
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
211
+              time: '2018年02月17日',
212
+              useType: '已使用',
213
+              tag: '商品'
214
+            },
215
+            {
216
+              title: '小小外交官体验卡',
217
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
218
+              time: '2018年02月17日',
219
+              useType: '已失效',
220
+              tag: '商品'
221
+            }
222
+          ]
131 223
         },
132 224
         {
133
-          invalid: false
225
+          hasPic: false,
226
+          hasMore: true,
227
+          page: 1,
228
+          pageSize: 1,
229
+          list: [
230
+            {
231
+              title: '小小外交官体验卡',
232
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
233
+              time: '2018年02月17日',
234
+              useType: '未使用',
235
+              tag: '共享'
236
+            },
237
+            {
238
+              title: '小小外交官体验卡',
239
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
240
+              time: '2018年02月17日',
241
+              useType: '已使用',
242
+              tag: '商品'
243
+            },
244
+            {
245
+              title: '小小外交官体验卡',
246
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
247
+              time: '2018年02月17日',
248
+              useType: '已失效',
249
+              tag: '商品'
250
+            }
251
+          ]
252
+        },
253
+        {
254
+          hasPic: false,
255
+          hasMore: true,
256
+          page: 1,
257
+          pageSize: 1,
258
+          list: [
259
+            {
260
+              title: '小小外交官体验卡',
261
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
262
+              time: '2018年02月17日',
263
+              useType: '未使用',
264
+              tag: '共享'
265
+            },
266
+            {
267
+              title: '小小外交官体验卡',
268
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
269
+              time: '2018年02月17日',
270
+              useType: '已使用',
271
+              tag: '商品'
272
+            },
273
+            {
274
+              title: '小小外交官体验卡',
275
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
276
+              time: '2018年02月17日',
277
+              useType: '已失效',
278
+              tag: '商品'
279
+            }
280
+          ]
134 281
         }
135 282
       ]
136 283
     }
137 284
   },
138 285
   computed: {
286
+    pullUpLoadObj: function () {
287
+      return this.pullUpLoad
288
+        ? {
289
+          threshold: parseInt(this.pullUpLoadThreshold),
290
+          txt: {
291
+            more: this.pullUpLoadMoreTxt,
292
+            noMore: this.pullUpLoadNoMoreTxt
293
+          }
294
+        }
295
+        : false
296
+    },
139 297
     ...mapState({
140 298
       userInfo: x => x.userCenter.userInfo,
141 299
       CaseList: x => x.app.CaseList,
@@ -144,12 +302,19 @@ export default {
144 302
     ...mapCaseState({
145 303
       caseTotal: x => x.caseTotal,
146 304
     }),
305
+    ...mapCustomerState({
306
+      customerList: x => x.customerList
307
+    }),
308
+    ...mapCardState({
309
+      cardList: x => x.cardList
310
+    })
147 311
   },
148 312
   components: {
149 313
     topCaseInfo,
150 314
     caseTableItem,
151 315
     myCard,
152
-    customerCard
316
+    customerCard,
317
+    scroll
153 318
   },
154 319
   created () {
155 320
     this.getCaseList().then((res) => {
@@ -161,6 +326,9 @@ export default {
161 326
       this.getCaseTotal({
162 327
         caseid: this.topCaseInfoData.CaseId
163 328
       })
329
+      this.getCustomerList().then(() => {
330
+
331
+      })
164 332
     })
165 333
   },
166 334
   methods: {
@@ -173,6 +341,8 @@ export default {
173 341
     ...mapCaseActions([
174 342
       'getCaseTotal',
175 343
     ]),
344
+    ...mapCustomerActions(['getCustomerList']),
345
+    ...mapCardActions(['getCardList']),
176 346
     toSalesHistory () {
177 347
       console.log(this.getUrl('salesRecord'))
178 348
       window.location.href = this.getUrl('salesRecord')
@@ -194,9 +364,54 @@ export default {
194 364
     },
195 365
     cutNav (index) { // 切换nav
196 366
       this.navActive = index
367
+      console.log(this.navActive)
368
+      // this.getList('change')
369
+    },
370
+    getList (param) {
371
+      if (this.navActive === 0) {
372
+        return
373
+      } else {
374
+        if (param === 'change') {
375
+          this.data[this.active].page = 0
376
+        }
377
+        if (this.data[this.active].hasMore) {
378
+          // this.getgymCardList({ page: this.data[this.active].page, pageSize: this.data[this.active].pageSize }).then((res) => {
379
+          //   this.data[this.active].list = this.data[this.active].list.concat(this.gymCardList)
380
+          //   this.data[this.active].page++
381
+          //   if (this.gymCardList.length < this.data[this.active].pageSize) {
382
+          //     this.data[this.active].hasMore = false
383
+          //   }
384
+          //   if (this.data[this.active].list.length <= 0) {
385
+          //     this.data[this.active].hasPic = true
386
+          //   }
387
+          // })
388
+        }
389
+      }
197 390
     },
198 391
     share (item) {
199 392
       console.log(item)
393
+    },
394
+    remark (item) {
395
+      console.log(item)
396
+      this.showDialog = true
397
+    },
398
+    history (item) {
399
+      console.log(item)
400
+      window.location.href = this.getUrl('history')
401
+    },
402
+    record (item) {
403
+      console.log(item)
404
+      window.location.href = this.getUrl('getRecord')
405
+    },
406
+    searchMask () {
407
+      window.location.href = this.getUrl('customerSearch')
408
+    },
409
+    beforeClose (action, done) {
410
+      if (action === 'confirm') {
411
+        setTimeout(done, 1000)
412
+      } else {
413
+        done()
414
+      }
200 415
     }
201 416
   }
202 417
 }

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

@@ -48,7 +48,7 @@
48 48
           width: 100%;
49 49
           height: 100%;
50 50
           position: relative;
51
-          overflow-y: scroll;
51
+          // overflow-y: scroll;
52 52
           -webkit-overflow-scrolling: touch;
53 53
           transform: translateZ(0);
54 54
           -webkit-transform: translateZ(0);
@@ -169,6 +169,15 @@
169 169
               padding: .1rem .2rem .2rem;
170 170
             }
171 171
           }
172
+          .search-bar{
173
+            align-items: center;
174
+            justify-content: space-between;
175
+            padding: 0 .1rem .1rem;
176
+            .search-icon{
177
+              font-size: .18rem;
178
+              color: #909090;
179
+            }
180
+          }
172 181
         }
173 182
       }
174 183
     }

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

@@ -0,0 +1,51 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    gymCardList: [],
9
+    gymCardDetail: ''
10
+  },
11
+  mutations: {
12
+    setgymCardList (state, data) { // 设置页面信息
13
+      state.gymCardList = data.list
14
+    },
15
+    setgymCardDetail (state, data) {
16
+      state.gymCardDetail = data
17
+    }
18
+  },
19
+  actions: {
20
+    getgymCardList (context, data) { // 获取课程详情信息
21
+      return new Promise((resolve) => {
22
+        Ajax(api.user.gymCard.url, {
23
+          method: api.user.gymCard.method,
24
+          queryData: {
25
+            ...data
26
+          }
27
+        }).then(res => {
28
+          context.commit('setgymCardList', res)
29
+          resolve(res)
30
+        }).catch((err) => {
31
+          reject(err)
32
+        })
33
+      })
34
+    },
35
+    getgymCardDetail (context, data) { // 获取课程详情信息
36
+      return new Promise((resolve, reject) => {
37
+        Ajax(api.user.gymCardDetail.url, {
38
+          method: api.user.gymCardDetail.method,
39
+          urlData: {
40
+            ...data
41
+          }
42
+        }).then(res => {
43
+          context.commit('setgymCardDetail', res)
44
+          resolve(res)
45
+        }).catch((err) => {
46
+          reject(err)
47
+        })
48
+      })
49
+    }
50
+  }
51
+}

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

@@ -19,6 +19,9 @@ export const modules = {
19 19
   case: () => require('./case/case').default,
20 20
   goodsOrder: () => require('./goods/order').default,
21 21
   login: () => require('./login/login').default,
22
+  myCustomer: () => require('./myCustomer/index').default,
23
+  myCard: () => require('./myCard/index').default,
24
+  card: () => require('./card/index').default
22 25
 }
23 26
 
24 27
 Object.keys(modules).forEach((modKey) => {

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

@@ -0,0 +1,29 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    cardList: []
9
+  },
10
+  mutations: {
11
+    setCustomerList (state, data) { // 设置页面信息
12
+      state.cardList = data
13
+    }
14
+  },
15
+  actions: {
16
+    getCustomerList (context) { // 获取课程详情信息
17
+      return new Promise((resolve) => {
18
+        Ajax(api.card.myCustomer.url, {
19
+          method: api.card.myCustomer.method
20
+        }).then(res => {
21
+          context.commit('setCustomerList', res)
22
+          resolve(res)
23
+        }).catch((err) => {
24
+          reject(err)
25
+        })
26
+      })
27
+    }
28
+  }
29
+}

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

@@ -0,0 +1,29 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    customerList: []
9
+  },
10
+  mutations: {
11
+    setCustomerList (state, data) { // 设置页面信息
12
+      state.customerList = data
13
+    }
14
+  },
15
+  actions: {
16
+    getCustomerList (context) { // 获取课程详情信息
17
+      return new Promise((resolve) => {
18
+        Ajax(api.card.myCustomer.url, {
19
+          method: api.card.myCustomer.method
20
+        }).then(res => {
21
+          context.commit('setCustomerList', res)
22
+          resolve(res)
23
+        }).catch((err) => {
24
+          reject(err)
25
+        })
26
+      })
27
+    }
28
+  }
29
+}

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

@@ -63,6 +63,12 @@ const $api = {
63 63
       url: `${baseUrl}${wechat}/order/course`
64 64
     },
65 65
   },
66
+  card:{
67
+    myCustomer:{ // 我的客户
68
+      method: 'get',
69
+      url: `${baseUrl}${wechat}/customer/user`
70
+    }
71
+  },
66 72
   user: {
67 73
     info: { // 获取用户信息
68 74
       method: 'get',
@@ -96,6 +102,14 @@ const $api = {
96 102
       method: 'get',
97 103
       url: `${baseUrl}${wechat}/course/user/:id`
98 104
     },
105
+    gymCard: { // 获取健身卡列表
106
+      method: 'get',
107
+      url: `${baseUrl}${wechat}/gymcard`
108
+    },
109
+    gymCardDetail: { // 获取健身卡列表
110
+      method: 'get',
111
+      url: `${baseUrl}${wechat}/gymcard/:customerGymId`
112
+    },
99 113
   },
100 114
   login: { // 主管、销售端登陆
101 115
     login: {

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

@@ -0,0 +1,45 @@
1
+import axios from 'axios'
2
+import api from './api'
3
+
4
+function wxsdk (params, config) {
5
+  const wx = require('weixin-js-sdk')
6
+
7
+  const shareData = {
8
+    title: config.title, // 分享标题
9
+    desc: config.desc, // 分享标题
10
+    link: config.link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
11
+    imgUrl: config.thu_image // 分享图标
12
+  }
13
+  // 初始化
14
+  return new Promise(function (resolve) {
15
+    axios.post(api.common.shareWx.url + '?url=' + params.url)
16
+      .then(function (res) {
17
+        let result = JSON.parse(res.data)
18
+        wx.config({
19
+          debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
20
+          appId: result.appId, // 必填,公众号的唯一标识
21
+          timestamp: result.timestamp, // 必填,生成签名的时间戳
22
+          nonceStr: result.noncestr, // 必填,生成签名的随机串
23
+          signature: result.signature, // 必填,签名,见附录1
24
+          jsApiList: [
25
+            'onMenuShareTimeline',
26
+            'onMenuShareAppMessage',
27
+            'onMenuShareQQ',
28
+            'onMenuShareWeibo',
29
+            'onMenuShareQZone',
30
+            'openLocation'
31
+          ]
32
+        })
33
+        wx.ready(function () {
34
+          wx.onMenuShareTimeline(shareData)
35
+          wx.onMenuShareAppMessage(shareData)
36
+          // resolve()
37
+        })
38
+      })
39
+      .catch(function (error) {
40
+        console.log(error)
41
+      })
42
+  })
43
+}
44
+
45
+export default wxsdk

+ 4
- 3
vue.config.js Прегледај датотеку

@@ -25,9 +25,10 @@ module.exports = {
25 25
       // '/api-v2': {
26 26
       '/api': {
27 27
         // target: 'https://dp.huiju360.com.cn/hj_operations',
28
-        target: 'http://192.168.0.62:8080', //wf
29
-        // target: 'http://192.168.0.11', //ys
30
-        // target: 'http://dev.ycjcjy.com', //frp
28
+        target: 'http://192.168.0.62:8080', // wf
29
+        // target: 'http://192.168.0.125:8080', // hyq
30
+        // target: 'http://192.168.0.11', // ys
31
+        // target: 'http://dev.ycjcjy.com', // frp
31 32
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
32 33
         // pathRewrite: {
33 34
         //   '^/api': '/api-v2/api'