-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #456 from AllenMinD/master
- Loading branch information
Showing
1 changed file
with
40 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,49 @@ | ||
var tempNum = 0; | ||
Page({ | ||
data: { | ||
students: [ | ||
{ | ||
sNum: "1122", | ||
name:'比尔盖茨' | ||
}, | ||
{ | ||
sNum: "1124", | ||
name:'扎克伯格' | ||
}, | ||
{ | ||
sNum: "1136", | ||
name:'老王' | ||
}, | ||
{ | ||
sNum: "1148", | ||
name: '老李' | ||
}, | ||
{ | ||
sNum: "1155", | ||
name:'杨赵' | ||
}, | ||
{ | ||
sNum: "5155", | ||
name: '呵呵大' | ||
students: [] | ||
}, | ||
|
||
onLoad: function(options) { | ||
var that = this; | ||
wx.request({ | ||
url: "http://www.easy-mock.com/mock/5a1f5ba9ca645757c0517e26/wechat-app-test/student-list", | ||
success: function (res) { | ||
var resData = res.data.data; | ||
that.setData({ | ||
students: resData | ||
}); | ||
} | ||
] | ||
}); | ||
}, | ||
|
||
more: function (e) { | ||
console.log(e); | ||
tempNum++; | ||
var newGuy = { | ||
sNum: "11" + tempNum, | ||
name: "神秘人" | ||
}; | ||
if (tempNum <= 35) { | ||
this.data.students.push(newGuy); | ||
this.setData({ | ||
students: this.data.students, | ||
}) | ||
} else { | ||
console.log("全员到齐!"); | ||
} | ||
//console.log(e); | ||
var that = this; | ||
wx.request({ | ||
url: 'http://easy-mock.com/mock/5a20c161be1c8248fef10e93/wechat-app-test2/web-wechat-test2', | ||
success: function(res) { | ||
var resData = res.data.data; | ||
//console.log(resData); | ||
that.setData({ | ||
students: that.data.students.concat(resData) | ||
}); | ||
console.log(that.data.students) | ||
} | ||
}) | ||
// tempNum++; | ||
// var newGuy = { | ||
// sNum: "11" + tempNum, | ||
// name: "神秘人" | ||
// }; | ||
// if (tempNum <= 35) { | ||
// //this.data.students.push(newGuy); | ||
// this.setData({ | ||
// students: this.data.students, | ||
// }) | ||
// } else { | ||
// console.log("全员到齐!"); | ||
// } | ||
} | ||
|
||
}) |