123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485 |
- <template>
- <view class="content">
- <view class="box">
- <!-- <view class="red-box">
- 报名参与
- </view> -->
- <view class="box-1">
- <view class="box-left">
- 姓名<text class="imp"></text>:
- </view>
- <input type="text" value="" class="list-input" v-model="name" />
- </view>
- <view class="box-1">
- <view class="box-left">
- 出生年月:
- </view>
- <picker mode="date" :value="birth" fields="month" :start="startDate" :end="endDate" @change="bindDateChange" class="box-right">
- <view>{{ birth }}</view>
- </picker>
- </view>
- <view class="box-1">
- <view class="box-left">
- 性别:
- </view>
- <picker @change="bindPickerSex" :value="index" :range="array" class="box-right">
- <text>{{ sex }}</text>
- </picker>
- </view>
- <view class="box-1">
- <view class="box-left">
- 文化程度:
- </view>
- <picker @change="bindPickerEdu" :value="index" :range="chooseEdu" class="box-right">
- <text>{{ education }}</text>
- </picker>
- </view>
- <view class="box-1">
- <view class="box-left">
- 民族:
- </view>
- <input type="text" value="" class="list-input" v-model="mz" />
- </view>
- <view class="box-1">
- <view class="box-left">
- 职位:
- </view>
- <input type="text" value="" class="list-input" v-model="specialty" />
- </view>
- <view class="box-1">
- <view class="box-left">
- 地址:
- </view>
- <input type="text" value="" class="list-input" v-model="address" />
- </view>
- <view class="box-1">
- <view class="box-left">
- 身份证号码:
- </view>
- <input type="text" value="" class="list-input" v-model="card" />
- </view>
- <view class="box-1">
- <view class="box-left">
- 联系电话:
- </view>
- <input type="text" value="" class="list-input" v-model="phone" />
- </view>
- <view class="box-1">
- <view class="box-left">
- 工作单位:
- </view>
- <input type="text" value="" class="list-input" v-model="work" />
- </view>
- <view class="upload-box">
- <view class="upload-left">
- 证件:
- </view>
- <view class="upload-right">
- <image :src="cardimg" mode="" class="upload-img" @click.stop="imgsub" v-if="cardimg"></image>
- <image src="../../static/images/upload.png" class="upload-img" mode="" v-if="!cardimg" @click.stop="imgsub"></image>
- </view>
- </view>
- </view>
- <view class="buttom" :class="{ action: loding }" @click="!loding?join():''">
- 提交申请
- </view>
- </view>
- </template>
- <script>
- import {
- joinSec
- } from '@/api/index.js';
- import {
- upload
- } from '@/api/ask.js';
- export default {
- data() {
- const currentDate = this.getDate({
- format: true
- })
- return {
- loding: false, //是否提交中
- array: ['男', '女'],
- chooseEdu: ['博士后', '博士', '硕士', '本科', '专科', '其他'],
- chooseVol: ['是', '否'],
- chooseExp: ['是', '否'],
- index: 0,
- mz: '',
- cardimg: '', //证件照
- card: '',
- checklist: [],
- name: '',
- sex: '',
- birth: '',
- phone: '',
- address: '',
- work: '',
- specialty: '',
- education: '',
- }
- },
- computed: {
- startDate() {
- return this.getDate('start');
- },
- endDate() {
- return this.getDate('end');
- }
- },
- methods: {
- async join() {
- let obj = this;
- if (obj.name == '') {
- obj.$api.msg('请输入您的姓名');
- return;
- }
- if (obj.birth == '') {
- obj.$api.msg('请选择出生年月');
- return
- }
- if (obj.sex == '') {
- obj.$api.msg('请输入您的性别');
- return;
- }
- if (obj.education == '') {
- obj.$api.msg('请选择您的文化程度');
- return;
- }
- if (obj.mz == '') {
- obj.$api.msg('请填写您所属的民族');
- return;
- }
- if (obj.specialty == '') {
- obj.$api.msg('请填写您的职位');
- return;
- }
- if (obj.address == '') {
- obj.$api.msg('请填写您的地址');
- return;
- }
- let reg1 =
- /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
- if (!reg1.test(obj.card)) {
- obj.$api.msg('请填写正确的身份证信息');
- return;
- }
- const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
- if (!reg.test(obj.phone)) {
- obj.$api.msg('请填写正确的手机号码');
- return;
- }
-
- // /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
- if (obj.work == '') {
- obj.$api.msg('请填写您的工作单位');
- return;
- }
- if (obj.cardimg == '') {
- obj.$api.msg('请上传您的证件');
- return
- }
-
- if (obj.specialty == '') {
- obj.$api.msg('请填写您的职位');
- return;
- }
- // if (obj.education == '') {
- // obj.$api.msg('请填写您的教育程度');
- // return;
- // }
- // if (obj.is_vol == '') {
- // obj.$api.msg('请填写您的是否受过志愿服务');
- // return;
- // }
- // if (obj.is_experience == '') {
- // obj.$api.msg('请填写您的有无服务经验');
- // return;
- // }
- obj.loding = true;
- joinSec({
- name: obj.name,
- sex: obj.sex,
- education: obj.education,
- birth: obj.birth,
- mz: obj.mz,
- phone: obj.phone,
- address: obj.address,
- work: obj.work,
- specialty: obj.specialty,
- img: obj.cardimg,
- card: obj.card,
- }).then(e => {
- obj.name = '';
- obj.sex = '';
- obj.education = '';
- obj.birth = '';
- obj.mz = '',
- obj.phone = '';
- obj.address = '';
- obj.work = '';
- obj.specialty = '';
- obj.cardimg = '',
- obj.card = ''
- uni.navigateTo({
- url: '../joinSuc/joinNow'
- });
- }).catch(function(e) {
- console.log('出错了')
- console.log(e);
- });
- },
- imgsub() {
- console.log('imgsub')
- upload({
- filename: ''
- }).then(data => {
- this.cardimg = data[0].url;
- })
- },
- // 选择性别
- bindPickerSex: function(e) {
- console.log(this.array[e.target.value])
- this.sex = this.array[e.target.value];
- this.index = e.target.value + 1;
- },
- // 选择教育程度
- bindPickerEdu: function(e) {
- this.education = this.chooseEdu[e.target.value];
- this.index = e.target.value + 1;
- },
- // 选择日期
- bindDateChange: function(e) {
- this.birth = e.target.value
- },
- // 是否参加志愿活动
- bindPickerVol: function(e) {
- this.is_vol = this.chooseVol[e.target.value];
- this.index = e.target.value + 1;
- },
- // 有无服务经验
- bindPickerExp: function(e) {
- this.is_experience = this.chooseExp[e.target.value];
- this.index = e.target.value + 1;
- },
- getDate(type) {
- const date = new Date();
- let year = date.getFullYear();
- let month = date.getMonth() + 1;
- let day = date.getDate();
- if (type === 'start') {
- year = year - 60;
- } else if (type === 'end') {
- year = year + 2;
- }
- month = month > 9 ? month : '0' + month;;
- day = day > 9 ? day : '0' + day;
- return `${year}-${month}-${day}`;
- },
- // 选择可提供时间
- // this.quantum = item.detail.value.join(',');
- checktime1(e) {
- // var items = this.timeList,
- // let quantum = [];
- this.quantum = e.detail.value.join(',');
- console.log(this.quantum);
- },
- checktime2(e) {
- // var items = this.timeList,
- let values = e.detail.value;
- // let quantum = [];
- console.log(values);
- },
- checktime3(e) {
- // var items = this.timeList,
- let values = e.detail.value;
- // let quantum = [];
- console.log(values);
- },
- //选择有兴趣参与的工作
- checkjob(item) {
- this.taste = item.detail.value.join(',');
- },
- // 选择专长checkspeciality
- checkspeciality(item) {
- this.speciali = item.detail.value.join(',');
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #f3afad;
- }
- .content {
- padding-top: (44vw/7.5);
- background-color: #f3afad;
- .buttom {
- width: (660vw/7.5);
- height: (100vw/7.5);
- background: linear-gradient(0deg, #C90F1B, #F14D33);
- border-radius: (50vw/7.5);
- margin: (50vw/7.5) auto;
- font-size: (36vw/7.5);
- font-weight: 400;
- color: #FFFFFF;
- line-height: (100vw/7.5);
- text-align: center;
- &.action {
- background: #999999;
- }
- }
- .box {
- // margin-top: 44(vw/7.5);
- width: (690vw/7.5);
- margin: (20vw/7.5) auto 0;
- background-color: #FFFFFF;
- border-radius: (10vw/7.5);
- padding: (28vw/7.5) (20vw/7.5) (32vw/7.5) (20vw/7.5);
- position: relative;
- .red-box {
- width: (405vw/7.5);
- line-height: (66vw/7.5);
- text-align: center;
- background: linear-gradient(0deg, #C90F1B, #F14D33);
- border-radius: (10vw/7.5);
- font-size: (30vw/7.5);
- font-weight: 500;
- color: #FFFFFF;
- // position: relative;
- position: absolute;
- top: (-36vw/7.5);
- left: 50%;
- transform: translateX(-50%);
- z-index: 1;
- }
- .box-check {
- font-size: (28vw/7.5);
- font-weight: 500;
- color: #666666;
- line-height: (100vw/7.5);
- }
- .imp {
- color: red;
- margin-left: (5vw/7.5);
- }
- .box-1 {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 100%;
- margin-top: (32vw/7.5);
- // height: 133(vw/7.5);
- .box-left {
- padding-left: (2vw/7.5);
- width: 100%;
- text-align: left;
- color: #E63931;
- font-size: (24vw/7.5);
- }
- input{
- height: (66vw/7.5);
- line-height: (66vw/7.5);
- margin-top: (32vw/7.5);
- // height: 88(vw/7.5);
- }
- .list-input {
- padding-left: (24vw/7.5);
- // margin: 12(vw/7.5) 0 ;
-
- // line-height: 66(vw/7.5);
- display: flex;
- align-items: center;
- width: 100%;
- font-size: (36vw/7.5);
- flex: 1;
- color: #FF9797;
- border: (1vw/7.5) solid #f3afad;
- border-radius: (22vw/7.5);
- text-align: left;
- padding-right: (24vw/7.5);
- .input-placeholder {
- height: (70vw/7.5);
- color: #FF9797;
- }
- }
- .box-right {
- display: flex;
- align-items: center;
- padding-left: (24vw/7.5);
- height: (66vw/7.5);
- line-height: (66vw/7.5);
- border: (1vw/7.5) solid #f3afad;
- border-radius: (22vw/7.5);
- margin: (32vw/7.5) (36vw/7.5) 0 (36vw/7.5);
- width: 96%;
- font-size: (36vw/7.5);
- color: #FF9797;
- text-align: left;
- // line-height: 1;
- }
- }
- .upload-box {
- width: 100%;
- height: (247vw/7.5);
- background: #FFFFFF;
- // border: 1px solid #E63931;
- border-radius: (27vw/7.5);
- display: flex;
- flex-direction: column;
- padding: (30vw/7.5) (40vw/7.5) (30vw/7.5) 0;
- margin: 0 auto 30(vw/7.5);
-
- .upload-left {
- font-weight: 400;
- color: #E63931;
- font-size: (24vw/7.5);
- }
-
- .upload-right {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .upload-img {
- width: (103vw/7.5);
- height: (103vw/7.5);
- margin-top: (24vw/7.5);
- }
- }
- }
- }
- }
- </style>
|