Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
web
soss
Commits
4853f810
Commit
4853f810
authored
Jul 27, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改赠送优惠券
parent
5ad9460a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
47 deletions
+39
-47
src/api/coupon/coupon.js
+9
-0
src/views/coupon/coupon/giveCoupon.vue
+30
-47
No files found.
src/api/coupon/coupon.js
View file @
4853f810
...
...
@@ -52,3 +52,12 @@ export function onlineCoupon(id) {
});
}
// 赠送优惠券
export
function
giveCoupon
(
data
)
{
return
request
({
url
:
"/coupon-user/give"
,
method
:
"post"
,
data
:
data
,
});
}
src/views/coupon/coupon/giveCoupon.vue
View file @
4853f810
...
...
@@ -2,11 +2,11 @@
<div
class=
"app-container"
>
<el-dialog
:visible
.
sync=
"giveOpen"
width=
"1000px"
append-to-body
>
<el-form
:model=
"queryParams"
size=
"small"
:inline=
"true"
label-width=
"68px"
>
<el-form-item
label=
"手机号"
prop=
"userInfo"
>
<el-form-item
label=
"手机号"
>
<el-input
v-model=
"queryParams.userInfo"
placeholder=
"请输入手机号"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"优惠券"
>
<el-select
v-model=
"queryParams.
state"
placeholder=
"请选择优惠券"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
>
<el-select
v-model=
"queryParams.
couponId"
placeholder=
"请选择优惠券"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
filterable
>
<el-option
v-for=
"item in couponList"
:key=
"item.id"
...
...
@@ -60,7 +60,7 @@
<
script
>
import
{
listCustomer
}
from
"@/api/system/customer"
;
import
{
listCoupon
}
from
"@/api/coupon/coupon"
;
import
{
listCoupon
,
giveCoupon
}
from
"@/api/coupon/coupon"
;
export
default
{
name
:
"Class"
,
data
()
{
...
...
@@ -73,8 +73,8 @@ export default {
giveOpen
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
userInfo
:
null
,
couponId
:
null
,
},
customerList
:[],
couponList
:[]
...
...
@@ -86,7 +86,11 @@ export default {
methods
:
{
/** 查询列表 */
getList
()
{
this
.
giveOpen
=
true
;
this
.
giveOpen
=
true
;
this
.
queryParams
.
userInfo
=
null
;
this
.
queryParams
.
couponId
=
null
;
this
.
customerList
=
[];
this
.
total
=
0
;
},
/** 查询优惠券列表 */
getCouponList
()
{
...
...
@@ -121,54 +125,33 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
if
(
this
.
form
.
state
==
"1"
){
this
.
$message
.
error
(
"停用之后才可以修改"
);
return
;
}
updateClass
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
giveOpen
=
false
;
this
.
getList
();
});
}
else
{
addClass
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
giveOpen
=
false
;
this
.
getList
();
});
}
let
userId
=
null
;
let
userPhone
=
null
;
if
(
this
.
customerList
.
length
>
0
){
userId
=
this
.
customerList
[
0
].
id
;
userPhone
=
this
.
customerList
[
0
].
phoneNumber
;
}
else
{
this
.
$message
.
error
(
"请查询赠送优惠券的用户!"
);
return
;
}
let
couponId
=
this
.
queryParams
.
couponId
;
if
(
couponId
==
null
){
this
.
$message
.
error
(
"请选择需要赠送的优惠券!"
);
return
;
}
giveCoupon
({
"userId"
:
userId
,
"userPhone"
:
userPhone
,
"couponId"
:
couponId
}).
then
((
response
)
=>
{
if
(
response
.
code
==
200
){
this
.
$modal
.
msgSuccess
(
"赠送成功"
);
this
.
giveOpen
=
false
;
}
});
});
}
},
},
};
</
script
>
<
style
lang=
"scss"
>
.dialogClass
.spanClass
{
margin-left
:
10px
;
}
.dialogClass
.inputCalss
{
width
:
50px
;
margin-left
:
10px
;
}
.dialogClass
.el-radio__label
{
padding-left
:
3px
!important
;
}
.dialogClass
.marginLeft10
{
padding-left
:
10px
;
}
.dialogClass
.marginLeft20
{
padding-left
:
20px
;
}
.dialogClass
.width
{
width
:
326px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment