index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="page-container">
  3. <!-- 搜索栏 -->
  4. <view class="search-bar">
  5. <input
  6. v-model="searchKey"
  7. class="search-input"
  8. placeholder="请输入承包方姓名/身份证号"
  9. />
  10. <button class="search-btn" @click="handleSearch">搜索</button>
  11. </view>
  12. <!-- 数据统计 -->
  13. <view class="total-count">
  14. 共计 {{ total }} 条
  15. </view>
  16. <!-- 列表区域 -->
  17. <view class="list-container">
  18. <!-- 列表项(循环渲染) -->
  19. <view class="list-item" v-for="(item, index) in contractorList" :key="index" @click="progressPage()">
  20. <!-- 姓名 + 状态标签 -->
  21. <view class="item-header">
  22. <text class="name">{{ item.name }}</text>
  23. <view class="status-tag">
  24. {{ item.status }}
  25. </view>
  26. </view>
  27. <!-- 详情信息(一行多列) -->
  28. <view class="item-info-row">
  29. <view class="info-item">
  30. <text class="label">身份证号:</text>
  31. <text class="value">{{ item.idCard }}</text>
  32. </view>
  33. </view>
  34. <view class="item-info-row">
  35. <view class="info-item">
  36. <text class="label">上报时间:</text>
  37. <text class="value">{{ item.reportTime }}</text>
  38. </view>
  39. </view>
  40. <view class="item-info-row">
  41. <view class="info-item">
  42. <text class="label">家庭人口:</text>
  43. <text class="value">{{ item.familyCount }}</text>
  44. </view>
  45. <view class="info-item">
  46. <text class="label">地块数量:</text>
  47. <text class="value">{{ item.landCount }}</text>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script setup>
  55. import { ref, onMounted } from 'vue';
  56. // 搜索关键词
  57. const searchKey = ref('');
  58. // 列表数据(模拟接口返回)
  59. const contractorList = ref([
  60. {
  61. name: '王战伟',
  62. status: '已上报·审核通过',
  63. idCard: '430322******1015',
  64. reportTime: '2025-08-09 16:09:13',
  65. familyCount: 2,
  66. landCount: 2
  67. },
  68. {
  69. name: '王战克',
  70. status: '已上报·审核通过',
  71. idCard: '430322******1032',
  72. reportTime: '2025-07-09 16:20:55',
  73. familyCount: 4,
  74. landCount: 1
  75. },
  76. {
  77. name: '王城埠',
  78. status: '已上报·审核通过',
  79. idCard: '430322******1019',
  80. reportTime: '2025-07-09 16:25:02',
  81. familyCount: 8,
  82. landCount: 1
  83. },
  84. {
  85. name: '王怀埠',
  86. status: '已上报·审核通过',
  87. idCard: '430322******1031',
  88. reportTime: '2025-07-09 16:27:07',
  89. familyCount: 2,
  90. landCount: 1
  91. },
  92. {
  93. name: '董庆林',
  94. status: '已上报·审核通过',
  95. idCard: '430322******1010',
  96. reportTime: '2025-07-09 16:29:05',
  97. familyCount: 3,
  98. landCount: 1
  99. },
  100. {
  101. name: '王立位',
  102. status: '已上报·审核通过',
  103. idCard: '430322******1014',
  104. reportTime: '2025-07-09 16:30:03',
  105. familyCount: 3,
  106. landCount: 2
  107. }
  108. ]);
  109. // 总条数
  110. const total = ref(contractorList.value.length);
  111. // 页面加载时初始化(可替换为接口请求)
  112. onMounted(() => {
  113. // 实际项目中这里调用接口获取列表数据
  114. // getContractorList().then(res => {
  115. // contractorList.value = res.data;
  116. // total.value = res.total;
  117. // });
  118. });
  119. // 搜索事件
  120. const handleSearch = () => {
  121. // 实际项目中这里调用搜索接口
  122. uni.showToast({
  123. title: `搜索关键词:${searchKey.value}`,
  124. icon: 'none'
  125. });
  126. // 模拟搜索(过滤本地数据)
  127. // const filteredList = 原始数据.filter(item =>
  128. // item.name.includes(searchKey.value) || item.idCard.includes(searchKey.value)
  129. // );
  130. // contractorList.value = filteredList;
  131. // total.value = filteredList.length;
  132. };
  133. const progressPage = () => {
  134. uni.navigateTo({
  135. url: `/pages/investigator/Households/progress`
  136. })
  137. }
  138. </script>
  139. <style scoped>
  140. /* 页面容器 */
  141. .page-container {
  142. padding: 20rpx;
  143. background-color: #f5f5f5;
  144. min-height: 100vh;
  145. }
  146. /* 搜索栏 */
  147. .search-bar {
  148. display: flex;
  149. gap: 16rpx;
  150. margin-bottom: 20rpx;
  151. }
  152. .search-input {
  153. flex: 1;
  154. height: 68rpx;
  155. padding: 0 20rpx;
  156. border: 1rpx solid #ddd;
  157. border-radius: 8rpx;
  158. background-color: #fff;
  159. font-size: 28rpx;
  160. }
  161. .search-btn {
  162. width: 120rpx;
  163. height: 68rpx;
  164. line-height: 68rpx;
  165. background-color: #1677ff;
  166. color: #fff;
  167. border-radius: 8rpx;
  168. font-size: 28rpx;
  169. text-align: center;
  170. }
  171. /* 总条数 */
  172. .total-count {
  173. font-size: 28rpx;
  174. color: #666;
  175. margin-bottom: 20rpx;
  176. }
  177. /* 列表容器 */
  178. .list-container {
  179. display: flex;
  180. flex-direction: column;
  181. gap: 16rpx;
  182. }
  183. /* 列表项 */
  184. .list-item {
  185. background-color: #fff;
  186. border-radius: 8rpx;
  187. padding: 20rpx;
  188. }
  189. .item-header {
  190. display: flex;
  191. justify-content: space-between;
  192. align-items: center;
  193. margin-bottom: 16rpx;
  194. }
  195. .name {
  196. font-size: 32rpx;
  197. font-weight: 600;
  198. color: #333;
  199. }
  200. .status-tag {
  201. font-size: 24rpx;
  202. color: #1677ff;
  203. background-color: #e6f0ff;
  204. padding: 4rpx 12rpx;
  205. border-radius: 4rpx;
  206. }
  207. /* 信息行 */
  208. .item-info-row {
  209. display: flex;
  210. flex-wrap: wrap;
  211. gap: 20rpx;
  212. margin-bottom: 12rpx;
  213. }
  214. .info-item {
  215. display: flex;
  216. font-size: 26rpx;
  217. }
  218. .label {
  219. color: #999;
  220. margin-right: 8rpx;
  221. }
  222. .value {
  223. color: #333;
  224. }
  225. </style>