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">
  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 pproduct.romotions.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. },
  80. computed: {
  81. ...mapState(['hasLogin','isWxAuthorize'])
  82. },
  83. methods:{
  84. hidePopup(){
  85. this.$parent.popupShow = false
  86. },
  87. goGoodActiveFn(id){
  88. this.$parent.popupShow = false
  89. this.$api.navigateTo('/pages/goods/goods-active?id='+id)
  90. }
  91. },
  92. }
  93. </script>
  94. <style lang="scss">
  95. .tui-flex-1 {
  96. flex: 1;
  97. }
  98. .tui-popup-box {
  99. position: relative;
  100. box-sizing: border-box;
  101. min-height: 220rpx;
  102. padding:24rpx 24rpx 0 24rpx;
  103. }
  104. .tui-scrollview-box{
  105. width: 100%;
  106. height: auto;
  107. float: left;
  108. box-sizing: border-box;
  109. .ladder-main{
  110. width: 100%;
  111. height: 320rpx;
  112. border: 1px solid rgba(225,86,22,0.3);
  113. border-radius: 10rpx;
  114. .ladder-item{
  115. width: 100%;
  116. height: 80rpx;
  117. float: left;
  118. border-bottom: 1px solid rgba(225,86,22,0.3);
  119. &:nth-child(1){
  120. .ladder-item-td{
  121. color: #333333;
  122. }
  123. }
  124. &:last-child{
  125. border-bottom: none;
  126. }
  127. .ladder-item-td{
  128. width:50%;
  129. text-align: center;
  130. line-height: 80rpx;
  131. font-size: $font-size-24;
  132. color: $color-system;
  133. box-sizing: border-box;
  134. float: left;
  135. &:nth-child(1){
  136. border-right: 1px solid rgba(225,86,22,0.3);
  137. }
  138. }
  139. }
  140. }
  141. .box-title{
  142. font-size: $font-size-26;
  143. color: $text-color;
  144. text-align: left;
  145. line-height: 56rpx;
  146. .txt{
  147. color: $color-system;
  148. margin: 0 8rpx;
  149. }
  150. }
  151. .box-text{
  152. font-size: $font-size-26;
  153. color: $text-color;
  154. text-align: left;
  155. line-height: 56rpx;
  156. .txt{
  157. color: $color-system;
  158. }
  159. }
  160. .box-product{
  161. width: 100%;
  162. height: auto;
  163. margin-top: 20rpx;
  164. .title{
  165. font-size: $font-size-24;
  166. color: $text-color;
  167. text-align: left;
  168. line-height: 54rpx;
  169. }
  170. .box-product-main{
  171. width: 100%;
  172. height: 136rpx;
  173. .image{
  174. width: 134rpx;
  175. height: 134rpx;
  176. border: 1px solid #EBEBEB;
  177. float: left;
  178. image{
  179. width: 100%;
  180. height: 100%;
  181. display: block;
  182. }
  183. }
  184. .info{
  185. width: 540rpx;
  186. height: 134rpx;
  187. float: left;
  188. margin-left: 16rpx;
  189. position: relative;
  190. .name{
  191. width: 100%;
  192. float: left;
  193. line-height: 40rpx;
  194. font-size: $font-size-28;
  195. color: $text-color;
  196. -o-text-overflow: ellipsis;
  197. text-overflow: ellipsis;
  198. display: -webkit-box;
  199. word-break: break-all;
  200. -webkit-box-orient: vertical;
  201. -webkit-line-clamp: 2;
  202. overflow: hidden;
  203. }
  204. .num{
  205. width: 100%;
  206. height: 44rpx;
  207. font-size: $font-size-24;
  208. color: $text-color;
  209. text-align: left;
  210. line-height: 44rpx;
  211. position: absolute;
  212. bottom: 0;
  213. left: 0;
  214. }
  215. }
  216. }
  217. }
  218. }
  219. .tui-popup-btn {
  220. width: 100%;
  221. height: auto;
  222. float: left;
  223. margin-top: 24rpx;
  224. .tui-button{
  225. width: 100%;
  226. height: 88rpx;
  227. background: $btn-confirm;
  228. line-height: 88rpx;
  229. text-align: center;
  230. color: #FFFFFF;
  231. font-size: $font-size-28;
  232. border-radius: 14rpx;
  233. }
  234. }
  235. </style>