index.js 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. import { createRouter, createWebHistory } from "vue-router";
  2. import HomeIndex from "../views/HomeIndex.vue";
  3. import AppIndex from "../views/index/Index.vue";
  4. import MarketIndex from "../views/market/Index.vue";
  5. import AssetIndex from "../views/asset/Index.vue";
  6. import UserIndex from "../views/user/Index.vue";
  7. import ApplyPermission from "../views/index/ApplyPermission.vue";
  8. import SplashScreen from "../views/index/SplashScreen.vue";
  9. import RiskTips from "../views/index/RiskTips.vue";
  10. import SearchIcon from "../views/index/SearchIcon.vue";
  11. import Notification from "../views/notification/Index.vue";
  12. import IndexUser from "../views/index/User.vue";
  13. import UserCenter from "../views/index/UserCenter.vue";
  14. import MarketDetails from "../views/market/details/Index.vue";
  15. import HistoryIndex from "../views/asset/history/Index.vue";
  16. import EntrustDetails from "../views/asset/history/EntrustDetails.vue";
  17. import PositionDetails from "../views/asset/history/PositionDetails.vue";
  18. import IcoIndex from "../views/index/ico/Index.vue";
  19. import LoanIndex from "../views/index/loan/Index.vue";
  20. import LoanRules from "../views/index/loan/Rules.vue";
  21. import UserLoanIndex from "../views/user/loan/Index.vue";
  22. import CommitMessage from "../views/index/loan/CommitMessage.vue";
  23. import ContractTerms from "../views/index/loan/ContractTerms.vue";
  24. import Signature from "../views/index/loan/Signature.vue";
  25. import DeleteAccount from "../views/user/DeleteAccount.vue";
  26. import RechargeIndex from "../views/index/recharge/RechargeIndex.vue";
  27. import WithdrawIndex from "../views/index/recharge/WithdrawIndex.vue";
  28. import RechargeChangeCoin from "../views/index/recharge/ChangeCoin.vue";
  29. import Transfer from "../views/index/recharge/Transfer.vue";
  30. import TransferHistory from "../views/index/recharge/TransferHistory.vue";
  31. import UserAsset from "../views/asset/UserAsset.vue";
  32. import TradeLayout from '@/views/bitcoin/TradeLayout.vue'; // 新建的公共父组件
  33. import TradeFutures from '@/views/bitcoin/TradeFutures.vue'; // (合约)
  34. import TradeSeconds from '@/views/bitcoin/lever/TradeSeconds.vue'; // 秒合约(占位)
  35. import TradeOptions from '@/views/bitcoin/lever/TradeOptions.vue'; // 期权(占位)
  36. import TradeMargin from '@/views/bitcoin/lever/TradeMargin.vue';
  37. import Calculator from '../views/bitcoin/Calculator.vue' // 新建的计算器页面
  38. import TradeSettings from '@/views/bitcoin/CommonFunctionsPopup/GeneralLevel2/TradeSettings.vue'// 新建
  39. import OptionTrading from '@/views/bitcoin/lever/OptionTrading.vue'
  40. const routes = [
  41. {
  42. path: "/",
  43. name: "home",
  44. component: HomeIndex,
  45. children: [
  46. {
  47. path: "",
  48. name: "",
  49. component: AppIndex,
  50. },
  51. {
  52. path: "marketIndex",
  53. name: "marketIndex",
  54. component: MarketIndex,
  55. },
  56. {
  57. path: "/bitcoin",
  58. component: TradeLayout, // 而是布局组件
  59. // 当访问 /bitcoin 时,自动重定向到 /bitcoin/contract
  60. redirect: '/bitcoin/contract',
  61. children: [
  62. // 1. 核心交易子路由
  63. {
  64. path: 'contract',
  65. name: 'TradeContract',
  66. component: TradeFutures, // 核心交易逻辑
  67. meta: { title: '合约' }
  68. },
  69. {
  70. path: 'seconds',
  71. name: 'TradeSeconds',
  72. component: TradeSeconds,
  73. meta: { title: '秒合约' }
  74. },
  75. {
  76. path: 'options',
  77. name: 'TradeOptions',
  78. component: TradeOptions,
  79. meta: { title: '期权' },
  80. },
  81. {
  82. path: "margin",
  83. name: "TradeMargin",
  84. component: TradeMargin,
  85. meta: {title: "杠杆"},
  86. },
  87. {
  88. path: 'settings',
  89. name: 'TradeSettings',
  90. component: TradeSettings
  91. },
  92. ]
  93. },
  94. {
  95. path: 'PnLAnalysis',
  96. name: 'PnLAnalysis.vue',
  97. component: () => import('@/views/bitcoin/lever/PnLAnalysis.vue'),
  98. meta: { title: '' }
  99. },
  100. { path: 'calculator',
  101. name: 'calculator',
  102. component: Calculator },
  103. {
  104. path: 'OptionTrading',
  105. name: 'OptionTrading',
  106. component: OptionTrading,
  107. meta: { title: '' }
  108. },
  109. {
  110. path: "/assetIndex",
  111. name: "assetIndex",
  112. component: AssetIndex,
  113. },
  114. {
  115. path: "/userIndex",
  116. name: "userIndex",
  117. component: UserIndex,
  118. },
  119. ],
  120. },
  121. {
  122. path: "/applyPermission",
  123. name: "applyPermission",
  124. component: ApplyPermission,
  125. },
  126. {
  127. path: "/splashScreen",
  128. name: "splashScreen",
  129. component: SplashScreen,
  130. },
  131. {
  132. path: "/riskTips",
  133. name: "riskTips",
  134. component: RiskTips,
  135. },
  136. {
  137. path: "/searchIcon",
  138. name: "searchIcon",
  139. component: SearchIcon,
  140. },
  141. {
  142. path: "/notification",
  143. name: "notification",
  144. component: Notification,
  145. },
  146. {
  147. path: "/indexUser",
  148. name: "indexUser",
  149. component: IndexUser,
  150. },
  151. {
  152. path: "/userCenter",
  153. name: "userCenter",
  154. component: UserCenter,
  155. },
  156. {
  157. path: "/marketDetails",
  158. name: "marketDetails",
  159. component: MarketDetails,
  160. },
  161. {
  162. path: "/historyIndex",
  163. name: "historyIndex",
  164. component: HistoryIndex,
  165. },
  166. {
  167. path: "/entrustDetails",
  168. name: "entrustDetails",
  169. component: EntrustDetails,
  170. },
  171. {
  172. path: "/positionDetails",
  173. name: "positionDetails",
  174. component: PositionDetails,
  175. },
  176. {
  177. path: "/icoIndex",
  178. name: "icoIndex",
  179. component: IcoIndex,
  180. },
  181. {
  182. path: "/loanIndex",
  183. name: "loanIndex",
  184. component: LoanIndex,
  185. },
  186. {
  187. path: "/loanRules",
  188. name: "loanRules",
  189. component: LoanRules,
  190. },
  191. {
  192. path: "/userLoanIndex",
  193. name: "userLoanIndex",
  194. component: UserLoanIndex,
  195. },
  196. {
  197. path: "/commitMessage",
  198. name: "commitMessage",
  199. component: CommitMessage,
  200. },
  201. {
  202. path: "/contractTerms",
  203. name: "contractTerms",
  204. component: ContractTerms,
  205. },
  206. {
  207. path: "/signature",
  208. name: "signature",
  209. component: Signature,
  210. },
  211. {
  212. path: "/deleteAccount",
  213. name: "deleteAccount",
  214. component: DeleteAccount,
  215. },
  216. {
  217. path: "/rechargeIndex",
  218. name: "rechargeIndex",
  219. component: RechargeIndex,
  220. },
  221. {
  222. path: "/rechargeChangeCoin",
  223. name: "rechargeChangeCoin",
  224. component: RechargeChangeCoin,
  225. },
  226. {
  227. path: "/withdrawIndex",
  228. name: "withdrawIndex",
  229. component: WithdrawIndex,
  230. },
  231. {
  232. path: "/transfer",
  233. name: "transfer",
  234. component: Transfer,
  235. },
  236. {
  237. path: "/transferHistory",
  238. name: "transferHistory",
  239. component: TransferHistory,
  240. },
  241. {
  242. path: "/userAsset",
  243. name: "userAsset",
  244. component: UserAsset,
  245. },
  246. {
  247. path: "/applyPermission",
  248. name: "applyPermission",
  249. component: ApplyPermission,
  250. },
  251. {
  252. path: "/splashScreen",
  253. name: "splashScreen",
  254. component: SplashScreen,
  255. },
  256. {
  257. path: "/riskTips",
  258. name: "riskTips",
  259. component: RiskTips,
  260. },
  261. {
  262. path: "/searchIcon",
  263. name: "searchIcon",
  264. component: SearchIcon,
  265. },
  266. {
  267. path: "/notification",
  268. name: "notification",
  269. component: Notification,
  270. },
  271. {
  272. path: "/indexUser",
  273. name: "indexUser",
  274. component: IndexUser,
  275. },
  276. {
  277. path: "/userCenter",
  278. name: "userCenter",
  279. component: UserCenter,
  280. },
  281. {
  282. path: "/marketDetails",
  283. name: "marketDetails",
  284. component: MarketDetails,
  285. },
  286. {
  287. path: "/historyIndex",
  288. name: "historyIndex",
  289. component: HistoryIndex,
  290. },
  291. {
  292. path: "/entrustDetails",
  293. name: "entrustDetails",
  294. component: EntrustDetails,
  295. },
  296. {
  297. path: "/positionDetails",
  298. name: "positionDetails",
  299. component: PositionDetails,
  300. },
  301. {
  302. path: "/icoIndex",
  303. name: "icoIndex",
  304. component: IcoIndex,
  305. },
  306. {
  307. path: "/loanIndex",
  308. name: "loanIndex",
  309. component: LoanIndex,
  310. },
  311. {
  312. path: "/loanRules",
  313. name: "loanRules",
  314. component: LoanRules,
  315. },
  316. {
  317. path: "/userLoanIndex",
  318. name: "userLoanIndex",
  319. component: UserLoanIndex,
  320. },
  321. {
  322. path: "/rechargeHistory",
  323. name: "rechargeHistory",
  324. component: RechargeHistory,
  325. },
  326. {
  327. path: "/withdrawHistory",
  328. name: "withdrawHistory",
  329. component: WithdrawHistory,
  330. },
  331. {
  332. path: "/financialIndex",
  333. name: "financialIndex",
  334. component: FinancialIndex,
  335. },
  336. {
  337. path: "/financialBuy",
  338. name: "financialBuy",
  339. component: FinancialBuy,
  340. },
  341. {
  342. path: "/myFinancial",
  343. name: "myFinancial",
  344. component: MyFinancial,
  345. },
  346. ];
  347. const router = createRouter({
  348. history: createWebHistory(process.env.BASE_URL),
  349. routes,
  350. });
  351. export default router;