top.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view>
  3. <uni-group mode="card">
  4. <u-line-progress active-color="#3396d1" :percent="activeNum == 1 ? 33 : activeNum == 2 ? 66 : 100"
  5. :show-percent="false"></u-line-progress>
  6. <u-row>
  7. <u-col span="4">
  8. <view class="nameTop" @click="activeNumClick(1)">
  9. <image src="../../../static/weitou/weituo-active.png" class="iamgeTop" v-if="activeNum == 1">
  10. </image>
  11. <image src="../../../static/weitou/weituo.png" class="iamgeTop" v-else></image>
  12. <view class="textName" :class="activeNum == 1 ? 'textName-active':''">{{weitTouTop[0].name}}
  13. </view>
  14. </view>
  15. </u-col>
  16. <u-col span="4">
  17. <view class="nameTop" @click="activeNumClick(2)">
  18. <image src="../../../static/weitou/yangpin-active.png" class="iamgeTop" v-if="activeNum == 2">
  19. </image>
  20. <image src="../../../static/weitou/yangpin.png" class="iamgeTop" v-else></image>
  21. <view class="textName" :class="activeNum == 2 ? 'textName-active':''">{{weitTouTop[1].name}}
  22. </view>
  23. </view>
  24. </u-col>
  25. <u-col span="4">
  26. <view class="nameTop" @click="activeNumClick(3)">
  27. <image src="../../../static/weitou/renyuan-active.png" class="iamgeTop" v-if="activeNum == 3">
  28. </image>
  29. <image src="../../../static/weitou/renyuan.png" class="iamgeTop" v-else></image>
  30. <view class="textName" :class="activeNum == 3 ? 'textName-active':''">{{weitTouTop[2].name}}
  31. </view>
  32. </view>
  33. </u-col>
  34. </u-row>
  35. </uni-group>
  36. </view>
  37. </template>
  38. <script>
  39. import order from './test.json'
  40. export default {
  41. data() {
  42. return {
  43. activeNum: 1,
  44. weitTouTop: order.weiTouTop
  45. }
  46. },
  47. methods: {
  48. activeNumClick(index) {
  49. // this.activeNum = index
  50. this.$emit("activeNumClick", index)
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .nameTop {
  57. display: flex;
  58. align-items: center;
  59. justify-content: center;
  60. margin: 15rpx 0;
  61. .iamgeTop {
  62. height: 30rpx;
  63. width: 30rpx;
  64. color: red;
  65. }
  66. .textName {
  67. margin-left: 5rpx;
  68. color: #8a8a8a;
  69. }
  70. .textName-active {
  71. color: #3396d1;
  72. }
  73. }
  74. </style>