Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

rightList.vue 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class='right-contaienr'>
  3. <scroll-view scroll-y="true" :style='{height:scrollHeight}'>
  4. <view v-for="(item,index) in menuList" :key='index' class="item-box" @click="toNext(item.link)">
  5. <view class="l-img bg-blue" :style="{ '--background': bgBlue }">
  6. <image :src="`${fileURLList}${item.iconPath}`" mode="aspectFit" class='img' />
  7. </view>
  8. <view class="r-info">
  9. <view class="title-text">{{item.name}}</view>
  10. <view class="title-desc">查看{{item.name}}</view>
  11. </view>
  12. </view>
  13. </scroll-view>
  14. </view>
  15. </template>
  16. <script lang="ts" setup>
  17. import {
  18. ref,
  19. reactive, onMounted,
  20. getCurrentInstance,
  21. defineProps
  22. } from "vue";
  23. import {
  24. fileURL, fileURLList
  25. } from "@/datas/fileURL.js";
  26. const bgBlue = `url(${fileURL}image/newHome/more-bg.png) center center no-repeat`;
  27. defineProps({
  28. menuList: {
  29. type: Array,
  30. default: () => []
  31. },
  32. })
  33. const instance = getCurrentInstance();
  34. const scrollHeight = ref('100%')
  35. onMounted(() => {
  36. let windowHeight = uni.getSystemInfoSync().windowHeight
  37. const query = uni.createSelectorQuery().in(instance.proxy)
  38. query
  39. .select(".right-contaienr")
  40. .boundingClientRect((data) => {
  41. console.log("得到布局位置信息", data);
  42. console.log("节点离页面顶部的距离为" + data.top, windowHeight);
  43. scrollHeight.value = (windowHeight - data.top) + 'px'
  44. })
  45. .exec();
  46. })
  47. function toNext(url) {
  48. uni.navigateTo({
  49. url: url,
  50. });
  51. }
  52. </script>
  53. <style lang='scss' scoped>
  54. .right-contaienr {
  55. overflow: hidden;
  56. .scroll-Y {
  57. height: 100%;
  58. }
  59. .item-box {
  60. display: flex;
  61. padding-bottom: 30rpx;
  62. }
  63. .l-img {
  64. width: 105rpx;
  65. height: 105rpx;
  66. background-size: 100% 100%;
  67. display: flex;
  68. align-items: center;
  69. justify-content: center;
  70. .img {
  71. width: 64rpx;
  72. height: 64rpx;
  73. }
  74. }
  75. .r-info {
  76. margin-left: 19rpx;
  77. font-family: MicrosoftYaHei;
  78. .title-text {
  79. font-size: 28rpx;
  80. color: #01243A;
  81. margin-top: 5rpx;
  82. }
  83. .title-desc {
  84. margin-top: 10rpx;
  85. font-size: 26rpx;
  86. color: #999999;
  87. }
  88. }
  89. }
  90. </style>