Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-content
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7dc31d4b
authored
Dec 23, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'xuyl_dev_v3.3.0' into 'v3.3.0'
Xuyl dev v3.3.0 See merge request
!4
2 parents
02d816f1
0835d102
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
37 deletions
src/config/index.js
src/views/material/addMaterial.vue
src/views/material/index.vue
src/config/index.js
View file @
7dc31d4
...
@@ -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
...
...
src/views/material/addMaterial.vue
View file @
7dc31d4
...
@@ -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.
media
Url"
>
<div
class=
"put-img"
v-if=
"materialAddForm.
video
Url"
>
<video
id=
"video"
width=
"100%"
height=
"100%"
preload
loop
muted
>
<video
id=
"video"
width=
"100%"
height=
"100%"
preload
loop
muted
>
<source
:src=
"materialAddForm.
media
Url"
type=
"video/mp4"
/>
<source
:src=
"materialAddForm.
video
Url"
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('
media
Url')"
/>
src=
"@/assets/material/dele.png"
alt=
""
@
click=
"deleteImg('
video
Url')"
/>
</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,'
media
Url')"/>
@change="e =>handleVideoChange(e,'
video
Url')"/>
</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
:
[],
media
Url
:
''
,
video
Url
:
''
,
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
.
media
Url
this
.
dialogSrc
=
this
.
materialAddForm
.
video
Url
},
},
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
.
media
Url
=
res
this
.
materialAddForm
.
video
Url
=
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
]))
{
...
...
src/views/material/index.vue
View file @
7dc31d4
...
@@ -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'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment