Git Product home page Git Product logo

how-house's Introduction

HowHouse,最優質的訂房網站

image

作品介紹

HowHouse,為旅人提供優質的住宿休息選擇

  • 首頁
    • 使用者可以看房間列表
    • 可以選擇下訂的房型、時間(超過 90 天、已無空房的日期不可選)
  • 房間細節頁
    • 使用者可以看房間細節(包含行事曆假日、非假日價錢)
    • 可以選擇下訂的房型、時間
  • 下訂單頁
    • 使用者可以確認房間時間、價錢等訊息
    • 使用者可以下訂單
  • 下訂成功頁
    • 使用者可以確認下訂成功的資訊
    • 使用者可以前去付款 (藍新金流)

使用技術

  • 切板相關
    • SCSS
    • tailwind
  • 框架相關
    • vue 2.6
    • vue router
    • vuex
    • nuxt: server side render
  • 套件使用
    • axios
    • moment
    • vue2-datepicker
    • vuex-map-fields
  • 程式碼風格管理
    • ESLint
    • Prettier
    • StyleLint
  • 上板相關
    • Github git service
    • vercel

環境建構

# install dependencies
$ npm install

# serve with hot reload at localhost:3000
$ npm run dev

# build for production and launch server
$ npm run build
$ npm run start

# generate static project
$ npm run generate

其他

本網站採用 The F2E - 前端修練精神時光屋 活動釋出的設計稿

後端 API,除了用該活動平台提供的 API(取得房間資訊、訂單資訊,以及能送出與刪除訂單) 也用了政府提供的行事曆公開資料

更多細節,請看 wiki

how-house's People

Contributors

ayugioh2003 avatar

Stargazers

Guo Hang avatar

Watchers

James Cloos avatar  avatar

how-house's Issues

測試訂房 API

分析

取消 console 錯誤

使用 nuxt-env 取用 .env 參數

測試API

搭配 vuex 使用

axios 管理

管理 api, vuex

調整

.env 存 token, API_HOTEL 資訊,為了後續 API 呼叫
.env.example

nuxt.config.js 引入 @nuxt/dotenv,來存取 .env 資訊
package.json 引入 @nuxt/dotenv

Services/RoomService.js 管理 rooms 相關 API
store/rooms.js 管理 vuex 的 state, actions
pages/index.vue 測試送出 fetchRooms,抓取 state.rooms

Footer 切版

需求

Footer 切版

需求細項

調整

nuxt.config.js 調整 tailwindcss 路徑設定
tailwind.config.js 調整 style guide
@/assets/scss/tailwind.scss 引入 base.scss
@/assets/scss/base.scss 基本樣式設定

@/components/Footer.vue 切版
@/layouts/default.vue 引入 Footer

在 vercel, heroku 沒辦法正確顯示網頁

FixedBar 的結構我覺得怪怪的

問題

重新調整 Navbar 的結構

分析

  • Kuro 雖然 index 和其他頁面的 Navbar 共用,但我覺得兩者的 input 行為應該不一樣
  • 想要分開寫,先重構之前 index 的 FixedBar

調整

pages/index 引入 HomeNavbar
components/HomNavBar.vue 引入 Logo
components/Logo.vue 專門處理 Logo

切版 Room navbar

需求

切版 Room navbar

分析

  • 感覺和 Home 的 navbar 用法不同,所以拆出 NavBar,跟 HomeNavBar 做區別

調整

pages/room/_id.vue 引入 NavBar
components/NavBar.vue 樣式
components/HomeNavBar.vue 調整 <nav>

切版 Main service

需求

切版 Main service

需求分析

  • head
  • body category room

調整

pages/index.vue

切版 Main fixed-bar

需求

切版 Main fixed-bar

需求分析

  • logo,字體最後再用
  • input,先塞個位置
  • button,寫出基本 hover 樣式

調整

pages/index.vue 用 BEM 寫樣式

assets/scss/tailwind.scss 引入 check, button
check 暫定 datapicker 的 input 樣式
button 按鈕樣式

修改 scss 後,畫面重整太慢

問題

修改 scss 後,畫面重整太慢

問題分析

  • 可能引用方式不適合放在 tailwind.scss 裡
  • 因為整個 tailwind 要重新編譯一次
  • 改放 layout 看看 (x)
  • 改用 nuxt.config.js 引入看看

參考資料

調整

assets/scss/tailwind.scss 只負責引入 tailwind css

nuxt.config.js 在 css 配置 引入 main.scss
assets/scss/base.scss 改名成 main.scss
assets/scss/main.scss 引入 button, check

切版 Main recommend

需求

切版 Main recommend

需求分析

  • recommend head
  • recommend rooms

調整

tailwind.config.js 新增 spacing gutter
index.vue 調整樣式名稱、添加樣式
main.scss 增加 .title 樣式

國定假日行事曆 OPEN API

嘗試加入 datepicker,但出現 document 沒被定義,或元件沒被定義問題

Main Header 切版

需求

Main Header 切版

需求分析

  • h1
  • image
  • reserve-now

調整

pages/index.vue 樣式

Bug ExperimentalWarning: The fs.promises API is experimental

問題

Bug ExperimentalWarning: The fs.promises API is experimental

問題分析

  • 應該是 nodejs v10 版本太低,Promise API 那時還在實驗階段,在 v11 時才改成正式,所以目前才一直跳出提示

https://blog.csdn.net/sunhuansheng/article/details/82841495
https://nodejs.org/zh-tw/
https://www.reddit.com/r/node/comments/db7pzx/is_fspromises_api_still_experimental/

調整項目

  • 重新安裝 nodejs 到 v12
  • 重新安裝 node-sass 和 sass-loader

切版 Thanks

分析

  • width 只有 350*2+30 = 730 而已
  • 順便修改 button 樣式

調整

pages/thanks.vue
components/Navbar.vue 調整 margin-bottom
buttons.scss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.