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
8feaa579
Commit
8feaa579
authored
Aug 25, 2023
by
袁玲利
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校园报告
parent
a22add4e
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1722 additions
and
10 deletions
+1722
-10
src/components/canlendar.vue
src/components/canlendar.vue
+246
-0
src/pages.json
src/pages.json
+9
-0
src/pages/ApplyConsumption/Home/Home.vue
src/pages/ApplyConsumption/Home/Home.vue
+14
-10
src/pages/ApplyConsumption/campusReport/campusReport.vue
src/pages/ApplyConsumption/campusReport/campusReport.vue
+1452
-0
src/pages/ConsumptionReport/ConsumptionReport.vue
src/pages/ConsumptionReport/ConsumptionReport.vue
+1
-0
No files found.
src/components/canlendar.vue
0 → 100644
View file @
8feaa579
<
template
>
<div
class=
"calendar-wrapper"
>
<div
class=
"calendar-week"
>
<div
class=
"week-item"
v-for=
"item of weekList"
:key=
"item"
>
{{
item
}}
</div>
</div>
<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"
>
<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
class=
"show"
>
{{
item
.
date
}}
</div>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
current
:
{},
// 当前时间
weekList
:
[
'
一
'
,
'
二
'
,
'
三
'
,
'
四
'
,
'
五
'
,
'
六
'
,
'
日
'
],
calendarList
:
[],
// 用于遍历显示
shareDate
:
new
Date
()
}
},
computed
:
{
// 显示当前时间
currentDateStr
()
{
let
{
year
,
month
}
=
this
.
current
;
return
`
${
year
}
年
${
this
.
pad
(
month
+
1
)}
月`
;
}
},
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
;
}
},
methods
:
{
init
()
{
// 初始化当前时间
this
.
setCurrent
();
this
.
calendarCreator
();
},
// 判断当前月有多少天
getDaysByMonth
(
year
,
month
)
{
return
new
Date
(
year
,
month
+
1
,
0
).
getDate
();
},
getFirstDayByMonths
(
year
,
month
)
{
return
new
Date
(
year
,
month
,
1
).
getDay
();
},
getLastDayByMonth
(
year
,
month
)
{
return
new
Date
(
year
,
month
+
1
,
0
).
getDay
();
},
// 对小于 10 的数字,前面补 0
pad
(
str
)
{
return
str
<
10
?
`0
${
str
}
`
:
str
;
},
// 点击上一月
prevMonth
()
{
this
.
current
.
month
--
;
// 因为 month的变化 会超出 0-11 的范围, 所以需要重新计算
this
.
correctCurrent
();
// 生成新日期
this
.
calendarCreator
();
},
// 点击下一月
nextMonth
()
{
this
.
current
.
month
++
;
this
.
correctCurrent
();
this
.
calendarCreator
();
},
// 格式化时间,与主逻辑无关
stringify
(
year
,
month
,
date
)
{
let
str
=
[
year
,
this
.
pad
(
month
+
1
),
this
.
pad
(
date
)].
join
(
'
-
'
);
return
str
;
},
// 设置或初始化 current
setCurrent
(
d
=
new
Date
())
{
let
year
=
d
.
getFullYear
();
let
month
=
d
.
getMonth
();
let
date
=
d
.
getDate
();
this
.
current
=
{
year
,
month
,
date
}
},
// 修正 current
correctCurrent
()
{
let
{
year
,
month
,
date
}
=
this
.
current
;
let
maxDate
=
this
.
getDaysByMonth
(
year
,
month
);
// 预防其他月跳转到2月,2月最多只有29天,没有30-31
date
=
Math
.
min
(
maxDate
,
date
);
let
instance
=
new
Date
(
year
,
month
,
date
);
this
.
setCurrent
(
instance
);
},
// 生成日期
calendarCreator
()
{
// 一天有多少毫秒
const
oneDayMS
=
24
*
60
*
60
*
1000
;
let
list
=
[];
let
{
year
,
month
}
=
this
.
current
;
// 当前月份第一天是星期几, 0-6
let
firstDay
=
this
.
getFirstDayByMonths
(
year
,
month
);
// 填充多少天
let
prefixDaysLen
=
firstDay
===
0
?
6
:
firstDay
-
1
;
// 毫秒数
let
begin
=
new
Date
(
year
,
month
,
1
).
getTime
()
-
oneDayMS
*
prefixDaysLen
;
// 当前月份最后一天是星期几, 0-6
let
lastDay
=
this
.
getLastDayByMonth
(
year
,
month
);
// 填充多少天, 和星期的排放顺序有关
let
suffixDaysLen
=
lastDay
===
0
?
0
:
7
-
lastDay
;
// 毫秒数
let
end
=
new
Date
(
year
,
month
+
1
,
0
).
getTime
()
+
oneDayMS
*
suffixDaysLen
;
while
(
begin
<=
end
)
{
this
.
shareDate
.
setTime
(
begin
);
let
year
=
this
.
shareDate
.
getFullYear
();
let
curMonth
=
this
.
shareDate
.
getMonth
();
let
date
=
this
.
shareDate
.
getDate
();
list
.
push
({
year
:
year
,
month
:
curMonth
,
date
:
date
,
disable
:
curMonth
!==
month
,
value
:
this
.
stringify
(
year
,
curMonth
,
date
)
});
begin
+=
oneDayMS
;
}
this
.
calendarList
=
list
;
console
.
log
(
list
,
'
calendarList
'
)
}
},
}
</
script
>
<
style
>
.calendar-wrapper
{
width
:
100%
;
height
:
auto
;
overflow
:
hidden
;
}
.calendar-week
{
display
:
flex
;
align-items
:
center
;
text-align
:
center
;
width
:
690
rpx
;
height
:
74
rpx
;
background
:
#F7FAF8
;
font-size
:
26
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
rgba
(
0
,
0
,
0
,
0.85
);
line-height
:
37
rpx
}
.calendar-week
.week-item
{
flex
:
1
;
}
.calendar-week
.week-item
:first-child
,
.week-item
:last-child
{
color
:
rgba
(
0
,
0
,
0
,
0.25
);
}
.calendar-inner
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
center
;
align-items
:
center
;
}
.calendar-item
{
display
:
flex
;
width
:
88
rpx
;
height
:
88
rpx
;
box-sizing
:
border-box
;
padding-top
:
28
rpx
;
border-radius
:
22
rpx
;
margin
:
5
rpx
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
32
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
rgba
(
0
,
0
,
0
,
0.75
);
line-height
:
45
rpx
;
flex-direction
:
column
;
}
.calendar-item.disabled
{
color
:
rgba
(
0
,
0
,
0
,
0.1
);
}
.signdate
{
border-radius
:
22
rpx
;
background-color
:
rgba
(
249
,
121
,
63
,
0.1
);
color
:
#F9793F
;
line-height
:
28
rpx
;
height
:
87
rpx
;
padding-top
:
0
rpx
;
}
.icons
{
font-size
:
20
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#F9793F
;
line-height
:
28
rpx
;
margin-bottom
:
4
rpx
;
}
.today
{
background
:
rgba
(
0
,
0
,
0
,
0.1
);
}
.calendar-item.checked
{
color
:
red
;
}
</
style
>
\ No newline at end of file
src/pages.json
View file @
8feaa579
...
...
@@ -598,6 +598,15 @@
}
}
,{
"path"
:
"pages/ApplyConsumption/campusReport/campusReport"
,
"style"
:
{
"navigationBarTitleText"
:
"校园报告"
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
...
...
src/pages/ApplyConsumption/Home/Home.vue
View file @
8feaa579
...
...
@@ -79,7 +79,7 @@
<view
class=
"sketch"
>
{{
item
.
sketch
||
''
}}
</view>
</view>
<view
class=
"icon"
>
<image
:src=
"i
tem.icon
"
mode=
"aspectFit"
></image>
<image
:src=
"i
ndex+1 != 5 ? item.icon : 'https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/applyCons/menu3.png'
"
mode=
"aspectFit"
></image>
</view>
</view>
</view>
...
...
@@ -122,20 +122,21 @@
return
{
ImgUrl
:
this
.
$ImgUrl
,
ImgUrl2
:
this
.
$ImgUrl
+
'
xzfalipay/
'
,
menuList
:
Array
(
4
).
fill
(
1
).
map
((
v
,
index
)
=>
{
menuList
:
Array
(
5
).
fill
(
1
).
map
((
v
,
index
)
=>
{
return
{
path
:
[
'
../ConsumptIoninfo/ConsumptIoninfo
'
,
'
../ConsumptionQuota/ConsumptionQuota
'
,
'
/pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption
'
,
'
../CommonProblem/CommonProblem
'
'
../CommonProblem/CommonProblem
'
,
'
../campusReport/campusReport
'
][
index
],
title
:
[
'
消费记录
'
,
'
消费限额
'
,
'
消费异常
'
,
'
常见问题
'
][
index
],
sketch
:
[
'
消费记录 笔笔可查
'
,
'
设置额度 管控消费
'
,
'
消费异常 每日提醒
'
,
'
使用疑问 一一解答
'
][
index
],
title
:
[
'
消费记录
'
,
'
消费限额
'
,
'
消费异常
'
,
'
常见问题
'
,
'
校园报告
'
][
index
],
sketch
:
[
'
消费记录 笔笔可查
'
,
'
设置额度 管控消费
'
,
'
消费异常 每日提醒
'
,
'
使用疑问 一一解答
'
,
'
校园报告
'
][
index
],
icon
:
this
.
$ImgUrl
+
`applyCons/menu
${
index
+
1
}
.png`
,
// 是否需要鉴权
auth
:
[
true
,
true
,
true
,
false
][
index
],
auth
:
[
true
,
true
,
true
,
false
,
true
][
index
],
// 鉴权服务项code
serviceItemCode
:
[
config
[
'
ServiceEnum
'
][
'
Auth10
'
],
config
[
'
ServiceEnum
'
][
'
Auth8
'
],
config
[
'
ServiceEnum
'
][
'
Auth11
'
],
''
]
'
ServiceEnum
'
][
'
Auth11
'
],
''
,
config
[
'
ServiceEnum
'
][
'
Auth02
'
]]
[
index
]
}
}),
...
...
@@ -166,7 +167,8 @@
// 学校 学生id
userInfo
:
{
schoolId
:
''
,
userId
:
''
userId
:
''
,
userType
:
''
,
},
// 消费会员弹框
contractMenber
:
false
,
...
...
@@ -233,7 +235,8 @@
}
this
.
userInfo
=
{
schoolId
:
data
.
data
[
'
schoolId
'
],
userId
:
data
.
data
[
'
userId
'
]
userId
:
data
.
data
[
'
userId
'
],
userType
:
data
.
data
[
'
userType
'
]
||
''
}
return
data
.
data
[
'
result
'
]
},
...
...
@@ -304,7 +307,8 @@
}
}
const
query
=
`?name=
${
this
.
HomeDataInfo
[
'
userName
'
]}
&userId=
${
this
.
userInfo
[
'
userId
'
]}
&schoolId=
${
this
.
userInfo
[
'
schoolId
'
]}
`
`?name=
${
this
.
HomeDataInfo
[
'
userName
'
]}
&accountId=
${
this
.
HomeDataInfo
[
'
accountId
'
]}
&userId=
${
this
.
userInfo
[
'
userId
'
]}
&schoolId=
${
this
.
userInfo
[
'
schoolId
'
]}
&userType=
${
this
.
userInfo
[
'
userType
'
]}
`
console
.
log
(
item
.
path
+
query
)
uni
.
switchTab
({
url
:
item
.
path
+
query
,
fail
:
()
=>
{
...
...
src/pages/ApplyConsumption/campusReport/campusReport.vue
0 → 100644
View file @
8feaa579
This diff is collapsed.
Click to expand it.
src/pages/ConsumptionReport/ConsumptionReport.vue
View file @
8feaa579
...
...
@@ -486,6 +486,7 @@
})
}
this
.
dataRangeArr
=
tmpArr
},
methods
:
{
consumerChange
(
e
)
{
...
...
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