asking.vue 1.8 KB

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