web/buyer/src/pages/shopEntry/ShopEntry.vue

181 lines
5.3 KiB
Vue
Raw Normal View History

2021-05-13 10:56:04 +08:00
<template>
<div class="shop-entry">
<div style="height: 20px"></div>
<div class="content">
<h3>店铺入驻</h3>
2021-06-28 11:23:22 +08:00
<Steps :current="currentIndex" class="margin">
2021-05-13 10:56:04 +08:00
<Step title="企业资质信息"></Step>
<Step title="财务资质信息"></Step>
<Step title="其他信息"></Step>
<Step title="提交审核"></Step>
</Steps>
<first-apply v-if="currentIndex == 0 && dataReview" :content="firstData" @change="nextPage"></first-apply>
2021-05-13 10:56:04 +08:00
<second-apply v-if="currentIndex == 1 && dataReview" :content="secondData" @change="nextPage"></second-apply>
2021-05-13 10:56:04 +08:00
<third-apply v-if="currentIndex == 2 && dataReview" :content="thirdData" @change="nextPage"></third-apply>
2021-05-13 10:56:04 +08:00
<div class="success-page" v-if="currentIndex == 3">
2021-05-18 18:03:00 +08:00
<span v-if="storeDisable == '' || storeDisable == 'APPLYING'">入驻申请提交成功等待平台审核</span>
2021-05-13 10:56:04 +08:00
<span v-if="storeDisable == 'OPEN'">申请已通过请联系管理员</span>
<span v-if="storeDisable == 'CLOSED'">店铺已关闭重申请联系管理员</span>
2021-05-18 18:03:00 +08:00
<span v-if="storeDisable == 'REFUSED'">审核未通过,请修改资质信息如有疑问请联系管理员</span>
2021-05-13 10:56:04 +08:00
</div>
2021-05-18 18:03:00 +08:00
<Button v-if="currentIndex === 3" @click="$router.push('/')">返回</Button>
<Button type="primary" @click='currentIndex = 0' v-if="storeDisable === 'REFUSED' && currentIndex === 3">重新申请</Button>
2021-05-13 10:56:04 +08:00
</div>
<Modal title="店铺入驻协议" v-model="showAgreement" width="1200" :closable="false" :mask-closable="false">
2021-05-13 10:56:04 +08:00
<div class="agreeent-con" v-html="agreementCon"></div>
<div slot="footer" style="text-align: center">
<p>
<Checkbox v-model="checked">我已同意以上协议</Checkbox>
</p>
<Button type="primary" :disabled="!checked" class="margin" @click="showAgreement = false">同意协议填写资质信息</Button>
2021-05-13 10:56:04 +08:00
</div>
</Modal>
</div>
</template>
<script>
2021-06-28 11:23:22 +08:00
import { agreement, applyStatus } from '@/api/shopentry';
2021-07-31 11:05:34 +08:00
import firstApply from './FirstApply';
import secondApply from './SecondApply';
import thirdApply from './ThirdApply';
2021-05-13 10:56:04 +08:00
export default {
components: {
firstApply,
secondApply,
2021-06-28 11:23:22 +08:00
thirdApply
2021-05-13 10:56:04 +08:00
},
2021-06-28 11:23:22 +08:00
data () {
2021-05-13 10:56:04 +08:00
return {
2021-05-13 11:35:57 +08:00
currentIndex: 0, // 当前步骤
showAgreement: false, // 协议显示
2021-06-28 11:23:22 +08:00
agreementCon: '', // 协议内容
2021-05-13 11:35:57 +08:00
checked: false, // 选中协议
firstData: {}, // 第一步数据
secondData: {}, // 第二步数据
thirdData: {}, // 第三步数据
2021-06-28 11:23:22 +08:00
storeDisable: '', // APPLY OPEN 开店中 CLOSED 关闭 REFUSED 拒绝 APPLYING 申请中,审核
dataReview: true // 根据接口返回判断是否可展示数据
2021-05-13 10:56:04 +08:00
};
},
methods: {
2021-06-28 11:23:22 +08:00
getArticle () {
2021-05-13 10:56:04 +08:00
// 入驻协议
agreement().then((res) => {
this.agreementCon = res.result.content;
2021-05-13 10:56:04 +08:00
});
},
2021-06-28 11:23:22 +08:00
getData () { // 获取已填写店铺信息
2021-05-13 10:56:04 +08:00
applyStatus().then((res) => {
if (res.success) {
if (!res.result) {
this.showAgreement = true;
} else {
this.dataReview = false;
let data = res.result;
let first = [
'companyAddressPath',
'companyAddress',
'companyAddressIdPath',
2021-06-28 11:23:22 +08:00
'companyEmail',
'companyName',
'employeeNum',
'companyPhone',
2021-06-28 11:23:22 +08:00
'legalId',
'legalName',
'licencePhoto',
'legalPhoto',
'licenseNum',
'linkName',
'linkPhone',
'registeredCapital',
'scope'
2021-05-13 10:56:04 +08:00
];
let second = [
2021-06-28 11:23:22 +08:00
'settlementBankAccountName',
'settlementBankAccountNum',
'settlementBankBranchName',
'settlementBankJointName'
2021-05-13 10:56:04 +08:00
];
let third = [
2021-06-28 11:23:22 +08:00
'goodsManagementCategory',
'storeCenter',
'storeDesc',
'storeLogo',
'storeName',
'storeAddressIdPath',
'storeAddressPath',
'storeAddressDetail'
2021-05-13 10:56:04 +08:00
];
this.storeDisable = data.storeDisable;
first.forEach((e) => {
this.firstData[e] = data[e];
});
second.forEach((e) => {
this.secondData[e] = data[e];
});
third.forEach((e) => {
this.thirdData[e] = data[e];
});
2021-06-28 11:23:22 +08:00
if (this.storeDisable === 'APPLY') {
2021-05-13 10:56:04 +08:00
this.currentIndex = 0;
} else {
this.currentIndex = 3;
}
2021-06-28 11:23:22 +08:00
this.$nextTick(() => {
this.dataReview = true;
this.$forceUpdate();
})
2021-05-13 10:56:04 +08:00
}
}
});
},
2021-07-30 18:17:01 +08:00
// 下一步
2021-06-28 11:23:22 +08:00
nextPage (step) {
2021-05-13 10:56:04 +08:00
this.currentIndex = step;
2021-06-28 11:23:22 +08:00
}
2021-05-13 10:56:04 +08:00
},
2021-06-28 11:23:22 +08:00
mounted () {
2021-05-13 10:56:04 +08:00
this.getData();
this.getArticle();
2021-06-28 11:23:22 +08:00
}
2021-05-13 10:56:04 +08:00
};
</script>
<style lang="scss" scoped>
.content {
width: 1200px;
margin: 0 auto;
border: 1px solid #eee;
min-height: 500px;
border-radius: 5px;
box-shadow: 3px 3px 10px #999;
background: #fff;
padding: 10px 20px;
h3 {
text-align: center;
margin-bottom: 10px;
}
}
.margin {
2021-06-28 11:23:22 +08:00
margin: 30px 0;
2021-05-13 10:56:04 +08:00
}
.agreeent-con {
max-height: 500px;
}
.success-page {
height: 500px;
width: 100%;
line-height: 500px;
text-align: center;
font-size: 20px;
}
</style>