xcx преди 4 години
родител
ревизия
9edb6ba08f
променени са 3 файла, в които са добавени 18 реда и са изтрити 3 реда
  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 Целия файл

74
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
74
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
75
 import { createNamespacedHelpers } from 'vuex'
75
 import { createNamespacedHelpers } from 'vuex'
76
 import MainPageContainer from '../../../components/common/MainPageContainer'
76
 import MainPageContainer from '../../../components/common/MainPageContainer'
77
-import { APIBase } from '@/util/constant'
78
 
77
 
79
 const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
78
 const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
80
 export default {
79
 export default {
134
     ]),
133
     ]),
135
     ...mapUserActions([
134
     ...mapUserActions([
136
       'GetCurrentShopOrderList',
135
       'GetCurrentShopOrderList',
137
-      'SendPrize'
136
+      'SendPrize',
137
+      'AliPay'
138
     ]),
138
     ]),
139
     SendMoney () { // 派奖
139
     SendMoney () { // 派奖
140
       if (this.DataLock || this.SelectNum === 0) return
140
       if (this.DataLock || this.SelectNum === 0) return
145
           CurrentOrder = { ...item }
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
       // this.SendPrize({ urlData: { id: OrderId.join(',') } }).then(() => {
155
       // this.SendPrize({ urlData: { id: OrderId.join(',') } }).then(() => {
150
       //   this.Toast('派奖成功')
156
       //   this.Toast('派奖成功')
151
       //   this.PageList.splice(Index, 1)
157
       //   this.PageList.splice(Index, 1)

+ 5
- 0
src/store/user/index.js Целия файл

79
     }
79
     }
80
   },
80
   },
81
   actions: {
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
     ResetPassword (context, payload) { // 重置密码
87
     ResetPassword (context, payload) { // 重置密码
83
       return new Promise((resolve, reject) => {
88
       return new Promise((resolve, reject) => {
84
         ToolClass.Axios(resolve, reject, Api.ResetPassword, context, payload, 1000)
89
         ToolClass.Axios(resolve, reject, Api.ResetPassword, context, payload, 1000)

+ 4
- 0
src/util/Api.js Целия файл

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