cm-ladder-popup.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template name="cm-ladder-popup">
  2. <!-- 规格阶梯价 -->
  3. <view class="tui-popup-maskmodel" v-show="show" @click.stop="hidePopup">
  4. <view class="tui-popup-ladder">
  5. <view class="tui-scrollview-box">
  6. <view class="ladder-main clearfix">
  7. <view class="ladder-item">
  8. <view class="ladder-item-td">起订量</view> <view class="ladder-item-td">价格</view>
  9. </view>
  10. <view class="ladder-item" v-for="(ladd, index) in ladderPriceList" :key="index">
  11. <view class="ladder-item-td">{{ ladd.numRange }}</view>
  12. <view class="ladder-item-td">¥{{ ladd.buyPrice | NumFormat }}</view>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  17. <view class="tui-flex-1">
  18. <view class="tui-button" @click.stop="hidePopup">了解</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import { mapState, mapMutations } from 'vuex'
  26. export default {
  27. name: 'cm-ladder-popup',
  28. props: {
  29. list: {
  30. type: Array
  31. },
  32. show: {
  33. type: Boolean,
  34. default: false
  35. },
  36. type: {
  37. type: Number,
  38. default: 1
  39. }
  40. },
  41. data() {
  42. return {
  43. ladderPriceList:[]
  44. }
  45. },
  46. filters: {
  47. NumFormat: function(value) {
  48. //处理金额
  49. if (!value) return '0.00'
  50. let number = Number(value).toFixed(2)
  51. return number
  52. }
  53. },
  54. created() {
  55. this.ladderPriceList = this.list
  56. },
  57. methods: {
  58. hidePopup() {
  59. this.$parent.laddePopupShow = false
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. .tui-popup-maskmodel{
  66. width: 100%;
  67. height: 100%;
  68. position: fixed;
  69. top: 0;
  70. left: 0;
  71. background: rgba(0, 0, 0, 0.6);
  72. z-index: 1000;
  73. }
  74. .tui-popup-ladder {
  75. width: 100%;
  76. height: 700rpx;
  77. box-sizing: border-box;
  78. padding: 40rpx 24rpx 0 24rpx;
  79. border-radius: 16rpx;
  80. background-color: #ffffff;
  81. box-shadow: 0px 10rpx 12rpx 0px rgba(0, 0, 0, 0.2);
  82. position: absolute;
  83. bottom: 0;
  84. left: 0;
  85. z-index: 1009;
  86. .tui-scrollview-box {
  87. width: 100%;
  88. height: auto;
  89. float: left;
  90. box-sizing: border-box;
  91. .ladder-main {
  92. width: 100%;
  93. min-height: 240rpx;
  94. border: 1px solid rgba(225, 86, 22, 0.6);
  95. border-radius: 10rpx;
  96. .ladder-item {
  97. width: 100%;
  98. height: 80rpx;
  99. float: left;
  100. border-bottom: 1px solid rgba(225, 86, 22, 0.6);
  101. &:nth-child(1) {
  102. .ladder-item-td {
  103. color: #333333;
  104. }
  105. }
  106. &:last-child {
  107. border-bottom: none;
  108. }
  109. .ladder-item-td {
  110. width: 50%;
  111. text-align: center;
  112. line-height: 80rpx;
  113. font-size: $font-size-28;
  114. color: $color-system;
  115. box-sizing: border-box;
  116. float: left;
  117. &:nth-child(1) {
  118. border-right: 1px solid rgba(225, 86, 22, 0.6);
  119. }
  120. }
  121. }
  122. }
  123. }
  124. }
  125. .tui-popup-btn {
  126. width: 100%;
  127. height: auto;
  128. float: left;
  129. margin-top: 200rpx;
  130. .tui-button {
  131. width: 100%;
  132. height: 88rpx;
  133. background: $btn-confirm;
  134. line-height: 88rpx;
  135. text-align: center;
  136. color: #ffffff;
  137. font-size: $font-size-28;
  138. border-radius: 44rpx;
  139. }
  140. }
  141. </style>