Commit dafd1138 by 赵雅纹

上传图片判断

parent 9ea31a82
...@@ -227,7 +227,7 @@ wxService.page({ ...@@ -227,7 +227,7 @@ wxService.page({
var sspList = this.data.params.sspList var sspList = this.data.params.sspList
for (var i in sspList) { for (var i in sspList) {
if (sspList[i].url) { if (sspList[i].url) {
sspList.splice(event.currentTarget.dataset.index, 1) sspList.splice(i, 1)
} }
} }
this.setData({ this.setData({
...@@ -237,11 +237,13 @@ wxService.page({ ...@@ -237,11 +237,13 @@ wxService.page({
// 上传视频 // 上传视频
_uploadVideo(e){ _uploadVideo(e){
console.log(e)
this.data.params.sspList.push({ this.data.params.sspList.push({
cover: 0, cover: 0,
videoUrl: e.detail videoUrl: e.detail
}); });
this.setData({
'params.sspList': this.data.params.sspList
})
}, },
// 删除视频 // 删除视频
...@@ -261,8 +263,6 @@ wxService.page({ ...@@ -261,8 +263,6 @@ wxService.page({
// 发布笔记 // 发布笔记
formSubmit(e){ formSubmit(e){
console.log('3333', this.data.params.sspList)
console.log('requesting', this.data.requesting)
if (this.data.requesting){ if (this.data.requesting){
return; return;
} }
...@@ -273,14 +273,7 @@ wxService.page({ ...@@ -273,14 +273,7 @@ wxService.page({
}) })
return; return;
} }
if (this.data.params.sspList && !this.data.params.sspList[0].url) { if (this.data.params.sspList && this.data.params.sspList[0].videoUrl && !this.data.params.sspList[1]) {
wx.showToast({
title: '请上传至少一张图片',
icon: 'none'
})
return;
}
if (this.data.params.sspList && this.data.params.sspList[0].videoUrl && !this.data.params.sspList[1].url ) {
wx.showToast({ wx.showToast({
title: '请上传至少一张图片', title: '请上传至少一张图片',
icon: 'none' icon: 'none'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment