diff --git a/Fronts/pages/Percenter/Sublayout/myinfo.vue b/Fronts/pages/Percenter/Sublayout/myinfo.vue index afb9025c37e243f0605fee5d9ad8a56a78eea380..1bb0204a3b91bccaaa814696cfe39dc0cff93242 100644 --- a/Fronts/pages/Percenter/Sublayout/myinfo.vue +++ b/Fronts/pages/Percenter/Sublayout/myinfo.vue @@ -4,46 +4,42 @@ - + - 姓名:{{item.studentInfo.studentName}} + 姓名:{{this.studentname}} - 性别:{{item.studentInfo.sex}} + 性别:{{this.studentsex}} - 地址:{{item.studentInfo.address}} - + 地址:{{this.studentaddress}} + - 班级:{{item.classInfo.className}} - - - - - 学院:{{item.academyInfo.academyName}} + 班级:{{this.classnames}} - 创建时间:{{item.studentInfo.createdAt}} + 创建时间:{{this.studentCreat}} - + - 手机号:{{item.studentInfo.phoneNumber}} - + 手机号: + + @@ -53,27 +49,66 @@ export default { data() { return { - result: [], + studentnum:"", + result: "", + studentname:"", + studentsex:"", + studentaddress:"", + classnames:"", + studentCreat:"", + studentPhone:"", }; }, + onLoad(){ + this.studentnum=wx.getStorageSync('studentnum'); + console.log(this.studentnum) + }, mounted() { this.getDate(); }, methods: { - getDate() { - uni.request({ - url: 'http://localhost:5003/student', - method: 'GET', - data: {}, - success: res => { - console.log(res); - this.result = res.data.data; - console.log(this.result) - }, - fail: () => {}, - complete: () => {} - }); - } + // getDate() { + // if(this.studentnum){ + // uni.request({ + // url:'http://localhost:5003/student, + // method: 'GET', + // data: {}, + // success: res => { + // console.log(res); + // this.result = res.data.data; + // console.log(this.result) + // }, + // fail: () => {}, + // complete: () => {} + // }); + // } + + // } + getDate() { + console.log(this.studentnum) + uni.request({ + url: 'http://localhost:5003/student?keyword=' + this.studentnum, + method: 'GET', + data: {}, + success: res => { + console.log(res) + this.result = res.data.data; + console.log(this.result); + this.result.forEach((item) => { + this.studentname = item.studentInfo.studentName; + this.studentsex = item.studentInfo.sex; + this.studentaddress = item.studentInfo.address; + this.classnames = item.classInfo.className; + this.studentCreat = item.studentInfo.createdAt; + this.studentPhone = item.studentInfo.phoneNumber; + }) + console.log(this.studentname); + + }, + fail: () => {}, + complete: () => {} + }); + }, } } @@ -149,6 +184,7 @@ margin-left: 5px; margin-right: 5px; background-color: rgba(255, 255, 255, 0.7); + height: 315px; } .mylabel{ margin-bottom: 10px; @@ -162,12 +198,19 @@ border-bottom: 2px darkgrey solid; height: 50px; font-weight: bolder; + } + .listdivd{ + display: flex; + align-items: center; + height: 50px; + font-weight: bolder; } .sanjiao{ font-family:'微软雅黑'; color:dimgrey; font-weight: bolder; margin-left: 40%; + } .zhuxiao{ margin-left: 15px; @@ -175,7 +218,6 @@ font-family:'微软雅黑'; font-weight: bolder; float: left; - } .tubiao{ display: flex;