You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
// pages/navigation/safety/safety.js
Page ( {
/**
* 页面的初始数据
*/
data : {
inputText : ''
} ,
saveinform : function ( ) {
wx . switchTab ( {
url : '../self/self'
} )
} ,
/**
* 生命周期函数--监听页面加载
*/
onLoad ( options ) {
} ,
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady ( ) {
} ,
/**
* 生命周期函数--监听页面显示
*/
onShow ( ) {
const self = this
let userText = wx . getStorageSync ( 'userText' )
if ( userText ) {
self . data . inputText = userText
self . setData ( self . data )
}
} ,
onInputText ( e ) {
const self = this
const value = e . detail . value
if ( value ) {
wx . setStorageSync ( 'userText' , value )
} // 监听用户输入的信息, 一旦有内容输入进去, 就会使用wx.setStorageSync('userText', value)设置usertext这个key的值, 使用wx.getStorageSync('userText')可以得到usertext这个key的值
} ,
/**
* 生命周期函数--监听页面隐藏
*/
onHide ( ) {
} ,
/**
* 生命周期函数--监听页面卸载
*/
onUnload ( ) {
} ,
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh ( ) {
} ,
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom ( ) {
} ,
/**
* 用户点击右上角分享
*/
onShareAppMessage ( ) {
}
} )