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. debugger
  51. this.typeList = res.rows
  52. })
  53. },
  54. goSanNong() {
  55. uni.navigateTo({
  56. url: '/pages/sannong/sannong'
  57. });
  58. },
  59. goDetails() {
  60. uni.navigateTo({
  61. url: '/pages/wenbaxiangqing/wenbaxiangqing'
  62. });
  63. },
  64. updateImg(imgList){
  65. this.imageList = imgList;
  66. }
  67. }
  68. };
  69. </script>
  70. <style scoped>
  71. @import './asking.css';
  72. .contain {
  73. height: 100%;
  74. display: flex;
  75. justify-content: space-between;
  76. padding: 0rpx 20rpx;
  77. box-sizing: border-box;
  78. }
  79. </style>