task_ima_tab.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="task-tab">
  3. <scroll-view class="scroll-Y row" scroll-x="true">
  4. <view class="z-tabs-scroll-view row-justify-sb center" style="position: relative;">
  5. <view class="column-c tab-item p-lr30 p-t30 p-b20" v-for="(item,index) in navList" :key="index"
  6. @click="setType(index)">
  7. <image class="wh-60 r-circle" :class="index===current?'double-border':''" :src="item.icon"
  8. mode="aspectFill">
  9. </image>
  10. <view class="m-t16 sys-size-24 text-center sys-weight-600"
  11. :class="{'default-text':index===current}">
  12. {{item.name}}
  13. </view>
  14. <!-- <view class="half-circle m-t20" :class="{'half-circle1':current==1}" v-if="current==index"></view> -->
  15. </view>
  16. <view class="half-circle m-t20"></view>
  17. </view>
  18. </scroll-view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. current: 0,
  26. navList: [{
  27. name: '垫资还款',
  28. icon: '/static/img/task/task-refund.png'
  29. }, {
  30. name: '房抵业务',
  31. icon: '/static/img/task/task-loan.png'
  32. }, {
  33. name: '消费金融',
  34. icon: '/static/img/task/task-financial.png'
  35. }, {
  36. name: '其他服务',
  37. icon: '/static/img/task/task-else.png'
  38. }, ]
  39. }
  40. },
  41. methods: {
  42. setType(current) {
  43. // this.$nextTick(() => {
  44. // uni.createSelectorQuery().in(this).select(".z-tabs-scroll-view").fields({
  45. // scrollOffset: true
  46. // }, data => {
  47. // if (data) {
  48. // this.currentScrollLeft = data.scrollLeft;
  49. // console.log(data);
  50. // } else {}
  51. // }).exec();
  52. // })
  53. if (current !== this.current) {
  54. this.current = current
  55. }
  56. },
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .task-tab {
  62. margin: 0 20rpx;
  63. border-radius: 30rpx;
  64. background: #fff;
  65. }
  66. .default-text {
  67. color: #10B261;
  68. }
  69. .half-circle {
  70. width: 20rpx;
  71. height: 10rpx;
  72. background-color: #3eaf7c;
  73. border-top-left-radius: 10rpx;
  74. border-top-right-radius: 10rpx;
  75. position: absolute;
  76. bottom: 0;
  77. left: calc(25%/2 - 10rpx);
  78. }
  79. .half-transition {
  80. transition: all .5s ease;
  81. }
  82. .tab-item {
  83. width: 25%;
  84. }
  85. .double-border {
  86. box-shadow: 0 0 0 6rpx #fff, 0 0 0 12rpx #10B261;
  87. }
  88. </style>