Skip to content

Commit

Permalink
test: temp merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Probe001 committed Jun 10, 2023
1 parent 56dd9d7 commit 539965d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const routes = [
// 승차벨 페이지
path: '/riding',
name: 'RidingView',
props: true,
component: () => import('@/views/passenger/RidingView.vue'),
},
{
Expand Down
9 changes: 9 additions & 0 deletions src/store/passsengerStore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {defineStore} from 'pinia';
import {ref} from 'vue';

export const usePassengerStore = defineStore('passenger', () => {
/** 커스텀 콘텐츠를 읽어주는 함수
Expand All @@ -16,7 +17,15 @@ export const usePassengerStore = defineStore('passenger', () => {
htmlElement.removeAttribute('aria-live');
}, 100);
}

const busData = ref({});
const startStation = ref({});
const endStation = ref({});

busData.value = {id: 123};

return {
announcePageContent,
busData,
};
});
4 changes: 3 additions & 1 deletion src/views/passenger/KeyboardSearchView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@
// 사용자 위치 기준으로 가까운 정류장 get
// TODO: 현재 위치를 동대문 DDP 으로 고정! 나중에 현재 위치로 바꾸깅
const tmpX = 126.910257;
const tmpY = 37.581632;
const url = `http://ws.bus.go.kr/api/rest/stationinfo/getStationByPos?serviceKey=${process.env.VUE_APP_ROUTE_SERVICE_KEY}&tmX=${127.00911}&tmY=${37.56652}&radius=${2000}&resultType=json`;
const url = `http://ws.bus.go.kr/api/rest/stationinfo/getStationByPos?serviceKey=${process.env.VUE_APP_ROUTE_SERVICE_KEY}&tmX=${tmpX}&tmY=${tmpY}&radius=${2000}&resultType=json`;
axios
.get(url)
.then(res => {
Expand Down
10 changes: 4 additions & 6 deletions src/views/passenger/RidingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@
<script>
import NavCompVue from '@/components/NavComp.vue';
import {ref} from 'vue';
import {usePassengerStore} from '@/store/passsengerStore';
export default {
components: {
NavCompVue,
},
props: {
busData: Object,
},
mounted() {
console.log(this.busData);
},
setup() {
const passengerStore = usePassengerStore();
console.log(passengerStore.busData);
// 버스 도착 여부
const isBusArrive = ref(false);
return {
isBusArrive,
passengerStore,
};
},
};
Expand Down
4 changes: 3 additions & 1 deletion src/views/passenger/StopBusListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import {useRoute} from 'vue-router';
import router from '@/router';
import NavComp from '@/components/NavComp.vue';
import {usePassengerStore} from '@/store/passsengerStore';
export default {
name: 'StopBusList',
Expand Down Expand Up @@ -113,11 +114,12 @@
return res.msgBody.itemList[0].arrmsg1;
};
const passengerStore = usePassengerStore();
const ridingReserve = busData => {
console.log('넘겨주는쪽:', busData);
passengerStore.busData = busData;
router.push({
name: 'RidingView',
props: {busData: busData},
});
};
Expand Down

0 comments on commit 539965d

Please sign in to comment.