menu.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div class="left_nav">
  3. <div class="nav_title flex flex-a-c ">
  4. 个人中心
  5. </div>
  6. <div class="nav flex flex-a-c " v-for="(item,index) in menu" :key="index" :class="[item.name==name?'color_red':'']"
  7. @click="toUrl(item.name)">
  8. {{item.text}}
  9. </div>
  10. <div class="nav flex flex-a-c " @click="toUrl('market')"
  11. :class="[
  12. name=='application_market'||
  13. name=='member-workerOrderlist'||
  14. name=='member-workerOrderDetail-id'||
  15. name=='member-userOrderDetail-id'||
  16. name=='member-userOrderlist'||
  17. name=='member-workerApply'||
  18. name=='market'?'color_red':''
  19. ]">
  20. 营销互动
  21. </div>
  22. <div class="nav flex flex-a-c " @click="toUrl('member-extension')"
  23. :class="[name=='member-extension'?'color_red':'']">
  24. 推广中心
  25. </div>
  26. <div class="nav flex flex-a-c " @click="toSet">
  27. 个人资料
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import {mapState} from "vuex";
  33. export default {
  34. data() {
  35. return {
  36. name: "",
  37. menu: [
  38. {
  39. name: "order",
  40. text: "我的订单"
  41. },
  42. {
  43. name: "cart",
  44. text: "购物车"
  45. },
  46. {
  47. name: "member-collection",
  48. text: "我的收藏"
  49. },
  50. {
  51. name: "coupon-coupon_index",
  52. text: "优惠券"
  53. },
  54. {
  55. name: "coupon-coupon_store",
  56. text: "领券中心"
  57. },
  58. {
  59. name: "member-balance",
  60. text: ""
  61. },
  62. {
  63. name: "member-integral_v2",
  64. text: ""
  65. },
  66. {
  67. name: "member-address",
  68. text: "收件人管理"
  69. }
  70. ]
  71. };
  72. },
  73. components: {},
  74. mounted() {
  75. this.menu[5].text = this.basic_info.balance && this.basic_info.balance.balance ? this.basic_info.balance.balance : '余额';
  76. this.menu[6].text = this.basic_info.home && this.basic_info.home.mailInfo && this.basic_info.home.mailInfo.credit1 ? this.basic_info.home.mailInfo.credit1 : '积分';
  77. this.name = this.$route.name;
  78. },
  79. computed: {
  80. ...mapState(["basic_info"])
  81. },
  82. methods: {
  83. toSet() {
  84. window.location.href = this.fun.toRealURl(`member/info`);
  85. },
  86. toUrl(url) {
  87. this.$router.push(this.fun.getUrl(url));
  88. }
  89. }
  90. };
  91. </script>
  92. <style lang="scss" scoped>
  93. .left_nav {
  94. width: 236px;
  95. box-sizing: border-box;
  96. min-height: 600px;
  97. .nav {
  98. border: solid 1px #f0f0f0;
  99. border-bottom: none;
  100. border-top: none;
  101. width: 234px;
  102. height: 60px;
  103. box-sizing: border-box;
  104. padding-left: 36px;
  105. color: #999999;
  106. font-size: 16px;
  107. cursor: pointer;
  108. }
  109. .nav:last-child {
  110. border-bottom: solid 1px #f0f0f0;
  111. }
  112. .nav_title {
  113. width: 236px;
  114. height: 60px;
  115. box-sizing: border-box;
  116. padding-left: 36px;
  117. background-color: #f5f5f5;
  118. color: #202020;
  119. font-size: 16px;
  120. }
  121. .color_red {
  122. color: $red !important;
  123. }
  124. }
  125. </style>