1002884655 4 gadus atpakaļ
vecāks
revīzija
ee9e64b70e

+ 7
- 7
config/index.js Parādīt failu

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

+ 11
- 24
src/pages/WoDe/ChongZhi/index.vue Parādīt failu

@@ -7,7 +7,7 @@
7 7
           <input type="number" placeholder="请输入充值牛币数量" v-model="Amount">
8 8
         </div>
9 9
         <div class="Btn">
10
-          <a @click="ToCashOut">确定</a>
10
+          <a @click="ToPayForAli">确定</a>
11 11
         </div>
12 12
       </div>
13 13
     </MainPageContainer>
@@ -15,7 +15,6 @@
15 15
 </template>
16 16
 
17 17
 <script>
18
-import md5 from 'js-md5'
19 18
 import MainPageContainer from '../../../components/common/MainPageContainer'
20 19
 import { createNamespacedHelpers } from 'vuex'
21 20
 const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
@@ -52,28 +51,16 @@ export default {
52 51
     ]),
53 52
     Init () {
54 53
     },
55
-    ToCashOut () {
56
-      // if (this.Amount === '') {
57
-      //   this.Toast('提现金额不能为空')
58
-      //   return false
59
-      // }
60
-      // if (this.Amount - 0 > this.UserInfo.account.cash - 0) {
61
-      //   this.Toast('提现金额不能大于账户余额')
62
-      //   return false
63
-      // }
64
-      // if (this.Password === '') {
65
-      //   this.Toast('提现密码不能为空')
66
-      //   return false
67
-      // }
68
-      if (this.DataLock) return
69
-      this.DataLock = true
70
-      this.CashOut({ data: { amount: this.Amount * 100, cashPass: md5(this.Password) } }).then((res) => {
71
-        this.Toast('提现成功')
72
-        this.DataLock = false
73
-      }).catch((res) => {
74
-        this.Toast(res.data.message)
75
-        this.DataLock = false
76
-      })
54
+    ToPayForAli () {
55
+      if (this.Amount === '') {
56
+        this.Toast('充值牛逼数量不能为空')
57
+        return false
58
+      }
59
+      if (this.Amount - 0) {
60
+        this.Toast('充值牛逼数量必须为正整数')
61
+        return false
62
+      }
63
+      window.location.href = `/api/app/alipay/deposit?amount=${this.Amount - 0}&returlURL=${encodeURIComponent(`${window.location.origin}/#/WoDe/ChongZhiZhuangTai`)}&token=${window.localStorage.Jwt}`
77 64
     }
78 65
   }
79 66
 }

+ 59
- 0
src/pages/WoDe/ChongZhiZhuangTai/index.vue Parādīt failu

@@ -0,0 +1,59 @@
1
+<template>
2
+  <div class="Page">
3
+    <MainPageContainer @UserInfoChange="Init" :ShowMainHeader="true" MainHeaderTitle="订单状态" :ShowMainHeaderRight="true" :MainHeaderRightText="`完成`" :MainHeaderRightClick="() => { $router.push({ name: 'index' }) }">
4
+      <div class="PageContainer">
5
+        <div class="centerLabel">
6
+          <i class="iconfont iconshibai" v-if="OrderStatus === 'Error'"></i>
7
+          <span v-if="OrderStatus === 'Error'">待支付</span>
8
+          <i class="iconfont iconchenggong active" v-if="OrderStatus === 'Success'"></i>
9
+          <span v-if="OrderStatus === 'Success'">支付成功</span>
10
+          <router-link :to="{ name: 'index' }">返回首页</router-link>
11
+        </div>
12
+      </div>
13
+    </MainPageContainer>
14
+  </div>
15
+</template>
16
+
17
+<script>
18
+import MainPageContainer from '../../../components/common/MainPageContainer'
19
+import { createNamespacedHelpers } from 'vuex'
20
+const { mapActions: mapUserActions } = createNamespacedHelpers('user')
21
+export default {
22
+  name: 'index',
23
+  data () {
24
+    return {
25
+      OrderStatus: null,
26
+      LocationOrigin: encodeURIComponent(`${window.location.origin}/#/index/DingDanZhiFuZhuangTai?orderId=${this.$route.query.id}`),
27
+      Jwt: window.localStorage.Jwt
28
+    }
29
+  },
30
+  computed: {
31
+  },
32
+  components: {
33
+    MainPageContainer
34
+  },
35
+  created () {
36
+  },
37
+  mounted () {
38
+    this.$nextTick(() => {
39
+    })
40
+  },
41
+  methods: {
42
+    ...mapUserActions([
43
+      'GetAliPayStatus'
44
+    ]),
45
+    Init () { // 初始化
46
+      if (this.$route.query.orderId !== undefined) {
47
+        this.GetAliPayStatus({ urlData: { id: this.$route.query.orderId } }).then((res) => {
48
+          this.OrderStatus = res.data.data === 1 ? 'Success' : 'Error'
49
+        })
50
+      }
51
+    }
52
+  }
53
+}
54
+</script>
55
+
56
+<!-- Add "scoped" attribute to limit CSS to this component only -->
57
+<style lang="scss" scoped>
58
+@import "page.scss";
59
+</style>

+ 43
- 0
src/pages/WoDe/ChongZhiZhuangTai/page.scss Parādīt failu

@@ -0,0 +1,43 @@
1
+.Page {
2
+  width: 100%;
3
+  height: 100%;
4
+  position: relative;
5
+  overflow: hidden;
6
+  .PageContainer {
7
+    width: 100%;
8
+    height: 100%;
9
+    position: relative;
10
+    overflow: hidden;
11
+    > div {
12
+      width: 100%;
13
+      text-align: center;
14
+      > i {
15
+        font-size: 1rem;
16
+        color: #f10404;
17
+        &.active {
18
+          color: #39ce09;
19
+        }
20
+      }
21
+      > span {
22
+        display: block;
23
+        text-align: center;
24
+        font-size: 0.14rem;
25
+        line-height: 0.2rem;
26
+        margin-top: 0.2rem;
27
+        + a {
28
+          margin-top: 0.4rem;
29
+        }
30
+      }
31
+      > a {
32
+        width: 80%;
33
+        display: block;
34
+        font-size: 0.14rem;
35
+        color: #fff;
36
+        line-height: 0.4rem;
37
+        border-radius: 0.06rem;
38
+        background: #ff5100;
39
+        margin: 0.2rem auto 0;
40
+      }
41
+    }
42
+  }
43
+}

+ 4
- 1
src/pages/index/DaLeTouDingDan/index.vue Parādīt failu

@@ -222,10 +222,13 @@ export default {
222 222
         this.TotalPrize = 0
223 223
         this.Multiple = 1
224 224
         this.DataLock = false
225
-        window.location.href = `/api/app/order/alipay/betting?orderId=${res.data.data.orderId}&returlURL=${encodeURIComponent(`${window.location.origin}/#/index/DingDanZhiFuZhuangTai?orderId=${res.data.data.orderId}&bettingId=${res.data.data.bettingId}`)}&token=${window.localStorage.Jwt}&routerName=DaLeTou`
225
+        this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId } })
226 226
       }).catch((res) => {
227 227
         this.Toast(res.data.message)
228 228
         this.DataLock = false
229
+        if (res.data.code - 0 === 1003) {
230
+          this.$router.push({ name: 'ChongZhi' })
231
+        }
229 232
       })
230 233
     },
231 234
     SwitchChange () { // 追加状态改变

+ 1
- 1
src/pages/index/DingDanZhiFuZhuangTai/index.vue Parādīt failu

@@ -7,7 +7,7 @@
7 7
           <span v-if="OrderStatus === 'Error'">待支付</span>
8 8
           <i class="iconfont iconchenggong active" v-if="OrderStatus === 'Success'"></i>
9 9
           <span v-if="OrderStatus === 'Success'">支付成功</span>
10
-          <a v-if="OrderStatus === 'Error'" :href="`/api/app/order/alipay/betting?orderId=${$route.query.id}&returlURL=${LocationOrigin}&token=${Jwt}&routerName=${$route.query.routerName}`">重新支付</a>
10
+          <!-- <a v-if="OrderStatus === 'Error'" :href="`/api/app/order/alipay/betting?orderId=${$route.query.id}&returlURL=${LocationOrigin}&token=${Jwt}&routerName=${$route.query.routerName}`">重新支付</a> -->
11 11
           <router-link :to="{ name: 'index' }">返回首页</router-link>
12 12
           <router-link :to="{ name: 'CaiPiaoXiangQing', query: { id: $route.query.bettingId } }">查看投注</router-link>
13 13
         </div>

+ 7
- 0
src/router/index.js Parādīt failu

@@ -367,6 +367,13 @@ let router = new Router({
367 367
             component: resolve => {
368 368
               require(['@/pages/WoDe/ChongZhi'], RouterLoading.resolve(resolve))
369 369
             }
370
+          },
371
+          {
372
+            path: '/WoDe/ChongZhiZhuangTai', // 充值状态
373
+            name: 'ChongZhiZhuangTai',
374
+            component: resolve => {
375
+              require(['@/pages/WoDe/ChongZhiZhuangTai'], RouterLoading.resolve(resolve))
376
+            }
370 377
           }
371 378
         ]
372 379
       },