index.js 9.3 KB

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