Commit 98c50a1b authored by jie zhang's avatar jie zhang

优化

parent 87860bc5
...@@ -51,8 +51,6 @@ Page({ ...@@ -51,8 +51,6 @@ Page({
this.data.page = 0 this.data.page = 0
this.httpRequest() this.httpRequest()
this.getSchedule()
this.getRecipe()
}, },
...@@ -66,6 +64,16 @@ Page({ ...@@ -66,6 +64,16 @@ Page({
this.setData({ this.setData({
selectedIndex: e.currentTarget.dataset.index selectedIndex: e.currentTarget.dataset.index
}) })
if (this.data.selectedIndex == 0) {
this.data.page = 0
this.httpRequest()
} else if (this.data.selectedIndex == 1){
this.getSchedule()
} else if (this.data.selectedIndex == 2) {
this.getRecipe()
}
}, },
......
...@@ -11,8 +11,8 @@ Page({ ...@@ -11,8 +11,8 @@ Page({
signIcon: "/src/img/signin.png", signIcon: "/src/img/signin.png",
userIcon: "", userIcon: "",
records: [], records: [],
userName:'', userName: '',
subTitle:'共0人' subTitle: '共0人'
}, },
...@@ -41,6 +41,16 @@ Page({ ...@@ -41,6 +41,16 @@ Page({
for (var i = 0; i < this.data.records.length; i++) { for (var i = 0; i < this.data.records.length; i++) {
studentIds.push(this.data.records[i].id) studentIds.push(this.data.records[i].id)
} }
if (studentIds.length == 0) {
wx.showToast({
title: '请先点名或联系管理员~',
icon: 'none'
})
return
}
wx.navigateTo({ wx.navigateTo({
url: '/pages/add_record/index?studentIds=' + JSON.stringify(studentIds), url: '/pages/add_record/index?studentIds=' + JSON.stringify(studentIds),
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment