BlockPopup.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <u-popup
  3. :show="layerVisible"
  4. @close="layerClose"
  5. :round="8"
  6. @open="layerOpen"
  7. >
  8. <view class="layer-popup">
  9. <view class="layer-popup__header">
  10. <view class="layer-popup__close">
  11. <u-icon
  12. name="close"
  13. size="36rpx"
  14. color="#4e6961"
  15. @click="layerClose"
  16. ></u-icon>
  17. </view>
  18. <view class="layer-popup__title"
  19. >{{
  20. `${dataSource.groupName || '未分组'}-${dataSource.blockName || '-'}`
  21. }}
  22. </view>
  23. </view>
  24. <view class="layer-popup__content">
  25. <view
  26. class="crop-card"
  27. v-for="item in dataSource.fmsPlanCropResVoList || []"
  28. :key="item.planId"
  29. >
  30. <view class="crop-card__title"
  31. >{{ item.cropName || '' }} - {{ item.planPeriodname || '' }}</view
  32. >
  33. <view class="crop-card__body">
  34. <view class="crop-card__label">种植面积</view>
  35. <view class="crop-card__value">{{ item.planArea || '-' }} 亩</view>
  36. </view>
  37. </view>
  38. <DescriptionItem>
  39. <view slot="title">地块面积</view>
  40. <view slot="content">{{ dataSource.blockArea || '-' }} 亩</view>
  41. </DescriptionItem>
  42. <DescriptionItem>
  43. <view slot="title">地块类型</view>
  44. <view slot="content">{{ dataSource.blockTypeContent || '-' }}</view>
  45. </DescriptionItem>
  46. <DescriptionItem>
  47. <view slot="title">负责人</view>
  48. <view slot="content">{{ dataSource.blockManagername || '-' }}</view>
  49. </DescriptionItem>
  50. <DescriptionItem>
  51. <view slot="title">联系方式</view>
  52. <view slot="content">{{ dataSource.blockTel || '-' }}</view>
  53. </DescriptionItem>
  54. <DescriptionItem>
  55. <view slot="title">所属基地</view>
  56. <view slot="content">{{ dataSource.landName || '-' }}</view>
  57. </DescriptionItem>
  58. <view class="layer-popup__link" @click="handleLink">详情</view>
  59. </view>
  60. </view>
  61. </u-popup>
  62. </template>
  63. <script>
  64. import DescriptionItem from '@/components/Descriptions/DescriptionItem.vue';
  65. export default {
  66. name: 'DevicePopup',
  67. components: {
  68. DescriptionItem
  69. },
  70. props: {
  71. visible: {
  72. type: Boolean,
  73. default: false
  74. },
  75. dataSource: {
  76. type: Object,
  77. default: () => ({})
  78. }
  79. },
  80. data() {
  81. return {
  82. layerVisible: false
  83. };
  84. },
  85. watch: {
  86. visible(newVal) {
  87. if (newVal !== this.layerVisible) {
  88. this.layerVisible = newVal;
  89. }
  90. }
  91. },
  92. methods: {
  93. layerClose() {
  94. this.$emit('update:visible', false);
  95. this.$emit('close');
  96. },
  97. layerOpen() {
  98. this.$emit('layerOpen');
  99. },
  100. handleLink() {
  101. uni.navigateTo({
  102. url: `/fmsPages/land/blockDetail?blockId=${this.dataSource.blockId}`
  103. });
  104. }
  105. }
  106. };
  107. </script>
  108. <style lang="scss" scoped>
  109. .layer-popup {
  110. background-color: #fff;
  111. &__header {
  112. position: relative;
  113. height: 96rpx;
  114. padding: 0 32rpx;
  115. color: #fff;
  116. border-bottom: 1rpx solid #e4e7ed;
  117. }
  118. &__title {
  119. text-align: left;
  120. font-size: 32rpx;
  121. line-height: 96rpx;
  122. color: #042118;
  123. max-width: 80%;
  124. }
  125. &__close {
  126. position: absolute;
  127. top: 0;
  128. right: 0;
  129. padding: 20rpx;
  130. color: #4e6961;
  131. }
  132. &__content {
  133. padding: 32rpx;
  134. background-color: #fff;
  135. }
  136. &__footer {
  137. display: flex;
  138. justify-content: center;
  139. padding: 16rpx 32rpx;
  140. background-color: #fff;
  141. box-shadow: 0 -2px 4px 0 #0000001a;
  142. }
  143. &__link {
  144. color: #14a478;
  145. font-size: 28rpx;
  146. text-align: center;
  147. line-height: 40rpx;
  148. margin-top: 16rpx;
  149. }
  150. }
  151. .crop-card {
  152. background-color: #f5f7fa;
  153. border-radius: 8rpx;
  154. padding: 16rpx 32rpx;
  155. margin-bottom: 16rpx;
  156. &:last-child {
  157. margin-bottom: 0;
  158. }
  159. &__title {
  160. font-size: 28rpx;
  161. line-height: 34rpx;
  162. margin-bottom: 6rpx;
  163. color: #333;
  164. }
  165. &__body {
  166. display: flex;
  167. align-items: center;
  168. font-size: 28rpx;
  169. line-height: 44rpx;
  170. }
  171. &__label {
  172. color: #9ba6a3;
  173. margin-right: 16rpx;
  174. }
  175. &__value {
  176. color: #333;
  177. }
  178. }
  179. </style>