[图片]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>
wxs getDate控制台输出 function nv_getDate(nv_date){if (nv_date === undefined)return(nv_date);;return(nv_date.nv_split(" ")[(0)])} function 2017-7-1 string 返回结果为string
2023-05-01 bindInputBlur:function(e){ console.log(e) this.inputValue=e.detail.value }, bindSendDanmu:function(){ console.log(this.inputValue) this.vedioContext.sendDanmu({ text:this.inputValue, color:'#f90' }) } [图片]
Cannot read property 'sendDanmu' of undefined?TypeError: Cannot read property 'sendDanmu' of undefined [图片]
2023-05-01