Authored by zhangwenxue

端口详情: 添加出售前实名认证流程

... ... @@ -223,8 +223,30 @@ export default {
loading && loading.hide();
});
},
/**
* 登录|认证
* needCert: 需要实名认证
*/
async auth(needCert = false) {
if (needCert) {
const authInfo = await this.$yoho.authRealName();
if (authInfo && authInfo.code === 403) { // 此时已经异步登录,当前页面取消业务处理
return;
}
return authInfo;
}
return this.$yoho.auth();
},
async _toggleFav(isFav) {
await this.$yoho.auth();
const userInfo = await this.auth();
if (!userInfo) {
return;
}
this.toggleFav({ productId: this.productId, isFav }).then(() => {
const txt = isFav ? '收藏成功' : '取消收藏成功';
... ... @@ -271,7 +293,11 @@ export default {
this.showSizeSelectSheet = false;
},
async buy() {
await this.$yoho.auth();
const userInfo = await this.auth();
if (!userInfo) {
return;
}
this.selectSizeConfig = {
dest: 'OrderBuyConfirm',
... ... @@ -284,7 +310,13 @@ export default {
this.showBuySheet = false;
},
async sell() {
await this.$yoho.auth();
// 出售需要实名认证
const userInfo = await this.auth(true);
if (!userInfo) {
return;
}
this.selectSizeConfig = {
dest: 'OrderSellConfirm',
type: 'sell',
... ...