cm-activipopu.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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.actStatus == null && product.ladderFlag == 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.ladderPriceList" :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. <template v-else>
  20. <view class="tui-scrollview-box">
  21. <view class="box-text">
  22. <text>促销时间:</text>
  23. <text class="txt" v-if="product.promotion.status == 1">不限时</text>
  24. <text class="txt" v-else>{{ product.promotion.beginTime }} ~ {{ product.promotion.endTime }}</text>
  25. </view>
  26. <view class="box-title" v-show="product.promotion.mode ==2">
  27. <text>购买{{product.promotion.name}}商品,满</text>
  28. <text class="txt">¥{{product.promotion == null ? '0.00' : product.promotion.touchPrice | NumFormat}}</text>减
  29. <text class="txt">¥{{product.promotion == null ? '0.00' : product.promotion.reducedPrice | NumFormat}}</text>
  30. </view>
  31. <view class="box-title" v-show="product.promotion.mode==3">
  32. <text>购买{{product.promotion.name}}商品,满</text>
  33. <text class="txt">¥{{product.promotion.touchPrice}}</text>赠送商品
  34. </view>
  35. <view class="box-product" v-show="product.promotion.mode==3">
  36. <view class="box-product-main" v-for="(item, index) in product.promotion.giftList" :key="index">
  37. <view class="image"><image :src="item.image" mode="widthFix"></image></view>
  38. <view class="info">
  39. <view class="name">{{ item.name }}</view>
  40. <view class="num">X{{ item.number }}</view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
  47. <view class="tui-flex-1">
  48. <view class="tui-button" v-if="product.promotion.type == 2" @click="goGoodActiveFn(product.promotion.id)">更多凑单商品</view>
  49. <view class="tui-button" v-else @click="hidePopup()">了解</view>
  50. </view>
  51. </view>
  52. </view>
  53. </tui-bottom-popup>
  54. </template>
  55. <script>
  56. import { mapState,mapMutations } from 'vuex'
  57. export default{
  58. name:'cm-price',
  59. props:{
  60. product:{
  61. type:Object,
  62. },
  63. popupShow:{
  64. type:Boolean,
  65. default:false
  66. }
  67. },
  68. data() {
  69. return{
  70. isIphoneX:this.$store.state.isIphoneX,
  71. }
  72. },
  73. filters: {
  74. NumFormat:function(text) {//处理金额
  75. return Number(text).toFixed(2);
  76. },
  77. },
  78. created() {
  79. console.log(this.product)
  80. },
  81. computed: {
  82. ...mapState(['hasLogin','isWxAuthorize'])
  83. },
  84. methods:{
  85. hidePopup(){
  86. this.$parent.popupShow = false
  87. },
  88. goGoodActiveFn(id){
  89. this.$parent.popupShow = false
  90. this.$api.navigateTo('/pages/goods/goods-active?id='+id)
  91. }
  92. },
  93. }
  94. </script>
  95. <style lang="scss">
  96. .tui-flex-1 {
  97. flex: 1;
  98. }
  99. .tui-popup-box {
  100. position: relative;
  101. box-sizing: border-box;
  102. min-height: 220rpx;
  103. padding:24rpx 24rpx 0 24rpx;
  104. }
  105. .tui-scrollview-box{
  106. width: 100%;
  107. height: auto;
  108. float: left;
  109. box-sizing: border-box;
  110. .ladder-main{
  111. width: 100%;
  112. min-height: 240rpx;
  113. border: 1px solid rgba(225,86,22,0.3);
  114. border-radius: 10rpx;
  115. .ladder-item{
  116. width: 100%;
  117. height: 80rpx;
  118. float: left;
  119. border-bottom: 1px solid rgba(225,86,22,0.3);
  120. &:nth-child(1){
  121. .ladder-item-td{
  122. color: #333333;
  123. }
  124. }
  125. &:last-child{
  126. border-bottom: none;
  127. }
  128. .ladder-item-td{
  129. width:50%;
  130. text-align: center;
  131. line-height: 80rpx;
  132. font-size: $font-size-24;
  133. color: $color-system;
  134. box-sizing: border-box;
  135. float: left;
  136. &:nth-child(1){
  137. border-right: 1px solid rgba(225,86,22,0.3);
  138. }
  139. }
  140. }
  141. }
  142. .box-title{
  143. font-size: $font-size-26;
  144. color: $text-color;
  145. text-align: left;
  146. line-height: 56rpx;
  147. .txt{
  148. color: $color-system;
  149. margin: 0 8rpx;
  150. }
  151. }
  152. .box-text{
  153. font-size: $font-size-26;
  154. color: $text-color;
  155. text-align: left;
  156. line-height: 56rpx;
  157. .txt{
  158. color: $color-system;
  159. }
  160. }
  161. .box-product{
  162. width: 100%;
  163. height: auto;
  164. margin-top: 20rpx;
  165. .title{
  166. font-size: $font-size-24;
  167. color: $text-color;
  168. text-align: left;
  169. line-height: 54rpx;
  170. }
  171. .box-product-main{
  172. width: 100%;
  173. height: 136rpx;
  174. float: left;
  175. margin: 10rpx 0;
  176. .image{
  177. width: 134rpx;
  178. height: 134rpx;
  179. border: 1px solid #EBEBEB;
  180. float: left;
  181. image{
  182. width: 100%;
  183. height: 100%;
  184. display: block;
  185. }
  186. }
  187. .info{
  188. width: 540rpx;
  189. height: 134rpx;
  190. float: left;
  191. margin-left: 16rpx;
  192. position: relative;
  193. .name{
  194. width: 100%;
  195. float: left;
  196. line-height: 40rpx;
  197. font-size: $font-size-28;
  198. color: $text-color;
  199. -o-text-overflow: ellipsis;
  200. text-overflow: ellipsis;
  201. display: -webkit-box;
  202. word-break: break-all;
  203. -webkit-box-orient: vertical;
  204. -webkit-line-clamp: 2;
  205. overflow: hidden;
  206. }
  207. .num{
  208. width: 100%;
  209. height: 44rpx;
  210. font-size: $font-size-24;
  211. color: $text-color;
  212. text-align: left;
  213. line-height: 44rpx;
  214. position: absolute;
  215. bottom: 0;
  216. left: 0;
  217. }
  218. }
  219. }
  220. }
  221. }
  222. .tui-popup-btn {
  223. width: 100%;
  224. height: auto;
  225. float: left;
  226. margin-top: 24rpx;
  227. .tui-button{
  228. width: 100%;
  229. height: 88rpx;
  230. background: $btn-confirm;
  231. line-height: 88rpx;
  232. text-align: center;
  233. color: #FFFFFF;
  234. font-size: $font-size-28;
  235. border-radius: 44rpx;
  236. }
  237. }
  238. </style>