oneMarket.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view>
  3. <navigation-bar title="一级市场" background-color="#fff" front-color="#000000" :left-button="null" />
  4. <u-list class="list" width="100%" @scrolltolower="scrolltolower">
  5. <u-list-item v-for="(item, index) in goods" :key="index">
  6. <view class="card" @click="toDetails(item.id)">
  7. <view class="card-body">
  8. <image
  9. src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg"
  10. mode="aspectFill" class="img"></image>
  11. <view class="txt">
  12. <view style="font-size: 30rpx;height: 140rpx;">{{item.goodsName}}</view>
  13. <view class="piece">{{item.price}} 元</view>
  14. </view>
  15. </view>
  16. </view>
  17. </u-list-item>
  18. <!-- <u-loadmore v-if="goods" :status="loadmoreStatus" margin-top="20" @loadmore="clickLoadMore"
  19. margin-bottom="50" /> -->
  20. </u-list>
  21. <view style="padding: 20px; display: flex;">
  22. <u-button type="primary" text="市场"></u-button>
  23. <u-button type="primary" text="购物车"></u-button>
  24. <u-button type="primary" text="订单列表" @click="swiTap"></u-button>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. loadmoreStatus: 'loadmore',
  33. goods: [],
  34. active: 1,
  35. }
  36. },
  37. onLoad() {
  38. this.getGoodsList()
  39. // this.loadmore()
  40. },
  41. // onShow() {
  42. // var a = document.getElementsByClassName('uni-page-head-hd')[0]
  43. // a.style.display = 'none';
  44. // },
  45. methods: {
  46. getGoodsList() {
  47. this.http.request({
  48. url: '/level-one-server/TbGoodsTransit/getTransitList',
  49. success: res => {
  50. this.goods = res.data.data;
  51. this.goods.forEach((item, index) => {
  52. if (index === this.goods.length - 1) {
  53. this.loadmoreStatus = 'nomore'
  54. } else {
  55. this.loadmoreStatus = 'loadmore'
  56. }
  57. })
  58. }
  59. });
  60. },
  61. scrolltolower() {
  62. this.getGoodsList()
  63. },
  64. toDetails(id) {
  65. this.$common.to('/pages/goodsDetails/goodsDetails?id=' + id)
  66. },
  67. swiTap() {
  68. uni.navigateTo({
  69. url: '/pages/order/order'
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style>
  76. .list {
  77. height: auto;
  78. border-radius: 10rpx;
  79. background-color: #fff;
  80. }
  81. .card {
  82. padding: 10rpx;
  83. }
  84. .card-body {
  85. display: flex;
  86. height: 300rpx;
  87. width: 100%;
  88. /* border: #888 1rpx solid; */
  89. box-shadow: 1rpx 1rpx #888;
  90. border-radius: 10rpx;
  91. }
  92. .img {
  93. height: 300rpx;
  94. width: 300rpx;
  95. margin-right: 10rpx;
  96. }
  97. .txt {
  98. padding: 10rpx;
  99. width: 300rpx;
  100. }
  101. .piece {
  102. margin: 50rpx 10rpx;
  103. color: red;
  104. position: relative;
  105. top: 50rpx;
  106. /* left: 5rpx; */
  107. }
  108. </style>