Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

add-work-list.vue 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="content">
  3. <view class="list" v-for="(item,index) in state.list" @click="details(item.orderStatus,item.id)">
  4. <view class="title" :style="{'--bgimg':`url(${$imgUrl}etcbg.png)`}">
  5. <view class="title_left">
  6. <image :src="`${$imgUrl}etc.png`" mode=""></image>
  7. <text class="question">ETC使用问题</text>
  8. </view>
  9. <text class="statusdcl" v-if="item.orderStatus==0">待处理</text>
  10. <text class="statusdbc" v-else-if="item.orderStatus==1">待补充</text>
  11. <text class="statusyjs" v-else>已结束</text>
  12. </view>
  13. <view class="bot">
  14. <view class="details">
  15. <view><text>工单号码:</text><view>{{item.id}}</view></view>
  16. <view><text>发生日期:</text><view>{{item.eventOccurrenceDate}}</view></view>
  17. <view><text>客户诉求:</text><view>{{item.appeal}}</view></view>
  18. </view>
  19. <view class="time">{{item.updateTime}}</view>
  20. </view>
  21. </view>
  22. <view style="text-align: center;margin: 20rpx;font-size: 30rpx;" v-if="state.flags">我是有底线的~</view>
  23. <view class="no" v-if="state.list.length==0">暂无自助工单</view>
  24. </view>
  25. <image class="add" :src="`${$imgUrl}etcadd.png`" mode="" @click="add()"></image>
  26. </template>
  27. <script setup lang="ts">
  28. import {navTo} from "@/utils/utils";
  29. import { onLoad,onReachBottom } from "@dcloudio/uni-app";
  30. import {requestNew} from "@/utils/network/request.js";
  31. import {selfServicePage} from "@/utils/network/api.js";
  32. import { reactive,ref } from "vue";
  33. const state = reactive({
  34. pageNo:1,
  35. pageSize:10,
  36. list:[],
  37. flags: false,
  38. totalCount:"",
  39. })
  40. onLoad(() => {
  41. list()
  42. });
  43. const list=()=>{
  44. const options = {
  45. type: 2,
  46. data: {
  47. pageNo:state.pageNo,
  48. pageSize:state.pageSize
  49. },
  50. method: "POST",
  51. showLoading: true,
  52. };
  53. requestNew(selfServicePage, options).then((res) => {
  54. console.log("自助工单列表",res)
  55. state.totalCount = res.totalCount
  56. state.list=[...state.list,...res.result]
  57. });
  58. }
  59. const add=()=>{
  60. navTo(`/subpackage/after-sale/work-order/add-work-order`)
  61. }
  62. const details=(orderStatus,id)=>{
  63. navTo(`/subpackage/after-sale/work-order/add-work-supplement?id=${id}&orderStatus=${orderStatus}`)
  64. }
  65. onReachBottom(() => {
  66. console.log("触底了", state.pageNo * 10)
  67. if (Number(state.totalCount) == state.list.length) return state.flags = true
  68. if (state.list.length < state.pageNo * 10) return state.flags = true
  69. console.log("触底了")
  70. state.pageNo++
  71. list()
  72. })
  73. </script>
  74. <style lang="scss" scoped>
  75. .content{
  76. padding-top: 30rpx;
  77. box-sizing: border-box;
  78. }
  79. .list{
  80. background: #FFFFFF;
  81. border-radius: 12rpx;
  82. border: 1px solid #FFFFFF;
  83. width: 90%;
  84. margin: 0 auto;
  85. font-weight: 400;
  86. margin-bottom: 30rpx;
  87. .title{
  88. padding: 0 20rpx;
  89. display: flex;
  90. justify-content: space-between;
  91. align-items: center;
  92. height: 80rpx;
  93. background-image: var(--bgimg);
  94. background-size: 100% 100%;
  95. background-repeat: no-repeat;
  96. .title_left{
  97. display: flex;
  98. align-items: center;
  99. }
  100. image{
  101. width: 50rpx;
  102. height: 50rpx;
  103. }
  104. .question{
  105. font-size: 30rpx;
  106. color: #01243A;
  107. margin-left: 10rpx;
  108. }
  109. // 待处理
  110. .statusdcl{
  111. font-size: 24rpx;
  112. color: #1458E5;
  113. background: #E3ECFF;
  114. border-radius: 6rpx;
  115. border: 1px solid #1458E5;
  116. padding: 4rpx 6rpx;
  117. }
  118. // 待补充
  119. .statusdbc{
  120. font-size: 24rpx;
  121. color: #42D175;
  122. background:#E6FFEF;
  123. border-radius: 6rpx;
  124. border: 1px solid #42D175;
  125. padding: 4rpx 6rpx;
  126. }
  127. // 已结束
  128. .statusyjs{
  129. font-size: 24rpx;
  130. color: #839AB4;
  131. background: #DCEFFC;
  132. border-radius: 6rpx;
  133. border: 1px solid #839AB4;
  134. padding: 4rpx 6rpx;
  135. }
  136. }
  137. .bot{
  138. padding: 0 20rpx;
  139. .details{
  140. font-size: 26rpx;
  141. padding: 10rpx 0 5rpx 0;
  142. view{
  143. display: flex;
  144. margin-bottom: 5rpx;
  145. text{
  146. color: #999999;
  147. width: 21%;
  148. }
  149. view{
  150. color: #002025;
  151. width: 79%;
  152. }
  153. }
  154. }
  155. .time{
  156. font-size: 24rpx;
  157. color: #999999;
  158. padding:20rpx 0;
  159. border-top: 1rpx solid #DCDCDC;
  160. }
  161. }
  162. }
  163. .add{
  164. position: fixed;
  165. z-index: 999;
  166. bottom: 20rpx;
  167. right: 0rpx;
  168. width: 174rpx;
  169. height: 174rpx;
  170. }
  171. .no {
  172. text-align: center;
  173. padding-top: 100rpx;
  174. }
  175. </style>