123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- //import * as WxJsApi from '@/utils/wxJsApi.js'
- import * as API from '@/apis/job/install.js'
- import * as API_common from '@/apis/common.js'
- import * as WxJsApi from '@/utils/wxJsApi.js'
- export default {
- data() {
- return {
- isReady:true,
- endyear:2020,
- pickerShow:false,
- form: {
- name: '',
- sex: '',
- value:''
- },
- leftStyle:{
- color: '#2979ff',
- fontSize:'32rpx',
- },
- actionSheetList: [
- {
- id:1,
- text: '男'
- },
- {
- id:0,
- text: '女'
- },
- {
- id:2,
- text: '保密'
- }
- ],
- pickerShowSList:[],
- pickerShowS:false,
- actionSheetShow: false,
- }
- },
- methods: {
- uploadPic(){
- if(!this.isReady){
- return
- }
- WxJsApi.chooseImage().then(res=>{
-
- var formData = {
- 'photoName': '1.jpg',
- 'photoFile': res.localData
- }
- uni.showLoading({
- title:"加载中",mask:true,
- })
-
- API_common.uploadBase64(formData).then(response => {
-
- this.form.headImageUrl=response.data;
-
- uni.showToast({
- title:"上传成功",
- icon:"none"
- })
- this.$forceUpdate()
- }).catch(error => {
- uni.showToast({
- title:error,
- icon:"none"
- })
- })
- })
-
- },
- selectpicker(item){
-
- this.form.birthday=item.year+"-"+item.month+"-"+item.day;
- },
- // 点击actionSheet回调
- save(){
-
- var form=this.form;
- var error=""
- if(!form.realName){
- error="请输入姓名"
- }else if(!form.sex){
- error="请选择性别"
- }else if(!form.birthday){
- error="请选择出生年月"
- }else if(!form.address){
- error="请输入常驻地区"
- }else if(!form.firstJobTime){
- error="请选择参加工作时间"
- }
-
- if(error){
- uni.showToast({
- title:error
- })
- return false;
- }
-
- uni.showLoading({
- title:"加载中",mask:true,
- })
- API.saveInformation(this.form).then((res)=>{
- uni.showToast({
- title:res.data
- })
- this.carhelp.setPersonInfo(this.form);
- // uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title:error
- })
- })
- },
- selectpickerS(item){
-
- this.form.firstJobTime=item[0].label+item[1].label;
- },
- getInfo() {
- uni.showLoading({
- title:"加载中",mask:true,
- })
- API.myInformation().then((res)=>{
-
- this.form=res.data;
- uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
- title:error
- })
-
- })
- },
- },
- onReady(){
- WxJsApi.getWxConfig(['chooseImage']).then(()=>{
- this.isReady=true
- });
-
- var list=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]
- list=list.map((item)=>{
- return {
- value:item,
- label:item,
- }
- })
- var year=new Date().getYear()+1900;
-
- this.endyear=year-5;
-
-
- console.log(this.endyear)
- var list2=[];
-
- for(var i=0;i< 40;i++){
- list2.push({
- value:year-i+"年",
- label:year-i+"年",
- children:list
- })
- }
- this.pickerShowSList.push(list2)
- this.pickerShowSList.push(list)
-
- this.getInfo()
- }
- }
|