goods.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="goodscontent">
  3. <view class="carSs">
  4. <view class="carssBox" >
  5. <img src="../../static/img/icon_search.png" alt="" class="carSsImg">
  6. <input type="text" placeholder="名称、规格、出厂编码、车型、品牌" class="carssInput" v-model="goodsName" @confirm="getgoodsList">
  7. </view>
  8. </view>
  9. <view class="listBox">
  10. <view class="listLine" v-for="(item,index) in list" @click="godetail(item)">
  11. <img :src="item.imgs.split(',')[0]|| require('../../static/img/pic_def_bj.png')" alt="图片加载失败" class="lineIMg">
  12. <view class="listlineRight">
  13. <view class="lineName">{{ item.brand }} {{ item.name }}</view>
  14. <view class="linespecificationModel">{{ item.specificationModel }} | {{ item.factoryNumber }}</view>
  15. <view class="linemodelRemark">备注:{{ item.modelRemark||'--' }}</view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="nodata" v-if="!list.length&&!loading">
  20. <img src="../../static/img/pic_empty_def.png" alt="" class="nodataImg">
  21. <view class="nodataTxt">暂无匹配商品</view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. list:[],
  30. goodsName:'',
  31. page:1,
  32. limit:10,
  33. loading:true,
  34. }
  35. },
  36. onLoad() {
  37. },
  38. methods: {
  39. getgoodsList(){
  40. uni.showLoading({ title: '加载中'});
  41. this.$http('partsByOpen/queryPartsList', {
  42. name:this.goodsName,
  43. page:this.page,
  44. limit:10,
  45. }, 'POST').then(res => {
  46. this.list=res.data
  47. uni.hideLoading();
  48. })
  49. }
  50. },
  51. onReachBottom(){
  52. console.log("上拉")
  53. }
  54. }
  55. </script>
  56. <style scoped>
  57. .goodscontent{
  58. min-height:calc(100vh - 44px) ;
  59. background: #FFFFFF;
  60. }
  61. .carSs{
  62. width: 750rpx;
  63. height: 96rpx;
  64. background: #FFFFFF;
  65. padding-top: 24rpx;
  66. position: relative;
  67. }
  68. .carssBox{
  69. width: 702rpx;
  70. height: 72rpx;
  71. background: #F4F5F7;
  72. border-radius: 36rpx;
  73. margin: 0 auto;
  74. }
  75. .carSsImg{
  76. width: 40rpx;
  77. height: 40rpx;
  78. margin-top: 16rpx;
  79. margin-left: 20rpx;
  80. }
  81. .carssInput{
  82. line-height:72px;
  83. font-size: 28rpx;
  84. height:72rpx;
  85. padding-left: 16rpx;
  86. width: 600rpx;
  87. }
  88. .carssBox{
  89. display: flex;
  90. }
  91. .listBox{
  92. padding: 0 24rpx;
  93. background: #FFFFFF;
  94. }
  95. .lineIMg{
  96. width: 110rpx;
  97. height: 110rpx;
  98. }
  99. .listLine{
  100. padding: 20rpx 0;
  101. border-bottom: 1px solid #EEEEEE;
  102. display: flex;
  103. }
  104. .listlineRight{
  105. width: 600rpx;
  106. padding-left: 20rpx;
  107. }
  108. .lineName{
  109. color: #3C3C3C;font-size: 28rpx;
  110. }
  111. .linespecificationModel{
  112. color: #999999;font-size: 24rpx;padding-top: 5rpx;
  113. }
  114. .linemodelRemark{
  115. color: #999999;font-size: 24rpx;padding-top: 10rpx;
  116. }
  117. .nodataImg{
  118. width: 452rpx;
  119. }
  120. .nodata{
  121. text-align: center;
  122. height: calc(100vh - 310rpx );
  123. }
  124. .nodataTxt{
  125. color: #999999;
  126. line-height: 40px;
  127. font-size: 28rpx;
  128. padding-top: 12rpx;
  129. }
  130. </style>