记得上下班打卡 | 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
65a713fd
Commit
65a713fd
authored
Dec 03, 2021
by
qinshuangshuang@zhengzai.tv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建积分活动
parent
33341010
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
907 additions
and
522 deletions
+907
-522
remote-search-coupon-list.js
...src/main/resources/static/js/remote-search-coupon-list.js
+176
-0
include.html
...lient-admin-web/src/main/resources/templates/include.html
+2
-0
form.html
...urces/templates/zhengzai/sweet/integralActivity/form.html
+729
-522
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/static/js/remote-search-coupon-list.js
0 → 100644
View file @
65a713fd
;(
function
(
$
)
{
//这里放入插件代码
var
RemoteSearchPerformance
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
);
this
.
options
=
$
.
extend
(
true
,
{},
$
.
fn
.
remoteSearchPerformance
.
defaults
,
options
);
this
.
id
=
$
(
element
).
attr
(
'id'
);
this
.
ulID
=
'#'
+
this
.
id
+
'_ul'
;
this
.
ulFoucus
=
false
;
// Method overrides
this
.
render
=
this
.
options
.
render
||
this
.
render
;
this
.
select
=
this
.
options
.
select
||
this
.
select
;
this
.
ajax
=
$
.
extend
({},
$
.
fn
.
remoteSearchPerformance
.
defaults
.
ajax
,
this
.
options
.
ajax
);
this
.
listen
();
}
RemoteSearchPerformance
.
prototype
=
{
listen
:
function
()
{
this
.
$element
.
on
(
'blur'
,
$
.
proxy
(
this
.
blur
,
this
))
.
on
(
'keyup'
,
$
.
proxy
(
this
.
keyup
,
this
));
this
.
$element
.
parent
(
'div.remote_wrapper'
).
on
(
'click'
,
this
.
ulID
,
$
.
proxy
(
this
.
click
,
this
));
},
blur
:
function
(
e
)
{
var
that
=
this
;
e
.
stopPropagation
();
e
.
preventDefault
();
setTimeout
(
function
()
{
if
(
!
that
.
ulFoucus
)
{
that
.
$element
.
val
(
that
.
$element
.
attr
(
'data-name'
));
that
.
hide
();
}
},
150
)
},
keyup
:
function
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
switch
(
e
.
keyCode
)
{
case
40
:
// down arrow
case
38
:
// up arrow
break
;
case
9
:
// tab
case
13
:
// enter
this
.
ajaxer
();
case
27
:
// escape
break
;
default
:
this
.
ajaxer
();
}
},
hide
:
function
()
{
$
(
this
.
ulID
).
remove
();
return
this
;
},
ajaxer
:
function
()
{
var
that
=
this
,
keyword
=
that
.
$element
.
val
();
busiType
=
window
.
typeRadio
;
couType
=
window
.
typeCoupe
;
// Query changed
that
.
keyword
=
keyword
;
// Cancel last timer if set
if
(
that
.
ajax
.
timerId
)
{
clearTimeout
(
that
.
ajax
.
timerId
);
that
.
ajax
.
timerId
=
null
;
}
// Query is good to send, set a timer
that
.
ajax
.
timerId
=
setTimeout
(
function
()
{
var
params
=
{
keyword
:
keyword
,
busiType
:
busiType
,
couType
:
couType
,
bindType
:
'1,4'
};
var
jAjax
=
$
.
post
;
jAjax
(
that
.
ajax
.
url
,
params
,
function
(
data
){
return
that
.
render
(
data
.
rows
);
});
that
.
ajax
.
timerId
=
null
;
},
that
.
ajax
.
timeout
);
return
that
;
},
render
:
function
(
data
)
{
this
.
ulFoucus
=
false
;
var
liList
=
data
||
[];
var
num
=
this
.
_getNum
();
//添加 ul
if
(
$
(
this
.
ulID
).
length
==
0
)
{
this
.
$element
.
after
(
"<ul id='"
+
this
.
id
+
"_ul' class='remote_search remote_search_top'></ul>"
);
};
//添加li
var
str
=
""
;
if
(
num
)
{
if
(
liList
.
length
)
{
for
(
var
i
=
0
;
i
<
liList
.
length
;
i
++
)
{
str
+=
"<li data-id='"
+
liList
[
i
].
couponId
+
"' data-name='"
+
liList
[
i
].
title
+
"' title='"
+
liList
[
i
].
title
+
"' value='"
+
liList
[
i
].
couponId
+
"'>"
+
liList
[
i
].
title
+
"</li>"
;
}
}
else
{
str
=
"<li data-id='' data-name=''>搜索无数据</li>"
}
}
else
{
this
.
$element
.
attr
(
'data-name'
,
""
);
this
.
$element
.
attr
(
'data-id'
,
""
);
}
$
(
this
.
ulID
).
html
(
str
);
var
bodyHeight
=
$
(
document
.
body
).
height
();
var
offsetTop
=
this
.
$element
.
offset
().
top
;
var
height
=
$
(
this
.
ulID
).
outerHeight
(
true
);
if
(
offsetTop
+
height
>
bodyHeight
){
$
(
this
.
ulID
).
addClass
(
'remote_search_bottom'
).
removeClass
(
'remote_search_top'
);
}
else
{
$
(
this
.
ulID
).
addClass
(
'remote_search_top'
).
removeClass
(
'remote_search_bottom'
);
}
return
this
;
},
click
:
function
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
var
dataName
=
$
(
e
.
target
).
attr
(
'data-name'
);
var
dataID
=
$
(
e
.
target
).
attr
(
'data-id'
);
this
.
$element
.
val
(
dataName
);
this
.
$element
.
attr
(
'data-name'
,
dataName
);
this
.
$element
.
attr
(
'data-id'
,
dataID
);
this
.
options
.
chose
(
dataName
,
dataID
);
this
.
ulFoucus
=
true
;
return
this
.
hide
();
},
_getNum
:
function
(){
return
this
.
$element
.
val
().
length
;
}
}
$
.
fn
.
remoteSearchPerformance
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
),
data
=
$this
.
data
(
'remoteSearchPerformance'
),
options
=
typeof
option
===
'object'
&&
option
;
if
(
!
data
)
{
$this
.
data
(
'remoteSearchPerformance'
,
(
data
=
new
RemoteSearchPerformance
(
this
,
options
)));
}
if
(
typeof
option
===
'string'
)
{
data
[
option
]();
}
});
}
$
.
fn
.
remoteSearchPerformance
.
defaults
=
{
hiddenVal
:
''
,
chose
:
function
()
{
},
ajax
:
{
url
:
null
,
timeout
:
300
,
method
:
'get'
,
timerId
:
null
},
success
:
function
(
res
){
}
}
$
.
fn
.
remoteSearchPerformance
.
Constructor
=
RemoteSearchPerformance
;
})(
jQuery
);
\ No newline at end of file
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/include.html
View file @
65a713fd
...
@@ -43,6 +43,8 @@
...
@@ -43,6 +43,8 @@
<script
th:src=
"@{/ruoyi/js/ry-ui.js?v=4.6.1}"
></script>
<script
th:src=
"@{/ruoyi/js/ry-ui.js?v=4.6.1}"
></script>
<!--远程搜索下拉框-->
<!--远程搜索下拉框-->
<script
th:src=
"@{/js/remote-search-performance.js}"
></script>
<script
th:src=
"@{/js/remote-search-performance.js}"
></script>
<!--远程搜索下拉框:积分抽奖配置使用-->
<script
th:src=
"@{/js/remote-search-coupon-list.js}"
></script>
</div>
</div>
<!-- ztree树插件 -->
<!-- ztree树插件 -->
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/sweet/integralActivity/form.html
View file @
65a713fd
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<th:block
th:include=
"include :: header('添加活动')"
/>
<th:block
th:include=
"include :: header('添加活动')"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-css"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-css"
/>
<style>
</head>
.layui-form
{
padding
:
20px
;
}
.main_type
,
.money
,
.scope_application
,
.sendType
,
.phoneNumber
,
.playMethod
{
margin-bottom
:
20px
;
}
.phoneNumber
,
.playMethod
{
<body
class=
"white-bg"
>
display
:
none
;
<!--奖品项配置表单-->
}
<form
id=
"form-user-add"
class=
"layui-form"
>
.labelName
{
display
:
inline-block
;
width
:
100px
;
text-align
:
right
;
}
input
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
padding-left
:
5px
;
height
:
30px
;
}
.main_type
.form-control.kv-fileinput-caption
{
height
:
42px
!important
;
}
.prompt
{
margin-left
:
100px
!important
;
}
.main_type
input
,
.sendType
input
,
.playMethod
input
{
margin-top
:
-2px
;
margin-right
:
5px
;
}
.main_type
span
,
.sendType
span
,
.playMethod
span
{
margin-right
:
12px
;
line-height
:
28px
;
}
.layui-form
.money
input
{
width
:
60px
;
}
.main_bottom
.describe
,
.main_bottom
.sendTime
{
margin-bottom
:
20px
;
}
.describe
,
.main_type
{
display
:
flex
;
}
.sendTime
{
display
:
flex
;
}
.sendTime
input
{
margin-top
:
-6px
;
margin-right
:
5px
;
}
.bottom_btn
{
width
:
25%
;
text-align
:
center
;
}
select
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
height
:
30px
;
width
:
200px
;
}
.required
{
font-style
:
normal
;
color
:
red
;
}
.ibox-content
{
border-style
:
none
;
border-width
:
0px
;
}
.main_type
.file-footer-buttons
.kv-file-remove
{
display
:
none
!important
;
}
.selectScore
{
display
:
flex
;
align-items
:
center
;
}
.selectScore
p
{
margin
:
0
;
}
.selectScore
button
{
margin
:
0
12px
;
}
.selectScore
span
{
color
:
#ccc
;
}
.scoreTable
{
margin-bottom
:
12px
;
}
</style>
</head>
<body
class=
"white-bg"
>
<form
id=
"form-user-add"
class=
"layui-form"
>
<div>
<div>
基础信息
基础信息
</div>
</div>
...
@@ -167,12 +74,24 @@
...
@@ -167,12 +74,24 @@
</div>
</div>
</div>
</div>
<div
class=
"main_bottom"
>
<div
class=
"main_bottom"
>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
预估玩此活动的总人数:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"text"
id=
"estimatedNum"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"预估玩此活动的总人数"
>
</div>
</div>
<div
class=
"describe"
>
<div
class=
"describe"
>
<span
class=
"labelName"
>
<span
class=
"labelName"
>
<i
class=
"required"
>
*
</i>
活动规则:
<i
class=
"required"
>
*
</i>
活动规则:
</span>
</span>
<textarea
id=
"activityRule"
class=
"form-control"
style=
"min-height: 160px;"
></textarea>
<textarea
id=
"activityRule"
class=
"form-control"
style=
"min-height: 160px;"
></textarea>
</div>
</div>
<div
class=
"describe"
>
<span
class=
"labelName"
>
<i
class=
"required"
>
*
</i>
概率公示:
</span>
<textarea
id=
"probabilityPublicity"
class=
"form-control"
style=
"min-height: 160px;"
></textarea>
</div>
<div
class=
"sendTime"
>
<div
class=
"sendTime"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
是否上线:
</span>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
是否上线:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
...
@@ -194,12 +113,31 @@
...
@@ -194,12 +113,31 @@
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
确 定
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
确 定
</button>
</div>
</div>
</div>
</div>
</form>
<div
id=
"detailsFormList"
class=
"details-form-list"
>
<!--奖品详情-->
<div
class=
"details-pop-inner"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"addCoupon()"
>
添加
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"closeCoupon()"
>
关闭窗口
</button>
<div
class=
"scoreTable"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12 select-table table-striped"
>
<table
id=
"details-table"
></table>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</form
>
<th:block
th:include=
"include :: footer"
/
>
<th:block
th:include=
"include :: footer"
/
>
<script
th:src=
"@{/js/jquery.tmpl.js}"
></script
>
<script
th:src=
"@{/js/jquery.tmpl.js}"
></script
>
<th:block
th:include=
"include :: bootstrap-fileinput-js"
/
>
<th:block
th:include=
"include :: bootstrap-fileinput-js"
/>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
platformUrl
=
`[[
${
platformUrl
}
]]`
var
platformUrl
=
`[[
${
platformUrl
}
]]`
var
prefix
=
ctx
+
"sweet/sweetIntegralActivity"
;
var
prefix
=
ctx
+
"sweet/sweetIntegralActivity"
;
let
showIndex
=
null
;
let
showIndex
=
null
;
...
@@ -218,6 +156,7 @@
...
@@ -218,6 +156,7 @@
let
itemId
=
''
;
let
itemId
=
''
;
let
activitySize
=
false
;
let
activitySize
=
false
;
var
options
=
{
var
options
=
{
id
:
"bootstrap-table"
,
data
:
data
,
data
:
data
,
pagination
:
false
,
pagination
:
false
,
showSearch
:
false
,
showSearch
:
false
,
...
@@ -284,7 +223,7 @@
...
@@ -284,7 +223,7 @@
align
:
'center'
,
align
:
'center'
,
title
:
'奖品类型'
,
title
:
'奖品类型'
,
formatter
:
function
(
value
,
row
,
index
)
{
formatter
:
function
(
value
,
row
,
index
)
{
let
arr
=
[
'谢谢惠顾'
,
'积分'
,
'代金券'
,
'满减券'
,
'优先购买'
,
'实物
'
];
let
arr
=
[
'积分'
,
'优惠券'
,
'实物'
,
'登登登VIP
'
];
let
str
=
''
;
let
str
=
''
;
arr
.
forEach
((
item
,
i
)
=>
{
arr
.
forEach
((
item
,
i
)
=>
{
i
++
i
++
...
@@ -300,6 +239,21 @@
...
@@ -300,6 +239,21 @@
return
dom
;
return
dom
;
}
}
},
},
{
field
:
'prizeTypeNum'
,
align
:
'center'
,
title
:
'奖励积分数量'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeTypeNum
&&
(
data
[
index
].
prizeType
===
1
))
{
str
=
`<input id='prizeTypeNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeTypeNum
}
'>`
}
else
{
str
=
`<input id='prizeTypeNum
${
index
}
' class='form-control' type='text' name='' value=''>`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
{
field
:
'winningProbability'
,
field
:
'winningProbability'
,
align
:
'center'
,
align
:
'center'
,
...
@@ -331,20 +285,35 @@
...
@@ -331,20 +285,35 @@
}
}
},
},
{
{
field
:
'winnersNum
'
,
field
:
'prizeDescribe
'
,
align
:
'center'
,
align
:
'center'
,
title
:
'中奖人数
'
,
title
:
'奖品描述
'
,
formatter
:
function
(
value
,
row
,
index
)
{
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
let
str
=
''
;
if
(
data
[
index
].
winners
Num
)
{
if
(
data
[
index
].
prize
Num
)
{
str
=
`<input id='winnersNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
winnersNum
}
'>`
str
=
`<input id='prizeDescribe
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeDescribe
}
'>`
}
else
{
}
else
{
str
=
`<input id='winnersNum
${
index
}
' class='form-control' type='text' name='' value=''>`
str
=
`<input id='prizeDescribe
${
index
}
' class='form-control' type='text' name='' value=''>`
}
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
return
html
;
}
}
},
},
// {
// field: 'winnersNum',
// align: 'center',
// title: '中奖人数',
// formatter: function(value, row, index) {
// let str = '';
// if (data[index].winnersNum) {
// str = `
<
input
id
=
'winnersNum${index}'
class
=
'form-control'
type
=
'text'
name
=
''
value
=
'${data[index].winnersNum}'
>
`
// } else {
// str = `
<
input
id
=
'winnersNum${index}'
class
=
'form-control'
type
=
'text'
name
=
''
value
=
''
>
`
// }
// var html = $.common.sprintf(str, index, value);
// return html;
// }
// },
{
{
field: 'winPrizeNum',
field: 'winPrizeNum',
align: 'center',
align: 'center',
...
@@ -361,30 +330,78 @@
...
@@ -361,30 +330,78 @@
return '0'
return '0'
}
}
}
}
},
{
field: '',
align: 'center',
title: '操作',
formatter: function(value, row, index) {
let str = '';
if (data[index].prizeTitle) {
str = `
<
button
type
=
"button"
class
=
"btn btn-primary"
onclick
=
"showList(` + index + `)"
>
查看列表
<
/button>
`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
}
}
]
]
};
};
layui
.
use
(
'laydate'
,
function
(){
var
nowList
=
[];
// 当前编辑的奖品详情列表
var
laydate
=
layui
.
laydate
;
var
detailsOptions
=
{
//执行一个laydate实例
id
:
"details-table"
,
laydate
.
render
({
data
:
nowList
,
elem
:
'#startTime'
,
//指定元素
pagination
:
false
,
type
:
'datetime'
showSearch
:
false
,
});
showRefresh
:
false
,
laydate
.
render
({
showToggle
:
false
,
elem
:
'#endTime'
,
//指定元素
showColumns
:
false
,
type
:
'datetime'
sidePagination
:
"client"
,
});
columns
:
[
});
{
$
(
"#ActivityName"
).
blur
(
function
(
e
)
{
field
:
'index'
,
if
(
e
.
target
.
value
.
length
>
20
)
{
align
:
'center'
,
activitySize
=
true
;
title
:
"序号"
,
layer
.
msg
(
'活动名称限制在20个字符以内!'
)
formatter
:
function
(
value
,
row
,
index
)
{
return
return
index
+
1
;
}
},{
field
:
'index'
,
align
:
'center'
,
title
:
"序号"
,
formatter
:
function
(
value
,
row
,
index
)
{
return
index
+
1
;
}
},
{
field
:
'prizeTitle'
,
align
:
'center'
,
title
:
'奖品名称'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeTitle
)
{
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value='"
+
data
[
index
].
prizeTitle
+
"'>"
}
else
{
}
else
{
activitySize
=
false
;
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value=''>"
}
}
})
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
''
,
align
:
'center'
,
title
:
'操作'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
str
=
`<button type="button" class="btn btn-primary" onclick="deleteCoupon(`
+
index
+
`)">删除</button>`
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
}
]
};
$
(
function
()
{
$
(
function
()
{
itemId
=
getUrlParms
(
'id'
)
itemId
=
getUrlParms
(
'id'
)
function
getUrlParms
(
name
){
function
getUrlParms
(
name
){
...
@@ -407,6 +424,8 @@
...
@@ -407,6 +424,8 @@
$
(
"#integral"
).
val
(
res
.
activityNum
);
$
(
"#integral"
).
val
(
res
.
activityNum
);
$
(
"#activityRule"
).
val
(
res
.
activityRules
);
$
(
"#activityRule"
).
val
(
res
.
activityRules
);
$
(
"#ActivityName"
).
val
(
res
.
activityTitle
);
$
(
"#ActivityName"
).
val
(
res
.
activityTitle
);
$
(
"#estimatedNum"
).
val
(
res
.
estimatedNum
);
$
(
"#probabilityPublicity"
).
val
(
res
.
probabilityPublicity
);
// activityType: 1,
// activityType: 1,
courierType
=
res
.
expressFeeType
;
courierType
=
res
.
expressFeeType
;
if
(
courierType
==
2
)
{
if
(
courierType
==
2
)
{
...
@@ -417,7 +436,6 @@
...
@@ -417,7 +436,6 @@
if
(
online
==
2
)
{
if
(
online
==
2
)
{
$
(
"input[name='online'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
$
(
"input[name='online'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
}
}
// prizeList: data,
timeType
=
res
.
timeType
;
timeType
=
res
.
timeType
;
if
(
timeType
==
2
)
{
if
(
timeType
==
2
)
{
...
@@ -441,10 +459,11 @@
...
@@ -441,10 +459,11 @@
prizeTitle
:
""
,
prizeTitle
:
""
,
prizeImgInit
:
""
,
prizeImgInit
:
""
,
prizeImgSelect
:
""
,
prizeImgSelect
:
""
,
winnersNum
:
""
,
winPrizeNum
:
""
,
winPrizeNum
:
""
,
prizeType
:
""
,
prizeType
:
""
,
prizeTypeNum
:
""
,
winningProbability
:
""
,
winningProbability
:
""
,
prizeDescribe
:
""
,
residue
:
""
,
residue
:
""
,
prizeNum
:
""
prizeNum
:
""
};
};
...
@@ -452,10 +471,32 @@
...
@@ -452,10 +471,32 @@
data
.
push
(
obj
)
data
.
push
(
obj
)
}
}
$
.
table
.
init
(
options
);
$
.
table
.
init
(
options
);
console
.
log
(
$
.
table
);
}
}
});
});
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#startTime'
,
//指定元素
type
:
'datetime'
});
laydate
.
render
({
elem
:
'#endTime'
,
//指定元素
type
:
'datetime'
});
});
$
(
"#ActivityName"
).
blur
(
function
(
e
)
{
if
(
e
.
target
.
value
.
length
>
20
)
{
activitySize
=
true
;
layer
.
msg
(
'活动名称限制在20个字符以内!'
)
return
}
else
{
activitySize
=
false
;
}
})
$
(
"input[name=sendType]"
).
change
((
e
)
=>
{
$
(
"input[name=sendType]"
).
change
((
e
)
=>
{
timeType
=
e
.
target
.
value
;
timeType
=
e
.
target
.
value
;
if
(
timeType
==
1
)
{
if
(
timeType
==
1
)
{
...
@@ -544,7 +585,15 @@
...
@@ -544,7 +585,15 @@
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
)
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
)
})
})
function
create
()
{
function
create
()
{
if
(
!
$
(
"#ActivityName"
).
val
()
||
!
$
(
"#ActivityType"
).
val
()
||
!
showPicture
||
!
$
(
"#integral"
).
val
()
||
!
$
(
"#activityRule"
).
val
()
||
!
$
(
"#viewImg"
).
attr
(
'src'
))
{
if
(
!
$
(
"#ActivityName"
).
val
()
||
!
$
(
"#ActivityType"
).
val
()
||
!
showPicture
||
!
$
(
"#integral"
).
val
()
||
!
$
(
"#activityRule"
).
val
()
||
!
$
(
"#viewImg"
).
attr
(
'src'
)
||
!
$
(
"#estimatedNum"
).
val
()
||
!
$
(
"#probabilityPublicity"
).
val
()
)
{
return
layer
.
msg
(
'请将必填信息填写完整!'
)
return
layer
.
msg
(
'请将必填信息填写完整!'
)
}
}
if
(
timeType
==
2
)
{
if
(
timeType
==
2
)
{
...
@@ -560,23 +609,44 @@
...
@@ -560,23 +609,44 @@
return
return
}
}
let
flag
=
false
;
let
flag
=
false
;
let
prizeListArr
=
[]
data
=
data
.
map
((
item
,
index
)
=>
{
data
=
data
.
map
((
item
,
index
)
=>
{
if
(
!
$
(
"#prizeTitle"
+
index
).
val
()
||!
$
(
"#showPic"
+
index
).
attr
(
'src'
)
||!
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
)
||!
$
(
"#winnersNum"
+
index
).
val
()
||!
$
(
"#prizeType"
+
index
).
val
()
||!
$
(
"#winningProbability"
+
index
).
val
()
||!
$
(
"#prizeNum"
+
index
).
val
())
{
let
temp
=
{};
if
(
!
$
(
"#prizeTitle"
+
index
).
val
()
||
!
$
(
"#showPic"
+
index
).
attr
(
'src'
)
||
!
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
)
||
!
$
(
"#prizeType"
+
index
).
val
()
||
!
$
(
"#winningProbability"
+
index
).
val
()
||
!
$
(
"#prizeNum"
+
index
).
val
()
||
!
$
(
"#prizeDescribe"
+
index
).
val
()
)
{
flag
=
true
flag
=
true
}
else
{
}
else
{
item
.
prizeTitle
=
$
(
"#prizeTitle"
+
index
).
val
();
temp
.
prizeTitle
=
$
(
"#prizeTitle"
+
index
).
val
();
item
.
prizeImgInit
=
$
(
"#showPic"
+
index
).
attr
(
'src'
);
temp
.
prizeImgInit
=
$
(
"#showPic"
+
index
).
attr
(
'src'
);
item
.
prizeImgSelect
=
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
);
temp
.
prizeImgSelect
=
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
);
item
.
winnersNum
=
$
(
"#winnersNum"
+
index
).
val
();
temp
.
prizeType
=
$
(
"#prizeType"
+
index
).
val
();
item
.
prizeType
=
$
(
"#prizeType"
+
index
).
val
();
temp
.
prizeTypeNum
=
temp
.
prizeType
==
'1'
?
$
(
"#prizeTypeNum"
+
index
).
val
()
:
0
;
item
.
winningProbability
=
$
(
"#winningProbability"
+
index
).
val
();
temp
.
prizeNum
=
$
(
"#prizeNum"
+
index
).
val
();
item
.
prizeNum
=
$
(
"#prizeNum"
+
index
).
val
();
temp
.
winningProbability
=
$
(
"#winningProbability"
+
index
).
val
();
}
temp
.
prizeDescribe
=
$
(
"#prizeDescribe"
+
index
).
val
();
return
{...
item
};
}
// TODO
temp
.
prizeTitle
=
'名称'
;
temp
.
prizeImgInit
=
"https://img.zhengzai.tv/other/2021/12/03/9b70f3c310f0452bb4544f9d7d5f482e.png"
;
temp
.
prizeImgSelect
=
"https://img.zhengzai.tv/other/2021/12/03/9b70f3c310f0452bb4544f9d7d5f482e.png"
;
temp
.
prizeType
=
$
(
"#prizeType"
+
index
).
val
();
temp
.
winningProbability
=
1
;
temp
.
prizeNum
=
1
;
temp
.
prizeTypeNum
=
temp
.
prizeType
==
'1'
?
1
:
0
;
temp
.
prizeDescribe
=
"描述"
;
prizeListArr
.
push
(
temp
);
// return {...item};
})
})
if
(
flag
)
{
//
if (flag) {
return
layer
.
msg
(
'请将表格内容填写完整!'
)
//
return layer.msg('请将表格内容填写完整!')
}
//
}
let
datas
=
{
let
datas
=
{
activityImg
:
showPicture
,
activityImg
:
showPicture
,
activityNum
:
$
(
"#integral"
).
val
(),
activityNum
:
$
(
"#integral"
).
val
(),
...
@@ -587,10 +657,14 @@
...
@@ -587,10 +657,14 @@
integralActivityId
:
itemId
||
''
,
integralActivityId
:
itemId
||
''
,
endTime
:
$
.
common
.
dateFormat
(
$
(
"#endTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
)
,
//
endTime
:
$
.
common
.
dateFormat
(
$
(
"#endTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
)
,
//
isOnline
:
online
,
isOnline
:
online
,
prizeList
:
data
,
prizeList
:
prizeListArr
,
startTime
:
$
.
common
.
dateFormat
(
$
(
"#startTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
),
startTime
:
$
.
common
.
dateFormat
(
$
(
"#startTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
),
timeType
:
timeType
timeType
:
timeType
,
estimatedNum
:
$
(
"#estimatedNum"
).
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
)
{
...
@@ -614,7 +688,140 @@
...
@@ -614,7 +688,140 @@
}
}
})
})
}
}
function
showList
(
index
)
{
console
.
log
(
index
);
data
[
index
].
prizeId
;
$
(
"#detailsFormList"
).
show
();
// 拿列表数据
$
.
table
.
init
(
detailsOptions
);
}
function
addCoupon
()
{
console
.
log
(
'添加优惠券==='
);
nowList
.
push
({
id
:
1
,
name
:
'hello'
});
// 添加数据
}
function
deleteCoupon
(
index
)
{
console
.
log
(
'删除优惠券==='
);
}
function
closeCoupon
()
{
$
(
"#detailsFormList"
).
hide
();
}
</script>
<style>
.layui-form
{
padding
:
20px
;
}
.main_type
,
.money
,
.scope_application
,
.sendType
,
.phoneNumber
,
.playMethod
{
margin-bottom
:
20px
;
}
.phoneNumber
,
.playMethod
{
display
:
none
;
}
.labelName
{
display
:
inline-block
;
width
:
100px
;
text-align
:
right
;
}
input
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
padding-left
:
5px
;
height
:
30px
;
}
.main_type
.form-control.kv-fileinput-caption
{
height
:
42px
!important
;
}
.prompt
{
margin-left
:
100px
!important
;
}
.main_type
input
,
.sendType
input
,
.playMethod
input
{
margin-top
:
-2px
;
margin-right
:
5px
;
}
.main_type
span
,
.sendType
span
,
.playMethod
span
{
margin-right
:
12px
;
line-height
:
28px
;
}
.layui-form
.money
input
{
width
:
60px
;
}
.main_bottom
.describe
,
.main_bottom
.sendTime
{
margin-bottom
:
20px
;
}
.describe
,
.main_type
{
display
:
flex
;
}
.sendTime
{
display
:
flex
;
}
.sendTime
input
{
margin-top
:
-6px
;
margin-right
:
5px
;
}
.bottom_btn
{
width
:
25%
;
text-align
:
center
;
}
select
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
height
:
30px
;
width
:
200px
;
}
.required
{
font-style
:
normal
;
color
:
red
;
}
.ibox-content
{
border-style
:
none
;
border-width
:
0px
;
}
.main_type
.file-footer-buttons
.kv-file-remove
{
display
:
none
!important
;
}
.selectScore
{
display
:
flex
;
align-items
:
center
;
}
.selectScore
p
{
margin
:
0
;
}
.selectScore
button
{
margin
:
0
12px
;
}
.selectScore
span
{
color
:
#ccc
;
}
.scoreTable
{
margin-bottom
:
12px
;
}
.details-form-list
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
.5
);
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.details-pop-inner
{
width
:
800px
;
height
:
800px
;
padding
:
10px
;
background
:
#fff
;
}
</style>
</script>
</body>
</html>
</html>
\ No newline at end of file
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