Skip to content

Commit

Permalink
Merge pull request #386 from lwYU/master
Browse files Browse the repository at this point in the history
#3 #157 第三次实验代码
  • Loading branch information
zengsn authored Nov 20, 2017
2 parents 47307b2 + 45ff058 commit 0095df8
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 1 deletion.
17 changes: 16 additions & 1 deletion 1514080901111/app.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
{
"pages":[
"pages/index/index",
"pages/logs/logs"
"pages/logs/logs",
"pages/sy/sy"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle":"black"
},
"tabBar": {
"color": "#000000",
"selectedColor": "#009444",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页"
},
{
"pagePath": "pages/sy/sy",
"text": ""
}
]
}
}
100 changes: 100 additions & 0 deletions 1514080901111/pages/sy/sy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
//index.js
//获取应用实例
const app = getApp()

Page({
data: {
/*搜索栏数据 */
inputShowed: false,
inputVal: "",
/************ */
ranks: [
{ title: 1, text: "类型1"},
{ type: 2, text: "类型2" },
{ type: 3, text: "类型3" },
{ type: 4, text: "类型4" },
{ type: 5, text: "类型5" },

],
//scroll-view变量start
windowHeight: 0,
windowWidth: 0,
scrollTop: 10,
//scroll-view表里end

},
/*搜索栏函数*/
showInput: function () {
this.setData({
inputShowed: true
});
},
hideInput: function () {
this.setData({
inputVal: "",
inputShowed: false
});
},
clearInput: function () {
this.setData({
inputVal: ""
});
},
inputTyping: function (e) {
this.setData({
inputVal: e.detail.value
});
},
/********* */
//事件处理函数
bindViewTap: function () {
wx.navigateTo({
url: '../logs/logs'
})
},

onLoad: function () {
var that = this;
//获取窗口大小
wx.getSystemInfo({
success: (res) => {
that.setData({
windowHeight: res.windowHeight - 5,
windowWidth: res.windowWidth
})
},
fail: (res) => ({

}),
})
},


getUserInfo: function (e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
},


//scroll-view相关函数start
upper: function (e) {
console.log(e)
},
lower: function (e) {
console.log(e)
},
scroll: function (e) {

},
tap: function (e) {

},
tapMove: function (e) {
},
//scroll-view相关函数end

})
1 change: 1 addition & 0 deletions 1514080901111/pages/sy/sy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
25 changes: 25 additions & 0 deletions 1514080901111/pages/sy/sy.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

<view class="page">
<view class="page__bd">
<scroll-view scroll-y style="height: {{windowHeight}}px;" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
<view class="weui-panel weui-panel_access">
<block wx:for="{{ranks}}" wx:key="{{item.type}}" >
<view class="weui-panel__hd">{{item.text}}</view>
<view class="weui-panel__bd">
<navigator url="" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
<image class="weui-media-box__thumb" src="../tupian/1.jpg" />
</view>
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__desc">111111</view>
</view>
</navigator>
</view>

</block>
</view>
</scroll-view>
</view>

</view>

1 change: 1 addition & 0 deletions 1514080901111/pages/sy/sy.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* pages/sy/sy.wxss */

0 comments on commit 0095df8

Please sign in to comment.