Authored by baoss

优化资源位展示,我的增加绑定入口

... ... @@ -55,7 +55,15 @@ export default {
confirm() {
this.bindAliPayAccount({account: this.account, name: this.name}).then((data) => {
this.dialogShow = false;
this.$router.back()
if (data.code === 200) {
this.$router.back()
} else {
this.$createToast({
txt: data.message,
time: 1500,
type: 'txt'
}).show();
}
})
},
... ...
... ... @@ -11,7 +11,10 @@ const {mapState, mapActions} = createNamespacedHelpers('home/bindAccount');
export default {
name: 'bind',
props: {
data: {
type: Object,
default: {}
}
},
data() {
return {
... ... @@ -28,7 +31,7 @@ export default {
methods: {
...mapActions(['fetchUserAliPayAccount']),
goBind() {
this.$router.push({name:'bindAccount'})
this.$router.push({name:this.data.page})
}
}
... ...
<template>
<div class="single-image">
<LayoutLink :href="data.url" class="link">
<LayoutLink :href="data.url" class="link" v-if="data.src">
<img :src="data.src" :alt="data.title" class="img" :style="style">
</LayoutLink>
</div>
... ...
... ... @@ -16,9 +16,10 @@
<div v-else-if="key === 'sale'" class="bg-top">
<tab-item :data="value" noLine titleBold titleSmall></tab-item>
</div>
<bind v-else-if="key === 'bindAccount'" :data="value"></bind>
<tab-item v-else :data="value"></tab-item>
</div>
<bind></bind>
</div>
</LayoutApp>
</template>
... ...
... ... @@ -35,11 +35,8 @@ export default function() {
certName: name
});
if (result.code === 200) {
// commit('addUserAliPayAccount', result.data);
return result;
}
// commit('addUserAliPayAccount', result.data);
return result;
},
},
};
... ...
... ... @@ -102,6 +102,7 @@ export default function() {
resource1: { name: 'resource1', data: state.resource1 },
income: {
title: '我的收入',
// num: state.userWalletInfo.walletAmount, // 钱包余额
num: state.assetData.totalIncome,
page: 'tradeIncome',
... ... @@ -135,6 +136,10 @@ export default function() {
title: '我的客服',
page: 'service'
},
bindAccount: {
name: 'bindAccount',
page: 'bindAccount'
},
resource2: { name: 'resource2', data: state.resource2 },
};
... ... @@ -312,24 +317,31 @@ export default function() {
});
if (result.code === 200) {
let src = getImgUrl(
get(result, 'data[0].data[0].src') || '',
1000,
240,
);
set(result, 'data[0].data[0].src', src);
commit('addResource', { resource1: result.data[0] });
if (result.data.length !== 0) {
let src = getImgUrl(
get(result, 'data[0].data[0].src') || '',
1000,
240,
);
set(result, 'data[0].data[0].src', src);
commit('addResource', {
resource1: result.data[0]
});
}
}
if (result1.code === 200) {
let src = getImgUrl(
get(result1, 'data[0].data[0].src') || '',
1000,
240,
);
set(result1, 'data[0].data[0].src', src);
commit('addResource', { resource2: result1.data[0] });
if (result.data.length !== 0) {
let src = getImgUrl(
get(result1, 'data[0].data[0].src') || '',
1000,
240,
);
set(result1, 'data[0].data[0].src', src);
commit('addResource', { resource2: result1.data[0] });
}
}
},
async fetchSellerOrder({ commit }) {
... ... @@ -382,7 +394,7 @@ export default function() {
let page = isRefresh ? 1 : currentPage + 1;
const result = await this.$api.get('/api/ufo/mine/assets', {
page,
limit: pageSize
limit: pageSize
});
// commit('assetFetching', {isFetching: false});
... ...