Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
panyongping
uni-pdtravel
Commits
6319f82f
Commit
6319f82f
authored
Aug 29, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日历组件目录修改
parent
21a85664
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
2 deletions
+85
-2
calendar.vue
components/calendar.vue
+83
-0
scenicCombiOrder.vue
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
+1
-1
scenicSingleOrder.vue
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
+1
-1
No files found.
components/calendar.vue
0 → 100644
View file @
6319f82f
<
template
>
<u-calendar
:show=
"showPop"
@
confirm=
"onConfirm"
@
close=
"showPop=false"
:defaultDate=
"defaultDate"
:formatter=
'formatter'
:customList=
'customList'
ref=
"calendar2"
rowHeight=
'112'
round=
'20'
closeOnClickOverlay=
'true'
></u-calendar>
</
template
>
<
script
>
export
default
{
props
:
[
'dateList'
],
watch
:
{
dateList
:{
handler
(
newValue
,
oldValue
){
if
(
newValue
&&
newValue
.
length
>
0
){
this
.
customList
=
newValue
.
map
(
item
=>
{
return
item
.
startTime
.
substr
(
0
,
10
)
})
this
.
defaultDate
=
newValue
[
0
].
startTime
.
substr
(
0
,
10
)
//由于传入了customList,最大日期和最小日期可以取消
// this.maxDate=newValue[newValue.length-1].startTime.substr(0,10)
// //默认和最小日期都为第一天
// this.minDate=newValue[0].startTime.substr(0,10)
}
},
deep
:
true
,
immediate
:
true
}
},
data
()
{
return
{
showPop
:
false
,
//控制日历显示隐藏
defaultDate
:
''
,
//默认日期
maxDate
:
''
,
//最大日期
minDate
:
''
,
//最小日期
customList
:[],
//转化之后的日期列表
}
},
mounted
()
{
this
.
$refs
.
calendar2
.
setFormatter
(
this
.
formatter
)
},
methods
:
{
//---日期确认事件
onConfirm
(
date
){
this
.
showPop
=
false
this
.
$emit
(
'dateConfig'
,
date
[
0
])
},
//---时间格式转换
formatter
(
day
)
{
let
year
=
day
.
date
.
getFullYear
()
let
month
=
day
.
date
.
getMonth
()
+
1
if
(
month
<
10
)
{
month
=
'0'
+
month
}
let
days
=
day
.
date
.
getDate
()
if
(
days
<
10
)
{
days
=
'0'
+
days
}
let
dates
=
year
+
'-'
+
month
+
'-'
+
days
//真机调试手极端报错,暂时注释
// this.dateList.forEach((item, index) => {
// if (item.startTime.substr(0, 10) == dates) {
// day.bottomInfo = '¥' + item.sellingPrice
// day.dot = true
// }
// })
return
day
}
}
}
</
script
>
<
style
scoped=
"scoped"
>
</
style
>
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
View file @
6319f82f
...
...
@@ -346,7 +346,7 @@
</template>
<
script
>
import
calendar
from
'
../scenicC
omponents/calendar'
//日历组件
import
calendar
from
'
@/c
omponents/calendar'
//日历组件
import
buyKnow
from
'@/components/buyKnow.vue'
//购票须知
import
orderCoupon
from
'@/components/orderCoupon'
//优惠券
import
detail
from
'../scenicComponents/combiDetail.vue'
//明细弹窗
...
...
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
View file @
6319f82f
...
...
@@ -394,7 +394,7 @@
</template>
<
script
>
import
calendar
from
'
../scenicC
omponents/calendar'
//日历组件
import
calendar
from
'
@/c
omponents/calendar'
//日历组件
import
buyKnow
from
'@/components/buyKnow.vue'
//购票须知
import
orderCoupon
from
'@/components/orderCoupon'
//优惠券
import
detail
from
'../scenicComponents/detail.vue'
//明细弹窗
...
...
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