更新记录
- 2018.05.01更新0.1
- 2018.05.02更新0.2
踩坑知识点
记录支付宝小程序一键转化微信小程序的踩坑过程:
-
纯前端
-
文件操作
-
支付宝/微信应用前端差异化
纯前端
promise/async&await
1.使用方法:
https://ninghao.net/blog/5508
2.引入规则:
http://wolfx.leanote.com/post/4d000e8c63d0
微信及支付宝开发文档
1.微信:
https://developers.weixin.qq.com/miniprogram/dev/api/
2.阿里:
https://docs.alipay.com/mini/developer/getting-started
栈溢出问题 Maximum call stack size exceeded
1.微信小程序中,文件相互循环引包导致栈溢出。支付宝未报错
正则匹配
1.匹配模块可调用
2.正则匹配的规范
文件操作
shelljs
1.
https://www.kancloud.cn/outsider/clitool/313191
shelljs是Unix Shell在Node.js API层的轻量级实现,可以支持Windows、Linux、OS X。你可以像在Unix命令行敲命令一样书写代码
fs
1.fs模块:
http://javascript.ruanyifeng.com/nodejs/fs.html
2.node-fs-extra:
https://github.com/jprichardson/node-fs-extra
parse5 – HTML parsing/serialization toolset for Node.js
http://inikulin.github.io/parse5/
https://github.com/inikulin/parse5
mpvue
https://github.com/Meituan-Dianping/mpvue
微信转支付宝
https://github.com/aOrz/wxmp2antmp
支付宝/微信应用前端差异化
微信和支付宝差异
1.wx 获取缓存空值会报fail,ali不会,会返回空
2.fetch不同,header与headers也不同
3.json有不同
4.ali允许相互调用,栈溢出没有报警,微信不允许
5.微信语法更严格,开闭合必须具备。ali不严格
6.微信async需要引入,ali不需要。promise都支持
7.wx样式更严格。
不支持:background: url(‘/imgs/back.png’) no-repeat;
8.目录区别:
1)ali支持目录下自动寻找index引导,wx不支持
2)微信都是相对路径,不支持绝对路径,以page作为目录;ali支持绝对路径
9.业务:
1)微信授权:
https://developers.weixin.qq.com/miniprogram/dev/api/authorize-index.html