diff --git a/models/user.js b/models/user.js index a883110..0ab5168 100644 --- a/models/user.js +++ b/models/user.js @@ -41,8 +41,15 @@ class UserModel extends HTTP { avatar: data.avatarUrl, realName: data.nickName, phone: data.phone, + departId:data.street, + age:data.age, + gender:data.genderIndex, company: data.company, - position: data.position + position: data.position, + education:data.educationIndex, + title:data.professionalTitle, + designation:data.talentTitle, + honor:data.prize }, success: success } diff --git a/pages/topics/talents/index.js b/pages/topics/talents/index.js index a4a9681..3fea50f 100644 --- a/pages/topics/talents/index.js +++ b/pages/topics/talents/index.js @@ -136,14 +136,6 @@ Component({ }, submit() { - // if (this.data.messageTitle === '') { - // wx.showModal({ - // title: '提示', - // content: '请输入标题', - // showCancel: false - // }) - // return - // } if (this.data.messageDetail === ''){ wx.showModal({ title: '提示', @@ -161,33 +153,16 @@ Component({ }) return } - //仿照这个方法添加文本,图片,街道 - // topicModel.addMessage(this.data.messageTitle, this.data.messageDetail,this.data.files,res=>{ - // if(res.code === 200){ - // this.setData({ - // messageTitle:'', - // messageDetail: '', - // files:[], - // },()=>{ - // wx.showToast({ - // title: res.message, - // icon: 'none' - // }) - // }) - // } - // }) - topicModel.addTalents(this.data.messageDetail, this.data.files,this.data.streetID,res=>{ + const id = res.result; + console.log("得到id值"); + console.log(id); if(res.code === 200){ this.setData({ messageDetail: '', streetID:'', files:[], },()=>{ - // wx.showToast({ - // title: res.message, - // icon: 'none' - // }) wx.showModal({ title: '提交成功', content: '问题已收到,我们会尽快给您答复的!', @@ -196,22 +171,24 @@ Component({ success (res) { if (res.confirm) { console.log('用户点击查看进度') + console.log(res) // 查看进度怎么填呀?? - + // wx.navigateTo({ + // url: `/pages/article/index?id=${id}`, + // }) + //不用wx.navigateTo,改用wx.redirectTo(url: 'test?id=1'}) + //浩然会给我一个接口返回id值 + console.log('talent的id') + console.log(id); + wx.redirectTo({ + // url: '../../user/myWhistle/whistleDetail/index?id=${id}', + url: '/pages/user/myWhistle/whistleDetail/index?id='+id, + }) } else if (res.cancel) { console.log('用户点击知道了') } } }) - - - - - - - - - }) } }) diff --git a/pages/topics/talents/index.wxml b/pages/topics/talents/index.wxml index 4a47c24..a75d4cd 100644 --- a/pages/topics/talents/index.wxml +++ b/pages/topics/talents/index.wxml @@ -1,23 +1,5 @@ - - - - - @@ -28,7 +10,6 @@ - diff --git a/pages/topics/talents/index.wxss b/pages/topics/talents/index.wxss index 738384b..bb79923 100644 --- a/pages/topics/talents/index.wxss +++ b/pages/topics/talents/index.wxss @@ -1,4 +1,4 @@ -/* pages/topics/common/message/index.wxss */ +/* pages/topics/talent/message/index.wxss */ @import '../../../style/font.wxss'; .container{ padding: 0px 20px; @@ -77,6 +77,8 @@ } .select-view{ display: flex; + /* btnView是position:fix,所以为防止遮挡,设置街道选择盒子下边框margin-bottom为100px */ + margin-bottom: 100px; } .select-mark{ width:15px; diff --git a/pages/user/index.js b/pages/user/index.js index ed84867..fd3d48d 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -27,6 +27,8 @@ Page({ }, onShow: function () { if (store.hasBindUserInfo()) { + console.log("onshow"); + this.getUserInfo() this.setData({ isAuth: true @@ -44,6 +46,8 @@ Page({ // 获取用户信息 getUserInfo () { userModel.getUserInfo(res => { + console.log("getUserInfo"); + console.log(res) let nickName = res.result.nickName let avatarUrl = res.result.avatarUrl @@ -100,11 +104,12 @@ Page({ // cell点击 onTapItem (e) { const { type } = e.currentTarget.dataset - //console.log(type) + console.log(type) + if(this.data.isAuth){ if (type === 'myInfo') { wx.navigateTo({ - url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}`, + url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}&street=${this.data.userInfo.departId || ''}&age=${this.data.userInfo.age || ''}&genderIndex=${this.data.userInfo.gender || ''}&education=${this.data.userInfo.education || ''}&professionalTitle=${this.data.userInfo.title || ''}&talentTitle=${this.data.userInfo.designation || ''}&prize=${this.data.userInfo.honor || ''}`, }) } else { wx.navigateTo({ diff --git a/pages/user/myInfo/index.js b/pages/user/myInfo/index.js index a2af991..e0e736f 100644 --- a/pages/user/myInfo/index.js +++ b/pages/user/myInfo/index.js @@ -13,13 +13,99 @@ Page({ nickName: String, phone: String, company: String, - position: String, + position: String, + street:String, + age:String, + gender:['','男','女'], + genderIndex:Number, + educationIndex:Number, + education:['','高中','专科','本科','硕士','博士'], + professionalTitle:String, + talentTitle:String, + prize:String, + show: false, + tempData:String, + realData:String, + type:String, + value:String, + }, + + getUserInfo(event) { + console.log(event.detail); + }, + onClose() { + this.setData({ close: false }); + }, + vantConfirm(){ + console.log("vant confirm"); + this.setData({ + realData:this.data.tempData + }) + console.log(this.data.realData); + if(this.data.type === 'userName'){ + this.setData({ + nickName:this.data.realData + }) + } + if(this.data.type === 'userPhone'){ + this.setData({ + phone:this.data.realData + }) + } + if(this.data.type === 'userStreet'){ + this.setData({ + street:this.data.realData + }) + } + if(this.data.type === 'userAge'){ + this.setData({ + age:this.data.realData + }) + + } + if(this.data.type === 'workUnit'){ + this.setData({ + workUnit:this.data.realData + }) + } + if(this.data.type === 'position'){ + this.setData({ + position:this.data.realData + }) + } + if(this.data.type === 'workUnit'){ + this.setData({ + company:this.data.realData + }) + } + if(this.data.type === 'userProfessionalTitle'){ + this.setData({ + professionalTitle:this.data.realData + }) + } + if(this.data.type === 'userTalentTitle'){ + this.setData({ + talentTitle:this.data.realData + }) + } + if(this.data.type === 'userPrize'){ + this.setData({ + prize:this.data.realData + }) + } + this.setData({ + value:'' + }) + }, + + tempData: function(e){ + this.setData({ + tempData:e.detail.value + }) }, - /** - * 生命周期函数--监听页面加载 - */ onLoad: function (options) { + console.log("index.js"); console.log(options) this.setData({ avatarUrl: options.userIcon, @@ -27,18 +113,34 @@ Page({ phone: options.userPhone || '', company: options.company || '', position: options.position || '', + street:options.street || '', + age:options.age || '', + genderIndex:options.genderIndex || '', + educationIndex:options.education || '', + professionalTitle:options.professionalTitle || '', + talentTitle:options.talentTitle || '', + prize:options.prize || '', }) }, + //性别和学历有专门的bind方法。此方法修改年龄,工作单位,职务,职称等 onTapItem(e) { const { type } = e.currentTarget.dataset + this.setData({ + type:type + }) console.log(type) + //如果等于userIcon调用upload方法更新头像 if(type === 'userIcon'){ this.upload() - } + }else{ + this.setData({ + show:true + }) + } }, + upload(){ - let that = this - + let that = this wx.chooseImage({ success(res) { wx.showLoading() @@ -89,13 +191,38 @@ Page({ // position: e.detail.value // }) // }, + bindGenderChange: function(e) { + console.log("bindGenderChange"); + console.log(e); + this.setData({ + genderIndex:e.detail.value + }) + console.log(this.data.genderIndex); + }, + bindEducationChange:function(e){ + this.setData({ + educationIndex:e.detail.value + }) + console.log(this.data.educationIndex); + }, submit(){ + console.log("submit"); + console.log(this.data); userModel.updateUserInfo(this.data, res => { if(res.code === 200){ store.saveUserInfo({ nickName: this.data.nickName, avatarUrl: this.data.avatarUrl, - phone: this.data.phone || '' + phone: this.data.phone || '', + departId:this.data.street, + age:this.data.age, + gender:this.data.genderIndex,// + company:this.data.company, + position:this.data.position, + education:this.data.educationIndex,// + title:this.data.professionalTitle, + designation:this.data.talentTitle, + honor:this.data.prize }) wx.showToast({ title: '修改成功', diff --git a/pages/user/myInfo/index.json b/pages/user/myInfo/index.json index dba7d7d..eb6adc7 100644 --- a/pages/user/myInfo/index.json +++ b/pages/user/myInfo/index.json @@ -3,6 +3,7 @@ "usingComponents": { "e-ibutton": "/components/image-button/index", "mp-cells": "/components/weui/cells/cells", - "mp-cell": "/components/weui/cell/cell" + "mp-cell": "/components/weui/cell/cell", + "van-dialog": "/components/vant/dialog/index" } } \ No newline at end of file diff --git a/pages/user/myInfo/index.wxml b/pages/user/myInfo/index.wxml index e7a86bf..88a7567 100644 --- a/pages/user/myInfo/index.wxml +++ b/pages/user/myInfo/index.wxml @@ -1,43 +1,140 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 请选择 + + + + {{gender[genderIndex]}} + + + + + + + + + + + + + + + + + + + + + + 请选择 + + + + + {{education[educationIndex]}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pages/user/myInfo/index.wxss b/pages/user/myInfo/index.wxss index 84b4e1f..e679121 100644 --- a/pages/user/myInfo/index.wxss +++ b/pages/user/myInfo/index.wxss @@ -1,4 +1,5 @@ /* pages/user/myInfo/index.wxss */ +@import '../../../style/font.wxss'; .container { background-color: #FAFAFA; height: 100vh; @@ -6,6 +7,10 @@ .page_hd { border-bottom: 7px solid #f7f7f7; } +/* btnView是position:fix,所以为防止遮挡,盒子下边框margin-bottom为100px */ +.cellAll{ + margin-bottom: 100px; +} .page_hd .weui-cells:before { border-top: 0px solid white; } @@ -28,7 +33,7 @@ .user_logo { width: 60px; height: 60px; - border-radius: 5px; + border-radius: 50%; } .user_name { width: 400rpx; @@ -70,12 +75,14 @@ .footer_input_phone{ padding: 0 5px; font-size: 14px; - border: 1px solid #AAAAAA; - border-radius: 4px; + /* border: 1px solid #AAAAAA; */ height: 30px; text-align: left; color: #3B3B3B; - background-color: #f7f7f7; +} +.select-mark{ + width:20px; + /* border:1px solid black; */ } .msg_footer{ font-size: 14px; @@ -87,4 +94,26 @@ bottom: 0; left: 0; right: 0; -} \ No newline at end of file + background-color: white; +} +.picker-view{ + display: flex; + /*控制元素在主轴的对齐方式*/ + justify-content: center; + /*控制默认的一行的对齐方式*/ + align-items: center; + /* margin:0 0 0 50px; */ +} +.picker-if{ + color:#888888; +} +.picker-block{ + margin:0 0 0 100px; +} +.diag_input{ + margin:20px; +} + + + + diff --git a/pages/user/myWhistle/index.js b/pages/user/myWhistle/index.js index 6171637..6d4910e 100644 --- a/pages/user/myWhistle/index.js +++ b/pages/user/myWhistle/index.js @@ -114,6 +114,8 @@ Page({ return; } if (e.currentTarget.dataset.id) { + + wx.navigateTo({ url: '../myWhistle/whistleDetail/index?id=' + e.currentTarget.dataset.id }) diff --git a/pages/user/myWhistle/whistleDetail/index.js b/pages/user/myWhistle/whistleDetail/index.js index 9087186..ae610d8 100644 --- a/pages/user/myWhistle/whistleDetail/index.js +++ b/pages/user/myWhistle/whistleDetail/index.js @@ -22,18 +22,13 @@ Page({ detail:res.result, img:img }) - }); - }, - /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { - }, - /** * 生命周期函数--监听页面显示 */