list.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="phone-list-page phone-banzheng-page">
  3. <view class="phone-filter-navBar-box">
  4. <view @click="goUpPage" class="nav-bar-icon"></view>
  5. <text class="nav-bar-title">办证管理</text>
  6. <icon class="nav-search-icon" @click="downBtn"></icon>
  7. </view>
  8. <!-- 课程列表 -->
  9. <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
  10. :refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
  11. class="phone-scroll-view">
  12. <uni-list>
  13. <uni-list-item v-for="item in data.list" class="banzheng-list-item-box">
  14. <template v-slot:body>
  15. <view class="banzheng-list-card-box" @click="checkKecheng(item)">
  16. <view class="card-head-row">
  17. <view class="head-name">{{item.realName}}</view>
  18. <view class="head-status">
  19. <text>{{item.statusBanzheng}}</text>
  20. <text class="status-line" v-if="item.statusKaoshi != '-'">|</text>
  21. <text v-if="item.statusKaoshi != '-'">{{item.statusKaoshi}}</text>
  22. </view>
  23. </view>
  24. <view class="card-body-row">
  25. <img :src="item.icon">
  26. <view class="body-content-row">
  27. <view>
  28. <text>手机号:</text>{{item.userName}}
  29. <button type="default" class="phone-green-btn">打电话</button>
  30. </view>
  31. <view><text>证件号:</text>{{item.idcard}}</view>
  32. <view>
  33. <view><icon></icon>报证机构:{{item.jgName}}</view>
  34. <view><icon></icon>职业名称:{{item.zyName}}</view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. </uni-list-item>
  41. <uni-load-more :status="data.state" @click="getMore(0)" :contentText="data.contentText"></uni-load-more>
  42. </uni-list>
  43. </scroll-view>
  44. <!-- 页面底端 -->
  45. <customTabbarClientVue></customTabbarClientVue>
  46. </view>
  47. </template>
  48. <script setup>
  49. import customTabbarClientVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  50. import {
  51. ref,
  52. reactive
  53. } from "vue";
  54. import {
  55. onLoad,
  56. onShow
  57. } from "@dcloudio/uni-app";
  58. import {getKaozhengList} from '@/api/banzheng.js'
  59. import {
  60. formatSecondsToCnhms
  61. } from "@/utils/common.js"
  62. const data = reactive({
  63. jgId: '', // 机构ID
  64. realName: '', // 姓名
  65. statusBanzheng: '', // 办证状态
  66. statusKaoshi: '', // 考试状态
  67. userName: '', // 手机号
  68. zyId: '', // 职业ID
  69. zyLevel: '', // 职业等级ID
  70. list: [], // 办证列表
  71. loading: false,
  72. page: 0,
  73. size: 10,
  74. state: 'more',
  75. contentText: {
  76. contentdown: '查看更多',
  77. contentrefresh: '加载中',
  78. contentnomore: '没有更多'
  79. },
  80. from: ''
  81. })
  82. function goUpPage() {
  83. uni.redirectTo({
  84. url: '/pages/admin/ShouYe/shouye'
  85. })
  86. }
  87. function handleSearch() {
  88. data.page = 0;
  89. refreshData();
  90. }
  91. function checkKecheng(item) {
  92. uni.navigateTo({
  93. url: `/pages/admin/tongzhi/details?noticeId=${item.noticeId}`
  94. })
  95. }
  96. function onRefresh() {
  97. data.page = 0;
  98. data.list = [];
  99. data.loading = true;
  100. refreshData();
  101. }
  102. function refreshData() {
  103. const opt = {
  104. jgId: data.jgId, // 机构ID
  105. realName: data.realName, // 姓名
  106. statusBanzheng: data.statusBanzheng, // 办证状态
  107. statusKaoshi: data.statusKaoshi, // 考试状态
  108. userName: data.userName, // 手机号
  109. zyId: data.zyId, // 职业ID
  110. zyLevel: data.zyId, // 职业等级ID
  111. page: 1,
  112. size: 10, // 固定查询10条
  113. }
  114. data.list = [];
  115. // 数学
  116. data.state = 'loading';
  117. data.page++;
  118. opt.page = data.page;
  119. getKaozhengList(opt).then(res => {
  120. data.list = data.list.concat(res.data.data);
  121. data.loading = false;
  122. if (res.data.total > data.list.length) {
  123. data.state = 'more';
  124. data.loading = false;
  125. } else {
  126. data.state = 'no-more';
  127. data.loading = false;
  128. }
  129. }).catch(err => {
  130. data.state = 'more';
  131. data.loading = false;
  132. })
  133. }
  134. function getMore() {
  135. const opt = {
  136. jgId: data.jgId, // 机构ID
  137. realName: data.realName, // 姓名
  138. statusBanzheng: data.statusBanzheng, // 办证状态
  139. statusKaoshi: data.statusKaoshi, // 考试状态
  140. userName: data.userName, // 手机号
  141. zyId: data.zyId, // 职业ID
  142. zyLevel: data.zyId, // 职业等级ID
  143. page: 1,
  144. size: 10, // 固定查询10条
  145. }
  146. if (data.state == 'no-more') return;
  147. data.state = 'loading';
  148. data.page++;
  149. opt.page = data.page;
  150. getKaozhengList(opt).then(res => {
  151. data.list = data.list.concat(res.data.data);
  152. data.loading = false;
  153. if (res.data.total > data.list.length) {
  154. data.state = 'more';
  155. data.loading = false;
  156. } else {
  157. data.state = 'no-more';
  158. data.loading = false;
  159. }
  160. }).catch(err => {
  161. data.state = 'more';
  162. data.loading = false;
  163. })
  164. }
  165. onLoad((options) => {
  166. data.from = options.from;
  167. })
  168. onShow(() => {
  169. getMore()
  170. })
  171. </script>