index.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. import { createRouter, createWebHashHistory } 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 OTCMessageIndex from "@/views/asset/otc/message/Index.vue";
  33. import OTCOrderIndex from "@/views/asset/otc/order/Index.vue";
  34. import OTCTransactionIndex from "@/views/asset/otc/transaction/Index.vue";
  35. import OTCUserIndex from "@/views/asset/otc/user/Index.vue";
  36. import CloudCalculator from "@/views/index/cloudComputingPower/Calculator.vue";
  37. import StakingIndex from "@/views/index/staking/Index.vue";
  38. import StakingRules from "@/views/index/staking/Rules.vue";
  39. import StakingRecord from "@/views/index/staking/Record.vue";
  40. import OTCIndex from "@/views/asset/otc/Index.vue";
  41. import MyPower from "@/views/index/cloudComputingPower/MyPower.vue";
  42. import MiningOutput from "@/views/index/cloudComputingPower/MiningOutput.vue";
  43. import ElectricityRecharge from "@/views/index/cloudComputingPower/ElectricityRecharge.vue";
  44. import ElectricitySetting from "@/views/index/cloudComputingPower/ElectricitySetting.vue";
  45. import ElectricityBill from "@/views/index/cloudComputingPower/ElectricityBill.vue";
  46. import CloudMyOrder from "@/views/index/cloudComputingPower/MyOrder.vue";
  47. import CloudComPowerIndex from "@/views/index/cloudComputingPower/Index.vue";
  48. import ComboDetails from "@/views/index/cloudComputingPower/ComboDetails.vue";
  49. import RechargeHistory from "../views/index/recharge/RechargeHistory.vue";
  50. import WithdrawHistory from "../views/index/recharge/WithdrawHistory.vue";
  51. import FinancialIndex from "../views/index/financial/Index.vue";
  52. import FinancialBuy from "../views/index/financial/Buy.vue";
  53. import MyFinancial from "../views/index/financial/MyFinancial.vue";
  54. import AddzfbAccount from "@/views/asset/otc/transaction/AddzfbAccount.vue";
  55. import AddBankAccount from "@/views/asset/otc/transaction/AddBankAccount.vue";
  56. import OTCMerchantDetails from "@/views/asset/otc/user/MerchantDetails.vue";
  57. import MyFollow from "@/views/asset/otc/user/MyFollow.vue";
  58. import LevelLimit from "@/views/asset/otc/user/LevelLimit.vue";
  59. import TransactionGuide from "@/views/asset/otc/user/TransactionGuide.vue";
  60. import CommonFunctionsPopup from "@/views/bitcoin/CommonFunctionsPopup/CommonFunctionsPopup.vue"; // 子组件路径
  61. import TradeRules from "@/views/bitcoin/CommonFunctionsPopup/GeneralLevel2/TradeRules.vue"; // 新建
  62. import TradeLayout from "@/views/bitcoin/TradeLayout.vue"; // 新建的公共父组件
  63. import TradeFutures from "@/views/bitcoin/TradeFutures.vue"; // (合约)
  64. import TradeSeconds from "@/views/bitcoin/lever/TradeSeconds.vue"; // 秒合约(占位)
  65. import TradeOptions from "@/views/bitcoin/lever/TradeOptions.vue"; // 期权(占位)
  66. import TradeMargin from "@/views/bitcoin/lever/TradeMargin.vue";
  67. import Calculator from "../views/bitcoin/Calculator.vue"; // 新建的计算器页面
  68. import TradeSettings from "@/views/bitcoin/CommonFunctionsPopup/GeneralLevel2/TradeSettings.vue"; // 新建
  69. import OptionTrading from "@/views/bitcoin/lever/OptionTrading.vue";
  70. import AddressAuth from "@/views/user/AddressAuth.vue";
  71. import RelativeAuth from "@/views/user/RelativeAuth.vue";
  72. import LanguageSwitch from "@/views/user/LanguageSwitch.vue"; //语言国际化
  73. const routes = [
  74. {
  75. path: "/",
  76. name: "home",
  77. component: HomeIndex,
  78. children: [
  79. {
  80. path: "",
  81. name: "appIndex",
  82. component: AppIndex,
  83. },
  84. {
  85. path: "marketIndex",
  86. name: "marketIndex",
  87. component: MarketIndex,
  88. },
  89. {
  90. path: "/bitcoin",
  91. component: TradeLayout, // 而是布局组件
  92. // 当访问 /bitcoin 时,自动重定向到 /bitcoin/contract
  93. redirect: "/bitcoin/CryptocurrencyTrading",
  94. children: [
  95. // 1. 核心交易子路由
  96. {
  97. path: "contract",
  98. name: "TradeContract",
  99. component: TradeFutures, // 核心交易逻辑
  100. meta: { title: "合约" },
  101. },
  102. {
  103. path: "seconds",
  104. name: "TradeSeconds",
  105. component: TradeSeconds,
  106. meta: { title: "秒合约" },
  107. },
  108. {
  109. path: "options",
  110. name: "TradeOptions",
  111. component: TradeOptions,
  112. meta: { title: "期权" },
  113. },
  114. {
  115. path: "CryptocurrencyTrading",
  116. name: "Cryptocurrency",
  117. component: () => import("@/views/bitcoin/lever/CryptocurrencyTrading.vue"),
  118. meta: { title: "币币交易" },
  119. },
  120. {
  121. path: "margin",
  122. name: "TradeMargin",
  123. component: TradeMargin,
  124. meta: { title: "杠杆" },
  125. },
  126. {
  127. path: "settings",
  128. name: "TradeSettings",
  129. component: TradeSettings,
  130. },
  131. ],
  132. },
  133. { path: "calculator", name: "calculator", component: Calculator },
  134. {
  135. path: "OptionTrading",
  136. name: "OptionTrading",
  137. component: OptionTrading,
  138. meta: { title: "" },
  139. },
  140. {
  141. path: "/assetIndex",
  142. name: "assetIndex",
  143. component: AssetIndex,
  144. },
  145. {
  146. path: "/userIndex",
  147. name: "userIndex",
  148. component: UserIndex,
  149. },
  150. ],
  151. },
  152. {
  153. path: "/AdvancedCertification",
  154. name: "AdvancedCertification",
  155. component: () => import("@/views/user/AdvancedCertification.vue"),
  156. meta: { title: "" },
  157. },
  158. {
  159. path: "/PnLAnalysis",
  160. name: "PnLAnalysis",
  161. component: () => import("@/views/bitcoin/lever/PnLAnalysis.vue"),
  162. meta: { title: "" },
  163. },
  164. {
  165. path: "/otcIndex",
  166. name: "otcIndex",
  167. component: OTCIndex,
  168. children: [
  169. {
  170. path: "",
  171. name: "otcTransactionIndex",
  172. component: OTCTransactionIndex,
  173. },
  174. {
  175. path: "/otcMessageIndex",
  176. name: "otcMessageIndex",
  177. component: OTCMessageIndex,
  178. },
  179. {
  180. path: "/otcOrderIndex",
  181. name: "otcOrderIndex",
  182. component: OTCOrderIndex,
  183. },
  184. {
  185. path: "/otcUserIndex",
  186. name: "otcUserIndex",
  187. component: OTCUserIndex,
  188. },
  189. ],
  190. },
  191. {
  192. path: "/detail",
  193. name: "HelpCenter",
  194. // 记得创建这个 Detail.vue 文件
  195. component: () => import("@/views/user/HelpCenter.vue"),
  196. },
  197. {
  198. // 动态路由,接收一个 id 参数
  199. path: "/help/detail",
  200. name: "HelpDetail",
  201. component: () => import("@/views/user/HelpDetail.vue"),
  202. },
  203. {
  204. path: "/about",
  205. name: "AboutUs",
  206. component: () => import("@/views/user/AboutUs.vue"),
  207. },
  208. {
  209. path: "/about/privacy",
  210. name: "PrivacyPolicy",
  211. component: () => import("@/views/user/PrivacyPolicy.vue"),
  212. },
  213. {
  214. path: "/about/agreement",
  215. name: "UserAgreement",
  216. component: () => import("@/views/user/UserAgreement.vue"),
  217. },
  218. {
  219. path: "/invite",
  220. name: "InviteCenter",
  221. component: () => import("@/views/user/InviteCenter.vue"), // 上面的组件
  222. },
  223. {
  224. path: "/invite/poster",
  225. name: "InvitePoster",
  226. component: () => import("@/views/user/InvitePoster.vue"),
  227. },
  228. {
  229. path: "/vip",
  230. name: "VipCenter",
  231. component: () => import("@/views/user/VipCenter.vue"),
  232. },
  233. {
  234. path: "/vip/rules",
  235. name: "VipRules",
  236. component: () => import("@/views/user/VipRules.vue"),
  237. },
  238. {
  239. path: "/kyc/step1",
  240. name: "KycForm",
  241. component: () => import("@/views/user/KycForm.vue"), // 填写表单
  242. },
  243. {
  244. path: "/kyc/step2",
  245. name: "KycUpload",
  246. component: () => import("@/views/user/KycUpload.vue"), // 上传证件
  247. },
  248. {
  249. path: "/security",
  250. name: "SecuritySettings",
  251. component: () => import("@/views/user/SecuritySettings.vue"), // 核心页面
  252. },
  253. {
  254. path: "/set-password",
  255. name: "SetPassword",
  256. component: () => import("@/views/user/SetPassword.vue"), // 新页面
  257. },
  258. {
  259. path: "/delete-account",
  260. name: "DeleteAccount",
  261. component: () => import("@/views/user/DeleteAccount.vue"), // 新页面
  262. },
  263. {
  264. // 地址认证:复用同一个组件,通过 query 参数 type 来区分是 "home" 还是 "work"
  265. path: "/auth/address",
  266. name: "address-auth",
  267. component: AddressAuth,
  268. },
  269. {
  270. // 亲属认证
  271. path: "/auth/relative",
  272. name: "relative-auth",
  273. component: RelativeAuth,
  274. },
  275. {
  276. path: "/language",
  277. name: "LanguageSwitch",
  278. component: LanguageSwitch,
  279. meta: { title: "切换语言" },
  280. },
  281. {
  282. path: "/basic-verify",
  283. name: "BasicVerify",
  284. component: () => import("@/views/user/BasicVerify.vue"),
  285. meta: { title: "基础认证" },
  286. },
  287. {
  288. path: "/applyPermission",
  289. name: "applyPermission",
  290. component: ApplyPermission,
  291. },
  292. {
  293. path: "/splashScreen",
  294. name: "splashScreen",
  295. component: SplashScreen,
  296. },
  297. {
  298. path: "/riskTips",
  299. name: "riskTips",
  300. component: RiskTips,
  301. },
  302. {
  303. path: "/searchIcon",
  304. name: "searchIcon",
  305. component: SearchIcon,
  306. },
  307. {
  308. path: "/notification",
  309. name: "notification",
  310. component: Notification,
  311. },
  312. {
  313. path: "/indexUser",
  314. name: "indexUser",
  315. component: IndexUser,
  316. },
  317. {
  318. path: "/userCenter",
  319. name: "userCenter",
  320. component: UserCenter,
  321. },
  322. {
  323. path: "/marketDetails",
  324. name: "marketDetails",
  325. component: MarketDetails,
  326. },
  327. {
  328. path: "/historyIndex",
  329. name: "historyIndex",
  330. component: HistoryIndex,
  331. },
  332. {
  333. path: "/entrustDetails",
  334. name: "entrustDetails",
  335. component: EntrustDetails,
  336. },
  337. {
  338. path: "/positionDetails",
  339. name: "positionDetails",
  340. component: PositionDetails,
  341. },
  342. {
  343. path: "/icoIndex",
  344. name: "icoIndex",
  345. component: IcoIndex,
  346. },
  347. {
  348. path: "/loanIndex",
  349. name: "loanIndex",
  350. component: LoanIndex,
  351. },
  352. {
  353. path: "/loanRules",
  354. name: "loanRules",
  355. component: LoanRules,
  356. },
  357. {
  358. path: "/userLoanIndex",
  359. name: "userLoanIndex",
  360. component: UserLoanIndex,
  361. },
  362. {
  363. path: "/commitMessage",
  364. name: "commitMessage",
  365. component: CommitMessage,
  366. },
  367. {
  368. path: "/contractTerms",
  369. name: "contractTerms",
  370. component: ContractTerms,
  371. },
  372. {
  373. path: "/signature",
  374. name: "signature",
  375. component: Signature,
  376. },
  377. {
  378. path: "/deleteAccount",
  379. name: "deleteAccount",
  380. component: DeleteAccount,
  381. },
  382. {
  383. path: "/rechargeIndex",
  384. name: "rechargeIndex",
  385. component: RechargeIndex,
  386. },
  387. {
  388. path: "/rechargeChangeCoin",
  389. name: "rechargeChangeCoin",
  390. component: RechargeChangeCoin,
  391. },
  392. {
  393. path: "/withdrawIndex",
  394. name: "withdrawIndex",
  395. component: WithdrawIndex,
  396. },
  397. {
  398. path: "/transfer",
  399. name: "transfer",
  400. component: Transfer,
  401. },
  402. {
  403. path: "/transferHistory",
  404. name: "transferHistory",
  405. component: TransferHistory,
  406. },
  407. {
  408. path: "/userAsset",
  409. name: "userAsset",
  410. component: UserAsset,
  411. },
  412. {
  413. path: "/applyPermission",
  414. name: "applyPermission",
  415. component: ApplyPermission,
  416. },
  417. {
  418. path: "/splashScreen",
  419. name: "splashScreen",
  420. component: SplashScreen,
  421. },
  422. {
  423. path: "/riskTips",
  424. name: "riskTips",
  425. component: RiskTips,
  426. },
  427. {
  428. path: "/searchIcon",
  429. name: "searchIcon",
  430. component: SearchIcon,
  431. },
  432. {
  433. path: "/notification",
  434. name: "notification",
  435. component: Notification,
  436. },
  437. {
  438. path: "/indexUser",
  439. name: "indexUser",
  440. component: IndexUser,
  441. },
  442. {
  443. path: "/userCenter",
  444. name: "userCenter",
  445. component: UserCenter,
  446. },
  447. {
  448. path: "/marketDetails",
  449. name: "marketDetails",
  450. component: MarketDetails,
  451. },
  452. {
  453. path: "/historyIndex",
  454. name: "historyIndex",
  455. component: HistoryIndex,
  456. },
  457. {
  458. path: "/entrustDetails",
  459. name: "entrustDetails",
  460. component: EntrustDetails,
  461. },
  462. {
  463. path: "/positionDetails",
  464. name: "positionDetails",
  465. component: PositionDetails,
  466. },
  467. {
  468. path: "/icoIndex",
  469. name: "icoIndex",
  470. component: IcoIndex,
  471. },
  472. {
  473. path: "/loanIndex",
  474. name: "loanIndex",
  475. component: LoanIndex,
  476. },
  477. {
  478. path: "/loanRules",
  479. name: "loanRules",
  480. component: LoanRules,
  481. },
  482. {
  483. path: "/userLoanIndex",
  484. name: "userLoanIndex",
  485. component: UserLoanIndex,
  486. },
  487. {
  488. path: "/rechargeHistory",
  489. name: "rechargeHistory",
  490. component: RechargeHistory,
  491. },
  492. {
  493. path: "/withdrawHistory",
  494. name: "withdrawHistory",
  495. component: WithdrawHistory,
  496. },
  497. {
  498. path: "/financialIndex",
  499. name: "financialIndex",
  500. component: FinancialIndex,
  501. },
  502. {
  503. path: "/financialBuy",
  504. name: "financialBuy",
  505. component: FinancialBuy,
  506. },
  507. {
  508. path: "/myFinancial",
  509. name: "myFinancial",
  510. component: MyFinancial,
  511. },
  512. {
  513. path: "/cloudComPowerIndex",
  514. name: "cloudComPowerIndex",
  515. component: CloudComPowerIndex,
  516. },
  517. {
  518. path: "/comboDetails",
  519. name: "comboDetails",
  520. component: ComboDetails,
  521. },
  522. {
  523. path: "/myPower",
  524. name: "myPower",
  525. component: MyPower,
  526. },
  527. {
  528. path: "/miningOutput",
  529. name: "miningOutput",
  530. component: MiningOutput,
  531. },
  532. {
  533. path: "/electricityRecharge",
  534. name: "electricityRecharge",
  535. component: ElectricityRecharge,
  536. },
  537. {
  538. path: "/electricitySetting",
  539. name: "electricitySetting",
  540. component: ElectricitySetting,
  541. },
  542. {
  543. path: "/electricityBill",
  544. name: "electricityBill",
  545. component: ElectricityBill,
  546. },
  547. {
  548. path: "/cloudMyOrder",
  549. name: "cloudMyOrder",
  550. component: CloudMyOrder,
  551. },
  552. {
  553. path: "/cloudCalculator",
  554. name: "cloudCalculator",
  555. component: CloudCalculator,
  556. },
  557. {
  558. path: "/stakingIndex",
  559. name: "stakingIndex",
  560. component: StakingIndex,
  561. },
  562. {
  563. path: "/stakingRules",
  564. name: "stakingRules",
  565. component: StakingRules,
  566. },
  567. {
  568. path: "/stakingRecord",
  569. name: "stakingRecord",
  570. component: StakingRecord,
  571. },
  572. {
  573. path: "/addzfbAccount",
  574. name: "addzfbAccount",
  575. component: AddzfbAccount,
  576. },
  577. {
  578. path: "/addBankAccount",
  579. name: "addBankAccount",
  580. component: AddBankAccount,
  581. },
  582. {
  583. path: "/OTCMerchantDetails",
  584. name: "OTCMerchantDetails",
  585. component: OTCMerchantDetails,
  586. },
  587. {
  588. path: "/myFollow",
  589. name: "myFollow",
  590. component: MyFollow,
  591. },
  592. {
  593. path: "/levelLimit",
  594. name: "levelLimit",
  595. component: LevelLimit,
  596. },
  597. {
  598. path: "/transactionGuide",
  599. name: "transactionGuide",
  600. component: TransactionGuide,
  601. },
  602. ];
  603. const router = createRouter({
  604. history: createWebHashHistory(),
  605. routes,
  606. });
  607. export default router;