Authored by TaoHuang

fix bind status

... ... @@ -22,118 +22,130 @@
<script>
import { createNamespacedHelpers } from 'vuex';
import {Input, Button, Style} from 'cube-ui';
import { Input, Button, Style } from 'cube-ui';
import myDialog from './components/bindModel';
const {mapState, mapActions} = createNamespacedHelpers('home/bindAccount');
const { mapState, mapActions } = createNamespacedHelpers('home/bindAccount');
export default {
data() {
return {
account: '',
name: '',
dialogShow: false
}
props: ['back'],
data() {
return {
account: '',
name: '',
dialogShow: false
};
},
computed: {
...mapState({
incomeData: (state) => state.assetData
}),
canSubmit() {
return !(this.name && this.account);
}
},
created() {
},
methods: {
...mapActions(['bindAliPayAccount']),
submitBind() {
this.dialogShow = true;
},
computed:{
...mapState({
incomeData: (state) => state.assetData
}),
canSubmit() {
return !(this.name && this.account);
}
cancel() {
this.dialogShow = false;
},
created() {
confirm() {
this.bindAliPayAccount({ account: this.account, name: this.name }).then((data) => {
this.dialogShow = false;
if (data.code === 200) {
if (this.back) {
this.$router.replace({
name: this.back
})
return;
}
this.$router.back();
} else {
this.$createToast({
txt: data.message,
time: 1500,
type: 'txt'
}).show();
}
});
},
methods: {
...mapActions(['bindAliPayAccount']),
submitBind() {
this.dialogShow = true
},
cancel() {
this.dialogShow = false
},
confirm() {
this.bindAliPayAccount({account: this.account, name: this.name}).then((data) => {
this.dialogShow = false;
if (data.code === 200) {
this.$router.back()
} else {
this.$createToast({
txt: data.message,
time: 1500,
type: 'txt'
}).show();
}
})
},
},
components: {
Style,
CubeInput: Input,
CubeButton: Button,
myDialog
}
},
components: {
Style,
CubeInput: Input,
CubeButton: Button,
myDialog
}
};
</script>
<style lang="scss" scoped>
.body {
position: relative;
height: 100%;
overflow-y: auto;
background-color: white;
padding: 0 40px;
position: relative;
height: 100%;
overflow-y: auto;
background-color: white;
padding: 0 40px;
}
.account-form {
margin-top: 40px;
}
margin-top: 40px;
}
.form-title {
font-size: 36px;
padding-top: 40px;
line-height: 1.6;
font-weight: 500;
}
.form-title {
font-size: 36px;
padding-top: 40px;
line-height: 1.6;
font-weight: 500;
}
.form-input-block {
padding-bottom: 16px;
border-bottom: 1px solid #eee;
position: relative;
}
.form-input-block {
padding-bottom: 16px;
border-bottom: 1px solid #eee;
position: relative;
}
.account-input {
&:after {
border: 0;
}
/deep/ .cube-input-field {
font-size: 14px;
height: 40px;
border: none;
padding: 0;
}
}
.account-input {
&:after {
border: 0;
}
/deep/ .cube-input-field {
font-size: 14px;
height: 40px;
border: none;
padding: 0;
}
}
.account-footer {
position: fixed;
padding: 28px 0;
left: 40px;
right: 40px;
bottom: 40px;
.submit-btn {
height: 88px;
line-height: 88px;
padding: 0;
background: #022c46;
border-radius: 44px;
&:after {
border: 0;
}
&.cube-btn_disabled {
background: #ccc;
}
position: fixed;
padding: 28px 0;
left: 40px;
right: 40px;
bottom: 40px;
.submit-btn {
height: 88px;
line-height: 88px;
padding: 0;
background: #022c46;
border-radius: 44px;
&:after {
border: 0;
}
&.cube-btn_disabled {
background: #ccc;
}
}
}
</style>
... ...
export default [{
name: 'bindAccount',
path: '/xianyu/home/bindAccount.html',
component: () => import(/* webpackChunkName: "bindAccount" */ './bindAccount')
component: () => import(/* webpackChunkName: "bindAccount" */ './bindAccount'),
props: (route) => ({ back: route.query.back })
}];
... ...
... ... @@ -6,10 +6,10 @@
</div>
<div class="title">支付成功</div>
<div class="desc">如卖家原因导致交易失败,您可获赔付200元保证金,建议您设置支付宝账号作为赔偿收款账户,如未绑定银行卡则视为放弃赔偿</div>
<div class="desc">如卖家原因导致交易失败,您可以获得相应赔偿金,具体金额参考《买家须知》。建议您设置支付宝账号作为赔偿收款账户,如未绑定支付宝账号视为放弃赔偿。</div>
<div class="btn-wrap">
<YohoButton :txt="txt" class="btn-class" @click="onClick"></YohoButton>
<YohoButton :txt="authorizeFlag ? txt : txt1" class="btn-class" @click="onClick"></YohoButton>
</div>
<div class="info">
... ... @@ -28,8 +28,10 @@
import ProductList from '../list/components/productList';
import { createNamespacedHelpers } from 'vuex';
import { get } from 'lodash';
const { mapActions: mapProductAction } = createNamespacedHelpers('product');
const { mapActions: mapOrderConfirmAction } = createNamespacedHelpers('order/orderConfirm');
export default {
name: 'BuyPayOk',
... ... @@ -40,25 +42,45 @@ export default {
data() {
return {
txt: '返回首页',
txt1: '绑定支付宝',
authorizeFlag: false,
productList: []
};
},
mounted() {
activated() {
if (this.productId) {
this.fetchRecommendProduct({ productId: this.productId }).then(result => {
this.productList = result;
});
}
// this.fetchAlipayStatus().then(result => {
// this.authorizeFlag = get(result, 'data.authorizeFlag', false);
// });
},
computed: {},
methods: {
...mapProductAction(['fetchRecommendProduct']),
...mapOrderConfirmAction(['fetchAlipayStatus']),
onClick() {
this.goHome();
if (this.authorizeFlag) {
this.goHome();
} else {
this.goBindAccount();
}
},
goHome() {
this.$router.replace({
name: 'ChannelPage'
});
},
goBindAccount() {
this.$router.replace({
name: 'bindAccount',
query: {
back: 'ChannelPage'
}
});
}
}
};
... ... @@ -87,7 +109,7 @@ export default {
.btn-class {
height: 88px;
font-size: 32px;
line-height: 100px;
line-height: 88px;
}
.desc {
... ...
... ... @@ -231,6 +231,10 @@ export default function() {
return this.$api.post('/api/order/user/status');
},
async fetchAlipayStatus() {
return this.$api.post('/api/order/alipay/status');
},
async submitOrder({ commit }, payload) {
return this.$api.post('/api/order/presubmit', payload);
},
... ...