Showing
6 changed files
with
29 additions
and
8 deletions
@@ -55,7 +55,15 @@ export default { | @@ -55,7 +55,15 @@ export default { | ||
55 | confirm() { | 55 | confirm() { |
56 | this.bindAliPayAccount({account: this.account, name: this.name}).then((data) => { | 56 | this.bindAliPayAccount({account: this.account, name: this.name}).then((data) => { |
57 | this.dialogShow = false; | 57 | this.dialogShow = false; |
58 | + if (data.code === 200) { | ||
58 | this.$router.back() | 59 | this.$router.back() |
60 | + } else { | ||
61 | + this.$createToast({ | ||
62 | + txt: data.message, | ||
63 | + time: 1500, | ||
64 | + type: 'txt' | ||
65 | + }).show(); | ||
66 | + } | ||
59 | }) | 67 | }) |
60 | }, | 68 | }, |
61 | 69 |
@@ -11,7 +11,10 @@ const {mapState, mapActions} = createNamespacedHelpers('home/bindAccount'); | @@ -11,7 +11,10 @@ const {mapState, mapActions} = createNamespacedHelpers('home/bindAccount'); | ||
11 | export default { | 11 | export default { |
12 | name: 'bind', | 12 | name: 'bind', |
13 | props: { | 13 | props: { |
14 | - | 14 | + data: { |
15 | + type: Object, | ||
16 | + default: {} | ||
17 | + } | ||
15 | }, | 18 | }, |
16 | data() { | 19 | data() { |
17 | return { | 20 | return { |
@@ -28,7 +31,7 @@ export default { | @@ -28,7 +31,7 @@ export default { | ||
28 | methods: { | 31 | methods: { |
29 | ...mapActions(['fetchUserAliPayAccount']), | 32 | ...mapActions(['fetchUserAliPayAccount']), |
30 | goBind() { | 33 | goBind() { |
31 | - this.$router.push({name:'bindAccount'}) | 34 | + this.$router.push({name:this.data.page}) |
32 | } | 35 | } |
33 | } | 36 | } |
34 | 37 |
1 | <template> | 1 | <template> |
2 | <div class="single-image"> | 2 | <div class="single-image"> |
3 | - <LayoutLink :href="data.url" class="link"> | 3 | + <LayoutLink :href="data.url" class="link" v-if="data.src"> |
4 | <img :src="data.src" :alt="data.title" class="img" :style="style"> | 4 | <img :src="data.src" :alt="data.title" class="img" :style="style"> |
5 | </LayoutLink> | 5 | </LayoutLink> |
6 | </div> | 6 | </div> |
@@ -16,9 +16,10 @@ | @@ -16,9 +16,10 @@ | ||
16 | <div v-else-if="key === 'sale'" class="bg-top"> | 16 | <div v-else-if="key === 'sale'" class="bg-top"> |
17 | <tab-item :data="value" noLine titleBold titleSmall></tab-item> | 17 | <tab-item :data="value" noLine titleBold titleSmall></tab-item> |
18 | </div> | 18 | </div> |
19 | + <bind v-else-if="key === 'bindAccount'" :data="value"></bind> | ||
19 | <tab-item v-else :data="value"></tab-item> | 20 | <tab-item v-else :data="value"></tab-item> |
20 | </div> | 21 | </div> |
21 | - <bind></bind> | 22 | + |
22 | </div> | 23 | </div> |
23 | </LayoutApp> | 24 | </LayoutApp> |
24 | </template> | 25 | </template> |
@@ -35,11 +35,8 @@ export default function() { | @@ -35,11 +35,8 @@ export default function() { | ||
35 | certName: name | 35 | certName: name |
36 | }); | 36 | }); |
37 | 37 | ||
38 | - if (result.code === 200) { | ||
39 | // commit('addUserAliPayAccount', result.data); | 38 | // commit('addUserAliPayAccount', result.data); |
40 | return result; | 39 | return result; |
41 | - } | ||
42 | - | ||
43 | }, | 40 | }, |
44 | }, | 41 | }, |
45 | }; | 42 | }; |
@@ -102,6 +102,7 @@ export default function() { | @@ -102,6 +102,7 @@ export default function() { | ||
102 | resource1: { name: 'resource1', data: state.resource1 }, | 102 | resource1: { name: 'resource1', data: state.resource1 }, |
103 | income: { | 103 | income: { |
104 | title: '我的收入', | 104 | title: '我的收入', |
105 | + | ||
105 | // num: state.userWalletInfo.walletAmount, // 钱包余额 | 106 | // num: state.userWalletInfo.walletAmount, // 钱包余额 |
106 | num: state.assetData.totalIncome, | 107 | num: state.assetData.totalIncome, |
107 | page: 'tradeIncome', | 108 | page: 'tradeIncome', |
@@ -135,6 +136,10 @@ export default function() { | @@ -135,6 +136,10 @@ export default function() { | ||
135 | title: '我的客服', | 136 | title: '我的客服', |
136 | page: 'service' | 137 | page: 'service' |
137 | }, | 138 | }, |
139 | + bindAccount: { | ||
140 | + name: 'bindAccount', | ||
141 | + page: 'bindAccount' | ||
142 | + }, | ||
138 | resource2: { name: 'resource2', data: state.resource2 }, | 143 | resource2: { name: 'resource2', data: state.resource2 }, |
139 | 144 | ||
140 | }; | 145 | }; |
@@ -312,6 +317,7 @@ export default function() { | @@ -312,6 +317,7 @@ export default function() { | ||
312 | }); | 317 | }); |
313 | 318 | ||
314 | if (result.code === 200) { | 319 | if (result.code === 200) { |
320 | + if (result.data.length !== 0) { | ||
315 | let src = getImgUrl( | 321 | let src = getImgUrl( |
316 | get(result, 'data[0].data[0].src') || '', | 322 | get(result, 'data[0].data[0].src') || '', |
317 | 1000, | 323 | 1000, |
@@ -319,9 +325,14 @@ export default function() { | @@ -319,9 +325,14 @@ export default function() { | ||
319 | ); | 325 | ); |
320 | 326 | ||
321 | set(result, 'data[0].data[0].src', src); | 327 | set(result, 'data[0].data[0].src', src); |
322 | - commit('addResource', { resource1: result.data[0] }); | 328 | + commit('addResource', { |
329 | + resource1: result.data[0] | ||
330 | + }); | ||
331 | + } | ||
332 | + | ||
323 | } | 333 | } |
324 | if (result1.code === 200) { | 334 | if (result1.code === 200) { |
335 | + if (result.data.length !== 0) { | ||
325 | let src = getImgUrl( | 336 | let src = getImgUrl( |
326 | get(result1, 'data[0].data[0].src') || '', | 337 | get(result1, 'data[0].data[0].src') || '', |
327 | 1000, | 338 | 1000, |
@@ -331,6 +342,7 @@ export default function() { | @@ -331,6 +342,7 @@ export default function() { | ||
331 | set(result1, 'data[0].data[0].src', src); | 342 | set(result1, 'data[0].data[0].src', src); |
332 | commit('addResource', { resource2: result1.data[0] }); | 343 | commit('addResource', { resource2: result1.data[0] }); |
333 | } | 344 | } |
345 | + } | ||
334 | }, | 346 | }, |
335 | async fetchSellerOrder({ commit }) { | 347 | async fetchSellerOrder({ commit }) { |
336 | const result = await this.$api.get( | 348 | const result = await this.$api.get( |
-
Please register or login to post a comment