Browse Source

静态页面

xcx 4 years ago
parent
commit
dac69c9b1c

+ 12
- 6
src/pages/WoDe/GeRenSheZhi/ZhangHuSheZhi/BangDingZhiFuBao/index.vue View File

@@ -56,7 +56,8 @@ export default {
56 56
       'EditUserInfo'
57 57
     ]),
58 58
     ...mapUserActions([
59
-      'UpdateUserInfo'
59
+      'UpdateUserInfo',
60
+      'NewBindAliPay'
60 61
     ]),
61 62
     Init () {
62 63
       this.AliAccount = (this.UserInfo || {}).alipayUser
@@ -70,11 +71,16 @@ export default {
70 71
         this.DataLock = false
71 72
         return false
72 73
       }
73
-      this.UpdateUserInfo({ urlData: { id: this.UserInfo.customerId }, data: { alipayUser: this.AliAccount, realName: this.RealName } }).then(() => {
74
-        this.Toast('绑定支付宝成功')
75
-        this.EditUserInfo({ name: 'alipayUser', value: this.AliAccount }, { name: 'realName', value: this.RealName })
76
-        this.DataLock = false
77
-        this.$router.go(-1)
74
+      this.NewBindAliPay({ urlData: { id: this.UserInfo.customerId }, data: { loginId: this.AliAccount, realName: this.RealName } }).then(() => {
75
+        this.UpdateUserInfo({ urlData: { id: this.UserInfo.customerId }, data: { alipayUser: this.AliAccount, realName: this.RealName } }).then(() => {
76
+          this.Toast('绑定支付宝成功')
77
+          this.EditUserInfo({ name: 'alipayUser', value: this.AliAccount }, { name: 'realName', value: this.RealName })
78
+          this.DataLock = false
79
+          this.$router.go(-1)
80
+        }).catch((res) => {
81
+          this.Toast(res.data.message)
82
+          this.DataLock = false
83
+        })
78 84
       }).catch((res) => {
79 85
         this.Toast(res.data.message)
80 86
         this.DataLock = false

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

@@ -124,6 +124,11 @@ export default {
124 124
     }
125 125
   },
126 126
   actions: {
127
+    NewBindAliPay (context, payload) { // 绑定支付宝(新)
128
+      return new Promise((resolve, reject) => {
129
+        ToolClass.Axios(resolve, reject, Api.NewBindAliPay, context, payload, 1000)
130
+      })
131
+    },
127 132
     AliPay (context, payload) { // 支付宝支付
128 133
       return new Promise((resolve, reject) => {
129 134
         ToolClass.Axios(resolve, reject, Api.AliPay, 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
+  NewBindAliPay: { // 绑定支付宝(新)
6
+    method: 'post',
7
+    url: `${prefix}/app/:id/ali-pay`
8
+  },
5 9
   AliPay: { // 支付宝支付
6 10
     method: 'post',
7 11
     url: `${prefix}/app/alipay/deposit`