摘要: // if (datas.key 'telephoneNumber') {// const { val } = datas// const patrn1 = /^(1[3-9]\d{9}$)/// const patrn = /^(([0-9]{3,4}[-])?[0-9]{7,8}$)/// le 阅读全文
posted @ 2022-07-27 10:52 谎渊 阅读(361) 评论(0) 推荐(0) 编辑
摘要: // mathjs 四舍五入取整 val:值export function roundingInt(val) { if (val) { return math.round(val, 0) }}// mathjs 四舍五入 val:值,num:小数位export function rounding(v 阅读全文
posted @ 2022-07-27 10:49 谎渊 阅读(131) 评论(0) 推荐(0) 编辑
摘要: /* * 参数说明:* number:要格式化的数字* decimals:保留几位小数 * dec_point:小数点符号* thousands_sep:千分位符号* */export function numberDivision(number, decimals, dec_point, thou 阅读全文
posted @ 2022-07-27 10:42 谎渊 阅读(120) 评论(0) 推荐(0) 编辑
摘要: // 搜索过滤 val:传入值, list:列表数组, key:对比字段, filterIndex:过滤开始的索引export function dataFilter(val, list, key, filterIndex) { filterIndex = filterIndex >= 0 ? fi 阅读全文
posted @ 2022-07-27 10:39 谎渊 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 使用uni.getFileSystemManager().writeFile去下载base64图片<view class="share-btn" @click="saveAlbum()">保存相册分享</view>//保存相册 saveAlbum(){ uni.getSetting({//获取用户的 阅读全文
posted @ 2022-07-13 17:43 谎渊 阅读(245) 评论(0) 推荐(0) 编辑
摘要: //APP.vuegetUser(){//获取客户端标识 消息推送 // #ifdef APP-PLUS var pinf = plus.push.getClientInfo(); var cid = pinf.clientid; //客户端标识 console.log('cid:' + cid); 阅读全文
posted @ 2022-06-17 11:57 谎渊 阅读(94) 评论(0) 推荐(0) 编辑
摘要: arrFilter(val1, val2, key1, key2) { const val = [] // 保存遍历时要留下的项 const res = [] for (let len = 0; len < val1.length; len++) { const item = val1[len] l 阅读全文
posted @ 2022-05-27 09:43 谎渊 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 常用正则表达式 正则表达式用于字符串处理、表单验证等场合,实用高效。现将一些常用的表达式收集于此,以备不时之需。 用户名:/^[a-z0-9_-]{3,16}$/ 密码:/^[a-z0-9_-]{6,18}$/ 十六进制值:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/ 电子邮箱:/ 阅读全文
posted @ 2022-05-16 11:08 谎渊 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 要使用第三方百度地图,首先要去百度地图官方申请一个密钥,之后引入百度地图的API文件,参考使用文档即可开发使用。而在uniapp中是没法直接引入百度地图API文件的,我们要结合uniapp中的web-view组件来使用。 web-view 是一个 web 浏览器组件,可以用来承载网页的容器,会自动铺 阅读全文
posted @ 2022-04-24 15:03 谎渊 阅读(2437) 评论(0) 推荐(0) 编辑
摘要: 一、初始化canvas画布 通过createCanvasContext方法来创建画布 var _this = this; _this.ctx = uni.createCanvasContext('canvasid', this); const C_W = 650; //canvas宽度,使用的手机屏 阅读全文
posted @ 2022-04-24 12:01 谎渊 阅读(7076) 评论(0) 推荐(1) 编辑