videoList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
  3. <u-tabs :list="tabsList" :current="tabsCurrent" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }" :scrollable="false"></u-tabs>
  4. </u-sticky>
  5. <oa-scroll
  6. customClass="repairManage-container scroll-height"
  7. :pageSize="pageSize"
  8. :total="total"
  9. :refresherLoad="true"
  10. :refresherEnabled="true"
  11. :refresherDefaultStyle="'none'"
  12. :refresherThreshold="44"
  13. :lowerThreshold="44"
  14. :refresherBackground="'#f5f6f7'"
  15. @load="load"
  16. @refresh="refresh"
  17. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  18. >
  19. <template #default>
  20. <view class="menu-list m0">
  21. <view class="list-cell list-cell-arrow" style="color: #666666; line-height: 25px" v-for="(base, index) in dataList" :key="index" @click="handleToDetails(base)">
  22. <view class="content-area-top menu-item">
  23. <view class="content-area-top-time">
  24. {{ base.repairStatus == 1 ? (base.createTime ? base.createTime.replace("T", " ") : "") : base.handleTime ? base.handleTime.replace("T", " ") : "" }}
  25. </view>
  26. <view class="content-area-top-status" v-if="base.repairStatus == 1" style="background-color: #23dedc"> 受理中 </view>
  27. <view class="content-area-top-status" v-if="base.repairStatus == 2" style="background-color: #16bf00"> 处理完成 </view>
  28. </view>
  29. <view class="content-area-row_wrap menu-item">
  30. <view class="content-area-row_wrap-view"> 项目名称:{{ base.projectName }} </view>
  31. <view class="content-area-row_wrap-view"> 报修人:{{ base.reflectName }} </view>
  32. <view class="content-area-row_wrap-view"> 报修人电话:{{ base.reflectPhone }} </view>
  33. <view class="content-area-row_wrap-view"> 报修内容:{{ base.repairContent }} </view>
  34. <view class="content-area-row_wrap-view"> 报修地址:{{ base.projectAddress }} </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. </oa-scroll>
  40. </template>
  41. <script setup>
  42. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  43. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  44. import { useStores, commonStores } from "@/store/modules/index";
  45. import { page } from "@/api/business/fireIot/repairManage.js";
  46. const { proxy } = getCurrentInstance();
  47. const commonStore = commonStores();
  48. const tabsList = ref([
  49. {
  50. name: "全部",
  51. value: "",
  52. },
  53. {
  54. name: "受理中",
  55. value: 1,
  56. },
  57. {
  58. name: "处理完成",
  59. value: 2,
  60. },
  61. ]);
  62. const tabsCurrent = ref(1);
  63. const dataList = ref([]);
  64. const pageSize = ref(20);
  65. const current = ref(1);
  66. const total = ref(0);
  67. /**
  68. * @页面初始化
  69. */
  70. function init() {
  71. selectListApi();
  72. }
  73. /**
  74. * @列表查询
  75. * @api接口查询
  76. */
  77. function selectListApi() {
  78. page({
  79. repairStatus: tabsList.value[tabsCurrent.value].value,
  80. current: current.value,
  81. size: pageSize.value,
  82. }).then((requset) => {
  83. if (requset.status === "SUCCESS") {
  84. dataList.value = requset.data.records;
  85. total.value = requset.data.total;
  86. }
  87. });
  88. }
  89. /**
  90. * @跳转详情事件
  91. */
  92. function handleToDetails(e) {
  93. proxy.$tab.navigateTo(`/pages/business/videoMonitor/videoDetail?repairCode=${e.repairCode}`);
  94. }
  95. /**
  96. * @scrollView加载数据
  97. */
  98. function load() {
  99. pageSize.value += 10;
  100. init();
  101. }
  102. /**
  103. * @scrollView刷新数据
  104. */
  105. function refresh() {
  106. pageSize.value = 20;
  107. total.value = 0;
  108. init();
  109. }
  110. /**
  111. * @tabs点击事件
  112. */
  113. function tabsClick(e) {
  114. tabsCurrent.value = e.index;
  115. init();
  116. }
  117. onReady(() => {});
  118. onShow(() => {
  119. //调用系统主题颜色
  120. proxy.$settingStore.systemThemeColor([1]);
  121. });
  122. onLoad((options) => {
  123. init();
  124. });
  125. </script>
  126. <style lang="scss" scoped>
  127. .repairManage-container {
  128. .content-area {
  129. &-top {
  130. padding-right: 10px;
  131. font-size: 16px;
  132. font-weight: 600;
  133. color: #000000;
  134. &-time {
  135. max-width: 70%;
  136. margin: auto 0;
  137. font-size: 14px;
  138. color: rgb(102, 102, 102);
  139. }
  140. &-name {
  141. max-width: 70%;
  142. color: #000;
  143. }
  144. &-status {
  145. max-width: 30%;
  146. margin: auto 0 auto auto;
  147. font-size: 12px;
  148. color: #ffffff;
  149. padding: 0 5px;
  150. border-radius: 20px;
  151. line-height: 20px;
  152. }
  153. }
  154. &-row_wrap {
  155. padding-right: 10px;
  156. font-size: 13px;
  157. flex-flow: row wrap;
  158. &-view {
  159. display: flex;
  160. min-width: 50%;
  161. > .iconfont {
  162. font-size: 14px;
  163. color: #909399;
  164. margin-left: 5px;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. </style>