You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

add-work-list.vue 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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="status-block statusdcl" v-if="item.orderStatus==0">待处理</text>
  10. <text class="status-block statusdbc" v-else-if="item.orderStatus==1">待补充</text>
  11. <text class="status-block statusyjs" v-else>已结束</text>
  12. </view>
  13. <view class="bot">
  14. <view class="details">
  15. <view class="detail-option"><text class="label">工单号码:</text><view class="value">{{item.id}}</view></view>
  16. <view class="detail-option"><text class="label">发生日期:</text><view class="value">{{item.eventOccurrenceTime}}</view></view>
  17. <view class="detail-option"><text class="label">客户诉求:</text><view class="value">{{item.appeal}}</view></view>
  18. </view>
  19. <view class="time">{{item.updateTime}}</view>
  20. </view>
  21. </view>
  22. <uni-load-more
  23. v-if="state.list.length > 0"
  24. :status="state.status"
  25. iconType="snow"
  26. :icon-size="16"
  27. :content-text="state.contentTxt"
  28. />
  29. <!-- <view class="no" v-if="state.list.length==0">暂无自助工单</view> -->
  30. <no-data-view v-else-if="state.list.length == 0" text="暂无自助工单"></no-data-view>
  31. </view>
  32. <!-- <image class="add" :src="`${$imgUrl}etcadd.png`" mode="" @click="add()"></image> -->
  33. <FixedFooter>
  34. <button type="default" class="ui-btn" @click="add">添加</button>
  35. </FixedFooter>
  36. </template>
  37. <script setup lang="ts">
  38. import {navTo} from "@/utils/utils";
  39. import { onLoad,onReachBottom } from "@dcloudio/uni-app";
  40. import {requestNew} from "@/utils/network/request.js";
  41. import { selfServicePage } from "@/utils/network/api.js";
  42. import { reactive,ref } from "vue";
  43. import FixedFooter from '@/components/common/FixedFooter.vue'
  44. const state = reactive({
  45. pageNo:1,
  46. pageSize:10,
  47. list:[],
  48. flags: false,
  49. totalCount: 0,
  50. status: 'loading',
  51. contentTxt: {
  52. contentdown: '~上拉加载更多~',
  53. contentrefresh: '努力加载中...',
  54. contentnomore: '-- 没有更多工单了 --'
  55. }
  56. })
  57. onLoad(() => {
  58. list()
  59. });
  60. const list=()=>{
  61. const options = {
  62. type: 2,
  63. data: {
  64. pageNo:state.pageNo,
  65. pageSize:state.pageSize
  66. },
  67. method: "POST",
  68. showLoading: true,
  69. };
  70. state.status = 'loading'
  71. requestNew(selfServicePage, options).then((res) => {
  72. console.log("自助工单列表",res)
  73. state.totalCount = res.totalCount
  74. state.list = [...state.list,...res.result]
  75. if (state.totalCount < state.list.length) {
  76. state.status = 'more'
  77. } else {
  78. state.status = 'noMore'
  79. }
  80. });
  81. }
  82. const add = () => {
  83. navTo(`/subpackage/after-sale/work-order/add-work-order`)
  84. }
  85. const details = (orderStatus: string, id: string)=>{
  86. navTo(`/subpackage/after-sale/work-order/add-work-supplement?id=${id}&orderStatus=${orderStatus}`)
  87. }
  88. onReachBottom(() => {
  89. console.log("触底了", state.pageNo * 10)
  90. if (Number(state.totalCount) == state.list.length) return state.flags = true
  91. if (state.list.length < state.pageNo * 10) return state.flags = true
  92. console.log("触底了")
  93. state.pageNo++
  94. list()
  95. })
  96. </script>
  97. <style>
  98. page{
  99. background-color: #E9EDF0;
  100. }
  101. </style>
  102. <style lang="scss" scoped>
  103. .content{
  104. padding-top: 30rpx;
  105. box-sizing: border-box;
  106. }
  107. .list{
  108. background: #FFFFFF;
  109. border-radius: 12rpx;
  110. margin: 0 35rpx;
  111. font-weight: 400;
  112. margin-bottom: 30rpx;
  113. .title{
  114. padding: 0 20rpx;
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: center;
  118. height: 96rpx;
  119. background-image: var(--bgimg);
  120. background-size: 100% 100%;
  121. background-repeat: no-repeat;
  122. .title_left{
  123. display: flex;
  124. align-items: center;
  125. color: #01243A;
  126. font-weight: bold;
  127. }
  128. image{
  129. width: 50rpx;
  130. height: 50rpx;
  131. }
  132. .question{
  133. font-size: 30rpx;
  134. color: #01243A;
  135. margin-left: 10rpx;
  136. }
  137. .status-block{
  138. font-size: 24rpx;
  139. color: #1458E5;
  140. background: #E3ECFF;
  141. border-radius: 6rpx;
  142. border: 1px solid #1458E5;
  143. padding: 7rpx 13rpx;
  144. }
  145. // 待处理
  146. .statusdcl{
  147. }
  148. // 待补充
  149. .statusdbc{
  150. color: #42D175;
  151. background: #E6FFEF;
  152. border: 1px solid #42D175;
  153. }
  154. // 已结束
  155. .statusyjs{
  156. color: #839AB4;
  157. background: #DCEFFC;
  158. border: 1px solid #839AB4;
  159. }
  160. }
  161. .bot{
  162. padding: 0 24rpx;
  163. .details{
  164. font-size: 26rpx;
  165. padding: 12rpx 0 12rpx 0;
  166. .detail-option{
  167. display: flex;
  168. padding: 10rpx 0;
  169. color: #002025;
  170. .label{
  171. width: 140rpx;
  172. flex-shrink: 0;
  173. flex-grow: 0;
  174. color: #999999;
  175. }
  176. .value{
  177. flex: 1;
  178. }
  179. }
  180. }
  181. .time{
  182. font-size: 24rpx;
  183. color: #999999;
  184. padding:20rpx 0;
  185. border-top: 1rpx solid #DCDCDC;
  186. }
  187. }
  188. }
  189. .add{
  190. position: fixed;
  191. z-index: 999;
  192. bottom: 20rpx;
  193. right: 0rpx;
  194. width: 174rpx;
  195. height: 174rpx;
  196. }
  197. .no {
  198. text-align: center;
  199. padding-top: 100rpx;
  200. }
  201. </style>