<!--pages/video/video.wxml--><viewclass="video-list"wx:for="{{movieList}}"wx:key="user"><viewclass="video-title">{{item.title}} </view><viewclass="video-time">{{formatData(item.create_time)}} </view><videosrc="{{item.src}}"object-fit="fill"/></view><wxsmodule="formatData">
module.exports=function(timestamp){
var date=getDate(timestamp)
var y=date.getFullYear()
var m=date.getMonth()
var d=date.getDate()
var h=date.getHours()
var i=date.getMinutes()
var s=date.getSeconds()
return y+'-'+m+'-'+d+' '+h+'-'+i+'-'+s
}
</wxs>
NaN是解析的值
js中create_time的值
<!--pages/video/video.wxml--> <view class="video-list" wx:for="{{movieList}}" wx:key="user"> <view class="video-title">{{item.title}} </view> <view class="video-time">{{formatData(item.create_time)}} </view> <video src="{{item.src}}" object-fit="fill"/> </view> <wxs module="formatData"> module.exports=function(timestamp){ var date=getDate(timestamp) var y=date.getFullYear() var m=date.getMonth() var d=date.getDate() var h=date.getHours() var i=date.getMinutes() var s=date.getSeconds() return y+'-'+m+'-'+d+' '+h+'-'+i+'-'+s } </wxs>
不明白!