上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: const d = Fri Sep 20 2019 16:37:39 GMT+0800 (中国标准时间); const d = res.data[0].time const resDate = d.getFullYear() + '-' + this.p((d.getMonth() + 1)) + '-' + this.p(d.getDate()) ... 阅读全文
posted @ 2019-09-26 21:08 在学习编程的lsy呀 阅读(1478) 评论(0) 推荐(0) 编辑
摘要: var str = 'Fri Sep 20 2019 16:37:39 GMT+0800 (中国标准时间)'; str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24) var d = new Date(str); var a = [d.getFullYear(), d.getMonth() + 1, d.getDate() 阅读全文
posted @ 2019-09-26 21:01 在学习编程的lsy呀 阅读(2905) 评论(0) 推荐(0) 编辑
摘要: 类型转换主要指,将其他数据类型转换为(String、Number、Boolean)转换为string:方式一:调用xxx的yyy()方法,就是xxx.yyy() var a=123; a.toString(); console.log(a); 结果:123 该方法不会影响到原来的变量,它会将转换的结 阅读全文
posted @ 2019-09-26 20:56 在学习编程的lsy呀 阅读(138) 评论(0) 推荐(0) 编辑
摘要: sitemap 的索引提示是默认开启的,如需要关闭 sitemap 的索引提示,可在小程序项目配置文件 project.config.json 的 setting 中配置字段 checkSiteMap 为 false 阅读全文
posted @ 2019-09-22 17:59 在学习编程的lsy呀 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 在wx:for后面添加wx:key="key" 可消除警告。 阅读全文
posted @ 2019-09-22 17:50 在学习编程的lsy呀 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 赋值的方式不对 我当时是数组循环赋值,结果没有显示出来 然后采用了下面的赋值方式就正确了 var that = this; that.setData({ listDatas: res.data }); var that = this; that.setData({ listDatas: res.da 阅读全文
posted @ 2019-09-22 17:44 在学习编程的lsy呀 阅读(1521) 评论(0) 推荐(0) 编辑
摘要: js: data:{ listDatas:null//请求的数据存在这个数组里面 } onLoad: function (options) { const db = wx.cloud.database(); db.collection('otheritems').get().then(res => 阅读全文
posted @ 2019-09-22 17:39 在学习编程的lsy呀 阅读(863) 评论(0) 推荐(0) 编辑
摘要: wxml: <van-tag round size="medium" type="{{item.type?'danger':'primary'}}">{{item.type?'失物招领':'寻物启事'}}</van-tag> js: listDatas: [ { type: 1, name: '充电 阅读全文
posted @ 2019-09-22 09:46 在学习编程的lsy呀 阅读(1852) 评论(0) 推荐(0) 编辑
摘要: wxml: <view class='button_container'> <block wx:for="{{buttons}}" wx:key="buttons"> <button class='{{item.checked?"checked_button":"normal_button"}}' 阅读全文
posted @ 2019-09-21 20:41 在学习编程的lsy呀 阅读(1260) 评论(1) 推荐(0) 编辑
摘要: wxml: <view class='parameter-wrap'> <block wx:for="{{parameter}}" wx:key="parameter"> <button class='parameter-info text-over {{item.checked?"checked_ 阅读全文
posted @ 2019-09-21 20:27 在学习编程的lsy呀 阅读(1242) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页