//登录页面
Page({
data:{
username:''☆●;,
password:''○△;
}•▼, onShareAppMessage: function () {
return {
title: '登录',
desc: '登录页面!'
}
}○▪,
onShow:function(){
var that=this;
wx.getStorage({
key: 'username'◇●▼,
success: function(res) {
console◇☆.log(res△★▼.data)
that.setData({
username: res.data
})
}□•,
})
wx.getStorage({
key: '…▲;password',
success: function (res) {
console.log(res.data)
that.setData({
password: res.data
})
}
})
},
//app.js
App({
onLaunch: function() {
//调用API从本地缓存中获取数据
var logs = wx=••□.getStorageSync('logs'▪◆●;)
[]
logs.unshift(Date.now())
wx.setStorageSync('▽-□■;logs', logs)
},
getUserInfo: function(cb) {
var that = this
if (this.globalData○•-=.userInfo) {
typeof cb == "function"○☆; && cb(this.globalData.userInfo)
} else {
//调用登录接口
wx.getUserInfo({
withCredentials: false,
success: function(res) {
that-★.globalData.userInfo = res•□-.userInfo
typeof cb == "function" &&☆•▽-; cb(that.globalData.userInfo)
}
})
}
},
globalData▪▲△: {
userInfo: null
}▽==▪,
})
以上就是如何将其他页面的数据存入app★◆.js中的详细内容,楚雄市小程序开发哪家好[四平seo公司都选久澳]更多请关注久澳传媒编程栏目其它相关文章!侯马市小程序制作公司22 2020.10 [乐山seo公司皆选久澳]微信小程序中如何引用其他JavaScript文件 微信小程序如何引用其他js文件 1.我们先建立一个common.js文件,商丘市小程序制作公司在common▷.js编写我们的程序, function myfunc() {console.log(myfunc....);} module.exports.myfunc = myfunc▲=○■; 这样暴露接口, 邢台市小。
*请认真填写需求信息,我们会在24小时内与您取得联系。