随笔分类 - UniApp
摘要:if (res.data.code == 401) { var jump = uni.getStorageSync('jump') if (!jump) { uni.navigateTo({ url: '/pages/weixin/weixin' }) } uni.setStorageSync('j
阅读全文
摘要:创建一个filters.js过滤文件 export default { textFilter(text) { //过滤特殊字符方法 var pattern=new RegExp("[`~%!@#^=''?~!@#¥……&——‘”“'?*()(),,。.、]"); var rs=""; for(var
阅读全文
摘要:var pages = getCurrentPages();//当前页 var beforePage = pages[pages.length - 2];//上个页面 // #ifdef H5 beforePage.getData() // #endif // #ifndef H5 beforePa
阅读全文
摘要:<rich-text class="rich-text" :nodes="dataList.activityDetails | formatRichText"></rich-text> filters: { formatRichText(html) { //控制小程序中图片大小 let newCon
阅读全文
摘要:在manifest.json里面修改 "permission" : { "scope.userLocation": { "desc": "你的位置信息将用于小程序位置接口的效果展示" // 高速公路行驶持续后台定位 } } 在menthods使用 getLocation(success) { //打
阅读全文
摘要:在onShow 中调用 wx.hideHomeButton() onShow() { wx.hideHomeButton() },
阅读全文
摘要:height: uni.getSystemInfoSync().screenHeight
阅读全文
摘要:pages.json文件中与pages同级 { "pages": [{ "path": "pages/index/index", "style": { ...} }, { "path": "pages/login/login", "style": { ...} }], "subPackages":
阅读全文
摘要:调取手机摄像头 <view @click="scan">扫码验证</view> scan() { //扫码验证 var _this = this; uni.scanCode({ onlyFromCamera: true, //为true只允许相机扫码,不加允许相册扫码 success: functi
阅读全文
摘要:与methods同级,可以直接调取小程序右上角的分享 onShareAppMessage(res) { if (res.from 'button') {// 来自页面内分享按钮 console.log(res.target) } return { title: '分享的标题', path: '分享的
阅读全文
摘要:点击确认保存,返回上一层 sure() { // uni.navigateBack({ // url: '../add_action/add_action?id=' + this.istab // }) var pages = getCurrentPages(); var prevPage = pa
阅读全文
摘要:如果点击手机运行,HBuilder无法找到手机,尝试以下解决方案:Android手机:1)确认手机已通过数据线连接电脑2)如果是Windows系统,确认已安装Android手机驱动。装驱动比较好的方式是使用各种手机助手,比如360、金山、腾讯的各种手机助手,如果有问题,尝试升级助手的版本。3)确认手
阅读全文