Commit 0b65589c by 前端

Merge branch 'xuyl_dev_v3.3.0' into 'v3.3.0'

修复bug

See merge request !6
2 parents f06a0b0a a8ba06c7
/*
* @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.'
......@@ -170,9 +170,9 @@ const findAllDictData = params => {
})
}
const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url:'rop-scrm-entmicro/router',
params.method = 'merchants.api.open.findMerchantListByPage'
return http3({
url:'rop-merchants/router',
method: 'POST',
data: params,
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()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(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)
......@@ -20,7 +20,7 @@ let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState }) {
const { response, request,request2, sign, secret, sign_common, request_common } = await fetchConfig()
const { response, request,request2,request3,sign, secret, sign_common, request_common } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......@@ -29,6 +29,7 @@ export async function bootstrap({ history, common, messenger, globalState }) {
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http3 = new common.Http({ response, request: request3, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
......
......@@ -7,10 +7,12 @@
<el-divider></el-divider>
<div class="m-l-20">
<el-form-item label="选择门店:" prop="targetMerchantId">
<el-select v-model="materialAddForm.targetMerchantId" :disabled="notDisplayProperties" ref="selectLabel" clearable filterable :size="size"
placeholder="请选择门店">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName"
:value="item.msgMerchantId + ''"></el-option>
<el-select remote :remote-method="remoteMethod" v-el-select-loadmore="loadmore"
v-model="materialAddForm.targetMerchantId" :disabled="notDisplayProperties" ref="selectLabel"
clearable filterable :size="size"
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-form-item>
<el-form-item v-if="!notDisplayProperties" label="选择素材组:" prop="groupId">
......@@ -32,7 +34,7 @@
</el-form-item>
<el-form-item label="素材类型:" prop="materialType">
<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="2">自定义链接</el-radio> -->
<el-radio :label="3">图文</el-radio>
......@@ -46,7 +48,6 @@
:disabled="notDisplayProperties">选择文件
</el-button>
</div>
<!-- <div v-if="pdfUrl">{{ pdfUrl }}</div> -->
<ul v-if="pdfName || materialAddForm.materialUrl">
<li class="pdf-show">
<span class="pdf-name" @click="openPdfDia">{{ pdfName || materialAddForm.materialUrl }}</span>
......@@ -54,14 +55,6 @@
</li>
</ul>
</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">
<textBox @change="writeChange" ref="textBox" @forbid="forbidEdit"></textBox>
......@@ -96,8 +89,8 @@
<el-form-item label="视频:" class="photoWrap">
<div class="img-div">
<div class="put-img" v-if="materialAddForm.videoUrl">
<video id="video" width="100%" height="100%" preload loop muted>
<source :src="materialAddForm.videoUrl" type="video/mp4"/>
<video :src="materialAddForm.videoUrl" id="video" width="100%" height="100%" preload loop muted>
<!-- <source type="video/mp4"/>-->
</video>
<div class="mask">
<h3>
......@@ -227,14 +220,13 @@
<GLFooter class="gl-footer">
<el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</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>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view>
</el-dialog>
</div>
</template>
<script>
import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable'
......@@ -272,6 +264,12 @@ export default {
pdfName: '',
dialogPdfVisible: false,
textBoxContent: '',
pageData: {
pageSize: 40,
pageNum: 1,
channelType: 1,
merchantAccountLevel: [4]
},
materialAddForm: {
groupId: '', // 素材组id
groupName: '',
......@@ -319,19 +317,88 @@ export default {
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.notDisplayProperties = this.routeInfo.addOrEdit == 3
this.materialInsert()
this.getMaterialList()
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: {
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,
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 => {
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() {
this.dialogVisibleImg = true
......@@ -359,7 +426,7 @@ export default {
}
},
getParams() {
var params = JSON.parse(JSON.stringify(this.materialAddForm))
let params = JSON.parse(JSON.stringify(this.materialAddForm))
let tagging = this.tagging.map(item => {
let tagIds = item.labelList.map(tag => {
return tag.id
......@@ -400,6 +467,8 @@ export default {
if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4
if (!imgHtml && !videoHtml) params.materialType = 5
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)
params.materialUrl = this.textBoxContent
}
......@@ -416,6 +485,7 @@ export default {
await this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res
this.materialAddForm.targetMerchantId = res.merchantId + '' || ''
this.getMaterialList({merchant:res.merchantId})
if (res.businessType) {
const businessTypeArr = this.materialAddForm.businessType.split(',')
this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item))
......@@ -455,12 +525,6 @@ export default {
}
})
},
// 获取全部素材组
getMaterialList() {
this.$apis.material.getMaterialList({}).then(res => {
this.groupCounter = res
})
},
// 创建素材组
materialInsert() {
var params = {}
......@@ -554,8 +618,7 @@ export default {
})
}
},
handleUploadChange(e, params,typeName,limitSize) {
handleUploadChange(e, params, typeName, limitSize) {
var file = e.srcElement.files[0]
var reader = new FileReader()
const isLt = file.size / 1024 / 1024 < limitSize
......@@ -677,7 +740,6 @@ export default {
forbidEdit() {
this.$refs.textBox.forbidEdit()
},
handleSelect(val) {
this.isUpdate = true
this.tagging = val
......@@ -715,7 +777,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.disableUpload {
cursor: not-allowed;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!