Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 87576c4f
authored
Jan 17, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
智能短链基本完成
1 parent
a7b3e6dd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
100 deletions
linkwe-pc/src/views/intelligentShortLink/addEdit.vue
linkwe-pc/src/views/intelligentShortLink/components/Add.vue
linkwe-pc/src/views/intelligentShortLink/components/PhonePreview.vue
linkwe-pc/src/views/intelligentShortLink/detail.vue
linkwe-pc/src/views/intelligentShortLink/index.vue
linkwe-pc/src/views/intelligentShortLink/addEdit.vue
View file @
87576c4
...
...
@@ -5,37 +5,20 @@ export default {
name
:
''
,
components
:
{
PhonePreview
:
()
=>
import
(
'./components/PhonePreview.vue'
),
Add
:
()
=>
import
(
'./components/Add
.vue
'
),
Add
:
()
=>
import
(
'./components/Add'
),
},
data
()
{
return
{
loading
:
false
,
currentActive
:
0
,
form
:
{
jumpType
:
1
,
extensionType
:
1
,
t
ouchT
ype
:
0
,
type
:
0
,
avatar
:
''
,
qrCode
:
''
,
},
rules
:
{
shortLinkName
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
name
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
describe
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
longLink
:
[
{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
},
{
validator
(
rule
,
value
,
callback
)
{
if
(
value
&&
!
/^http/gi
.
test
(
value
))
callback
(
'链接格式错误,需以http(s)开头'
)
},
trigger
:
'blur'
,
},
],
avatar
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
qrCode
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
qrCodeId
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
appId
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
secret
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
},
typeDict
,
touchTypeDict
,
data
:
{},
...
...
@@ -66,9 +49,13 @@ export default {
})
},
submit
()
{
this
.
$refs
[
'form'
].
validate
((
validate
)
=>
{
this
.
$refs
.
add
.
$refs
[
'form'
].
validate
((
validate
)
=>
{
if
(
validate
)
{
this
.
form
.
type
=
this
.
form
.
touchType
if
([
1
,
0
].
includes
(
this
.
form
.
type
))
{
this
.
form
.
touchType
=
this
.
form
.
type
+
1
}
else
{
delete
this
.
form
.
touchType
}
this
.
loading
=
true
;(
this
.
form
.
id
?
update
:
add
)(
this
.
form
)
.
then
((
res
)
=>
{
...
...
@@ -119,16 +106,16 @@ export default {
</el-form-item>
<el-form-item
label=
"推广类型"
>
<el-radio-group
v-model=
"form.extensionType"
>
<el-radio-button
v-for=
"(item, key) in typeDict"
:key=
"key"
:label=
"key"
>
<el-radio-button
v-for=
"(item, key) in typeDict"
:key=
"key"
:label=
"
+
key"
>
{{
item
.
name
}}
</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"触达类型"
>
<el-radio-group
v-model=
"form.t
ouchT
ype"
>
<el-radio-group
v-model=
"form.type"
>
<template
v-for=
"(item, key) in typeDict"
>
<div
v-show=
"form.extensionType == key"
:key=
"key"
>
<el-radio-button
v-for=
"(unit, unique) in item.touchType"
:key=
"key + '-' + unique"
:label=
"unique"
>
<el-radio-button
v-for=
"(unit, unique) in item.touchType"
:key=
"key + '-' + unique"
:label=
"
+
unique"
>
{{
unit
.
name
}}
</el-radio-button>
</div>
...
...
@@ -136,16 +123,16 @@ export default {
</el-radio-group>
</el-form-item>
<div
class=
"g-card g-pad20"
style=
"background: #eee"
>
<span>
{{ touchTypeDict[form.t
ouchT
ype].tip }}
</span>
<span>
{{ touchTypeDict[form.type].tip }}
</span>
</div>
</el-form>
<div
v-show=
"currentActive == 1"
class=
"fxbw ais mt10"
style=
"overflow: auto"
>
<div
class=
"g-card g-pad20"
style=
"width: 58%"
>
<Add
:form=
"form"
/>
<Add
ref=
"add"
:form=
"form"
/>
</div>
<div
class=
"g-card g-pad20"
style=
"width: 40%; margin-top: 0
"
>
<div
style=
"width: 40%
"
>
<PhonePreview
:data=
"form"
/>
</div>
</div>
...
...
@@ -179,9 +166,4 @@ export default {
</el-container>
</template>
<
style
lang=
"scss"
scoped
>
.tips
{
color
:
#aaa
;
font-size
:
12px
;
}
</
style
>
<
style
lang=
"scss"
scoped
></
style
>
linkwe-pc/src/views/intelligentShortLink/components/Add.vue
View file @
87576c4
<
script
>
import
{
touchTypeDict
}
from
'./mixin'
export
default
{
name
:
''
,
components
:
{},
props
:
{
form
:
{
...
...
@@ -10,6 +9,26 @@ export default {
},
data
()
{
return
{
rules
:
{
shortLinkName
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
name
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
describe
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
longLink
:
[
{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
},
{
validator
(
rule
,
value
,
callback
)
{
if
(
value
&&
!
/^http/gi
.
test
(
value
))
callback
(
'链接格式错误,需以http(s)开头'
)
else
callback
()
},
trigger
:
'blur'
,
},
],
avatar
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
qrCode
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
qrCodeId
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'change'
}],
appId
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
secret
:
[{
required
:
true
,
message
:
'必填项'
,
trigger
:
'blur'
}],
},
touchTypeDict
,
prefixFormLabel
:
Object
.
freeze
({
1
:
'公众号'
,
...
...
@@ -31,58 +50,51 @@ export default {
<div>
<el-form
ref=
"form"
:model=
"form"
label-suffix=
":"
label-width=
"140px"
:rules=
"rules"
>
<el-form-item
label=
"短链类型"
>
<span>
{{
touchTypeDict
[
form
.
t
ouchT
ype
].
allName
}}
</span>
<span>
{{
touchTypeDict
[
form
.
type
].
allName
}}
</span>
</el-form-item>
<el-form-item
label=
"短链名称"
prop=
"shortLinkName"
>
<el-input
clearable
v-model=
"form.shortLinkName"
placeholder=
"请输入"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
<!-- 公众号文章 -->
<template
v-if=
"form.touchType == 0"
>
<el-form-item
prop=
"longLink"
label=
"公众号文章链接"
>
<el-input
clearable
v-model=
"form.longLink"
placeholder=
"请输入"
></el-input>
<div
class=
"tips"
>
请在公众号后台文章发布列表页中获取并复制文章的永久链接
</div>
</el-form-item>
</
template
>
<el-form-item
prop=
"longLink"
label=
"公众号文章链接"
v-if=
"form.type == 0"
>
<el-input
clearable
v-model=
"form.longLink"
placeholder=
"请输入"
></el-input>
<div
class=
"tips"
>
请在公众号后台文章发布列表页中获取并复制文章的永久链接
</div>
</el-form-item>
<!-- 公众号二维码,个人二维码,群二维码,小程序二维码 -->
<
template
v-else-if=
"Object.keys(prefixFormLabel).includes(form.t
ouchT
ype + '')"
>
<el-form-item
prop=
"name"
:label=
"prefixFormLabel[form.t
ouchT
ype] + '名称'"
>
<template
v-else-if=
"Object.keys(prefixFormLabel).includes(form.type + '')"
>
<el-form-item
prop=
"name"
:label=
"prefixFormLabel[form.type] + '名称'"
>
<el-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
prop=
"describe"
:label=
"prefixFormLabel[form.t
ouchT
ype] + '描述'"
>
<el-form-item
prop=
"describe"
:label=
"prefixFormLabel[form.type] + '描述'"
>
<el-input
clearable
v-model=
"form.describe"
placeholder=
"请输入"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
prop=
"avatar"
:label=
"prefixFormLabel[form.t
ouchT
ype] + '头像'"
>
<el-form-item
prop=
"avatar"
:label=
"prefixFormLabel[form.type] + '头像'"
>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"form.avatar"
></upload>
</el-form-item>
<el-form-item
prop=
"qrCode"
:label=
"prefixFormLabel[form.t
ouchT
ype] + '二维码'"
>
<el-form-item
prop=
"qrCode"
:label=
"prefixFormLabel[form.type] + '二维码'"
>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"form.qrCode"
></upload>
</el-form-item>
</
template
>
<!-- 员工活码,客群活码 -->
<
template
v-else-if=
"[4, 5].includes(+form.touchType)"
>
<el-form-item
prop=
"qrCodeId"
:label=
"'选择' + touchTypeDict[form.touchType].name"
>
<el-button
type=
"primary"
plain
@
click=
"choiceQqcode(form.touchType, '选择' + touchTypeDict[form.touchType].name)"
>
选择
{{
touchTypeDict
[
form
.
touchType
].
name
}}
<
template
v-else-if=
"[4, 5].includes(+form.type)"
>
<el-form-item
prop=
"qrCodeId"
:label=
"'选择' + touchTypeDict[form.type].name"
>
<el-button
type=
"primary"
plain
@
click=
"choiceQqcode(form.type, '选择' + touchTypeDict[form.type].name)"
>
选择
{{
touchTypeDict
[
form
.
type
].
name
}}
</el-button>
</el-form-item>
</
template
>
<!-- 门店导购活码,门店群活码 -->
<
template
v-else-if=
"[6, 8].includes(+form.touchType)"
>
<el-form-item
prop=
"qrCodeId"
:label=
"touchTypeDict[form.touchType].name"
>
<el-button
type=
"primary"
plain
@
click=
"choiceQqcode(form.touchType, '选择' + touchTypeDict[form.touchType].name)"
>
暂无
{{
touchTypeDict
[
form
.
touchType
].
name
}}
,去配置
<
template
v-else-if=
"[6, 8].includes(+form.type)"
>
<el-form-item
prop=
"qrCodeId"
:label=
"touchTypeDict[form.type].name"
>
<el-button
type=
"primary"
plain
@
click=
"choiceQqcode(form.type, '选择' + touchTypeDict[form.type].name)"
>
暂无
{{
touchTypeDict
[
form
.
type
].
name
}}
,去配置
</el-button>
</el-form-item>
</
template
>
<!-- 个人小程序 -->
<
template
v-else-if=
"form.t
ouchT
ype == 7"
>
<
template
v-else-if=
"form.type == 7"
>
<el-form-item
prop=
"name"
label=
"小程序名称"
>
<el-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
</el-form-item>
...
...
@@ -97,7 +109,7 @@ export default {
</el-form-item>
</
template
>
<!-- 企业小程序 -->
<
template
v-else-if=
"form.t
ouchT
ype == 9"
>
<
template
v-else-if=
"form.type == 9"
>
<el-form-item
prop=
"name"
label=
"小程序名称"
>
<el-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
</el-form-item>
...
...
@@ -121,4 +133,9 @@ export default {
</div>
</template>
<
style
lang=
"scss"
scoped
></
style
>
<
style
lang=
"scss"
scoped
>
.tips
{
color
:
#aaa
;
font-size
:
12px
;
}
</
style
>
linkwe-pc/src/views/intelligentShortLink/components/PhonePreview.vue
View file @
87576c4
...
...
@@ -26,36 +26,38 @@ export default {
<
template
>
<div>
<div
class=
"g-title"
>
预览
</div>
<PhoneTemplate
v-if=
"touchTypeDict[data.touchType]"
:title=
"touchTypeDict[data.touchType].previewMobileTitle"
>
<template
v-if=
"data.touchType == 0"
>
<div
class=
"mask"
style=
"position: absolute"
>
<div
class=
"cc ac g-card g-pad20"
style=
"width: 70%"
>
公众号文章示例
</div>
</div>
</
template
>
<
template
v-else-if=
"[7, 9, 10].includes(+data.touchType)"
>
<div
class=
"g-card g-pad20 cc ac"
style=
"width: 80%"
>
小程序
<el-image
style=
"width: 120px; height: 120px"
:src=
"data.avatar"
error=
"头像"
fit=
"fit"
></el-image>
<el-button
type=
"primary"
>
点击打开小程序
</el-button>
</div>
</
template
>
<
template
v-else
>
<div
class=
"g-card g-pad20 cc ac"
style=
"width: 80%"
>
<div
class=
"al bfc-o"
>
<el-image
class=
"fl mr10"
style=
"width: 50px; height: 50px"
:src=
"data.avatar"
error=
"头像"
fit=
"fit"
></el-image>
<div
class=
"toe"
>
{{
data
.
name
||
'名称'
}}
</div>
<div
class=
"tips mt20 toe"
>
{{
data
.
describe
||
'描述'
}}
</div>
<div
class=
"g-card g-pad20"
>
<PhoneTemplate
v-if=
"touchTypeDict[data.type]"
:title=
"touchTypeDict[data.type].previewMobileTitle"
>
<template
v-if=
"data.type == 0"
>
<div
class=
"mask"
style=
"position: absolute"
>
<div
class=
"cc ac g-card g-pad20"
style=
"width: 70%"
>
公众号文章示例
</div>
</div>
<el-image
style=
"width: 120px; height: 120px; margin: 20px 0"
:src=
"url"
:fit=
"fit"
></el-image>
<div
class=
"mt20"
>
长按二维码
{{
touchTypeDict
[
data
.
touchType
].
previewMobileTitle
}}
</div>
</div>
</
template
>
</PhoneTemplate>
</
template
>
<
template
v-else-if=
"[7, 9, 10].includes(+data.type)"
>
<div
class=
"g-card g-pad20 cc ac"
style=
"width: 80%"
>
小程序
<el-image
style=
"width: 120px; height: 120px"
:src=
"data.avatar"
error=
"头像"
fit=
"fit"
></el-image>
<el-button
type=
"primary"
>
点击打开小程序
</el-button>
</div>
</
template
>
<
template
v-else
>
<div
class=
"g-card g-pad20 cc ac"
style=
"width: 80%"
>
<div
class=
"al bfc-o"
>
<el-image
class=
"fl mr10"
style=
"width: 50px; height: 50px"
:src=
"data.avatar"
error=
"头像"
fit=
"fit"
></el-image>
<div
class=
"toe"
>
{{
data
.
name
||
'名称'
}}
</div>
<div
class=
"tips mt20 toe"
>
{{
data
.
describe
||
'描述'
}}
</div>
</div>
<el-image
style=
"width: 120px; height: 120px; margin: 20px 0"
:src=
"data.qrCode"
fit=
"fit"
></el-image>
<div
class=
"mt20"
>
长按二维码
{{
touchTypeDict
[
data
.
type
].
previewMobileTitle
}}
</div>
</div>
</
template
>
</PhoneTemplate>
</div>
</div>
</template>
...
...
linkwe-pc/src/views/intelligentShortLink/detail.vue
View file @
87576c4
...
...
@@ -5,7 +5,9 @@ export default {
components
:
{
TimeSearchTitle
:
()
=>
import
(
'@/components/common/TimeSearchTitle'
),
PhonePreview
:
()
=>
import
(
'./components/PhonePreview.vue'
),
CardGroupIndex
:
()
=>
import
(
'@/components/CardGroupIndex'
),
ChartLine
:
()
=>
import
(
'@/components/ChartLine'
),
Add
:
()
=>
import
(
'./components/Add'
),
},
data
()
{
return
{
...
...
@@ -93,10 +95,11 @@ export default {
}
getLineAnalysis
(
query
).
then
(({
data
})
=>
{
this
.
series
=
[]
this
.
xData
=
data
.
map
((
e
)
=>
e
.
xtime
)
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
pvTodayCount
))
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
uvTodayCount
))
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
openTodayCount
))
this
.
xData
=
data
.
xaxis
this
.
series
=
data
.
yaxis
// this.series.push(data.map((e) => e.pvTodayCount))
// this.series.push(data.map((e) => e.uvTodayCount))
// this.series.push(data.map((e) => e.openTodayCount))
})
},
},
...
...
@@ -123,7 +126,7 @@ export default {
:series=
"series"
></ChartLine>
</div>
</div>
<div
class=
"g-card g-pad20"
style=
"width: 40%; margin-top: 0
"
>
<div
style=
"width: 40%
"
>
<PhonePreview
:data=
"data"
/>
</div>
</div>
...
...
linkwe-pc/src/views/intelligentShortLink/index.vue
View file @
87576c4
...
...
@@ -2,7 +2,9 @@
import
{
getList
,
getAnalysis
,
remove
}
from
'@/api/intelligentShortLink'
export
default
{
name
:
''
,
components
:
{},
components
:
{
CardGroupIndex
:
()
=>
import
(
'@/components/CardGroupIndex'
),
},
data
()
{
return
{
loading
:
false
,
...
...
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