butler.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="container">
  3. <view class="box">
  4. <view class="imgBox" v-for="(item, index) in dataList" :key="index">
  5. <image class="imgs" mode="scaleToFill" :src="filesUrl + item.blogPic"></image>
  6. <text class="name">张曦汐</text>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import request from '../../api/cms.js';
  13. import { BASE_URL } from '../../env.js';
  14. export default {
  15. data() {
  16. return {
  17. filesUrl: BASE_URL.fileUrl,
  18. dataList: []
  19. }
  20. },
  21. onShow: function() {},
  22. async mounted() {
  23. this.getPolicyList({ typeName: 'policy' });
  24. },
  25. methods: {
  26. // 列表点击函数
  27. listItemBtn(e) {
  28. return;
  29. uni.navigateTo({ url: `/pages/details/index?id=${e.id}` })
  30. },
  31. // 搜索函数
  32. async getPolicyList(e) {
  33. const res = await request.getArticleList({ pageNum: 1, pageSize: 100, typeName: 'hgjfc' });
  34. this.dataList = res.rows;
  35. }
  36. }
  37. }
  38. </script>
  39. <style>
  40. .container {
  41. width: 100%;
  42. height: 100vh;
  43. overflow-y: auto;
  44. background-color: darkred;
  45. }
  46. .box {
  47. display: flex;
  48. flex-wrap: wrap;
  49. }
  50. .imgBox {
  51. width: 30%;
  52. height: 36vw;
  53. margin-left: 2.5%;
  54. margin-top: 20px;
  55. }
  56. .imgs {
  57. display: block;
  58. width: 100%;
  59. height: 90%;
  60. }
  61. .name {
  62. width: 100%;
  63. display: block;
  64. text-align: center;
  65. color: #fff;
  66. }
  67. </style>