记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
31f1197d
Commit
31f1197d
authored
Dec 06, 2021
by
qinshuangshuang@zhengzai.tv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建积分活动+优惠券选择
parent
40c5beec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
37 deletions
+48
-37
form.html
...urces/templates/zhengzai/sweet/integralActivity/form.html
+48
-37
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/sweet/integralActivity/form.html
View file @
31f1197d
...
@@ -114,11 +114,11 @@
...
@@ -114,11 +114,11 @@
</div>
</div>
</div>
</div>
</form>
</form>
<div
id=
"detailsFormList"
class=
"details-form-list"
>
<div
id=
"detailsFormList"
class=
"details-form-list"
style=
"display: none"
>
<!--奖品详情-->
<!--奖品详情-->
<div
class=
"details-pop-inner"
>
<div
class=
"details-pop-inner"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"addCouponShow()"
>
添加
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"addCouponShow()"
>
添加
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"closeCoupon()"
>
关闭窗口
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"closeCoupon
Show
()"
>
关闭窗口
</button>
<hr>
<hr>
<div
class=
"coupon-select"
style=
"display: none"
>
<div
class=
"coupon-select"
style=
"display: none"
>
<!--选择优惠券-->
<!--选择优惠券-->
...
@@ -364,12 +364,10 @@
...
@@ -364,12 +364,10 @@
]
]
};
};
var
nowList
=
[];
// 当前编辑的奖品详情列表
var
nowList
=
[];
// 当前编辑的奖品详情列表
var
nowPrizeId
=
''
;
// 当前编辑的奖品ID
var
nowShowData
=
{};
// 当前编辑的奖品信息
var
integralActivityId
=
''
;
// 当前编辑的活动ID
let
searchVal
=
''
;
// 优惠券输入框内数据
let
searchVal
=
''
;
// 优惠券输入框内数据
let
searchData
=
[];
// 优惠券搜索总数据
let
searchData
=
[];
// 优惠券搜索总数据
let
nowCouponSelectId
=
''
;
// 当前选择的优惠券ID
var
nowCouponSelect
=
{};
// 当前选择的优惠券
let
nowCouponSelectTitle
=
''
;
// 当前选择的优惠券title
var
detailsOptions
=
{
var
detailsOptions
=
{
id
:
"details-table"
,
id
:
"details-table"
,
data
:
nowList
,
data
:
nowList
,
...
@@ -393,7 +391,7 @@
...
@@ -393,7 +391,7 @@
align
:
'center'
,
align
:
'center'
,
title
:
"优惠券ID"
,
title
:
"优惠券ID"
,
formatter
:
function
(
value
,
row
,
index
)
{
formatter
:
function
(
value
,
row
,
index
)
{
return
data
[
index
].
couponId
;
return
nowList
[
index
].
couponId
;
}
}
},
},
{
{
...
@@ -401,7 +399,7 @@
...
@@ -401,7 +399,7 @@
align
:
'center'
,
align
:
'center'
,
title
:
"优惠券名称"
,
title
:
"优惠券名称"
,
formatter
:
function
(
value
,
row
,
index
)
{
formatter
:
function
(
value
,
row
,
index
)
{
return
data
[
index
].
couponTitle
;
return
nowList
[
index
].
couponTitle
;
}
}
},
},
{
{
...
@@ -487,7 +485,6 @@
...
@@ -487,7 +485,6 @@
data
.
push
(
obj
)
data
.
push
(
obj
)
}
}
$
.
table
.
init
(
options
);
$
.
table
.
init
(
options
);
console
.
log
(
$
.
table
);
}
}
});
});
...
@@ -681,8 +678,6 @@
...
@@ -681,8 +678,6 @@
estimatedNum
:
$
(
"#estimatedNum"
).
val
(),
estimatedNum
:
$
(
"#estimatedNum"
).
val
(),
probabilityPublicity
:
$
(
"#probabilityPublicity"
).
val
()
probabilityPublicity
:
$
(
"#probabilityPublicity"
).
val
()
}
}
console
.
log
(
'========'
,
data
);
console
.
log
(
'========'
,
datas
);
let
url
=
'/sweet/integralActivity/create'
;
let
url
=
'/sweet/integralActivity/create'
;
let
type
=
'post'
;
let
type
=
'post'
;
if
(
itemId
)
{
if
(
itemId
)
{
...
@@ -706,36 +701,40 @@
...
@@ -706,36 +701,40 @@
}
}
})
})
}
}
// 展示已配置的优惠券列表
function
showList
(
index
)
{
function
showList
(
index
)
{
console
.
log
(
'showList==='
,
data
[
index
])
;
nowShowData
=
data
[
index
]
;
now
PrizeId
=
data
[
index
].
prizeId
;
now
ShowData
.
index
=
index
;
integralActivityId
=
data
[
index
].
integralActivityId
;
nowList
=
[]
;
detailsOptions
.
data
=
[];
// 拿列表数据
$
.
table
.
destroy
(
"details-table"
);
$
.
ajax
({
$
.
ajax
({
type
:
'get'
,
type
:
'get'
,
url
:
'/sweet/integralActivityPrizeRelation/list'
,
url
:
'/sweet/integralActivityPrizeRelation/list'
,
data
:
{
prizeId
:
nowPrizeId
},
data
:
{
prizeId
:
nowShowData
[
'prizeId'
]
},
success
:
function
(
e
)
{
success
:
function
(
res
)
{
if
(
e
.
code
==
0
)
{
nowList
=
res
;
let
res
=
e
.
data
;
detailsOptions
.
data
=
res
;
}
setTimeout
(()
=>
{
$
.
table
.
init
(
detailsOptions
);
},
500
)
$
(
"#detailsFormList"
).
show
();
}
}
});
});
$
.
table
.
init
(
detailsOptions
);
$
(
"#detailsFormList"
).
show
();
}
}
function
addCouponShow
()
{
function
addCouponShow
()
{
$
(
".coupon-select"
).
show
();
$
(
".coupon-select"
).
show
();
}
}
function
closeCouponShow
()
{
$
(
"#detailsFormList"
).
hide
();
}
// 添加优惠券
function
addCouponFun
()
{
function
addCouponFun
()
{
console
.
log
(
'添加优惠券==='
);
let
postData
=
{
let
postData
=
{
"couponId"
:
nowCouponSelectId
,
"couponId"
:
nowCouponSelect
.
coupon
Id
,
"couponTitle"
:
nowCouponSelect
T
itle
,
"couponTitle"
:
nowCouponSelect
.
t
itle
,
"integralActivityId"
:
integralActivityId
,
"integralActivityId"
:
nowShowData
[
'integralActivityId'
]
,
"prizeId"
:
now
PrizeId
"prizeId"
:
now
ShowData
[
'prizeId'
]
};
};
$
.
ajax
({
$
.
ajax
({
type
:
'post'
,
type
:
'post'
,
...
@@ -744,16 +743,29 @@
...
@@ -744,16 +743,29 @@
contentType
:
'application/json'
,
contentType
:
'application/json'
,
success
:
function
(
e
)
{
success
:
function
(
e
)
{
if
(
e
.
code
==
0
)
{
if
(
e
.
code
==
0
)
{
showList
(
nowShowData
.
index
);
alert
(
'添加成功!'
);
alert
(
'添加成功!'
);
}
}
}
}
});
});
}
}
// 删除优惠券
function
deleteCoupon
(
index
)
{
function
deleteCoupon
(
index
)
{
console
.
log
(
'删除优惠券==='
);
let
postData
=
{
}
"integralActivityId"
:
nowShowData
[
'integralActivityId'
],
function
closeCoupon
()
{
"prizeRelationId"
:
nowList
[
index
][
'prizeRelationId'
]
$
(
"#detailsFormList"
).
hide
();
};
$
.
ajax
({
type
:
'put'
,
url
:
'/sweet/integralActivityPrizeRelation/delete'
,
data
:
postData
,
success
:
function
(
e
)
{
if
(
e
.
code
==
0
)
{
showList
(
nowShowData
.
index
);
alert
(
'删除成功!'
);
}
}
});
}
}
// 远程搜索券
// 远程搜索券
function
getMallList
()
{
function
getMallList
()
{
...
@@ -790,15 +802,14 @@
...
@@ -790,15 +802,14 @@
})
})
})
})
}
}
// 选择优惠券
function
selectOne
(
id
,
name
)
{
function
selectOne
(
id
,
name
)
{
searchData
.
some
(
item
=>
{
searchData
.
some
(
(
item
,
index
)
=>
{
if
(
item
[
name
]
==
id
)
{
if
(
item
[
name
]
==
id
)
{
nowCouponSelect
Title
=
item
.
title
;
nowCouponSelect
=
item
;
return
$
(
"#searchIpt"
).
val
(
item
.
title
);
return
$
(
"#searchIpt"
).
val
(
item
.
title
);
}
}
}
)
}
)
nowCouponSelectId
=
id
;
console
.
log
(
'选择==='
,
id
,
nowCouponSelectTitle
);
}
}
$
(
"#searchIpt"
).
focus
(
function
(){
$
(
"#searchIpt"
).
focus
(
function
(){
getMallList
()
getMallList
()
...
...
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