Commit 4a7cf6a5 authored by xiaoye's avatar xiaoye

布局适应移动端

parent ac58828e
...@@ -23,7 +23,13 @@ ...@@ -23,7 +23,13 @@
</uni-list> </uni-list>
</view> </view>
<view class = 'click head'><uni-list><uni-list-chat></uni-list-chat></uni-list></view> <view class = 'click head'><uni-list><uni-list-chat></uni-list-chat></uni-list></view>
<Pics></Pics> <Pics
:style = "{
'--maxsize' : `${size.width > size.height ? size.width / 2 : size.width / 1.2}px`,
'--minsize' : `${size.width / 2}px`,
'--height' : `${size.width > size.height ? 10 : 25}%`,
}"
></Pics>
<transition name = 'move_right'> <transition name = 'move_right'>
<uni-card <uni-card
class = 'click' class = 'click'
...@@ -32,7 +38,7 @@ ...@@ -32,7 +38,7 @@
:title = 'Mycard.username' :title = 'Mycard.username'
:sub-title = 'Mycard.email' :sub-title = 'Mycard.email'
:thumbnail = 'Mycard.avatar' :thumbnail = 'Mycard.avatar'
:style = "{ '--size' : `${size.width / 2}px` }" :style = "{ '--size' : `${size.width > size.height ? size.width / 2 : size.width / 1.2}px` }"
> >
<view v-show = 'Mycard.id >= 0'><h2>{{ Mycard.id }}</h2></view> <view v-show = 'Mycard.id >= 0'><h2>{{ Mycard.id }}</h2></view>
<hr v-show = 'Mycard.id >= 0'> <hr v-show = 'Mycard.id >= 0'>
...@@ -98,7 +104,7 @@ ...@@ -98,7 +104,7 @@
<transition name = 'switch'> <transition name = 'switch'>
<view <view
id = 'body' id = 'body'
:style = "{ '--size' : `${size.width > size.height ? size.width / 2 : size.width / 1.2}px` }" :style = "{ '--size' : `${size.width > size.height ? size.width / 2 : size.width}px` }"
> >
<transition name = 'switch'> <transition name = 'switch'>
<uni-list <uni-list
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<uni-card <uni-card
v-show = 'deck.participant' v-show = 'deck.participant'
:title = "`${deck.participant?.name ?? '...'} 的卡组`" :title = "`${deck.participant?.name ?? '...'} 的卡组`"
id = 'main'
:spacing = '0'
:padding = '0'
> >
<!-- <view <!-- <view
class = 'button' class = 'button'
...@@ -12,11 +15,11 @@ ...@@ -12,11 +15,11 @@
> >
<uni-icons type = 'download'></uni-icons> <uni-icons type = 'download'></uni-icons>
</view> --> </view> -->
<uni-card :title = "deck.main.length > 0 ? '主卡组' : '暂无主卡组'"> <uni-card class = 'deck' :title = "deck.main.length > 0 ? '主卡组' : '暂无主卡组'">
<image class = 'deck_cards' v-for = '(i, v) in deck.main' :src = 'getImg(i)' mode = 'aspectFit' @error = 'changeImg.main(v)'></image> <cover-image class = 'deck_cards' v-for = '(i, v) in deck.main' :src = 'getImg(i)' @error = 'changeImg.main(v)'></cover-image>
</uni-card> </uni-card>
<uni-card :title = "deck.side.length > 0 ? '副卡组' : '暂无副卡组'"> <uni-card class = 'deck' :title = "deck.side.length > 0 ? '副卡组' : '暂无副卡组'">
<image class = 'deck_cards' v-for = '(i, v) in deck.side' :src = 'getImg(i)' mode = 'aspectFit' @error = 'changeImg.main(v)'></image> <cover-image class = 'deck_cards' v-for = '(i, v) in deck.side' :src = 'getImg(i)' @error = 'changeImg.main(v)'></cover-image>
</uni-card> </uni-card>
</uni-card> </uni-card>
</transition> </transition>
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
right: 2%; right: 2%;
z-index: 2; z-index: 2;
max-width: var(--size); max-width: var(--size);
width: 20%;
.user { .user {
&:hover { &:hover {
cursor: pointer; cursor: pointer;
...@@ -94,15 +93,17 @@ ...@@ -94,15 +93,17 @@
top : 70px; top : 70px;
z-index: 2; z-index: 2;
right: 2%; right: 2%;
width: 50%; max-width: var(--maxsize);
:deep(.uni-card) { min-width: var(--minsize);
// display: flex; :deep(#main) {
.deck_cards { overflow-y: auto;
width: 10%; max-height: 90vh;
height: 11.52vh; .deck {
aspect-ratio: 1 / 1.43; .deck_cards {
display: inline-block; width: var(--height);
vertical-align: top; display: inline-block;
vertical-align: top;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment