Commit 95d6fc5d by wuwx

Merge branch 'v2.7.0' into wuwx_dev_v2.7.0

2 parents 2790ca72 3d40d852
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</template> </template>
<!-- 图文编辑器 --> <!-- 图文编辑器 -->
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" @change="e => handleTextBoxChange(e, item)" @focus="handleTextBoxFocus(item)"></textBox> <textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" :excludeMenus="item.excludeMenus || ['code']" @change="e => handleTextBoxChange(e, item)" @focus="handleTextBoxFocus(item)"></textBox>
<!-- 地图 --> <!-- 地图 -->
<div v-else-if="item.type === 'map'" class="flex"> <div v-else-if="item.type === 'map'" class="flex">
<Province ref="provinceForm" :subdistrict="subdistrict" :isDisabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)"></Province> <Province ref="provinceForm" :subdistrict="subdistrict" :isDisabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)"></Province>
......
...@@ -281,9 +281,9 @@ export default { ...@@ -281,9 +281,9 @@ export default {
type: 'material', type: 'material',
funName: 'material', funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi, groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi, materialListApi: this.$apis.welcomeword.getMaterialListApi
pdfNo: 1, // pdfNo: 1
videoNo: 1 // videoNo: 1
}, },
{ {
name: '模板', name: '模板',
...@@ -378,7 +378,9 @@ export default { ...@@ -378,7 +378,9 @@ export default {
// 预览回显事件 // 预览回显事件
previewForm(val) { previewForm(val) {
console.log(val) console.log(val)
this.previewVal = val const value = this.$common.utils.deepClone(val)
if (!value[0].attContent) value.splice(0, 1)
this.previewVal = value
}, },
handleCancel() { handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) { if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
......
...@@ -217,9 +217,9 @@ export default { ...@@ -217,9 +217,9 @@ export default {
type: 'material', type: 'material',
funName: 'material', funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi, groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi, materialListApi: this.$apis.welcomeword.getMaterialListApi
pdfNo: 1, // pdfNo: 1,
videoNo: 1 // videoNo: 1
}, },
{ {
name: '模板', name: '模板',
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<div class="detail-condition-item" v-if="basicInfo.condition.chatName"> <div class="detail-condition-item" v-if="basicInfo.condition.chatName">
<span class="name">所在群聊</span> <span class="name">所在群聊</span>
<span v-for="(item, index) in basicInfo.condition.chatName.split(',')" class="el-tag-item" :key="index"> <span v-for="(item, index) in basicInfo.condition.chatName.split(',')" class="el-tag-item" :key="index">
<el-tag v-if="index < 2" type="info" class="hidden-tag">{{ item }}</el-tag> <el-tag v-if="index < 2" type="info" :class="index > 2 ? 'hidden-tag' : ''">{{ item }}</el-tag>
<el-tag type="info" v-if="basicInfo.condition.chatName.split(',').length > 2 && index == 2"> <el-tag type="info" v-if="basicInfo.condition.chatName.split(',').length > 2 && index == 2">
<el-popover placement="top" width="300" trigger="hover"> <el-popover placement="top" width="300" trigger="hover">
<span slot="reference">...({{ basicInfo.condition.chatName.split(',').length }})</span> <span slot="reference">...({{ basicInfo.condition.chatName.split(',').length }})</span>
......
...@@ -22,7 +22,12 @@ ...@@ -22,7 +22,12 @@
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template> </template>
<template v-else-if="item.attType == 3"> <template v-else-if="item.attType == 3">
<video style="width: 100px" :src="item.attContent"></video> <div class="video-panel" :key="itm">
<video id="video" width="95">
<source :src="item.attContent" type="video/mp4" />
</video>
<i class="el-icon-video-play"></i>
</div>
</template> </template>
<template v-else-if="item.attType == 5"> <template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet"> <div class="preview-text text preview-applet">
...@@ -33,6 +38,14 @@ ...@@ -33,6 +38,14 @@
{{ item.attContent.page }} {{ item.attContent.page }}
</div> </div>
</template> </template>
<template v-else-if="item.attType == 6">
<div class="preview-pdf">
<div class="pdf-title">{{ item.attContent.fileName }}</div>
<div class="preview-link">
<img src="@/assets/guestCustom/preview-link.png" alt="" />
</div>
</div>
</template>
</div> </div>
</div> </div>
</div> </div>
...@@ -56,7 +69,7 @@ export default { ...@@ -56,7 +69,7 @@ export default {
val.forEach(item => { val.forEach(item => {
if (item.attType == 1) { if (item.attType == 1) {
const attContent = item.attContent const attContent = item.attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
...@@ -68,9 +81,9 @@ export default { ...@@ -68,9 +81,9 @@ export default {
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">` return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
}) })
item.attContent = htm item.attContent = htm
} else if (item.attType != 2) { } else if (item.attType != 2 && item.attType != 3) {
console.log(item) console.log(item)
item.attContent = JSON.parse(item.attContent) if (!this.eventBus) item.attContent = JSON.parse(utils.deepClone(item.attContent))
console.log(item.attContent) console.log(item.attContent)
} }
}) })
...@@ -85,9 +98,11 @@ export default { ...@@ -85,9 +98,11 @@ export default {
} }
}, },
created() { created() {
this.eventBus.$on('update', val => { if (this.eventBus) {
this.previewList = val this.eventBus.$on('update', val => {
}) this.previewList = val
})
}
}, },
mounted() { mounted() {
const date = new Date() const date = new Date()
...@@ -151,14 +166,11 @@ export default { ...@@ -151,14 +166,11 @@ export default {
white-space: pre-wrap; white-space: pre-wrap;
} }
.preview-link { .preview-link {
display: inline-flex; display: flex;
word-break: break-all; justify-content: flex-end;
font-size: 14px;
padding: 8px 8px 8px 11px;
img { img {
width: 34px; width: 30px;
height: 34px; height: 30px;
margin-left: 10px;
} }
} }
.preview-text::before { .preview-text::before {
...@@ -209,6 +221,31 @@ export default { ...@@ -209,6 +221,31 @@ export default {
border-top: 1px solid #edeff3; border-top: 1px solid #edeff3;
} }
} }
.preview-pdf {
width: 158px;
height: 62px;
background-color: #fff;
padding: 5px 13px;
box-sizing: border-box;
.pdf-title {
font-size: 12px;
color: #333;
line-height: 16px;
}
}
.video-panel {
position: relative;
.el-icon-video-play {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 10;
font-size: 20px;
color: #fff;
// cursor: pointer;
}
}
} }
} }
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div class="member-name">成员名称({{ innerTags.length }}项)</div> <div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper"> <div class="input-tag-wrapper">
<div class="tag-box"> <div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)"> <el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(innerTags[idx])">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ tag.staffName }} {{ tag.staffName }}
</el-tag> </el-tag>
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
methods: { methods: {
selectionTable(val) { selectionTable(val) {
console.log(val) console.log(val)
this.innerTags = val this.innerTags = this.$common.utils.deepClone(val)
// this.$emit('selectTable', val) // this.$emit('selectTable', val)
}, },
// 清空搜索条件 // 清空搜索条件
...@@ -226,7 +226,14 @@ export default { ...@@ -226,7 +226,14 @@ export default {
} }
}, },
remove(item) { remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item) // var idx = this.innerTags.findIndex(k => k.id == item.id)
// this.innerTags.splice(idx, 1)
if (this.tableEmpData.map(k => k.id).includes(item.id)) {
var i = this.tableEmpData.findIndex(k => k.id == item.id)
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(this.tableEmpData[i])
console.log(item, this.tableEmpData[i])
}
// this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
}, },
rowClick(row) { rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row) this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
......
...@@ -187,37 +187,38 @@ ...@@ -187,37 +187,38 @@
</GLFooter> </GLFooter>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog> <select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog>
<!-- 在线客服 --> <!-- 在线客服 -->
<glsx-dialog class="server-dialog" title="在线客服" width="712px" :noBtnOk="true" :isVisible.sync="isConsultantVisible" @confirmDialog="handleConsultantConfirm" @closeDialog="handleConsultantClose"> <GLDialog class="server-dialog" title="在线客服" mode="mid" :visible.sync="isConsultantVisible" @onOk="handleConsultantConfirm" @onCancel="handleConsultantClose">
<div class="server-container"> <div class="server-container">
<img src="@/assets/no-server.png" /> <img src="@/assets/no-server.png" />
<p class="server-txt">系统暂无已创建的在线客服</p> <p class="server-txt">系统暂无已创建的在线客服</p>
</div> </div>
<template slot="btn-middle"> <template slot="footer">
<el-button size="small" @click="handleConsultantClose">取 消</el-button>
<GLButton type="primary" :size="size" fn="创建客服" @click="handleConsultantConfirm">创建客服</GLButton> <GLButton type="primary" :size="size" fn="创建客服" @click="handleConsultantConfirm">创建客服</GLButton>
</template> </template>
</glsx-dialog> </GLDialog>
<el-dialog v-if="isImgVisible" :visible.sync="isImgVisible" class="dialog-look"> <GLDialog v-if="isImgVisible" bigTitle="查看" mode="big" :visible.sync="isImgVisible" class="dialog-look" :hasFooter="false">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls> <video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" /> <source :src="dialogObj.url" type="video/mp4" />
</video> </video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" /> <img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</el-dialog> </GLDialog>
<!-- banner管理配置门店 --> <!-- banner管理配置门店 -->
<relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"> <relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
<el-row slot> <el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px"> <el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px">
<el-form-item label="商户ID:" prop="merchantId"> <el-form-item label="商户ID:" prop="merchantId">
<el-input :size="size" v-model.trim="storeSearchForm.merchantId" placeholder="请输入商户ID" clearable></el-input> <el-input :size="size" v-model.trim="storeSearchForm.merchantId" placeholder="请输入商户ID" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="门店名称:" prop="merchantName"> <el-form-item label="门店名称:" prop="merchantName">
<el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input> <el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button> <el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>
</relate-store-dialog> </relate-store-dialog>
</div> </div>
</template> </template>
...@@ -259,7 +260,7 @@ export default { ...@@ -259,7 +260,7 @@ export default {
// } // }
// ] // ]
// }, // },
// 选择门店 // 选择门店
relateStoreVisible: false, relateStoreVisible: false,
relateStoreVisibles: false, relateStoreVisibles: false,
storeApi: this.$apis.common.getSimpleMerchantList, storeApi: this.$apis.common.getSimpleMerchantList,
...@@ -409,9 +410,9 @@ export default { ...@@ -409,9 +410,9 @@ export default {
title: '在线客服', title: '在线客服',
editFormData: [ editFormData: [
{ {
label: '在线客服', label: '在线客服',
name: '', name: '',
addHtml: 'customerServerUserId' addHtml: 'customerServerUserId'
} }
] ]
} }
...@@ -442,7 +443,7 @@ export default { ...@@ -442,7 +443,7 @@ export default {
this.getInfo() this.getInfo()
this.getConsultant() this.getConsultant()
// 非集团账号隐藏配置门店 // 非集团账号隐藏配置门店
if(!this.$isGroupUp){ if (!this.$isGroupUp) {
let idx = this.externalFormList.findIndex(item => item.title == 'Banner管理') let idx = this.externalFormList.findIndex(item => item.title == 'Banner管理')
let idxx = this.externalFormList[idx].editFormData.findIndex(item => item.name == 'bannerToSubMerchant') let idxx = this.externalFormList[idx].editFormData.findIndex(item => item.name == 'bannerToSubMerchant')
let idxxx = this.externalFormList.findIndex(item => item.title == '公告管理') let idxxx = this.externalFormList.findIndex(item => item.title == '公告管理')
...@@ -455,25 +456,25 @@ export default { ...@@ -455,25 +456,25 @@ export default {
}, },
methods: { methods: {
selectAddAttr(value){ selectAddAttr(value) {
var tempObj = { var tempObj = {
customerServerName: '', customerServerName: '',
customerServerUserTitle: '' customerServerUserTitle: ''
} }
this.customerServerList = [] this.customerServerList = []
this.editForm.customerServerId = '' this.editForm.customerServerId = ''
this.editForm.customerServerName = '' this.editForm.customerServerName = ''
this.editForm.customerServerUserTitle = '' this.editForm.customerServerUserTitle = ''
if (value) { if (value) {
tempObj = this.baseData.consultantList.find(item => item.userOneid == value) tempObj = this.baseData.consultantList.find(item => item.userOneid == value)
this.editForm.customerServerId = tempObj.id this.editForm.customerServerId = tempObj.id
this.editForm.customerServerName = tempObj.staffName this.editForm.customerServerName = tempObj.staffName
this.editForm.customerServerUserTitle = tempObj.staffTitle this.editForm.customerServerUserTitle = tempObj.staffTitle
this.customerServerList.push({ this.customerServerList.push({
customerServerName: tempObj.staffName, customerServerName: tempObj.staffName,
customerServerUserTitle: tempObj.staffTitle customerServerUserTitle: tempObj.staffTitle
}) })
} }
}, },
getInfo() { getInfo() {
this.$apis.homeSet.getHomeInfoListApi({}).then(res => { this.$apis.homeSet.getHomeInfoListApi({}).then(res => {
...@@ -541,19 +542,19 @@ export default { ...@@ -541,19 +542,19 @@ export default {
// 选择门店 // 选择门店
handleRelateStoreClose(v) { handleRelateStoreClose(v) {
this.state = v this.state = v
if(v == 'banner') { if (v == 'banner') {
this.selectedList = this.$common.utils.deepClone(this.editForm.bannerMerchantList) this.selectedList = this.$common.utils.deepClone(this.editForm.bannerMerchantList)
} else if(v == 'notice') { } else if (v == 'notice') {
this.selectedList = this.$common.utils.deepClone(this.editForm.noticeMerchantList) this.selectedList = this.$common.utils.deepClone(this.editForm.noticeMerchantList)
} }
this.relateStoreVisible = !this.relateStoreVisible this.relateStoreVisible = !this.relateStoreVisible
}, },
handleRelateStoreConfirm(selectedData) { handleRelateStoreConfirm(selectedData) {
console.log('selectedData',selectedData); console.log('selectedData', selectedData);
if(this.state == 'banner') { if (this.state == 'banner') {
this.editForm.bannerMerchantList = selectedData this.editForm.bannerMerchantList = selectedData
} else if(this.state == 'notice') { } else if (this.state == 'notice') {
this.editForm.noticeMerchantList = selectedData this.editForm.noticeMerchantList = selectedData
} }
this.selectedList = selectedData this.selectedList = selectedData
this.handleRelateStoreClose(this.state) this.handleRelateStoreClose(this.state)
...@@ -600,7 +601,7 @@ export default { ...@@ -600,7 +601,7 @@ export default {
this.$messageBox.confirm('是否删除该banner?', '删除', { this.$messageBox.confirm('是否删除该banner?', '删除', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
// type: 'error', type: 'warning',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
this.editForm[attrName].splice(subIndex, 1) this.editForm[attrName].splice(subIndex, 1)
...@@ -792,31 +793,31 @@ export default { ...@@ -792,31 +793,31 @@ export default {
}) })
// banner管理配置门店 // banner管理配置门店
params.bannerMerchantList = [] params.bannerMerchantList = []
if(this.editForm.bannerToSubMerchant == 'Y') { if (this.editForm.bannerToSubMerchant == 'Y') {
this.editForm.bannerMerchantList.forEach(item => { this.editForm.bannerMerchantList.forEach(item => {
params.bannerMerchantList.push({ params.bannerMerchantList.push({
merchantId: item.merchantNo, merchantId: item.merchantNo,
merchantName: item.merchantName, merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel merchantAccountLevel: item.merchantAccountLevel
}) })
}) })
} }
// 公告管理配置门店 // 公告管理配置门店
params.noticeMerchantList = [] params.noticeMerchantList = []
if(this.editForm.noticeToSubMerchant == 'Y') { if (this.editForm.noticeToSubMerchant == 'Y') {
this.editForm.noticeMerchantList.forEach(item => { this.editForm.noticeMerchantList.forEach(item => {
params.noticeMerchantList.push({ params.noticeMerchantList.push({
merchantId: item.merchantNo, merchantId: item.merchantNo,
merchantName: item.merchantName, merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel merchantAccountLevel: item.merchantAccountLevel
}) })
}) })
} }
// 金刚区管理 // 金刚区管理
params.clueList = this.editForm.clueList.length params.clueList = this.editForm.clueList.length
? this.editForm.clueList.map(k => { ? this.editForm.clueList.map(k => {
return { clueId: k } return { clueId: k }
}) })
: [] : []
console.log(params) console.log(params)
this.$apis.homeSet.updateHomeApi(params).then(res => { this.$apis.homeSet.updateHomeApi(params).then(res => {
...@@ -967,9 +968,9 @@ export default { ...@@ -967,9 +968,9 @@ export default {
height: 20px; height: 20px;
font-size: 16px; font-size: 16px;
} }
.home-set .server-dialog .el-dialog__footer { /* .home-set .server-dialog .el-dialog__footer {
text-align: center; text-align: center;
} } */
.merchantTable { .merchantTable {
width: 800px; width: 800px;
margin-left: 45px; margin-left: 45px;
......
...@@ -15,6 +15,12 @@ export default { ...@@ -15,6 +15,12 @@ export default {
editorOption: {} editorOption: {}
} }
}, },
props: {
excludeMenus: {
type: Array,
default: () => ['code']
}
},
mounted() { mounted() {
this.getEdit() this.getEdit()
}, },
...@@ -27,7 +33,7 @@ export default { ...@@ -27,7 +33,7 @@ export default {
this.editor.config.menuTooltipPosition = 'down' this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400 this.editor.config.height = 400
this.editor.config.width = 500 this.editor.config.width = 500
this.editor.config.excludeMenus = ['code'] this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => { this.editor.config.onchange = html => {
// console.log(html); // console.log(html);
this.content = html // 绑定当前逐渐地值 this.content = html // 绑定当前逐渐地值
......
...@@ -79,15 +79,31 @@ ...@@ -79,15 +79,31 @@
</div> </div>
</template> </template>
<template slot="activityMusic" slot-scope="scope"> <template slot="activityMusic" slot-scope="scope">
<el-upload v-show="!editForm[scope.scope.name]" class="upload-demo" action="" accept="audio/mp3, audio/m4a" :show-file-list="false" :http-request="handleMusicUpload" :before-upload="e => handleMusicBeforeUpload(e, scope.scope)" :file-list="fileList" :limit="1"> <div class="flex">
<div class="music-box flex-center" v-for="(item, index) in musicList" :key="index" @click="handleMusicChange(index)">
<div class="music-icon" @click.stop="handleMusic(item, index)">
<div :class="[index != playObj.idx ? 'icon-start' : 'icon-stop']"></div>
<img src="@/assets/seckillActivity/icon-music-default.png" />
</div>
<div class="music-name">
<p class="ellipsis-1" style="max-width: 90%;">{{ item.name }}</p>
.mp3
</div>
<img v-show="item.isCheck" :class="{ 'icon-check': item.isCheck }" src="@/assets/seckillActivity/icon-check.png" />
</div>
</div>
<el-upload class="m-t-10" action="" accept="audio/mp3, audio/m4a" :show-file-list="false" :http-request="handleMusicUpload" :before-upload="e => handleMusicBeforeUpload(e, scope.scope)" :file-list="fileList">
<el-button class="el-icon-plus" size="small" type="default">背景音乐</el-button> <el-button class="el-icon-plus" size="small" type="default">背景音乐</el-button>
</el-upload> </el-upload>
<div v-if="editForm[scope.scope.name]" class="flex"> <audio v-if="playObj.src" style="display: none;" id="music-audio" controls>
<source type="audio/mpeg" :src="playObj.src" />
</audio>
<!-- <div v-if="editForm[scope.scope.name]" class="flex">
<audio controls> <audio controls>
<source :src="editForm[scope.scope.name]" type="audio/mpeg" /> <source :src="editForm[scope.scope.name]" type="audio/mpeg" />
</audio> </audio>
<el-button class="describe-delete" icon="el-icon-delete" type="text" @click="handleMusicDelete(scope.scope)"></el-button> <el-button class="describe-delete" icon="el-icon-delete" type="text" @click="handleMusicDelete(scope.scope)"></el-button>
</div> </div> -->
</template> </template>
<template slot="fictitious"> <template slot="fictitious">
<div class="fictitious" id="fictitious"> <div class="fictitious" id="fictitious">
...@@ -455,6 +471,29 @@ export default { ...@@ -455,6 +471,29 @@ export default {
} }
} }
], ],
// 活动音乐
playObj: {
idx: -1,
src: ''
},
musicUploadName: '音频',
musicList: [
{
name: '1',
addr: 'https://img01.glsx.com.cn/group1/M00/23/C8/wKgFHWLh7Y2ARPH_ACav2AhE_vA583.mp3',
isCheck: false
},
{
name: '2',
addr: 'https://img01.glsx.com.cn/group1/M00/23/C8/wKgFHWLh7a-ADfhZABqkegKp2yY992.mp3',
isCheck: false
},
{
name: '3',
addr: 'https://img01.glsx.com.cn/group1/M00/23/C8/wKgFHWLh7cyACPoUACnOiS36FT0760.mp3',
isCheck: false
}
],
// 活动配置 // 活动配置
configEditFormData: [ configEditFormData: [
{ {
...@@ -508,10 +547,16 @@ export default { ...@@ -508,10 +547,16 @@ export default {
handleUpload: (e, file, targetItem) => { handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result const imgFile = e.target.result
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.uploadImgApi({ file: base64, fileType: 'image' }).then(res => { this.loading = true
this.editForm[targetItem.name] = res this.$apis.common
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name) .uploadImgApi({ file: base64, fileType: 'image' })
}) .then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
} }
}, },
{ {
...@@ -526,16 +571,23 @@ export default { ...@@ -526,16 +571,23 @@ export default {
handleUpload: (e, file, targetItem) => { handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result const imgFile = e.target.result
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.loading = true
this.editForm[targetItem.name].push(res) this.$apis.common
}) .uploadVideoApi({ file: base64 })
.then(res => {
this.editForm[targetItem.name].push(res)
})
.finally(() => {
this.loading = false
})
} }
}, },
{ {
label: '活动详情', label: '活动详情',
name: 'activityDetail', name: 'activityDetail',
tips: '展示活动的详细内容', tips: '展示活动的详细内容',
type: 'textBox' type: 'textBox',
excludeMenus: ['video', 'code']
}, },
{ {
label: '音乐文件', label: '音乐文件',
...@@ -900,13 +952,61 @@ export default { ...@@ -900,13 +952,61 @@ export default {
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
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.loading = true
this.$apis.common.uploadMusicApi({ file: base64 }).then(res => { this.$apis.common.uploadMusicApi({ file: base64 }).then(res => {
this.loading = false
this.$set(this.editForm, targetItem.name, res) this.$set(this.editForm, targetItem.name, res)
if (this.musicList.length == 4) {
this.musicList.pop()
}
this.musicList.push({
name: this.musicUploadName,
addr: res,
isCheck: false
})
this.handleMusicChange(this.musicList.length - 1)
}) })
} }
}, },
// 音乐
handleMusic(targetItem, idx) {
// stop-音频结束;play-音频播放
var playFlag = this.playObj.idx != -1 && this.playObj.idx == idx ? 'stop' : 'play'
var audioDom = document.getElementById('music-audio')
this.playObj.idx = -1
this.playObj.src = ''
this.$nextTick(() => {
if (playFlag == 'play') {
this.playObj.idx = idx
this.playObj.src = targetItem.addr
this.$nextTick(() => {
if (playFlag == 'play') {
audioDom = document.getElementById('music-audio')
audioDom && audioDom.play()
}
})
}
})
},
stopMusic() {
this.playObj.idx = -1
this.playObj.src = ''
},
handleMusicChange(idx) {
this.musicList.forEach((item, index) => {
if (index != idx) {
item.isCheck = false
}
})
this.musicList[idx].isCheck = !this.musicList[idx].isCheck
this.editForm.activityMusic = this.musicList[idx].isCheck ? this.musicList[idx].addr : ''
},
handleMusicBeforeUpload(file, targetItem) { handleMusicBeforeUpload(file, targetItem) {
this.stopMusic()
this.musicUpload(file, targetItem) this.musicUpload(file, targetItem)
}, },
...@@ -994,6 +1094,21 @@ export default { ...@@ -994,6 +1094,21 @@ export default {
this.editForm.activityDetail = decodeURIComponent(info.activityDetail) this.editForm.activityDetail = decodeURIComponent(info.activityDetail)
this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].setEdit(this.editForm.activityDetail) this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].setEdit(this.editForm.activityDetail)
} }
// 活动音乐
if (info.activityMusic) {
var checkIdx = this.musicList.map(item => item.addr).findIndex(k => k == info.activityMusic)
if (checkIdx != -1) {
this.musicList[checkIdx].isCheck = false
this.handleMusicChange(checkIdx)
} else {
this.musicList.push({
name: this.musicUploadName,
addr: info.activityMusic,
isCheck: false
})
this.handleMusicChange(this.musicList.length - 1)
}
}
// 表单设置 // 表单设置
this.formDescribeList = [] this.formDescribeList = []
Object.values(this.describeIdxToAttr).forEach((item, index) => { Object.values(this.describeIdxToAttr).forEach((item, index) => {
...@@ -1107,6 +1222,7 @@ export default { ...@@ -1107,6 +1222,7 @@ export default {
}, },
handleConfirm() { handleConfirm() {
this.stopMusic()
this.validateRules() this.validateRules()
var flag = true var flag = true
if (this.nameToValSpecsList && this.nameToValSpecsList.length > 0) { if (this.nameToValSpecsList && this.nameToValSpecsList.length > 0) {
...@@ -1354,6 +1470,60 @@ export default { ...@@ -1354,6 +1470,60 @@ export default {
padding: 20px 20px 0 20px; padding: 20px 20px 0 20px;
background: #f9f9f9; background: #f9f9f9;
} }
.edit-activity .music-box {
position: relative;
box-sizing: border-box;
width: 160px;
height: 56px;
background: #fafbfe;
border-radius: 2px;
border: 1px solid #e8e8ea;
padding: 10px 7px;
margin: 0 8px 8px 0;
cursor: pointer;
.music-icon {
position: relative;
cursor: pointer;
width: 36px;
height: 36px;
}
.icon-start {
position: absolute;
display: inline-block;
top: 0;
left: 0;
width: 36px;
height: 36px;
cursor: pointer;
}
.icon-stop {
position: absolute;
display: inline-block;
top: 0;
left: 0;
width: 36px;
height: 36px;
background-image: url('../../assets/seckillActivity/icon-stop.png');
cursor: pointer;
}
.icon-start:hover {
background-image: url('../../assets/seckillActivity/icon-start.png');
z-index: 999;
}
.icon-check {
width: 15px;
height: 15px;
position: absolute;
right: 0;
bottom: 0;
}
.music-name {
display: flex;
box-sizing: border-box;
width: calc(100% - 36px);
padding-left: 8px;
}
}
.edit-activity .fictitious { .edit-activity .fictitious {
width: 600px; width: 600px;
padding: 20px 20px 0 20px; padding: 20px 20px 0 20px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!