mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
优化移动端
This commit is contained in:
parent
4da73dd144
commit
117fd62c44
@ -3,10 +3,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {mapState} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MobileBack",
|
name: "MobileBack",
|
||||||
props: {
|
props: {
|
||||||
disabled: {
|
showTabbar: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
@ -37,16 +39,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState(['cacheDrawerOverlay']),
|
||||||
|
|
||||||
style() {
|
style() {
|
||||||
return {
|
return {
|
||||||
top: this.y + 'px',
|
top: this.y + 'px',
|
||||||
left: !this.disabled && this.x > 30 && this.show ? 0 : '-50px',
|
left: this.x > 30 && this.show ? 0 : '-50px',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 获取坐标
|
|
||||||
getXY(event) {
|
getXY(event) {
|
||||||
let touch = event.touches[0]
|
let touch = event.touches[0]
|
||||||
this.x = touch.clientX
|
this.x = touch.clientX
|
||||||
@ -55,19 +58,40 @@ export default {
|
|||||||
touchstart(event) {
|
touchstart(event) {
|
||||||
this.getXY(event)
|
this.getXY(event)
|
||||||
// 判断是否是边缘滑动
|
// 判断是否是边缘滑动
|
||||||
this.show = !this.disabled && this.x < 30;
|
this.show = this.canBack() && this.x < 30;
|
||||||
},
|
},
|
||||||
touchmove(event) {
|
touchmove(event) {
|
||||||
this.getXY(event)
|
this.getXY(event)
|
||||||
},
|
},
|
||||||
touchend() {
|
touchend() {
|
||||||
// 判断停止时的位置偏移
|
// 判断停止时的位置偏移
|
||||||
if (this.x > 90 && this.show) {
|
if (this.x > 90) {
|
||||||
this.goBack();
|
this.onBack();
|
||||||
}
|
}
|
||||||
this.x = 0
|
this.x = 0
|
||||||
this.show = false
|
this.show = false
|
||||||
},
|
},
|
||||||
|
canBack() {
|
||||||
|
if (!this.showTabbar) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (this.$Modal.visibles().length > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return this.cacheDrawerOverlay.length > 0;
|
||||||
|
},
|
||||||
|
onBack() {
|
||||||
|
if (this.$Modal.removeLast()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.cacheDrawerOverlay.length > 0) {
|
||||||
|
this.cacheDrawerOverlay[this.cacheDrawerOverlay.length - 1].close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.show) {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -355,7 +355,7 @@
|
|||||||
|
|
||||||
<!--移动端选项卡-->
|
<!--移动端选项卡-->
|
||||||
<MobileTabbar v-if="showMobileTabbar"/>
|
<MobileTabbar v-if="showMobileTabbar"/>
|
||||||
<MobileBack :disabled="showMobileTabbar"/>
|
<MobileBack :showTabbar="showMobileTabbar"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,9 @@
|
|||||||
<div class="project-head">
|
<div class="project-head">
|
||||||
<div class="project-titbox">
|
<div class="project-titbox">
|
||||||
<div class="project-title">
|
<div class="project-title">
|
||||||
|
<div class="project-back" @click="goBack">
|
||||||
|
<i class="taskfont"></i>
|
||||||
|
</div>
|
||||||
<h1>{{projectData.name}}</h1>
|
<h1>{{projectData.name}}</h1>
|
||||||
<label v-if="projectData.top_at" class="top-text">{{$L('置顶')}}</label>
|
<label v-if="projectData.top_at" class="top-text">{{$L('置顶')}}</label>
|
||||||
<div v-if="loading" class="project-load"><Loading/></div>
|
<div v-if="loading" class="project-load"><Loading/></div>
|
||||||
|
|||||||
6
resources/assets/sass/components/mobile.scss
vendored
6
resources/assets/sass/components/mobile.scss
vendored
@ -4,9 +4,9 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background-color: #f3f6fe;
|
background-color: #f8f8f8;
|
||||||
box-shadow: 0 0 2px rgba(28, 34, 43, 0.15);
|
box-shadow: 0 0 2px rgba(28, 34, 43, 0.15);
|
||||||
z-index: 98;
|
z-index: 9998;
|
||||||
> ul {
|
> ul {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -47,7 +47,7 @@
|
|||||||
width: 500px;
|
width: 500px;
|
||||||
height: 500px;
|
height: 500px;
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
z-index: 99;
|
z-index: 9999;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
transform: translate(-460px, -50%);
|
transform: translate(-460px, -50%);
|
||||||
transition: left 0.2s;
|
transition: left 0.2s;
|
||||||
|
|||||||
@ -826,9 +826,10 @@
|
|||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.dialog-wrapper {
|
.dialog-wrapper {
|
||||||
.dialog-nav {
|
.dialog-nav {
|
||||||
height: 60px;
|
height: 52px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
|
||||||
&.completed {
|
&.completed {
|
||||||
&:after {
|
&:after {
|
||||||
@ -846,7 +847,7 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 60px;
|
width: 52px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -859,7 +860,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.dialog-block {
|
.dialog-block {
|
||||||
margin: 0 60px;
|
margin: 0 52px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
.dialog-avatar {
|
.dialog-avatar {
|
||||||
display: none;
|
display: none;
|
||||||
@ -879,8 +880,16 @@
|
|||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
}
|
}
|
||||||
.dialog-footer {
|
.dialog-footer {
|
||||||
padding: 0 20px;
|
background-color: #f8f8f8;
|
||||||
margin-bottom: 16px;
|
padding: 8px 10px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
.dialog-input {
|
||||||
|
.chat-input-wrapper {
|
||||||
|
padding-left: 6px;
|
||||||
|
padding-right: 8px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
.project-list {
|
.project-list {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
||||||
.list-search {
|
.list-search {
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
z-index: 1;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -15,11 +13,11 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 54px;
|
height: 54px;
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
background-color: #ffffff;
|
background-color: #f8f8f8;
|
||||||
|
|
||||||
.search-wrapper {
|
.search-wrapper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background-color: #F7F7F7;
|
background-color: #ffffff;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
margin: 0 4px;
|
margin: 0 4px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
@ -39,12 +37,14 @@
|
|||||||
|
|
||||||
> ul {
|
> ul {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
height: 0;
|
||||||
|
overflow: auto;
|
||||||
|
background-color: #f8f8f8;
|
||||||
> li {
|
> li {
|
||||||
margin: 16px;
|
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
background: #F9FAFB;
|
margin: 16px;
|
||||||
box-shadow: 0 0 4px rgba(28, 34, 43, 0.1);
|
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
background-color: #ffffff;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
.project-h1 {
|
.project-h1 {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|||||||
@ -15,6 +15,9 @@
|
|||||||
.project-title {
|
.project-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
.project-back {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
> h1 {
|
> h1 {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
@ -1024,14 +1027,25 @@
|
|||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.project-panel {
|
.project-panel {
|
||||||
.project-head {
|
.project-head {
|
||||||
margin: 24px 24px 0;
|
margin: 12px 16px 0;
|
||||||
.project-titbox {
|
.project-titbox {
|
||||||
display: block;
|
display: block;
|
||||||
|
margin-bottom: 16px;
|
||||||
.project-title {
|
.project-title {
|
||||||
float: left;
|
float: left;
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
|
.project-back {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: -16px;
|
||||||
|
width: 52px;
|
||||||
|
> i {
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
}
|
||||||
> h1 {
|
> h1 {
|
||||||
font-size: 24px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.project-icons {
|
.project-icons {
|
||||||
|
|||||||
2
resources/assets/sass/pages/page-login.scss
vendored
2
resources/assets/sass/pages/page-login.scss
vendored
@ -7,7 +7,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background-color: #F3F6FE;
|
background-color: #f8f8f8;
|
||||||
.login-body {
|
.login-body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@ -410,6 +410,15 @@
|
|||||||
.page-messenger {
|
.page-messenger {
|
||||||
.messenger-wrapper {
|
.messenger-wrapper {
|
||||||
.messenger-select {
|
.messenger-select {
|
||||||
|
.messenger-search {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
.search-wrapper {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.messenger-nav {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
.messenger-menu {
|
.messenger-menu {
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user