12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
建站问答 时间:2024-12-01 19:17:42
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
小程序调用不同页面函数的案例:函数写在对应的js文件,代码如下:functionformatTime(date){varyear=date.getFullYear()varmonth=date.getMonth()+1varday=date.getDate()varhou
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
小程序调用不同页面函数的案例:
函数写在对应的js文件,代码如下:
functionformatTime(date){
varyear=date.getFullYear()
varmonth=date.getMonth()+1
varday=date.getDate()
varhour=date.getHours()
varminute=date.getMinutes()
varsecond=date.getSeconds()
return[year,month,day].map(formatNumber).join('/')+''+[hour,minute,second].map(formatNumber).join(':')
}
functionformatNumber(n){
n=n.toString()
returnn[1]?n:'0'+n
}
module.exports={
formatTime:formatTime,
}
在其他页面中调用的代码如下:
collegeChoiceTap:function(e){
if(this.data.index!==e.detail.value){
console.log(getApp().globalData.college_change)。
getApp().get_a_test()
this.setData({
index:e.detail.value
})
}
}
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19