首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >微信小程序评论发送功能无法实现:异常报错newData is not a function?

微信小程序评论发送功能无法实现:异常报错newData is not a function?

提问于 2019-05-17 11:20:47
回答 0关注 0查看 283

评论newData is not a function框输入内容之后发送不出去,发送按钮不管用

发送方法在post-comment.js里面

//提交用户评论

submitComment:function(event){

var newData={

username:"青石",

avatar:"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1552921052251&di=8005020afa2e9232c0dcd5c78a0f6829&imgtype=0&src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180803%2F21%2F1533303068-YzdjEqvFtK.jpg",

create_time:newData().getTime()/1000,

//评论内容

content:{

txt:this.data.keyboardInputValue

},

};

if(!newData.content.txt){

//如果没有评论内容,就不执行任何操作

return;

};

//保存新评论缓存到数据库中

this.dbPost.newComment(newData);

//显示操作结果

this.showCommitSuccessToast();

//重新渲染并绑定所有评论

this.bindCommentData();

//恢复初始状态

this.resetAllDefaultStatus();

},

报错截图

模拟器截图

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档