123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760 |
- <template>
- <view>
- <u-navbar back-text="实名认证" back-icon-size="28" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
- :back-text-style="{color: '#ffffff'}"></u-navbar>
- <!-- 标签 -->
- <view class="tabs">
- <u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
- </view>
- <view class="personal-box" v-if="current==0">
- <!-- 个人认证 -->
- <view class="personal-authentication" v-if="authentication">
- <view class="headline">
- 您的信息将会被严格保密,请放心填写
- </view>
- <!-- 信息 -->
- <view class="infos-group">
- <view class="item">
- <view class="title">
- 手机号码
- </view>
- <view class="value">
- {{personalForm.phone}}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 真实姓名
- </view>
- <view class="value">
- <input v-model="personalForm.realName" type="text" placeholder="请填写真实姓名">
- </view>
- </view>
- <view class="item">
- <view class="title">
- 身份证号
- </view>
- <view class="value">
- <input v-model="personalForm.idCard" type="text" placeholder="请填写18位身份证号">
- </view>
- </view>
- <view class="viewradio">
- <u-radio-group v-model="valueradio">
- <u-radio name="1">阅读并同意</u-radio>
- </u-radio-group>
-
- <span v-for="(item,i) in newsList" :key="i">
- {{i==0?'':','}}<span @click="gotoUrl('pages/packages/news/articleDetail?id='+item.id)" class="spanradio" ><{{item.title}}></span>
- </span>
-
- </view>
- </view>
-
-
- <button class="save" @click="personalAut" v-if="!perinReview">保存</button>
- <button class="save" style="background-color: #777777;" v-else>审核中</button>
- </view>
-
- <!-- 认证成功 -->
- <view class="success" v-if="!authentication">
- <view class="img-box">
- <img src="@/assets/img/success.png" alt="">
- </view>
- <!-- 信息 -->
- <view class="infos-box">
- <view class="item">
- <view class="title">
- 手机号码
- </view>
- <view class="title">
- {{personalForm.phone}}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 姓名
- </view>
- <view class="title">
- {{personalForm.realName}}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 身份证号
- </view>
- <view class="title">
- {{personalForm.idCard.slice(0,1)+'****************'+personalForm.idCard.slice(-1)}}
- </view>
- </view>
- </view>
-
- </view>
- <!-- 提示 -->
- <view class="tips" v-if="!authentication">
- <view class="tips-item">
- <view class="icon">
- <img src="@/assets/img/shield-user-line.png" alt="">
- </view>
- <view class="text">
- 信息安全保护中,认证信息将用于创建信息等功能,与账号为已绑定,未经您允许不对外提供
- </view>
- </view>
- <view class="tips-item">
- <view class="icon">
- <u-icon name="info-circle"></u-icon>
- </view>
- <view class="text">
- 每个账号只能进行一次实名认证,认证成功不支持修改
- </view>
- </view>
- <view class="viewradio2">
-
- 阅读
- <span v-for="(item,i) in newsList" :key="i">
- {{i==0?'':','}}<span @click="gotoUrl('pages/packages/news/articleDetail?id='+item.id)" class="spanradio" ><{{item.title}}></span>
- </span>
-
- </view>
- </view>
- </view>
-
- <!-- 企业认证 -->
- <view class="enterprise-box" v-if="current==1">
- <view class="enterprise-authentication" v-if="enterprise">
- <view class="headline">
- 您的信息将会被严格保密,请放心填写
- </view>
- <!-- 企业信息 -->
- <view class="enterprise-infos">
- <view class="infos-input">
- <view class="item">
- <view class="title">
- 企业全称
- </view>
- <view class="input">
- <input v-model="enterpriseForm.name" type="text" placeholder="请填写企业全称">
- </view>
- </view>
- <view class="item">
- <view class="title">
- 企业地址
- </view>
- <view class="input">
- <input v-model="enterpriseForm.address" type="text" placeholder="请填写企业地址">
- </view>
- </view>
- <view class="item">
- <view class="title">
- 企业联系人
- </view>
- <view class="input">
- <input v-model="enterpriseForm.contactsPersonId" type="text" placeholder="请填写企业联系人">
- </view>
- </view>
- </view>
- <!-- 营业执照 -->
- <view class="business-license">
- <view class="title">
- <view class="title-left">
- 营业执照
- </view>
- <view class="title-right">
- 请保证图中文字、印章等清晰可辨识
- </view>
- </view>
- <view class="img-box" v-if="entinReview" >
- <img width="100%" height="100%" :src="enterpriseForm.licenseImage" alt="">
- </view>
- <u-upload v-else ref="uUpload" :action="action" name="photoFile" :file-list="listPic"
- :form-data="formData" :header="header" width="686" max-count="1" @on-success="onSuccess">
- </u-upload>
- </view>
-
- </view>
- <view class="viewradio">
- <u-radio-group v-model="valueradio">
- <u-radio name="1">阅读并同意</u-radio>
- </u-radio-group>
-
- <span v-for="(item,i) in newsList" :key="i">
- {{i==0?'':','}}<span @click="gotoUrl('pages/packages/news/articleDetail?id='+item.id)" class="spanradio" ><{{item.title}}></span>
- </span>
-
- </view>
- <button class="save" @click="enterpriseCer" v-if="!entinReview">保存</button>
- <button class="save" style="background-color: #777777;" v-else>审核中</button>
- </view>
-
- <!-- 企业认证成功 -->
- <view class="success" v-if="!enterprise">
- <view class="img-box">
- <img src="@/assets/img/success.png" alt="">
- </view>
- <!-- 信息 -->
- <view class="infos-box">
- <view class="item">
- <view class="title">
- 企业全称
- </view>
- <view class="value">
- {{enterpriseForm.name}}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 企业地址
- </view>
- <view class="value">
-
- {{enterpriseForm.address?enterpriseForm.address:'' }}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 企业联系人
- </view>
- <view class="value">
- {{enterpriseForm.contactsPersonId?enterpriseForm.contactsPersonId:'' }}
- </view>
- </view>
- <view class="item">
- <view class="title">
- 营业执照
- </view>
- </view>
- <view class="img-box">
- <img :src="enterpriseForm.licenseImage" alt="">
- </view>
- </view>
- </view>
- <!-- 提示 -->
- <view class="tips" v-if="!enterprise">
- <view class="tips-item">
- <view class="icon">
- <img src="@/assets/img/shield-user-line.png" alt="">
- </view>
- <view class="text">
- 信息安全保护中,认证信息将用于创建信息等功能,与账号为已绑定,未经您允许不对外提供
- </view>
- </view>
- <view class="tips-item">
- <view class="icon">
- <u-icon name="info-circle"></u-icon>
- </view>
- <view class="text">
- 每个账号只能进行一次实名认证,认证成功不支持修改
- </view>
- </view>
- <view class="viewradio2">
-
- 阅读
- <span v-for="(item,i) in newsList" :key="i">
- {{i==0?'':','}}<span @click="gotoUrl('pages/packages/news/articleDetail?id='+item.id)" class="spanradio" ><{{item.title}}></span>
- </span>
-
- </view>
- </view>
- </view>
-
- </view>
- </template>
- <script>
- import * as API_main from '@/apis/pagejs/packages.js'
- import * as API_weixin from '@/apis/weixin.js'
- import {
- checkIdCard
- } from '@/apis/utils'
-
- export default {
- data() {
- return {
- authentication: true,
- enterprise: true,
- perinReview: false,
- entinReview: false,
- list: [{
- name: '个人认证'
- }, {
- name: '企业认证'
- }],
- current: 0,
- personalForm: {
- realName: '',
- idCard: '',
- type: '0'
- },
- enterpriseForm: {
- name: '',
- licenseUrl: '',
- type: '1',
- address: '',
-
- contactsPersonId: '',
-
- },
- phone: '',
- listPic: [],
- action: '',
- header: '',
- formData: {},
- newsList:[],
- valueradio:'',
- }
- },
- onLoad() {
- this.action = process.car.BASE_URL+"uploadPicture";
- this.formData = {
- subFolder: "licenseUrl"
- }
- var token = this.carhelp.getToken();
- this.header={
- 'Authorization': token,
- 'X-Requested-With': 'XMLHttpRequest'
- }
- },
- onReady() {
- this.getFindByOpenId();
- this.getNewsInfo()
- },
- methods: {
- gotoInfo(item){
-
- },
- getNewsInfo(){
-
- API_main.newsList({
- category:9,
-
- }).then((res) => {
- uni.hideLoading();
-
- this.newsList = res.data.data;
-
-
- }).catch(error => {
- uni.showToast({icon: 'none',
- title: error,
- icon: "none"
- })
- })
- },
- onSuccess(data, index, lists, name) {
- //.log(data)
- if(data.result) {
- this.enterpriseForm.licenseUrl = data.data;
- }
- },
- personalAutApi(){
- uni.showLoading({
- title: "加载中",
- mask: true
- })
- API_main.createAuthentication(this.personalForm).then((res) => {
- uni.hideLoading();
- this.getFindByOpenId();
- }).catch(error => {
- uni.showToast({icon: 'none',
- title: error,
- icon: "none"
- })
- })
- },
- personalAut() {
-
- if(!this.valueradio) {
- uni.showToast({icon: 'none',
- title: "请勾选`阅读并同意`相关协议",
- icon: "none"
- })
- return
- }
-
- if(!this.personalForm.realName) {
- uni.showToast({icon: 'none',
- title: "请填写真实姓名",
- icon: "none"
- })
- return
- }
- if(!this.personalForm.idCard) {
- uni.showToast({icon: 'none',
- title: "请填写身份证号",
- icon: "none"
- })
- return
- }
- var checkIdCardResult = checkIdCard(this.personalForm.idCard);
- if (checkIdCardResult !== true) {
- uni.showToast({icon: 'none',
- title: checkIdCardResult,
- icon: "none"
- })
- return;
- }
- var _this=this;
- uni.showModal({
- title: '提示',
- content:"确认提交个人认证信息",
- //content: '这是一个模态弹窗',
- success: function(res) {
- if (res.confirm) {
- _this.personalAutApi()
- } else if (res.cancel) {
- //.log('用户点击取消');
- }
- }
- });
-
-
- },
- enterpriseCerApi() {
- uni.showLoading({
- title: "加载中",
- mask: true
- })
- API_main.createAuthentication({
- enterpriseName: this.enterpriseForm.name,
- licenseUrl: this.enterpriseForm.licenseUrl,
- contactsPersonId: this.enterpriseForm.contactsPersonId,
- address: this.enterpriseForm.address,
- type: this.enterpriseForm.type
- }).then((res) => {
- uni.hideLoading();
- this.getFindByOpenId();
- }).catch(error => {
- uni.showToast({icon: 'none',
- title: error,
- icon: "none"
- })
- })
- },
- enterpriseCer() {
- if(!this.valueradio) {
- uni.showToast({icon: 'none',
- title: "请勾选`阅读并同意`相关协议",
- icon: "none"
- })
- return
- }
- if(!this.enterpriseForm.name) {
- uni.showToast({icon: 'none',
- title: "请填写企业全称",
- icon: "none"
- })
- return
- }
- if(!this.enterpriseForm.address) {
- uni.showToast({icon: 'none',
- title: "请填写企业地址",
- icon: "none"
- })
- return
- }
- if(!this.enterpriseForm.contactsPersonId) {
- uni.showToast({icon: 'none',
- title: "请填写企业联系人",
- icon: "none"
- })
- return
- }
- if(!this.enterpriseForm.licenseUrl) {
- uni.showToast({icon: 'none',
- title: "请上传营业执照",
- icon: "none"
- })
- return
- }
-
- var _this=this;
- uni.showModal({
- title: '提示',
- content:"确认提交企业认证信息",
- //content: '这是一个模态弹窗',
- success: function(res) {
- if (res.confirm) {
- _this.enterpriseCerApi()
- } else if (res.cancel) {
- //.log('用户点击取消');
- }
- }
- });
-
- },
- getFindByOpenId(){
- uni.showLoading({
- title: "加载中",
- mask: true
- })
- API_weixin.findByOpenId({
- openId:this.carhelp.getOpenId()
- }).then((res) => {
- uni.hideLoading();
-
- var userList = res.data.regUser;
- var enterList = res.data.enterpriseInfo;
- this.personalForm = userList;
- if(userList.status == '1') {
- this.authentication = false;
- this.personalForm.realName = userList.realName;
-
- }
- if(enterList != null) {
- this.enterpriseForm = enterList;
- if(enterList.status == '0') {
- this.entinReview = true;
- } else {
- this.enterprise = false;
- }
- }
- if(userList.status == '0' && userList.idCard != null) {
- this.perinReview = true;
- }
- }).catch(error => {
- uni.showToast({icon: 'none',
- title: error,
- icon: "none"
- })
- })
- },
- change(index) {
- this.current = index;
- }
- }
- }
- </script>
- <style>
- page {
- background: #F0F0F2;
- padding-bottom: 150px;
- }
- </style>
- <style lang="scss" scoped>
- .viewradio{
- background-color: #fff;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- .spanradio{
- color:#4496f8
- }
- }
- .viewradio2{
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- .spanradio{
- color:#4496f8
- }
- }
- .headline {
- color: rgba(51, 51, 51, 1);
- padding-left: 32rpx;
- margin-top: 32rpx;
- }
- .personal-box {
- // 信息
- .infos-group {
- background-color: #fff;
- margin-top: 16rpx;
- .item {
- display: flex;
- align-items: center;
- padding: 24rpx 32rpx;
- .title {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- width: 180rpx;
- }
- .value {
- /deep/.uni-input-input {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- }
- }
- }
- .img-box {
- display: flex;
- justify-content: center;
- img {
- width: 100%;
- height: 440rpx;
- }
- }
- }
- }
- // 企业认证
- .enterprise-box {
- .enterprise-authentication {
- .enterprise-infos {
- background-color: #fff;
- padding: 24rpx 32rpx;
- margin-top: 16rpx;
- .item{
- padding: 6px 0;
- border-bottom: 1px solid #f1f1f1;
- }
- }
- .infos-input {
- padding: 0 0 24rpx 0;
- border-bottom: 1px solid #e6e6e6;
- }
- .item {
- display: flex;
- align-items: center;
- .title {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- width: 180rpx;
- }
- .value {
- /deep/.uni-input-input {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- }
- }
- }
- }
- .business-license {
- .title {
- display: flex;
- justify-content: space-between;
- padding: 24rpx 0 20rpx;
- .title1 {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- }
- .title2 {
- color: #999999;
- }
- }
- // 上传
- /deep/.u-list-item {
- width: 686rpx;
- height: 360rpx !important;
- }
- /deep/.u-add-btn {
- color: #ACBAC9;
- font-size: 96rpx
- }
- /deep/.uicon-plus[data-v-2ee87dc9]:before {
- font-size: 72rpx;
- }
- }
- }
- //认证成功
- .success {
- background-color: #fff;
- .img-box {
- display: flex;
- justify-content: center;
- width: 686rpx;
- height: 596rpx;
- margin: 0 auto;
- padding: 48rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- // 信息
- .infos-box {
- .item {
- display: flex;
- align-items: center;
- padding: 24rpx;
- margin: 0 32rpx;
- border-bottom: 1px solid #e3e3e3;
- .title {
- color: rgba(119, 119, 119, 1);
- font-size: 16px;
- width: 190rpx;
- }
- .value {
- color: rgba(51, 51, 51, 1);
- font-size: 16px;
- }
- }
- }
- }
- //提示
- .tips {
- padding: 24rpx 32rpx;
- .tips-item {
- display: flex;
- margin-bottom: 24rpx;
- font-size: 24rpx;
- line-height: 34rpx;
- .icon {
- width: 32rpx;
- height: 32rpx;
- img {
- width: 100%;
- height: 100%;
- vertical-align: middle;
- }
- }
- .text {
- flex: 1;
- margin-left: 8rpx;
- }
- }
- }
- // 保存
- .save {
- background-color: rgba(34, 149, 255, 1);
- color: rgba(241, 241, 241, 1);
- font-size: 36rpx;
- height: 96rpx;
- margin: 40rpx 32rpx;
- border-radius: 50px;
- }
- </style>
|