myBespeak.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="box">
  3. <view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.ID)">
  4. <view class="carPlate">
  5. <view class="time">{{item.BillDate}}</view>
  6. <view class="mileage" v-if="item.SheetState == 0" style="color: #FF0000">待确认</view>
  7. <view class="mileage" v-if="item.SheetState == 1" style="color: #3F90F7">预约中</view>
  8. <view class="mileage" v-if="item.SheetState == 2" style="color: #00A040;">已到店</view>
  9. <view class="mileage" v-if="item.SheetState == 3">已取消</view>
  10. </view>
  11. <view class="plate">{{item.PlateNumber}}</view>
  12. <view class="shopName">{{item.ShopName}}</view>
  13. <view class="itemN">
  14. <view class="itemContent" v-if="item.OrderItem.length != 0">{{item.OrderItem}}</view>
  15. </view>
  16. </view>
  17. <!-- 上拉 加载更多 -->
  18. <view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
  19. <!-- 无数据空白页 -->
  20. <nodata v-if="itemData.length==0"></nodata>
  21. </view>
  22. </template>
  23. <script>
  24. import nodata from '../../components/nodata/nodata.vue'
  25. export default {
  26. components: {
  27. nodata,
  28. },
  29. data() {
  30. return {
  31. page: 1,
  32. itemData: [],
  33. noMoreShow: false,
  34. }
  35. },
  36. onLoad() {
  37. this.page = 1
  38. this.myOrderCoupon()
  39. },
  40. onShow() {
  41. this.page = 1
  42. this.myOrderCoupon()
  43. },
  44. methods: {
  45. goDetail(id) {
  46. uni.navigateTo({
  47. url: 'bespeakDetail?id=' + id
  48. })
  49. },
  50. myOrderCoupon() {
  51. uni.showLoading({
  52. title: '加载中'
  53. })
  54. this.$http('openreservation/listOrderSheet', {
  55. // page: this.page,
  56. // limit: 10,
  57. }, 'GET').then(res => {
  58. uni.hideLoading();
  59. // var list = res.data.Items
  60. var list = res.data
  61. // 处理 undefined和null转为空白字符串
  62. // list.forEach((item, index) => {
  63. // for (const key in item) {
  64. // item[key] = this.$praseStrEmpty(item[key])
  65. // }
  66. // })
  67. if (this.page == 1) {
  68. this.itemData = list
  69. } else {
  70. this.itemData = this.itemData.concat(list)
  71. }
  72. if (list.length < 10) {
  73. this.noMoreShow = true
  74. } else {
  75. this.noMoreShow = false
  76. }
  77. })
  78. },
  79. },
  80. // 下拉刷新
  81. onPullDownRefresh() {
  82. this.page = 1
  83. this.myOrderCoupon()
  84. setTimeout(function() {
  85. uni.stopPullDownRefresh();
  86. }, 1000);
  87. },
  88. // 上拉加载更多
  89. onReachBottom() {
  90. // this.page++;
  91. this.myOrderCoupon()
  92. },
  93. }
  94. </script>
  95. <style>
  96. .box {
  97. min-height: 100vh;
  98. background-color: #F4F5F7;
  99. padding-top: 20rpx;
  100. }
  101. .itemHistory {
  102. margin: 0rpx 24rpx 20rpx;
  103. padding: 20rpx;
  104. background-color: #FFFFFF;
  105. border-radius: 10rpx;
  106. }
  107. .time {
  108. font-size: 24rpx;
  109. color: #999999;
  110. }
  111. .carPlate {
  112. margin-bottom: 22rpx;
  113. display: flex;
  114. align-items: center;
  115. justify-content: space-between;
  116. }
  117. .plate {
  118. font-size: 30rpx;
  119. color: #3C3C3C;
  120. font-weight: bold;
  121. margin-right: 20rpx;
  122. }
  123. .mileage {
  124. font-size: 24rpx;
  125. color: #999999;
  126. }
  127. .itemN {
  128. display: flex;
  129. }
  130. .shopName{
  131. color: #666666;
  132. font-size: 24rpx;
  133. margin: 16rpx 0rpx;
  134. /* 隐藏文字显示 ...不换行 */
  135. overflow: hidden;
  136. text-overflow: ellipsis;
  137. white-space: nowrap;
  138. }
  139. .itemContent {
  140. color: #666666;
  141. font-size: 24rpx;
  142. /* 隐藏文字显示 ...不换行 */
  143. overflow: hidden;
  144. text-overflow: ellipsis;
  145. white-space: nowrap;
  146. }
  147. .noMore {
  148. text-align: center;
  149. line-height: 50rpx;
  150. color: #999999;
  151. font-size: 28rpx;
  152. }
  153. </style>