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 de113e02
authored
Jun 06, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit 修复BUG
1 parent
b0b66b51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
package.json
packageEquity/pages/aiInspection/components/dateBox/dateBox.js
packageEquity/pages/aiInspection/components/dateBox/dateBox.wxml
package.json
View file @
de113e0
...
...
@@ -2,6 +2,7 @@
"dependencies"
:
{
"@vant/area-data"
:
"^1.5.1"
,
"@vant/weapp"
:
"^1.10.24"
,
"dayjs"
:
"^1.11.11"
,
"glsk-applet-component"
:
"^1.0.0"
,
"glsx-applet-component"
:
"^1.1.29"
,
"glsx-common-sdk"
:
"^0.2.8"
,
...
...
packageEquity/pages/aiInspection/components/dateBox/dateBox.js
View file @
de113e0
// packageEquity/pages/aiInspection/components/dateBox/dateBox.js
import
dayjs
from
'dayjs'
const
defaultDay
=
new
Date
().
setDate
(
new
Date
().
getDate
()
-
1
)
Component
({
...
...
@@ -26,6 +27,7 @@ Component({
*/
methods
:
{
init
()
{
wx
.
$util
.
showLoading
()
const
now
=
new
Date
().
format
(
'yyyy/MM/dd'
),
calendar
=
this
.
selectComponent
(
'#calendar'
)
this
.
setData
({
...
...
@@ -35,33 +37,33 @@ Component({
currentDayTime
:
new
Date
(
defaultDay
).
getTime
()
})
calendar
.
resetData
(
new
Date
(
defaultDay
).
format
(
'yyyy-MM-dd'
))
wx
.
$util
.
hideLoading
()
},
selectDay
(
e
)
{
let
{
date
}
=
e
.
detail
,
currentDay
=
new
Date
(
date
.
replace
(
/-/g
,
'/'
)
)
}
=
e
.
detail
let
currentDay
=
dayjs
(
date
)
this
.
setData
({
currentDay
:
currentDay
.
format
(
'yyyy年MM月dd日'
),
currentDayTime
:
currentDay
.
getTime
(),
currentDay
:
currentDay
.
format
(
'YYYY年MM月DD日'
),
currentDayTime
:
currentDay
.
valueOf
(),
},
()
=>
{
this
.
triggerEvent
(
'change'
,
date
)
this
.
selectComponent
(
'#calendar'
).
resetData
(
date
)
wx
.
$util
.
hideLoading
()
})
this
.
triggerEvent
(
'change'
,
date
)
this
.
selectComponent
(
'#calendar'
).
resetData
(
date
)
},
choose
(
e
)
{
const
{
wx
.
$util
.
showLoading
()
let
{
index
}
=
e
.
target
.
dataset
,
{
currentDayTime
}
=
this
.
data
let
currentDay
=
new
Date
(
currentDayTime
)
currentDay
.
setDate
(
currentDay
.
getDate
()
+
Number
(
index
))
let
y
=
currentDay
.
getFullYear
(),
m
=
currentDay
.
getMonth
()
+
1
<
10
?
`0
${
currentDay
.
getMonth
()
+
1
}
`
:
currentDay
.
getMonth
()
+
1
,
d
=
currentDay
.
getDate
()
<
10
?
`0
${
currentDay
.
getDate
()}
`
:
currentDay
.
getDate
()
currentDayTime
}
=
this
.
data
,
date
=
dayjs
(
currentDayTime
).
add
(
Number
(
index
),
'day'
).
format
(
'YYYY-MM-DD'
)
this
.
selectDay
({
detail
:
{
date
:
`
${
y
}
-
${
m
}
-
${
d
}
`
date
}
})
},
...
...
packageEquity/pages/aiInspection/components/dateBox/dateBox.wxml
View file @
de113e0
<view class="date-box">
<block wx:if="{{minTime != currentDayTime}}">
<view class="date-btn" bindtap="choose" data-index="-1">
<gl-image class="icon" src="/equity/arrow-left.png" />
<gl-image
data-index="-1"
class="icon" src="/equity/arrow-left.png" />
上一天
</view>
</block>
...
...
@@ -12,7 +12,7 @@
<block wx:if="{{maxDateTime != currentDayTime}}">
<view class="date-btn next" bindtap="choose" data-index="1">
下一天
<gl-image class="icon" src="/equity/arrow-right.png" />
<gl-image class="icon"
data-index="1"
src="/equity/arrow-right.png" />
</view>
</block>
</view>
...
...
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