记得上下班打卡 | 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
4d0165ef
Commit
4d0165ef
authored
Oct 28, 2021
by
dongchun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
转盘页面相关功能
parent
01cbbb25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
150 additions
and
100 deletions
+150
-100
form.html
...urces/templates/zhengzai/sweet/integralActivity/form.html
+124
-97
list.html
...urces/templates/zhengzai/sweet/integralActivity/list.html
+26
-3
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/sweet/integralActivity/form.html
View file @
4d0165ef
...
...
@@ -150,12 +150,12 @@
<div
style=
"display: flex;align-items: center;"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
活动时间:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"
0
"
name=
"sendType"
checked
><span>
长期
</span>
<input
type=
"radio"
value=
"
1
"
name=
"sendType"
><span>
选择开始结束时间
</span>
<input
type=
"radio"
value=
"
1
"
name=
"sendType"
checked
><span>
长期
</span>
<input
type=
"radio"
value=
"
2
"
name=
"sendType"
><span>
选择开始结束时间
</span>
<div
class=
"selectTime"
>
<input
type=
"text"
class=
"layui-input"
id=
"startTime"
placeholder=
"请选择起始时间"
>
<input
type=
"text"
class=
"layui-input"
id=
"startTime"
autocomplete=
"off"
placeholder=
"请选择起始时间"
>
<span>
~
</span>
<input
type=
"text"
class=
"layui-input"
id=
"endTime"
placeholder=
"请选择结束时间"
>
<input
type=
"text"
class=
"layui-input"
id=
"endTime"
autocomplete=
"off"
placeholder=
"请选择结束时间"
>
</div>
</div>
</div>
...
...
@@ -186,17 +186,17 @@
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
是否上线:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
name=
"online"
value=
"1"
checked
><span>
未上线
</span>
<input
type=
"radio"
name=
"online"
value=
"2"
><span>
已上线
</span>
<input
type=
"radio"
name=
"online"
value=
"2"
style=
"margin-left: 12px;"
><span>
已上线
</span>
</div>
</div>
<div
class=
"sendTime"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
快递费用:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
name=
"sex"
value=
"1"
checked
><span>
包邮
</span>
<input
type=
"radio"
name=
"sex"
value=
"2"
><span>
到付
</span>
<span
style=
"margin-right:12px;"
><p>
输入金额
</p></span>
<input
type=
"radio"
name=
"sex"
value=
"2"
style=
"margin-left: 12px;"
><span>
到付
</span>
</div>
<input
type=
"text"
id=
"courierMoney"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"请输入金额"
>
<!-- <span style="margin-right:12px;"><p>输入金额</p></span>
<input type="text" id="courierMoney" autocomplete="off" class="layui-input" placeholder="请输入金额"> -->
</div>
<div
class=
"bottom_btn"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
...
...
@@ -223,6 +223,8 @@
let
courierMoney
=
''
;
// 快递费用
let
showPicture
=
''
;
// banner
let
online
=
'1'
;
// 是否上线
let
itemId
=
''
;
let
activitySize
=
false
;
var
options
=
{
data
:
data
,
pagination
:
false
,
...
...
@@ -247,7 +249,7 @@
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
].
nam
e
+
"'>"
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value='"
+
data
[
index
].
prizeTitl
e
+
"'>"
}
else
{
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value=''>"
}
...
...
@@ -336,7 +338,7 @@
}
},
{
field
:
'
send
'
,
field
:
'
WinPrizeNum
'
,
align
:
'center'
,
title
:
'已发出'
,
formatter
:
function
(
value
,
row
,
index
)
{
...
...
@@ -352,8 +354,8 @@
align
:
'center'
,
title
:
'奖品剩余'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
)
{
return
value
if
(
itemId
)
{
return
row
.
prizeNum
-
row
.
WinPrizeNum
}
else
{
return
'-'
}
...
...
@@ -361,24 +363,99 @@
}
]
};
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
;
}
})
$
(
function
()
{
let
obj
=
{
prizeTitle
:
""
,
prizeImg
:
""
,
winnersNum
:
""
,
send
:
""
,
prizeType
:
""
,
winningProbability
:
""
,
residue
:
""
,
prizeNum
:
""
};
for
(
var
i
=
0
;
i
<
12
;
i
++
)
{
data
.
push
(
obj
)
}
$
.
table
.
init
(
options
);
itemId
=
getUrlParms
(
'id'
)
function
getUrlParms
(
name
){
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
if
(
itemId
)
{
$
.
ajax
({
type
:
'get'
,
url
:
'/sweet/integralActivity/details'
,
data
:
{
integralActivityId
:
itemId
},
success
:
function
(
e
)
{
if
(
e
.
code
==
0
)
{
let
res
=
e
.
data
;
showPicture
=
res
.
activityImg
;
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
);
$
(
"#integral"
).
val
(
res
.
activityNum
);
$
(
"#activityRule"
).
val
(
res
.
activityRules
);
$
(
"#ActivityName"
).
val
(
res
.
activityTitle
);
// activityType: 1,
courierType
=
res
.
expressFeeType
;
if
(
courierType
==
2
)
{
$
(
"input[name='sex'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
}
integralActivityId
=
res
.
integralActivityId
;
$
(
"#endTime"
).
val
(
$
.
common
.
dateFormat
(
res
.
endTime
,
'yyyy-MM-dd HH:mm:ss'
));
online
=
res
.
isOnline
;
if
(
online
==
2
)
{
$
(
"input[name='online'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
}
// prizeList: data,
$
(
"#startTime"
).
val
(
$
.
common
.
dateFormat
(
res
.
startTime
,
'yyyy-MM-dd HH:mm:ss'
));
timeType
=
timeType
;
if
(
timeType
==
2
)
{
$
(
"input[name='sendType'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
}
data
=
[...
res
.
prizeList
]
options
.
data
=
data
;
setTimeout
(()
=>
{
$
.
table
.
init
(
options
);
},
500
)
}
}
})
}
else
{
let
obj
=
{
prizeTitle
:
""
,
prizeImg
:
""
,
winnersNum
:
""
,
WinPrizeNum
:
""
,
prizeType
:
""
,
winningProbability
:
""
,
residue
:
""
,
prizeNum
:
""
};
for
(
var
i
=
0
;
i
<
12
;
i
++
)
{
data
.
push
(
obj
)
}
$
.
table
.
init
(
options
);
}
});
$
(
"input[name=sendType]"
).
change
((
e
)
=>
{
timeType
=
e
.
target
.
value
;
if
(
timeType
==
1
)
{
$
(
"#endTime"
).
val
(
""
);
$
(
"#startTime"
).
val
(
""
);
}
})
$
(
"input[name=sex]"
).
change
((
e
)
=>
{
courierType
=
e
.
target
.
value
;
...
...
@@ -386,47 +463,11 @@
$
(
"input[name=online]"
).
change
((
e
)
=>
{
online
=
e
.
target
.
value
;
})
function
addColumn
()
{
if
(
data
.
length
>=
6
)
{
return
layer
.
msg
(
'最多可上传6个商品!'
)
}
if
(
data
.
length
>
0
)
{
data
=
data
.
map
((
item
,
index
)
=>
{
item
.
name
=
$
(
'#prizeTitle'
+
index
).
val
()
item
.
winnersNum
=
$
(
'#winnersNum'
+
index
).
val
()
item
.
send
=
$
(
'#send'
+
index
).
val
()
item
.
type
=
$
(
'#prizeType'
+
index
).
val
()
item
.
winningProbability
=
$
(
'#winningProbability'
+
index
).
val
()
item
.
residue
=
$
(
'#residue'
+
index
).
val
()
item
.
prizeNum
=
$
(
'#prizeNum'
+
index
).
val
()
return
item
})
}
console
.
log
(
data
,
'data'
)
var
row
=
{
prizeTitle
:
""
,
prizeImg
:
""
,
winnersNum
:
""
,
send
:
""
,
type
:
""
,
winningProbability
:
""
,
residue
:
""
,
prizeNum
:
""
}
data
.
push
(
row
)
row
.
prizeImg
=
'https://img.zhengzai.tv/other/2021/10/26/17bf7fdea070448aa28d6e86506e4f6d.png'
;
$
(
"#"
+
table
.
options
.
id
).
bootstrapTable
(
'insertRow'
,
{
index
:
data
.
length
,
// 你想插入到哪,0表示第一行
row
:
row
})
console
.
log
(
data
)
}
function
upFile
(
e
)
{
showIndex
=
e
;
$
(
"#ceshi"
).
click
();
}
$
(
"#ceshi"
).
change
((
e
)
=>
{
console
.
log
(
e
)
if
(
!
e
.
target
.
files
[
0
])
{
return
}
...
...
@@ -441,9 +482,7 @@
type
:
'POST'
,
success
:
function
(
res
)
{
$
(
"#showPic"
+
showIndex
).
attr
(
'src'
,
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
)
console
.
log
(
res
,
res
.
data
.
ossPath
,
showIndex
,
data
[
showIndex
],
'????1'
)
data
[
showIndex
].
prizeImg
=
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
;
console
.
log
(
res
,
res
.
data
.
ossPath
,
'????2'
)
// $summernote.summernote('insertImage', 'https://img.zhengzai.tv/' + data.data.ossPath)
}
});
...
...
@@ -473,39 +512,22 @@
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
)
})
function
create
()
{
/**
* let activityType = ''; // 活动类型
let timeType = ''; // 活动时间类型
let startTime = ''; // 开始时间
let endTime = ''; // 结束时间
let activityRule = ''; // 活动规则
let courierType = ''; // 快递类型
let courierMoney = ''; // 快递费用
*
*
* {
prizeTitle: "",
prizeImg: "",
winnersNum: "",
send: "",
prizeType: "",
winningProbability: "",
residue: "",
prizeNum: ""
},
* **/
console
.
log
(
!
$
(
"#ActivityName"
).
val
(),
!
$
(
"#ActivityType"
).
val
(),
!
$
(
"#courierMoney"
).
val
(),
!
showPicture
,
!
$
(
"#integral"
).
val
(),
!
$
(
"#activityRule"
).
val
(),
$
(
"#viewImg"
).
attr
(
'src'
))
if
(
!
$
(
"#ActivityName"
).
val
()
||
!
$
(
"#ActivityType"
).
val
()
||
!
$
(
"#courierMoney"
).
val
()
||
!
showPicture
||
!
$
(
"#integral"
).
val
()
||
!
$
(
"#activityRule"
).
val
()
||
!
$
(
"#viewImg"
).
attr
(
'src'
))
{
if
(
!
$
(
"#ActivityName"
).
val
()
||
!
$
(
"#ActivityType"
).
val
()
||
!
showPicture
||
!
$
(
"#integral"
).
val
()
||
!
$
(
"#activityRule"
).
val
()
||
!
$
(
"#viewImg"
).
attr
(
'src'
))
{
return
layer
.
msg
(
'请将必填信息填写完整!'
)
}
if
(
timeType
==
2
)
{
console
.
log
(
timeType
,
'?????'
)
if
(
!
$
(
"#startTime"
).
val
()
||
!
$
(
"#endTIme"
).
val
())
{
if
(
!
$
(
"#startTime"
).
val
()
||
!
$
(
"#endTime"
).
val
())
{
return
layer
.
msg
(
'请选择时间!'
)
}
}
else
{
$
(
"#startTime"
).
val
(
""
)
$
(
"#endTime"
).
val
(
""
)
}
if
(
activitySize
)
{
layer
.
msg
(
"活动名称限制在20个字符以内!"
)
return
}
let
flag
=
false
;
console
.
log
(
$
(
"#prizeTitle"
+
1
).
val
())
data
=
data
.
map
((
item
,
index
)
=>
{
if
(
!
$
(
"#prizeTitle"
+
index
).
val
()
||!
$
(
"#showPic"
+
index
).
attr
(
'src'
)
||!
$
(
"#winnersNum"
+
index
).
val
()
||!
$
(
"#prizeType"
+
index
).
val
()
||!
$
(
"#winningProbability"
+
index
).
val
()
||!
$
(
"#prizeNum"
+
index
).
val
())
{
flag
=
true
...
...
@@ -517,7 +539,7 @@
item
.
winningProbability
=
$
(
"#winningProbability"
+
index
).
val
();
item
.
prizeNum
=
$
(
"#prizeNum"
+
index
).
val
();
}
return
item
;
return
{...
item
}
;
})
if
(
flag
)
{
return
layer
.
msg
(
'请将表格内容填写完整!'
)
...
...
@@ -529,16 +551,22 @@
activityTitle
:
$
(
"#ActivityName"
).
val
(),
activityType
:
1
,
expressFeeType
:
courierType
,
integralActivityId
:
''
,
endTime
:
$
(
"#endTime"
).
val
(),
integralActivityId
:
itemId
||
''
,
endTime
:
$
.
common
.
dateFormat
(
$
(
"#endTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
)
,
//
isOnline
:
online
,
prizeList
:
data
,
startTime
:
$
(
"#startTime"
).
val
(
),
startTime
:
$
.
common
.
dateFormat
(
$
(
"#startTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
),
timeType
:
timeType
}
let
url
=
'/sweet/integralActivity/create'
;
let
type
=
'post'
;
if
(
itemId
)
{
url
=
'/sweet/integralActivity/update'
type
=
'put'
}
$
.
ajax
({
type
:
'post'
,
url
:
'/sweet/integralActivity/create'
,
type
,
url
,
contentType
:
"application/json;charset=UTF-8"
,
data
:
JSON
.
stringify
(
datas
),
success
:
function
(
res
)
{
...
...
@@ -552,7 +580,6 @@
}
}
})
console
.
log
(
data
,
$
(
"#"
+
table
.
options
.
id
).
bootstrapTable
(
'getData'
),
$
(
"#type0"
).
val
(),
'???'
)
}
</script>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/sweet/integralActivity/list.html
View file @
4d0165ef
...
...
@@ -124,8 +124,8 @@
formatter
:
function
(
value
,
row
,
index
)
{
var
actions
=
[];
actions
.
push
(
'<a class="btn btn-success btn-xs '
+
drawListFlag
+
'" href="javascript:void(0)" onclick="$.operate.detailTab(
\'
'
+
row
.
integralActivityId
+
'
\'
)"><i class="fa fa-edit"></i>查看中奖名单</a> '
);
actions
.
push
(
'<a class="btn btn-success btn-xs '
+
updateFlag
+
'" href="javascript:void(0)" onclick="$.operate.edit(
\'
'
+
row
.
integralActivityId
+
'
\'
)"></i>编辑</a> '
);
actions
.
push
(
'<a class="btn btn-danger btn-xs '
+
isOnlineFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
integralActivityId
+
'
\'
)"></i>上下线</a> '
);
actions
.
push
(
'<a class="btn btn-success btn-xs '
+
updateFlag
+
'" href="javascript:void(0)" onclick="$.operate.edit
Tab
(
\'
'
+
row
.
integralActivityId
+
'
\'
)"></i>编辑</a> '
);
actions
.
push
(
`<a class="btn btn-danger btn-xs
${
isOnlineFlag
}
" href="javascript:void(0)" onclick="openModal('
${
row
.
integralActivityId
}
','
${
row
.
isOnline
}
')"></i>上下线</a>`
);
actions
.
push
(
'<a class="btn btn-warning btn-xs '
+
exportExcelFlag
+
'" href="javascript:void(0)" onclick="exportExcel(
\'
'
+
row
.
integralActivityId
+
'
\'
)"></i>导出中奖信息</a> '
);
return
actions
.
join
(
''
);
}
...
...
@@ -133,8 +133,31 @@
};
$
.
table
.
init
(
options
);
});
function
openModal
(
id
,
data
)
{
console
.
log
(
id
,
data
,
'dhsa'
)
let
title
=
''
;
let
lineId
=
null
;
if
(
data
==
1
)
{
title
=
'上线'
;
lineId
=
2
}
else
{
title
=
'下线'
;
lineId
=
1
}
$
.
modal
.
confirm
(
`确定要
${
title
}
此活动吗`
,
function
()
{
$
.
ajax
({
type
:
'put'
,
url
:
'/sweet/integralActivity/isOnline'
,
data
:
{
integralActivityId
:
id
,
isOnline
:
lineId
},
success
:
function
(
e
)
{
console
.
log
(
e
)
$
(
"button[name=refresh]"
).
click
();
}
})
});
}
</script>
</body>
</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