yuantianjiao 6 年之前
父節點
當前提交
5804e2e6de

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

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="card-content">
3
-    <div class="tag">
3
+    <div class="tag" v-if='data.showTag'>
4 4
       <span>我推荐</span>
5 5
     </div>
6 6
     <div class="card-top flex-h">

+ 3
- 1
src/pages/sales/login/index.vue 查看文件

@@ -120,7 +120,9 @@ export default {
120 120
       // console.log(this.postData)
121 121
       this.submitData(this.postData).then((res) => {
122 122
         // this.$toast(res)
123
-        window.location.href = this.getUrl('mainPage/coffeeIndex')
123
+        setTimeout(() => {
124
+          window.location.href = this.getUrl('mainPage/coffeeIndex')
125
+        }, 2000)
124 126
       })
125 127
     }
126 128
   },

+ 1
- 1
src/pages/user/App.vue 查看文件

@@ -37,7 +37,7 @@ export default {
37 37
     wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
38 38
       title: '城的空间',
39 39
       desc: '城的空间',
40
-      link: `${window.location.origin}${window.location.pathname}/user.html#/mainPage/indexPage`,
40
+      link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
41 41
       thu_image: `${window.location.origin}${window.location.pathname}${logo}`
42 42
     })
43 43
   },

+ 1
- 1
src/pages/user/bindMobile/bindMobile.vue 查看文件

@@ -179,7 +179,7 @@ export default {
179 179
           setTimeout(() => {
180 180
             // this.$router.push({name: 'userCenter'})
181 181
             window.history.go(-1)
182
-          }, 300)
182
+          }, 2000)
183 183
         }
184 184
       })
185 185
     }

+ 29
- 16
src/pages/user/mainPage/coffeeIndex/index.vue 查看文件

@@ -77,7 +77,7 @@
77 77
               <div class="list-box">
78 78
                 <div class="search-bar flex-h">
79 79
                   <span>共{{this.data[3].list.length}}位客户</span>
80
-                  <!-- <van-checkbox v-model="postCustomerData.isrecommend">
80
+                  <van-checkbox v-model="postCustomerData.isrecommend">
81 81
                     我推荐的客户({{myRecommendUserList.length}}人)
82 82
                     <img
83 83
                       slot="icon"
@@ -85,7 +85,7 @@
85 85
                       :src="postCustomerData.isrecommend ? icon.active : icon.normal"
86 86
                       style="width:.2rem;height:.2rem;bottom: .02rem;position: relative;"
87 87
                     >
88
-                  </van-checkbox> -->
88
+                  </van-checkbox>
89 89
                   <i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
90 90
                 </div>
91 91
                 <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record'></customerCard>
@@ -265,6 +265,9 @@ export default {
265 265
           for (var n = 0; n < res.length; n++) {
266 266
             if (res[n].RecommendId === this.userInfo.customer.MapUser) {
267 267
               this.myRecommendUserList.push(res[n])
268
+              res[n].showTag = true
269
+            } else {
270
+              res[n].showTag = false
268 271
             }
269 272
             this.data[3].list.push(res[n])
270 273
           }
@@ -276,7 +279,7 @@ export default {
276 279
           for (var n = 0; n < res.list.length; n++) {
277 280
             this.data[2].list.push({
278 281
               invalid: this.returnInvalid(res.list[n], 'coupon'),
279
-              price: res.list[n].Price,
282
+              price: parseInt(res.list[n].Price),
280 283
               title: res.list[n].CouponName,
281 284
               desc: res.list[n].Share.UseRule,
282 285
               startDate: this.toolClass.dateFormat(res.list[n].StartDate, 'yyyy年MM月dd日'),
@@ -300,7 +303,7 @@ export default {
300 303
           for (var n = 0; n < res.list.length; n++) {
301 304
             this.data[1].list.push({
302 305
               invalid: this.returnInvalid(res.list[n], 'card'),
303
-              price: res.list[n].Price,
306
+              price: parseInt(res.list[n].Price),
304 307
               title: res.list[n].CardName,
305 308
               desc: res.list[n].Share.CardUseRule,
306 309
               startDate: this.toolClass.dateFormat(res.list[n].StartDate, 'yyyy年MM月dd日'),
@@ -308,7 +311,7 @@ export default {
308 311
               totalCount: res.list[n].TotalCount,
309 312
               SentCount: res.list[n].SentCount,
310 313
               usedCount: res.list[n].UsedCount,
311
-              CardId: res.list[n].CardId,
314
+              CardId: res.list[n].CardId
312 315
             })
313 316
           }
314 317
           var count = 0
@@ -391,7 +394,8 @@ export default {
391 394
         id: item.CardId,
392 395
         type: 'card',
393 396
         sharetype: 'share',
394
-        salesid: this.userInfo.customer.MapUser
397
+        salesid: this.userInfo.customer.MapUser,
398
+        random: this.random()
395 399
       }
396 400
       this.$router.push({ name: 'receive', query: query })
397 401
     },
@@ -400,10 +404,19 @@ export default {
400 404
         id: item.CardId,
401 405
         type: 'coupon',
402 406
         sharetype: 'share',
403
-        salesid: this.userInfo.customer.MapUser
407
+        salesid: this.userInfo.customer.MapUser,
408
+        random: this.random()
404 409
       }
405 410
       this.$router.push({ name: 'receive', query: query })
406 411
     },
412
+    random () {
413
+      let rnd = ''
414
+      for (let i = 0; i < 5; i++) {
415
+        rnd += Math.floor(Math.random() * 10)
416
+      }
417
+      let timestamp = new Date().valueOf()
418
+      return `${rnd}${timestamp}`
419
+    },
407 420
     remark (item) {
408 421
       // console.log(item)
409 422
       this.showDialog = true
@@ -423,14 +436,6 @@ export default {
423 436
       let that = this
424 437
       that.topCaseInfoData.caseName = that.CaseList[0].CaseName
425 438
       that.topCaseInfoData.caseId = that.CaseList[0].CaseId
426
-      that.getCaseTableList({
427
-        caseid: that.topCaseInfoData.caseId
428
-      })
429
-      if (this.userInfo.customer.MapUser !== '') {
430
-        that.getCaseTotal({
431
-          caseid: that.topCaseInfoData.caseId
432
-        })
433
-      }
434 439
       if (this.userInfo.customer.MapUser !== '') {
435 440
         this.topCaseInfoData.caseId = this.userInfo.customer.BelongCaseId
436 441
         for (let i = 0; i < this.CaseList.length; i++) {
@@ -438,11 +443,19 @@ export default {
438 443
             this.topCaseInfoData.caseName = this.CaseList[i].CaseName
439 444
           }
440 445
         }
446
+        that.getCaseTableList({
447
+          caseid: that.topCaseInfoData.caseId
448
+        })
449
+        if (this.userInfo.customer.MapUser !== '') {
450
+          that.getCaseTotal({
451
+            caseid: that.topCaseInfoData.caseId
452
+          })
453
+        }
441 454
       } else {
442 455
         wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
443 456
           title: '城的空间',
444 457
           desc: '城的空间',
445
-          link: `${window.location.origin}${window.location.pathname}/user.html#/mainPage/indexPage`,
458
+          link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
446 459
           thu_image: `${window.location.origin}${window.location.pathname}${logo}`
447 460
         }).then(() => {
448 461
           wx.getLocation({

+ 5
- 2
src/pages/user/mainPage/indexPage/index.vue 查看文件

@@ -84,6 +84,7 @@ export default {
84 84
       locationId: '',
85 85
       swiperOption: {
86 86
         observer: true,
87
+        speed: 1000,
87 88
         autoplay: {
88 89
           disableOnInteraction: false,
89 90
         }
@@ -91,7 +92,7 @@ export default {
91 92
       swiperOptionMsg: {
92 93
         observer: true,
93 94
         direction: 'vertical',
94
-        loop: true,
95
+        speed: 1000,
95 96
         autoplay: {
96 97
           disableOnInteraction: false,
97 98
         }
@@ -115,7 +116,9 @@ export default {
115 116
       return this.$refs.mySwiper.swiper
116 117
     },
117 118
     MySwiperMsg () {
118
-      return this.$refs.MySwiperMsg.swiper
119
+      this.$nextTick(() => {  // 下一个UI帧再初始化swiper
120
+        return this.$refs.MySwiperMsg.swiper
121
+      })
119 122
     }
120 123
   },
121 124
   components: {

+ 6
- 13
src/pages/user/mainPage/userCenter/index.vue 查看文件

@@ -1,15 +1,12 @@
1 1
 <template>
2 2
   <div class="mainPage">
3
-    <div class="loading" v-if="isLoading">
4
-      <!-- <div @click="bindMobile">请绑定手机号</div> -->
5
-    </div>
6
-    <div v-else>
3
+    <div>
7 4
       <div class="userTop_view" >
8 5
         <div class="gradient_bg"></div>
9 6
         <div class="zIndex_bg"></div>
10 7
         <div class="userAvatar_Border">
11 8
           <div class="userAvatar">
12
-            <img :src='AccountInfo.headimgurl' alt="" width="100%" height="100%">
9
+            <img :src='headimgurl' alt="" width="100%" height="100%">
13 10
           </div>
14 11
         </div>
15 12
         <div class="uesr-info">
@@ -71,8 +68,7 @@ export default {
71 68
   name: '',
72 69
   data () {
73 70
     return {
74
-      user: {},
75
-      isLoading: true
71
+      user: {}
76 72
     }
77 73
   },
78 74
   computed: {
@@ -87,12 +83,9 @@ export default {
87 83
   },
88 84
   mounted () {
89 85
     this.getUserInfo({ org: this.org }).then(() => {
90
-      if (this.userInfo) {
91
-        this.user = this.userInfo.customer
92
-        this.AccountInfo = JSON.parse(this.user.AccountInfo)
93
-        this.headimgurl = this.AccountInfo.headimgurl
94
-        this.isLoading = false
95
-      }
86
+      this.user = this.userInfo.customer
87
+      this.AccountInfo = JSON.parse(this.user.AccountInfo)
88
+      this.headimgurl = this.user.Headimgurl
96 89
     })
97 90
     this.getNum()
98 91
   },

+ 2
- 2
src/pages/user/majorProjectsDetail/index.vue 查看文件

@@ -122,7 +122,7 @@ export default {
122 122
       }
123 123
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
124 124
       let nowDate = Date.now()
125
-      let endData = new Date(this.courseDetail.EndDate).getTime()
125
+      let endData = new Date(this.courseDetail.CourseDetail[0].EndDate).getTime()
126 126
       if (nowDate > endData) {
127 127
         this.gray = true
128 128
       }
@@ -130,7 +130,7 @@ export default {
130 130
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
131 131
         title: '城的空间',
132 132
         desc: '城的空间',
133
-        link: `${window.location.origin}${window.location.pathname}/user.html#/mainPage/indexPage`,
133
+        link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
134 134
         thu_image: `${window.location.origin}${window.location.pathname}${logo}`
135 135
       }).then(() => {
136 136
         let result = this.courseDetail.CaseInfo.Coordinate.split(",")

+ 5
- 3
src/pages/user/placeOrder/index.vue 查看文件

@@ -186,9 +186,11 @@ export default {
186 186
         // console.log(JSON.stringify(res))
187 187
         this.mapArr()
188 188
       })
189
-      this.getCaseTotal({
190
-        caseid: this.caseId
191
-      })
189
+      if (this.userInfo.customer.MapUser !== '') {
190
+        this.getCaseTotal({
191
+          caseid: this.caseId
192
+        })
193
+      }
192 194
     })
193 195
   },
194 196
   methods: {

+ 8
- 14
src/pages/user/receive/index.vue 查看文件

@@ -8,8 +8,8 @@
8 8
       <img :src="logo" alt="">
9 9
     </div> -->
10 10
     <div class="banner"  v-if="!video">
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>
11
+      <img :src="data.Images[0].CardImageUrl" alt="" width="100%" height="100%" v-if="type === 'card'">
12
+      <img :src="data.Images[0].CouponImageUrl" alt="" width="100%" height="100%" v-if="type === 'coupon'">
13 13
     </div>
14 14
     <div class="content">
15 15
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
@@ -59,6 +59,7 @@ export default {
59 59
       video: true,
60 60
       button: true,
61 61
       show: false,
62
+      type: '',
62 63
       data: {}
63 64
     }
64 65
   },
@@ -80,6 +81,7 @@ export default {
80 81
       })
81 82
     }
82 83
 
84
+    this.type = this.$route.query.type
83 85
 
84 86
     if (this.$route.query.sharetype === 'share') {
85 87
       this.button = false
@@ -116,14 +118,14 @@ export default {
116 118
     },
117 119
     receive () {
118 120
       if (this.$route.query.type === 'card') {
119
-        this.setCardShare({ id: this.$route.query.id, salesid: this.$route.query.salesid, serialcode: this.random() }).then(() => {
121
+        this.setCardShare({ id: this.$route.query.id, salesid: this.$route.query.salesid, serialcode: this.$route.query.random }).then(() => {
120 122
           this.$router.push({ name: 'receiveResults', query: { type: 'success' } })
121 123
         }).catch((err) => {
122 124
           this.$router.push({ name: 'receiveResults', query: { type: 'fail' } })
123 125
           console.log(err)
124 126
         })
125 127
       } else {
126
-        this.setCouponShare({ id: this.$route.query.id, salesid: this.$route.query.salesid, serialcode: this.random() }).then(() => {
128
+        this.setCouponShare({ id: this.$route.query.id, salesid: this.$route.query.salesid, serialcode: this.$route.query.random }).then(() => {
127 129
           this.$router.push({ name: 'receiveResults', query: { type: 'success' } })
128 130
         }).catch((err) => {
129 131
           this.$router.push({ name: 'receiveResults', query: { type: 'fail' } })
@@ -131,17 +133,9 @@ export default {
131 133
         })
132 134
       }
133 135
     },
134
-    random () {
135
-      let rnd = ''
136
-      for (let i = 0; i < 5; i++) {
137
-        rnd += Math.floor(Math.random() * 10)
138
-      }
139
-      let timestamp = new Date().valueOf()
140
-      return `${rnd}${timestamp}`
141
-    },
142 136
     sdk (info) {
143 137
       let logo, title
144
-      if ($route.query.type === 'card') {
138
+      if (this.$route.query.type === 'card') {
145 139
         logo = this.data.Images[0].CardImageUrl
146 140
         title = this.data.CardName
147 141
       } else {
@@ -151,7 +145,7 @@ export default {
151 145
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
152 146
         title: title,
153 147
         desc: info,
154
-        link: `${window.location.origin}${window.location.pathname}#/receiveShared/${this.$route.query.id}/${this.$route.query.salesid}/${this.$route.query.type}/receive`,
148
+        link: `${window.location.origin}${window.location.pathname}#/receiveShared/${this.$route.query.id}/${this.$route.query.salesid}/${this.$route.query.type}/${this.$route.query.random}/receive`,
155 149
         thu_image: logo
156 150
       })
157 151
     }

+ 7
- 4
src/pages/user/receiveChannel/index.vue 查看文件

@@ -8,8 +8,8 @@
8 8
       <img :src="logo" alt="">
9 9
     </div>
10 10
     <div class="banner"  v-if="!video">
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>
11
+      <img :src="data.Images[0].CardImageUrl" alt="" width="100%" height="100%" v-if="type === 'card'">
12
+      <img :src="data.Images[0].CouponImageUrl" alt="" width="100%" height="100%" v-if="type === 'coupon'">
13 13
     </div>
14 14
     <div class="content">
15 15
       <div class="title" v-if="$route.query.type === 'card'">{{data.CardName}}</div>
@@ -59,6 +59,7 @@ export default {
59 59
       video: true,
60 60
       button: true,
61 61
       show: false,
62
+      type:'',
62 63
       data: {}
63 64
     }
64 65
   },
@@ -79,10 +80,12 @@ export default {
79 80
       })
80 81
     }
81 82
 
82
-
83 83
     if (this.$route.query.sharetype === 'share') {
84 84
       this.button = false
85 85
     }
86
+
87
+    this.type = this.$route.query.type
88
+    
86 89
     this.getCaseList().then(() => {
87 90
       this.init()
88 91
     })
@@ -132,7 +135,7 @@ export default {
132 135
     },
133 136
     sdk (info) {
134 137
       let logo, title
135
-      if ($route.query.type === 'card') {
138
+      if (this.$route.query.type === 'card') {
136 139
         logo = this.data.Images[0].CardImageUrl
137 140
         title = this.data.CardName
138 141
       } else {

+ 1
- 1
src/pages/user/receiveResults/page.scss 查看文件

@@ -32,6 +32,6 @@
32 32
   img{
33 33
     width: 1rem;
34 34
     margin-top: 1rem;
35
-    opacity: .5;
35
+    opacity: .3;
36 36
   }
37 37
 }

+ 1
- 1
src/pages/user/router.js 查看文件

@@ -139,7 +139,7 @@ const router = new Router({
139 139
     component: receiveResults,
140 140
     children: []
141 141
   }, { // 卡券领取(带参数,分享后的路径)
142
-    path: '/receiveShared/:id/:salesid/:type/:sharetype',
142
+    path: '/receiveShared/:id/:salesid/:type/:random/:sharetype',
143 143
     name: 'receive',
144 144
     component: receive
145 145
   }, { // 渠道卡券领取

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

@@ -6,7 +6,7 @@ import { Toast } from '../../node_modules/vant';
6 6
 
7 7
 const token = function (headers) {
8 8
   let JWT
9
-  if (headers){
9
+  if (headers) {
10 10
     localStorage.setItem('JWT', headers.authorization)
11 11
     JWT = headers.authorization
12 12
   }
@@ -77,12 +77,15 @@ const ajax = (...args) => {
77 77
           router.push({ name: 'bindMobile' })
78 78
         }
79 79
       } else {
80
-        // console.log(message)
81
-        Toast.fail({
82
-          duration: 2000, // 持续展示 toast
83
-          forbidClick: true, // 禁用背景点击
84
-          message: message
85
-        })
80
+        if (message.indexOf("log-error") != -1) {
81
+          console.log(message)
82
+        } else {
83
+          Toast.fail({
84
+            duration: 2000, // 持续展示 toast
85
+            forbidClick: true, // 禁用背景点击
86
+            message: message
87
+          })
88
+        }
86 89
         reject(message)
87 90
       }
88 91
     }).catch(reject)