Browse Source

静态页面

xcx 4 years ago
parent
commit
9edb6ba08f
3 changed files with 18 additions and 3 deletions
  1. 9
    3
      src/pages/PaiJiang/PaiJiangGuanLi/index.vue
  2. 5
    0
      src/store/user/index.js
  3. 4
    0
      src/util/Api.js

+ 9
- 3
src/pages/PaiJiang/PaiJiangGuanLi/index.vue View File

@@ -74,7 +74,6 @@ import 'swiper/dist/css/swiper.css'
74 74
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
75 75
 import { createNamespacedHelpers } from 'vuex'
76 76
 import MainPageContainer from '../../../components/common/MainPageContainer'
77
-import { APIBase } from '@/util/constant'
78 77
 
79 78
 const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
80 79
 export default {
@@ -134,7 +133,8 @@ export default {
134 133
     ]),
135 134
     ...mapUserActions([
136 135
       'GetCurrentShopOrderList',
137
-      'SendPrize'
136
+      'SendPrize',
137
+      'AliPay'
138 138
     ]),
139 139
     SendMoney () { // 派奖
140 140
       if (this.DataLock || this.SelectNum === 0) return
@@ -145,7 +145,13 @@ export default {
145 145
           CurrentOrder = { ...item }
146 146
         }
147 147
       })
148
-      window.location.href = `${APIBase}api/shop/sent-award/order/${CurrentOrder.orderId}?returlURL=${encodeURIComponent(`${window.location.origin}/#/PaiJiang/PaiJiangGuanLi`)}&token=${window.localStorage.Jwt}`
148
+      this.AliPay({ urlData: { orderId: CurrentOrder.orderId }, queryData: { returlURL: encodeURIComponent(`${window.location.origin}/#/PaiJiang/PaiJiangGuanLi`) } }).then((res) => {
149
+        this.DataLock = false
150
+        window.location.href = res.data.data.payUrl
151
+      }).catch((res) => {
152
+        this.DataLock = false
153
+      })
154
+      // window.location.href = `${APIBase}api/shop/sent-award/order/${CurrentOrder.orderId}?returlURL=${encodeURIComponent(`${window.location.origin}/#/PaiJiang/PaiJiangGuanLi`)}&token=${window.localStorage.Jwt}`
149 155
       // this.SendPrize({ urlData: { id: OrderId.join(',') } }).then(() => {
150 156
       //   this.Toast('派奖成功')
151 157
       //   this.PageList.splice(Index, 1)

+ 5
- 0
src/store/user/index.js View File

@@ -79,6 +79,11 @@ export default {
79 79
     }
80 80
   },
81 81
   actions: {
82
+    AliPay (context, payload) { // 支付宝支付
83
+      return new Promise((resolve, reject) => {
84
+        ToolClass.Axios(resolve, reject, Api.AliPay, context, payload, 1000)
85
+      })
86
+    },
82 87
     ResetPassword (context, payload) { // 重置密码
83 88
       return new Promise((resolve, reject) => {
84 89
         ToolClass.Axios(resolve, reject, Api.ResetPassword, context, payload, 1000)

+ 4
- 0
src/util/Api.js View File

@@ -2,6 +2,10 @@
2 2
 const prefix = '/api'
3 3
 
4 4
 const $api = {
5
+  AliPay: { // 支付宝支付
6
+    method: 'post',
7
+    url: `${prefix}/shop/sent-award/order/:orderId`
8
+  },
5 9
   ResetPassword: { // 重置密码
6 10
     method: 'put',
7 11
     url: `${prefix}/shop/reset-password`