This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
form input[type='file'] {
visibility: hidden;
position: absolute;
z-index: -1;
}
.idcard-bg {
width: 20em;
height: 13em;
border: 1px #ccc solid;
border-radius: 1em;
position: relative;
overflow: hidden;
}
.idcard-bg .button {
position: absolute;
left: 50%;
top: 50%;
margin-left: -1.6em;
margin-top: -1.6em;
}
.idcard-bg img {
width: 100%;
height: 100%;
}
/*# sourceMappingURL=enterprise.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["enterprise.less"],"names":[],"mappings":"AAAA,IACC,MAAK;EACJ,kBAAA;EACA,kBAAA;EACA,WAAA;;AAIF;EACC,WAAA;EACA,YAAA;EACA,sBAAA;EACA,kBAAA;EACA,kBAAA;EACA,gBAAA;;AAND,UAQC;EACC,kBAAA;EACA,SAAA;EACA,QAAA;EACA,mBAAA;EACA,kBAAA;;AAbF,UAgBC;EACC,WAAA;EACA,YAAA","file":"enterprise.css"}

View File

@@ -0,0 +1,87 @@
{$layout}
<first-menu>
<menu-item href="/settings/identity">实名认证</menu-item>
<span class="item disabled">&raquo;</span>
<span class="item">企业实名认证</span>
</first-menu>
<form class="ui form" data-tea-action=".uploadEnterprise" data-tea-timeout="600" data-tea-before="beforeSubmit" data-tea-done="doneSubmit" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="identityId" :value="identity.id" v-if="identity != null"/>
<table class="ui table selectable definition">
<tr>
<td class="title">企业全称 *</td>
<td>
<div v-if="canEdit">
<input type="text" name="realName" placeholder="企业全称" maxlength="100" style="width: 20em" ref="focus" v-model="realName"/>
</div>
<div v-else>
{{identity.realName}}
</div>
</td>
</tr>
<tr>
<td>营业执照号码 *</td>
<td>
<div v-if="canEdit">
<input type="text" name="number" placeholder="营业执照号码" maxlength="18" style="width: 20em" v-model="number"/>
</div>
<div v-else>
{{identity.number}}
</div>
</td>
</tr>
<tr>
<td>营业执照照片 *<em>不超过8MiB</em></td>
<td>
<input type="file" name="frontFile" id="front-file" accept="image/jpeg, image/png" @change="changeFrontFile"/>
<div class="idcard-bg">
<img :src="'/files/file?fileId=' + identity.frontFileId" v-if="identity != null && identity.frontFileId > 0 && frontPreviewURL.length == 0" alt=""/>
<img :src="frontPreviewURL" alt="" v-if="frontPreviewURL.length > 0"/>
<button type="button" class="ui button icon" v-if="canEdit" @click.prevent="selectFile('front-file')"><i class="icon plus"></i></button>
</div>
</td>
</tr>
</table>
<div v-if="!isSubmitting">
<div>
<!-- 未上传 -->
<submit-btn v-if="identity == null">保存</submit-btn>
</div>
<div v-if="identity != null">
<!-- 待提交 -->
<div v-if="identity.status == 'none'">
<div class="ui message warning">已上传,请提交审核。</div>
<button class="ui button primary" type="submit">保存修改</button> &nbsp; &nbsp;
<a href="" @click.prevent="submit">提交审核</a>
</div>
<!-- 已提交 -->
<div v-if="identity.status == 'submitted'">
<div class="ui message warning">管理员审核中,请耐心等待。</div>
<a href="" class="ui button" @click.prevent="cancel">取消审核</a>
</div>
<!-- 已拒绝 -->
<div v-if="identity.status == 'rejected'">
<div class="ui message error">审核不通过,原因:{{identity.rejectReason}}。</div>
<button class="ui button" type="submit">保存修改</button> &nbsp; &nbsp;
<a href="" class="ui button primary" @click.prevent="submit">重新提交审核</a>
</div>
<!-- 已通过 -->
<div v-if="identity.status == 'verified'">
<div class="ui message success">实名认证审核通过。</div>
</div>
</div>
</div>
<div v-if="isSubmitting">
正在提交,请稍候...
</div>
</form>

View File

@@ -0,0 +1,73 @@
Tea.context(function () {
this.frontPreviewURL = ""
this.isSubmitting = false
this.realName = ""
this.number = ""
if (this.identity != null) {
this.realName = this.identity.realName
this.number = this.identity.number
}
this.canEdit = (this.identity == null || this.identity.status == "none" || this.identity.status == "rejected")
this.selectFile = function (targetId) {
let selector = document.getElementById(targetId)
selector.click()
}
this.changeFrontFile = function (e) {
let files = e.target.files
if (files.length > 0) {
this.frontPreviewURL = URL.createObjectURL(files[0])
}
}
this.beforeSubmit = function () {
this.isSubmitting = true
}
this.doneSubmit = function () {
this.isSubmitting = false
}
this.success = function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
this.submit = function () {
if (this.identity == null) {
teaweb.fail("请先保存后再提交审核")
return
}
this.$post(".submit")
.params({
identityId: this.identity.id
})
.success(function () {
teaweb.success("提交成功", function () {
teaweb.reload()
})
})
}
this.cancel = function () {
if (this.identity == null) {
teaweb.fail("请先保存后再提交审核")
return
}
teaweb.confirm("确定要取消提交审核吗?", function () {
this.$post(".cancel")
.params({
identityId: this.identity.id
})
.success(function () {
teaweb.success("取消成功", function () {
teaweb.reload()
})
})
})
}
})

View File

@@ -0,0 +1,29 @@
form {
input[type='file'] {
visibility: hidden;
position: absolute;
z-index: -1;
}
}
.idcard-bg {
width: 20em;
height: 13em;
border: 1px #ccc solid;
border-radius: 1em;
position: relative;
overflow: hidden;
.button {
position: absolute;
left: 50%;
top: 50%;
margin-left: -1.6em;
margin-top: -1.6em;
}
img {
width: 100%;
height: 100%;
}
}

View File

@@ -0,0 +1,30 @@
.identities-box {
height: 14em;
width: 45em;
margin: 5em auto;
}
.identities-box .identity-box {
float: left;
width: 20em;
border: 1px #ccc solid;
padding: 1em 2em;
text-align: center;
margin-left: 1em;
margin-right: 1em;
height: 8.8em;
border-radius: 0.4em;
}
.identities-box .identity-box .real-name {
font-size: 1.2em;
line-height: 1.5;
}
.identities-box .identity-box .status-box {
line-height: 2;
margin-top: 0.5em;
color: #999;
}
.identities-box .identity-box:hover {
background: #eee;
cursor: pointer;
}
/*# sourceMappingURL=index.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACC,YAAA;EACA,WAAA;EACA,gBAAA;;AAHD,eAKC;EACC,WAAA;EACA,WAAA;EACA,sBAAA;EACA,gBAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,aAAA;EACA,oBAAA;;AAdF,eAKC,cAWC;EACC,gBAAA;EACA,gBAAA;;AAlBH,eAKC,cAgBC;EACC,cAAA;EACA,iBAAA;EACA,WAAA;;AAxBH,eA4BC,cAAa;EACZ,gBAAA;EACA,eAAA","file":"index.css"}

View File

@@ -0,0 +1,39 @@
{$layout}
<div class="identities-box">
<!-- 个人认证 -->
<div class="identity-box" @click.prevent="goIndividual">
<h4>个人实名认证</h4>
<div v-if="individualIdentity != null">
<div><a href="" class="real-name">{{individualIdentity.realName}}</a></div>
<div class="status-box">
<span v-if="individualIdentity.status == 'none'">等待提交</span>
<span v-if="individualIdentity.status == 'submitted'">审核中</span>
<span v-if="individualIdentity.status == 'rejected'" class="red">已驳回</span>
<span v-if="individualIdentity.status == 'verified'" class="green">已认证</span>
</div>
</div>
<div v-else>
<a href="">尚未提交认证 &raquo;</a>
</div>
</div>
<!-- 企业认证 -->
<div class="identity-box" @click.prevent="goEnterprise">
<h4>企业实名认证</h4>
<div v-if="enterpriseIdentity != null">
<div><a href="" class="real-name">{{enterpriseIdentity.realName}}</a></div>
<div class="status-box">
<span v-if="enterpriseIdentity.status == 'none'">等待提交</span>
<span v-if="enterpriseIdentity.status == 'submitted'">审核中</span>
<span v-if="enterpriseIdentity.status == 'rejected'" class="red">已驳回</span>
<span v-if="enterpriseIdentity.status == 'verified'" class="green">已认证</span>
</div>
</div>
<div v-else>
<a href="">尚未提交认证 &raquo;</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,9 @@
Tea.context(function () {
this.goIndividual = function () {
window.location = "/settings/identity/individual"
}
this.goEnterprise = function () {
window.location = "/settings/identity/enterprise"
}
})

View File

@@ -0,0 +1,33 @@
.identities-box {
height: 14em;
width: 45em;
margin: 5em auto;
.identity-box {
float: left;
width: 20em;
border: 1px #ccc solid;
padding: 1em 2em;
text-align: center;
margin-left: 1em;
margin-right: 1em;
height: 8.8em;
border-radius: 0.4em;
.real-name {
font-size: 1.2em;
line-height: 1.5;
}
.status-box {
line-height: 2;
margin-top: 0.5em;
color: #999;
}
}
.identity-box:hover {
background: #eee;
cursor: pointer;
}
}

View File

@@ -0,0 +1,25 @@
form input[type='file'] {
visibility: hidden;
position: absolute;
z-index: -1;
}
.idcard-bg {
width: 20em;
height: 13em;
border: 1px #ccc solid;
border-radius: 1em;
position: relative;
overflow: hidden;
}
.idcard-bg .button {
position: absolute;
left: 50%;
top: 50%;
margin-left: -1.6em;
margin-top: -1.6em;
}
.idcard-bg img {
width: 100%;
height: 100%;
}
/*# sourceMappingURL=individual.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["individual.less"],"names":[],"mappings":"AAAA,IACC,MAAK;EACJ,kBAAA;EACA,kBAAA;EACA,WAAA;;AAIF;EACC,WAAA;EACA,YAAA;EACA,sBAAA;EACA,kBAAA;EACA,kBAAA;EACA,gBAAA;;AAND,UAQC;EACC,kBAAA;EACA,SAAA;EACA,QAAA;EACA,mBAAA;EACA,kBAAA;;AAbF,UAgBC;EACC,WAAA;EACA,YAAA","file":"individual.css"}

View File

@@ -0,0 +1,98 @@
{$layout}
<first-menu>
<menu-item href="/settings/identity">实名认证</menu-item>
<span class="item disabled">&raquo;</span>
<span class="item">个人实名认证</span>
</first-menu>
<form class="ui form" data-tea-action=".uploadIndividual" data-tea-timeout="600" data-tea-before="beforeSubmit" data-tea-done="doneSubmit" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="identityId" :value="identity.id" v-if="identity != null"/>
<table class="ui table selectable definition">
<tr>
<td class="title">真实姓名 *</td>
<td>
<div v-if="canEdit">
<input type="text" name="realName" placeholder="真实姓名" maxlength="100" style="width: 10em" ref="focus" v-model="realName"/>
</div>
<div v-else>
{{identity.realName}}
</div>
</td>
</tr>
<tr>
<td>身份证号 *</td>
<td>
<div v-if="canEdit">
<input type="text" name="number" placeholder="身份证号" maxlength="18" style="width: 13em" v-model="number"/>
</div>
<div v-else>
{{identity.number}}
</div>
</td>
</tr>
<tr>
<td>身份证 - 照片面 *<em>不超过8MiB</em></td>
<td>
<input type="file" name="backFile" id="back-file" accept="image/jpeg, image/png" @change="changeBackFile"/>
<div class="idcard-bg">
<img :src="'/files/file?fileId=' + identity.backFileId" v-if="identity != null && identity.backFileId > 0 && backPreviewURL.length == 0" alt=""/>
<img :src="backPreviewURL" alt="" v-if="backPreviewURL.length > 0"/>
<button type="button" class="ui button icon" v-if="canEdit" @click.prevent="selectFile('back-file')"><i class="icon plus"></i></button>
</div>
</td>
</tr>
<tr>
<td>身份证 - 国徽面 *<em>不超过8MiB</em></td>
<td>
<input type="file" name="frontFile" id="front-file" accept="image/jpeg, image/png" @change="changeFrontFile"/>
<div class="idcard-bg">
<img :src="'/files/file?fileId=' + identity.frontFileId" v-if="identity != null && identity.frontFileId > 0 && frontPreviewURL.length == 0" alt=""/>
<img :src="frontPreviewURL" alt="" v-if="frontPreviewURL.length > 0"/>
<button type="button" class="ui button icon" v-if="canEdit" @click.prevent="selectFile('front-file')"><i class="icon plus"></i></button>
</div>
</td>
</tr>
</table>
<div v-if="!isSubmitting">
<div>
<!-- 未上传 -->
<submit-btn v-if="identity == null">保存</submit-btn>
</div>
<div v-if="identity != null">
<!-- 待提交 -->
<div v-if="identity.status == 'none'">
<div class="ui message warning">已上传,请提交审核。</div>
<button class="ui button primary" type="submit">保存修改</button> &nbsp; &nbsp;
<a href="" @click.prevent="submit">提交审核</a>
</div>
<!-- 已提交 -->
<div v-if="identity.status == 'submitted'">
<div class="ui message warning">管理员审核中,请耐心等待。</div>
<a href="" class="ui button" @click.prevent="cancel">取消审核</a>
</div>
<!-- 已拒绝 -->
<div v-if="identity.status == 'rejected'">
<div class="ui message error">审核不通过,原因:{{identity.rejectReason}}。</div>
<button class="ui button" type="submit">保存修改</button> &nbsp; &nbsp;
<a href="" class="ui button primary" @click.prevent="submit">重新提交审核</a>
</div>
<!-- 已通过 -->
<div v-if="identity.status == 'verified'">
<div class="ui message success">实名认证审核通过。</div>
</div>
</div>
</div>
<div v-if="isSubmitting">
正在提交,请稍候...
</div>
</form>

View File

@@ -0,0 +1,81 @@
Tea.context(function () {
this.backPreviewURL = ""
this.frontPreviewURL = ""
this.isSubmitting = false
this.realName = ""
this.number = ""
if (this.identity != null) {
this.realName = this.identity.realName
this.number = this.identity.number
}
this.canEdit = (this.identity == null || this.identity.status == "none" || this.identity.status == "rejected")
this.selectFile = function (targetId) {
let selector = document.getElementById(targetId)
selector.click()
}
this.changeBackFile = function (e) {
let files = e.target.files
if (files.length > 0) {
this.backPreviewURL = URL.createObjectURL(files[0])
}
}
this.changeFrontFile = function (e) {
let files = e.target.files
if (files.length > 0) {
this.frontPreviewURL = URL.createObjectURL(files[0])
}
}
this.beforeSubmit = function () {
this.isSubmitting = true
}
this.doneSubmit = function () {
this.isSubmitting = false
}
this.success = function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
this.submit = function () {
if (this.identity == null) {
teaweb.fail("请先保存后再提交审核")
return
}
this.$post(".submit")
.params({
identityId: this.identity.id
})
.success(function () {
teaweb.success("提交成功", function () {
teaweb.reload()
})
})
}
this.cancel = function () {
if (this.identity == null) {
teaweb.fail("请先保存后再提交审核")
return
}
teaweb.confirm("确定要取消提交审核吗?", function () {
this.$post(".cancel")
.params({
identityId: this.identity.id
})
.success(function () {
teaweb.success("取消成功", function () {
teaweb.reload()
})
})
})
}
})

View File

@@ -0,0 +1,29 @@
form {
input[type='file'] {
visibility: hidden;
position: absolute;
z-index: -1;
}
}
.idcard-bg {
width: 20em;
height: 13em;
border: 1px #ccc solid;
border-radius: 1em;
position: relative;
overflow: hidden;
.button {
position: absolute;
left: 50%;
top: 50%;
margin-left: -1.6em;
margin-top: -1.6em;
}
img {
width: 100%;
height: 100%;
}
}