From 24a054abf40dac06b5d7c729865dc0a589549fb3 Mon Sep 17 00:00:00 2001 From: zh363y468b3 <2463925854@qq.com> Date: Fri, 19 Aug 2022 15:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Fronts/pages/Percenter/Sublayout/myinfo.vue | 104 ++++++++++++++------ 1 file changed, 73 insertions(+), 31 deletions(-) diff --git a/Fronts/pages/Percenter/Sublayout/myinfo.vue b/Fronts/pages/Percenter/Sublayout/myinfo.vue index afb9025..1bb0204 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; -- Gitee