searchOrder.vue 3.8 KB

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