基础库
- 开发用户程序
- 上层: 用户
- SDK 解析程序 到 应用层
- wx -> minprogram -> SDK -> 版本不停 SDK不同
- 灰度发布: 服务器推送一部分用户测试 -> 测试完成 -> 全量发布 所有用户
时间格式化封装
function formatCount (count) {
var counter = parseInt(count)
if ( counter > 100000000) {
return (counter / 100000000).toFixed(1) + '亿'
} else if (counter > 10000) {
return (counter / 10000).toFixed(1) + '万'
} else {
return counter + ""
}
}
function padLeftZero (time) {
time = time + ""
return ("00"+time).slice(time.length)
}
function formatDuration (dt) {
dt = dt / 1000
var minute = Math.floor(dt / 60)
var second = dt % 60
return padLeftZero(minute) + ':' + padLeftZero(second)
}
module.exports = {
formatCount: formatCount,
formatDuration: formatDuration
}
组件不作为display: flex的第一个对象 外面包裹一个div&view
滚动