张延森 il y a 4 ans
Parent
révision
4d6c8fe62b

+ 2
- 7
config/index.js Voir le fichier

@@ -12,16 +12,11 @@ module.exports = {
12 12
     assetsPublicPath: '/',
13 13
     proxyTable: {
14 14
       '/api': {
15
+        target: 'https://app.xnsport.cn',
15 16
         // target: 'http://123.57.65.31:9004',
16
-        target: 'http://127.0.0.1:8080',
17 17
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
18 18
         pathRewrite: { '^/api': '/api' }
19
-      },
20
-      // '/api': {
21
-      //   target: 'https://app.xnsport.cn',
22
-      //   changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
23
-      //   pathRewrite: { '^/api': '/api' }
24
-      // }
19
+      }
25 20
       // '/app-api': {
26 21
       //   target: 'http://ycapi.jcjyhn.com',
27 22
       //   changeOrigin: true, // 如果接口跨域,需要进行这个参数配置

+ 1
- 1
src/pages/WoDe/ChongZhi/index.vue Voir le fichier

@@ -60,7 +60,7 @@ export default {
60 60
         this.Toast('充值牛逼数量必须为正整数')
61 61
         return false
62 62
       }
63
-      window.location.href = `/api/app/alipay/deposit?amount=${this.Amount - 0}&returlURL=${encodeURIComponent(`${window.location.origin}/#/WoDe/ChongZhiZhuangTai`)}&token=${window.localStorage.Jwt}`
63
+      window.location.href = `/api/app/alipay/deposit?amount=${this.Amount - 0}&returnURL=${encodeURIComponent(`${window.location.origin}/#/WoDe/ChongZhiZhuangTai`)}&token=${window.localStorage.Jwt}`
64 64
     }
65 65
   }
66 66
 }

+ 10
- 1
src/pages/WoDe/ChongZhiZhuangTai/index.vue Voir le fichier

@@ -17,7 +17,7 @@
17 17
 <script>
18 18
 import MainPageContainer from '../../../components/common/MainPageContainer'
19 19
 import { createNamespacedHelpers } from 'vuex'
20
-const { mapActions: mapUserActions } = createNamespacedHelpers('user')
20
+const { mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
21 21
 export default {
22 22
   name: 'index',
23 23
   data () {
@@ -40,12 +40,21 @@ export default {
40 40
   },
41 41
   methods: {
42 42
     ...mapUserActions([
43
+      'GetCurrentUserInfo',
43 44
       'GetAliPayStatus'
44 45
     ]),
46
+    ...mapUserMutations([
47
+      'UpdateUserInfo'
48
+    ]),
45 49
     Init () { // 初始化
46 50
       if (this.$route.query.orderId !== undefined) {
47 51
         this.GetAliPayStatus({ urlData: { id: this.$route.query.orderId } }).then((res) => {
48 52
           this.OrderStatus = res.data.data === 1 ? 'Success' : 'Error'
53
+          if (res.data.data === 1) {
54
+            this.GetCurrentUserInfo().then((res) => {
55
+              this.UpdateUserInfo(res.data.data)
56
+            })
57
+          }
49 58
         })
50 59
       }
51 60
     }

+ 7
- 2
src/pages/WoDe/UserCenter/index.vue Voir le fichier

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="Page">
3
-    <MainPageContainer :ShowMainTabBar="true" :MainTabBarActiveId="3">
3
+    <MainPageContainer @UserInfoChange="UserInfoChange" :ShowMainTabBar="true" :MainTabBarActiveId="3">
4 4
       <div class="PageContainer">
5 5
         <!-- 头像 & 背景 -->
6 6
         <div class="TopContainer">
@@ -38,7 +38,7 @@
38 38
 <script>
39 39
 import MainPageContainer from '../../../components/common/MainPageContainer'
40 40
 import { createNamespacedHelpers } from 'vuex'
41
-const { mapState: mapUserState } = createNamespacedHelpers('user')
41
+const { mapState: mapUserState, mapActions: mapUserActions } = createNamespacedHelpers('user')
42 42
 export default {
43 43
   name: '',
44 44
   data () {
@@ -69,6 +69,11 @@ export default {
69 69
     })
70 70
   },
71 71
   methods: {
72
+    ...mapUserActions([
73
+      'GetCurrentUserInfo'
74
+    ]),
75
+    UserInfoChange () {
76
+    }
72 77
   }
73 78
 }
74 79
 </script>

+ 34
- 4
src/pages/index/LanQiuDingDan/index.vue Voir le fichier

@@ -44,14 +44,14 @@
44 44
             <a @click="ShowStore = true">店铺:{{CurrentStoreName || '请选择'}}</a>
45 45
           </div>
46 46
           <div class="Chuan" v-if="$route.query.type === 'mix'">
47
-            <span @click="ShowPassWay = true">{{CurrentPassName || '请选择过关方式'}}</span>
47
+            <span @click="ShowPassWay = true">{{CurrentPassName || '请选择过关方式'}} <i class="iconfont iconjiantoudown"></i></span>
48 48
           </div>
49 49
           <div class="Count">
50 50
             <span>
51 51
               <em>{{TotalCount}}</em>注
52 52
             </span>
53 53
             <span>金额:<em>{{TotalPrice}}</em>牛币</span>
54
-            <span>预计奖金:<em>{{(PriceArr[0] * Multiple).toFixed(2)}} ~ {{(PriceArr[1] * Multiple).toFixed(2)}}</em>牛币</span>
54
+            <span>预计奖金:<em>{{(MinPrice * Multiple).toFixed(2)}} ~ {{(MaxPrice * Multiple).toFixed(2)}}</em>牛币</span>
55 55
           </div>
56 56
           <a :class="{'active': CurrentStoreId !== null && LanQiuCart.length}" @click="ToPostBetting">立即购买</a>
57 57
         </div>
@@ -151,7 +151,9 @@ export default {
151 151
       TotalCount: 0, // 总注数
152 152
       TotalPrice: 0, // 总金额
153 153
       PageList: [],
154
-      DataLock: false
154
+      DataLock: false,
155
+      MaxPrice: 0,
156
+      MinPrice: 0
155 157
     }
156 158
   },
157 159
   computed: {
@@ -303,7 +305,35 @@ export default {
303 305
       this.TotalCount = GetAllParts([...ListData], PassTarget).sum
304 306
       this.TotalPrice = this.TotalCount * 2 * this.Multiple
305 307
       this.PriceArr = GetPrice(this.AllParts)
306
-      console.log(JSON.stringify(this.AllParts))
308
+      // console.log(this.AllParts)
309
+      let ResArr = []
310
+      this.AllParts.map((item, index) => {
311
+        ResArr.push([])
312
+        item.map((subItem, subIndex) => {
313
+          ResArr[index].push([])
314
+          subItem.map((cItem) => {
315
+            ResArr[index][subIndex].push({ odds: cItem.detail.odds - 0, id: cItem.matchId, ruleCode: cItem.detail.ruleCode })
316
+          })
317
+        })
318
+      })
319
+      // console.log(JSON.stringify(ResArr))
320
+      let MaxPrice = 0
321
+      let PrevPrice = null
322
+      ResArr.map((item, index) => {
323
+        let subItemPrice = 1
324
+        item.map((subItem, subIndex) => {
325
+          subItem.map((cItem) => {
326
+            subItemPrice *= cItem.odds
327
+          })
328
+          subItemPrice *= 2
329
+          if (PrevPrice === null || PrevPrice > subItemPrice) {
330
+            PrevPrice = subItemPrice - 0
331
+          }
332
+        })
333
+        MaxPrice += subItemPrice
334
+      })
335
+      this.MaxPrice = MaxPrice.toFixed(2)
336
+      this.MinPrice = PrevPrice.toFixed(2)
307 337
     },
308 338
     ReturnDeatilList (list, pid) {
309 339
       let Arr = []

+ 23
- 17
src/pages/index/ZuQiuDingDan/index.vue Voir le fichier

@@ -44,14 +44,14 @@
44 44
             <a @click="ShowStore = true">店铺:{{CurrentStoreName || '请选择'}}</a>
45 45
           </div>
46 46
           <div class="Chuan" v-if="$route.query.type === 'mix'">
47
-            <span @click="ShowPassWay = true">{{CurrentPassName || '请选择过关方式'}}</span>
47
+            <span @click="ShowPassWay = true">{{CurrentPassName || '请选择过关方式'}} <i class="iconfont iconjiantoudown"></i></span>
48 48
           </div>
49 49
           <div class="Count">
50 50
             <span>
51 51
               <em>{{TotalCount}}</em>注
52 52
             </span>
53 53
             <span>金额:<em>{{TotalPrice}}</em>牛币</span>
54
-            <span>预计奖金:<em>{{(PriceArr[0] * Multiple).toFixed(2)}} ~ {{(PriceArr[1] * Multiple).toFixed(2)}}</em>牛币</span>
54
+            <span>预计奖金:<em>{{(MinPrice * Multiple).toFixed(2)}} ~ {{(MaxPrice * Multiple).toFixed(2)}}</em>牛币</span>
55 55
           </div>
56 56
           <a :class="{'active': CurrentStoreId !== null && ZuQiuCart.length}" @click="ToPostBetting">立即购买</a>
57 57
         </div>
@@ -151,7 +151,9 @@ export default {
151 151
       TotalCount: 0, // 总注数
152 152
       TotalPrice: 0, // 总金额
153 153
       PageList: [],
154
-      DataLock: false
154
+      DataLock: false,
155
+      MaxPrice: 0,
156
+      MinPrice: 0
155 157
     }
156 158
   },
157 159
   computed: {
@@ -315,20 +317,24 @@ export default {
315 317
           })
316 318
         })
317 319
       })
318
-      console.log(JSON.stringify(ResArr))
319
-      // let PartsArr = this.AllParts
320
-      // let OddsArr = []
321
-      // PartsArr.map((item, index) => {
322
-      //   OddsArr.push([])
323
-      //   item.map((subItem, subIndex) => {
324
-      //     let Num = 1
325
-      //     subItem.map((cItem) => {
326
-      //       Num *= cItem.detail.odds - 0
327
-      //     })
328
-      //     OddsArr[index].push((Num * 2).toFixed(2) - 0)
329
-      //   })
330
-      // })
331
-      // console.log(JSON.stringify(OddsArr))
320
+      // console.log(JSON.stringify(ResArr))
321
+      let MaxPrice = 0
322
+      let PrevPrice = null
323
+      ResArr.map((item, index) => {
324
+        let subItemPrice = 1
325
+        item.map((subItem, subIndex) => {
326
+          subItem.map((cItem) => {
327
+            subItemPrice *= cItem.odds
328
+          })
329
+          subItemPrice *= 2
330
+          if (PrevPrice === null || PrevPrice > subItemPrice) {
331
+            PrevPrice = subItemPrice - 0
332
+          }
333
+        })
334
+        MaxPrice += subItemPrice
335
+      })
336
+      this.MaxPrice = MaxPrice.toFixed(2)
337
+      this.MinPrice = PrevPrice.toFixed(2)
332 338
     },
333 339
     ReturnDeatilList (list, pid) {
334 340
       let Arr = []

+ 5
- 0
src/store/user/index.js Voir le fichier

@@ -121,6 +121,11 @@ export default {
121 121
     }
122 122
   },
123 123
   actions: {
124
+    GetCurrentUserInfo (context, payload) { // 获取当前用户信息
125
+      return new Promise((resolve, reject) => {
126
+        ToolClass.Axios(resolve, reject, Api.GetCurrentUserInfo, context, payload, 1000)
127
+      })
128
+    },
124 129
     BindAliAccount (context, payload) { // 绑定支付宝
125 130
       return new Promise((resolve, reject) => {
126 131
         ToolClass.Axios(resolve, reject, Api.BindAliAccount, context, payload, 1000)

+ 4
- 0
src/util/Api.js Voir le fichier

@@ -2,6 +2,10 @@
2 2
 const prefix = process.env.NODE_ENV === 'production' ? '/api' : '/api'
3 3
 
4 4
 const $api = {
5
+  GetCurrentUserInfo: { // 获取当前用户信息
6
+    method: 'get',
7
+    url: `${prefix}/app/customer/current`
8
+  },
5 9
   BindAliAccount: { // 绑定支付宝
6 10
     method: 'post',
7 11
     url: `${prefix}/shop/alipay/auth/user`