yuantianjiao 6 lat temu
rodzic
commit
7fcbef2c1d

+ 2
- 2
src/components/topCaseInfo/index.vue Wyświetl plik

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

+ 30
- 14
src/pages/user/mainPage/coffeeIndex/index.vue Wyświetl plik

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

+ 18
- 15
src/pages/user/mainPage/coffeeIndex/page.scss Wyświetl plik

@@ -32,23 +32,26 @@
32 32
     }
33 33
   }
34 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 50
         &>li{
48 51
           width: 100%;
49 52
           height: 100%;
50 53
           position: relative;
51
-          // overflow-y: scroll;
54
+          overflow-y: scroll;
52 55
           -webkit-overflow-scrolling: touch;
53 56
           transform: translateZ(0);
54 57
           -webkit-transform: translateZ(0);
@@ -179,8 +182,8 @@
179 182
             }
180 183
           }
181 184
         }
182
-    //   }
183
-    // }
185
+      }
186
+    }
184 187
   }
185 188
   .selectCase{
186 189
     width: 100%;

+ 1
- 1
src/pages/user/mainPage/index.vue Wyświetl plik

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

+ 2
- 0
src/pages/user/placeOrder/index.vue Wyświetl plik

@@ -336,6 +336,8 @@ export default {
336 336
           spec: (val.spec || ''),
337 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 343
     calcTotalNum () { // 计算总数量、价格

+ 18
- 13
src/pages/user/receive/index.vue Wyświetl plik

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

+ 18
- 22
src/pages/user/receiveChannel/index.vue Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="mainPage">
2
+  <div class="mainPage" v-if="show">
3 3
     <div class="residue">
4 4
       <i class="iconfont icon-gantanhao"></i>
5 5
       <span>仅剩{{data.TotalCount - data.UsedCount}}张券可以领取!</span>
@@ -8,10 +8,12 @@
8 8
       <img :src="logo" alt="">
9 9
     </div>
10 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 13
     </div>
13 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 17
       <div class="video" v-if='video'>
16 18
         <video :src="data.VideoUrl" width="100%" height="100%"></video>
17 19
       </div>
@@ -20,7 +22,8 @@
20 22
           <i class="icon-shuoming iconfont"></i>
21 23
           <span>卡券使用说明</span>
22 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 27
       </div>
25 28
       <div class="text">
26 29
         <div>
@@ -55,9 +58,8 @@ export default {
55 58
       logo,
56 59
       video: true,
57 60
       button: true,
58
-      data: {
59
-        Share: {}
60
-      }
61
+      show: false,
62
+      data: {}
61 63
     }
62 64
   },
63 65
   computed: {
@@ -78,7 +80,7 @@ export default {
78 80
     }
79 81
 
80 82
 
81
-    if (this.$route.query.shareType === 'share') {
83
+    if (this.$route.query.sharetype === 'share') {
82 84
       this.button = false
83 85
     }
84 86
     this.getCaseList().then(() => {
@@ -96,16 +98,18 @@ export default {
96 98
           if (!this.data.VideoUrl) {
97 99
             this.video = false
98 100
           }
99
-          this.sdk()
101
+          this.show = true
102
+          this.sdk(this.data.Share.CardShareInfo)
100 103
         })
101 104
       } else {
102 105
         this.getCouponShare({ id: this.$route.query.id }).then(() => {
103
-          this.data = this.cardShare.Card
106
+          this.data = this.couponShare.coupon
104 107
           this.data.address = this.caseList.filter(x => x.CaseId === this.data.CaseId)[0].CaseAddress
105 108
           if (!this.data.VideoUrl) {
106 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,20 +130,12 @@ export default {
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 134
       let logo = this.logo.substring(2, this.logo.length)
139 135
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
140 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 139
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
144 140
       })
145 141
     }

+ 1
- 1
src/util/share.js Wyświetl plik

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