微信小程序记账本进度六
//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.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData:{
userInfo:null
}
})
//app.json
{
"pages":[
"pages/index/index"
],
"window":{
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "记账",
"navigationBarTextStyle":"black",
"backgroundColor": "gray"
},
"debug":true
}
//app.wxss
.container {
display: flex;
flex-direction: column;
}
微信小程序记账本进度六的更多相关文章
- 微信小程序记账本进度一
一,1.注册微信公众号 2.点击“立即注册”后,点击“”小程序“” 3.填写邮箱等信息.完成并激活.
- 微信小程序记账本进度二
二.1,下载微信web开发者工具 2,使用新注册的账号登录,并创建工程
- 微信小程序记账本进度七
最后大体上完成了,但是好像少了点功能,整体并不是特别华丽
- 微信小程序记账本进度三
//index.jsvar util = require("../../utils/util.js"); //获取应用实例 var app = getApp(); Page({ d ...
- 微信小程序记账本进度四
//index.wxml <view class="container"> <form catchsubmit="formSubmit" &g ...
- 微信小程序记账本进度五
//index.wxss.account-detail{ height: 100rpx; padding: 0 30rpx; } .account-amount{ padding: 0 30rpx; ...
- 【微信小程序开发•系列文章六】生命周期和路由
这篇文章理论的知识比较多一些,都是个人观点,描述有失妥当的地方希望读者指出. [微信小程序开发•系列文章一]入门 [微信小程序开发•系列文章二]视图层 [微信小程序开发•系列文章三]数据层 [微信小程 ...
- 微信小程序,前端大梦想(六)
微信小程序,前端大梦想(六) 微信小程序之联合百度API实现定位 定位功能对于我们都不陌生,在移动端的应用中更是不可或缺的功能,小程序中也提供了对应的API帮助我们完成定位的实现,但是目前小程序的定位 ...
- 微信小程序把玩(十六)form组件
原文:微信小程序把玩(十六)form组件 form表单组件 是提交form内的所有选中属性的值,注意每个form表单内的组件都必须有name属性指定否则提交不上去,button中的type两个subm ...
随机推荐
- 阿里java开发规范 强制约束
http://news.51cto.com/art/201901/591018.htm :阿里开发强制要求的11条索引创建规范,提高性能 https://blog.csdn.net/Lujunwei ...
- pandas Dataframe 取某行
In [1]: df = DataFrame(randn(5,2),index=range(0,10,2),columns=list('AB')) In [2]: df Out[2]: A B 0 1 ...
- python 文件读写模式r,r+,w,w+,a,a+的区别(附代码示例)
如下表 模式 可做操作 若文件不存在 是否覆盖 r 只能读 报错 - r+ 可读可写 报错 是 w 只能写 创建 是 w+ 可读可写 创建 是 a 只能写 创建 否,追加写 a+ 可读可写 创建 ...
- jekins构建触发器详解
jenkins版本:2.89.2 1.触发远程构建 (例如,使用脚本):通过一个网址的访问来触发构建,这样就不需要登录jenkins系统也能触发构建了. 示例地址: http://localhost: ...
- vim中行末去掉^M
方式1: 输入 :%s/^M//g 方式2: 输入:%s/\r//g
- pass parameter by endpoint, this is for websocket
使用了Java的字符串:@ServerEndpoint("/chat/{room}")public class MyEndpoint {@OnMessagepublic void ...
- 使用fdisk进行分区
fdisk进行分区 1.首先使用fdisk -l 发现待分区磁盘/dev/vdb 大小为1TB 2.fdisk /dev/vdb 对该磁盘进行分区,输入m并回车 3.输入n并回车,n是“new”新建 ...
- Redis梳理
- Unable to complete the scan for annotations for web application [/wrs] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies.
tomcat启动报错:Jul 20, 2018 11:48:37 AM org.apache.catalina.core.ContainerBase addChildInternalSEVERE: C ...
- js跳转新窗口
语法:window.open(url,[target]); eg: window.open("index.html"); window.open("index.html& ...