Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
李智书
xzf_uniapp-wechat-web
Commits
6eaace67
Commit
6eaace67
authored
Aug 25, 2023
by
袁玲利
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校园报告暂存
parent
213e139a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
34 deletions
+62
-34
src/components/canlendar.vue
src/components/canlendar.vue
+47
-16
src/pages/ApplyConsumption/campusReport/campusReport.vue
src/pages/ApplyConsumption/campusReport/campusReport.vue
+15
-18
No files found.
src/components/canlendar.vue
View file @
6eaace67
...
...
@@ -6,11 +6,11 @@
<div
class=
"calendar-inner"
>
<div
class=
"calendar-item"
v-for=
"(item, index) of calendarList"
:key=
"index"
:class=
"[item.disable ? 'disabled' : '',item.value=='2023-08-23'||item.value=='2023-08-18'||item.value=='2023-08-28'?'signdate':'',item.value===currentDay?'today':'']"
>
<div
v-if=
"item.value=='2023-08-23'||item.value=='2023-08-18'||item.value=='2023-08-28'"
class=
"icons"
>
<
!--
<
div
v-if=
"item.value=='2023-08-23'||item.value=='2023-08-18'||item.value=='2023-08-28'"
class=
"icons"
>
<span
v-if=
"item.value=='2023-08-23'"
>
早中
</span>
<span
v-else-if=
"item.value=='2023-08-18'"
>
早中晚
</span>
<span
v-else
>
晚
</span>
</div>
</div>
-->
<div
class=
"show"
>
{{
item
.
date
}}
</div>
</div>
</div>
...
...
@@ -19,6 +19,21 @@
<
script
>
export
default
{
props
:
{
currentDate
:
{
type
:
Object
,
default
:
function
()
{
return
{
year
:
''
,
month
:
''
};
}
},
shareDate_
:
{
type
:
String
,
default
:
""
},
},
data
()
{
return
{
current
:
{},
// 当前时间
...
...
@@ -34,22 +49,27 @@
year
,
month
}
=
this
.
current
;
return
`
${
year
}
年
${
this
.
pad
(
month
+
1
)}
月`
;
return
`
${
year
}
年
${
this
.
pad
(
month
)}
月`
;
}
},
mounted
()
{
this
.
init
();
},
computed
:
{
currentDay
(){
let
month
=
(
this
.
current
.
month
+
1
)
<
10
?
'
0
'
+
(
this
.
current
.
month
+
1
):(
this
.
current
.
month
+
1
);
return
this
.
current
.
year
+
'
-
'
+
month
+
'
-
'
+
this
.
current
.
date
;
currentDay
()
{
let
month
=
(
this
.
current
.
month
+
1
)
<
10
?
'
0
'
+
(
this
.
current
.
month
+
1
)
:
(
this
.
current
.
month
+
1
);
return
this
.
current
.
year
+
'
-
'
+
month
+
'
-
'
+
this
.
current
.
date
;
}
},
methods
:
{
init
()
{
console
.
log
(
this
.
shareDate_
,)
this
.
shareDate
=
new
Date
(
this
.
shareDate_
);
this
.
current
=
this
.
currentDate
;
// this.shareDate = new Date('2023-05-01')
console
.
log
(
this
.
shareDate
,
'
shareDate11111
'
)
// 初始化当前时间
this
.
setCurrent
();
//
this.setCurrent();
this
.
calendarCreator
();
},
// 判断当前月有多少天
...
...
@@ -87,6 +107,8 @@
},
// 设置或初始化 current
setCurrent
(
d
=
new
Date
())
{
let
t
=
new
Date
(
this
.
current
.
year
)
console
.
log
(
d
,
'
setCurrent
'
)
let
year
=
d
.
getFullYear
();
let
month
=
d
.
getMonth
();
let
date
=
d
.
getDate
();
...
...
@@ -156,6 +178,14 @@
console
.
log
(
list
,
'
calendarList
'
)
}
},
watch
:
{
currentDate
(
val
)
{
this
.
current
=
val
},
shareDate_
(
val
)
{
this
.
shareDate
=
new
Date
(
val
)
}
},
}
</
script
>
...
...
@@ -177,7 +207,7 @@
font-size
:
26
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
rgba
(
0
,
0
,
0
,
0.85
);
color
:
rgba
(
0
,
0
,
0
,
0.85
);
line-height
:
37
rpx
}
...
...
@@ -185,8 +215,9 @@
flex
:
1
;
}
.calendar-week
.week-item
:first-child
,
.week-item
:last-child
{
color
:
rgba
(
0
,
0
,
0
,
0.25
);
.calendar-week
.week-item
:first-child
,
.week-item
:last-child
{
color
:
rgba
(
0
,
0
,
0
,
0.25
);
}
.calendar-inner
{
...
...
src/pages/ApplyConsumption/campusReport/campusReport.vue
View file @
6eaace67
...
...
@@ -133,7 +133,7 @@
</view>
<!-- 日历 -->
<view
class=
"canlendar"
>
<Canlendar></Canlendar>
<Canlendar
:currentDate=
"currentDate"
:shareDate_=
"shareDate"
></Canlendar>
</view>
<!-- 底部 -->
<view
class=
"dining_footer"
>
...
...
@@ -291,6 +291,11 @@
name
:
'
campusReport
'
,
data
()
{
return
{
shareDate
:
""
,
currentDate
:
{
year
:
''
,
month
:
''
},
// 是否为会员
isVip
:
false
,
// 是否展示消费明细
...
...
@@ -344,6 +349,11 @@
},
async
mounted
()
{
console
.
log
(
this
.
dataRangeArr
,
'
dataRangeArr
'
)
this
.
currentDate
.
month
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
month
()
this
.
currentDate
.
year
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
year
()
this
.
currentDate
.
date
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
date
()
this
.
shareDate
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
format
(
'
YYYY-MM-DD 00:00:00
'
)
console
.
log
(
this
.
currentDate
,
'
currentDate1111111111111
'
,
this
.
shareDate
)
this
.
columns
=
this
.
dataRangeArr
.
map
(
x
=>
x
.
month
)
console
.
log
(
this
.
columns
,
'
columns
'
)
await
this
.
getCampusConsumerReport
()
...
...
@@ -358,6 +368,10 @@
async
confrimDate
(
date
)
{
console
.
log
(
date
,
'
date
'
)
const
self
=
this
;
this
.
currentDate
.
month
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
month
()
this
.
currentDate
.
year
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
year
()
this
.
currentDate
.
date
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
date
()
this
.
shareDate
=
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
format
(
'
YYYY-MM-DD 00:00:00
'
)
let
obj
=
this
.
dataRangeArr
.
filter
((
x
,
idx
)
=>
(
x
.
month
==
date
)
&&
(
self
.
dataRangeIndex
=
idx
))
console
.
log
(
obj
,
'
obj
'
,
this
.
dataRangeIndex
)
await
this
.
getCampusConsumerReport
()
...
...
@@ -501,25 +515,8 @@
}
return
},
// 获取当前日期
getNowFormatDate
()
{
var
date
=
new
Date
()
var
seperator
=
'
-
'
var
year
=
date
.
getFullYear
()
var
month
=
date
.
getMonth
()
+
1
var
day
=
date
.
getDate
()
if
(
month
>=
1
&&
month
<=
9
)
{
month
=
'
0
'
+
month
}
if
(
day
>=
1
&&
day
<=
9
)
{
day
=
'
0
'
+
day
}
var
currentdate
=
year
+
seperator
+
month
+
seperator
+
day
return
currentdate
},
// 获取日期范围列表
getDataRangeArr
()
{
// console.log(this.getNowFormatDate())
console
.
log
(
this
.
dataRangeArr
,
'
dataRangeArr
'
)
},
init
()
{
...
...
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