ufutx_love_mp/src/pages/users/degreeCertificate.wpy

715 lines
24 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view v-if="accomplish == 1 && !up">
<view class="certificate_title">
<view class="font_30 color-333 bold title">
<view class="img" style="background-image:url(https://images.ufutx.com/202104/29/5cefaa65f4103540201b7f9ec8bb4faf.png);"></view>
学历已认证
</view>
<view class="font_28 color-666" style="margin-bottom:30rpx;">用于验证《中国高等教育学历认证》的真实性,支持【学信网】【毕业证书】【留学服务中心证书】等方式认证,承诺保障信息安全。</view>
<view class="way pass animation-slide-bottom">
<view class="font_28 color-000 textStyle bold">认证方式</view>
<view class="certificate">
<view class="font_28 color-333" style="margin-right:10rpx;">{{manner[mannerIndex]}}</view>
</view>
</view>
<block v-if="mannerIndex == 0">
<view class="way pass animation-slide-bottom" v-if="user.graduate_school">
<view class="font_28 color-000 textStyle bold">毕业院校</view>
<view class="certificate">
<view class="font_28 color-333" style="margin-right:10rpx;">{{user.graduate_school}}</view>
</view>
</view>
<view class="way pass animation-slide-bottom" v-if="user.degree">
<view class="font_28 color-000 textStyle bold">最高学历</view>
<view class="certificate">
<view class="font_28 color-333" style="margin-right:10rpx;">{{user.degree}}</view>
</view>
</view>
<view class="animation-slide-bottom certificateText" v-if="user.educate_photo">
<view class="font_28 color-000 textStyle bold">毕业证书</view>
<view class="certificateImg">
<view class="img" style="{{'background-image:url(' + user.educate_photo + ');'}}"></view>
</view>
</view>
</block>
<block v-else>
<view class="way pass animation-slide-bottom" v-if="user.chsi_code">
<view class="font_28 color-000 textStyle bold">在线验证码</view>
<view class="certificate">
<view class="font_28 color-333" style="margin-right:10rpx;">{{user.chsi_code}}</view>
</view>
</view>
</block>
</view>
</view>
<view v-else class="">
<view class="certificate_title">
<view class="font_28 color-666">用于验证《中国高等教育学历认证》的真实性,支持【学信网】【毕业证书】【留学服务中心证书】等方式认证,承诺保障信息安全。</view>
<view class="way animation-slide-bottom">
<view class="font_28 color-000 textStyle bold">认证方式</view>
<view class="certificate" bindtap="mannerChange">
<view class="font_28 color-333" style="margin-right:10rpx;">{{manner[mannerIndex]}}</view>
<view class="triangle"></view>
</view>
<view v-if="hint" class="hintImg" style="background-image:url(https://images.ufutx.com/202104/27/e536a423a145ae12ab4f6dc57f58588d.png);">点此更换认证方式</view>
</view>
</view>
<!-- 学位证书 -->
<view :class="{'show':mannerIndex == 0}" class="information_box hidden">
<view class="inputBox animation-slide-bottom" style="animation-delay: 0.1s;">
<view class="font_28 textStyle bold">毕业院校</view>
<view catchtap="handleScroll">
<input :value="school" ref="inputRef" disabled type="text" class="inputStyle font_30" readonly placeholder="请输入你的毕业院校" />
</view>
</view>
<view class="inputBox animation-slide-bottom" style="animation-delay: 0.1s;">
<picker mode="selector" value="{{degreeIndex}}" range="{{degree}}" bindchange="statureChange" >
<view class="font_28 textStyle bold">学历</view>
<view >
<input type="text" v-model="degree[degreeIndex]" disabled class="inputStyle font_30" readonly placeholder="请选择你的最高学历" />
</view>
</picker>
</view>
<view class="animation-slide-bottom">
<view class="font_30 color-333 bold">请上传你的毕业证书、学位证书或学信网截图</view>
<view class="font_28 color-999">(你上传的照片仅作认证使用,并将加密处理)</view>
<view class="upload_box">
<view class="text-center">
<view class="upload_sample_box">
<image class="sample_pic" src="https://images.ufutx.com/202012/28/12700c367130e75de1cd03ef0d042e78.png" mode="widthFix"></image>
</view>
<view class="font_24 color-666" style="margin-top: 4rpx">示例</view>
</view>
<view class="text-center" @tap="toUploadPic">
<view class="upload_sample_box">
<block v-if="!educate_photo">
<image class="upload_pic" src="https://images.ufutx.com/202012/28/d8b20596f3b37fb5efcd90612cd35e05.png" mode="widthFix" ></image>
</block>
<block v-else>
<image class="educate_photo" :src="educate_photo" mode="aspectFill" ></image>
</block>
</view>
<view class="font_24 color-666" style="margin-top: 4rpx">上传照片</view>
</view>
</view>
</view>
</view>
<!-- 在线认证 -->
<view class="information_box {{mannerIndex == 1 ? 'show':'hidden'}}">
<view class="inputBox animation-slide-bottom" style="animation-delay: 0.1s;">
<view class="font_28 textStyle bold">在线验证码</view>
<input v-model="attestation" type="text" class="inputStyle font_30" placeholder="请输入12-18位编号" />
</view>
<view class="verify animation-slide-bottom" @tap.stop="gotoBook">
<view class="title bold">获取学信网在线验证码</view>
<view class="main">按步骤操作即可获取学信网在线验证码</view>
<view class="rit"></view>
</view>
</view>
<view class="submit_box text-center">
<view class="Can_submit_button font_32" @tap="save" v-if="anew == 1">立即认证</view>
<view class="Can_submit_button font_32" @tap="save" v-else>重新认证</view>
</view>
<view class="main-logo text-center animation-slide-bottom">
<view style="margin-bottom: 22rpx;">
<image src="https://images.ufutx.com/202012/24/181993236787c898d25df284b5cb092e.png" mode="aspectFit" class="iconV2" v-if="active" @tap="activeFn"></image>
<image src="https://images.ufutx.com/202006/18/2b234f0a7d8c1b7f97e98ee597a1f2c1.png" mode="aspectFit" class="iconV2" v-else @tap="activeFn"></image>
<span class="font_24">
<span @tap="activeFn">请阅读并同意</span>
<span class="color-theme" @tap.stop="gotoApp('https://love.ufutx.com/h5/#/serviceAgreementV2')">《服务协议》</span>和
<span class="color-theme" @tap.stop="gotoApp('https://love.ufutx.com/h5/#/PrivacyAgreementV2')">《隐私协议》</span>
</span>
</view>
</view>
</view>
<view :class="{'show':modalName=='successfulModal'}" class="cu-modal">
<view class="successful_prompt_box">
<view style="padding: 60rpx 0 20rpx 0">
<image class="successful_pic" src="https://images.ufutx.com/202012/28/2168fa80aa80eb0f76ba71ac0e449c7e.png" mode="widthFix" ></image>
</view>
<view class="font_36 color-333 bold">认证已提交,等待审核</view>
<view class="font_28 color-333 prompt_text">审核结果将在13个工作日内通知请耐心等待如有需要请直接联系客服<span class="color-theme" @tap="callPhone('18922809346')">18922809346</span></view>
<view class="Know font_32" @tap="goToBack">我知道了</view>
</view>
</view>
<view class="popUp">
<view :class="{'show':modalName=='bottomModal'}" class="cu-modal bottom-modal " catchtap="hideModal"></view>
<view class="bouncedV3 ff" v-if="modalName=='bottomModal'">
<view class="cu-dialog dialog" style="border-radius: 30rpx 30rpx 0rpx 0rpx;">
<view>请选择学历认证方式</view>
<block v-for="(item,index) in manner" :key="index">
<view :class="{'col':mannerIndex == index}" catchtap="select" data-index="{{index}}">{{item}}</view>
</block>
<view bindtap="hideModal">取消</view>
</view>
</view>
</view>
<uploadPic :chooseShow.sync="choosePicsShow" @changeVal="changeVal" @closeUploadPic="closeUploadPic"></uploadPic>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config.js'
wepy.page({
mixins: [base, https],
data: {
state: '',
user: {},
modalName: '',
educate_photo: '',
degree: ['博士', '硕士', '本科', '大专', '其他'],
manner: ['毕业证/学位证书照片', '国内学信网在线认证'],
degreeIndex: '',
mannerIndex: 0,
school: '',
attestation: '',
ShowDegree: false,
init: false,
formId: [],
protocol: true,
shareImage: true,
active: true,
invite_pic: '',
tempId: [], // 模板id
system: wx.getStorageSync('system'),
approve_time: 0,
hint: true,
accomplish: '',
anew: 1,
up: '',
choosePicsShow: false,
inputRef: null
},
onShow(e) {
if (e && e.school) {
this.school = e.school
}
},
async onLoad(e) {
this.accomplish = e.typ ? e.typ : ''
this.up = e.up ? e.up : ''
this.anew = e.anew ? e.anew : 1
this.initPageData()
setTimeout(() => {
this.hint = false
}, 3000)
},
onPullDownRefresh() {
},
methods: {
onInput(e) {
console.log(e, 'eeee==2333=')
},
// 初始化页面数据
initPageData() {
this.$get({url: `${service.host}/user/approve/profile`}).then(({code, data}) => {
this.init = true
this.user = data.educate_info
if (this.user.graduate_school) {
this.school = this.user.graduate_school
}
if (this.user.educate_photo) {
this.educate_photo = this.user.educate_photo
}
if (this.user.degree) {
this.degree.forEach((item, index) => {
if (item == this.user.degree) {
this.degreeIndex = index
}
})
}
if (this.user.edc_type) {
this.mannerIndex = this.user.edc_type
console.log(this.user)
}
})
},
// 指定下标更换 ***
interceptAndReplace(str, frontLen, endLen, symbol) {
var len = str.length - frontLen - endLen
var xing = ''
for (var i = 0; i < len; i++) {
xing += symbol
}
return str.substring(0, frontLen) + xing + str.substring(str.length - endLen)
},
callPhone (phone) {
this.$callPhone(phone)
},
handleScroll() {
wx.navigateTo({url: '/pages/users/schools'})
},
gotoApp(url) {
wx.navigateTo({url: '/pages/books/bookDetail?url=' + encodeURIComponent(url)})
},
gotoBook(url) {
wx.navigateTo({url: '/pages/books/schoolVerify'})
},
activeFn(index) {
this.active = !this.active
},
statureChange(e) { // 身高Change
console.log(e.$wx.detail, 'detail')
this.degreeIndex = e.$wx.detail.value[0]
console.log(this.degreeIndex)
},
confirm() {
let vm = this
if (vm.degreeIndex == '') {
vm.degreeIndex = 0
}
this.modalName = ''
},
save() {
let vm = this,
data = {
educate_photo: vm.educate_photo,
graduate_school: vm.school,
degree: vm.degree[vm.degreeIndex]
}
// 在线认证
if (vm.mannerIndex == 1) {
data = {
educate_photo: '',
graduate_school: '',
degree: '',
chsi_code: vm.attestation
}
if (!vm.attestation) {
return vm.$showToast('请填写在线验证码')
} else if (vm.attestation.length > 11 && vm.attestation.length < 19) {
const englishAndNum = /^[A-Za-z0-9]+$/
if (!(englishAndNum.test(vm.attestation))) {
wx.showToast({ title: '请正确填写在线验证码', icon: 'none' })
return false
}
vm.$post({url: `${service.host}/user/approve/education`, data}).then(({code, data}) => {
vm.modalName = 'successfulModal'
})
console.log(vm.attestation)
} else {
return vm.$showToast('请正确填写在线验证码')
}
}
if (vm.mannerIndex == 0) {
console.log(vm.educate_photo, vm.school, vm.degree[vm.degreeIndex])
if (!vm.educate_photo || !vm.school || !vm.degree[vm.degreeIndex]) {
return vm.$showToast('请完善表单信息!')
}
if (!vm.active) {
return vm.$showToast('请先选择同意服务协议')
}
vm.$post({url: `${service.host}/user/approve/education`, data}).then(({code, data}) => {
vm.modalName = 'successfulModal'
})
}
},
goToBack () {
this.$gotoBack(1)
},
toUploadPic() { // 上传组件
let vm = this
vm.choosePicsShow = true
},
changeVal(e) {
let vm = this
vm.educate_photo = e[0].filePath
},
// 关闭弹窗
closeUploadPic() {
this.choosePicsShow = false
},
degreeChange(e) {
// this.ShowDegree = true
if (this.degreeIndex.length == 0) {
this.degreeIndex = [2]
}
this.modalName = 'bottomModals'
},
mannerChange(e) {
this.modalName = 'bottomModal'
},
select(e) {
let that = this
let index = e.currentTarget.dataset.index
that.mannerIndex = index
that.modalName = ''
},
hideModal(e) {
this.modalName = ''
}
}
})
</script>
<style lang="less">
page {
background: white;
}
.certificate_title{
padding: 20rpx 30rpx 30rpx 30rpx;
.way{
display: flex;
justify-content: space-between;
align-items: center;
animation-delay: 0.1s;
padding: 30rpx 0rpx;
.hintImg{
position: absolute;
display: flex;
color: #ffffff;
font-size: 24rpx;
line-height: 70rpx;
justify-content: center;
right: 12rpx;
bottom: -30rpx;
width: 230rpx;
height: 60rpx;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
.certificate{
position:relative;
display:flex;
align-items: center;
.triangle{
width: 0;
height: 0;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
border-top: 5px solid #515151;
}
}
}
.pass{
justify-content: left;
.certificate{
margin-left: 30rpx;
}
}
// ---------已认证------------
.title{
display: flex;
align-items: center;
margin-bottom: 20rpx;
.img{
width: 32rpx;
height: 36rpx;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
margin-right: 6rpx;
}
}
.certificateText{
display: flex;
justify-content: left;
padding: 30rpx 0;
.certificateImg{
width: 508rpx;
height: 360rpx;
margin-top: 6rpx;
padding: 30rpx;
background: #F5F5F5;
border-radius: 8rpx;
margin-left: 30rpx;
.img{
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
}
}
}
.information_box{
margin: 0 30rpx;
.inputBox{
margin-bottom: 30rpx;
text-align: left;
background: white;
padding-bottom: 10rpx;
border-bottom: 2rpx solid #f6f6f6;
overflow: hidden;
.textStyle{
color: #f33b6c;
margin-bottom: 14rpx;
}
}
.img{
padding: 30rpx 30rpx 0rpx 30rpx;
}
.verify{
position: relative;
height: 124rpx;
background: #F5F5F5;
border-radius: 8rpx;
padding: 0 30rpx;
margin-bottom: 76rpx;
display: flex;
flex-flow: column;
justify-content: space-evenly;
.title{
height: 40rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.main{
height: 34rpx;
font-size: 24rpx;
font-weight: 400;
color: #999999;
line-height: 34rpx;
}
.rit{
position: absolute;
top: 0;
right: 30rpx;
bottom: 0;
margin: auto;
border-right: 2rpx solid #AAAAAA;
border-top: 2rpx solid #AAAAAA;
height: 20rpx;
width: 20rpx;
transform: rotate(deg);
-webkit-transform: rotate(45deg);
border-left: 2rpx solid transparent;
border-bottom: 2rpx solid transparent;
}
}
.upload_box{
margin-top: 20rpx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.upload_sample_box{
position: relative;
display: inline-block;
width: 330rpx;
height: 250rpx;
background: #f5f5f5;
border-radius: 8rpx;
.sample_pic{
position: absolute;
left: 50%;
top: 50%;
margin-left: -136rpx;
margin-top: -96rpx;
width: 272rpx;
height: 192rpx;
}
.upload_pic{
position: absolute;
left: 50%;
top: 50%;
margin-left: -30rpx;
margin-top: -26rpx;
width: 60rpx;
height: 52rpx;
}
.educate_photo{
position: absolute;
left: 50%;
top: 50%;
margin-left: -136rpx;
margin-top: -96rpx;
width: 272rpx;
height: 192rpx;
}
}
}
}
.submit_box{
margin-top: 30rpx;
.submit_button, .Can_submit_button{
width: 650rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 88rpx;
background-image: linear-gradient(to right, #FF5380 0%, #FF85A5 100%);
opacity: 1;
color: #ffffff;
margin: 0 auto 20rpx auto;
}
.Can_submit_button{
opacity: 1;
}
}
.successful_prompt_box{
position: relative;
display: inline-block;
vertical-align: middle;
margin-left: auto;
margin-right: auto;
width: 600rpx;
max-width: 100%;
background-color: #ffffff;
border-radius: 24rpx;
overflow: hidden;
padding-bottom: 46rpx;
.successful_pic{
width: 180rpx;
height: 180rpx;
display: block;
margin: 0 auto;
}
.prompt_text{
padding: 48rpx 0 36rpx 0;
margin: 0 32rpx;
}
.Know{
width: 280rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 80rpx;
background: #ff5380;
color: #ffffff;
margin: 0 auto;
}
}
.show{
display: block;
}
.hidden{
display: none;
}
.dialog {
width: 100%;
background: white;
height: auto;
z-index: 1111;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
view {
height: 90rpx;
font-size: 30rpx;
text-align: center;
line-height: 90rpx;
margin: 0 30rpx;
color: #333333;
font-weight: 500;
border-top: 1rpx solid #f5f5f5;
}
view:first-of-type{
border-top: none;
font-size: 32rpx;
font-weight: 600;
}
view:nth-of-type(2){
border-top: none;
}
view:last-of-type {
color: #999999;
}
.col{
color: #FF5380;
}
}
.popUp{
.bouncedV3{
position: absolute;
bottom: 0;
z-index: 1111;
border-radius: 32rpx 32rpx 0 0;
background: #fff;
width: 100%;
height: auto;
overflow: hidden;
}
.bouncedV2{
position: absolute;
bottom: 0;
z-index: 1111;
border-radius: 32rpx 32rpx 0 0;
background: #fff;
width: 100%;
height: 40vh;
overflow: hidden;
.bounced{
position: absolute;
bottom: 0;z-index: 1111;
border-radius: 0;
background: #fff;
width: 100%;
height: 40vh;
}
._title{
padding: 30rpx 40rpx;
display: flex;
justify-content: space-between;
}
.picker-content-item {
width: 100%;
height: 350rpx;
text-align: center;
margin-bottom: 32rpx;
.tex{
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
.picker_column_item{
height: 70rpx;
line-height: 70rpx;
}
}
.cu-modal_nextStep{
width: 260rpx;
height: 72rpx;
line-height: 72rpx;
position: absolute;
bottom: 60rpx;
left: 33%;
border-radius: 60rpx;
z-index: 99999;
background-image: linear-gradient(to right, #FF5380 0%, #FF85A5 100%);
color: #ffffff;
}
}
}
.main-logo{
width: 100%;
position: absolute;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
right: 0;
.logo{
width: 180rpx;
height: 100rpx;
}
.iconV2{
width: 28rpx;
height: 28rpx;
vertical-align: middle;
margin-right: 8rpx;
margin-top: -2rpx;
}
}
</style>
<config>
{
navigationBarTitleText: '学历认证',
enablePullDownRefresh: true,
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: {
uploadPic: '~@/components/uploadPic'
}
}
</config>