asking.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <!-- pages/fuwu/fuwu.wxml -->
  3. <view class="contain">
  4. <!-- 问答类别 -->
  5. <ul class="wendaFL" v-for="(e,idx) in typeList" :key="idx" style="width: 48%;">
  6. <li class="sanNong" style="width: 100%;">
  7. <image :src="loadImgSrcLocalhost(e.path)" class="lbBj" @tap="goSanNong"></image>
  8. <h2>{{obj.type}}</h2>
  9. <span>1566</span>
  10. </li>
  11. </ul>
  12. </view>
  13. </template>
  14. <script>
  15. import upload from '@/components/upload/index.vue'
  16. import {getTypeList} from '@/api/asking/asking.js'
  17. export default {
  18. components: {
  19. upload
  20. },
  21. data() {
  22. return {
  23. imageList:[
  24. '/profile/upload/2024/03/02/D5hjxYkldNxIef093ae65b2128b1293b86a7b537ed98_20240302170757A001.png',
  25. '/profile/upload/2024/03/02/D5hjxYkldNxIef093ae65b2128b1293b86a7b537ed98_20240302170757A001.png'
  26. ],
  27. typeList: [
  28. {
  29. type: null,
  30. path: null
  31. }
  32. ],
  33. // 查询参数
  34. queryParams: {
  35. pageNum: 1,
  36. pageSize: 6,
  37. },
  38. };
  39. }
  40. /**
  41. * 生命周期函数--监听页面加载
  42. */,
  43. onLoad(options) {
  44. this.getTypeList();
  45. },
  46. methods: {
  47. //获取类型列表
  48. getTypeList(){
  49. getTypeList(this.queryParams).then(res =>{
  50. this.typeList = res.rows
  51. })
  52. },
  53. goSanNong() {
  54. uni.navigateTo({
  55. url: '/pages/demo/sannong/sannong'
  56. });
  57. },
  58. goDetails() {
  59. uni.navigateTo({
  60. url: '/pages/demo/wenbaxiangqing/wenbaxiangqing'
  61. });
  62. },
  63. updateImg(imgList){
  64. this.imageList = imgList;
  65. }
  66. }
  67. };
  68. </script>
  69. <style scoped>
  70. @import './asking.css';
  71. .contain {
  72. height: 100%;
  73. display: flex;
  74. justify-content: space-between;
  75. padding: 0rpx 20rpx;
  76. box-sizing: border-box;
  77. flex-wrap: wrap;
  78. }
  79. </style>