Compare commits
No commits in common. 'master' and 'main' have entirely different histories.
@ -1,32 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
pnpm-debug.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
.DS_Store
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
coverage
|
|
||||||
*.local
|
|
||||||
|
|
||||||
/cypress/videos/
|
|
||||||
/cypress/screenshots/
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
.idea
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
|
|
||||||
*.tsbuildinfo
|
|
||||||
|
|
||||||
/unpackage/*
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Subproject commit 9afd67d4320ab967a75ad9a38e65907cb3074bfe
|
|
||||||
|
Before Width: | Height: | Size: 3.9 KiB |
@ -1,12 +0,0 @@
|
|||||||
const apiOther = {
|
|
||||||
/**
|
|
||||||
* 发送手机验证码
|
|
||||||
*/
|
|
||||||
sendMobileCode: (params) => {
|
|
||||||
return uni.$u.http.post("/mobile/get_verify_code", {
|
|
||||||
mobileNo: params.mobileNo, // 手机号码
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default apiOther;
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* 站点接口
|
|
||||||
*/
|
|
||||||
|
|
||||||
const apiStations = {
|
|
||||||
/**
|
|
||||||
* 站点列表
|
|
||||||
*/
|
|
||||||
get: (params) => {
|
|
||||||
return uni.$u.http.get("/stations");
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default apiStations;
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* 车票接口
|
|
||||||
*/
|
|
||||||
|
|
||||||
const apiTickets = {
|
|
||||||
/**
|
|
||||||
* 车票列表
|
|
||||||
*/
|
|
||||||
get: (params) => {
|
|
||||||
return uni.$u.http.get("/tickets", {
|
|
||||||
params: {
|
|
||||||
state: 1, // 已出票(订单已支付)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default apiTickets;
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* 车次接口
|
|
||||||
*/
|
|
||||||
|
|
||||||
const apiTrains = {
|
|
||||||
/**
|
|
||||||
* 车次列表
|
|
||||||
*/
|
|
||||||
get: (params) => {
|
|
||||||
return uni.$u.http.get("/trains/query_train", {
|
|
||||||
params: {
|
|
||||||
from: params.from,
|
|
||||||
to: params.to,
|
|
||||||
date: params.date,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default apiTrains;
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<script>
|
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
||||||
CSS.supports('top: constant(a)'))
|
|
||||||
document.write(
|
|
||||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
||||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
||||||
</script>
|
|
||||||
<title></title>
|
|
||||||
<!--preload-links-->
|
|
||||||
<!--app-context-->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app"><!--app-html--></div>
|
|
||||||
<script type="module" src="/main.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 762 B |
|
Before Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 978 B |
|
Before Width: | Height: | Size: 734 B |
|
Before Width: | Height: | Size: 883 B |
|
Before Width: | Height: | Size: 841 B |
|
Before Width: | Height: | Size: 454 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 510 B |
|
Before Width: | Height: | Size: 525 B |
|
Before Width: | Height: | Size: 800 B |
|
Before Width: | Height: | Size: 652 B |
|
Before Width: | Height: | Size: 579 B |
|
Before Width: | Height: | Size: 944 B |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 578 B |
|
Before Width: | Height: | Size: 594 B |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 366 B |
|
Before Width: | Height: | Size: 558 B |
|
Before Width: | Height: | Size: 186 B |
|
Before Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 727 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 335 KiB |
|
Before Width: | Height: | Size: 652 KiB |
|
Before Width: | Height: | Size: 1023 KiB |
@ -1,35 +0,0 @@
|
|||||||
import Vue from "vue";
|
|
||||||
import Vuex from "vuex";
|
|
||||||
|
|
||||||
import storeAuth from "./modules/auth";
|
|
||||||
|
|
||||||
Vue.use(Vuex);
|
|
||||||
|
|
||||||
const store = new Vuex.Store({
|
|
||||||
state: {
|
|
||||||
stations: [],
|
|
||||||
},
|
|
||||||
mutations: {
|
|
||||||
SET_STATIONS(state, stations) {
|
|
||||||
state.stations = stations || [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
/**
|
|
||||||
* [{ id: 1, name: "长沙南站" }]
|
|
||||||
*/
|
|
||||||
updateStations({ commit }, stations) {
|
|
||||||
commit(
|
|
||||||
"SET_STATIONS",
|
|
||||||
stations.sort((a, b) =>
|
|
||||||
a.pinyin < b.pinyin ? -1 : a.pinyin > b.pinyin ? 1 : 0
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
modules: {
|
|
||||||
auth: storeAuth,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export default store;
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import getDefaultAuth from "./state";
|
|
||||||
|
|
||||||
export function updateAuth({ commit }, auth) {
|
|
||||||
auth = auth ?? getDefaultAuth();
|
|
||||||
if ("token" in auth) uni.setStorageSync("auth-token", auth.token);
|
|
||||||
if ("id" in auth) commit("SET_AUTH_ID", auth.id);
|
|
||||||
if ("account" in auth) commit("SET_AUTH_ACCOUNT", auth.account);
|
|
||||||
if ("name" in auth) commit("SET_AUTH_NAME", auth.name);
|
|
||||||
if ("idCardNo" in auth) commit("SET_AUTH_ID_CARD_NO", auth.idCardNo);
|
|
||||||
if ("mobileNo" in auth) commit("SET_AUTH_MOBILE_NO", auth.mobileNo);
|
|
||||||
if ("bankCardNo" in auth) commit("SET_AUTH_BANK_CARD_NO", auth.bankCardNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function revertAuth({ dispatch }) {
|
|
||||||
dispatch("updateAuth", getDefaultAuth());
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* Auth 代表登录用户信息
|
|
||||||
*/
|
|
||||||
|
|
||||||
import getDefaultAuth from "./state";
|
|
||||||
import * as mutations from "./mutations";
|
|
||||||
import * as actions from "./actions";
|
|
||||||
|
|
||||||
const storeAuth = {
|
|
||||||
state: getDefaultAuth(),
|
|
||||||
mutations,
|
|
||||||
actions,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default storeAuth;
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
import getDefaultAuth from "./state";
|
|
||||||
|
|
||||||
export function SET_AUTH_ID(state, id) {
|
|
||||||
state.id = id || getDefaultAuth().id;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function SET_AUTH_ACCOUNT(state, account) {
|
|
||||||
state.account = account || getDefaultAuth().account;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function SET_AUTH_NAME(state, name) {
|
|
||||||
state.name = name || getDefaultAuth().name;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function SET_AUTH_ID_CARD_NO(state, idCardNo) {
|
|
||||||
state.idCardNo = idCardNo || getDefaultAuth().idCardNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function SET_AUTH_MOBILE_NO(state, mobileNo) {
|
|
||||||
state.mobileNo = mobileNo || getDefaultAuth().mobileNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function SET_AUTH_BANK_CARD_NO(state, bankCardNo) {
|
|
||||||
state.bankCardNo = bankCardNo || getDefaultAuth().bankCardNo;
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
function getDefaultAuth() {
|
|
||||||
return {
|
|
||||||
id: undefined,
|
|
||||||
account: "", // 用户名
|
|
||||||
name: "", // 姓名
|
|
||||||
idCardNo: "", // 身份证号
|
|
||||||
mobileNo: undefined, // 手机号
|
|
||||||
bankCardNo: undefined, // 银行卡号
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getDefaultAuth;
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
uni.addInterceptor({
|
|
||||||
returnValue (res) {
|
|
||||||
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
res.then((res) => res[0] ? reject(res[0]) : resolve(res[1]));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
export function timeAscCompareFn(aTime, bTime) {
|
|
||||||
const at = uni.$u.dayjs(aTime);
|
|
||||||
const bt = uni.$u.dayjs(bTime);
|
|
||||||
|
|
||||||
if (at.isBefore(bt)) return -1;
|
|
||||||
else if (at.isAfter(bt)) return 1;
|
|
||||||
else return 0;
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
uNavbarBgColor: "transparent",
|
|
||||||
uNavbarTitleColor: "transparent",
|
|
||||||
uNavbarIconColor: "var(--color-white)",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onPageScroll(e) {
|
|
||||||
let per = e.scrollTop / 200;
|
|
||||||
if (per < 0) per = 0;
|
|
||||||
else if (per > 1) per = 1;
|
|
||||||
|
|
||||||
this.uNavbarBgColor = `rgba(245,245,245,${per})`;
|
|
||||||
this.uNavbarTitleColor = `rgba(48,49,51,${per})`;
|
|
||||||
this.uNavbarIconColor = `rgba(${255 - (255 - 96) * per},${
|
|
||||||
255 - (255 - 98) * per
|
|
||||||
},${255 - (255 - 102) * per})`;
|
|
||||||
},
|
|
||||||
};
|
|
||||||