yuantianjiao 6 vuotta sitten
vanhempi
commit
d5aac12e89

+ 1
- 1
src/pages/user/bindMobile/bindMobile.vue Näytä tiedosto

173
         if (this.$route.query.isLottery) {
173
         if (this.$route.query.isLottery) {
174
           setTimeout(() => {
174
           setTimeout(() => {
175
             const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}` : ''
175
             const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}` : ''
176
-            window.location.href = `/game/luckdraw/${from}`
176
+            window.location.href = `${window.location.origin}/c-v2/game/luckdraw/${from}`
177
           }, 2000)
177
           }, 2000)
178
         } else {
178
         } else {
179
           setTimeout(function () {
179
           setTimeout(function () {

+ 13
- 11
src/pages/user/mainPage/coffeeIndex/index.vue Näytä tiedosto

132
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
132
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
133
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
133
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
134
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
134
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
135
+const wx = require('weixin-js-sdk')
135
 
136
 
136
 export default {
137
 export default {
137
   name: '',
138
   name: '',
427
       window.location.href = this.getUrl('customerSearch')
428
       window.location.href = this.getUrl('customerSearch')
428
     },
429
     },
429
     locationMapping () {
430
     locationMapping () {
431
+      let that = this
430
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
432
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
431
         title: '城的空间',
433
         title: '城的空间',
432
         desc: '城的空间',
434
         desc: '城的空间',
438
           success: function (res) {
440
           success: function (res) {
439
             let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
441
             let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
440
             let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
442
             let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
441
-            for (let i = 0; i < this.CaseList.length; i++) {
442
-              let result = this.CaseList[i].Coordinate.split(",")
443
+            for (let i = 0; i < that.CaseList.length; i++) {
444
+              let result = that.CaseList[i].Coordinate.split(",")
443
               let latitude2 = parseFloat(result[0])
445
               let latitude2 = parseFloat(result[0])
444
               let longitude2 = parseFloat(result[1])
446
               let longitude2 = parseFloat(result[1])
445
-              if (this.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
446
-                this.topCaseInfoData.caseName = this.CaseList[i].CaseName
447
-                this.topCaseInfoData.caseId = this.CaseList[i].CaseId
448
-                this.getCaseTableList({
449
-                  caseid: this.topCaseInfoData.caseId
447
+              if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
448
+                that.topCaseInfoData.caseName = that.CaseList[i].CaseName
449
+                that.topCaseInfoData.caseId = that.CaseList[i].CaseId
450
+                that.getCaseTableList({
451
+                  caseid: that.topCaseInfoData.caseId
450
                 })
452
                 })
451
-                this.getCaseTotal({
452
-                  caseid: this.topCaseInfoData.caseId
453
+                that.getCaseTotal({
454
+                  caseid: that.topCaseInfoData.caseId
453
                 })
455
                 })
454
               }
456
               }
455
             }
457
             }
456
-            if (!this.topCaseInfoData.caseId || !this.topCaseInfoData.caseName){
457
-              this.topCaseInfoData.caseName = '当前位置无案场'
458
+            if (!that.topCaseInfoData.caseId || !that.topCaseInfoData.caseName){
459
+              that.topCaseInfoData.caseName = '当前位置无案场'
458
             }
460
             }
459
           }
461
           }
460
         })
462
         })

+ 9
- 7
src/pages/user/mainPage/userCenter/index.vue Näytä tiedosto

23
             <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
23
             <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
24
           </div>
24
           </div>
25
           <span>优惠券</span>
25
           <span>优惠券</span>
26
-          <span>2张未使用</span>
26
+          <span>{{Nums.couponnum || 0}}张未使用</span>
27
         </div>
27
         </div>
28
         <div class="flex-item privilege-item" @click="toCard">
28
         <div class="flex-item privilege-item" @click="toCard">
29
           <div class="img-box">
29
           <div class="img-box">
30
             <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
30
             <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
31
           </div>
31
           </div>
32
           <span>卡券</span>
32
           <span>卡券</span>
33
-          <span>2张未使用</span>
33
+          <span>{{Nums.cardsnum || 0}}张未使用</span>
34
         </div>
34
         </div>
35
         <div class="flex-item privilege-item" @click="toVip">
35
         <div class="flex-item privilege-item" @click="toVip">
36
           <div class="img-box">
36
           <div class="img-box">
37
             <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
37
             <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
38
           </div>
38
           </div>
39
           <span>VIP卡</span>
39
           <span>VIP卡</span>
40
-          <span>¥200 <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
40
+          <span>¥{{(Nums.account || {}).Amount || 0}} <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
41
         </div>
41
         </div>
42
       </div>
42
       </div>
43
 
43
 
77
   computed: {
77
   computed: {
78
     ...mapState({
78
     ...mapState({
79
       userInfo: x => x.userCenter.userInfo,
79
       userInfo: x => x.userCenter.userInfo,
80
-      org: x => x.app.orgId
80
+      org: x => x.app.orgId,
81
+      Nums: x => x.userCenter.Nums
81
     })
82
     })
82
   },
83
   },
83
   components: {
84
   components: {
92
         this.isLoading = false
93
         this.isLoading = false
93
       }
94
       }
94
     })
95
     })
96
+    this.getNum()
95
   },
97
   },
96
   methods: {
98
   methods: {
97
-    ...actions(['getUserInfo']),
99
+    ...actions(['getUserInfo', 'getNum']),
98
     toLessonOrder () {
100
     toLessonOrder () {
99
       this.$router.push({ name: 'lessonOrder' })
101
       this.$router.push({ name: 'lessonOrder' })
100
     },
102
     },
114
       this.$router.push({ name: 'orderList' })
116
       this.$router.push({ name: 'orderList' })
115
     },
117
     },
116
     toBodyCheck () {
118
     toBodyCheck () {
117
-      window.location.href = `/bodyCheck.html#/`
119
+      window.location.href = `${window.location.origin}/c-v2/bodyCheck.html#/`
118
     },
120
     },
119
     toLuckdraw () {
121
     toLuckdraw () {
120
       // ^参数约定为97
122
       // ^参数约定为97
122
       let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
124
       let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
123
       num = num >= 1000 ? 999 : num
125
       num = num >= 1000 ? 999 : num
124
       userid = parseInt(`${userid}${num}`) ^ 97
126
       userid = parseInt(`${userid}${num}`) ^ 97
125
-      window.location.href = `/game/luckdraw/#/lotteryList?from=${userid}`
127
+      window.location.href = `${window.location.origin}/c-v2/game/luckdraw/#/lotteryList?from=${userid}`
126
     }
128
     }
127
   }
129
   }
128
 }
130
 }

+ 1
- 0
src/pages/user/majorProjectsDetail/index.vue Näytä tiedosto

74
 import 'swiper/dist/css/swiper.css'
74
 import 'swiper/dist/css/swiper.css'
75
 import { mapState, createNamespacedHelpers } from 'vuex'
75
 import { mapState, createNamespacedHelpers } from 'vuex'
76
 const { mapActions: mapProjectActions, mapState: mapProjectState } = createNamespacedHelpers('majorProjects')
76
 const { mapActions: mapProjectActions, mapState: mapProjectState } = createNamespacedHelpers('majorProjects')
77
+const wx = require('weixin-js-sdk')
77
 
78
 
78
 export default {
79
 export default {
79
   name: '',
80
   name: '',

+ 15
- 1
src/store/userCenter/userCenter.js Näytä tiedosto

73
 export default {
73
 export default {
74
   namespaced: true,
74
   namespaced: true,
75
   state: {
75
   state: {
76
+    Nums: {},
76
     userInfo: {},
77
     userInfo: {},
77
     caseInfo: {},
78
     caseInfo: {},
78
     courseOrderList: {},
79
     courseOrderList: {},
80
     courseOrderDetail: {},
81
     courseOrderDetail: {},
81
   },
82
   },
82
   mutations: {
83
   mutations: {
84
+    setNums (state, data) {
85
+      state.Nums = data || {}
86
+    },
83
     setUserInfo (state, data) {
87
     setUserInfo (state, data) {
84
       state.userInfo = data
88
       state.userInfo = data
85
     },
89
     },
96
       if (page <= 1) {
100
       if (page <= 1) {
97
         state.courseOrderList = res
101
         state.courseOrderList = res
98
       } else {
102
       } else {
99
-        state.courseOrderList = {...res, list: [...state.courseOrderList.list, ...res.list]}
103
+        state.courseOrderList = { ...res, list: [...state.courseOrderList.list, ...res.list] }
100
       }
104
       }
101
     }
105
     }
102
   },
106
   },
103
   actions: {
107
   actions: {
108
+    getNum (context) { // 获取我的用户领取卡信息
109
+      return new Promise((resolve) => {
110
+        Ajax({
111
+          ...api.user.getNum
112
+        }).then(res => {
113
+          context.commit('setNums', res)
114
+          resolve(res)
115
+        })
116
+      })
117
+    },
104
     getCustomerCardList (context, { id, payload }) { // 获取我的用户领取卡信息
118
     getCustomerCardList (context, { id, payload }) { // 获取我的用户领取卡信息
105
       return new Promise((resolve) => {
119
       return new Promise((resolve) => {
106
         Ajax(api.sales.getCustomerCardList.url, {
120
         Ajax(api.sales.getCustomerCardList.url, {

+ 3
- 1
src/util/ajax.js Näytä tiedosto

10
     localStorage.setItem('JWT', headers.authorization)
10
     localStorage.setItem('JWT', headers.authorization)
11
     JWT = headers.authorization
11
     JWT = headers.authorization
12
   }
12
   }
13
-  return JWT ? JWT : localStorage.getItem('JWT')
13
+  const token = JWT ? JWT : localStorage.getItem('JWT')
14
+
15
+  return !token ? '' : token
14
 }
16
 }
15
 
17
 
16
 const Axios = axios.create({
18
 const Axios = axios.create({

+ 7
- 3
src/util/api.js Näytä tiedosto

1
-// const baseUrl = '/api-v2'
2
-const baseUrl = '/api'
1
+const baseUrl = '/api-v2'
2
+// const baseUrl = '/api'
3
 const wechat = '/wechat/:org'
3
 const wechat = '/wechat/:org'
4
 const guest = '/guest/:org'
4
 const guest = '/guest/:org'
5
 const common = '/common/:org'
5
 const common = '/common/:org'
126
       method: 'get',
126
       method: 'get',
127
       url: `${baseUrl}${wechat}/gymcard/:customerGymId`
127
       url: `${baseUrl}${wechat}/gymcard/:customerGymId`
128
     },
128
     },
129
+    getNum: { // 获取卡券数
130
+      method: 'get',
131
+      url: `${baseUrl}${wechat}/customer/info`
132
+    }
129
   },
133
   },
130
   director: {
134
   director: {
131
     getSales: { // 获取销售列表
135
     getSales: { // 获取销售列表
204
   share: {
208
   share: {
205
     share: {
209
     share: {
206
       method: 'get',
210
       method: 'get',
207
-      url: `${baseUrl}${guest}/wechat/jssdk/signature/:url`
211
+      url: `${baseUrl}${guest}/wechat/jssdk/signature`
208
     },
212
     },
209
     card: {
213
     card: {
210
       method: 'get',
214
       method: 'get',

+ 4
- 2
src/util/share.js Näytä tiedosto

14
   return new Promise(function (resolve, reject) {
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
+      queryData: {
18
         ...params
18
         ...params
19
       }
19
       }
20
     }).then(result => {
20
     }).then(result => {
21
+      console.log(result)
22
+      let time = parseInt(result.timestamp)
21
       wx.config({
23
       wx.config({
22
         debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
24
         debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
23
         appId: result.appId, // 必填,公众号的唯一标识
25
         appId: result.appId, // 必填,公众号的唯一标识
24
-        timestamp: result.timestamp, // 必填,生成签名的时间戳
26
+        timestamp: time, // 必填,生成签名的时间戳
25
         nonceStr: result.noncestr, // 必填,生成签名的随机串
27
         nonceStr: result.noncestr, // 必填,生成签名的随机串
26
         signature: result.signature, // 必填,签名,见附录1
28
         signature: result.signature, // 必填,签名,见附录1
27
         jsApiList: [
29
         jsApiList: [