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
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
73 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 {
...
@@ -5,37 +5,20 @@ export default {
name
:
''
,
name
:
''
,
components
:
{
components
:
{
PhonePreview
:
()
=>
import
(
'./components/PhonePreview.vue'
),
PhonePreview
:
()
=>
import
(
'./components/PhonePreview.vue'
),
Add
:
()
=>
import
(
'./components/Add
.vue
'
),
Add
:
()
=>
import
(
'./components/Add'
),
},
},
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
currentActive
:
0
,
currentActive
:
0
,
form
:
{
form
:
{
jumpType
:
1
,
jumpType
:
1
,
extensionType
:
1
,
extensionType
:
1
,
t
ouchT
ype
:
0
,
type
:
0
,
avatar
:
''
,
avatar
:
''
,
qrCode
:
''
,
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
,
typeDict
,
touchTypeDict
,
touchTypeDict
,
data
:
{},
data
:
{},
...
@@ -66,9 +49,13 @@ export default {
...
@@ -66,9 +49,13 @@ export default {
})
})
},
},
submit
()
{
submit
()
{
this
.
$refs
[
'form'
].
validate
((
validate
)
=>
{
this
.
$refs
.
add
.
$refs
[
'form'
].
validate
((
validate
)
=>
{
if
(
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
.
loading
=
true
;(
this
.
form
.
id
?
update
:
add
)(
this
.
form
)
;(
this
.
form
.
id
?
update
:
add
)(
this
.
form
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
...
@@ -119,16 +106,16 @@ export default {
...
@@ -119,16 +106,16 @@ export default {
</el-form-item>
</el-form-item>
<el-form-item
label=
"推广类型"
>
<el-form-item
label=
"推广类型"
>
<el-radio-group
v-model=
"form.extensionType"
>
<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
}}
{{
item
.
name
}}
</el-radio-button>
</el-radio-button>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"触达类型"
>
<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"
>
<template
v-for=
"(item, key) in typeDict"
>
<div
v-show=
"form.extensionType == key"
:key=
"key"
>
<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
}}
{{
unit
.
name
}}
</el-radio-button>
</el-radio-button>
</div>
</div>
...
@@ -136,16 +123,16 @@ export default {
...
@@ -136,16 +123,16 @@ export default {
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<div
class=
"g-card g-pad20"
style=
"background: #eee"
>
<div
class=
"g-card g-pad20"
style=
"background: #eee"
>
<span>
{{ touchTypeDict[form.t
ouchT
ype].tip }}
</span>
<span>
{{ touchTypeDict[form.type].tip }}
</span>
</div>
</div>
</el-form>
</el-form>
<div
v-show=
"currentActive == 1"
class=
"fxbw ais mt10"
style=
"overflow: auto"
>
<div
v-show=
"currentActive == 1"
class=
"fxbw ais mt10"
style=
"overflow: auto"
>
<div
class=
"g-card g-pad20"
style=
"width: 58%"
>
<div
class=
"g-card g-pad20"
style=
"width: 58%"
>
<Add
:form=
"form"
/>
<Add
ref=
"add"
:form=
"form"
/>
</div>
</div>
<div
class=
"g-card g-pad20"
style=
"width: 40%; margin-top: 0
"
>
<div
style=
"width: 40%
"
>
<PhonePreview
:data=
"form"
/>
<PhonePreview
:data=
"form"
/>
</div>
</div>
</div>
</div>
...
@@ -179,9 +166,4 @@ export default {
...
@@ -179,9 +166,4 @@ export default {
</el-container>
</el-container>
</template>
</template>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
></
style
>
.tips
{
color
:
#aaa
;
font-size
:
12px
;
}
</
style
>
linkwe-pc/src/views/intelligentShortLink/components/Add.vue
View file @
87576c4
<
script
>
<
script
>
import
{
touchTypeDict
}
from
'./mixin'
import
{
touchTypeDict
}
from
'./mixin'
export
default
{
export
default
{
name
:
''
,
components
:
{},
components
:
{},
props
:
{
props
:
{
form
:
{
form
:
{
...
@@ -10,6 +9,26 @@ export default {
...
@@ -10,6 +9,26 @@ export default {
},
},
data
()
{
data
()
{
return
{
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
,
touchTypeDict
,
prefixFormLabel
:
Object
.
freeze
({
prefixFormLabel
:
Object
.
freeze
({
1
:
'公众号'
,
1
:
'公众号'
,
...
@@ -31,58 +50,51 @@ export default {
...
@@ -31,58 +50,51 @@ export default {
<div>
<div>
<el-form
ref=
"form"
:model=
"form"
label-suffix=
":"
label-width=
"140px"
:rules=
"rules"
>
<el-form
ref=
"form"
:model=
"form"
label-suffix=
":"
label-width=
"140px"
:rules=
"rules"
>
<el-form-item
label=
"短链类型"
>
<el-form-item
label=
"短链类型"
>
<span>
{{
touchTypeDict
[
form
.
t
ouchT
ype
].
allName
}}
</span>
<span>
{{
touchTypeDict
[
form
.
type
].
allName
}}
</span>
</el-form-item>
</el-form-item>
<el-form-item
label=
"短链名称"
prop=
"shortLinkName"
>
<el-form-item
label=
"短链名称"
prop=
"shortLinkName"
>
<el-input
clearable
v-model=
"form.shortLinkName"
placeholder=
"请输入"
maxlength=
"30"
show-word-limit
></el-input>
<el-input
clearable
v-model=
"form.shortLinkName"
placeholder=
"请输入"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
</el-form-item>
<!-- 公众号文章 -->
<!-- 公众号文章 -->
<template
v-if=
"form.touchType == 0"
>
<el-form-item
prop=
"longLink"
label=
"公众号文章链接"
v-if=
"form.type == 0"
>
<el-form-item
prop=
"longLink"
label=
"公众号文章链接"
>
<el-input
clearable
v-model=
"form.longLink"
placeholder=
"请输入"
></el-input>
<el-input
clearable
v-model=
"form.longLink"
placeholder=
"请输入"
></el-input>
<div
class=
"tips"
>
请在公众号后台文章发布列表页中获取并复制文章的永久链接
</div>
<div
class=
"tips"
>
请在公众号后台文章发布列表页中获取并复制文章的永久链接
</div>
</el-form-item>
</el-form-item>
</
template
>
<!-- 公众号二维码,个人二维码,群二维码,小程序二维码 -->
<!-- 公众号二维码,个人二维码,群二维码,小程序二维码 -->
<
template
v-else-if=
"Object.keys(prefixFormLabel).includes(form.t
ouchT
ype + '')"
>
<template
v-else-if=
"Object.keys(prefixFormLabel).includes(form.type + '')"
>
<el-form-item
prop=
"name"
:label=
"prefixFormLabel[form.t
ouchT
ype] + '名称'"
>
<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-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
</el-form-item>
</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-input
clearable
v-model=
"form.describe"
placeholder=
"请输入"
maxlength=
"30"
show-word-limit
></el-input>
</el-form-item>
</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>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"form.avatar"
></upload>
</el-form-item>
</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>
<upload
class=
"image-uploader"
:fileUrl
.
sync=
"form.qrCode"
></upload>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
<!-- 员工活码,客群活码 -->
<!-- 员工活码,客群活码 -->
<
template
v-else-if=
"[4, 5].includes(+form.touchType)"
>
<
template
v-else-if=
"[4, 5].includes(+form.type)"
>
<el-form-item
prop=
"qrCodeId"
:label=
"'选择' + touchTypeDict[form.touchType].name"
>
<el-form-item
prop=
"qrCodeId"
:label=
"'选择' + touchTypeDict[form.type].name"
>
<el-button
<el-button
type=
"primary"
plain
@
click=
"choiceQqcode(form.type, '选择' + touchTypeDict[form.type].name)"
>
type=
"primary"
选择
{{
touchTypeDict
[
form
.
type
].
name
}}
plain
@
click=
"choiceQqcode(form.touchType, '选择' + touchTypeDict[form.touchType].name)"
>
选择
{{
touchTypeDict
[
form
.
touchType
].
name
}}
</el-button>
</el-button>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
<!-- 门店导购活码,门店群活码 -->
<!-- 门店导购活码,门店群活码 -->
<
template
v-else-if=
"[6, 8].includes(+form.touchType)"
>
<
template
v-else-if=
"[6, 8].includes(+form.type)"
>
<el-form-item
prop=
"qrCodeId"
:label=
"touchTypeDict[form.touchType].name"
>
<el-form-item
prop=
"qrCodeId"
:label=
"touchTypeDict[form.type].name"
>
<el-button
<el-button
type=
"primary"
plain
@
click=
"choiceQqcode(form.type, '选择' + touchTypeDict[form.type].name)"
>
type=
"primary"
暂无
{{
touchTypeDict
[
form
.
type
].
name
}}
,去配置
plain
@
click=
"choiceQqcode(form.touchType, '选择' + touchTypeDict[form.touchType].name)"
>
暂无
{{
touchTypeDict
[
form
.
touchType
].
name
}}
,去配置
</el-button>
</el-button>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
<!-- 个人小程序 -->
<!-- 个人小程序 -->
<
template
v-else-if=
"form.t
ouchT
ype == 7"
>
<
template
v-else-if=
"form.type == 7"
>
<el-form-item
prop=
"name"
label=
"小程序名称"
>
<el-form-item
prop=
"name"
label=
"小程序名称"
>
<el-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
<el-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
</el-form-item>
</el-form-item>
...
@@ -97,7 +109,7 @@ export default {
...
@@ -97,7 +109,7 @@ export default {
</el-form-item>
</el-form-item>
</
template
>
</
template
>
<!-- 企业小程序 -->
<!-- 企业小程序 -->
<
template
v-else-if=
"form.t
ouchT
ype == 9"
>
<
template
v-else-if=
"form.type == 9"
>
<el-form-item
prop=
"name"
label=
"小程序名称"
>
<el-form-item
prop=
"name"
label=
"小程序名称"
>
<el-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
<el-input
clearable
v-model=
"form.name"
placeholder=
"请输入"
maxlength=
"15"
show-word-limit
></el-input>
</el-form-item>
</el-form-item>
...
@@ -121,4 +133,9 @@ export default {
...
@@ -121,4 +133,9 @@ export default {
</div>
</div>
</template>
</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,13 +26,14 @@ export default {
...
@@ -26,13 +26,14 @@ export default {
<
template
>
<
template
>
<div>
<div>
<div
class=
"g-title"
>
预览
</div>
<div
class=
"g-title"
>
预览
</div>
<PhoneTemplate
v-if=
"touchTypeDict[data.touchType]"
:title=
"touchTypeDict[data.touchType].previewMobileTitle"
>
<div
class=
"g-card g-pad20"
>
<template
v-if=
"data.touchType == 0"
>
<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=
"mask"
style=
"position: absolute"
>
<div
class=
"cc ac g-card g-pad20"
style=
"width: 70%"
>
公众号文章示例
</div>
<div
class=
"cc ac g-card g-pad20"
style=
"width: 70%"
>
公众号文章示例
</div>
</div>
</div>
</
template
>
</
template
>
<
template
v-else-if=
"[7, 9, 10].includes(+data.touchT
ype)"
>
<
template
v-else-if=
"[7, 9, 10].includes(+data.t
ype)"
>
<div
class=
"g-card g-pad20 cc ac"
style=
"width: 80%"
>
<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-image
style=
"width: 120px; height: 120px"
:src=
"data.avatar"
error=
"头像"
fit=
"fit"
></el-image>
...
@@ -51,12 +52,13 @@ export default {
...
@@ -51,12 +52,13 @@ export default {
<div
class=
"toe"
>
{{
data
.
name
||
'名称'
}}
</div>
<div
class=
"toe"
>
{{
data
.
name
||
'名称'
}}
</div>
<div
class=
"tips mt20 toe"
>
{{
data
.
describe
||
'描述'
}}
</div>
<div
class=
"tips mt20 toe"
>
{{
data
.
describe
||
'描述'
}}
</div>
</div>
</div>
<el-image
style=
"width: 120px; height: 120px; margin: 20px 0"
:src=
"url"
:
fit=
"fit"
></el-image>
<el-image
style=
"width: 120px; height: 120px; margin: 20px 0"
:src=
"data.qrCode"
fit=
"fit"
></el-image>
<div
class=
"mt20"
>
长按二维码
{{
touchTypeDict
[
data
.
touchT
ype
].
previewMobileTitle
}}
</div>
<div
class=
"mt20"
>
长按二维码
{{
touchTypeDict
[
data
.
t
ype
].
previewMobileTitle
}}
</div>
</div>
</div>
</
template
>
</
template
>
</PhoneTemplate>
</PhoneTemplate>
</div>
</div>
</div>
</template>
</template>
<
style
lang=
"scss"
scoped
></
style
>
<
style
lang=
"scss"
scoped
></
style
>
linkwe-pc/src/views/intelligentShortLink/detail.vue
View file @
87576c4
...
@@ -5,7 +5,9 @@ export default {
...
@@ -5,7 +5,9 @@ export default {
components
:
{
components
:
{
TimeSearchTitle
:
()
=>
import
(
'@/components/common/TimeSearchTitle'
),
TimeSearchTitle
:
()
=>
import
(
'@/components/common/TimeSearchTitle'
),
PhonePreview
:
()
=>
import
(
'./components/PhonePreview.vue'
),
PhonePreview
:
()
=>
import
(
'./components/PhonePreview.vue'
),
CardGroupIndex
:
()
=>
import
(
'@/components/CardGroupIndex'
),
ChartLine
:
()
=>
import
(
'@/components/ChartLine'
),
ChartLine
:
()
=>
import
(
'@/components/ChartLine'
),
Add
:
()
=>
import
(
'./components/Add'
),
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -93,10 +95,11 @@ export default {
...
@@ -93,10 +95,11 @@ export default {
}
}
getLineAnalysis
(
query
).
then
(({
data
})
=>
{
getLineAnalysis
(
query
).
then
(({
data
})
=>
{
this
.
series
=
[]
this
.
series
=
[]
this
.
xData
=
data
.
map
((
e
)
=>
e
.
xtime
)
this
.
xData
=
data
.
xaxis
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
pvTodayCount
))
this
.
series
=
data
.
yaxis
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
uvTodayCount
))
// this.series.push(data.map((e) => e.pvTodayCount))
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
openTodayCount
))
// this.series.push(data.map((e) => e.uvTodayCount))
// this.series.push(data.map((e) => e.openTodayCount))
})
})
},
},
},
},
...
@@ -123,7 +126,7 @@ export default {
...
@@ -123,7 +126,7 @@ export default {
:series=
"series"
></ChartLine>
:series=
"series"
></ChartLine>
</div>
</div>
</div>
</div>
<div
class=
"g-card g-pad20"
style=
"width: 40%; margin-top: 0
"
>
<div
style=
"width: 40%
"
>
<PhonePreview
:data=
"data"
/>
<PhonePreview
:data=
"data"
/>
</div>
</div>
</div>
</div>
...
...
linkwe-pc/src/views/intelligentShortLink/index.vue
View file @
87576c4
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
import
{
getList
,
getAnalysis
,
remove
}
from
'@/api/intelligentShortLink'
import
{
getList
,
getAnalysis
,
remove
}
from
'@/api/intelligentShortLink'
export
default
{
export
default
{
name
:
''
,
name
:
''
,
components
:
{},
components
:
{
CardGroupIndex
:
()
=>
import
(
'@/components/CardGroupIndex'
),
},
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
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