leftMenu.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <el-menu
  3. :collapse="isCollapse"
  4. background-color="#FA7D22"
  5. text-color="#FFFFFF"
  6. active-text-color="#FA7D22"
  7. :default-active="$route.path"
  8. style="width: 115px"
  9. router
  10. >
  11. <div class="logo">
  12. <img
  13. src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/logo.png"
  14. alt=""
  15. />
  16. </div>
  17. <div v-for="(item, index1) in menu" :key="index1">
  18. <!-- <el-submenu :index="index1+'a'" v-if="item.children && item.children.length > 0">-->
  19. <!-- <template slot="title">-->
  20. <!-- <i :class="item.icon"></i>-->
  21. <!-- <span v-show="!isCollapse" slot="title">{{ item.name }}</span>-->
  22. <!-- </template>-->
  23. <!-- <div v-for="(child,index2) in item.children" :key="'second'+index2">-->
  24. <!-- <el-menu-item :index="child.path">-->
  25. <!-- <i :class="child.icon"></i>-->
  26. <!-- <span slot="title">{{ child.name }}</span>-->
  27. <!-- </el-menu-item>-->
  28. <!-- </div>-->
  29. <!-- </el-submenu>-->
  30. <div
  31. class="el-menu-item"
  32. @click="handleSelect(index1, item)"
  33. :index="item.path"
  34. :class="index1 == nowIndex ? 'active' : ''"
  35. :style="
  36. index1 + 1 == nowIndex
  37. ? 'padding-bottom:0px'
  38. : index1 - 1 == nowIndex
  39. ? 'padding-top:0px'
  40. : ''
  41. "
  42. >
  43. <img :src="index1 == nowIndex ? item.icon : item.unicon" /><span
  44. slot="title"
  45. >{{ item.name }}</span
  46. >
  47. </div>
  48. </div>
  49. </el-menu>
  50. </template>
  51. <script>
  52. // import memberLogic from '@/server/memberLogic.js'
  53. export default {
  54. props: ["isCollapse"],
  55. data() {
  56. return {
  57. menu: [
  58. {
  59. name: "首页",
  60. path: "/home",
  61. unicon:
  62. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unhome.png",
  63. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/home.png",
  64. },
  65. {
  66. name: "测肤记录",
  67. path: "/testSkin",
  68. unicon:
  69. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unskin.png",
  70. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/Skin.png",
  71. },
  72. {
  73. name: "发券中心",
  74. path: "/coupon",
  75. unicon:
  76. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/uncoupon.png",
  77. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/coupon.png",
  78. },
  79. // {
  80. // name: "历史订单",
  81. // path: "/historicalOrder",
  82. // unicon:
  83. // "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unhistory.png",
  84. // icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/history.png",
  85. // },
  86. {
  87. name: "订单中心",
  88. path: "/orderCenter",
  89. unicon:
  90. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unhistory.png",
  91. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/history.png",
  92. },
  93. {
  94. name: "确定订单",
  95. path: "/confirmOrder",
  96. unicon:
  97. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unconfirmOrder.png",
  98. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/confirmOrder.png",
  99. },
  100. // {
  101. // name: "门店检测",
  102. // path: "/storeDetection",
  103. // icon: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/testing.png',
  104. // unicon: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/untesting.png'
  105. // },
  106. {
  107. name: "客户管理",
  108. path: "/customerMan",
  109. unicon:
  110. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unskin.png",
  111. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/Skin.png",
  112. },
  113. {
  114. name: "付费客户",
  115. path: "/payUser",
  116. unicon:
  117. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unskin.png",
  118. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/Skin.png",
  119. },
  120. {
  121. name: "店铺排班",
  122. path: "/schedulingDetail",
  123. unicon:
  124. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/unskin.png",
  125. icon: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/Skin.png",
  126. },
  127. ],
  128. nowIndex: 0,
  129. };
  130. },
  131. watch: {
  132. $route(to, from) {
  133. // console.log(to, "tootototo");
  134. let patname = `/${to.path.split("/")[1]}`;
  135. // console.log(window.location, "window.location.pathname", to);
  136. this.$emit("changeIsBack", to.meta.isback);
  137. this.menu.forEach((item, index) => {
  138. if (patname == item.path) {
  139. this.nowIndex = index;
  140. this.$emit("changeMenu", index);
  141. }
  142. });
  143. // 客户管理详情跳转测肤记录修改返回键显示
  144. if (to.path == "/testSkin") {
  145. this.$emit("changeIsBack", this.$route.query.isback);
  146. }
  147. },
  148. },
  149. mounted() {
  150. let patname = `/${window.location.hash.substr(1).split("/")[1]}`;
  151. // console.log(window.location, "window.location.pathname", patname);
  152. this.menu.forEach((item, index) => {
  153. if (patname == item.path) {
  154. this.nowIndex = index;
  155. this.$emit("changeMenu", index);
  156. }
  157. });
  158. },
  159. methods: {
  160. handleSelect(index, item) {
  161. this.nowIndex = index;
  162. this.$router.push({
  163. path: item.path,
  164. });
  165. this.$emit("changeMenu", index);
  166. },
  167. },
  168. };
  169. </script>
  170. <style lang="less" scoped>
  171. .logo {
  172. margin-top: 22px;
  173. text-align: center;
  174. img {
  175. width: 60px;
  176. height: 60px;
  177. }
  178. }
  179. .active {
  180. line-height: 46px !important;
  181. background: url("https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/select_icon.png")
  182. no-repeat;
  183. margin-right: -2px;
  184. background-size: 100% 100%;
  185. background-color: #fa7d22 !important;
  186. color: #fa7d22 !important;
  187. }
  188. .el-menu-item {
  189. margin-left: 8px;
  190. padding-left: 9px !important;
  191. height: auto;
  192. line-height: initial;
  193. padding: 13px 0;
  194. cursor: none;
  195. color: #ffffff;
  196. img {
  197. width: 20px;
  198. height: 20px;
  199. }
  200. }
  201. /deep/ .el-menu-item:focus {
  202. background-color: transparent;
  203. }
  204. /deep/ .el-menu-item:hover {
  205. background-color: transparent;
  206. }
  207. </style>