摘要: const fileName = file.lastIndexOf('.'); // 取到文件名开始到最后一个点的长度 const fileNameLen = file.length; // 取到文件名长度 const fileType = file.substring(fileName + 1, fileNameLen); // 截 阅读全文
posted @ 2019-11-15 14:55 顾非白 阅读(1978) 评论(0) 推荐(0) 编辑
摘要: /* 打开文档 * @param fileUrl: 文件地址 * @param filetype: 文件类型 */ openDocument(fileUrl, filetype) { wx.downloadFile({ url: fileUrl, success: res => { const filePath = res.temp... 阅读全文
posted @ 2019-11-09 09:37 顾非白 阅读(4742) 评论(0) 推荐(0) 编辑
摘要: http请求 删除数据 上传 阅读全文
posted @ 2019-11-09 09:33 顾非白 阅读(1912) 评论(0) 推荐(0) 编辑
摘要: 公司业务需要实现电子签名功能,当前我使用的是wepy框架。 html less ts 阅读全文
posted @ 2019-11-09 09:23 顾非白 阅读(3034) 评论(0) 推荐(1) 编辑
摘要: 1、数组按createTime排序 function sortByCreateTime(list: any[]) { return list.sort(function(a, b) { return new Date(a.createTime).getTime() - new Date(b.crea 阅读全文
posted @ 2019-11-09 09:07 顾非白 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 1.npm -v 查看npm当前版本 2.tsc -v 查看typescript当前版本 3.npm install moduleName 安装模块到项目node_modules目录下,运行 npm install 初始化项目时不会下载模块,若此模块已安装,则为升级到最新版本,eg:npm i ty 阅读全文
posted @ 2019-11-05 14:46 顾非白 阅读(778) 评论(0) 推荐(0) 编辑
摘要: join() 1 // 数组转字符串 2 var arr = [1,2,3]; 3 console.log(arr.join()); // 1,2,3 4 console.log(arr.join("-")); // 1-2-3 5 // 通过join()方法可以实现重复字符串,只需传入字符串以及重 阅读全文
posted @ 2019-10-23 17:27 顾非白 阅读(1629) 评论(0) 推荐(0) 编辑
摘要: forEach 循环 1 // 遍历数组,无返回值,不改变原数组,仅仅只是遍历 2 let arr = [2,3,4,5]; 3 arr.forEach((item, index)=>console.log(item)); map 1 // 1个对1个映射, 循环什么最后return什么,不会改变原 阅读全文
posted @ 2019-10-23 16:17 顾非白 阅读(534) 评论(0) 推荐(0) 编辑
摘要: 最近在撸原生代码,input还能更改disabled样式,先做一个记录 1 input:disabled { 2 background-color : #fff; // 修改默认灰色样式 3 color: #666; 4 opacity:1; // 默认的不透明级别为0.3 5 -webkit-te 阅读全文
posted @ 2019-04-03 19:18 顾非白 阅读(4264) 评论(0) 推荐(0) 编辑
摘要: 开发时会遇到这种问题,从A页面跳转→B页面→C页面,使用navigateBack,跳转到上一页,但如果从C页面直接跳转到A页面,在这个过程中直接销毁B页面呢? 可在A页面跳转B页面时: 可在B页面跳转C页面时: 这样在C页面点击回退时,会直接回到A页面。 阅读全文
posted @ 2018-06-29 14:26 顾非白 阅读(678) 评论(0) 推荐(0) 编辑