yuantianjiao 6 år sedan
förälder
incheckning
7fcbef2c1d

+ 2
- 2
src/components/topCaseInfo/index.vue Visa fil

13
 
13
 
14
 export default {
14
 export default {
15
   name: '',
15
   name: '',
16
-  props: ['data','userName'],
16
+  props: ['data', 'userName'],
17
   data () {
17
   data () {
18
     return {
18
     return {
19
 
19
 
38
 
38
 
39
 <!-- Add "scoped" attribute to limit CSS to this component only -->
39
 <!-- Add "scoped" attribute to limit CSS to this component only -->
40
 <style lang="scss" scoped>
40
 <style lang="scss" scoped>
41
-@import "page.scss";
41
+@import 'page.scss';
42
 </style>
42
 </style>

+ 30
- 14
src/pages/user/mainPage/coffeeIndex/index.vue Visa fil

6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
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 !== '4'" :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
     </nav>
8
     </nav>
9
-    <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='data[navActive].list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
10
       <div class="content">
9
       <div class="content">
11
-        <!-- <div>
12
-          <ul> -->
10
+        <div>
11
+          <ul>
13
             <li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
12
             <li :hidden="navActive !== 0 && userInfo.customer.MapUser !== ''" class="placeOrder">
14
               <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== ''">
13
               <div class="topInfo flex-h" v-if="userInfo.customer.MapUser !== ''">
15
                 <div class="flex-item">
14
                 <div class="flex-item">
56
                   </div>
55
                   </div>
57
                   <a @click="toSalesHistory">销售记录</a>
56
                   <a @click="toSalesHistory">销售记录</a>
58
                 </div>
57
                 </div>
59
-                <myCard v-for="(item,index) in data[1].list" :key="index" :data='item' @share='share'></myCard>
58
+                <myCard v-for="(item,index) in data[1].list" :key="index" :data='item' @share='shareCard'></myCard>
60
               </div>
59
               </div>
61
             </li>
60
             </li>
62
             <li :hidden="navActive !== 2" class="my-card">
61
             <li :hidden="navActive !== 2" class="my-card">
70
                   </div>
69
                   </div>
71
                   <a @click="toSalesHistory">销售记录</a>
70
                   <a @click="toSalesHistory">销售记录</a>
72
                 </div>
71
                 </div>
73
-                <myCard v-for="(item,index) in data[2].list" :key="index" :data='item' @share='share'></myCard>
72
+                <myCard v-for="(item,index) in data[2].list" :key="index" :data='item' @share='shareCoupon'></myCard>
74
               </div>
73
               </div>
75
             </li>
74
             </li>
76
             <li :hidden="navActive !== 3" class="customer-card">
75
             <li :hidden="navActive !== 3" class="customer-card">
91
                 <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record'></customerCard>
90
                 <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record'></customerCard>
92
               </div>
91
               </div>
93
             </li>
92
             </li>
94
-          <!-- </ul>
95
-        </div> -->
93
+          </ul>
94
+        </div>
96
       </div>
95
       </div>
97
-    </scroll>
98
     <div class="selectCase" :hidden="!showSelect"></div>
96
     <div class="selectCase" :hidden="!showSelect"></div>
99
     <van-picker :hidden="!showSelect"
97
     <van-picker :hidden="!showSelect"
100
       show-toolbar
98
       show-toolbar
120
 </template>
118
 </template>
121
 
119
 
122
 <script>
120
 <script>
123
-import scroll from '../../../../components/scroll/scroll'
124
 import caseTableItem from '../../../../components/caseTableItem/index'
121
 import caseTableItem from '../../../../components/caseTableItem/index'
125
 import topCaseInfo from '../../../../components/topCaseInfo/index'
122
 import topCaseInfo from '../../../../components/topCaseInfo/index'
126
 import myCard from '../../../../components/myCard/myCard'
123
 import myCard from '../../../../components/myCard/myCard'
184
       topCaseInfoData: {
181
       topCaseInfoData: {
185
         CaseName: '',
182
         CaseName: '',
186
         CaseId: '',
183
         CaseId: '',
187
-        ShowSelect: true,
184
+        ShowSelect: false,
188
       },
185
       },
189
       caseInfo: {
186
       caseInfo: {
190
         value: '',
187
         value: '',
258
     topCaseInfo,
255
     topCaseInfo,
259
     caseTableItem,
256
     caseTableItem,
260
     myCard,
257
     myCard,
261
-    customerCard,
262
-    scroll
258
+    customerCard
263
   },
259
   },
264
   created () {
260
   created () {
261
+    if (!this.userInfo.customer.MapUser) {
262
+      this.topCaseInfoData.ShowSelect = true
263
+    }
265
     if (this.userInfo.customer.MapUser !== '') {
264
     if (this.userInfo.customer.MapUser !== '') {
266
       this.getForbidInfo().then((res) => {
265
       this.getForbidInfo().then((res) => {
267
         this.forbidList = res || []
266
         this.forbidList = res || []
291
               totalCount: res.list[n].TotalCount,
290
               totalCount: res.list[n].TotalCount,
292
               SentCount: res.list[n].SentCount,
291
               SentCount: res.list[n].SentCount,
293
               usedCount: res.list[n].UsedCount,
292
               usedCount: res.list[n].UsedCount,
293
+              CardId: res.list[n].CouponId,
294
             })
294
             })
295
           }
295
           }
296
           var count = 0
296
           var count = 0
314
               totalCount: res.list[n].TotalCount,
314
               totalCount: res.list[n].TotalCount,
315
               SentCount: res.list[n].SentCount,
315
               SentCount: res.list[n].SentCount,
316
               usedCount: res.list[n].UsedCount,
316
               usedCount: res.list[n].UsedCount,
317
+              CardId: res.list[n].CardId,
317
             })
318
             })
318
           }
319
           }
319
           var count = 0
320
           var count = 0
396
         }
397
         }
397
       }
398
       }
398
     },
399
     },
399
-    share (item) {
400
-      // console.log(item)
400
+    shareCard (item) {
401
+      let query = {
402
+        id: item.CardId,
403
+        type: 'card',
404
+        sharetype: 'share',
405
+        salesid: this.userInfo.customer.MapUser
406
+      }
407
+      this.$router.push({ name: 'receive', query: query })
408
+    },
409
+    shareCoupon (item) {
410
+      let query = {
411
+        id: item.CardId,
412
+        type: 'coupon',
413
+        sharetype: 'share',
414
+        salesid: this.userInfo.customer.MapUser
415
+      }
416
+      this.$router.push({ name: 'receive', query: query })
401
     },
417
     },
402
     remark (item) {
418
     remark (item) {
403
       // console.log(item)
419
       // console.log(item)

+ 18
- 15
src/pages/user/mainPage/coffeeIndex/page.scss Visa fil

32
     }
32
     }
33
   }
33
   }
34
   .content{
34
   .content{
35
-    // &>div{
36
-    //   width: 100%;
37
-    //   position: absolute;
38
-    //   left: 0;
39
-    //   top: 0;
40
-    //   bottom: 0;
41
-    //   overflow: hidden;
42
-    //   &>ul{
43
-    //     width: 100%;
44
-    //     height: 100%;
45
-    //     position: relative;
46
-    //     overflow: hidden;
35
+    width: 100%;
36
+    height: 100%;
37
+    position: relative;
38
+    &>div{
39
+      width: 100%;
40
+      position: absolute;
41
+      left: 0;
42
+      top: 0;
43
+      bottom: 0;
44
+      overflow: hidden;
45
+      &>ul{
46
+        width: 100%;
47
+        height: 100%;
48
+        position: relative;
49
+        overflow: hidden;
47
         &>li{
50
         &>li{
48
           width: 100%;
51
           width: 100%;
49
           height: 100%;
52
           height: 100%;
50
           position: relative;
53
           position: relative;
51
-          // overflow-y: scroll;
54
+          overflow-y: scroll;
52
           -webkit-overflow-scrolling: touch;
55
           -webkit-overflow-scrolling: touch;
53
           transform: translateZ(0);
56
           transform: translateZ(0);
54
           -webkit-transform: translateZ(0);
57
           -webkit-transform: translateZ(0);
179
             }
182
             }
180
           }
183
           }
181
         }
184
         }
182
-    //   }
183
-    // }
185
+      }
186
+    }
184
   }
187
   }
185
   .selectCase{
188
   .selectCase{
186
     width: 100%;
189
     width: 100%;

+ 1
- 1
src/pages/user/mainPage/index.vue Visa fil

5
         <router-view></router-view>
5
         <router-view></router-view>
6
       </div>
6
       </div>
7
     </div>
7
     </div>
8
-    <nav class="flex-h" v-if="!userInfo.CustomerId">
8
+    <nav class="flex-h" v-if="!userInfo.customer.MapUser">
9
       <router-link :to="{name:item.pathName,query:{}}" class="flex-item" active-class="active" v-for="(item, index) in tabBar" :key="index">
9
       <router-link :to="{name:item.pathName,query:{}}" class="flex-item" active-class="active" v-for="(item, index) in tabBar" :key="index">
10
         <div>
10
         <div>
11
           <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">
11
           <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">

+ 2
- 0
src/pages/user/placeOrder/index.vue Visa fil

336
           spec: (val.spec || ''),
336
           spec: (val.spec || ''),
337
           specname: (val.specname || ''),
337
           specname: (val.specname || ''),
338
         })
338
         })
339
+      } else {
340
+        this.selGoods.splice(this.selGoods.findIndex(item => item.id === val.id && item.spec === (val.spec || '')), 1)
339
       }
341
       }
340
     },
342
     },
341
     calcTotalNum () { // 计算总数量、价格
343
     calcTotalNum () { // 计算总数量、价格

+ 18
- 13
src/pages/user/receive/index.vue Visa fil

1
 <template>
1
 <template>
2
-  <div class="mainPage">
2
+  <div class="mainPage" v-if="show">
3
     <!-- <div class="residue">
3
     <!-- <div class="residue">
4
       <i class="iconfont icon-gantanhao"></i>
4
       <i class="iconfont icon-gantanhao"></i>
5
       <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
5
       <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
8
       <img :src="logo" alt="">
8
       <img :src="logo" alt="">
9
     </div> -->
9
     </div> -->
10
     <div class="banner"  v-if="!video">
10
     <div class="banner"  v-if="!video">
11
-      <img :src="data.CoverUrl" alt="" width="100%" height="100%">
11
+      <img :src="data.Images[0].CardImageUrl" alt="" width="100%" height="100%" v-if="$route.query.type === 'card'">
12
+      <img :src="data.Images[0].CouponImageUrl" alt="" width="100%" height="100%" v-else>
12
     </div>
13
     </div>
13
     <div class="content">
14
     <div class="content">
14
-      <div class="title">{{data.CardName}}</div>
15
+      <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
16
+      <div class="title" v-else>{{data.CouponName}}</div>
15
       <div class="video" v-if='video'>
17
       <div class="video" v-if='video'>
16
         <video :src="data.VideoUrl" width="100%" height="100%"></video>
18
         <video :src="data.VideoUrl" width="100%" height="100%"></video>
17
       </div>
19
       </div>
20
           <i class="icon-shuoming iconfont"></i>
22
           <i class="icon-shuoming iconfont"></i>
21
           <span>卡券使用说明</span>
23
           <span>卡券使用说明</span>
22
         </div>
24
         </div>
23
-        <pre>{{data.Share.CardUseInstruction}}</pre>
25
+        <pre v-if="$route.query.type === 'card'">{{data.Share.CardUseInstruction}}</pre>
26
+        <pre v-else>{{data.Share.UseInstruction}}</pre>
24
       </div>
27
       </div>
25
       <div class="text">
28
       <div class="text">
26
         <div>
29
         <div>
55
       logo,
58
       logo,
56
       video: true,
59
       video: true,
57
       button: true,
60
       button: true,
58
-      data: {
59
-        Share: {}
60
-      }
61
+      show: false,
62
+      data: {}
61
     }
63
     }
62
   },
64
   },
63
   computed: {
65
   computed: {
70
     })
72
     })
71
   },
73
   },
72
   created () {
74
   created () {
75
+    this.data = {}
73
     if (this.$route.params) {
76
     if (this.$route.params) {
74
       let that = this
77
       let that = this
75
       Object.keys(this.$route.params).forEach(function (key) {
78
       Object.keys(this.$route.params).forEach(function (key) {
78
     }
81
     }
79
 
82
 
80
 
83
 
81
-    if (this.$route.query.shareType === 'share') {
84
+    if (this.$route.query.sharetype === 'share') {
82
       this.button = false
85
       this.button = false
83
     }
86
     }
84
     this.getCaseList().then(() => {
87
     this.getCaseList().then(() => {
96
           if (!this.data.VideoUrl) {
99
           if (!this.data.VideoUrl) {
97
             this.video = false
100
             this.video = false
98
           }
101
           }
99
-          this.sdk()
102
+          this.show = true
103
+          this.sdk(this.data.Share.CardShareInfo)
100
         })
104
         })
101
       } else {
105
       } else {
102
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
106
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
103
-          this.data = this.cardShare.Card
107
+          this.data = this.couponShare.coupon
104
           this.data.address = this.caseList.filter(x => x.CaseId === this.data.CaseId)[0].CaseAddress
108
           this.data.address = this.caseList.filter(x => x.CaseId === this.data.CaseId)[0].CaseAddress
105
           if (!this.data.VideoUrl) {
109
           if (!this.data.VideoUrl) {
106
             this.video = false
110
             this.video = false
107
           }
111
           }
108
-          this.sdk()
112
+          this.show = true
113
+          this.sdk(this.data.Share.CouponShareInfo)
109
         })
114
         })
110
       }
115
       }
111
     },
116
     },
134
       let timestamp = new Date().valueOf()
139
       let timestamp = new Date().valueOf()
135
       return `${rnd}${timestamp}`
140
       return `${rnd}${timestamp}`
136
     },
141
     },
137
-    sdk () {
142
+    sdk (info) {
138
       let logo = this.logo.substring(2, this.logo.length)
143
       let logo = this.logo.substring(2, this.logo.length)
139
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
144
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
140
         title: '领取卡券',
145
         title: '领取卡券',
141
-        desc: this.data.Share.CardShareInfo,
146
+        desc: info,
142
         link: `${window.location.origin}${window.location.pathname}#/receiveShared/${this.$route.query.id}/${this.$route.query.salesid}/${this.$route.query.type}/receive`,
147
         link: `${window.location.origin}${window.location.pathname}#/receiveShared/${this.$route.query.id}/${this.$route.query.salesid}/${this.$route.query.type}/receive`,
143
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
148
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
144
       })
149
       })

+ 18
- 22
src/pages/user/receiveChannel/index.vue Visa fil

1
 <template>
1
 <template>
2
-  <div class="mainPage">
2
+  <div class="mainPage" v-if="show">
3
     <div class="residue">
3
     <div class="residue">
4
       <i class="iconfont icon-gantanhao"></i>
4
       <i class="iconfont icon-gantanhao"></i>
5
       <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
5
       <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
8
       <img :src="logo" alt="">
8
       <img :src="logo" alt="">
9
     </div>
9
     </div>
10
     <div class="banner"  v-if="!video">
10
     <div class="banner"  v-if="!video">
11
-      <img :src="data.CoverUrl" alt="" width="100%" height="100%">
11
+      <img :src="data.Images[0].CardImageUrl" alt="" width="100%" height="100%" v-if="$route.query.type === 'card'">
12
+      <img :src="data.Images[0].CouponImageUrl" alt="" width="100%" height="100%" v-else>
12
     </div>
13
     </div>
13
     <div class="content">
14
     <div class="content">
14
-      <div class="title">{{data.CardName}}</div>
15
+      <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
16
+      <div class="title" v-else>{{data.CouponName}}</div>
15
       <div class="video" v-if='video'>
17
       <div class="video" v-if='video'>
16
         <video :src="data.VideoUrl" width="100%" height="100%"></video>
18
         <video :src="data.VideoUrl" width="100%" height="100%"></video>
17
       </div>
19
       </div>
20
           <i class="icon-shuoming iconfont"></i>
22
           <i class="icon-shuoming iconfont"></i>
21
           <span>卡券使用说明</span>
23
           <span>卡券使用说明</span>
22
         </div>
24
         </div>
23
-        <pre>{{data.Share.CardUseInstruction}}</pre>
25
+        <pre v-if="$route.query.type === 'card'">{{data.Share.CardUseInstruction}}</pre>
26
+        <pre v-else>{{data.Share.UseInstruction}}</pre>
24
       </div>
27
       </div>
25
       <div class="text">
28
       <div class="text">
26
         <div>
29
         <div>
55
       logo,
58
       logo,
56
       video: true,
59
       video: true,
57
       button: true,
60
       button: true,
58
-      data: {
59
-        Share: {}
60
-      }
61
+      show: false,
62
+      data: {}
61
     }
63
     }
62
   },
64
   },
63
   computed: {
65
   computed: {
78
     }
80
     }
79
 
81
 
80
 
82
 
81
-    if (this.$route.query.shareType === 'share') {
83
+    if (this.$route.query.sharetype === 'share') {
82
       this.button = false
84
       this.button = false
83
     }
85
     }
84
     this.getCaseList().then(() => {
86
     this.getCaseList().then(() => {
96
           if (!this.data.VideoUrl) {
98
           if (!this.data.VideoUrl) {
97
             this.video = false
99
             this.video = false
98
           }
100
           }
99
-          this.sdk()
101
+          this.show = true
102
+          this.sdk(this.data.Share.CardShareInfo)
100
         })
103
         })
101
       } else {
104
       } else {
102
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
105
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
103
-          this.data = this.cardShare.Card
106
+          this.data = this.couponShare.coupon
104
           this.data.address = this.caseList.filter(x => x.CaseId === this.data.CaseId)[0].CaseAddress
107
           this.data.address = this.caseList.filter(x => x.CaseId === this.data.CaseId)[0].CaseAddress
105
           if (!this.data.VideoUrl) {
108
           if (!this.data.VideoUrl) {
106
             this.video = false
109
             this.video = false
107
           }
110
           }
108
-          this.sdk()
111
+          this.show = true
112
+          this.sdk(this.data.Share.CouponShareInfo)
109
         })
113
         })
110
       }
114
       }
111
     },
115
     },
126
         })
130
         })
127
       }
131
       }
128
     },
132
     },
129
-    random () {
130
-      let rnd = ''
131
-      for (let i = 0; i < 5; i++) {
132
-        rnd += Math.floor(Math.random() * 10)
133
-      }
134
-      let timestamp = new Date().valueOf()
135
-      return `${rnd}${timestamp}`
136
-    },
137
-    sdk () {
133
+    sdk (info) {
138
       let logo = this.logo.substring(2, this.logo.length)
134
       let logo = this.logo.substring(2, this.logo.length)
139
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
135
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
140
         title: '领取卡券',
136
         title: '领取卡券',
141
-        desc: this.data.Share.CardShareInfo,
142
-        link: `${window.location.origin}${window.location.pathname}#/receiveShared/${this.$route.query.id}/${this.$route.query.salesid}/${this.$route.query.type}/receive`,
137
+        desc: info,
138
+        link: `${window.location.origin}${window.location.pathname}#/receiveChannelShared/${this.$route.query.id}/${this.$route.query.type}/receive`,
143
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
139
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
144
       })
140
       })
145
     }
141
     }

+ 1
- 1
src/util/share.js Visa fil

11
     imgUrl: config.thu_image // 分享图标
11
     imgUrl: config.thu_image // 分享图标
12
   }
12
   }
13
   // 初始化
13
   // 初始化
14
-  return new Promise(function (resolve) {
14
+  return new Promise(function (resolve, reject) {
15
     Ajax(api.share.share.url, {
15
     Ajax(api.share.share.url, {
16
       method: api.share.share.method,
16
       method: api.share.share.method,
17
       urlData: {
17
       urlData: {