Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
],
"window": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "小程序测试",
"navigationBarTitleText": "智能小程序官方组件",
"navigationBarTextStyle": "black",
"backgroundTextStyle": "black",
"enablePullDownRefresh": false
Expand Down
6 changes: 3 additions & 3 deletions pages/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ Page({
}, {
subName: '选择视频',
id: 'chooseVideo'
}, {
subName: '录音管理',
id: 'getRecorderManager'
// }, {
// subName: '录音管理',
// id: 'getRecorderManager'
}]
}, {
icon: '../../images/location.png',
Expand Down
2 changes: 1 addition & 1 deletion pages/api/api.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"navigationBarTitleText": "智能小程序接口能力展示"
"navigationBarTitleText": "智能小程序接口能力"
}
7 changes: 4 additions & 3 deletions pages/chooseVideo/chooseVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ Page({
showVideo: false
},
playVideo() {
swan.showToast({
title: '触发bindplay'
});
// swan.showToast({
// title: '触发bindplay'
// });
console.log('触发bindplay');
},
chooseVideo() {
let self = this;
Expand Down
2 changes: 1 addition & 1 deletion pages/chooseVideo/chooseVideo.swan
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
<text>{{maxDuration}}秒</text>
</view>
</view>
</view>
</view>
6 changes: 3 additions & 3 deletions pages/component/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ Page({
}, {
subName: 'label',
id: 'label'
}, {
subName: 'textarea',
id: 'textarea'
// }, {
// subName: 'textarea',
// id: 'textarea'
}, {
subName: 'picker',
id: 'picker'
Expand Down
4 changes: 2 additions & 2 deletions pages/component/component.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"navigationBarTitleText": "智能小程序官方组件展示"
}
"navigationBarTitleText": "智能小程序官方组件"
}
2 changes: 1 addition & 1 deletion pages/getSystemInfo/getSystemInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Page({
this.updateInfoList(res);
},
fail: err => {
this.showToast({
swan.showToast({
title: '获取失败'
});
}
Expand Down
6 changes: 2 additions & 4 deletions pages/label/label.swan
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
<label class="label-3">
<view class="label-box">
<view class="checkbox-3 label-first">
<checkbox></checkbox>
<text>选项一</text>
<checkbox >选项一</checkbox>
</view>
<view class="checkbox-3">
<checkbox></checkbox>
<text>选项二</text>
<checkbox>选项二</checkbox>
</view>
</view>
<view class="label-3-text">点击该label下的文字默认选中第一个checkbox</view>
Expand Down
2 changes: 1 addition & 1 deletion pages/makePhoneCall/makePhoneCall.swan
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<view class="phone-call-container">
<text>请在下方输入电话号码</text>
<input bind:input="phoneNumberInput" class="input" type="number" placeholder="请输入电话号码"/>
<button bind:tap="makePhoneCall" type="primary" disabled="{{phoneNumber ? 'disabled' : 'false'}}" hover-stop-propagation="true">拨打</button>
<button bind:tap="makePhoneCall" type="primary" hover-stop-propagation="true">拨打</button>
</view>
</view>
<view class="page-title">
Expand Down
2 changes: 1 addition & 1 deletion pages/payment/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Page({
},
fail(err) {
swan.showToast({
title: JSON.stringify(err)
title: err.errMsg
});
console.log('pay fail', err);
}
Expand Down
12 changes: 12 additions & 0 deletions pages/scroll-view/scroll-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ Page({
},
},

toLeft() {
swan.showToast({
duration: 1000,
title: '到最左边了'
});
},
toRight() {
swan.showToast({
duration: 1000,
title: '到最右边了'
});
},
upper() {
swan.showToast({
duration: 1000,
Expand Down
16 changes: 8 additions & 8 deletions pages/scroll-view/scroll-view.swan
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<view class="wrap">
<view class="title">横向滚动</view>
<scroll-view
scroll-x
<scroll-view
scroll-x
class="scroll-view"
bind:scrolltoupper="upper"
bind:scrolltolower="lower"
bind:scrolltoupper="toLeft"
bind:scrolltolower="toRight"
scroll-into-view="one"
upper-threshold="1"
lower-threshold="1"
Expand All @@ -19,10 +19,10 @@
<scroll-view
scroll-y
class="scroll-view"
bind:scrolltoupper="upper"
bind:scrolltolower="lower"
bind:scrolltoupper="upper"
bind:scrolltolower="lower"
scroll-into-view="four"
upper-threshold="10"
upper-threshold="10"
lower-threshold="10"
bind:scroll="myscroll"
enable-back-to-top="true"
Expand All @@ -31,4 +31,4 @@
<view id="five" class="color-b">B</view>
<view id="six" class="color-c">C</view>
</scroll-view>
</view>
</view>
10 changes: 9 additions & 1 deletion pages/video/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

Page({
data: {
src: 'https://b.bdstatic.com/swan-temp/940fe716b0eaad38f47b209d61657490.mp4',
current: 0,
srcList: ['https://vd3.bdstatic.com/mda-ia8e6q3g23py8qdh/hd/mda-ia8e6q3g23py8qdh.mp4?playlist=%5B%22hd%22%5D&auth_key=1521549485-0-0-d5d042ba3555b2d23909d16a82916ebc&bcevod_channel=searchbox_feed&pd=share', 'https://vd3.bdstatic.com/mda-ib0u8x1bvaf00qa8/mda-ib0u8x1bvaf00qa8.mp4?playlist=%5B%22hd%22%2C%22sc%22%5D'],
src: 'https://vd3.bdstatic.com/mda-ia8e6q3g23py8qdh/hd/mda-ia8e6q3g23py8qdh.mp4?playlist=%5B%22hd%22%5D&auth_key=1521549485-0-0-d5d042ba3555b2d23909d16a82916ebc&bcevod_channel=searchbox_feed&pd=share',
loop: false,
muted: false,
autoplay: false
Expand All @@ -24,6 +26,12 @@ Page({
console.log('ended');
this.next();
},
next: function (e) {
let list = this.getData('srcList');
let current = (this.getData('current') + 1) % list.length;
this.setData('src', list[current]);
this.setData('current', current);
},
setloop: function (e) {
this.setData('loop', !this.getData('loop'));
},
Expand Down
1 change: 1 addition & 0 deletions pages/video/video.swan
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<view class="video-wrap">
<video id="myde" style="width: 100%;" src="{{src}}" controls bindplay="play" bindpause="pause" bindfullscreenchange="fullscreen" bindended="ended" autoplay="{{autoplay}}" muted="{{muted}}"></video>
</view>
<button class="btn" bindtap="next" type="primary">切换视频地址</button>
<button class="btn" bindtap="setmuted" type="primary">设置静音</button>
</view>