张延森 4 年之前
父節點
當前提交
4d6c8fe62b

+ 2
- 7
config/index.js 查看文件

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

+ 1
- 1
src/pages/WoDe/ChongZhi/index.vue 查看文件

60
         this.Toast('充值牛逼数量必须为正整数')
60
         this.Toast('充值牛逼数量必须为正整数')
61
         return false
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 查看文件

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

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

+ 34
- 4
src/pages/index/LanQiuDingDan/index.vue 查看文件

44
             <a @click="ShowStore = true">店铺:{{CurrentStoreName || '请选择'}}</a>
44
             <a @click="ShowStore = true">店铺:{{CurrentStoreName || '请选择'}}</a>
45
           </div>
45
           </div>
46
           <div class="Chuan" v-if="$route.query.type === 'mix'">
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
           </div>
48
           </div>
49
           <div class="Count">
49
           <div class="Count">
50
             <span>
50
             <span>
51
               <em>{{TotalCount}}</em>注
51
               <em>{{TotalCount}}</em>注
52
             </span>
52
             </span>
53
             <span>金额:<em>{{TotalPrice}}</em>牛币</span>
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
           </div>
55
           </div>
56
           <a :class="{'active': CurrentStoreId !== null && LanQiuCart.length}" @click="ToPostBetting">立即购买</a>
56
           <a :class="{'active': CurrentStoreId !== null && LanQiuCart.length}" @click="ToPostBetting">立即购买</a>
57
         </div>
57
         </div>
151
       TotalCount: 0, // 总注数
151
       TotalCount: 0, // 总注数
152
       TotalPrice: 0, // 总金额
152
       TotalPrice: 0, // 总金额
153
       PageList: [],
153
       PageList: [],
154
-      DataLock: false
154
+      DataLock: false,
155
+      MaxPrice: 0,
156
+      MinPrice: 0
155
     }
157
     }
156
   },
158
   },
157
   computed: {
159
   computed: {
303
       this.TotalCount = GetAllParts([...ListData], PassTarget).sum
305
       this.TotalCount = GetAllParts([...ListData], PassTarget).sum
304
       this.TotalPrice = this.TotalCount * 2 * this.Multiple
306
       this.TotalPrice = this.TotalCount * 2 * this.Multiple
305
       this.PriceArr = GetPrice(this.AllParts)
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
     ReturnDeatilList (list, pid) {
338
     ReturnDeatilList (list, pid) {
309
       let Arr = []
339
       let Arr = []

+ 23
- 17
src/pages/index/ZuQiuDingDan/index.vue 查看文件

44
             <a @click="ShowStore = true">店铺:{{CurrentStoreName || '请选择'}}</a>
44
             <a @click="ShowStore = true">店铺:{{CurrentStoreName || '请选择'}}</a>
45
           </div>
45
           </div>
46
           <div class="Chuan" v-if="$route.query.type === 'mix'">
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
           </div>
48
           </div>
49
           <div class="Count">
49
           <div class="Count">
50
             <span>
50
             <span>
51
               <em>{{TotalCount}}</em>注
51
               <em>{{TotalCount}}</em>注
52
             </span>
52
             </span>
53
             <span>金额:<em>{{TotalPrice}}</em>牛币</span>
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
           </div>
55
           </div>
56
           <a :class="{'active': CurrentStoreId !== null && ZuQiuCart.length}" @click="ToPostBetting">立即购买</a>
56
           <a :class="{'active': CurrentStoreId !== null && ZuQiuCart.length}" @click="ToPostBetting">立即购买</a>
57
         </div>
57
         </div>
151
       TotalCount: 0, // 总注数
151
       TotalCount: 0, // 总注数
152
       TotalPrice: 0, // 总金额
152
       TotalPrice: 0, // 总金额
153
       PageList: [],
153
       PageList: [],
154
-      DataLock: false
154
+      DataLock: false,
155
+      MaxPrice: 0,
156
+      MinPrice: 0
155
     }
157
     }
156
   },
158
   },
157
   computed: {
159
   computed: {
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
     ReturnDeatilList (list, pid) {
339
     ReturnDeatilList (list, pid) {
334
       let Arr = []
340
       let Arr = []

+ 5
- 0
src/store/user/index.js 查看文件

121
     }
121
     }
122
   },
122
   },
123
   actions: {
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
     BindAliAccount (context, payload) { // 绑定支付宝
129
     BindAliAccount (context, payload) { // 绑定支付宝
125
       return new Promise((resolve, reject) => {
130
       return new Promise((resolve, reject) => {
126
         ToolClass.Axios(resolve, reject, Api.BindAliAccount, context, payload, 1000)
131
         ToolClass.Axios(resolve, reject, Api.BindAliAccount, context, payload, 1000)

+ 4
- 0
src/util/Api.js 查看文件

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