Browse Source

静态页面

xcx 4 years ago
parent
commit
dac69c9b1c

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

56
       'EditUserInfo'
56
       'EditUserInfo'
57
     ]),
57
     ]),
58
     ...mapUserActions([
58
     ...mapUserActions([
59
-      'UpdateUserInfo'
59
+      'UpdateUserInfo',
60
+      'NewBindAliPay'
60
     ]),
61
     ]),
61
     Init () {
62
     Init () {
62
       this.AliAccount = (this.UserInfo || {}).alipayUser
63
       this.AliAccount = (this.UserInfo || {}).alipayUser
70
         this.DataLock = false
71
         this.DataLock = false
71
         return false
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
       }).catch((res) => {
84
       }).catch((res) => {
79
         this.Toast(res.data.message)
85
         this.Toast(res.data.message)
80
         this.DataLock = false
86
         this.DataLock = false

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

124
     }
124
     }
125
   },
125
   },
126
   actions: {
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
     AliPay (context, payload) { // 支付宝支付
132
     AliPay (context, payload) { // 支付宝支付
128
       return new Promise((resolve, reject) => {
133
       return new Promise((resolve, reject) => {
129
         ToolClass.Axios(resolve, reject, Api.AliPay, context, payload, 1000)
134
         ToolClass.Axios(resolve, reject, Api.AliPay, context, payload, 1000)

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

2
 const prefix = '/api'
2
 const prefix = '/api'
3
 
3
 
4
 const $api = {
4
 const $api = {
5
+  NewBindAliPay: { // 绑定支付宝(新)
6
+    method: 'post',
7
+    url: `${prefix}/app/:id/ali-pay`
8
+  },
5
   AliPay: { // 支付宝支付
9
   AliPay: { // 支付宝支付
6
     method: 'post',
10
     method: 'post',
7
     url: `${prefix}/app/alipay/deposit`
11
     url: `${prefix}/app/alipay/deposit`