Skip to content

Commit

Permalink
[K5P-51] [feat] 모바일 화면 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
Koneweekk committed Jul 22, 2024
1 parent 5d4eeac commit f6eebf9
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/assets/scss/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $base-shadow : 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);

$nav-bar-height : 60px;
$side-bar-width : 150px;
$mobile-header-height : 100px;

@mixin flex-box($direction, $align, $gap) {
display: flex;
Expand Down
14 changes: 14 additions & 0 deletions src/stores/mobilePage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineStore } from 'pinia'

export const useMobileStore = defineStore('mobilePage', {
state() {
return {
pageName : ""
}
},
actions: {
setPageName(pageName) {
this.pageName = pageName;
}
},
})
36 changes: 31 additions & 5 deletions src/views/MobileView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,60 @@
class="logo-img"
src="@/assets/images/name_white.png"
alt="logo">
<p class="page-name">{{ mobilePageStore.pageName }}</p>
</header>
<RouterView/>
<div class="main-content">
<RouterView/>
</div>
</div>
</template>

<script>
import { useMobileStore } from '@/stores/mobilePage';
import { mapActions, mapStores } from 'pinia';
export default {
name: 'MobileView'
name: 'MobileView',
computed: {
...mapStores(useMobileStore)
},
methods: {
...mapActions(useMobileStore, ['setPageName'])
}
}
</script>

<style lang="scss" scoped>
.mobile-view {
width: 100%;
margin: auto;
position: relative;
@media (min-width: 501px) {
max-width: 500px;
}
}
.logo-header {
@include flex-box(row, center, 0px);
@include flex-box(column, center, 10px);
background-color: $theme-color;
position: absolute;
top:0;
width: 100%;
padding: 10px;
height: $mobile-header-height;
.logo-img {
width: 200px
}
.page-name {
color: white;
font-weight: bold;
font-size: 22px;
margin: 0px;
}
}
.main-content {
position: absolute;
top: $mobile-header-height;
width: 100%;
}
</style>
14 changes: 13 additions & 1 deletion src/views/consent/ConsentItemView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@
</template>

<script>
import { useMobileStore } from '@/stores/mobilePage';
import { mapActions, mapStores } from 'pinia';
export default {
name: 'ConsentItemView'
name: 'ConsentItemView',
computed: {
...mapStores(useMobileStore)
},
methods: {
...mapActions(useMobileStore, ['setPageName'])
},
mounted() {
this.mobilePageStore.setPageName("상품 선택")
}
}
</script>

Expand Down
15 changes: 13 additions & 2 deletions src/views/payment/PaymentStartView.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
<template>
<div>
<h1>납부자 결제 시작</h1>
</div>
</template>

<script>
import { useMobileStore } from '@/stores/mobilePage';
import { mapActions, mapStores } from 'pinia';
export default {
name: 'PaymentStartView'
name: 'PaymentStartView',
computed: {
...mapStores(useMobileStore)
},
methods: {
...mapActions(useMobileStore, ['setPageName'])
},
mounted() {
this.mobilePageStore.setPageName("회원 결제")
}
}
</script>

Expand Down

0 comments on commit f6eebf9

Please sign in to comment.