Last active
September 5, 2019 10:11
-
-
Save trylovetom/bb43b657597473e25dfec65852a03545 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DriverMachine = Machine({ | |
id: '叫車服務(司機端)', | |
initial: '登入頁面', | |
states: { | |
'登入頁面': { | |
on: { | |
'登入流程': '準備上線頁面' | |
} | |
}, | |
'準備上線頁面': { | |
on: { | |
'上線': '地圖頁面(等待訂單請求)' | |
} | |
}, | |
'地圖頁面(等待訂單請求)': { | |
on: { | |
'收到派車請求': '確認頁面', | |
'下線': '準備上線頁面' | |
} | |
}, | |
'確認頁面': { | |
on: { | |
'取消': '地圖頁面(等待訂單請求)', | |
'超過一分鐘': '地圖頁面(等待訂單請求)', | |
'超過一分鐘三次': '準備上線頁面', | |
'確認': '導航頁面(司機位置->上車位置)(訂單進行中)' | |
} | |
}, | |
'導航頁面(司機位置->上車位置)(訂單進行中)': { | |
on: { | |
'超過十分鐘且無法聯繫乘客': '地圖頁面(等待訂單請求)', | |
'乘客上車(司機控制)': '導航頁面(上車位置->下車位置)' | |
} | |
}, | |
'導航頁面(上車位置->下車位置)': { | |
on: { | |
'乘客下車(司機控制)': '訂單結束頁面(訂單結束)' | |
} | |
}, | |
'訂單結束頁面(訂單結束)': { | |
on: { | |
'重新上線': '地圖頁面(等待訂單請求)', | |
'下線': '準備上線頁面' | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment