searchOrder.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="pages flex flex_column">
  3. <view class="search-box">
  4. <u-search placeholder="请输入轮胎唯一码/手机号码" v-model="queryWord" @search="pageInit" @custom="pageInit"></u-search>
  5. </view>
  6. <view class="uuid-listbox">
  7. <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
  8. <view class="uuid-list">
  9. <view
  10. v-for="(item,index) in list"
  11. :key="item.id"
  12. @click="toDetail(item)"
  13. >
  14. <view class="flex">
  15. <view class="uuid-info">
  16. <view>产品名称:{{item.productName}}</view>
  17. <view>产品编码:{{item.productCode}}</view>
  18. </view>
  19. <view class="uuid-img">
  20. <image style="width: 100%;height: 80px;background: #eaeaea;" :src="item.productMsg"></image>
  21. </view>
  22. </view>
  23. <view class="uuid-info">
  24. <view class="uuid">唯一码:{{item.traceCode}}</view>
  25. <view class="uuid">质保时间:{{item.warrantyStartDate.split(' ')[0]}}至{{item.warrantyEndDate.split(' ')[0]}}</view>
  26. <view class="uuid">手机号码:{{item.customMobile}}</view>
  27. </view>
  28. <view class="state" :class="item.state"></view>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { getWarrantyQueryList } from "@/api/trace"
  37. export default {
  38. data() {
  39. return {
  40. queryWord: '',
  41. pageNo: 1,
  42. pageSize: 10,
  43. list: [],
  44. total: 0,
  45. status: 'loading',
  46. noDataText: '暂无数据',
  47. }
  48. },
  49. onLoad(opts) {
  50. this.queryWord = opts.mobile || ''
  51. this.pageInit()
  52. },
  53. methods: {
  54. pageInit(){
  55. this.status = 'loading'
  56. this.total = 0
  57. this.pageNo = 1
  58. uni.showLoading({
  59. mask:true,
  60. title: "正在查询..."
  61. })
  62. this.getRow()
  63. },
  64. // 查询列表
  65. getRow (pageNo) {
  66. let _this = this
  67. if (pageNo) {
  68. this.pageNo = pageNo
  69. }
  70. // 查询条件
  71. let params = {
  72. pageNo: this.pageNo,
  73. pageSize: this.pageSize,
  74. queryWord: this.queryWord
  75. }
  76. this.status = "loading"
  77. getWarrantyQueryList(params).then(res => {
  78. if (res.status == 200) {
  79. const retList = res.data.list
  80. if(_this.pageNo>1){
  81. _this.list = _this.list.concat(retList || [])
  82. }else{
  83. _this.list = retList || []
  84. }
  85. _this.total = res.data.count || 0
  86. } else {
  87. _this.list = []
  88. _this.total = 0
  89. _this.noDataText = '暂无数据'
  90. }
  91. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  92. uni.hideLoading()
  93. })
  94. },
  95. // scroll-view到底部加载更多
  96. onreachBottom() {
  97. if(this.list.length < this.total){
  98. this.pageNo += 1
  99. this.getRow()
  100. }else{
  101. this.status = "nomore"
  102. }
  103. },
  104. toDetail(item){
  105. uni.navigateTo({
  106. url: "/pagesA/qualityPolicy/orderDetail?id="+item.id
  107. })
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="less">
  113. .pages{
  114. height: 100vh;
  115. background: #f8f8f8;
  116. overflow: auto;
  117. .search-box{
  118. padding: 0.6rem 1rem;
  119. background: #fff;
  120. }
  121. .uuid-listbox{
  122. flex-grow: 1;
  123. height: calc(100vh - 52px);
  124. }
  125. .uuid-list{
  126. > view{
  127. justify-content: space-between;
  128. border-bottom: 1px solid #eee;
  129. padding: 0.6rem 1rem;
  130. position: relative;
  131. background: #fff;
  132. margin-top: 0.2rem;
  133. }
  134. .state{
  135. background-repeat: no-repeat;
  136. background-size: 100%;
  137. background-position: center center;
  138. position: absolute;
  139. width: 4.5rem;
  140. height: 4.5rem;
  141. z-index: 1000;
  142. bottom: 0.5rem;
  143. right: 1rem;
  144. }
  145. .RUN{
  146. background-image: url(/pagesA/static/inhand.png);
  147. }
  148. .END{
  149. background-image: url(/pagesA/static/outof.png);
  150. }
  151. color: #666;
  152. .uuid-info{
  153. flex-grow: 1;
  154. padding-right: 0.5rem;
  155. line-height: 1.5rem;
  156. }
  157. .uuid{
  158. color: #000;
  159. }
  160. .uuid-img{
  161. width: 7rem;
  162. }
  163. }
  164. }
  165. </style>