From 8b7d180fcf485c57dcbad73e70bba12b0aa137b2 Mon Sep 17 00:00:00 2001 From: chenteng <17864191895@163.com> Date: Mon, 10 Aug 2020 13:35:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/user/myInfo/index.js | 67 ++++++++++++++++++++++++++++++++---- pages/user/myInfo/index.wxml | 2 +- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/pages/user/myInfo/index.js b/pages/user/myInfo/index.js index 9c922fc..1da04b9 100644 --- a/pages/user/myInfo/index.js +++ b/pages/user/myInfo/index.js @@ -34,9 +34,15 @@ Page({ temp:String, type:String, value:String, + defaultValue:'请输入修改后的内容' }, getUserInfo(event) { + console.log("getUserInfo"); + console.log(event); + + + }, onClose() { @@ -49,9 +55,6 @@ Page({ //判断名字长度,限制名字长度10个字之内,姓名不能为空 if(this.data.type === 'userName'){ console.log("username"); - // console.dir(this.data.realData); - // console.log(this.data.realData); - // console.log(this.data.realData.length); if(this.data.realData.length > 10){ wx.showToast({ title: '姓名长度应小于10', @@ -110,7 +113,8 @@ Page({ this.setData({ value:'', realData:'', - tempData:'' + tempData:'', + defaultValue:'请输入修改后的内容' }) }, @@ -156,16 +160,67 @@ Page({ onTapItem(e) { const { type } = e.currentTarget.dataset + console.log('onTapItem'); + console.log(type); + console.log(e); this.setData({ type:type }) if(type === 'userIcon'){ this.upload() + return }else{ this.setData({ show:true - }) - } + }) + //姓名 + if(type =='userName'&&this.data.nickName!=''){ + this.setData({ + defaultValue:this.data.nickName + }) + } + //年龄 + if(type =='userAge'&&this.data.age!=''){ + this.setData({ + defaultValue:this.data.age + }) + } + //工作单位 + if(type =='workUnit'&&this.data.company!=''){ + this.setData({ + defaultValue:this.data.company + }) + } + //职务 + if(type =='position'&&this.data.position!=''){ + this.setData({ + defaultValue:this.data.position + }) + } + //职称 + if(type =='userProfessionalTitle'&&this.data.professionalTitle!=''){ + this.setData({ + defaultValue:this.data.professionalTitle + }) + } + //人才称号 + if(type =='userTalentTitle'&&this.data.talentTitle!=''){ + this.setData({ + defaultValue:this.data.talentTitle + }) + } + //荣誉 + if(type =='userPrize'&&this.data.prize!=''){ + this.setData({ + defaultValue:this.data.prize + }) + } + return + } + this.setData({ + defaultValue:'请输入修改后的内容' + }) + }, upload(){ diff --git a/pages/user/myInfo/index.wxml b/pages/user/myInfo/index.wxml index 8f37797..f600e74 100644 --- a/pages/user/myInfo/index.wxml +++ b/pages/user/myInfo/index.wxml @@ -141,7 +141,7 @@ bind:getuserinfo="getUserInfo" bind:confirm="vantConfirm" > - +