zheng před 1 dnem
rodič
revize
fbc0dfab65

+ 2 - 1
12.小程序/app.json

@@ -2,7 +2,8 @@
   "pages": [
     "pages/home/home",
     "pages/my/my",
-    "pages/list/list"
+    "pages/list/list",
+    "pages/detail/detail"
   ],
   "window": {
     "navigationBarTextStyle": "black",

+ 66 - 0
12.小程序/pages/detail/detail.js

@@ -0,0 +1,66 @@
+// pages/detail/detail.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
12.小程序/pages/detail/detail.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
12.小程序/pages/detail/detail.wxml

@@ -0,0 +1,2 @@
+<!--pages/detail/detail.wxml-->
+<text>详情</text>

+ 1 - 0
12.小程序/pages/detail/detail.wxss

@@ -0,0 +1 @@
+/* pages/detail/detail.wxss */

+ 25 - 0
12.小程序/pages/home/home.js

@@ -31,6 +31,31 @@ Page({
      name:"哆啦A梦" 
     })
   },
+  handleRead() {
+    console.log(wx.getStorageSync('username'))
+  },
+  handleShow() {
+    // wx.showToast({
+    //   title: '你好',
+    //   icon:'error'
+    // })
+    wx.setStorageSync('username', '小强')
+  },
+  handleJump() {
+    console.log("你好")
+    // wx.navigateTo({
+    //   url: '/pages/detail/detail',
+    // })
+    // wx.redirectTo({
+    //   url: '/pages/detail/detail',
+    // })
+    // wx.switchTab({
+    //   url: '/pages/list/list',
+    // })
+    wx.reLaunch({
+      url: '/pages/list/list',
+    })
+  },
   handleInput(e) {
     // console.log(e,'eeee')
     const key = e.detail.value;

+ 4 - 0
12.小程序/pages/home/home.wxml

@@ -1,6 +1,9 @@
 <!--pages/home/home.wxml-->
 <view>
+<navigator url="/pages/detail/detail">详情</navigator>
+  <button bind:tap="handleJump" class="btn">跳转</button>
   <headers></headers>
+  <button bind:tap="handleShow" class="btn">展示</button>
   <!-- 表单绑定 -->
   <input type="text" class="inp" value="{{users}}" bindinput="handleInput" />
   <!-- <input type="radio"/> -->
@@ -8,6 +11,7 @@
     <radio value="man" />男
     <radio value="woman" />女
   </radio-group>
+  <button bind:tap="handleRead" class="btn">读取</button>
   <!-- <checkbox-group bindchange="">
   <checkbox value=""/>
 </checkbox-group> -->