cm-activipopu.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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.ladderPrices" :key="index">
  13. <view class="ladder-item-td">{{ ladd.numRange }}</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.promotions.status == 1">不限时</text>
  24. <text class="txt" v-else>{{ product.promotions.beginTime }} ~ {{ product.promotions.endTime }}</text>
  25. </view>
  26. <view class="box-title" v-show="product.promotions.mode ==2">
  27. <text>购买{{product.promotions.name}}商品,满</text>
  28. <text class="txt">¥{{product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat}}</text>减
  29. <text class="txt">¥{{product.promotions == null ? '0.00' : product.promotions.reducedPrice | NumFormat}}</text>
  30. </view>
  31. <view class="box-title" v-show="product.promotions.mode==3">
  32. <text>购买{{product.promotions.name}}商品,满</text>
  33. <text class="txt">¥{{product.promotions.touchPrice}}</text>赠送商品
  34. </view>
  35. <view class="box-product" v-show="product.promotions.mode==3">
  36. <view class="box-product-main" v-for="(item, index) in product.promotions.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.promotions.type == 2" @click="goGoodActiveFn(product.promotions.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. .image{
  175. width: 134rpx;
  176. height: 134rpx;
  177. border: 1px solid #EBEBEB;
  178. float: left;
  179. image{
  180. width: 100%;
  181. height: 100%;
  182. display: block;
  183. }
  184. }
  185. .info{
  186. width: 540rpx;
  187. height: 134rpx;
  188. float: left;
  189. margin-left: 16rpx;
  190. position: relative;
  191. .name{
  192. width: 100%;
  193. float: left;
  194. line-height: 40rpx;
  195. font-size: $font-size-28;
  196. color: $text-color;
  197. -o-text-overflow: ellipsis;
  198. text-overflow: ellipsis;
  199. display: -webkit-box;
  200. word-break: break-all;
  201. -webkit-box-orient: vertical;
  202. -webkit-line-clamp: 2;
  203. overflow: hidden;
  204. }
  205. .num{
  206. width: 100%;
  207. height: 44rpx;
  208. font-size: $font-size-24;
  209. color: $text-color;
  210. text-align: left;
  211. line-height: 44rpx;
  212. position: absolute;
  213. bottom: 0;
  214. left: 0;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. .tui-popup-btn {
  221. width: 100%;
  222. height: auto;
  223. float: left;
  224. margin-top: 24rpx;
  225. .tui-button{
  226. width: 100%;
  227. height: 88rpx;
  228. background: $btn-confirm;
  229. line-height: 88rpx;
  230. text-align: center;
  231. color: #FFFFFF;
  232. font-size: $font-size-28;
  233. border-radius: 14rpx;
  234. }
  235. }
  236. </style>