formsubmit:function(e){
var page =this;
if (page.data.title.replace(/(^\s*)|(\s*$)/g, "") == "" || page.data.content.replace(/(^\s*)|(\s*$)/g, "") == "") {
wx.showModal({
title: '',
content: '请填写完整的内容哦!',
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
} else {
wx.redirectTo({
url: '../success/success',
})
var img = page.data.ishas;
console.log(img)
var imgUrl = page.data.imgUrl;
var title = e.detail.value.title.replace(/(^\s*)|(\s*$)/g, "");
var showList = new ShowList({
zan: false,
imgUrl: imgUrl,
contentTitle: e.detail.value.title,
suggest: e.detail.value.text,
img: img
})
var acl = new AV.ACL();
acl.setPublicReadAccess(true);
acl.setPublicWriteAccess(false);
acl.setReadAccess(AV.User.current(), true);
acl.setWriteAccess(AV.User.current(), true);
showList.setACL(acl);
showList.save()
.then(
ShowList => app.globalData.showList =
[ShowList, ...app.globalData.ShowLists]
)
.catch(console.error)
}
console.log('form发生了submit事件,携带数据为:', e.detail.value)
}
这是提交的事件,如果我把上面的save放到了这里,就会有那个imgUrl的地址是本地地址,不知道怎么去把这个字段设置为传回后台的网络地址