Browse Source

refactor(student): 优化学生首页代码结构

- 移除了未使用的 memberIndexData 对象
- 删除了冗余的 getMemberIndex 方法
- 简化了页面初始化逻辑
master
liutong 10 months ago
parent
commit
db53cbe471
  1. 69
      pages/student/index/index.vue

69
pages/student/index/index.vue

@ -157,24 +157,6 @@
assignmentsList: [],//
jobAssignmentsInfo: [],//
memberIndexData:{
tx:{//
height: '', //
weight: '', //
score: '', //
create_time: '' //
},
kcyg: { //
id: '', // ID
date_time: "", //
time_slot: "", //
address: "", //
courses_name: "", //
date_md: "", // /
weekday: "" //
}
},//
path_arr:{
'1':'/pages/coach/home/index',//
'2':'/pages/market/index/index',//
@ -205,7 +187,6 @@
await this.member_init()
await this.getPhysicalTestList()
await this.getPersonCourseScheduleList()
this.getMemberIndex()
this.getList()
this.getJobAssignmentsInfo()
},
@ -259,56 +240,6 @@
}
},
async openViewHome_COPY(){
//
let pages = getCurrentPages();
//
this.thisPath = '/' + pages[0].route
//
let userType = String(uni.getStorageSync('userType'))
this.openPath = this.path_arr[userType]
console.log(
'跳转',
this.thisPath,
userType,
this.path_arr[userType]
)
if(this.thisPath != this.openPath){
console.log('打印1')
//tabBar-
uni.setStorageSync('tabBerIndex', 0)
uni.navigateTo({
url: this.openPath
})
return
}else{
//->
this.init()
}
},
async getMemberIndex(){
let res = await memberApi.memberIndex({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
// console.log('',res)
if(res.data.kcyg.time_slot){
res.data.kcyg.time_slot = res.data.kcyg.time_slot.split(',');
}
this.memberIndexData = res.data
},
//
async getList(){
let data = {

Loading…
Cancel
Save