Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
sso-equity
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 a0e61ecb
authored
Sep 27, 2023
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
权益商品优惠券可生成领取链接进行领取
1 parent
826fb8d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
3 deletions
src/api/modules/goodsCouponApi.js
src/views/goodsCoupon/index.vue
src/api/modules/goodsCouponApi.js
View file @
a0e61ec
...
@@ -130,8 +130,8 @@ const saveCouponInfo = params => {
...
@@ -130,8 +130,8 @@ const saveCouponInfo = params => {
// 获取模板下的优惠券列表
// 获取模板下的优惠券列表
const
getCouponById
=
params
=>
{
const
getCouponById
=
params
=>
{
if
(
!
params
.
templateId
)
{
if
(
!
params
.
templateId
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
reject
()
reject
()
})
})
};
};
...
@@ -164,7 +164,19 @@ const delTemplateById = params => {
...
@@ -164,7 +164,19 @@ const delTemplateById = params => {
})
})
}
}
// 获取领取优惠券的短链
const
getUrlLink
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
urlLink.get`
return
other_http
({
url
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
export
default
{
getUrlLink
,
getCouponsList
,
getCouponsList
,
createCoupons
,
createCoupons
,
getExportApi
,
getExportApi
,
...
...
src/views/goodsCoupon/index.vue
View file @
a0e61ec
...
@@ -24,6 +24,9 @@
...
@@ -24,6 +24,9 @@
<GLTableButton
:buttonList=
"buttonList"
:buttonItem=
"scope"
:buttonNum=
"3"
></GLTableButton>
<GLTableButton
:buttonList=
"buttonList"
:buttonItem=
"scope"
:buttonNum=
"3"
></GLTableButton>
</div>
</div>
</GLTable>
</GLTable>
<GLDialog
class=
"codeDialog"
mode=
"small"
title=
"领取链接"
@
onOk=
"handleCopyLink"
okText=
"复制"
cancelText=
"取消"
:before-close=
"closeLinkDialog"
@
onCancel=
"closeLinkDialog"
:visible
.
sync=
"dialogShow"
>
<div
class=
"link-wrap"
>
{{
urlLink
}}
</div>
</GLDialog>
</div>
</div>
</
template
>
</
template
>
...
@@ -32,6 +35,7 @@ export default {
...
@@ -32,6 +35,7 @@ export default {
name
:
'index'
,
name
:
'index'
,
data
()
{
data
()
{
return
{
return
{
dialogShow
:
false
,
getListApi
:
this
.
$apis
.
goodsCouponApi
.
getCouponsList
,
getListApi
:
this
.
$apis
.
goodsCouponApi
.
getCouponsList
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
searchForm
:
{
searchForm
:
{
...
@@ -99,6 +103,19 @@ export default {
...
@@ -99,6 +103,19 @@ export default {
listeners
:
{
listeners
:
{
click
:
row
=>
this
.
goDetailPage
(
row
)
click
:
row
=>
this
.
goDetailPage
(
row
)
}
}
},
{
type
:
'el-button'
,
name
:
row
=>
{
return
'领取链接'
},
attrs
:
{
type
:
'text'
,
fn
:
'领取链接'
},
listeners
:
{
click
:
row
=>
this
.
goLink
(
row
.
scope
)
}
}
}
],
],
tableParams
:
{
tableParams
:
{
...
@@ -214,13 +231,41 @@ export default {
...
@@ -214,13 +231,41 @@ export default {
optionLabel
:
'label'
,
optionLabel
:
'label'
,
isClear
:
true
isClear
:
true
}
}
]
],
urlLink
:
''
,
}
}
},
},
created
()
{
created
()
{
this
.
getAllBrandList
()
this
.
getAllBrandList
()
},
},
methods
:
{
methods
:
{
goLink
(
row
)
{
this
.
$apis
.
goodsCouponApi
.
getUrlLink
({
couponId
:
row
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
urlLink
=
res
.
data
this
.
dialogShow
=
true
})
},
handleCopyLink
()
{
this
.
$message
({
message
:
'复制成功'
,
type
:
'success'
,
customClass
:
'message-Z-zinde'
})
const
input
=
document
.
createElement
(
'input'
)
document
.
body
.
appendChild
(
input
)
input
.
setAttribute
(
'value'
,
this
.
urlLink
)
input
.
select
()
document
.
execCommand
(
'Copy'
)
document
.
body
.
removeChild
(
input
)
},
closeLinkDialog
()
{
this
.
dialogShow
=
!
this
.
dialogShow
this
.
urlLink
=
''
},
handleOk
()
{
handleOk
()
{
this
.
$refs
.
tableRef
.
refreshTable
()
this
.
$refs
.
tableRef
.
refreshTable
()
},
},
...
@@ -326,4 +371,11 @@ export default {
...
@@ -326,4 +371,11 @@ export default {
}
}
}
}
}
}
.link-wrap
{
background
:
#f8f8f8
;
border-radius
:
2px
;
padding
:
20px
;
position
:
relative
;
margin-top
:
20px
;
}
</
style
>
</
style
>
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