小程序开发中的总结

nice,赶上了第一波小程序,自己开发得一个应用上线啦,不容易呀,尤其是微信审核,往返5次左右才通过审核,在这里给大家分享一些有用的信息(其实开发过程也碰到了很多细节上的小坑,不过微信升级比较频繁,有些解决了,细节上的有些忘记了,可以留言一起讨论下)

1、审核不通过原因总结:

2、Promise

我这边使用的是es6-promise,推酷上采用某位大神的方式

yarn add es6-promise --save

使用(根据自己公司的接口情况,自己封装一下,使用比较方便):

import Promise from './lib/es6-promise';

request(params).then((res) =>{

}).catch((err) => {

}).finally(() => {

});

3、tab图片注意事项


icon最好留下透明边距,默认会图片全部拉伸适应的,刚开始安卓会固定大小自动去适配挺好看的,iPhone不行,现在两边都不做处理了,所以icon得自己做下透明边距,不然超难看的

4、css3支持的不是很全(选择器nth-child不支持),wxss又有点像sass、less之类但是功能又远不如,比较鸡肋,将就用吧。wxml节点上用起来挺不爽的,微信自己整了一套规范出来了,人家的平台想咋整咋整,原理上和html差不多

.loading view {

background-color: #ddd;

width: 10px;

height: 10px;

border-radius: 100%;

margin: 2px;

-webkit-animation-fill-mode: both;

animation-fill-mode: both;

display: inline-block;

}

@-webkit-keyframes scale {

0% {

-webkit-transform: scale(1);

opacity: 1;

}

45% {

-webkit-transform: scale(0.1);

opacity: 0.7;

}

80% {

-webkit-transform: scale(1);

opacity: 1;

}

}

@keyframes scale {

0% {

-webkit-transform: scale(1);

transform: scale(1);

opacity: 1;

}

45% {

transform: scale(0.1);

opacity: 0.7;

}

80% {

transform: scale(1);

opacity: 1;

}

}

.loading .ball-1 {

animation: scale 0.75s 0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);

-webkit-animation: scale 0.75s 0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);

}

.loading .ball-2 {

animation: scale 0.75s 0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);

-webkit-animation: scale 0.75s 0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);

}

.loading .ball-3 {

animation: scale 0.75s 0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);

-webkit-animation: scale 0.75s 0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);

}


其实过程中还碰到不少坑,记不清了,第二版再给大家总结下,有啥问题大家一起讨论~

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    love2013阅读 6,874评论 0 11
  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    wzhiq896阅读 5,938评论 0 2
  • 2D、3D变形动画 transform:2D变形:复合属性 通过 CSS3 转换,我们能够对元素进行移动、缩放、转...
    Zd_silent阅读 3,161评论 0 0
  • 百度知道和知乎同样都是提问区,作为推广者我们该如何选择这两个平台呢?下面三师弟就详细和大家聊聊。 1、社区定位差别...
    皮皮虾时尚阅读 5,136评论 0 0
  • 凌晨时分 我咿咿呀呀的叫着 此刻 我降临于世上 这是 母亲赐予我最好的礼物
    Ling_00阅读 1,229评论 2 4

友情链接更多精彩内容