From 06c0140fbd03bd951455a31006f1ec3520b210b6 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Fri, 11 Nov 2022 09:20:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=B0=8F=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/pages/list/list.js | 73 ++++++++++++++++++++++++++++++++ miniprogram/pages/list/list.wxml | 5 +++ miniprogram/pages/more/more.js | 15 +++++-- 3 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 miniprogram/pages/list/list.js create mode 100644 miniprogram/pages/list/list.wxml diff --git a/miniprogram/pages/list/list.js b/miniprogram/pages/list/list.js new file mode 100644 index 0000000..8c1a850 --- /dev/null +++ b/miniprogram/pages/list/list.js @@ -0,0 +1,73 @@ +// pages/list/list.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + nowTime: new Date().toLocaleDateString(), + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.startWifi({ + success (res) { + console.log("成功", res.errMsg); + + }, + fail(res) { + console.log("失败", res.errMsg); + } + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, +}) \ No newline at end of file diff --git a/miniprogram/pages/list/list.wxml b/miniprogram/pages/list/list.wxml new file mode 100644 index 0000000..bb87873 --- /dev/null +++ b/miniprogram/pages/list/list.wxml @@ -0,0 +1,5 @@ + + +现在时间是: {{nowTime}} + + \ No newline at end of file diff --git a/miniprogram/pages/more/more.js b/miniprogram/pages/more/more.js index 14870a3..e49638e 100644 --- a/miniprogram/pages/more/more.js +++ b/miniprogram/pages/more/more.js @@ -13,7 +13,15 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + wx.startWifi({ + success (res) { + console.log("成功", res.errMsg); + + }, + fail(res) { + console.log("失败", res.errMsg); + } + }); }, /** @@ -29,14 +37,13 @@ Page({ onShow: function () { }, - + /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, - /** * 生命周期函数--监听页面卸载 */ @@ -63,5 +70,5 @@ Page({ */ onShareAppMessage: function () { - } + }, }) \ No newline at end of file