Skip to content

Commit

Permalink
hzuapps#5 hzuapps#61 第五次实验代码
Browse files Browse the repository at this point in the history
  • Loading branch information
MercyMo committed Dec 10, 2017
1 parent 743c78e commit 948f31d
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 1514080901106/app.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"pages": [
"pages/request/requset",
"pages/form/form",
"pages/index/index",
"pages/show/show",
"pages/form/form"
"pages/show/show"
],
"window": {
"backgroundTextStyle": "light",
Expand Down
98 changes: 98 additions & 0 deletions 1514080901106/pages/request/requset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// pages/request/requset.js
Page({

/**
* 页面的初始数据
*/
data: {
name: '',
index: 0,
show:[]
},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
var data;
wx.request({
url: 'https://infoaas.com/data/1514080901101/indexHot.json',
data: {},
success: function (res) {
that.setData({
name: res.data
})
}
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

},

getMore:function(){
console.dir(this.data.name);
var l = this.data.index;
var list = this.data.name;
var temp = this.data.show;
l += 1;
console.dir(l);
this.setData({
index: l
})
var obj = list[l - 1].name;
console.dir(obj);
temp.push(obj);
this.setData({
show: temp
})
console.dir(this.data.show);
}
})

1 change: 1 addition & 0 deletions 1514080901106/pages/request/requset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions 1514080901106/pages/request/requset.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--pages/request/requset.wxml-->
<button class="btn" bindtap="getMore">+</button>
<block wx:for="{{show}}">
<view>{{item}}</view>
</block>
1 change: 1 addition & 0 deletions 1514080901106/pages/request/requset.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* pages/request/requset.wxss */

0 comments on commit 948f31d

Please sign in to comment.