LandPopup.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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">{{ dataSource.landName || '-' }}</view>
  19. </view>
  20. <view class="layer-popup__content">
  21. <DescriptionItem labelWidth="140rpx">
  22. <view slot="title">基地面积</view>
  23. <view slot="content">{{ `${dataSource.landArea || '-'} 亩` }}</view>
  24. </DescriptionItem>
  25. <DescriptionItem labelWidth="140rpx">
  26. <view slot="title">基地负责人</view>
  27. <view slot="content">{{ dataSource.landManagerName || '-' }}</view>
  28. </DescriptionItem>
  29. <DescriptionItem labelWidth="140rpx">
  30. <view slot="title">联系方式</view>
  31. <view slot="content">{{ dataSource.landTel || '-' }}</view>
  32. </DescriptionItem>
  33. <view class="layer-popup__link" @click="handleLink">详情</view>
  34. </view>
  35. </view>
  36. </u-popup>
  37. </template>
  38. <script>
  39. import DescriptionItem from '@/components/Descriptions/DescriptionItem.vue';
  40. export default {
  41. name: 'LandPopup',
  42. components: {
  43. DescriptionItem
  44. },
  45. props: {
  46. visible: {
  47. type: Boolean,
  48. default: false
  49. },
  50. dataSource: {
  51. type: Object,
  52. default: () => ({})
  53. }
  54. },
  55. data() {
  56. return {
  57. layerVisible: false
  58. };
  59. },
  60. watch: {
  61. visible(newVal) {
  62. if (newVal !== this.layerVisible) {
  63. this.layerVisible = newVal;
  64. }
  65. }
  66. },
  67. methods: {
  68. layerClose() {
  69. this.$emit('update:visible', false);
  70. this.$emit('close');
  71. },
  72. layerOpen() {
  73. this.$emit('layerOpen');
  74. },
  75. handleLink() {
  76. uni.navigateTo({
  77. url: `/fmsPages/land/landDetail?landId=${this.dataSource.landId}`
  78. });
  79. }
  80. }
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .layer-popup {
  85. background-color: #fff;
  86. &__header {
  87. position: relative;
  88. height: 96rpx;
  89. padding: 0 32rpx;
  90. color: #fff;
  91. border-bottom: 1rpx solid #e4e7ed;
  92. }
  93. &__title {
  94. text-align: left;
  95. font-size: 32rpx;
  96. line-height: 96rpx;
  97. color: #042118;
  98. max-width: 80%;
  99. }
  100. &__close {
  101. position: absolute;
  102. top: 0;
  103. right: 0;
  104. padding: 20rpx;
  105. color: #4e6961;
  106. }
  107. &__content {
  108. padding: 32rpx;
  109. background-color: #fff;
  110. }
  111. &__footer {
  112. display: flex;
  113. justify-content: center;
  114. padding: 16rpx 32rpx;
  115. background-color: #fff;
  116. box-shadow: 0 -2px 4px 0 #0000001a;
  117. }
  118. &__link {
  119. color: #14a478;
  120. font-size: 28rpx;
  121. text-align: center;
  122. line-height: 40rpx;
  123. margin-top: 16rpx;
  124. }
  125. }
  126. </style>