sc
This commit is contained in:
@@ -84,13 +84,6 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/me/tijian",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "上传证件照",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/me/school",
|
"path": "pages/me/school",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -146,19 +139,13 @@
|
|||||||
"navigationBarTitleText": "支付结果",
|
"navigationBarTitleText": "支付结果",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "pages/index/trueTest",
|
"path": "pages/index/trueTest",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "真实考场模拟",
|
"navigationBarTitleText": "真实考场模拟",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/me/uploadPic",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "上传证件照",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/secretPapers",
|
"path": "pages/index/secretPapers",
|
||||||
@@ -176,24 +163,21 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/activity",
|
"path": "pages/index/activity",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
|
||||||
"navigationBarTitleText": "活动",
|
"navigationBarTitleText": "活动",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/me/myGift",
|
"path": "pages/me/myGift",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
|
||||||
"navigationBarTitleText": "我的奖品",
|
"navigationBarTitleText": "我的奖品",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/me/qrCode",
|
"path": "pages/me/qrCode",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
|
||||||
"navigationBarTitleText": "核销二维码",
|
"navigationBarTitleText": "核销二维码",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
@@ -218,7 +202,8 @@
|
|||||||
"selectedColor": "#05C341",
|
"selectedColor": "#05C341",
|
||||||
"backgroundColor": "#FFFFFF",
|
"backgroundColor": "#FFFFFF",
|
||||||
"color": "#999999",
|
"color": "#999999",
|
||||||
"list": [{
|
"list": [
|
||||||
|
{
|
||||||
"pagePath": "pages/index/index",
|
"pagePath": "pages/index/index",
|
||||||
"iconPath": "static/image/tabbar/tab-home.png",
|
"iconPath": "static/image/tabbar/tab-home.png",
|
||||||
"selectedIconPath": "static/image/tabbar/tab-home-selected.png",
|
"selectedIconPath": "static/image/tabbar/tab-home-selected.png",
|
||||||
|
|||||||
@@ -42,9 +42,9 @@
|
|||||||
} from '@/jtools/api/question';
|
} from '@/jtools/api/question';
|
||||||
import Subject1 from "./components/Subject1";
|
import Subject1 from "./components/Subject1";
|
||||||
import Subject2 from "./components/Subject2";
|
import Subject2 from "./components/Subject2";
|
||||||
import {
|
// import {
|
||||||
queryActivityList
|
// queryActivityList
|
||||||
} from '@/jtools/api/activity';
|
// } from '@/jtools/api/activity';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Subject1,
|
Subject1,
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
if (this.subject == '2' || this.subject == '3') {
|
if (this.subject == '2' || this.subject == '3') {
|
||||||
this.$refs.subjectRef.getDiverType()
|
this.$refs.subjectRef.getDiverType()
|
||||||
}
|
}
|
||||||
this.queryActivityList()
|
// this.queryActivityList()
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.show = false
|
this.show = false
|
||||||
|
|||||||
@@ -83,11 +83,6 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<u-icon size="24" name="gift"></u-icon>
|
<u-icon size="24" name="gift"></u-icon>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
|
||||||
<u-cell size="large" title="我的体检" isLink @tap="handleTJ">
|
|
||||||
<template #icon>
|
|
||||||
<img src="/static/image/mine/wdtj.png" style="width: 24px;height: 24px;">
|
|
||||||
</template>
|
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<u-cell size="large" title="我的题库" :value="carName" @tap="toChangeCarType">
|
<u-cell size="large" title="我的题库" :value="carName" @tap="toChangeCarType">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -222,19 +217,6 @@ export default {
|
|||||||
this.toLogin()
|
this.toLogin()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleTJ() {
|
|
||||||
if (this.isLogin) {
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pages/me/tijian'
|
|
||||||
// })
|
|
||||||
uni.showToast({
|
|
||||||
title: '敬请期待',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.toLogin()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toLogin() {
|
toLogin() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
|
|||||||
@@ -15,15 +15,6 @@
|
|||||||
<u-icon name="arrow-right" color="#999" />
|
<u-icon name="arrow-right" color="#999" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="flex jc-sb ai-c bb1" style="height: 110rpx;">
|
|
||||||
<view class="title">身份证号</view>
|
|
||||||
<view class="m30lr fs14 cor-333">{{sfzNum}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="flex ai-c" style="height: 110rpx;" @tap="toUploadPic">
|
|
||||||
<view class="title">证件照</view>
|
|
||||||
<view class="m30lr fs14 cor-333 fl1"></view>
|
|
||||||
<u-icon name="arrow-right" color="#999" />
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -40,11 +31,6 @@
|
|||||||
this.sfzNum=storage.get('sfzNum') || ''
|
this.sfzNum=storage.get('sfzNum') || ''
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toUploadPic(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/me/uploadPic'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,214 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="">
|
|
||||||
<view class="wp100 bc-fff p14">
|
|
||||||
<view class="title fontColor">第一步 上传学员图像</view>
|
|
||||||
<view class="mt15">
|
|
||||||
<!-- <u-upload width="165" height="165" :file-list=" fileList1" multiple :max-count="1" @afterRead="afterRead" @delete="deletePic" /> -->
|
|
||||||
<!-- <u-upload ref="uUpload" class="mt25" :size-type="['compressed']" :file-list="fileList1" deletable :multiple="false" :max-count="1" width="165rpx" height="165rpx" @afterRead="afterRead" @delete="deletePic" /> -->
|
|
||||||
<view style="width: 320rpx;height:300rpx;background-color: rgb(247, 255, 255);border-radius: 20rpx;">
|
|
||||||
<view style="width: 320rpx;height:240rpx;" class="flex jc-c ai-c">
|
|
||||||
<image v-if="fileList&&fileList.length" style="width: 240rpx;height: 240rpx;" :src="fileList[0].url">
|
|
||||||
</image>
|
|
||||||
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
|
||||||
</view>
|
|
||||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
|
|
||||||
height="150">
|
|
||||||
<view
|
|
||||||
style="width: 320rpx;height:60rpx;line-height:60rpx;background-color: #05C341;border-radius: 0 0 20rpx 20rpx;"
|
|
||||||
class="text-center cor-fff">
|
|
||||||
点击
|
|
||||||
</view>
|
|
||||||
</u-upload>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="mt20">
|
|
||||||
<view class="title fontColor">第二步 核实后再提交</view>
|
|
||||||
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
|
|
||||||
<u-form-item label="姓名" :required="true" prop="idCardName" borderBottom ref="item1">
|
|
||||||
<u--input v-model="form.idCardName" border="none"></u--input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="身份证号" :required="true" prop="sfzmhm" borderBottom ref="item2">
|
|
||||||
<u--input v-model="form.sfzmhm" border="none"></u--input>
|
|
||||||
</u-form-item>
|
|
||||||
</u--form>
|
|
||||||
</view>
|
|
||||||
<view style="margin-top: 20px;">
|
|
||||||
<u-button type="primary" :style="{width: '100%',borderRadius:'40rpx',backgroundColor:'#05C341'}" :disabled="saving" text="提交"
|
|
||||||
@click="submit" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import storage from '@/jtools/storage';
|
|
||||||
import {
|
|
||||||
addInfo,
|
|
||||||
} from '@/jtools/api/index';
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
const shenfenzhen = (rule, value, callback) => {
|
|
||||||
/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value) ? callback() : callback(
|
|
||||||
new Error('请输入正确的身份证号'))
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
form: {
|
|
||||||
idCardName: '',
|
|
||||||
sfzmhm: ''
|
|
||||||
},
|
|
||||||
driverLicenseImg:'',
|
|
||||||
fileList:[],
|
|
||||||
fileList1: [],
|
|
||||||
uploadList: [],
|
|
||||||
saving: false,
|
|
||||||
rules: {
|
|
||||||
idCardName: [{
|
|
||||||
required: true,
|
|
||||||
message: '请输入姓名',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
}],
|
|
||||||
sfzmhm: [{
|
|
||||||
required: true,
|
|
||||||
message: '请输入身份证号',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
},{
|
|
||||||
// 自定义验证函数,见上说明
|
|
||||||
validator: shenfenzhen,
|
|
||||||
message: '身份证号码不正确',
|
|
||||||
// 触发器可以同时用blur和change
|
|
||||||
trigger: ['change', 'blur'],
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onReady() {
|
|
||||||
this.$refs.form1.setRules(this.rules);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 删除图片
|
|
||||||
deletePic(event) {
|
|
||||||
this.fileList1.splice(event.index, 1);
|
|
||||||
this.uploadList.splice(event.index, 1);
|
|
||||||
},
|
|
||||||
// 新增图片
|
|
||||||
async afterRead(event) {
|
|
||||||
let imageInfoObj = await uni.getImageInfo({src: event.file[0].url})
|
|
||||||
console.log(imageInfoObj);
|
|
||||||
if(imageInfoObj.width!=720&&imageInfoObj.height!=720){
|
|
||||||
uni.showToast({
|
|
||||||
icon:'error',
|
|
||||||
title:'证件照尺寸有误'
|
|
||||||
})
|
|
||||||
this.fileList=[]
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
this.driverLicenseImg = this.urlTobase64(event.file[0].url)
|
|
||||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
||||||
const lists = [].concat(event.file);
|
|
||||||
this.fileList=lists
|
|
||||||
this.fileList1 = [];
|
|
||||||
uni.showToast({
|
|
||||||
title:'上传成功!'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
uploadFilePromise(url) {
|
|
||||||
this.saving = true;
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
uni.uploadFile({
|
|
||||||
url: process.env.VUE_APP_BASE_API + 'mongodb/uploadFile', // 仅为示例,非真实的接口地址
|
|
||||||
filePath: url,
|
|
||||||
name: 'file',
|
|
||||||
success: (res) => {
|
|
||||||
// setTimeout(() => {
|
|
||||||
resolve(JSON.parse(res.data).data);
|
|
||||||
// }, 100);
|
|
||||||
this.saving = false;
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
resolve(null);
|
|
||||||
this.saving = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 提交
|
|
||||||
submit() {
|
|
||||||
this.$refs.form1.validate().then((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const param={
|
|
||||||
driverLicenseImg:this.driverLicenseImg,
|
|
||||||
...this.form,
|
|
||||||
schoolOrgCode:'340103000700',
|
|
||||||
operater:'1d08daf852cf4ee28f67cb583f538cbf'
|
|
||||||
}
|
|
||||||
addInfo(param).then(resp=>{
|
|
||||||
uni.showToast({
|
|
||||||
title:"提交成功!",
|
|
||||||
duration:2000,
|
|
||||||
})
|
|
||||||
setTimeout(()=>{
|
|
||||||
uni.navigateBack()
|
|
||||||
},1000)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
console.log('验证失败');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
urlTobase64(url){
|
|
||||||
let base64=''
|
|
||||||
console.log(url);
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
uni.getFileSystemManager().readFile({
|
|
||||||
filePath: url, //选择图片返回的相对路径
|
|
||||||
encoding: 'base64', //编码格式
|
|
||||||
success: res => { //成功的回调
|
|
||||||
console.log(res);
|
|
||||||
base64 = 'data:image/jpeg;base64,' + res.data //不加上这串字符,在页面无法显示的哦
|
|
||||||
resolve(base64);
|
|
||||||
},fail: (e) => {
|
|
||||||
console.log("图片转换失败");
|
|
||||||
reject(e)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.upload-img {
|
|
||||||
width: 165rpx;
|
|
||||||
height: 165rpx;
|
|
||||||
border: 1px dashed #c4c4c4;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fontColor {
|
|
||||||
color: #383838;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .u-textarea__count {
|
|
||||||
background-color: #f9faf9 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .u-upload__button>.u-icon>.u-icon__icon {
|
|
||||||
font-size: 90rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .u-button--square {
|
|
||||||
border-radius: 40rpx !important;
|
|
||||||
}
|
|
||||||
::v-deep .u-button--primary{
|
|
||||||
background-color: #05C341 !important;
|
|
||||||
border-color: #05C341 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user