cm-activipopu.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template name="cm-price">
  2. <!--促销活动弹窗提示-->
  3. <tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
  4. <view class="tui-popup-box clearfix">
  5. <template v-if="product.activeStatus == 1">
  6. <view class="tui-scrollview-box">
  7. <view class="ladder-main clearfix">
  8. <view class="ladder-item">
  9. <view class="ladder-item-td">购买数</view>
  10. <view class="ladder-item-td">价格</view>
  11. </view>
  12. <view class="ladder-item" v-for="(ladd, index) in product.ladderList" :key="index">
  13. <view class="ladder-item-td">{{ ladd.buyNum }}</view>
  14. <view class="ladder-item-td">{{ ladd.buyPrice | NumFormat }}</view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
  20. <view class="tui-flex-1">
  21. <view class="tui-button" @click="hidePopup()">了解</view>
  22. </view>
  23. </view>
  24. </view>
  25. </tui-bottom-popup>
  26. </template>
  27. <script>
  28. import { mapState,mapMutations } from 'vuex'
  29. export default{
  30. name:'cm-price',
  31. props:{
  32. product:{
  33. type:Object,
  34. },
  35. popupShow:{
  36. type:Boolean,
  37. default:false
  38. }
  39. },
  40. data() {
  41. return{
  42. isIphoneX:this.$store.state.isIphoneX,
  43. }
  44. },
  45. filters: {
  46. NumFormat:function(text) {//处理金额
  47. return Number(text).toFixed(2);
  48. },
  49. },
  50. created() {
  51. console.log(this.product)
  52. },
  53. computed: {
  54. ...mapState(['hasLogin','isWxAuthorize'])
  55. },
  56. methods:{
  57. hidePopup(){
  58. this.$parent.popupShow = false
  59. },
  60. goGoodActiveFn(id){
  61. this.$parent.popupShow = false
  62. this.$api.navigateTo('/pages/goods/goods-active?id='+id)
  63. }
  64. },
  65. }
  66. </script>
  67. <style lang="scss">
  68. .tui-flex-1 {
  69. flex: 1;
  70. }
  71. .tui-popup-box {
  72. position: relative;
  73. box-sizing: border-box;
  74. min-height: 220rpx;
  75. padding:24rpx 24rpx 0 24rpx;
  76. z-index: 9999;
  77. }
  78. .tui-scrollview-box{
  79. width: 100%;
  80. height: auto;
  81. float: left;
  82. box-sizing: border-box;
  83. .ladder-main{
  84. width: 100%;
  85. min-height: 240rpx;
  86. border: 1px solid $color-system;
  87. border-radius: 10rpx;
  88. .ladder-item{
  89. width: 100%;
  90. height: 80rpx;
  91. float: left;
  92. border-bottom: 1px solid $color-system;
  93. &:nth-child(1){
  94. .ladder-item-td{
  95. color: #333333;
  96. }
  97. }
  98. &:last-child{
  99. border-bottom: none;
  100. }
  101. .ladder-item-td{
  102. width:50%;
  103. text-align: center;
  104. line-height: 80rpx;
  105. font-size: $font-size-24;
  106. color: $color-system;
  107. box-sizing: border-box;
  108. float: left;
  109. &:nth-child(1){
  110. border-right: 1px solid $color-system;
  111. }
  112. }
  113. }
  114. }
  115. .box-title{
  116. font-size: $font-size-26;
  117. color: $text-color;
  118. text-align: left;
  119. line-height: 56rpx;
  120. .txt{
  121. color: $color-system;
  122. margin: 0 8rpx;
  123. }
  124. }
  125. .box-text{
  126. font-size: $font-size-26;
  127. color: $text-color;
  128. text-align: left;
  129. line-height: 56rpx;
  130. .txt{
  131. color: #ff2a2a;
  132. }
  133. }
  134. .box-product{
  135. width: 100%;
  136. height: auto;
  137. margin-top: 20rpx;
  138. .title{
  139. font-size: $font-size-24;
  140. color: $text-color;
  141. text-align: left;
  142. line-height: 54rpx;
  143. }
  144. .box-product-main{
  145. width: 100%;
  146. height: 136rpx;
  147. float: left;
  148. margin: 10rpx 0;
  149. .image{
  150. width: 134rpx;
  151. height: 134rpx;
  152. border: 1px solid #EBEBEB;
  153. float: left;
  154. image{
  155. width: 100%;
  156. height: 100%;
  157. display: block;
  158. }
  159. }
  160. .info{
  161. width: 540rpx;
  162. height: 134rpx;
  163. float: left;
  164. margin-left: 16rpx;
  165. position: relative;
  166. .name{
  167. width: 100%;
  168. float: left;
  169. line-height: 40rpx;
  170. font-size: $font-size-28;
  171. color: $text-color;
  172. -o-text-overflow: ellipsis;
  173. text-overflow: ellipsis;
  174. display: -webkit-box;
  175. word-break: break-all;
  176. -webkit-box-orient: vertical;
  177. -webkit-line-clamp: 2;
  178. overflow: hidden;
  179. }
  180. .num{
  181. width: 100%;
  182. height: 44rpx;
  183. font-size: $font-size-24;
  184. color: $text-color;
  185. text-align: left;
  186. line-height: 44rpx;
  187. position: absolute;
  188. bottom: 0;
  189. left: 0;
  190. }
  191. }
  192. }
  193. }
  194. }
  195. .tui-popup-btn {
  196. width: 100%;
  197. height: auto;
  198. float: left;
  199. margin-top: 24rpx;
  200. .tui-button{
  201. width: 100%;
  202. height: 88rpx;
  203. background: $btn-confirm;
  204. line-height: 88rpx;
  205. text-align: center;
  206. color: #FFFFFF;
  207. font-size: $font-size-28;
  208. border-radius: 44rpx;
  209. }
  210. }
  211. </style>