libPre.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="scoped-box">
  3. <view @click="linkList(item.val)" class="op" v-for="(item, i) in areaType" :key="i">{{item.key}}</view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. colorArr: ['#fb7366', '#ff9a59', '#9f7df5', '#60c68b', '#4da4ee', '#e77ad4'],
  11. areaType: [],
  12. };
  13. },
  14. onLoad(params) {
  15. const dictObj = uni.getStorageSync('MD_dict')
  16. this.areaType = dictObj.area_type
  17. },
  18. onReachBottom() {},
  19. onPullDownRefresh() {
  20. // 防止频繁刷新
  21. },
  22. methods: {
  23. linkList (v) {
  24. uni.navigateTo({
  25. url: `/pages/estate/lib?v=${v}`
  26. })
  27. }
  28. }
  29. };
  30. </script>
  31. <style lang="scss">
  32. .scoped-box {
  33. display: flex;
  34. flex-wrap: wrap;
  35. .op {
  36. width: 33.33%;
  37. text-align: center;
  38. color: #fff;
  39. height: 120rpx;
  40. line-height: 120rpx;
  41. font-size: 34rpx;
  42. font-weight: bold;
  43. &:nth-child(6n+1) {
  44. background: #fb7366;
  45. }
  46. &:nth-child(6n+2) {
  47. background: #ff9a59;
  48. }
  49. &:nth-child(6n+3) {
  50. background: #e77ad4;
  51. }
  52. &:nth-child(6n+4) {
  53. background: #9f7df5;
  54. }
  55. &:nth-child(6n+5) {
  56. background: #4da4ee;
  57. }
  58. &:nth-child(6n) {
  59. background: #60c68b;
  60. }
  61. }
  62. }
  63. </style>