Showing
4 changed files
with
140 additions
and
101 deletions
@@ -22,118 +22,130 @@ | @@ -22,118 +22,130 @@ | ||
22 | <script> | 22 | <script> |
23 | 23 | ||
24 | import { createNamespacedHelpers } from 'vuex'; | 24 | import { createNamespacedHelpers } from 'vuex'; |
25 | -import {Input, Button, Style} from 'cube-ui'; | 25 | +import { Input, Button, Style } from 'cube-ui'; |
26 | import myDialog from './components/bindModel'; | 26 | import myDialog from './components/bindModel'; |
27 | -const {mapState, mapActions} = createNamespacedHelpers('home/bindAccount'); | 27 | + |
28 | +const { mapState, mapActions } = createNamespacedHelpers('home/bindAccount'); | ||
29 | + | ||
28 | export default { | 30 | export default { |
29 | - data() { | ||
30 | - return { | ||
31 | - account: '', | ||
32 | - name: '', | ||
33 | - dialogShow: false | ||
34 | - } | 31 | + props: ['back'], |
32 | + data() { | ||
33 | + return { | ||
34 | + account: '', | ||
35 | + name: '', | ||
36 | + dialogShow: false | ||
37 | + }; | ||
38 | + }, | ||
39 | + computed: { | ||
40 | + ...mapState({ | ||
41 | + incomeData: (state) => state.assetData | ||
42 | + }), | ||
43 | + canSubmit() { | ||
44 | + return !(this.name && this.account); | ||
45 | + } | ||
46 | + }, | ||
47 | + created() { | ||
48 | + }, | ||
49 | + | ||
50 | + methods: { | ||
51 | + ...mapActions(['bindAliPayAccount']), | ||
52 | + submitBind() { | ||
53 | + this.dialogShow = true; | ||
35 | }, | 54 | }, |
36 | - computed:{ | ||
37 | - ...mapState({ | ||
38 | - incomeData: (state) => state.assetData | ||
39 | - }), | ||
40 | - canSubmit() { | ||
41 | - return !(this.name && this.account); | ||
42 | - } | 55 | + cancel() { |
56 | + this.dialogShow = false; | ||
43 | }, | 57 | }, |
44 | - created() { | 58 | + confirm() { |
59 | + this.bindAliPayAccount({ account: this.account, name: this.name }).then((data) => { | ||
60 | + this.dialogShow = false; | ||
61 | + if (data.code === 200) { | ||
62 | + if (this.back) { | ||
63 | + this.$router.replace({ | ||
64 | + name: this.back | ||
65 | + }) | ||
66 | + return; | ||
67 | + } | ||
68 | + this.$router.back(); | ||
69 | + } else { | ||
70 | + this.$createToast({ | ||
71 | + txt: data.message, | ||
72 | + time: 1500, | ||
73 | + type: 'txt' | ||
74 | + }).show(); | ||
75 | + } | ||
76 | + }); | ||
45 | }, | 77 | }, |
46 | - | ||
47 | - methods: { | ||
48 | - ...mapActions(['bindAliPayAccount']), | ||
49 | - submitBind() { | ||
50 | - this.dialogShow = true | ||
51 | - }, | ||
52 | - cancel() { | ||
53 | - this.dialogShow = false | ||
54 | - }, | ||
55 | - confirm() { | ||
56 | - this.bindAliPayAccount({account: this.account, name: this.name}).then((data) => { | ||
57 | - this.dialogShow = false; | ||
58 | - if (data.code === 200) { | ||
59 | - this.$router.back() | ||
60 | - } else { | ||
61 | - this.$createToast({ | ||
62 | - txt: data.message, | ||
63 | - time: 1500, | ||
64 | - type: 'txt' | ||
65 | - }).show(); | ||
66 | - } | ||
67 | - }) | ||
68 | - }, | ||
69 | 78 | ||
70 | - }, | ||
71 | - components: { | ||
72 | - Style, | ||
73 | - CubeInput: Input, | ||
74 | - CubeButton: Button, | ||
75 | - myDialog | ||
76 | - } | 79 | + }, |
80 | + components: { | ||
81 | + Style, | ||
82 | + CubeInput: Input, | ||
83 | + CubeButton: Button, | ||
84 | + myDialog | ||
85 | + } | ||
77 | }; | 86 | }; |
78 | </script> | 87 | </script> |
79 | 88 | ||
80 | <style lang="scss" scoped> | 89 | <style lang="scss" scoped> |
81 | .body { | 90 | .body { |
82 | - position: relative; | ||
83 | - height: 100%; | ||
84 | - overflow-y: auto; | ||
85 | - background-color: white; | ||
86 | - padding: 0 40px; | 91 | + position: relative; |
92 | + height: 100%; | ||
93 | + overflow-y: auto; | ||
94 | + background-color: white; | ||
95 | + padding: 0 40px; | ||
87 | } | 96 | } |
97 | + | ||
88 | .account-form { | 98 | .account-form { |
89 | - margin-top: 40px; | ||
90 | - } | 99 | + margin-top: 40px; |
100 | +} | ||
91 | 101 | ||
92 | - .form-title { | ||
93 | - font-size: 36px; | ||
94 | - padding-top: 40px; | ||
95 | - line-height: 1.6; | ||
96 | - font-weight: 500; | ||
97 | - } | 102 | +.form-title { |
103 | + font-size: 36px; | ||
104 | + padding-top: 40px; | ||
105 | + line-height: 1.6; | ||
106 | + font-weight: 500; | ||
107 | +} | ||
98 | 108 | ||
99 | - .form-input-block { | ||
100 | - padding-bottom: 16px; | ||
101 | - border-bottom: 1px solid #eee; | ||
102 | - position: relative; | ||
103 | - } | 109 | +.form-input-block { |
110 | + padding-bottom: 16px; | ||
111 | + border-bottom: 1px solid #eee; | ||
112 | + position: relative; | ||
113 | +} | ||
114 | + | ||
115 | +.account-input { | ||
116 | + &:after { | ||
117 | + border: 0; | ||
118 | + } | ||
119 | + | ||
120 | + /deep/ .cube-input-field { | ||
121 | + font-size: 14px; | ||
122 | + height: 40px; | ||
123 | + border: none; | ||
124 | + padding: 0; | ||
125 | + } | ||
126 | +} | ||
104 | 127 | ||
105 | - .account-input { | ||
106 | - &:after { | ||
107 | - border: 0; | ||
108 | - } | ||
109 | - | ||
110 | - /deep/ .cube-input-field { | ||
111 | - font-size: 14px; | ||
112 | - height: 40px; | ||
113 | - border: none; | ||
114 | - padding: 0; | ||
115 | - } | ||
116 | - } | ||
117 | .account-footer { | 128 | .account-footer { |
118 | - position: fixed; | ||
119 | - padding: 28px 0; | ||
120 | - left: 40px; | ||
121 | - right: 40px; | ||
122 | - bottom: 40px; | ||
123 | - .submit-btn { | ||
124 | - height: 88px; | ||
125 | - line-height: 88px; | ||
126 | - padding: 0; | ||
127 | - background: #022c46; | ||
128 | - border-radius: 44px; | ||
129 | - | ||
130 | - &:after { | ||
131 | - border: 0; | ||
132 | - } | ||
133 | - | ||
134 | - &.cube-btn_disabled { | ||
135 | - background: #ccc; | ||
136 | - } | 129 | + position: fixed; |
130 | + padding: 28px 0; | ||
131 | + left: 40px; | ||
132 | + right: 40px; | ||
133 | + bottom: 40px; | ||
134 | + | ||
135 | + .submit-btn { | ||
136 | + height: 88px; | ||
137 | + line-height: 88px; | ||
138 | + padding: 0; | ||
139 | + background: #022c46; | ||
140 | + border-radius: 44px; | ||
141 | + | ||
142 | + &:after { | ||
143 | + border: 0; | ||
144 | + } | ||
145 | + | ||
146 | + &.cube-btn_disabled { | ||
147 | + background: #ccc; | ||
137 | } | 148 | } |
138 | } | 149 | } |
150 | +} | ||
139 | </style> | 151 | </style> |
1 | export default [{ | 1 | export default [{ |
2 | name: 'bindAccount', | 2 | name: 'bindAccount', |
3 | path: '/xianyu/home/bindAccount.html', | 3 | path: '/xianyu/home/bindAccount.html', |
4 | - component: () => import(/* webpackChunkName: "bindAccount" */ './bindAccount') | 4 | + component: () => import(/* webpackChunkName: "bindAccount" */ './bindAccount'), |
5 | + props: (route) => ({ back: route.query.back }) | ||
5 | }]; | 6 | }]; |
@@ -6,10 +6,10 @@ | @@ -6,10 +6,10 @@ | ||
6 | </div> | 6 | </div> |
7 | <div class="title">支付成功</div> | 7 | <div class="title">支付成功</div> |
8 | 8 | ||
9 | - <div class="desc">如卖家原因导致交易失败,您可获赔付200元保证金,建议您设置支付宝账号作为赔偿收款账户,如未绑定银行卡则视为放弃赔偿</div> | 9 | + <div class="desc">如卖家原因导致交易失败,您可以获得相应赔偿金,具体金额参考《买家须知》。建议您设置支付宝账号作为赔偿收款账户,如未绑定支付宝账号视为放弃赔偿。</div> |
10 | 10 | ||
11 | <div class="btn-wrap"> | 11 | <div class="btn-wrap"> |
12 | - <YohoButton :txt="txt" class="btn-class" @click="onClick"></YohoButton> | 12 | + <YohoButton :txt="authorizeFlag ? txt : txt1" class="btn-class" @click="onClick"></YohoButton> |
13 | </div> | 13 | </div> |
14 | 14 | ||
15 | <div class="info"> | 15 | <div class="info"> |
@@ -28,8 +28,10 @@ | @@ -28,8 +28,10 @@ | ||
28 | 28 | ||
29 | import ProductList from '../list/components/productList'; | 29 | import ProductList from '../list/components/productList'; |
30 | import { createNamespacedHelpers } from 'vuex'; | 30 | import { createNamespacedHelpers } from 'vuex'; |
31 | +import { get } from 'lodash'; | ||
31 | 32 | ||
32 | const { mapActions: mapProductAction } = createNamespacedHelpers('product'); | 33 | const { mapActions: mapProductAction } = createNamespacedHelpers('product'); |
34 | +const { mapActions: mapOrderConfirmAction } = createNamespacedHelpers('order/orderConfirm'); | ||
33 | 35 | ||
34 | export default { | 36 | export default { |
35 | name: 'BuyPayOk', | 37 | name: 'BuyPayOk', |
@@ -40,25 +42,45 @@ export default { | @@ -40,25 +42,45 @@ export default { | ||
40 | data() { | 42 | data() { |
41 | return { | 43 | return { |
42 | txt: '返回首页', | 44 | txt: '返回首页', |
45 | + txt1: '绑定支付宝', | ||
46 | + authorizeFlag: false, | ||
43 | productList: [] | 47 | productList: [] |
44 | }; | 48 | }; |
45 | }, | 49 | }, |
46 | - mounted() { | 50 | + activated() { |
47 | if (this.productId) { | 51 | if (this.productId) { |
48 | this.fetchRecommendProduct({ productId: this.productId }).then(result => { | 52 | this.fetchRecommendProduct({ productId: this.productId }).then(result => { |
49 | this.productList = result; | 53 | this.productList = result; |
50 | }); | 54 | }); |
51 | } | 55 | } |
56 | + | ||
57 | + // this.fetchAlipayStatus().then(result => { | ||
58 | + // this.authorizeFlag = get(result, 'data.authorizeFlag', false); | ||
59 | + // }); | ||
52 | }, | 60 | }, |
61 | + computed: {}, | ||
53 | methods: { | 62 | methods: { |
54 | ...mapProductAction(['fetchRecommendProduct']), | 63 | ...mapProductAction(['fetchRecommendProduct']), |
64 | + ...mapOrderConfirmAction(['fetchAlipayStatus']), | ||
55 | onClick() { | 65 | onClick() { |
56 | - this.goHome(); | 66 | + if (this.authorizeFlag) { |
67 | + this.goHome(); | ||
68 | + } else { | ||
69 | + this.goBindAccount(); | ||
70 | + } | ||
57 | }, | 71 | }, |
58 | goHome() { | 72 | goHome() { |
59 | this.$router.replace({ | 73 | this.$router.replace({ |
60 | name: 'ChannelPage' | 74 | name: 'ChannelPage' |
61 | }); | 75 | }); |
76 | + }, | ||
77 | + goBindAccount() { | ||
78 | + this.$router.replace({ | ||
79 | + name: 'bindAccount', | ||
80 | + query: { | ||
81 | + back: 'ChannelPage' | ||
82 | + } | ||
83 | + }); | ||
62 | } | 84 | } |
63 | } | 85 | } |
64 | }; | 86 | }; |
@@ -87,7 +109,7 @@ export default { | @@ -87,7 +109,7 @@ export default { | ||
87 | .btn-class { | 109 | .btn-class { |
88 | height: 88px; | 110 | height: 88px; |
89 | font-size: 32px; | 111 | font-size: 32px; |
90 | - line-height: 100px; | 112 | + line-height: 88px; |
91 | } | 113 | } |
92 | 114 | ||
93 | .desc { | 115 | .desc { |
@@ -231,6 +231,10 @@ export default function() { | @@ -231,6 +231,10 @@ export default function() { | ||
231 | return this.$api.post('/api/order/user/status'); | 231 | return this.$api.post('/api/order/user/status'); |
232 | }, | 232 | }, |
233 | 233 | ||
234 | + async fetchAlipayStatus() { | ||
235 | + return this.$api.post('/api/order/alipay/status'); | ||
236 | + }, | ||
237 | + | ||
234 | async submitOrder({ commit }, payload) { | 238 | async submitOrder({ commit }, payload) { |
235 | return this.$api.post('/api/order/presubmit', payload); | 239 | return this.$api.post('/api/order/presubmit', payload); |
236 | }, | 240 | }, |
-
Please register or login to post a comment