随笔分类 - 微信小程序
开发小程序时遇到的坑
摘要:// 验证输入金额 money(val) { let num = val.toString(); //先转换成字符串类型 if (num.indexOf('.') == 0) { //第一位就是 . num = '1' + num } num = num.replace(/[^\d.]/g, "")
阅读全文
摘要:/** * 获取模块高度 * @param {*} selector :模块的id/class */ function getModularHeight(selector, callback) { let query = wx.createSelectorQuery(); query.select(
阅读全文
摘要:/** * 小程序更新 */ autoUpdate: function () { var self = this // 获取小程序更新机制兼容 /* 判断小程序的API,回调,参数,组件等是否在当前版本可用 */ if (wx.canIUse('getUpdateManager')) { const
阅读全文
摘要:/** * TM无提示弹框 */ export const noneTips = (text, time, callback) => { let isFun = typeof time == 'function'; wxTips(text, 'none', isFun ? '2000' : time
阅读全文
摘要:// router 路由js 用于跳转 TMD 各个页面 /** * 跳转到首页 */ export const routeHome = (callback) => { router('../index/index', 'switchTab').then(res => { callback ? ca
阅读全文