Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 516e215f
authored
Apr 21, 2024
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug 修复
1 parent
232a66d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
packageEquity/pages/deliveryTarget/deliveryTarget.js
utils/timeFormat/time-utils.js
packageEquity/pages/deliveryTarget/deliveryTarget.js
View file @
516e215
...
...
@@ -275,7 +275,7 @@ Page({
weeklyList
:
weeklyList
,
timeBean
})
api
.
deliveryTargetDetailWeekList
(
params
).
then
(
res
=>
{
params
?.
merchantId
&&
api
.
deliveryTargetDetailWeekList
(
params
).
then
(
res
=>
{
let
{
code
,
data
,
message
}
=
res
if
(
code
==
0
)
{
let
arr
=
[]
...
...
@@ -299,7 +299,7 @@ Page({
// 获取某一天交车目标数据
getTargetInfo
()
{
let
{
reportDate
,
merchantId
,
staffUuid
}
=
this
.
data
.
targetInfo
api
.
deliveryTargetInfo
({
merchantId
,
staffUuid
,
targetDate
:
reportDate
}).
then
(
res
=>
{
merchantId
&&
api
.
deliveryTargetInfo
({
merchantId
,
staffUuid
,
targetDate
:
reportDate
}).
then
(
res
=>
{
let
{
code
,
data
,
message
}
=
res
if
(
code
==
0
)
{
let
{
preDelieveryBefore
,
chatBefore
,
dealBefore
,
preDelieveryAfer
,
chatAfter
,
dealAfter
,
id
}
=
data
||
{}
...
...
utils/timeFormat/time-utils.js
View file @
516e215
...
...
@@ -46,7 +46,7 @@ function getWeekDayList(selectWeek, selectDay, customerDisabled,) {
timeBean
.
endDayLabel
=
getYearMonth
(
dataStr
,
'/'
)
+
'/'
+
weekDay
.
day
timeBean
.
reportEndDate
=
getDataFormat
(
dataStr
)
// console.log(dataStr)
timeBean
.
isInCurrentWeek
=
isTimestampInCurrentWeek
(
dataStr
)
timeBean
.
isInCurrentWeek
=
isTimestampInCurrentWeek
(
dataStr
,
customerDisabled
)
}
}
...
...
@@ -155,7 +155,7 @@ function getDataFormat(res) {
// return targetDate >= currentWeekStart && targetDate <= currentWeekEnd
// }
function
isTimestampInCurrentWeek
(
timestamp
)
{
function
isTimestampInCurrentWeek
(
timestamp
,
customerDisabled
)
{
const
currentDate
=
new
Date
();
const
currentDay
=
currentDate
.
getDay
();
// 获取当前日期是星期几
...
...
@@ -167,6 +167,13 @@ function isTimestampInCurrentWeek(timestamp) {
const
targetDate
=
new
Date
(
timestamp
);
if
(
customerDisabled
)
{
let
startOfTargetDate
=
new
Date
(
targetDate
.
getFullYear
(),
targetDate
.
getMonth
(),
targetDate
.
getDate
())
let
endOfTargetDate
=
new
Date
(
startOfTargetDate
.
getTime
()
+
(
24
*
60
*
60
*
1000
)
-
1
)
let
tomorrow
=
new
Date
(
new
Date
().
getTime
()
+
(
24
*
60
*
60
*
1000
))
return
tomorrow
<=
endOfTargetDate
}
return
targetDate
>=
currentWeekStart
&&
targetDate
<=
currentWeekEnd
;
}
...
...
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