Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pad
Project
Project
Details
Activity
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
ximai
mes-pad
Commits
572d5f36
Commit
572d5f36
authored
Jul 23, 2024
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改uni-datetime-picker在PC端的显示
parent
29cbe3f5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
12 deletions
+41
-12
App.vue
App.vue
+3
-3
global.scss
static/css/global.scss
+4
-0
calendar.vue
...tetime-picker/components/uni-datetime-picker/calendar.vue
+3
-3
uni-datetime-picker.vue
...er/components/uni-datetime-picker/uni-datetime-picker.vue
+31
-6
No files found.
App.vue
View file @
572d5f36
...
...
@@ -35,10 +35,10 @@ export default {
max-height
:
120px
!
important
;
}
/
deep
/
.times
.uni-date-picker__container
{
.uni-date-picker__container
{
height
:
400px
!
important
;
z-index
:
1
0000
!
important
;
position
:
fixed
!
important
;
z-index
:
5
0000
!
important
;
position
:
absolute
!
important
;
}
/
deep
/
.uni-pagination__num-tag
{
...
...
static/css/global.scss
View file @
572d5f36
...
...
@@ -25,3 +25,7 @@
.uni-page-body
{
font-size
:
14px
;
}
body
{
position
:
relative
;
}
\ No newline at end of file
uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
View file @
572d5f36
...
...
@@ -32,7 +32,7 @@
<text
class=
"uni-calendar__box-bg-text"
>
{{
nowDate
.
month
}}
</text>
</view>
<view
class=
"uni-calendar__weeks"
style=
"padding-bottom: 7px;"
>
<view
class=
"uni-calendar__weeks"
>
<view
class=
"uni-calendar__weeks-day"
>
<text
class=
"uni-calendar__weeks-day-text"
>
{{
SUNText
}}
</text>
</view>
...
...
@@ -685,7 +685,7 @@
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
height
:
5
0px
;
height
:
3
0px
;
}
.uni-calendar__header-mobile
{
...
...
@@ -791,7 +791,7 @@
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
height
:
40
px
;
height
:
25
px
;
border-bottom-color
:
#F5F5F5
;
border-bottom-style
:
solid
;
border-bottom-width
:
1px
;
...
...
uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
View file @
572d5f36
...
...
@@ -27,8 +27,8 @@
<view
v-show=
"pickerVisible"
class=
"uni-date-mask--pc"
@
click=
"close"
></view>
<view
v-if=
"!isPhone"
v-show=
"pickerVisible"
ref=
"datePicker"
class=
"uni-date-picker__container"
>
<view
v-if=
"!isRange"
class=
"uni-date-single--x"
:style=
"pickerPositionStyle"
>
<view
v-if=
"!isPhone"
v-show=
"pickerVisible"
ref=
"datePicker"
class=
"uni-date-picker__container"
:style=
"pickerPositionStyle"
>
<view
v-if=
"!isRange"
class=
"uni-date-single--x"
>
<view
class=
"uni-popper__arrow"
></view>
<view
v-if=
"hasTime"
class=
"uni-date-changed popup-x-header"
>
...
...
@@ -335,6 +335,9 @@
// todo
return
this
.
isRange
?
653
:
301
},
datePopupHight
(){
return
403
},
/**
* for i18n
...
...
@@ -384,6 +387,11 @@
this
.
initI18nT
()
this
.
platform
()
},
beforeDestroy
()
{
if
(
!
this
.
isPhone
)
{
document
.
body
.
removeChild
(
this
.
$refs
.
datePicker
.
$el
);
}
},
methods
:
{
initI18nT
()
{
const
vueI18n
=
initVueI18n
(
i18nMessages
)
...
...
@@ -459,10 +467,12 @@
return
}
const
{
windowWidth
windowWidth
,
windowHeight
}
=
uni
.
getSystemInfoSync
()
this
.
isPhone
=
windowWidth
<=
1200
this
.
windowWidth
=
windowWidth
this
.
windowHeight
=
windowHeight
},
show
()
{
this
.
$emit
(
"show"
)
...
...
@@ -479,11 +489,24 @@
this
.
pickerPositionStyle
=
{
top
:
'10px'
}
const
{
windowHeight
}
=
uni
.
getSystemInfoSync
()
const
dateEditor
=
uni
.
createSelectorQuery
().
in
(
this
).
select
(
".uni-date-editor"
)
dateEditor
.
boundingClientRect
(
rect
=>
{
if
(
this
.
windowWidth
-
rect
.
left
<
this
.
datePopupWidth
)
{
this
.
pickerPositionStyle
.
right
=
0
}
let
top
=
rect
.
top
this
.
pickerPositionStyle
.
left
=
rect
.
left
+
'px'
if
(
windowHeight
-
rect
.
top
<
this
.
datePopupHight
)
{
// delete this.pickerPositionStyle.top
top
=
(
windowHeight
-
rect
.
top
)
}
if
(
top
+
this
.
datePopupHight
>
windowHeight
)
{
top
=
top
-
((
top
+
this
.
datePopupHight
)
-
windowHeight
)
}
this
.
pickerPositionStyle
.
top
=
top
+
'px'
}).
exec
()
setTimeout
(()
=>
{
this
.
pickerVisible
=
!
this
.
pickerVisible
...
...
@@ -504,7 +527,9 @@
}
}
}
if
(
!
this
.
isPhone
&&
this
.
isFirstShow
)
{
document
.
body
.
appendChild
(
this
.
$refs
.
datePicker
.
$el
);
}
},
50
)
},
close
()
{
...
...
@@ -893,9 +918,9 @@
}
.uni-date__input
{
height
:
4
0px
;
height
:
3
0px
;
width
:
100%
;
line-height
:
4
0px
;
line-height
:
3
0px
;
font-size
:
14px
;
}
...
...
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