Commit fc3b8a67 by 前端

更新代码3.3.0

1 parent dbb6d220
...@@ -12,6 +12,7 @@ let cfg = require('./conf.js') ...@@ -12,6 +12,7 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
// console.log(1111111) // console.log(1111111)
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
......
...@@ -95,15 +95,15 @@ ...@@ -95,15 +95,15 @@
</el-form-item> </el-form-item>
<el-form-item label="视频:" class="photoWrap"> <el-form-item label="视频:" class="photoWrap">
<div class="img-div"> <div class="img-div">
<div class="put-img" v-if="materialAddForm.mediaUrl"> <div class="put-img" v-if="materialAddForm.videoUrl">
<video id="video" width="100%" height="100%" preload loop muted> <video id="video" width="100%" height="100%" preload loop muted>
<source :src="materialAddForm.mediaUrl" type="video/mp4"/> <source :src="materialAddForm.videoUrl" type="video/mp4"/>
</video> </video>
<div class="mask"> <div class="mask">
<h3> <h3>
<img slot="reference" src="@/assets/material/view.png" alt="" @click="viewVideo"/> <img slot="reference" src="@/assets/material/view.png" alt="" @click="viewVideo"/>
<img v-if="!notDisplayProperties" class="del-img" <img v-if="!notDisplayProperties" class="del-img"
src="@/assets/material/dele.png" alt="" @click="deleteImg('mediaUrl')"/> src="@/assets/material/dele.png" alt="" @click="deleteImg('videoUrl')"/>
</h3> </h3>
</div> </div>
</div> </div>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<input :class="{disableUpload:notDisplayProperties}" <input :class="{disableUpload:notDisplayProperties}"
:disabled="notDisplayProperties" type="file" style="opacity: 0" :disabled="notDisplayProperties" type="file" style="opacity: 0"
accept="video/*" accept="video/*"
@change="e =>handleVideoChange(e,'mediaUrl')"/> @change="e =>handleVideoChange(e,'videoUrl')"/>
</div> </div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> --> <!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div> </div>
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
description: '', // 描述 description: '', // 描述
titleUrl: '', // 封面 titleUrl: '', // 封面
imageUrlList: [], imageUrlList: [],
mediaUrl: '', videoUrl: '',
targetMerchantId: '' targetMerchantId: ''
}, },
groupCounter: [], groupCounter: [],
...@@ -320,7 +320,6 @@ export default { ...@@ -320,7 +320,6 @@ export default {
this.notDisplayProperties = this.routeInfo.addOrEdit == 3 this.notDisplayProperties = this.routeInfo.addOrEdit == 3
this.materialInsert() this.materialInsert()
this.getMaterialList() this.getMaterialList()
// this.findAllDictData('business_type')
this.getListEntBusinessType() this.getListEntBusinessType()
this.loadUpData() this.loadUpData()
}, },
...@@ -336,7 +335,7 @@ export default { ...@@ -336,7 +335,7 @@ export default {
}, },
viewVideo() { viewVideo() {
this.dialogVisibleImg = true this.dialogVisibleImg = true
this.dialogSrc = this.materialAddForm.mediaUrl this.dialogSrc = this.materialAddForm.videoUrl
}, },
handleVideoChange(e) { handleVideoChange(e) {
let file = e.srcElement.files[0] let file = e.srcElement.files[0]
...@@ -354,7 +353,7 @@ export default { ...@@ -354,7 +353,7 @@ export default {
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({file: base64}).then(res => { this.$apis.common.uploadVideoApi({file: base64}).then(res => {
if (res) { if (res) {
this.materialAddForm.mediaUrl = res this.materialAddForm.videoUrl = res
} }
}) })
} }
...@@ -555,11 +554,45 @@ export default { ...@@ -555,11 +554,45 @@ export default {
}) })
} }
}, },
handleUploadChange(e, params,typeName,limitSize) {
var file = e.srcElement.files[0]
var reader = new FileReader()
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error(`上传${typeName}大小不能超过 + limitSize + MB!`)
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({file: base64}).then(res => {
if (res) {
if (Array.isArray(this.materialAddForm[params]) || this.materialAddForm[params] == null) {
if (this.materialAddForm[params] && this.materialAddForm[params].length > 8) {
this.$message.error('图片最多可上传9张')
return
} else {
if (!this.materialAddForm[params]) {
this.materialAddForm[params] = []
this.materialAddForm[params][0] = res
} else {
this.materialAddForm[params].push(res)
}
}
} else {
this.materialAddForm[params] = res
}
}
})
}
},
// 存草稿 // 存草稿
onSave() { onSave() {
this.$refs.materialAddForm.validate(valid => { this.$refs.materialAddForm.validate(valid => {
if (valid) { if (valid) {
var params = this.getParams() let params = this.getParams()
if (!params.materialUrl) { if (!params.materialUrl) {
this.$message({ this.$message({
message: '素材内容不能为空', message: '素材内容不能为空',
...@@ -593,7 +626,6 @@ export default { ...@@ -593,7 +626,6 @@ export default {
}, },
// 提交 // 提交
handleSubmit() { handleSubmit() {
console.log(typeof this.materialAddForm.targetMerchantId)
this.$refs.materialAddForm.validate(valid => { this.$refs.materialAddForm.validate(valid => {
if (valid) { if (valid) {
var params = this.getParams() var params = this.getParams()
...@@ -645,11 +677,7 @@ export default { ...@@ -645,11 +677,7 @@ export default {
forbidEdit() { forbidEdit() {
this.$refs.textBox.forbidEdit() this.$refs.textBox.forbidEdit()
}, },
// 打开标签
openLabel() {
this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init(this.tagging)
},
handleSelect(val) { handleSelect(val) {
this.isUpdate = true this.isUpdate = true
this.tagging = val this.tagging = val
...@@ -667,27 +695,6 @@ export default { ...@@ -667,27 +695,6 @@ export default {
}) })
this.taggingList = arr this.taggingList = arr
}, },
// 删除标签
removeTag(tag, idx1, idx) {
tag.labelList.splice(idx1, 1)
if (tag.labelList.length == 0) {
this.tagging.splice(idx, 1)
}
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
this.isUpdate = true
},
// 删除上传图片 // 删除上传图片
deleteImg(params, content) { deleteImg(params, content) {
if (Array.isArray(this.materialAddForm[params])) { if (Array.isArray(this.materialAddForm[params])) {
......
...@@ -129,7 +129,8 @@ export default { ...@@ -129,7 +129,8 @@ export default {
materialType: '', // 素材类型 materialType: '', // 素材类型
businessType: '', // 业务类型 businessType: '', // 业务类型
status: '', // 状态 status: '', // 状态
materialName: '' // 素材名称 materialName: '', // 素材名称
createdType:'1'
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!