diff --git a/pages/Viewprescription/Viewprescription.vue b/pages/Viewprescription/Viewprescription.vue index 9050e2b..4d2555d 100644 --- a/pages/Viewprescription/Viewprescription.vue +++ b/pages/Viewprescription/Viewprescription.vue @@ -351,7 +351,7 @@ background: #fff; box-shadow: 0px 3px 18px 0px rgba(182, 218, 213, 0.43); width: 90%; - margin: 0 auto; // text-align: center; + margin: 0 auto 20rpx; // text-align: center; height: 268rpx; border-radius: 10rpx; position: relative; diff --git a/pages/grade/grade.vue b/pages/grade/grade.vue index 38b2d33..0043694 100644 --- a/pages/grade/grade.vue +++ b/pages/grade/grade.vue @@ -44,25 +44,29 @@ data() { return { StudentScore: [], - studentId: "", - // studentIdList:{}, } }, onShow() { const value = uni.getStorageSync('phone'); - getInfoByPhone(value).then(res => { - if (res.code == 200) { - var obj = { - studentIdList: [] - } - res.data.studentInfoList.forEach(e => { - obj.studentIdList.push(e.studentId) - }) - getStudentScore(obj).then(res => { - this.StudentScore = res.data - }) - } else {} - }) + if (value) { + getInfoByPhone(value).then(res => { + if (res.code == 200) { + var obj = { + studentIdList: [] + } + res.data.studentInfoList.forEach(e => { + obj.studentIdList.push(e.studentId) + }) + getStudentScore(obj).then(res => { + this.StudentScore = res.data + }) + } else {} + }) + } else { + uni.navigateTo({ + url: '/pages/index/index' + }) + } }, methods: { lookbook(item) { @@ -102,25 +106,6 @@ }); } }, - getPhoneNumberp(val) { - wx.login({ - provider: 'weixin', - success: function(loginRes) {} - }); - }, - wxGetUserInfo() { - let that = this; - uni.getUserProfile({ - desc: "获取用户信息", - lang: "zh_CN", - success(res) { - that.yonghuwx = res.userInfo - }, - fail(res) { - //失败则返回home页面 - }, - }); - }, } } diff --git a/pages/prescription/prescription.vue b/pages/prescription/prescription.vue index 90b6270..66cd05c 100644 --- a/pages/prescription/prescription.vue +++ b/pages/prescription/prescription.vue @@ -143,7 +143,6 @@ studentInfoList: [], studentIditem: [], getchildlist: [], - studentId: "", batchCode: "", phone: "", studentList: [], @@ -152,35 +151,41 @@ onShow() { let that = this; this.phone = uni.getStorageSync('phone'); - getInfoByPhone(this.phone).then(res => { - if (res.code == 200) { - var obj = { - studentIdList: [] - } - res.data.studentInfoList.forEach(e => { - obj.studentIdList.push(e.studentId) - }) - let items = JSON.stringify(res.data); - uni.setStorageSync("this.DATAList", items) - getChildrenResultScore(obj).then(res => { - this.StudentScore = res.data - if (this.StudentScore.length == 1) { - getMotionPrescription(res.data[0].studentId, res.data[0].batchCode).then( - res => { - this.studentInfoList = res.data - this.studentInfoList.forEach(e => { - e.motionPrescriptionVideoInfoVOList.forEach(el => { - el.count = 0 - el.prescriptionVideoUrl = baseurl + el - .prescriptionVideoUrl + if (this.phone) { + getInfoByPhone(this.phone).then(res => { + if (res.code == 200) { + var obj = { + studentIdList: [] + } + res.data.studentInfoList.forEach(e => { + obj.studentIdList.push(e.studentId) + }) + let items = JSON.stringify(res.data); + uni.setStorageSync("this.DATAList", items) + getChildrenResultScore(obj).then(res => { + this.StudentScore = res.data + if (this.StudentScore.length == 1) { + getMotionPrescription(res.data[0].studentId, res.data[0].batchCode).then( + res => { + this.studentInfoList = res.data + this.studentInfoList.forEach(e => { + e.motionPrescriptionVideoInfoVOList.forEach(el => { + el.count = 0 + el.prescriptionVideoUrl = baseurl + el + .prescriptionVideoUrl + }) }) }) - }) - this.infolist(); - } - }) - } else {} - }) + this.infolist(); + } + }) + } else {} + }) + } else { + uni.navigateTo({ + url: '/pages/index/index' + }) + } }, methods: { look(uitem) {