cm-ladder-popup.vue 2.9 KB

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