随笔分类 -  uniapp

摘要:1.打开蓝牙适配器 openBluetoothAdapter() { const that = this wx.openBluetoothAdapter({ success(res) { console.log('open blueFi success: ', res) that.onBluetoo 阅读全文
posted @ 2021-09-08 15:28 飞鸟和蝉- 阅读(5020) 评论(0) 推荐(0) 编辑
摘要:小程序设置缓存时,添加一个失效时间 其实原理就是,在设置缓存的时候,同时设置一个 缓存名+deadtime用来存当前的时间戳. 使用的时候直接判断一下设置的到期时间(t) 和 当前的时间,查看是否过期 var dtime = '_deadtime' /** * @param {*} k: key; 阅读全文
posted @ 2021-01-18 11:32 飞鸟和蝉- 阅读(2853) 评论(0) 推荐(0) 编辑
摘要:先创建一个index.vue文件: 在uni.scss 里用变量定义颜色: 配置浅色 css 样式: 配置暗色主题颜色: 只需要改变颜色变量名; 创建一个store文件:在里面创建一个 index.js 和 modules文件夹 在 theme.js 里面 配置如下:export default { 阅读全文
posted @ 2020-09-02 19:04 飞鸟和蝉- 阅读(5860) 评论(0) 推荐(0) 编辑
摘要:onReady(){ let that = this uni.getSystemInfo({ success: function(res) { // res - 各种参数 console.log(res.windowHeight); // 屏幕的宽度 let info = uni.createSel 阅读全文
posted @ 2020-08-12 17:58 飞鸟和蝉- 阅读(3629) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示