xcx 4 vuotta sitten
vanhempi
commit
c82205b770

+ 1
- 1
index.html Näytä tiedosto

@@ -5,7 +5,7 @@
5 5
   <meta charset='utf-8'>
6 6
   <meta content='width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0' name='viewport'>
7 7
   <meta name="referrer" content="no-referrer">
8
-  <link rel="stylesheet" href="//at.alicdn.com/t/font_2022160_zgncjv2mcd.css">
8
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_2022160_w52az879v6.css">
9 9
   <title>牛彩</title>
10 10
   <script>
11 11
     let Width = document.documentElement.clientWidth / 375 * 100

+ 21
- 20
src/pages/index/DingDanZhiFuZhuangTai/index.vue Näytä tiedosto

@@ -2,7 +2,15 @@
2 2
   <div class="Page">
3 3
     <MainPageContainer :ShowMainHeader="true" :ShowMainHeaderBack="true" MainHeaderTitle="订单状态">
4 4
       <div class="PageContainer">
5
-        订单支付状态
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
+          <a v-if="OrderStatus === 'Error'" :href="`/api/app/order/alipay/buylottery?orderId=${$route.query.id}&returlURL=${LocationOrigin}&token=${Jwt}`">重新支付</a>
11
+          <router-link :to="{ name: 'index' }">返回首页</router-link>
12
+          <a @click="$router.go(-1)">继续投注</a>
13
+        </div>
6 14
       </div>
7 15
     </MainPageContainer>
8 16
   </div>
@@ -10,21 +18,18 @@
10 18
 
11 19
 <script>
12 20
 import MainPageContainer from '../../../components/common/MainPageContainer'
13
-import { mapState, mapActions, createNamespacedHelpers } from 'vuex'
14
-const { mapState: mapIndexState, mapActions: mapIndexActions, mapMutations: mapIndexMutations } = createNamespacedHelpers('index')
21
+import { createNamespacedHelpers } from 'vuex'
22
+const { mapActions: mapUserActions } = createNamespacedHelpers('user')
15 23
 export default {
16 24
   name: 'index',
17 25
   data () {
18 26
     return {
27
+      OrderStatus: null,
28
+      LocationOrigin: encodeURIComponent(`${window.location.origin}/#/index/DingDanZhiFuZhuangTai?orderId=${this.$route.query.id}`),
29
+      Jwt: window.localStorage.Jwt
19 30
     }
20 31
   },
21 32
   computed: {
22
-    ...mapState({
23
-      AllLotteryType: x => x.AllLotteryType // 所有彩种类型
24
-    }),
25
-    ...mapIndexState({
26
-      NewstLotteryRes: x => x.NewstLotteryRes // 最新数字彩开奖结果列表
27
-    })
28 33
   },
29 34
   components: {
30 35
     MainPageContainer
@@ -37,19 +42,15 @@ export default {
37 42
     })
38 43
   },
39 44
   methods: {
40
-    ...mapActions([
41
-      'GetAllLotteryType'
42
-    ]),
43
-    ...mapIndexActions([
44
-      'GetBanner',
45
-      'GetLotteryRes',
46
-      'GetNewstLotteryRes'
47
-    ]),
48
-    ...mapIndexMutations([
49
-      'EmptyBanner'
45
+    ...mapUserActions([
46
+      'GetAliPayStatus'
50 47
     ]),
51 48
     Init () { // 初始化
52
-
49
+      if (this.$route.query.id !== undefined) {
50
+        this.GetAliPayStatus({ urlData: { id: this.$route.query.id } }).then((res) => {
51
+          this.OrderStatus = res.data.data === 1 ? 'Success' : 'Error'
52
+        })
53
+      }
53 54
     }
54 55
   }
55 56
 }

+ 31
- 0
src/pages/index/DingDanZhiFuZhuangTai/page.scss Näytä tiedosto

@@ -8,5 +8,36 @@
8 8
     height: 100%;
9 9
     position: relative;
10 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
+    }
11 42
   }
12 43
 }

+ 5
- 0
src/store/user/index.js Näytä tiedosto

@@ -114,6 +114,11 @@ export default {
114 114
     }
115 115
   },
116 116
   actions: {
117
+    GetAliPayStatus (context, payload) { // 获取支付宝支付结果
118
+      return new Promise((resolve, reject) => {
119
+        ToolClass.Axios(resolve, reject, Api.GetAliPayStatus, context, payload, 1000)
120
+      })
121
+    },
117 122
     CreateAliPayOrder (context, payload) { // 创建支付宝订单
118 123
       return new Promise((resolve, reject) => {
119 124
         ToolClass.Axios(resolve, reject, Api.CreateAliPayOrder, context, payload, 1000)

+ 4
- 0
src/util/Api.js Näytä tiedosto

@@ -77,6 +77,10 @@ const $api = {
77 77
   UpdateUserInfo: { // 更新用户信息
78 78
     method: 'put',
79 79
     url: `${prefix}/app/customer/:id`
80
+  },
81
+  GetAliPayStatus: { // 获取支付宝支付结果
82
+    method: 'get',
83
+    url: `${prefix}/app/order/:id/paystatus`
80 84
   }
81 85
 }
82 86