-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
加入新的朋友板块,附带基于weui改的实时搜索框简易demo,加入了picker和switch的示例,加入查看系统信息
- Loading branch information
Showing
16 changed files
with
307 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
Page({ | ||
data:{ | ||
// text:"这是一个页面" | ||
list:[ | ||
{ | ||
img:"/image/adam.jpg", | ||
name:"王浩", | ||
message:"你好", | ||
type:true, | ||
id:"1" | ||
}, | ||
{ | ||
img:"/image/ben.png", | ||
name:"成凤杰", | ||
message:"我是成凤杰", | ||
type:true, | ||
id:"2" | ||
}, | ||
{ | ||
img:"/image/max.png", | ||
name:"梁雨", | ||
message:"加个好友", | ||
type:true, | ||
id:"3" | ||
}, | ||
{ | ||
img:"/image/mike.png", | ||
name:"廖芳樱", | ||
message:"+++++", | ||
type:true, | ||
id:"4" | ||
}, | ||
{ | ||
img:"/image/perry.png", | ||
name:"邓福滨", | ||
message:"...", | ||
type:true, | ||
id:"5" | ||
} | ||
], | ||
textList:[ | ||
{ | ||
text:"实时搜索文本" | ||
}, | ||
{ | ||
text:"不像angular有过滤器" | ||
}, | ||
{ | ||
text:"只能从服务端过滤" | ||
} | ||
], | ||
type:true, | ||
inputValue: '' | ||
}, | ||
onLoad:function(options){ | ||
// 页面初始化 options为页面跳转所带来的参数 | ||
}, | ||
onReady:function(){ | ||
// 页面渲染完成 | ||
}, | ||
onShow:function(){ | ||
// 页面显示 | ||
}, | ||
onHide:function(){ | ||
// 页面隐藏 | ||
}, | ||
onUnload:function(){ | ||
// 页面关闭 | ||
}, | ||
goPage:function(e){ | ||
// console.log(e.currentTarget.dataset.index) | ||
// console.log(e.target.dataset.name) | ||
wx.navigateTo({ | ||
url: '../message/message?name='+e.currentTarget.dataset.name+"&id="+e.currentTarget.dataset.id | ||
}) | ||
// console.log(test); | ||
}, | ||
inputFun:function(e){ | ||
var _self = this; | ||
console.log(e); | ||
if(e.detail.cursor){ | ||
_self.setData({ | ||
type:false | ||
}) | ||
}else{ | ||
_self.setData({ | ||
type:true | ||
}) | ||
} | ||
}, | ||
inputclear:function(e){ | ||
// e.detail={ | ||
// cursor:0, | ||
// value:"" | ||
// } | ||
// var _self = this; | ||
// _self.setData({ | ||
// inputValue: '' | ||
// }) | ||
} | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"navigationBarTitleText": "新的朋友" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<scroll-view> | ||
<view class="weui-search-bar weui-search-bar_focusing" id="search_bar"> | ||
<view class="weui-search-bar__form"> | ||
<view class="weui-search-bar__box"> | ||
<text class="weui-icon-search"></text> | ||
<input type="text" class="weui-search-bar__input" id="search_input" placeholder="搜索" bindinput="inputFun" bindblur="inputclear" value="{{inputValue}}"/> | ||
<text class="weui-icon-clear" id="search_clear"></text> | ||
</view> | ||
<view for="search_input" class="weui-search-bar__label" id="search_text"> | ||
<text class="weui-icon-search"></text> | ||
<text>搜索</text> | ||
</view> | ||
</view> | ||
<!--<text class="weui-search-bar__cancel-btn" id="search_cancel" bindtap="inputclear">取消</text>--> | ||
</view> | ||
<view class="weui-cells weui-cells_access search_show" hidden="{{type}}" id="search_show"> | ||
<view class="weui-cell" wx:for="{{textList}}" wx:for-item="i"> | ||
<view class="weui-cell__bd weui-cell_primary"> | ||
<text>{{i.text}}</text> | ||
</view> | ||
</view> | ||
|
||
</view> | ||
<view class="item-avatar-md" wx:for="{{list}}" wx:for-item="i" data-name="{{i.name}}" data-id="{{i.id}}" bindtap="goPage"> | ||
<image src="{{i.img}}"></image> | ||
<view class="item-text"> | ||
<view class="text_box"> | ||
<view class="flex"> | ||
<text class="title">{{i.name}}</text> | ||
</view> | ||
<view class="flex" style="color:#3ccccc"> | ||
<text class="message">{{i.message}}</text> | ||
</view> | ||
</view> | ||
</view> | ||
<view class="item-time padding_half" style="color:#3ccccc"> | ||
<text class="message">{{i.type?"已添加":"未添加"}}</text> | ||
</view> | ||
</view> | ||
</scroll-view> |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.weui-cells_access{ | ||
position:fixed; | ||
width: 100%; | ||
z-index:999; | ||
margin-top: 0; | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Page({ | ||
data: { | ||
array: ['美国', '中国', '巴西', '日本'], | ||
index: 0, | ||
date: '2016-09-01', | ||
time: '12:01' | ||
}, | ||
bindPickerChange: function(e) { | ||
console.log('picker发送选择改变,携带值为', e.detail.value) | ||
this.setData({ | ||
index: e.detail.value | ||
}) | ||
}, | ||
bindDateChange: function(e) { | ||
this.setData({ | ||
date: e.detail.value | ||
}) | ||
}, | ||
bindTimeChange: function(e) { | ||
this.setData({ | ||
time: e.detail.value | ||
}) | ||
}, | ||
switch1Change: function (e){ | ||
console.log('switch1 发生 change 事件,携带值为', e.detail.value) | ||
}, | ||
switch2Change: function (e){ | ||
console.log('switch2 发生 change 事件,携带值为', e.detail.value) | ||
}, | ||
onLoad:function(options){ | ||
// 页面初始化 options为页面跳转所带来的参数 | ||
}, | ||
onReady:function(){ | ||
// 页面渲染完成 | ||
}, | ||
onShow:function(){ | ||
// 页面显示 | ||
}, | ||
onHide:function(){ | ||
// 页面隐藏 | ||
}, | ||
onUnload:function(){ | ||
// 页面关闭 | ||
} | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"navigationBarTitleText": "选择器" | ||
} |
Oops, something went wrong.