productlist.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="center">
  3. <view class="massage" v-for="(item, index) in list" :key="index"
  4. @click="nav('/pages/navigation/product?id=' + item.id)">
  5. <image class="list-prc" :src="item.image_input[0]" mode=""></image>
  6. <view class="info">
  7. <view class="title">{{ item.title }}</view>
  8. <view class="time">{{ item.add_time }}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. article
  16. } from '@/api/user.js';
  17. export default {
  18. data() {
  19. return {
  20. list: [],
  21. type: ''
  22. };
  23. },
  24. onLoad(opt) {
  25. let obj = this;
  26. article({
  27. page: 1,
  28. limit: 1000
  29. }, 5).then(({
  30. data
  31. }) => {
  32. this.list = data;
  33. });
  34. },
  35. methods: {
  36. nav(url) {
  37. uni.navigateTo({
  38. url
  39. });
  40. }
  41. }
  42. };
  43. </script>
  44. <style lang="less">
  45. .center {
  46. background: #f3f3f3;
  47. }
  48. .massage {
  49. background: #ffffff;
  50. padding: 30rpx;
  51. border-bottom: 1px solid #e9e9e9;
  52. display: flex;
  53. align-items: center;
  54. .list-prc {
  55. width: 120rpx;
  56. height: 120rpx;
  57. }
  58. .info {
  59. margin-left: 10rpx;
  60. }
  61. .title {
  62. font-size: 28rpx;
  63. font-family: PingFang SC;
  64. font-weight: 500;
  65. color: #333333;
  66. }
  67. .time {
  68. margin-top: 18rpx;
  69. font-size: 20rpx;
  70. font-family: PingFang SC;
  71. font-weight: 500;
  72. color: #999999;
  73. }
  74. }
  75. </style>