1
0

bd-kb.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="bd-kb" v-if="express || shipping || pickup || limit">
  3. <view class="block dir-left-nowrap cross-center" v-if="express">
  4. <view class="box-grow-0">快递</view>
  5. <view class="content box-grow-1 u-line-1">{{express}}</view>
  6. </view>
  7. <view class="block dir-left-nowrap cross-center bd-margin" v-if="shipping" @click="openPopup('shipping', '包邮')">
  8. <view class="box-grow-0">包邮</view>
  9. <view class="content box-grow-1 u-line-1">{{shipping}}</view>
  10. <image class="bd-icon box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  11. </view>
  12. <view class="block dir-left-nowrap cross-center bd-margin" v-if="limit" @click="openPopup('limit', '限购')">
  13. <view class="box-grow-0">限购</view>
  14. <view class="content box-grow-1 u-line-1">{{limit}}</view>
  15. <image class="bd-icon box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  16. </view>
  17. <view class="block dir-left-nowrap cross-center bd-margin" v-if="pickup" @click="openPopup('pickup', '起送')">
  18. <view class="box-grow-0">起送</view>
  19. <view class="content box-grow-1 u-line-1">{{pickup}}</view>
  20. <image class="bd-icon box-grow-0" src="../../../static/image/icon/arrow-right.png"></image>
  21. </view>
  22. <u-popup v-model="show" length="600" mode="center" border-radius="14" @close="show = false">
  23. <view class="model" @touchmove.stop.prevent>
  24. <view class="f-top dir-left-nowrap main-between cross-center">
  25. <view class="f-title dir-left-nowrap cross-center u-line-1">
  26. <view class="p-title">{{showTitle}}</view>
  27. </view>
  28. <view class="f-image" @click="show = false">
  29. <image class="f-img" src="/static/image/icon/icon-close.png"></image>
  30. </view>
  31. </view>
  32. <scroll-view scroll-y class="f-scroll">
  33. <view class="f-scroll-content">
  34. {{showText}}
  35. </view>
  36. </scroll-view>
  37. </view>
  38. </u-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import uPopup from '../../basic-component/u-popup/u-popup.vue';
  43. export default {
  44. name: "bd-kb",
  45. props: {
  46. limit: String,
  47. shipping: String,
  48. express: String,
  49. pickup: String
  50. },
  51. components: {
  52. uPopup
  53. },
  54. data() {
  55. return {
  56. show: false,
  57. showText: '',
  58. showTitle: ''
  59. }
  60. },
  61. methods: {
  62. openPopup(data, title) {
  63. this.showText = this[data];
  64. this.showTitle = title;
  65. this.show = true;
  66. }
  67. }
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .bd-kb {
  72. width: 100%;
  73. padding: 20upx;
  74. background-color: #ffffff;
  75. margin-top: 24upx;
  76. }
  77. .block {
  78. font-size: 26upx;
  79. }
  80. .block view:first-child {
  81. margin-right: 26upx;
  82. color: #999999;
  83. }
  84. .content {
  85. color: #353535;
  86. }
  87. .bd-icon {
  88. width: 12upx;
  89. height: 22upx;
  90. }
  91. .bd-margin {
  92. margin-top: 20upx;
  93. }
  94. .bd-margin:first-child{
  95. margin-top: 0;
  96. }
  97. .model {
  98. background-color: #ffffff;
  99. padding-bottom: 24upx;
  100. }
  101. .f-scroll {
  102. max-height: 450upx;
  103. }
  104. .f-image {
  105. width: 78upx;
  106. height: 78upx;
  107. padding: 24upx;
  108. position: absolute;
  109. right: 0;
  110. }
  111. .f-img {
  112. width: 30upx;
  113. height: 30upx;
  114. }
  115. .f-top {
  116. height: 105upx;
  117. position: relative;
  118. }
  119. .f-title {
  120. position: absolute;
  121. left: 50%;
  122. transform: translateX(-50%);
  123. max-width: 594upx;
  124. }
  125. .p-title {
  126. font-size: 28upx;
  127. color: #000000;
  128. text-align: center;
  129. }
  130. .f-scroll-content {
  131. padding: 0 24upx;
  132. font-size: 28upx;
  133. color: #353535;
  134. }
  135. </style>