Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 a6e1e104
authored
Jan 09, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化代码+展示表情
1 parent
3f404c51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
104 deletions
src/views/sop/editSop/baseInfo.vue
src/views/sop/editSop/baseInfo.vue
View file @
a6e1e10
...
...
@@ -96,10 +96,8 @@
</div>
<div
class=
"event-link"
>
<!-- typeof(item.backupContent) == 'string' ? (obj,index) in JSON.parse(item.backupContent) : (obj,index) in item.backupContent-->
<
template
v-if=
" typeof(item.backupContent) == 'string'"
>
<!--
{{
JSON
.
parse
(
item
.
backupContent
)
}}
-->
<div
v-for=
"(obj,index) in JSON.parse(item.backupContent)"
:key=
"index"
>
<div
class=
"event-content"
v-if=
"obj.attType == 1"
>
{{
obj
.
attContent
}}
</div>
<div
v-for=
"(obj,index) in backupContentJson(item.backupContent)"
:key=
"index"
>
<div
class=
"event-content"
v-if=
"obj.attType == 1"
v-html=
"tramWord(obj.attContent)"
></div>
<div
class=
"event-content"
v-if=
"obj.attType == 2"
>
<img
class=
"limitPhoto"
:src=
"obj.attContent"
alt
/>
...
...
@@ -111,102 +109,7 @@
<div
class=
"welcome-activity-panel"
>
<div
class=
"welcome-activity-box"
>
<div
class=
"welcome-activity-icon"
>
<img
src=
"@/assets/welcomeWord/pdf_r.png"
v-if=
"obj.attContent"
/>
</div>
<div
class=
"welcome-activity-desc"
>
<div
class=
"model-item-title"
>
{{
JSON
.
parse
(
obj
.
attContent
).
fileName
}}
</div>
</div>
<div
class=
"delete-solid"
>
<i
class=
"el-icon-delete-solid"
@
click=
"close(index)"
></i>
</div>
</div>
</div>
</div>
<div
v-if=
"obj.attType == 7"
>
<div
class=
"welcome-activity-panel"
>
<div
class=
"welcome-activity-box"
>
<div
class=
"welcome-activity-icon"
>
<img
src=
"@/assets/welcomeWord/coupon.png"
alt=
""
v-if=
"marketingContentJSON(obj).selectType == 'coupon'"
/>
<img
src=
"@/assets/welcomeWord/gift.png"
alt=
""
v-else
/>
</div>
<!--
<div
class=
"delete-solid"
>
-->
<!--
<i
class=
"el-icon-delete-solid"
@
click=
"close(index)"
></i>
-->
<!--
</div>
-->
<div
class=
"welcome-activity-desc"
>
<template
v-if=
"marketingContentJSON(obj).selectType == 'card'"
>
<div
class=
"model-item-title"
:title=
"marketingContentJSON(obj).equityName"
>
{{
marketingContentJSON
(
obj
).
equityName
}}
</div>
<div
class=
"model-item-content model-item-contents"
>
试用天数:
<span>
{{
marketingContentJSON
(
obj
).
freeDay
}}
天
</span>
</div>
</
template
>
<
template
v-else-if=
"marketingContentJSON(obj).selectType == 'package'"
>
<div
class=
"model-item-title"
:title=
"marketingContentJSON(obj).packageName"
>
{{
marketingContentJSON
(
obj
).
packageName
}}
</div>
<div
class=
"model-item-content model-item-contents"
>
销售价格:
<span>
{{
marketingContentJSON
(
obj
).
packagePrice
}}
元
</span>
</div>
</
template
>
<
template
v-else-if=
"marketingContentJSON(obj).selectType == 'coupon'"
>
<div
class=
"model-item-title"
:title=
"marketingContentJSON(obj).couponName"
>
{{
marketingContentJSON
(
obj
).
couponName
}}
</div>
<div
class=
"model-item-content model-item-contents"
>
数量:
<span>
{{
marketingContentJSON
(
obj
).
residueAmount
}}
</span>
</div>
</
template
>
<
template
v-else-if=
"marketingContentJSON(obj).selectType == 'activity'"
>
<div
class=
"model-item-title"
:title=
"marketingContentJSON(obj).activityName"
>
{{
marketingContentJSON
(
obj
).
activityName
}}
</div>
<div
class=
"model-item-content"
></div>
<div
class=
"model-item-content"
>
开始时间:
{{
marketingContentJSON
(
obj
).
startTime
}}
</div>
<div
class=
"model-item-content"
>
结束时间:
{{
marketingContentJSON
(
obj
).
endTime
}}
</div>
</
template
>
<
template
v-else
>
<div
class=
"model-item-title"
:title=
"marketingContentJSON(obj.attContent).couponName"
>
{{
marketingContentJSON
(
obj
).
equityName
}}
</div>
<div
class=
"model-item-content model-item-weight"
>
赠送天数:
<span>
{{
marketingContentJSON
(
obj
).
effectiveType
==
2
?
marketingContentJSON
(
obj
).
effectivedDay
+
'天'
:
'永久有效'
}}
</span>
</div>
</
template
>
</div>
</div>
</div>
</div>
</div>
</template>
<
template
v-else
>
<div
v-for=
"(obj,index) in item.backupContent"
:key=
"index"
>
<div
class=
"event-content"
v-if=
"obj.attType == 1"
>
{{
obj
.
attContent
}}
</div>
<div
class=
"event-content"
v-if=
"obj.attType == 2"
>
<img
class=
"limitPhoto"
:src=
"obj.attContent"
alt
/>
</div>
<div
v-if=
"obj.attType == 3"
>
<video
class=
"model-item-img"
:src=
"obj.attContent"
controls=
"controls"
/>
</div>
<div
v-if=
"obj.attType == 6"
>
<div
class=
"welcome-activity-panel"
>
<div
class=
"welcome-activity-box"
>
<div
class=
"welcome-activity-icon"
>
<img
src=
"@/assets/welcomeWord/pdf_r.png"
v-if=
"obj.attContent"
/>
<img
src=
"@/assets/welcomeWord/pdf_r.png"
v-if=
"obj.attContent"
/>
</div>
<div
class=
"welcome-activity-desc"
>
<div
class=
"model-item-title"
>
{{ JSON.parse(obj.attContent).fileName }}
</div>
...
...
@@ -286,8 +189,6 @@
</div>
</div>
</div>
</template>
</div>
<div
class=
"event-btns"
>
<el-button
v-if=
"new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit =='copy'"
...
...
@@ -329,6 +230,7 @@
<
script
>
import
url
from
'@/assets/empty.png'
import
emoji
from
'@/utils/emo'
import
selectCustomer
from
'./components/selectCustomer'
import
selectCrowd
from
'./components/selectCrowd'
...
...
@@ -532,10 +434,34 @@ export default {
},
methods
:
{
tramWord
(
val
)
{
let
htm
=
val
.
replace
(
/
\[([\u
4E00-
\u
9FA56
]{1,4}
|OK|NO|666
)
]/gi
,
function
(
res
)
{
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
const
list
=
emoji
.
flat
(
Infinity
)
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
if
(
index
<
10
)
{
index
=
'00'
+
index
}
else
if
(
index
>=
10
&&
index
<
100
)
{
index
=
'0'
+
index
}
return
`<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/
${
index
}
.png">`
}
)
return
htm
},
backupContentJson
(
val
)
{
if
(
typeof
(
val
)
==
'string'
){
return
JSON
.
parse
(
val
)
}
else
{
return
val
}
},
marketingContentJSON
(
val
)
{
if
(
typeof
(
val
.
attContent
)
==
'string'
){
if
(
typeof
(
val
.
attContent
)
==
'string'
)
{
return
JSON
.
parse
(
val
.
attContent
).
marketingContent
}
else
{
}
else
{
return
val
.
attContent
.
marketingContent
}
},
...
...
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