index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="container">
  3. <!-- 统计信息 -->
  4. <view class="count-tip">共计 6 条</view>
  5. <!-- 地块列表 -->
  6. <view class="list-item" v-for="(item, index) in landList" :key="index">
  7. <!-- 地块编号+名称+面积 -->
  8. <view class="item-header">
  9. <text class="item-code">{{ item.code }}</text>
  10. <text class="item-name">{{ item.name }}</text>
  11. <text class="item-area">{{ item.area }}亩</text>
  12. <!-- 地块位置按钮 -->
  13. <text class="location-btn" @click="handleLocation(item)">地块位置</text>
  14. </view>
  15. <!-- 四至信息 -->
  16. <view class="boundary-row" @click="handleDetail(item)">
  17. <text class="boundary-label">地块东至:{{ item.east }}</text>
  18. <text class="boundary-label">地块西至:{{ item.west }}</text>
  19. </view>
  20. <view class="boundary-row">
  21. <text class="boundary-label">地块南至:{{ item.south }}</text>
  22. <text class="boundary-label">地块北至:{{ item.north }}</text>
  23. </view>
  24. <!-- 箭头按钮 -->
  25. <view class="arrow-btn">></view>
  26. </view>
  27. <!-- 新增按钮 -->
  28. <button class="add-btn" @click="handleAdd">新增</button>
  29. </view>
  30. </template>
  31. <script setup>
  32. import { ref } from 'vue';
  33. import { onLoad } from '@dcloudio/uni-app';
  34. // 模拟地块数据
  35. const landList = ref([
  36. {
  37. code: '00006',
  38. name: '桑枣村水田',
  39. area: '1.73',
  40. east: '田埂',
  41. west: '桑枣村水田',
  42. south: '桑枣村水田',
  43. north: '田埂'
  44. },
  45. {
  46. code: '00005',
  47. name: '桑枣村水田',
  48. area: '2.19',
  49. east: '桑枣村水田',
  50. west: '田埂',
  51. south: '田埂',
  52. north: '桑枣村水田'
  53. },
  54. {
  55. code: '00004',
  56. name: '桑枣村旱地',
  57. area: '0.94',
  58. east: '田埂',
  59. west: '桑枣村旱地',
  60. south: '田埂',
  61. north: '桑枣村旱地'
  62. },
  63. {
  64. code: '00003',
  65. name: '桑枣村旱地',
  66. area: '5.37',
  67. east: '桑枣村旱地',
  68. west: '桑枣村旱地',
  69. south: '桑枣村旱地',
  70. north: '桑枣村旱地'
  71. },
  72. {
  73. code: '00002',
  74. name: '桑枣村旱地',
  75. area: '1.78',
  76. east: '桑枣村旱地',
  77. west: '田埂',
  78. south: '桑枣村旱地',
  79. north: '田埂'
  80. },
  81. {
  82. code: '00001',
  83. name: '桑枣村旱地',
  84. area: '1.39',
  85. east: '田埂',
  86. west: '田埂',
  87. south: '田埂',
  88. north: '田埂'
  89. }
  90. ]);
  91. // 地块位置点击事件
  92. const handleLocation = (item) => {
  93. uni.navigateTo({
  94. url: `/pages/map/map`
  95. });
  96. };
  97. // 详情箭头点击事件
  98. const handleDetail = (item) => {
  99. console.log(item)
  100. uni.navigateTo({
  101. url: `/pages/map/collectively/information?landInfo=${encodeURIComponent(JSON.stringify(item))}`
  102. });
  103. };
  104. // 新增按钮点击事件
  105. const handleAdd = () => {
  106. uni.navigateTo({
  107. url: '/pages/map/collectively/add'
  108. });
  109. };
  110. </script>
  111. <style scoped>
  112. .container {
  113. padding: 16rpx;
  114. background-color: #f8f9fa;
  115. min-height: 100vh;
  116. box-sizing: border-box;
  117. }
  118. .count-tip {
  119. font-size: 28rpx;
  120. color: #666;
  121. margin-bottom: 16rpx;
  122. }
  123. .list-item {
  124. background-color: #fff;
  125. border-radius: 12rpx;
  126. padding: 20rpx;
  127. margin-bottom: 16rpx;
  128. position: relative;
  129. }
  130. .item-header {
  131. display: flex;
  132. align-items: center;
  133. margin-bottom: 12rpx;
  134. }
  135. .item-code {
  136. color: #007bff;
  137. font-size: 28rpx;
  138. margin-right: 8rpx;
  139. }
  140. .item-name {
  141. font-size: 28rpx;
  142. margin-right: 8rpx;
  143. }
  144. .item-area {
  145. font-size: 28rpx;
  146. color: #666;
  147. }
  148. .location-btn {
  149. color: #007bff;
  150. font-size: 28rpx;
  151. margin-left: auto;
  152. }
  153. .boundary-row {
  154. font-size: 26rpx;
  155. color: #666;
  156. margin-bottom: 8rpx;
  157. }
  158. .boundary-label{
  159. margin-right: 100rpx;
  160. }
  161. .arrow-btn {
  162. position: absolute;
  163. right: 20rpx;
  164. bottom: 40rpx;
  165. font-size: 32rpx;
  166. color: #999;
  167. }
  168. .add-btn {
  169. position: fixed;
  170. bottom: 40rpx;
  171. right: 40rpx;
  172. width: 100rpx;
  173. height: 100rpx;
  174. border-radius: 50%;
  175. background-color: #007bff;
  176. color: #fff;
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. font-size: 32rpx;
  181. white-space: nowrap;
  182. }
  183. </style>