Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
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 9a6d32ac
authored
Oct 14, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改有效期
1 parent
d8a7f302
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
14 deletions
html/merchant/index.html
html/merchant/validPeriodForm.html
html/merchant/index.html
View file @
9a6d32a
...
@@ -504,7 +504,7 @@
...
@@ -504,7 +504,7 @@
// console.log(row)
// console.log(row)
var
area
=
[
'500px'
,
'180px'
]
var
area
=
[
'500px'
,
'180px'
]
if
(
row
.
merchantAccountLevel
==
4
)
{
if
(
row
.
merchantAccountLevel
==
4
)
{
area
=
[
'
900px'
,
'48
0px'
]
area
=
[
'
700px'
,
'45
0px'
]
}
}
layer
.
open
({
layer
.
open
({
type
:
2
,
type
:
2
,
...
@@ -514,7 +514,7 @@
...
@@ -514,7 +514,7 @@
fixed
:
false
,
//不固定
fixed
:
false
,
//不固定
// maxmin: true,
// maxmin: true,
btn
:
[
'确定'
,
'取消'
],
btn
:
[
'确定'
,
'取消'
],
content
:
'validPeriodForm.html?id='
+
row
.
id
+
'&effective
Time='
+
row
.
effectiveTim
e
+
'&status='
+
row
.
status
+
'&merchantAccountLevel='
+
row
.
merchantAccountLevel
,
content
:
'validPeriodForm.html?id='
+
row
.
id
+
'&effective
Starttime='
+
row
.
effectiveStarttime
+
'&expireDate='
+
row
.
expireDat
e
+
'&status='
+
row
.
status
+
'&merchantAccountLevel='
+
row
.
merchantAccountLevel
,
yes
:
function
(
index
,
layero
)
{
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
)
var
body
=
layer
.
getChildFrame
(
'body'
,
index
)
helper
.
store
.
set
(
'isRefresh'
,
false
)
helper
.
store
.
set
(
'isRefresh'
,
false
)
...
...
html/merchant/validPeriodForm.html
View file @
9a6d32a
...
@@ -52,9 +52,11 @@
...
@@ -52,9 +52,11 @@
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"expireDate"
class=
"layui-input"
name=
"expireDate"
placeholder=
"结束时间"
/>
<input
type=
"text"
id=
"expireDate"
class=
"layui-input"
name=
"expireDate"
placeholder=
"结束时间"
/>
</div>
</div>
<button
id=
"sevenday"
type=
"button"
class=
"layui-btn btn-no-border"
>
续7天
</button>
</div>
<button
id=
"oneyear"
type=
"button"
class=
"layui-btn btn-no-border"
>
续1年
</button>
<div>
<button
id=
"twoyears"
type=
"button"
class=
"layui-btn btn-no-border"
>
续2年
</button>
<button
id=
"sevenday"
type=
"button"
class=
"layui-btn btn-no-border"
>
续7天
</button>
<button
id=
"oneyear"
type=
"button"
class=
"layui-btn btn-no-border"
>
续1年
</button>
<button
id=
"twoyears"
type=
"button"
class=
"layui-btn btn-no-border"
>
续2年
</button>
</div>
</div>
</div>
</div>
</form>
</form>
...
@@ -78,6 +80,13 @@
...
@@ -78,6 +80,13 @@
if
(
merchantAccountLevel
==
4
)
{
if
(
merchantAccountLevel
==
4
)
{
$
(
'#storeEl'
).
show
()
$
(
'#storeEl'
).
show
()
$
(
'#merchantEl'
).
hide
()
$
(
'#merchantEl'
).
hide
()
vaildData
.
expireDate
=
getQueryString
(
'expireDate'
)
vaildData
.
effectiveStarttime
=
getQueryString
(
'effectiveStarttime'
)
console
.
log
(
vaildData
,
getQueryString
(
'expireDate'
))
form
.
val
(
'periodFilter'
,
{
expireDate
:
getQueryString
(
'expireDate'
),
effectiveStarttime
:
getQueryString
(
'effectiveStarttime'
)
})
}
else
{
}
else
{
$
(
'#merchantEl'
).
show
()
$
(
'#merchantEl'
).
show
()
$
(
'#storeEl'
).
hide
()
$
(
'#storeEl'
).
hide
()
...
@@ -106,34 +115,38 @@
...
@@ -106,34 +115,38 @@
})
})
$
(
'#sevenday'
).
on
(
'click'
,
function
()
{
$
(
'#sevenday'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
*
1
+
86400
*
7
*
1000
var
endTime
=
startTime
*
1
+
86400
*
7
*
1000
console
.
log
(
helper
.
dateFormat
(
startTime
),
endTime
)
console
.
log
(
helper
.
dateFormat
(
startTime
),
endTime
)
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
startTime
))
if
(
overdue
)
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
startTime
))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
})
$
(
'#oneyear'
).
on
(
'click'
,
function
()
{
$
(
'#oneyear'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
1
)
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
1
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
if
(
overdue
)
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
})
$
(
'#twoyears'
).
on
(
'click'
,
function
()
{
$
(
'#twoyears'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
2
)
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
2
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
if
(
overdue
)
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
})
// 1-草稿;2-正常;3-注销;4-过期
// 1-草稿;2-正常;3-注销;4-过期
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
console
.
log
(
data
,
merchantAccountLevel
)
if
(
merchantAccountLevel
==
4
)
{
if
(
merchantAccountLevel
==
4
)
{
console
.
log
(
'2222222222'
)
if
(
data
.
field
.
effectiveStarttime
&&
data
.
field
.
expireDate
)
{
if
(
data
.
field
.
effectiveStarttime
&&
data
.
field
.
expireDate
)
{
var
params
=
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
...
@@ -155,7 +168,6 @@
...
@@ -155,7 +168,6 @@
}
}
}
else
{
}
else
{
if
(
data
.
field
.
effectiveTime
)
{
if
(
data
.
field
.
effectiveTime
)
{
console
.
log
(
'11111111'
)
var
params
=
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
id
:
vaildData
.
id
,
id
:
vaildData
.
id
,
...
@@ -191,6 +203,22 @@
...
@@ -191,6 +203,22 @@
}
}
}
}
function
getStartTime
(
time
)
{
var
expireDate
=
new
Date
(
time
)
var
currentDate
=
new
Date
()
if
(
expireDate
.
getTime
()
>
currentDate
.
getTime
())
{
return
{
startDate
:
expireDate
,
overdue
:
false
}
}
else
{
return
{
startDate
:
currentDate
,
overdue
:
true
}
}
}
// 获取参数
// 获取参数
function
getQueryString
(
name
)
{
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
...
...
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