浏览代码

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

yuantianjiao 6 年前
父节点
当前提交
015e672aa0

+ 6
- 0
package-lock.json 查看文件

13386
       "integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk=",
13386
       "integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk=",
13387
       "dev": true
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
     "which": {
13395
     "which": {
13390
       "version": "1.3.1",
13396
       "version": "1.3.1",
13391
       "resolved": "http://registry.npm.taobao.org/which/download/which-1.3.1.tgz",
13397
       "resolved": "http://registry.npm.taobao.org/which/download/which-1.3.1.tgz",

+ 3
- 14
src/components/customerCard/customerCard.vue 查看文件

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

+ 4
- 4
src/components/myCard/myCard.vue 查看文件

3
     <div class="card-top flex-h">
3
     <div class="card-top flex-h">
4
       <div>
4
       <div>
5
         <img :src="logo" class="logo">
5
         <img :src="logo" class="logo">
6
-        <span>¥ <span> {{data.Price}} </span> 元</span>
6
+        <span>¥ <span> {{data.price}} </span> 元</span>
7
         <img :src="line3" class="line3">
7
         <img :src="line3" class="line3">
8
       </div>
8
       </div>
9
       <div>
9
       <div>
31
         <span>{{data.usedCount}}</span>
31
         <span>{{data.usedCount}}</span>
32
       </div>
32
       </div>
33
     </div>
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
     </div>
36
     </div>
37
   </div>
37
   </div>
58
   },
58
   },
59
   methods: {
59
   methods: {
60
     share () {
60
     share () {
61
-      if(this.data.invalid){
61
+      if(!this.data.invalid){
62
         this.$emit('share', this.data)
62
         this.$emit('share', this.data)
63
       }
63
       }
64
     }
64
     }
103
         align-items: baseline;
103
         align-items: baseline;
104
         span {
104
         span {
105
           color: #fc6243;
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 查看文件

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
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
     <div class="content flex-item">
6
     <div class="content flex-item">
4
       <div>
7
       <div>
5
         <ul>
8
         <ul>
6
           <li class="customer-card">
9
           <li class="customer-card">
7
             <div class="list-box">
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
             </div>
13
             </div>
10
           </li>
14
           </li>
11
         </ul>
15
         </ul>
13
     </div>
17
     </div>
14
     <div v-if="mask" class="search-mask">
18
     <div v-if="mask" class="search-mask">
15
       <div class="mask-top">
19
       <div class="mask-top">
16
-        <input type="text">
20
+        <input type="text" v-model="key">
17
         <i class="iconfont icon-sousuo search-icon"></i>
21
         <i class="iconfont icon-sousuo search-icon"></i>
18
         <span @click="searchMask">搜索</span>
22
         <span @click="searchMask">搜索</span>
19
       </div>
23
       </div>
20
       <div class="mask-bottom"></div>
24
       <div class="mask-bottom"></div>
21
     </div>
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
   </div>
26
   </div>
35
 </template>
27
 </template>
36
 
28
 
38
 import customerCard from '../../../components/customerCard/customerCard'
30
 import customerCard from '../../../components/customerCard/customerCard'
39
 import active from '../../../common/icon/check-box-checked.png'
31
 import active from '../../../common/icon/check-box-checked.png'
40
 import normal from '../../../common/icon/check-box-empty.png'
32
 import normal from '../../../common/icon/check-box-empty.png'
33
+import topCaseInfo from '../../../components/topCaseInfo/index'
41
 import { mapState, createNamespacedHelpers } from 'vuex'
34
 import { mapState, createNamespacedHelpers } from 'vuex'
42
 const { mapActions: actions } = createNamespacedHelpers('app')
35
 const { mapActions: actions } = createNamespacedHelpers('app')
43
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
36
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
44
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
37
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
38
+const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
45
 
39
 
46
 export default {
40
 export default {
47
   name: '',
41
   name: '',
48
   data () {
42
   data () {
49
     return {
43
     return {
44
+      topCaseInfoData: {
45
+        CaseName: '',
46
+        CaseId: '',
47
+        ShowSelect: false,
48
+      },
50
       icon: {
49
       icon: {
51
         active: active,
50
         active: active,
52
         normal: normal
51
         normal: normal
53
       },
52
       },
54
-      showDialog: false,
53
+      ajaxOff: false,
54
+      key: '',
55
       mask: true,
55
       mask: true,
56
       checked: true,
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
   computed: {
60
   computed: {
79
     })
68
     })
80
   },
69
   },
81
   components: {
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
   methods: {
80
   methods: {
81
+    ...mapUserCenterActions([
82
+      'getCustomerList',
83
+    ]),
86
     ...actions([
84
     ...actions([
87
       'getCaseList',
85
       'getCaseList',
88
     ]),
86
     ]),
92
     ...mapCaseActions([
90
     ...mapCaseActions([
93
       'getCaseTotal',
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
     record (item) {
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
     searchMask () {
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
 </script>
115
 </script>

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

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 查看文件

1
 <template>
1
 <template>
2
   <div class="mainPage flex-v">
2
   <div class="mainPage flex-v">
3
     <div class="top">
3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.CustomerName : ''" @selectCase="showSelect = true"></topCaseInfo>
5
     </div>
5
     </div>
6
     <div class="info">
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
     </div>
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
     </div>
42
     </div>
20
   </div>
43
   </div>
21
 </template>
44
 </template>
22
 
45
 
23
 <script>
46
 <script>
24
 import topCaseInfo from '../../../components/topCaseInfo/index'
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
 export default {
52
 export default {
27
   name: '',
53
   name: '',
28
   data () {
54
   data () {
29
     return {
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
       topCaseInfoData: {
66
       topCaseInfoData: {
32
-        caseName: '',
33
-        caseId: '',
67
+        CaseName: '',
68
+        CaseId: '',
34
         showSelect: false,
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
   components: {
80
   components: {
40
     topCaseInfo,
81
     topCaseInfo,
41
   },
82
   },
42
   created () {
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
   methods: {
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
 </script>
130
 </script>

+ 45
- 1
src/pages/sales/getRecord/page.scss 查看文件

41
       text-align: center;
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 查看文件

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

+ 101
- 58
src/pages/user/mainPage/coffeeIndex/index.vue 查看文件

51
                   <div class="flex-item">
51
                   <div class="flex-item">
52
                     <div>
52
                     <div>
53
                       <span>卡券货值总额:</span>
53
                       <span>卡券货值总额:</span>
54
-                      <span>¥1000</span>
55
-                      <span>万</span>
54
+                      <span>¥{{cardTotalCount}}</span>
56
                     </div>
55
                     </div>
57
                   </div>
56
                   </div>
58
                   <a @click="toSalesHistory">销售记录</a>
57
                   <a @click="toSalesHistory">销售记录</a>
66
                   <div class="flex-item">
65
                   <div class="flex-item">
67
                     <div>
66
                     <div>
68
                       <span>卡券货值总额:</span>
67
                       <span>卡券货值总额:</span>
69
-                      <span>¥1000</span>
70
-                      <span>万</span>
68
+                      <span>¥{{couponTotalCount}}</span>
71
                     </div>
69
                     </div>
72
                   </div>
70
                   </div>
73
                   <a @click="toSalesHistory">销售记录</a>
71
                   <a @click="toSalesHistory">销售记录</a>
78
             <li :hidden="navActive !== 3" class="customer-card">
76
             <li :hidden="navActive !== 3" class="customer-card">
79
               <div class="list-box">
77
               <div class="list-box">
80
                 <div class="search-bar flex-h">
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
                     <img
82
                     <img
85
                       slot="icon"
83
                       slot="icon"
86
                       slot-scope="props"
84
                       slot-scope="props"
87
-                      :src="props.checked ? icon.active : icon.normal"
85
+                      :src="postCustomerData.isrecommend ? icon.active : icon.normal"
88
                       style="width:.2rem;height:.2rem;bottom: .02rem;position: relative;"
86
                       style="width:.2rem;height:.2rem;bottom: .02rem;position: relative;"
89
                     >
87
                     >
90
                   </van-checkbox>
88
                   </van-checkbox>
91
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
89
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
92
                 </div>
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
               </div>
92
               </div>
95
             </li>
93
             </li>
96
           <!-- </ul>
94
           <!-- </ul>
133
 const { mapActions: actions } = createNamespacedHelpers('app')
131
 const { mapActions: actions } = createNamespacedHelpers('app')
134
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
132
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
135
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
133
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
136
-const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('myCustomer')
137
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
134
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
138
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
135
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
139
 
136
 
141
   name: '',
138
   name: '',
142
   data () {
139
   data () {
143
     return {
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
       postCardData: {
154
       postCardData: {
145
         page: 1,
155
         page: 1,
146
-        pageSize: 10
156
+        pageSize: 10000
147
       },
157
       },
148
       pullUpLoad: true,
158
       pullUpLoad: true,
149
       pullUpLoadThreshold: 40,
159
       pullUpLoadThreshold: 40,
156
       active,
166
       active,
157
       normal,
167
       normal,
158
       navActive: 0,
168
       navActive: 0,
159
-      checked: true,
160
       showDialog: false,
169
       showDialog: false,
161
       message: '',
170
       message: '',
162
       cutNavList: [{
171
       cutNavList: [{
241
     ...mapCaseState({
250
     ...mapCaseState({
242
       caseTotal: x => x.caseTotal,
251
       caseTotal: x => x.caseTotal,
243
     }),
252
     }),
244
-    ...mapCustomerState({
245
-      customerList: x => x.customerList
246
-    }),
247
     ...mapCardState({
253
     ...mapCardState({
248
       cardList: x => x.cardList
254
       cardList: x => x.cardList
249
     })
255
     })
256
     scroll
262
     scroll
257
   },
263
   },
258
   created () {
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
     this.getCaseList().then((res) => {
327
     this.getCaseList().then((res) => {
284
       this.topCaseInfoData.CaseName = res.cases[0].CaseName
328
       this.topCaseInfoData.CaseName = res.cases[0].CaseName
285
       this.topCaseInfoData.CaseId = res.cases[0].CaseId
329
       this.topCaseInfoData.CaseId = res.cases[0].CaseId
289
       this.getCaseTotal({
333
       this.getCaseTotal({
290
         caseid: this.topCaseInfoData.CaseId
334
         caseid: this.topCaseInfoData.CaseId
291
       })
335
       })
292
-      this.getCustomerList().then(() => {
293
-
294
-      })
295
     })
336
     })
296
   },
337
   },
297
   methods: {
338
   methods: {
298
     ...mapUserCenterActions([
339
     ...mapUserCenterActions([
299
       'getMyCardList',
340
       'getMyCardList',
341
+      'getMyCouponList',
342
+      'getForbidInfo',
343
+      'getCustomerList',
300
     ]),
344
     ]),
301
     ...actions([
345
     ...actions([
302
       'getCaseList',
346
       'getCaseList',
307
     ...mapCaseActions([
351
     ...mapCaseActions([
308
       'getCaseTotal',
352
       'getCaseTotal',
309
     ]),
353
     ]),
310
-    ...mapCustomerActions(['getCustomerList']),
311
     ...mapCardActions(['getCardList']),
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
     toSalesHistory () {
366
     toSalesHistory () {
313
-      console.log(this.getUrl('salesRecord'))
314
       window.location.href = this.getUrl('salesRecord')
367
       window.location.href = this.getUrl('salesRecord')
315
     },
368
     },
316
     getUrl (val) {
369
     getUrl (val) {
340
           this.data[this.navActive].page = 0
393
           this.data[this.navActive].page = 0
341
         }
394
         }
342
         if (this.data[this.navActive].hasMore) {
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
     share (item) {
399
     share (item) {
357
-      console.log(item)
400
+      // console.log(item)
358
     },
401
     },
359
     remark (item) {
402
     remark (item) {
360
-      console.log(item)
403
+      // console.log(item)
361
       this.showDialog = true
404
       this.showDialog = true
362
     },
405
     },
363
     history (item) {
406
     history (item) {
364
-      console.log(item)
407
+      // console.log(item)
365
       window.location.href = this.getUrl('history')
408
       window.location.href = this.getUrl('history')
366
     },
409
     },
367
     record (item) {
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
     searchMask () {
414
     searchMask () {
372
       window.location.href = this.getUrl('customerSearch')
415
       window.location.href = this.getUrl('customerSearch')

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

17
       method: api.user.info.method,
17
       method: api.user.info.method,
18
       queryData: queryData
18
       queryData: queryData
19
     }).then(res => {
19
     }).then(res => {
20
-      console.log(res)
20
+      // console.log(res)
21
       resolve(res)
21
       resolve(res)
22
     }).catch((err) => {
22
     }).catch((err) => {
23
       reject(err)
23
       reject(err)
41
 }
41
 }
42
 
42
 
43
 http.getCaptcha = (data) => { // 获取验证码
43
 http.getCaptcha = (data) => { // 获取验证码
44
-  console.log(data)
44
+  // console.log(data)
45
   return new Promise((resolve, reject) => {
45
   return new Promise((resolve, reject) => {
46
     Ajax(api.user.captcha.url, {
46
     Ajax(api.user.captcha.url, {
47
       method: api.user.captcha.method,
47
       method: api.user.captcha.method,
57
 }
57
 }
58
 
58
 
59
 http.submitData = (data) => { // 绑定手机号
59
 http.submitData = (data) => { // 绑定手机号
60
-  console.log(data)
60
+  // console.log(data)
61
   return new Promise((resolve, reject) => {
61
   return new Promise((resolve, reject) => {
62
     Ajax(api.user.wxsignup.url, {
62
     Ajax(api.user.wxsignup.url, {
63
       method: api.user.wxsignup.method,
63
       method: api.user.wxsignup.method,
101
     }
101
     }
102
   },
102
   },
103
   actions: {
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
     getMyCardList (context, payload) { // 获取我的卡列表
163
     getMyCardList (context, payload) { // 获取我的卡列表
105
       return new Promise((resolve) => {
164
       return new Promise((resolve) => {
106
         Ajax(api.sales.getCardList.url, {
165
         Ajax(api.sales.getCardList.url, {

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

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

+ 16
- 8
src/util/api.js 查看文件

148
       method: 'get',
148
       method: 'get',
149
       url: `${baseUrl}${wechat}/user/detail/:id`
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
   sales: {
152
   sales: {
161
     getCardList: { // 获取我的卡列表
153
     getCardList: { // 获取我的卡列表
166
       method: 'get',
158
       method: 'get',
167
       url: `${baseUrl}${wechat}/coupon`
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
   login: { // 主管、销售端登陆
178
   login: { // 主管、销售端登陆
171
     login: {
179
     login: {