index.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. import Vue from 'vue';
  2. import VueRouter from 'vue-router';
  3. import { Notify } from 'vant';
  4. import Home from '../views/Home.vue';
  5. import Index from '../views/index/index.vue'; //首页
  6. import trade from '../views/trade/index.vue'; //团队
  7. import orders from '../views/trade/orders.vue'; //订单页面
  8. import bulletin from '../views/bulletin/index.vue'; //公告
  9. import bulletinDetail from '../views/bulletin/details.vue'; //公告详情
  10. import service from '../views/bulletin/service.vue'; //服务协议
  11. import mine from '../views/mine/index.vue'; //我的
  12. import invite from '../views/mine/invite.vue'; //邀请
  13. import withdraw from '../views/mine/withdraw.vue'; //提现
  14. // import transfer from '../views/mine/transfer.vue'; //提现
  15. import withdrawRecord from '../views/mine/withdrawRecord.vue'; //提现记录
  16. // import seso from '../views/mine/seso.vue'; //seso
  17. import assets from '../views/mine/assets.vue'; //我的资产
  18. // import introduce from '../views/introduce/index.vue'; //平台介绍
  19. // import datainfo from '../views/datainfo/index.vue'; //首页数据页面
  20. import assetDetails from '../views/mine/assetDetails.vue'; //资产明细页面
  21. import transfer from '../views/transfer/list.vue'; //寄售
  22. import typeDetail from '../views/transfer/typeDetail.vue'; //寄售分类详情
  23. import TransferDetail from '../views/transfer/detail.vue'; //寄售详情
  24. import TransferOrder from '../views/transfer/order.vue'; //寄售确认订单
  25. import initiatePurchase from '../views/transfer/initiatePurchase.vue'; //发起求购
  26. import soldConsignment from '../views/transfer/soldConsignment.vue'; //售出求购
  27. import waitPay from '../views/mine/waitPay.vue'; //待支付
  28. import personal from '../views/mine/personal.vue'; //个人中心页面
  29. import share from '../views/mine/share.vue'; //分享奖励
  30. import language from '../views/mine/language.vue'; //分享奖励
  31. import GoodsDetail from '../views/trade/detail.vue'; //详情
  32. import myTeaFriends from '../views/mine/myTeaFriends.vue'; //我的资产
  33. import setting from '../views/mine/setting.vue'; //设置
  34. // import TransferDetail from '../views/mine/TransferDetail.vue'; //寄售详情
  35. import recharge from '../views/mine/recharge.vue'; //充值
  36. import rechargeRecord from '../views/mine/rechargeRecord.vue'; //充值记录
  37. import sendChaBao from '../views/mine/sendChaBao.vue'; //转账茶宝
  38. import teaRights from '../views/mine/teaRights.vue'; //我的茶权
  39. import operationLog from '../views/mine/operationLog.vue'; //操作记录
  40. import welfare from '../views/index/welfare.vue'; //新人福利
  41. import teaTalk from '../views/mine/teaTalk.vue'; //茶说
  42. import synthesis from '../views/mine/synthesis.vue'; //合成中心
  43. import synthesisDetail from '../views/mine/synthesisDetail.vue'; //合成详情
  44. import rule from '../views/rule/index.vue'; //合成规则
  45. import storage from '../views/storage/list.vue'; //茶权存储
  46. import MulStorageDetail from '../views/storage/mulDetail.vue'; //组合茶权存储详情
  47. import SingleStorageDetail from '../views/storage/singleDetail.vue'; //单个茶权存储详情
  48. import storing from '../views/storage/storing.vue'; //我的茶矿
  49. import frozenTransfer from '../views/mine/frozenTransfer.vue'; //转账标记茶宝
  50. import C2CList from '../views/c2c/list.vue'; //c2c列表
  51. import teacSell from '../views/c2c/sell.vue'; //c2c出售
  52. import teacBuy from '../views/c2c/buy.vue'; //c2c求购
  53. import exchange from '../views/exchange/exchange.vue'; //福利兑换
  54. import exchangeList from '../views/exchange/index.vue'; //兑换
  55. import kf from '../views/index/kf.vue'; //客服
  56. import exList from '../views/teacEx/index.vue'; //Teac兑换
  57. import exDetail from '../views/teacEx/detail.vue'; //Teac兑换详情
  58. Vue.use(VueRouter);
  59. const routes = [
  60. {
  61. path: '/',
  62. redirect: '/',
  63. component: Home,
  64. children: [
  65. {
  66. path: '/',
  67. name: 'Index',
  68. component: Index,
  69. },
  70. {
  71. path: 'trade',
  72. name: 'trade',
  73. component: trade,
  74. meta: {
  75. requiresAuth: true
  76. }
  77. },
  78. {
  79. path: 'mine',
  80. name: 'mine',
  81. component: mine,
  82. meta: {
  83. requiresAuth: true
  84. }
  85. },
  86. {
  87. path: 'invite',
  88. name: 'invite',
  89. component: invite,
  90. meta: {
  91. requiresAuth: true
  92. }
  93. },
  94. {
  95. path: 'withdraw',
  96. name: 'withdraw',
  97. component: withdraw,
  98. meta: {
  99. requiresAuth: true
  100. }
  101. },
  102. {
  103. path: 'withdrawRecord',
  104. name: 'withdrawRecord',
  105. component: withdrawRecord,
  106. meta: {
  107. requiresAuth: true
  108. }
  109. },
  110. {
  111. path: 'assets',
  112. name: 'assets',
  113. component: assets,
  114. meta: {
  115. requiresAuth: true
  116. }
  117. },
  118. {
  119. path: 'bulletin',
  120. name: 'bulletin',
  121. component: bulletin,
  122. meta: {
  123. requiresAuth: true
  124. }
  125. },
  126. {
  127. path: 'bulletinDetail',
  128. name: 'bulletinDetail',
  129. component: bulletinDetail,
  130. meta: {
  131. requiresAuth: true
  132. }
  133. },
  134. {
  135. path: 'assetDetails',
  136. name: 'assetDetails',
  137. component: assetDetails,
  138. meta: {
  139. requiresAuth: true
  140. }
  141. },
  142. {
  143. path: 'transfer',
  144. name: 'transfer',
  145. component: transfer,
  146. meta: {
  147. requiresAuth: true
  148. }
  149. },
  150. {
  151. path: 'orders',
  152. name: 'orders',
  153. component: orders,
  154. meta: {
  155. requiresAuth: true
  156. }
  157. },
  158. {
  159. path: 'personal',
  160. name: 'personal',
  161. component: personal,
  162. meta: {
  163. requiresAuth: true
  164. }
  165. },
  166. {
  167. path: 'share',
  168. name: 'share',
  169. component: share,
  170. meta: {
  171. requiresAuth: true
  172. }
  173. },
  174. {
  175. path: 'GoodsDetail',
  176. name: 'GoodsDetail',
  177. component: GoodsDetail,
  178. meta: {
  179. requiresAuth: true
  180. }
  181. },
  182. {
  183. path: 'myTeaFriends',
  184. name: 'myTeaFriends',
  185. component: myTeaFriends,
  186. meta: {
  187. requiresAuth: true
  188. }
  189. },
  190. {
  191. path: 'setting',
  192. name: 'setting',
  193. component: setting,
  194. meta: {
  195. requiresAuth: true
  196. }
  197. },
  198. {
  199. path: 'language',
  200. name: 'language',
  201. component: language,
  202. meta: {
  203. requiresAuth: true
  204. }
  205. },
  206. {
  207. path: 'TransferDetail',
  208. name: 'TransferDetail',
  209. component: TransferDetail,
  210. meta: {
  211. requiresAuth: true
  212. }
  213. },
  214. {
  215. path: 'recharge',
  216. name: 'recharge',
  217. component: recharge,
  218. meta: {
  219. requiresAuth: true
  220. }
  221. },
  222. {
  223. path: 'rechargeRecord',
  224. name: 'rechargeRecord',
  225. component: rechargeRecord,
  226. meta: {
  227. requiresAuth: true
  228. }
  229. },
  230. {
  231. path: 'sendChaBao',
  232. name: 'sendChaBao',
  233. component: sendChaBao,
  234. meta: {
  235. requiresAuth: true
  236. }
  237. },
  238. {
  239. path: 'teaRights',
  240. name: 'teaRights',
  241. component: teaRights,
  242. meta: {
  243. requiresAuth: true
  244. }
  245. },
  246. {
  247. path: 'operationLog',
  248. name: 'operationLog',
  249. component: operationLog,
  250. meta: {
  251. requiresAuth: true
  252. }
  253. },
  254. {
  255. path: 'welfare',
  256. name: 'welfare',
  257. component: welfare,
  258. meta: {
  259. requiresAuth: true
  260. }
  261. },
  262. {
  263. path: 'teaTalk',
  264. name: 'teaTalk',
  265. component: teaTalk,
  266. meta: {
  267. requiresAuth: true
  268. }
  269. },
  270. {
  271. path: 'synthesis',
  272. name: 'synthesis',
  273. component: synthesis,
  274. meta: {
  275. requiresAuth: true
  276. }
  277. },
  278. {
  279. path: 'synthesisDetail',
  280. name: 'synthesisDetail',
  281. component: synthesisDetail,
  282. meta: {
  283. requiresAuth: true
  284. }
  285. },
  286. {
  287. path: 'rule',
  288. name: 'rule',
  289. component: rule,
  290. meta: {
  291. requiresAuth: true
  292. }
  293. },
  294. {
  295. path: 'storage',
  296. name: 'storage',
  297. component: storage,
  298. meta: {
  299. requiresAuth: true
  300. }
  301. },
  302. {
  303. path: 'MulStorageDetail',
  304. name: 'MulStorageDetail',
  305. component: MulStorageDetail,
  306. meta: {
  307. requiresAuth: true
  308. }
  309. },
  310. {
  311. path: 'SingleStorageDetail',
  312. name: 'SingleStorageDetail',
  313. component: SingleStorageDetail,
  314. meta: {
  315. requiresAuth: true
  316. }
  317. },
  318. {
  319. path: 'storing',
  320. name: 'storing',
  321. component: storing,
  322. meta: {
  323. requiresAuth: true
  324. }
  325. },
  326. {
  327. path: 'frozenTransfer',
  328. name: 'frozenTransfer',
  329. component: frozenTransfer,
  330. meta: {
  331. requiresAuth: true
  332. }
  333. },
  334. {
  335. path: 'typeDetail',
  336. name: 'typeDetail',
  337. component: typeDetail,
  338. meta: {
  339. requiresAuth: true
  340. }
  341. },
  342. {
  343. path: 'TransferOrder',
  344. name: 'TransferOrder',
  345. component: TransferOrder,
  346. meta: {
  347. requiresAuth: true
  348. }
  349. },
  350. {
  351. path: 'initiatePurchase',
  352. name: 'initiatePurchase',
  353. component: initiatePurchase,
  354. meta: {
  355. requiresAuth: true
  356. }
  357. },
  358. {
  359. path: 'soldConsignment',
  360. name: 'soldConsignment',
  361. component: soldConsignment,
  362. meta: {
  363. requiresAuth: true
  364. }
  365. },
  366. {
  367. path: 'waitPay',
  368. name: 'waitPay',
  369. component: waitPay,
  370. meta: {
  371. requiresAuth: true
  372. }
  373. },
  374. {
  375. path: 'service',
  376. name: 'service',
  377. component: service,
  378. meta: {
  379. requiresAuth: true
  380. }
  381. },
  382. {
  383. path: 'C2CList',
  384. name: 'C2CList',
  385. component: C2CList,
  386. meta: {
  387. requiresAuth: true
  388. }
  389. },
  390. {
  391. path: 'teacSell',
  392. name: 'teacSell',
  393. component: teacSell,
  394. meta: {
  395. requiresAuth: true
  396. }
  397. },
  398. {
  399. path: 'teacBuy',
  400. name: 'teacBuy',
  401. component: teacBuy,
  402. meta: {
  403. requiresAuth: true
  404. }
  405. },
  406. {
  407. path: 'exchange',
  408. name: 'exchange',
  409. component: exchange,
  410. meta: {
  411. requiresAuth: true
  412. }
  413. },
  414. {
  415. path: 'kf',
  416. name: 'kf',
  417. component: kf,
  418. meta: {
  419. requiresAuth: true
  420. }
  421. },
  422. {
  423. path: 'exList',
  424. name: 'exList',
  425. component: exList,
  426. meta: {
  427. requiresAuth: true
  428. }
  429. },
  430. {
  431. path: 'exDetail',
  432. name: 'exDetail',
  433. component: exDetail,
  434. meta: {
  435. requiresAuth: true
  436. }
  437. },
  438. {
  439. path: 'exchangeList',
  440. name: 'exchangeList',
  441. component: exchangeList,
  442. meta: {
  443. requiresAuth: true
  444. }
  445. },
  446. ],
  447. },
  448. ];
  449. const router = new VueRouter({
  450. // mode: 'hash',
  451. mode: 'history',
  452. // base: './',
  453. routes,
  454. });
  455. // router.beforeEach((to, from, next) => {
  456. // let parentId = localStorage.getItem('parentId')
  457. // if (to.meta.requiresAuth) {
  458. // if (parentId != 0) {
  459. // // 判断是否有上级
  460. // next()
  461. // } else {
  462. // next({ path: "/" })
  463. // }
  464. // } else {
  465. // next()
  466. // };
  467. // });
  468. export default router;