From 78833a95889246610669d88b6700452c603c014e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2021 18:30:00 +0800 Subject: [PATCH] 2021-12-21 --- app.json | 61 ++++++++++++++++------------- pages/index/index.js | 16 +++++++- pages/test/audio.js | 70 +++++++++++++++++++++++++++++++++ pages/test/audio.json | 3 ++ pages/test/audio.wxml | 6 +++ pages/test/audio.wxss | 1 + pages/test/camera.js | 66 +++++++++++++++++++++++++++++++ pages/test/camera.json | 3 ++ pages/test/camera.wxml | 2 + pages/test/camera.wxss | 1 + pages/test/image.js | 66 +++++++++++++++++++++++++++++++ pages/test/image.json | 3 ++ pages/test/image.wxml | 2 + pages/test/image.wxss | 1 + pages/test/picker-view.js | 78 +++++++++++++++++++++++++++++++++++++ pages/test/picker-view.json | 3 ++ pages/test/picker-view.wxml | 17 ++++++++ pages/test/picker-view.wxss | 8 ++++ pages/test/radio.js | 73 ++++++++++++++++++++++++++++++++++ pages/test/radio.json | 3 ++ pages/test/radio.wxml | 10 +++++ pages/test/radio.wxss | 1 + pages/test/slider.js | 69 ++++++++++++++++++++++++++++++++ pages/test/slider.json | 3 ++ pages/test/slider.wxml | 12 ++++++ pages/test/slider.wxss | 1 + pages/test/switch.js | 68 ++++++++++++++++++++++++++++++++ pages/test/switch.json | 3 ++ pages/test/switch.wxml | 6 +++ pages/test/switch.wxss | 1 + pages/test/textarea.js | 66 +++++++++++++++++++++++++++++++ pages/test/textarea.json | 3 ++ pages/test/textarea.wxml | 10 +++++ pages/test/textarea.wxss | 1 + pages/test/vedio.js | 66 +++++++++++++++++++++++++++++++ pages/test/vedio.json | 3 ++ pages/test/vedio.wxml | 2 + pages/test/vedio.wxss | 1 + 38 files changed, 782 insertions(+), 27 deletions(-) create mode 100644 pages/test/audio.js create mode 100644 pages/test/audio.json create mode 100644 pages/test/audio.wxml create mode 100644 pages/test/audio.wxss create mode 100644 pages/test/camera.js create mode 100644 pages/test/camera.json create mode 100644 pages/test/camera.wxml create mode 100644 pages/test/camera.wxss create mode 100644 pages/test/image.js create mode 100644 pages/test/image.json create mode 100644 pages/test/image.wxml create mode 100644 pages/test/image.wxss create mode 100644 pages/test/picker-view.js create mode 100644 pages/test/picker-view.json create mode 100644 pages/test/picker-view.wxml create mode 100644 pages/test/picker-view.wxss create mode 100644 pages/test/radio.js create mode 100644 pages/test/radio.json create mode 100644 pages/test/radio.wxml create mode 100644 pages/test/radio.wxss create mode 100644 pages/test/slider.js create mode 100644 pages/test/slider.json create mode 100644 pages/test/slider.wxml create mode 100644 pages/test/slider.wxss create mode 100644 pages/test/switch.js create mode 100644 pages/test/switch.json create mode 100644 pages/test/switch.wxml create mode 100644 pages/test/switch.wxss create mode 100644 pages/test/textarea.js create mode 100644 pages/test/textarea.json create mode 100644 pages/test/textarea.wxml create mode 100644 pages/test/textarea.wxss create mode 100644 pages/test/vedio.js create mode 100644 pages/test/vedio.json create mode 100644 pages/test/vedio.wxml create mode 100644 pages/test/vedio.wxss diff --git a/app.json b/app.json index ec9ca6c..af36e5d 100644 --- a/app.json +++ b/app.json @@ -1,28 +1,37 @@ { - "pages": [ - "pages/index/index", - "pages/logs/logs", - "pages/test/icon", - "pages/test/cover-view", - "pages/test/moveable-view", - "pages/test/swiper", - "pages/test/scrollview", - "pages/test/view", - "pages/test/text", - "pages/test/rich-text", - "pages/test/progress", - "pages/test/button", - "pages/test/checkbox", - "pages/test/input", - "pages/test/form", - "pages/test/picker" - ], - "window": { - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#fff", - "navigationBarTitleText": "Weixin", - "navigationBarTextStyle": "black" - }, - "style": "v2", - "sitemapLocation": "sitemap.json" + "pages": [ + "pages/index/index", + "pages/logs/logs", + "pages/test/icon", + "pages/test/cover-view", + "pages/test/moveable-view", + "pages/test/swiper", + "pages/test/scrollview", + "pages/test/view", + "pages/test/text", + "pages/test/rich-text", + "pages/test/progress", + "pages/test/button", + "pages/test/checkbox", + "pages/test/input", + "pages/test/form", + "pages/test/picker", + "pages/test/picker-view", + "pages/test/radio", + "pages/test/slider", + "pages/test/switch", + "pages/test/textarea", + "pages/test/audio", + "pages/test/image", + "pages/test/vedio", + "pages/test/camera" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "Weixin", + "navigationBarTextStyle": "black" + }, + "style": "v2", + "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 5717426..c449ada 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -31,7 +31,21 @@ Page({ {title:'checkbox组件',url: "../test/checkbox"}, {title:'input组件',url: "../test/input"}, {title:'form组件',url: "../test/form"}, - {title:'picker组件',url: "../test/picker"} + {title:'picker组件',url: "../test/picker"}, + {title:'picker-view组件',url: "../test/picker-view"}, + {title:'radio组件',url: "../test/radio"}, + {title:'slider组件',url: "../test/slider"}, + {title:'switch组件',url: "../test/switch"}, + {title:'textarea组件',url: "../test/textarea"} + ] + }, + { + type:'媒体组件', + pages:[ + {title:'audio组件',url: "../test/audio"}, + {title:'image组件',url: "../test/image"}, + {title:'vedio组件',url: "../test/vedio"}, + {title:'camera组件',url: "../test/camera"} ] } ], diff --git a/pages/test/audio.js b/pages/test/audio.js new file mode 100644 index 0000000..3001002 --- /dev/null +++ b/pages/test/audio.js @@ -0,0 +1,70 @@ +// pages/test/audio.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + poster:'https://img.1ting.com/images/special/15/s300_2e0d202a2f39d3431d53053dac7f49c0.jpg', + name:'朋友', + author:'周华健', + src:'https://www.1ting.com/api/audio?/2021/12/08/08b_zd/01.mp3' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + const audioCtx=wx.createInnerAudioContext(); + audioCtx.src='https://mp3.haoge500.com/upload/320/2021/11/11/1234749.mp3'; + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/audio.json b/pages/test/audio.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/audio.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/audio.wxml b/pages/test/audio.wxml new file mode 100644 index 0000000..8470429 --- /dev/null +++ b/pages/test/audio.wxml @@ -0,0 +1,6 @@ + +pages/test/audio.wxml + + 播放网络音频 + + diff --git a/pages/test/audio.wxss b/pages/test/audio.wxss new file mode 100644 index 0000000..04f5fe0 --- /dev/null +++ b/pages/test/audio.wxss @@ -0,0 +1 @@ +/* pages/test/audio.wxss */ \ No newline at end of file diff --git a/pages/test/camera.js b/pages/test/camera.js new file mode 100644 index 0000000..68b00cd --- /dev/null +++ b/pages/test/camera.js @@ -0,0 +1,66 @@ +// pages/test/camera.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/camera.json b/pages/test/camera.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/camera.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/camera.wxml b/pages/test/camera.wxml new file mode 100644 index 0000000..8cce145 --- /dev/null +++ b/pages/test/camera.wxml @@ -0,0 +1,2 @@ + +pages/test/camera.wxml diff --git a/pages/test/camera.wxss b/pages/test/camera.wxss new file mode 100644 index 0000000..1520095 --- /dev/null +++ b/pages/test/camera.wxss @@ -0,0 +1 @@ +/* pages/test/camera.wxss */ \ No newline at end of file diff --git a/pages/test/image.js b/pages/test/image.js new file mode 100644 index 0000000..5f7f69b --- /dev/null +++ b/pages/test/image.js @@ -0,0 +1,66 @@ +// pages/test/image.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/image.json b/pages/test/image.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/image.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/image.wxml b/pages/test/image.wxml new file mode 100644 index 0000000..d26fdcf --- /dev/null +++ b/pages/test/image.wxml @@ -0,0 +1,2 @@ + +pages/test/image.wxml diff --git a/pages/test/image.wxss b/pages/test/image.wxss new file mode 100644 index 0000000..990b9ac --- /dev/null +++ b/pages/test/image.wxss @@ -0,0 +1 @@ +/* pages/test/image.wxss */ \ No newline at end of file diff --git a/pages/test/picker-view.js b/pages/test/picker-view.js new file mode 100644 index 0000000..a71037a --- /dev/null +++ b/pages/test/picker-view.js @@ -0,0 +1,78 @@ +// pages/test/picker-view.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + soup:["奶油蘑菇汤",'罗宋汤','牛肉清汤'], + maincourse:['煎小牛肉卷','传统烤羊排','清煮三文鱼'], + dessert:['坚果冰淇淋','焦糖布丁','奶酪蛋糕'], + value:[1,1,1], + menu:[] + }, + pickerviewChange:function(e){ + let v=e.detail.value; + let menu=[]; + menu.push(this.data.soup[v[0]]); + menu.push(this.data.maincourse[v[1]]); + menu.push(this.data.dessert[v[2]]); + this.setData({menu:menu}); + + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/picker-view.json b/pages/test/picker-view.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/picker-view.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/picker-view.wxml b/pages/test/picker-view.wxml new file mode 100644 index 0000000..043ea4e --- /dev/null +++ b/pages/test/picker-view.wxml @@ -0,0 +1,17 @@ + +pages/test/picker-view.wxml + + 今日菜单 + {{menu}} + + + {{item}} + + + {{item}} + + + {{item}} + + + diff --git a/pages/test/picker-view.wxss b/pages/test/picker-view.wxss new file mode 100644 index 0000000..d3323d5 --- /dev/null +++ b/pages/test/picker-view.wxss @@ -0,0 +1,8 @@ +/* pages/test/picker-view.wxss */ +picker-view{ + width: 100%; + height: 300px; +} +.col{ + line-height: 50px; +} \ No newline at end of file diff --git a/pages/test/radio.js b/pages/test/radio.js new file mode 100644 index 0000000..12ad46a --- /dev/null +++ b/pages/test/radio.js @@ -0,0 +1,73 @@ +// pages/test/radio.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + radioitems:[ + {name:'苹果',value:'Apple'}, + {name:'梨子',value:'Pear'}, + {name:'橙子',value:'Orange',checked:'true'} + ] + }, + radiochange:function(e){ + console.log(e.detail.value); + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/radio.json b/pages/test/radio.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/radio.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/radio.wxml b/pages/test/radio.wxml new file mode 100644 index 0000000..3621a01 --- /dev/null +++ b/pages/test/radio.wxml @@ -0,0 +1,10 @@ + +pages/test/radio.wxml + + 使用数组批量生成选项 + + + {{item.name}} + + + diff --git a/pages/test/radio.wxss b/pages/test/radio.wxss new file mode 100644 index 0000000..8a88b76 --- /dev/null +++ b/pages/test/radio.wxss @@ -0,0 +1 @@ +/* pages/test/radio.wxss */ \ No newline at end of file diff --git a/pages/test/slider.js b/pages/test/slider.js new file mode 100644 index 0000000..41c16db --- /dev/null +++ b/pages/test/slider.js @@ -0,0 +1,69 @@ +// pages/test/slider.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + sliderchange:function(e){ + console.log(e.detail.value); + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/slider.json b/pages/test/slider.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/slider.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/slider.wxml b/pages/test/slider.wxml new file mode 100644 index 0000000..25eb653 --- /dev/null +++ b/pages/test/slider.wxml @@ -0,0 +1,12 @@ + +pages/test/slider.wxml + + 1.滚动条右侧显示当前取值 + + 2.自定义滑动条颜色和滑块样式 + + 3.禁用滑动条 + + 4.滑动条事件监听 + + \ No newline at end of file diff --git a/pages/test/slider.wxss b/pages/test/slider.wxss new file mode 100644 index 0000000..71736f1 --- /dev/null +++ b/pages/test/slider.wxss @@ -0,0 +1 @@ +/* pages/test/slider.wxss */ \ No newline at end of file diff --git a/pages/test/switch.js b/pages/test/switch.js new file mode 100644 index 0000000..dbc59be --- /dev/null +++ b/pages/test/switch.js @@ -0,0 +1,68 @@ +// pages/test/switch.js +Page({ + switchchange:function(e){ + console.log(e.detail.value); + }, + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/switch.json b/pages/test/switch.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/switch.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/switch.wxml b/pages/test/switch.wxml new file mode 100644 index 0000000..e48e8cd --- /dev/null +++ b/pages/test/switch.wxml @@ -0,0 +1,6 @@ + +pages/test/switch.wxml + + switch事件监听 + + \ No newline at end of file diff --git a/pages/test/switch.wxss b/pages/test/switch.wxss new file mode 100644 index 0000000..386a4bd --- /dev/null +++ b/pages/test/switch.wxss @@ -0,0 +1 @@ +/* pages/test/switch.wxss */ \ No newline at end of file diff --git a/pages/test/textarea.js b/pages/test/textarea.js new file mode 100644 index 0000000..338b785 --- /dev/null +++ b/pages/test/textarea.js @@ -0,0 +1,66 @@ +// pages/test/textarea.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/test/textarea.json b/pages/test/textarea.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/textarea.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/textarea.wxml b/pages/test/textarea.wxml new file mode 100644 index 0000000..3902546 --- /dev/null +++ b/pages/test/textarea.wxml @@ -0,0 +1,10 @@ + +pages/test/textarea.wxml + + 1.自动变高 +