Commit 26bff53a by 前端

修复bug

1 parent bb161bf1
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-24 16:20:21
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-29 10:23:34
* @FilePath: \live\src\api\modules\console.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http } from '@/main'
//基本信息
const consoleBasic = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.basic`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//流量数据-详情列表导出
const detailexport = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.detailexport`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//流量数据-详情列表导出
const consoleExport = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.export`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//流量数据-详情列表查询(分页)
const detailpage = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.detailpage`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//直播间信息
const consoleInfo = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.info`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//分页查询流量数据列表
const consolePage = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
consoleBasic,
consolePage,
consoleInfo,
detailpage,
detailexport,
consoleExport
}
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.livebroadcast.'
const getListApi = params => {
params.method = `${defaultPath}page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
/**新增或编辑直播间 */
const addOrUpdataLiveRoomApi = params => {
params.method = `${defaultPath}add.or.update`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
/** 直播间详情 */
const LiveRoomDetailApi = params => {
params.method = `${defaultPath}detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
})
}
// 删除直播间
const deleteLiveRoomApi = params => {
params.method = `${defaultPath}delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, addOrUpdataLiveRoomApi, LiveRoomDetailApi,deleteLiveRoomApi }
import { http, http_merchant } from '@/main' import { http, http_merchant,http3 } from '@/main'
const defaultPath = 'marketing.api.material.' const defaultPath = 'marketing.api.material.'
...@@ -170,9 +170,9 @@ const findAllDictData = params => { ...@@ -170,9 +170,9 @@ const findAllDictData = params => {
}) })
} }
const getStoreList = params => { const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant' params.method = 'merchants.api.open.findMerchantListByPage'
return http({ return http3({
url:'rop-scrm-entmicro/router', url:'rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
......
import { http } from '@/main'
//分页查询媒体文件列表
const dropdownList = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.dropdown.list`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//删除媒体文件
const tencentcloudmediaDelete = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//新增或编辑媒体文件
const tencentcloudmediaUpdate = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.add.or.update`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//媒体文件详情
const tencentcloudmediaDetail = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//分页查询媒体文件列表
const tencentcloudmediaPage = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
dropdownList,
tencentcloudmediaPage,
tencentcloudmediaDetail,
tencentcloudmediaUpdate,
tencentcloudmediaDelete
}
...@@ -21,4 +21,5 @@ start() ...@@ -21,4 +21,5 @@ start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http2 = params => Vue.prototype.$http2(params) export const http2 = params => Vue.prototype.$http2(params)
export const http3 = params => Vue.prototype.$http3(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
<el-divider></el-divider> <el-divider></el-divider>
<div class="m-l-20"> <div class="m-l-20">
<el-form-item label="选择门店:" prop="targetMerchantId"> <el-form-item label="选择门店:" prop="targetMerchantId">
<el-select v-model="materialAddForm.targetMerchantId" :disabled="notDisplayProperties" ref="selectLabel" clearable filterable :size="size" <el-select remote :remote-method="remoteMethod" v-el-select-loadmore="loadmore"
placeholder="请选择门店"> v-model="materialAddForm.targetMerchantId" :disabled="notDisplayProperties" ref="selectLabel"
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" clearable filterable :size="size"
:value="item.msgMerchantId + ''"></el-option> placeholder="请选择门店" @change="selectChange" @clear="clearDrop">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.merchantName"
:value="item.merchantNo + ''"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="!notDisplayProperties" label="选择素材组:" prop="groupId"> <el-form-item v-if="!notDisplayProperties" label="选择素材组:" prop="groupId">
...@@ -32,7 +34,7 @@ ...@@ -32,7 +34,7 @@
</el-form-item> </el-form-item>
<el-form-item label="素材类型:" prop="materialType"> <el-form-item label="素材类型:" prop="materialType">
<el-radio-group v-model="materialAddForm.materialType" @change="radioChange" <el-radio-group v-model="materialAddForm.materialType" @change="radioChange"
:disabled="notDisplayProperties"> :disabled="routeInfo.addOrEdit != 1">
<el-radio :label="1">PDF文件</el-radio> <el-radio :label="1">PDF文件</el-radio>
<!-- <el-radio :label="2">自定义链接</el-radio> --> <!-- <el-radio :label="2">自定义链接</el-radio> -->
<el-radio :label="3">图文</el-radio> <el-radio :label="3">图文</el-radio>
...@@ -46,7 +48,6 @@ ...@@ -46,7 +48,6 @@
:disabled="notDisplayProperties">选择文件 :disabled="notDisplayProperties">选择文件
</el-button> </el-button>
</div> </div>
<!-- <div v-if="pdfUrl">{{ pdfUrl }}</div> -->
<ul v-if="pdfName || materialAddForm.materialUrl"> <ul v-if="pdfName || materialAddForm.materialUrl">
<li class="pdf-show"> <li class="pdf-show">
<span class="pdf-name" @click="openPdfDia">{{ pdfName || materialAddForm.materialUrl }}</span> <span class="pdf-name" @click="openPdfDia">{{ pdfName || materialAddForm.materialUrl }}</span>
...@@ -54,14 +55,6 @@ ...@@ -54,14 +55,6 @@
</li> </li>
</ul> </ul>
</div> </div>
<!-- 选择自定义链接 -->
<!-- <div v-show="materialAddForm.materialType == 2">
<el-form :model="linkForm" :rules="linkRules" ref="linkForm" label-width="100px">
<el-form-item label="链接地址" prop="link">
<el-input v-model="linkForm.link" placeholder="请填写跳转链接" maxlength="150" show-word-limit></el-input>
</el-form-item>
</el-form>
</div> -->
<!-- 选择图文 --> <!-- 选择图文 -->
<div v-show="materialAddForm.materialType == 3"> <div v-show="materialAddForm.materialType == 3">
<textBox @change="writeChange" ref="textBox" @forbid="forbidEdit"></textBox> <textBox @change="writeChange" ref="textBox" @forbid="forbidEdit"></textBox>
...@@ -96,8 +89,8 @@ ...@@ -96,8 +89,8 @@
<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.videoUrl"> <div class="put-img" v-if="materialAddForm.videoUrl">
<video id="video" width="100%" height="100%" preload loop muted> <video :src="materialAddForm.videoUrl" id="video" width="100%" height="100%" preload loop muted>
<source :src="materialAddForm.videoUrl" type="video/mp4"/> <!-- <source type="video/mp4"/>-->
</video> </video>
<div class="mask"> <div class="mask">
<h3> <h3>
...@@ -227,14 +220,13 @@ ...@@ -227,14 +220,13 @@
<GLFooter class="gl-footer"> <GLFooter class="gl-footer">
<el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button> <el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button>
<el-button @click="handleCancel" class="btn-cancle">取消</el-button> <el-button @click="handleCancel" class="btn-cancle">取消</el-button>
<el-button @click="handleSubmit" type="primary">确定</el-button> <el-button @click="handleSubmit" v-if="this.routeInfo.addOrEdit !== 3" type="primary">确定</el-button>
</GLFooter> </GLFooter>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%"> <el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view> <big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import textBox from '@/views/material/components/textBox' import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable' import SelectLabel from '@/views/material/components/selectLable'
...@@ -272,6 +264,12 @@ export default { ...@@ -272,6 +264,12 @@ export default {
pdfName: '', pdfName: '',
dialogPdfVisible: false, dialogPdfVisible: false,
textBoxContent: '', textBoxContent: '',
pageData: {
pageSize: 40,
pageNum: 1,
channelType: 1,
merchantAccountLevel: [4]
},
materialAddForm: { materialAddForm: {
groupId: '', // 素材组id groupId: '', // 素材组id
groupName: '', groupName: '',
...@@ -319,19 +317,88 @@ export default { ...@@ -319,19 +317,88 @@ export default {
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
this.notDisplayProperties = this.routeInfo.addOrEdit == 3 this.notDisplayProperties = this.routeInfo.addOrEdit == 3
this.materialInsert() this.materialInsert()
this.getMaterialList()
this.getListEntBusinessType() this.getListEntBusinessType()
this.loadUpData() this.loadUpData(this.pageData, '')
},
directives: {
/** 下拉框懒加载 */
'el-select-loadmore': {
bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
}, },
methods: { methods: {
async loadUpData() { // 获取全部素材组
const params = { getMaterialList(params) {
this.$apis.material.getMaterialList(params).then(res => {
this.groupCounter = res
})
},
selectChange(val) {
let params = {merchant: val}
this.materialAddForm.groupId = ''
this.getMaterialList(params)
},
clearDrop() {
this.pageData = {
pageNum: 1, pageNum: 1,
pageSize: 10000 pageSize: 40
}
this.searchContentStorage = ''
this.dataItems = []
this.loadUpData(this.pageData, '')
},
loadmore() {
this.pageData.pageNum++
let acquireCount = this.pageData.pageNum * this.pageData.pageSize
if (acquireCount - this.totalNum >= this.pageData.pageSize) {
return
}
if (this.searchContentStorage) {
this.loadUpData(this.pageData, this.searchContentStorage)
} else {
this.loadUpData(this.pageData, '') //类似于分页查询
}
},
async loadUpData(pageData, searchVal) {
let params = {
...pageData,
merchantName: searchVal
} }
await this.$apis.material.getStoreList(params).then(res => { await this.$apis.material.getStoreList(params).then(res => {
this.dataItems = res || [] this.totalNum = res.count
this.arrBack = res.data
}) })
this.dataItems = [...this.dataItems, ...this.arrBack]
},
async remoteMethod(searchValue) {
if (searchValue !== '') {
this.searchContentStorage = searchValue
;(this.pageData = {
pageNum: 1,
pageSize: 40
}),
(this.dataItems = [])
this.timer = setTimeout(() => {
this.loadUpData(this.pageData, searchValue)
}, 300)
} else {
this.dataItems = []
this.loadUpData(
{
pageNum: 1,
pageSize: 40
},
''
)
}
}, },
viewVideo() { viewVideo() {
this.dialogVisibleImg = true this.dialogVisibleImg = true
...@@ -359,7 +426,7 @@ export default { ...@@ -359,7 +426,7 @@ export default {
} }
}, },
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.materialAddForm)) let params = JSON.parse(JSON.stringify(this.materialAddForm))
let tagging = this.tagging.map(item => { let tagging = this.tagging.map(item => {
let tagIds = item.labelList.map(tag => { let tagIds = item.labelList.map(tag => {
return tag.id return tag.id
...@@ -400,6 +467,8 @@ export default { ...@@ -400,6 +467,8 @@ export default {
if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4 if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4
if (!imgHtml && !videoHtml) params.materialType = 5 if (!imgHtml && !videoHtml) params.materialType = 5
if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6 if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6
if (this.materialAddForm.vedioUrl && !this.materialAddForm.imageUrlList.length) params.materialType = 4
if (this.materialAddForm.imageUrlList.length) params.materialType = 3
this.textBoxContent = encodeURIComponent(this.textBoxContent) this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent params.materialUrl = this.textBoxContent
} }
...@@ -416,6 +485,7 @@ export default { ...@@ -416,6 +485,7 @@ export default {
await this.$apis.material.materialDetail(params).then(res => { await this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res this.materialAddForm = res
this.materialAddForm.targetMerchantId = res.merchantId + '' || '' this.materialAddForm.targetMerchantId = res.merchantId + '' || ''
this.getMaterialList({merchant:res.merchantId})
if (res.businessType) { if (res.businessType) {
const businessTypeArr = this.materialAddForm.businessType.split(',') const businessTypeArr = this.materialAddForm.businessType.split(',')
this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item)) this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item))
...@@ -455,12 +525,6 @@ export default { ...@@ -455,12 +525,6 @@ export default {
} }
}) })
}, },
// 获取全部素材组
getMaterialList() {
this.$apis.material.getMaterialList({}).then(res => {
this.groupCounter = res
})
},
// 创建素材组 // 创建素材组
materialInsert() { materialInsert() {
var params = {} var params = {}
...@@ -554,8 +618,7 @@ export default { ...@@ -554,8 +618,7 @@ export default {
}) })
} }
}, },
handleUploadChange(e, params, typeName, limitSize) {
handleUploadChange(e, params,typeName,limitSize) {
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
var reader = new FileReader() var reader = new FileReader()
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
...@@ -677,7 +740,6 @@ export default { ...@@ -677,7 +740,6 @@ export default {
forbidEdit() { forbidEdit() {
this.$refs.textBox.forbidEdit() this.$refs.textBox.forbidEdit()
}, },
handleSelect(val) { handleSelect(val) {
this.isUpdate = true this.isUpdate = true
this.tagging = val this.tagging = val
...@@ -715,7 +777,6 @@ export default { ...@@ -715,7 +777,6 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.disableUpload { .disableUpload {
cursor: not-allowed; cursor: not-allowed;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!