leverStaff.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view>
  3. <view class="partner-type dis">
  4. <view style="width: 650px;overflow-x: auto;">
  5. <text :class="typeStatistics == val.value ? 'selected' : ''" v-for="val in partnerTypeOption"
  6. :key="val.value" @click="getPartnerType(val.value)">{{ val.lable }}</text>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import {
  13. mapState,
  14. } from "vuex"
  15. export default {
  16. data(){
  17. return{
  18. typeStatistics: 1,
  19. partnerTypeOption: [
  20. {
  21. lable: '一级合伙人',
  22. value: '1'
  23. }, {
  24. lable: '二级合伙人',
  25. value: '2'
  26. }, {
  27. lable: '三级合伙人',
  28. value: '3'
  29. }, {
  30. lable: '四级合伙人',
  31. value: '4'
  32. },
  33. ],
  34. }
  35. },
  36. computed: {
  37. ...mapState(['userInfo']),
  38. },
  39. onLoad() {
  40. this.level = this.userInfo.sysUser.level
  41. if (this.level == 2) {
  42. this.partnerTypeOption = this.partnerTypeOption.slice(0, -1);
  43. }
  44. if (this.level == 3) {
  45. this.partnerTypeOption = this.partnerTypeOption.slice(0, -2);
  46. }
  47. if (this.level == 4) {
  48. this.partnerTypeOption = this.partnerTypeOption.slice(0, 1);
  49. }
  50. },
  51. methods:{
  52. getPartnerType(type) {
  53. this.typeStatistics = type
  54. this.$emit('getPartnerType',type)
  55. },
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .partner-type {
  61. margin: 10px;
  62. width: 97%;
  63. overflow: hidden;
  64. white-space: nowrap;
  65. text {
  66. display: inline-block;
  67. border-radius: 14px 14px 14px 14px;
  68. font-size: 14px;
  69. color: #666666;
  70. padding: 1px 10px;
  71. background: #F4F4F4;
  72. margin-right: 8px;
  73. }
  74. .selected {
  75. color: #FFFFFF;
  76. background: linear-gradient(132deg, #2DD9FF 0%, #2D6DFF 100%);
  77. }
  78. }
  79. </style>