Explorar el Código

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

yuantianjiao hace 6 años
padre
commit
015e672aa0

+ 6
- 0
package-lock.json Ver fichero

@@ -13386,6 +13386,12 @@
13386 13386
       "integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk=",
13387 13387
       "dev": true
13388 13388
     },
13389
+    "weixin-js-sdk": {
13390
+      "version": "1.3.3",
13391
+      "resolved": "https://registry.npmjs.org/weixin-js-sdk/-/weixin-js-sdk-1.3.3.tgz",
13392
+      "integrity": "sha512-1ofMi7Q1ioXV8/V8tGv3DrU7pugmyvhN86Pxbj1WaGeIEs/+yz0Jdv/5L+ocuDh/JAbKmtvMvBXh0OyuP6kQ8A==",
13393
+      "dev": true
13394
+    },
13389 13395
     "which": {
13390 13396
       "version": "1.3.1",
13391 13397
       "resolved": "http://registry.npm.taobao.org/which/download/which-1.3.1.tgz",

+ 3
- 14
src/components/customerCard/customerCard.vue Ver fichero

@@ -2,21 +2,16 @@
2 2
   <div class="card-content">
3 3
     <div class="card-top flex-h">
4 4
       <div class="flex-h">
5
-        <img :src="inv" alt="">
5
+        <img :src="data.Headimgurl" alt="">
6 6
         <div>
7
-          <span>姓名:王丽丽</span>
8
-          <span>手机号:17372957078</span>
7
+          <span>姓名:{{data.Name}}</span>
8
+          <span>手机号:{{data.Phone}}</span>
9 9
         </div>
10 10
       </div>
11 11
       <div>
12 12
         <div @click="record">领取记录</div>
13
-        <div @click="history">历史备注</div>
14 13
       </div>
15 14
     </div>
16
-    <div class="card-bottom">
17
-      <span>备注:老客户,人非常好。</span>
18
-      <span @click="remark">+ 添加备注</span>
19
-    </div>
20 15
   </div>
21 16
 </template>
22 17
 
@@ -36,15 +31,9 @@ export default {
36 31
     }
37 32
   },
38 33
   methods: {
39
-    remark () {
40
-      this.$emit('remark', this.data)
41
-    },
42 34
     record () {
43 35
       this.$emit('record', this.data)
44 36
     },
45
-    history () {
46
-      this.$emit('history', this.data)
47
-    }
48 37
   }
49 38
 }
50 39
 </script>

+ 4
- 4
src/components/myCard/myCard.vue Ver fichero

@@ -3,7 +3,7 @@
3 3
     <div class="card-top flex-h">
4 4
       <div>
5 5
         <img :src="logo" class="logo">
6
-        <span>¥ <span> {{data.Price}} </span> 元</span>
6
+        <span>¥ <span> {{data.price}} </span> 元</span>
7 7
         <img :src="line3" class="line3">
8 8
       </div>
9 9
       <div>
@@ -31,7 +31,7 @@
31 31
         <span>{{data.usedCount}}</span>
32 32
       </div>
33 33
     </div>
34
-    <div v-if='data.invalid' class="card-bottom" @click.stop="share">
34
+    <div class="card-bottom" @click.stop="share">
35 35
       分享卡券
36 36
     </div>
37 37
   </div>
@@ -58,7 +58,7 @@ export default {
58 58
   },
59 59
   methods: {
60 60
     share () {
61
-      if(this.data.invalid){
61
+      if(!this.data.invalid){
62 62
         this.$emit('share', this.data)
63 63
       }
64 64
     }
@@ -103,7 +103,7 @@ export default {
103 103
         align-items: baseline;
104 104
         span {
105 105
           color: #fc6243;
106
-          font-size: 0.26rem;
106
+          font-size: 0.22rem;
107 107
         }
108 108
       }
109 109
     }

+ 43
- 47
src/pages/sales/customerSearch/index.vue Ver fichero

@@ -1,11 +1,15 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3
+    <div class="top">
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.CustomerName : ''"></topCaseInfo>
5
+    </div>
3 6
     <div class="content flex-item">
4 7
       <div>
5 8
         <ul>
6 9
           <li class="customer-card">
7 10
             <div class="list-box">
8
-              <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @remark='remark' @record='record' @history='history'></customerCard>
11
+              <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @record='record'></customerCard>
12
+              <span class="noData" v-if="ajaxOff && !cardList.length">暂无数据</span>
9 13
             </div>
10 14
           </li>
11 15
         </ul>
@@ -13,24 +17,12 @@
13 17
     </div>
14 18
     <div v-if="mask" class="search-mask">
15 19
       <div class="mask-top">
16
-        <input type="text">
20
+        <input type="text" v-model="key">
17 21
         <i class="iconfont icon-sousuo search-icon"></i>
18 22
         <span @click="searchMask">搜索</span>
19 23
       </div>
20 24
       <div class="mask-bottom"></div>
21 25
     </div>
22
-    <van-dialog
23
-      v-model="showDialog"
24
-      show-cancel-button
25
-      title='添加备注'
26
-      :before-close="beforeClose">
27
-      <van-field
28
-        v-model="message"
29
-        type="textarea"
30
-        placeholder="请输入备注"
31
-        rows="3"
32
-        autosize/>
33
-    </van-dialog>
34 26
   </div>
35 27
 </template>
36 28
 
@@ -38,34 +30,31 @@
38 30
 import customerCard from '../../../components/customerCard/customerCard'
39 31
 import active from '../../../common/icon/check-box-checked.png'
40 32
 import normal from '../../../common/icon/check-box-empty.png'
33
+import topCaseInfo from '../../../components/topCaseInfo/index'
41 34
 import { mapState, createNamespacedHelpers } from 'vuex'
42 35
 const { mapActions: actions } = createNamespacedHelpers('app')
43 36
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
44 37
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
38
+const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
45 39
 
46 40
 export default {
47 41
   name: '',
48 42
   data () {
49 43
     return {
44
+      topCaseInfoData: {
45
+        CaseName: '',
46
+        CaseId: '',
47
+        ShowSelect: false,
48
+      },
50 49
       icon: {
51 50
         active: active,
52 51
         normal: normal
53 52
       },
54
-      showDialog: false,
53
+      ajaxOff: false,
54
+      key: '',
55 55
       mask: true,
56 56
       checked: true,
57
-      cardList: [
58
-        {
59
-          invalid: true
60
-        },
61
-        {
62
-          invalid: false
63
-        },
64
-        {
65
-          invalid: false
66
-        }
67
-      ],
68
-      message: ''
57
+      cardList: [],
69 58
     }
70 59
   },
71 60
   computed: {
@@ -79,10 +68,19 @@ export default {
79 68
     })
80 69
   },
81 70
   components: {
82
-    customerCard
71
+    customerCard,
72
+    topCaseInfo,
73
+  },
74
+  created () {
75
+    this.getCaseList().then((res) => {
76
+      this.topCaseInfoData.CaseName = res.cases[0].CaseName
77
+      this.topCaseInfoData.CaseId = res.cases[0].CaseId
78
+    })
83 79
   },
84
-  created () { },
85 80
   methods: {
81
+    ...mapUserCenterActions([
82
+      'getCustomerList',
83
+    ]),
86 84
     ...actions([
87 85
       'getCaseList',
88 86
     ]),
@@ -92,28 +90,26 @@ export default {
92 90
     ...mapCaseActions([
93 91
       'getCaseTotal',
94 92
     ]),
95
-    remark (item) {
96
-      console.log(item)
97
-      this.showDialog = true
98
-    },
99
-    history (item) {
100
-      console.log(item)
101
-      this.$router.push({ name: 'history' })
102
-    },
103 93
     record (item) {
104
-      console.log(item)
105
-      this.$router.push({ name: 'getRecord' })
94
+      // console.log(item)
95
+      this.$router.push({ name: 'getRecord', query: {name: item.Name, phone: item.Phone, id: item.CustomerId} })
106 96
     },
107 97
     searchMask () {
108
-      this.mask = false
98
+      this.getCustomerList({
99
+        page: 1,
100
+        pagesize: 10000,
101
+        isrecommend: false,
102
+        key: this.key,
103
+      }).then((res) => {
104
+        // console.log(JSON.stringify(res))
105
+        res = res || []
106
+        for (var n = 0; n < res.length; n++) {
107
+          this.cardList.push({...res[n], invalid: false})
108
+        }
109
+        this.mask = false
110
+        this.ajaxOff = true
111
+      })
109 112
     },
110
-    beforeClose (action, done) {
111
-      if (action === 'confirm') {
112
-        setTimeout(done, 1000)
113
-      } else {
114
-        done()
115
-      }
116
-    }
117 113
   }
118 114
 }
119 115
 </script>

+ 7
- 0
src/pages/sales/customerSearch/page.scss Ver fichero

@@ -106,4 +106,11 @@
106 106
       }
107 107
     }
108 108
   }
109
+  .noData{
110
+    width: 100%;
111
+    display: block;
112
+    text-align: center;
113
+    color: #666;
114
+    line-height: .4rem;
115
+  }
109 116
 }

+ 99
- 18
src/pages/sales/getRecord/index.vue Ver fichero

@@ -1,49 +1,130 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.CustomerName : ''" @selectCase="showSelect = true"></topCaseInfo>
5 5
     </div>
6 6
     <div class="info">
7
-      <span><em>姓名</em>:顶顶顶</span>
8
-      <span><em>手机号</em>:13888888888</span>
7
+      <span><em>姓名:</em>{{user.name}}</span>
8
+      <span><em>手机号:</em>{{user.phone}}</span>
9 9
     </div>
10
-    <div class="list-title">
11
-      <span>名称</span>
12
-      <span>领取时间</span>
13
-      <span>记录</span>
14
-    </div>
15
-    <div class="list-detail" v-for="(item,index) in list" :key="index">
16
-      <span>瑜伽体验卡lkjfklskd</span>
17
-      <span>06-27 12:20</span>
18
-      <span>已使用</span>
10
+    <div class="flex-item flex-v">
11
+      <ul class="flex-h">
12
+        <li class="flex-item" :class="{'active': activeIndex === 0}" @click="cutNav(0)">卡记录</li>
13
+        <li class="flex-item" :class="{'active': activeIndex === 1}" @click="cutNav(1)">券记录</li>
14
+      </ul>
15
+      <div class="flex-item flex-v">
16
+        <div class="list-title">
17
+          <span>名称</span>
18
+          <span>领取时间</span>
19
+          <span>记录</span>
20
+        </div>
21
+        <div class="flex-item">
22
+          <div class="scollBody">
23
+            <div v-if="activeIndex === 0">
24
+              <div class="list-detail" v-for="(item,index) in cardList" :key="index">
25
+                <span>{{item.CustomerCardName}}</span>
26
+                <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
27
+                <span>已使用</span>
28
+              </div>
29
+              <span class="noData" v-if="cardAjaxOff && !cardList.length">暂无数据</span>
30
+            </div>
31
+            <div v-if="activeIndex === 1">
32
+              <div class="list-detail" v-for="(item,index) in couponList" :key="index">
33
+                <span>{{item.CustomerCouponName}}</span>
34
+                <span>{{toolClass.dateFormat(item.ReceiveDate)}}</span>
35
+                <span>已使用</span>
36
+              </div>
37
+              <span class="noData" v-if="couponAjaxOff && !couponList.length">暂无数据</span>
38
+            </div>
39
+          </div>
40
+        </div>
41
+      </div>
19 42
     </div>
20 43
   </div>
21 44
 </template>
22 45
 
23 46
 <script>
24 47
 import topCaseInfo from '../../../components/topCaseInfo/index'
48
+import { mapState, createNamespacedHelpers } from 'vuex'
49
+const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
50
+const { mapActions: actions } = createNamespacedHelpers('app')
25 51
 
26 52
 export default {
27 53
   name: '',
28 54
   data () {
29 55
     return {
30
-      list: [1,1,1,1,1],
56
+      activeIndex: 0,
57
+      user: {
58
+        name: this.$route.query.name,
59
+        phone: this.$route.query.phone,
60
+        id: this.$route.query.id
61
+      },
62
+      cardAjaxOff: false,
63
+      couponAjaxOff: false,
64
+      cardList: [],
65
+      couponList: [],
31 66
       topCaseInfoData: {
32
-        caseName: '',
33
-        caseId: '',
67
+        CaseName: '',
68
+        CaseId: '',
34 69
         showSelect: false,
35
-        userName: 'xxx'
70
+        userName: ''
36 71
       },
37 72
     }
38 73
   },
74
+  computed: {
75
+    ...mapState({
76
+      userInfo: x => x.userCenter.userInfo,
77
+      CaseList: x => x.app.CaseList,
78
+    }),
79
+  },
39 80
   components: {
40 81
     topCaseInfo,
41 82
   },
42 83
   created () {
43
-
84
+    this.getCaseList().then((res) => {
85
+      this.topCaseInfoData.CaseName = res.cases[0].CaseName
86
+      this.topCaseInfoData.CaseId = res.cases[0].CaseId
87
+    })
88
+    this.getCustomerCardList({
89
+      id: this.user.id,
90
+      payload: {
91
+        page: 1,
92
+        pagesize: 10000,
93
+      }
94
+    }).then((res) => {
95
+      console.log(JSON.stringify(res))
96
+      res.list = res.list || []
97
+      for (var n = 0; n < res.list.length; n++) {
98
+        this.cardList.push(res.list[n])
99
+      }
100
+      this.cardAjaxOff = true
101
+    })
102
+    this.getCustomerCouponList({
103
+      id: this.user.id,
104
+      payload: {
105
+        page: 1,
106
+        pagesize: 10000,
107
+      }
108
+    }).then((res) => {
109
+      console.log(JSON.stringify(res))
110
+      res.list = res.list || []
111
+      for (var n = 0; n < res.list.length; n++) {
112
+        this.couponList.push(res.list[n])
113
+      }
114
+      this.couponAjaxOff = true
115
+    })
44 116
   },
45 117
   methods: {
46
-    
118
+    ...actions([
119
+      'getCaseList',
120
+    ]),
121
+    ...mapUserCenterActions([
122
+      'getCustomerCardList',
123
+      'getCustomerCouponList',
124
+    ]),
125
+    cutNav (index) {
126
+      this.activeIndex = index
127
+    },
47 128
   }
48 129
 }
49 130
 </script>

+ 45
- 1
src/pages/sales/getRecord/page.scss Ver fichero

@@ -41,4 +41,48 @@
41 41
       text-align: center;
42 42
     }
43 43
   }
44
-}
44
+  ul{
45
+    width: 100%;
46
+    border-top: .01rem solid #eee;
47
+    li{
48
+      text-align: center;
49
+      line-height: .46rem;
50
+      position: relative;
51
+      &.active::after{
52
+        content: '';
53
+        width: 50%;
54
+        height: .02rem;
55
+        background: #fc6243;
56
+        position: absolute;
57
+        left: 50%;
58
+        bottom: 0;
59
+        transform: translateX(-50%);
60
+        -webkit-transform: translateX(-50%);
61
+      }
62
+    }
63
+  }
64
+  .scollBody{
65
+    width: 100%;
66
+    position: absolute;
67
+    left: 0;
68
+    top: 0;
69
+    bottom: 0;
70
+    overflow: hidden;
71
+    >div{
72
+      width: 100%;
73
+      height: 100%;
74
+      position: relative;
75
+      overflow-y: scroll;
76
+      -webkit-overflow-scrolling: touch;
77
+      transform: translateZ(0);
78
+      -webkit-transform: translateZ(0);
79
+      .noData{
80
+        width: 100%;
81
+        display: block;
82
+        text-align: center;
83
+        color: #666;
84
+        line-height: .4rem;
85
+      }
86
+    }
87
+  }
88
+} 

+ 2
- 2
src/pages/user/App.vue Ver fichero

@@ -12,7 +12,7 @@ export default {
12 12
   name: 'app',
13 13
   data () {
14 14
     return {
15
-      showPage: true
15
+      showPage: false
16 16
     }
17 17
   },
18 18
   components: {},
@@ -23,7 +23,7 @@ export default {
23 23
     })
24 24
   },
25 25
   created () {
26
-    console.log('creatde')
26
+    // console.log('creatde')
27 27
     if (location.search && this.toolClass.UrlSearch(location.search).code) {
28 28
       this.code = this.toolClass.UrlSearch(location.search).code
29 29
     } else {

+ 101
- 58
src/pages/user/mainPage/coffeeIndex/index.vue Ver fichero

@@ -51,8 +51,7 @@
51 51
                   <div class="flex-item">
52 52
                     <div>
53 53
                       <span>卡券货值总额:</span>
54
-                      <span>¥1000</span>
55
-                      <span>万</span>
54
+                      <span>¥{{cardTotalCount}}</span>
56 55
                     </div>
57 56
                   </div>
58 57
                   <a @click="toSalesHistory">销售记录</a>
@@ -66,8 +65,7 @@
66 65
                   <div class="flex-item">
67 66
                     <div>
68 67
                       <span>卡券货值总额:</span>
69
-                      <span>¥1000</span>
70
-                      <span>万</span>
68
+                      <span>¥{{couponTotalCount}}</span>
71 69
                     </div>
72 70
                   </div>
73 71
                   <a @click="toSalesHistory">销售记录</a>
@@ -78,19 +76,19 @@
78 76
             <li :hidden="navActive !== 3" class="customer-card">
79 77
               <div class="list-box">
80 78
                 <div class="search-bar flex-h">
81
-                  <span>共15位客户</span>
82
-                  <van-checkbox v-model="checked">
83
-                    我推荐的客户(8人)
79
+                  <span>共{{this.data[3].list.length}}位客户</span>
80
+                  <van-checkbox v-model="postCustomerData.isrecommend">
81
+                    我推荐的客户({{myRecommendUserList.length}}人)
84 82
                     <img
85 83
                       slot="icon"
86 84
                       slot-scope="props"
87
-                      :src="props.checked ? icon.active : icon.normal"
85
+                      :src="postCustomerData.isrecommend ? icon.active : icon.normal"
88 86
                       style="width:.2rem;height:.2rem;bottom: .02rem;position: relative;"
89 87
                     >
90 88
                   </van-checkbox>
91 89
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
92 90
                 </div>
93
-                <customerCard v-for="(item,index) in data[3].list" :key="index" :data='item' @remark='remark' @history='history' @record='record'></customerCard>
91
+                <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record'></customerCard>
94 92
               </div>
95 93
             </li>
96 94
           <!-- </ul>
@@ -133,7 +131,6 @@ import { mapState, createNamespacedHelpers } from 'vuex'
133 131
 const { mapActions: actions } = createNamespacedHelpers('app')
134 132
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
135 133
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
136
-const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('myCustomer')
137 134
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
138 135
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
139 136
 
@@ -141,9 +138,22 @@ export default {
141 138
   name: '',
142 139
   data () {
143 140
     return {
141
+      myRecommendUserList: [],
142
+      forbidList: [],
143
+      postCustomerData: {
144
+        page: 1,
145
+        pagesize: 10000,
146
+        isrecommend: false,
147
+      },
148
+      couponTotalCount: 0,
149
+      cardTotalCount: 0,
150
+      postCouponData: {
151
+        page: 1,
152
+        pageSize: 10000
153
+      },
144 154
       postCardData: {
145 155
         page: 1,
146
-        pageSize: 10
156
+        pageSize: 10000
147 157
       },
148 158
       pullUpLoad: true,
149 159
       pullUpLoadThreshold: 40,
@@ -156,7 +166,6 @@ export default {
156 166
       active,
157 167
       normal,
158 168
       navActive: 0,
159
-      checked: true,
160 169
       showDialog: false,
161 170
       message: '',
162 171
       cutNavList: [{
@@ -241,9 +250,6 @@ export default {
241 250
     ...mapCaseState({
242 251
       caseTotal: x => x.caseTotal,
243 252
     }),
244
-    ...mapCustomerState({
245
-      customerList: x => x.customerList
246
-    }),
247 253
     ...mapCardState({
248 254
       cardList: x => x.cardList
249 255
     })
@@ -256,30 +262,68 @@ export default {
256 262
     scroll
257 263
   },
258 264
   created () {
259
-    this.getMyCardList({
260
-      ...this.postCardData
261
-    }).then((res) => {
262
-      console.log(JSON.stringify(res))
263
-      for (var n = 0; n < res.list.length; n++) {
264
-        this.data[1].list.push({
265
-          invalid: '',
266
-          price: res.list[n].Price,
267
-          title: res.list[n].CardName,
268
-          desc: 'xxx',
269
-          startDate: this.toolClass.dateFormat(res.list[n].StartDate),
270
-          endDate: this.toolClass.dateFormat(res.list[n].EndDate),
271
-          totalCount: res.list[n].TotalCount,
272
-          SentCount: res.list[n].SentCount,
273
-          usedCount: res.list[n].UsedCount,
274
-          // title: res.list[n].CardName,
275
-          // desc: '描述',
276
-          // time: this.toolClass.dateFormat(res.list[n].EndDate),
277
-          // useType: '未使用',
278
-          // tag: '共享'
265
+    if (this.userInfo.customer.MapUser !== '') {
266
+      this.getForbidInfo().then((res) => {
267
+        this.forbidList = res || []
268
+        this.getCustomerList({
269
+          ...this.postCustomerData
270
+        }).then((res) => {
271
+          // console.log(JSON.stringify(res))
272
+          for (var n = 0; n < res.length; n++) {
273
+            if (res[n].RecommendId === this.userInfo.customer.MapUser) {
274
+              this.myRecommendUserList.push(res[n])
275
+            }
276
+            this.data[3].list.push(res[n])
277
+          }
279 278
         })
280
-      }
281
-      console.log(JSON.stringify(this.data[1].list))
282
-    })
279
+        this.getMyCouponList({
280
+          ...this.postCouponData
281
+        }).then((res) => {
282
+          res.list = res.list || []
283
+          for (var n = 0; n < res.list.length; n++) {
284
+            this.data[2].list.push({
285
+              invalid: this.returnInvalid(res.list[n], 'coupon'),
286
+              price: res.list[n].Price,
287
+              title: res.list[n].CouponName,
288
+              desc: res.list[n].Share.UseRule,
289
+              startDate: this.toolClass.dateFormat(res.list[n].StartDate),
290
+              endDate: this.toolClass.dateFormat(res.list[n].EndDate),
291
+              totalCount: res.list[n].TotalCount,
292
+              SentCount: res.list[n].SentCount,
293
+              usedCount: res.list[n].UsedCount,
294
+            })
295
+          }
296
+          var count = 0
297
+          for (var n = 0; n < this.data[2].list.length; n++) {
298
+            count += this.data[2].list[n].price * this.data[2].list[n].totalCount - 0
299
+          }
300
+          this.couponTotalCount = count.toFixed(2)
301
+        })
302
+        this.getMyCardList({
303
+          ...this.postCardData
304
+        }).then((res) => {
305
+          res.list = res.list || []
306
+          for (var n = 0; n < res.list.length; n++) {
307
+            this.data[1].list.push({
308
+              invalid: this.returnInvalid(res.list[n], 'card'),
309
+              price: res.list[n].Price,
310
+              title: res.list[n].CardName,
311
+              desc: res.list[n].Share.CardUseRule,
312
+              startDate: this.toolClass.dateFormat(res.list[n].StartDate),
313
+              endDate: this.toolClass.dateFormat(res.list[n].EndDate),
314
+              totalCount: res.list[n].TotalCount,
315
+              SentCount: res.list[n].SentCount,
316
+              usedCount: res.list[n].UsedCount,
317
+            })
318
+          }
319
+          var count = 0
320
+          for (var n = 0; n < this.data[1].list.length; n++) {
321
+            count += this.data[1].list[n].price * this.data[1].list[n].totalCount - 0
322
+          }
323
+          this.cardTotalCount = count.toFixed(2)
324
+        })
325
+      })
326
+    }
283 327
     this.getCaseList().then((res) => {
284 328
       this.topCaseInfoData.CaseName = res.cases[0].CaseName
285 329
       this.topCaseInfoData.CaseId = res.cases[0].CaseId
@@ -289,14 +333,14 @@ export default {
289 333
       this.getCaseTotal({
290 334
         caseid: this.topCaseInfoData.CaseId
291 335
       })
292
-      this.getCustomerList().then(() => {
293
-
294
-      })
295 336
     })
296 337
   },
297 338
   methods: {
298 339
     ...mapUserCenterActions([
299 340
       'getMyCardList',
341
+      'getMyCouponList',
342
+      'getForbidInfo',
343
+      'getCustomerList',
300 344
     ]),
301 345
     ...actions([
302 346
       'getCaseList',
@@ -307,10 +351,19 @@ export default {
307 351
     ...mapCaseActions([
308 352
       'getCaseTotal',
309 353
     ]),
310
-    ...mapCustomerActions(['getCustomerList']),
311 354
     ...mapCardActions(['getCardList']),
355
+    returnInvalid (item, type) {
356
+      for (var n = 0; n < this.forbidList.length; n++) {
357
+        if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
358
+          return true
359
+        }
360
+      }
361
+      if (item.TotalCount - 0 === item.SentCount - 0 + item.UsedCount - 0 || new Date(item.EndDate).getTime() < Date.now()) {
362
+        return true
363
+      }
364
+      return false
365
+    },
312 366
     toSalesHistory () {
313
-      console.log(this.getUrl('salesRecord'))
314 367
       window.location.href = this.getUrl('salesRecord')
315 368
     },
316 369
     getUrl (val) {
@@ -340,33 +393,23 @@ export default {
340 393
           this.data[this.navActive].page = 0
341 394
         }
342 395
         if (this.data[this.navActive].hasMore) {
343
-          // this.getgymCardList({ page: this.data[this.active].page, pageSize: this.data[this.active].pageSize }).then((res) => {
344
-          //   this.data[this.active].list = this.data[this.active].list.concat(this.gymCardList)
345
-          //   this.data[this.active].page++
346
-          //   if (this.gymCardList.length < this.data[this.active].pageSize) {
347
-          //     this.data[this.active].hasMore = false
348
-          //   }
349
-          //   if (this.data[this.active].list.length <= 0) {
350
-          //     this.data[this.active].hasPic = true
351
-          //   }
352
-          // })
353 396
         }
354 397
       }
355 398
     },
356 399
     share (item) {
357
-      console.log(item)
400
+      // console.log(item)
358 401
     },
359 402
     remark (item) {
360
-      console.log(item)
403
+      // console.log(item)
361 404
       this.showDialog = true
362 405
     },
363 406
     history (item) {
364
-      console.log(item)
407
+      // console.log(item)
365 408
       window.location.href = this.getUrl('history')
366 409
     },
367 410
     record (item) {
368
-      console.log(item)
369
-      window.location.href = this.getUrl('getRecord')
411
+      // console.log(item)
412
+      window.location.href = this.getUrl('getRecord') + '?name=' + item.Name + '&phone=' + item.Phone + '&id=' + item.CustomerId
370 413
     },
371 414
     searchMask () {
372 415
       window.location.href = this.getUrl('customerSearch')

+ 62
- 3
src/store/userCenter/userCenter.js Ver fichero

@@ -17,7 +17,7 @@ http.getUserInfo = (data) => { // 获取用户信息
17 17
       method: api.user.info.method,
18 18
       queryData: queryData
19 19
     }).then(res => {
20
-      console.log(res)
20
+      // console.log(res)
21 21
       resolve(res)
22 22
     }).catch((err) => {
23 23
       reject(err)
@@ -41,7 +41,7 @@ http.getCaseInfo = (data) => { // 获取案场列表
41 41
 }
42 42
 
43 43
 http.getCaptcha = (data) => { // 获取验证码
44
-  console.log(data)
44
+  // console.log(data)
45 45
   return new Promise((resolve, reject) => {
46 46
     Ajax(api.user.captcha.url, {
47 47
       method: api.user.captcha.method,
@@ -57,7 +57,7 @@ http.getCaptcha = (data) => { // 获取验证码
57 57
 }
58 58
 
59 59
 http.submitData = (data) => { // 绑定手机号
60
-  console.log(data)
60
+  // console.log(data)
61 61
   return new Promise((resolve, reject) => {
62 62
     Ajax(api.user.wxsignup.url, {
63 63
       method: api.user.wxsignup.method,
@@ -101,6 +101,65 @@ export default {
101 101
     }
102 102
   },
103 103
   actions: {
104
+    getCustomerCardList (context, { id, payload }) { // 获取我的用户领取卡信息
105
+      return new Promise((resolve) => {
106
+        Ajax(api.sales.getCustomerCardList.url, {
107
+          method: api.sales.getCustomerCardList.method,
108
+          queryData: {
109
+            ...payload
110
+          },
111
+          urlData: {
112
+            id,
113
+          },
114
+        }).then(res => {
115
+          resolve(res)
116
+        })
117
+      })
118
+    },
119
+    getCustomerCouponList (context, { id, payload }) { // 获取我的用户领取券信息
120
+      return new Promise((resolve) => {
121
+        Ajax(api.sales.getCustomerCouponList.url, {
122
+          method: api.sales.getCustomerCouponList.method,
123
+          queryData: {
124
+            ...payload
125
+          },
126
+          urlData: {
127
+            id,
128
+          },
129
+        }).then(res => {
130
+          resolve(res)
131
+        })
132
+      })
133
+    },
134
+    getCustomerList (context, payload) { // 获取我的客户列表
135
+      return new Promise((resolve) => {
136
+        Ajax(api.sales.getCustomerList.url, {
137
+          method: api.sales.getCustomerList.method,
138
+          queryData: { ...payload }
139
+        }).then(res => {
140
+          resolve(res)
141
+        })
142
+      })
143
+    },
144
+    getForbidInfo (context) { // 获取用户禁用信息
145
+      return new Promise((resolve) => {
146
+        Ajax(api.sales.getForbidInfo.url, {
147
+          method: api.sales.getForbidInfo.method,
148
+        }).then(res => {
149
+          resolve(res)
150
+        })
151
+      })
152
+    },
153
+    getMyCouponList (context, payload) { // 获取我的券列表
154
+      return new Promise((resolve) => {
155
+        Ajax(api.sales.getCouponList.url, {
156
+          method: api.sales.getCouponList.method,
157
+          queryData: { ...payload }
158
+        }).then(res => {
159
+          resolve(res)
160
+        })
161
+      })
162
+    },
104 163
     getMyCardList (context, payload) { // 获取我的卡列表
105 164
       return new Promise((resolve) => {
106 165
         Ajax(api.sales.getCardList.url, {

+ 3
- 3
src/util/ajax.js Ver fichero

@@ -67,16 +67,16 @@ const ajax = (...args) => {
67 67
       if (code === 200) {
68 68
         resolve(result)
69 69
       } else if (code === 401) {
70
-        console.log(result)
70
+        // console.log(result)
71 71
         // reject(code)
72 72
         toolClass.getCode(result.appid)
73 73
       } else if (code === 406) {
74
-        console.log(router.history.current.name)
74
+        // console.log(router.history.current.name)
75 75
         if (router.history.current.name !== 'bindMobile') {
76 76
           router.push({ name: 'bindMobile' })
77 77
         }
78 78
       } else {
79
-        console.log(message)
79
+        // console.log(message)
80 80
         Toast.fail({
81 81
           duration: 2000, // 持续展示 toast
82 82
           forbidClick: true, // 禁用背景点击

+ 16
- 8
src/util/api.js Ver fichero

@@ -148,14 +148,6 @@ const $api = {
148 148
       method: 'get',
149 149
       url: `${baseUrl}${wechat}/user/detail/:id`
150 150
     },
151
-    getCardNum: { // 获取卡数量
152
-      method: 'get',
153
-      url: `${baseUrl}${wechat}/card/detail/:id`
154
-    },
155
-    getCouponNum: { // 获取券数量
156
-      method: 'get',
157
-      url: `${baseUrl}${wechat}/coupon/detail/:id`
158
-    }
159 151
   },
160 152
   sales: {
161 153
     getCardList: { // 获取我的卡列表
@@ -166,6 +158,22 @@ const $api = {
166 158
       method: 'get',
167 159
       url: `${baseUrl}${wechat}/coupon`
168 160
     },
161
+    getForbidInfo: { // 获取用户禁用信息
162
+      method: 'get',
163
+      url: `${baseUrl}${wechat}/user/forbid`
164
+    },
165
+    getCustomerList: { // 获取客户列表
166
+      method: 'get',
167
+      url: `${baseUrl}${wechat}/customer/user`
168
+    },
169
+    getCustomerCardList: { // 获取我的用户领取卡信息
170
+      method: 'get',
171
+      url: `${baseUrl}${wechat}/customer/sales/card/:id`
172
+    },
173
+    getCustomerCouponList: { // 获取我的用户领取券信息
174
+      method: 'get',
175
+      url: `${baseUrl}${wechat}/customer/sales/coupon/:id`
176
+    },
169 177
   },
170 178
   login: { // 主管、销售端登陆
171 179
     login: {