-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bearyan
committed
Dec 6, 2016
1 parent
2c3ebdb
commit afe58de
Showing
10 changed files
with
96 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 | ||
}) | ||
} | ||
}); |
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,19 @@ | ||
<view class="page"> | ||
<view class="page__hd"> | ||
<view class="page__title">Picker</view> | ||
<view class="page__desc">选择器,这里使用小程序原生的picker。</view> | ||
</view> | ||
<view class="page__bd"> | ||
<view class="weui-btn-area"> | ||
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}"> | ||
<button type="default">单列选择器</button> | ||
</picker> | ||
<picker class="weui-btn" mode="time" value="{{time}}" start="09:01" end="21:01" bindchange="bindTimeChange"> | ||
<button type="default">时间选择器</button> | ||
</picker> | ||
<picker class="weui-btn" mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange"> | ||
<button type="default">日期选择器</button> | ||
</picker> | ||
</view> | ||
</view> | ||
</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,3 @@ | ||
page{ | ||
background-color: #FFFFFF; | ||
} |
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,24 @@ | ||
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 | ||
}) | ||
} | ||
}); |
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,19 @@ | ||
<view class="page"> | ||
<view class="page__hd"> | ||
<view class="page__title">Picker</view> | ||
<view class="page__desc">选择器,这里使用小程序原生的picker。</view> | ||
</view> | ||
<view class="page__bd"> | ||
<view class="weui-btn-area"> | ||
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}"> | ||
<button type="default">单列选择器</button> | ||
</picker> | ||
<picker class="weui-btn" mode="time" value="{{time}}" start="09:01" end="21:01" bindchange="bindTimeChange"> | ||
<button type="default">时间选择器</button> | ||
</picker> | ||
<picker class="weui-btn" mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange"> | ||
<button type="default">日期选择器</button> | ||
</picker> | ||
</view> | ||
</view> | ||
</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,3 @@ | ||
page{ | ||
background-color: #FFFFFF; | ||
} |