Commit 30ba0d24 by chenwq

众筹

1 parent c3fdb02e
......@@ -47,7 +47,7 @@
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<div class="add" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''">+</div>
<!-- <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }}/{{ item.maxPhotoNum }}</span> -->
<span class="number" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传图片</span>
<span class="number" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传{{ item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div>
......@@ -210,7 +210,6 @@ export default {
var reader = new FileReader()
var file = e.srcElement.files[0]
var uploadType = targetItem.uploadType || 'img'
// console.log(file)
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
......
......@@ -757,6 +757,11 @@ export default {
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
const fileSuffix = file.name.split('.')[file.name.split('.').length - 1]
if (fileSuffix.toLowerCase() != 'mp4') {
this.$message.error('上传视频不是MP4的格式!')
return true
}
this.loading = true
this.$apis.common
.uploadFundingVideoApi({ file: base64 })
......@@ -1514,7 +1519,12 @@ export default {
this.editForm[listName].forEach(item => {
for (let i = 0; i < attrList.length; i++) {
let attrItem = attrList[i]
if (item[attrItem]) {
if (Array.isArray(item[attrItem])) {
if (item[attrItem].length) {
list.push(item)
break
}
} else if (item[attrItem]) {
list.push(item)
break
}
......@@ -1527,6 +1537,7 @@ export default {
this.stopMusic()
this.editForm.activityServices = this.delListAllEmpty('activityServices', ['title', 'content'])
this.editForm.activityCommoditys = this.delListAllEmpty('activityCommoditys', ['question', 'answer'])
this.editForm.activityExperienceDTOs = this.delListAllEmpty('activityExperienceDTOs', ['experience', 'activityExperienceImgs'])
this.validateRules()
var flag = true
if (this.nameToValSpecsList && this.nameToValSpecsList.length > 0) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!