cm-cart-navbar.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="cart-navbar">
  3. <simple-safe-view :safeStatus="safeArea">
  4. <view class="navbar">
  5. <view
  6. class="icon iconfont"
  7. :class="isCheckedAll ? 'icon-xuanze' : 'icon-weixuanze'"
  8. @click="$emit('all')"
  9. >
  10. <text>全选</text>
  11. </view>
  12. <template v-if="isDeleted">
  13. <view class="control">
  14. <tui-button
  15. type="gray"
  16. width="210rpx"
  17. height="80rpx"
  18. :size="30"
  19. shape="circle"
  20. @click="$emit('cancel')"
  21. >
  22. 取消
  23. </tui-button>
  24. <tui-button
  25. type="base"
  26. width="210rpx"
  27. height="80rpx"
  28. :size="30"
  29. shape="circle"
  30. @click="$emit('remove')"
  31. >
  32. 删除
  33. </tui-button>
  34. </view>
  35. </template>
  36. <template v-else>
  37. <view class="center">
  38. <view class="total">
  39. <text>总价:</text>
  40. <text class="price">¥{{ data.finallyPrice | priceFormat }}</text>
  41. <text class="delete" v-if="data.allPrice > data.finallyPrice">
  42. ¥{{ data.allPrice | priceFormat }}
  43. </text>
  44. </view>
  45. <view class="reduce" v-if="data.discountedPrice">
  46. <text class="price" v-if="data.discountedPrice">
  47. 共减¥{{ data.discountedPrice | priceFormat }}
  48. </text>
  49. <text class="detail" @click="popupShow = true">优惠明细</text>
  50. <tui-icon
  51. :name="popupShow ? 'arrowup' : 'arrowdown'"
  52. color="#fc32b4"
  53. size="30rpx"
  54. ></tui-icon>
  55. </view>
  56. </view>
  57. <tui-button
  58. type="base"
  59. width="210rpx"
  60. height="80rpx"
  61. :size="30"
  62. shape="circle"
  63. @click="$emit('submit')"
  64. >
  65. 去结算({{ data.count }})
  66. </tui-button>
  67. </template>
  68. </view>
  69. </simple-safe-view>
  70. <!-- 弹出 优惠明细-->
  71. <tui-bottom-popup :zIndex="89" :maskZIndex="88" :show="popupShow">
  72. <template>
  73. <view class="popup-content">
  74. <simple-safe-view :safeStatus="safeArea">
  75. <view class="icon-iconfontguanbi iconfont colse" @click="popupShow = false"></view>
  76. <view class="title">优惠明细</view>
  77. <view class="row">
  78. <text>商品总额</text>
  79. <text>¥{{ data.allPrice | priceFormat }}</text>
  80. </view>
  81. <view class="row">
  82. <text>促销满减</text>
  83. <text class="reduce">-¥0.00</text>
  84. </view>
  85. <view class="row">
  86. <text>优惠券</text>
  87. <text class="reduce">-¥{{ data.couponAmount | priceFormat }}</text>
  88. </view>
  89. <view class="row total-price">
  90. <text>总计</text>
  91. <text>¥{{ data.finallyPrice | priceFormat }}</text>
  92. </view>
  93. <view class="tip">实际订单金额已结算页为准</view>
  94. </simple-safe-view>
  95. </view>
  96. </template>
  97. </tui-bottom-popup>
  98. </view>
  99. </template>
  100. <script>
  101. export default {
  102. name: 'cm-cart-navbar',
  103. props: {
  104. safeArea: {
  105. type: Boolean,
  106. default: false
  107. },
  108. isDeleted: {
  109. type: Boolean,
  110. default: false
  111. },
  112. isCheckedAll: {
  113. type: Boolean,
  114. default: false
  115. },
  116. data: {
  117. type: Object,
  118. default: () => {}
  119. }
  120. },
  121. data() {
  122. return {
  123. popupShow: false
  124. }
  125. },
  126. methods: {}
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .cart-navbar {
  131. @extend .fixed-bottom;
  132. z-index: 90;
  133. background: #fff;
  134. box-sizing: border-box;
  135. border-top: 1rpx solid #eee;
  136. .navbar {
  137. position: relative;
  138. height: 100rpx;
  139. @extend .cm-flex-between;
  140. padding: 0 24rpx;
  141. z-index: 90;
  142. background-color: #fff;
  143. &::after {
  144. content: '';
  145. display: block;
  146. width: 750rpx;
  147. height: 100rpx;
  148. position: absolute;
  149. bottom: -100rpx;
  150. left: 0;
  151. background-color: #fff;
  152. }
  153. .icon {
  154. margin-right: 6rpx;
  155. text {
  156. display: inline-block;
  157. font-size: 30rpx;
  158. margin-left: 4rpx;
  159. color: #333;
  160. }
  161. }
  162. .control {
  163. width: 444rpx;
  164. @extend .cm-flex-between;
  165. }
  166. .total,
  167. .reduce {
  168. .price {
  169. color: #f83c6c;
  170. }
  171. .detail {
  172. color: #f83c6c;
  173. }
  174. }
  175. .total {
  176. font-size: 26rpx;
  177. margin-bottom: 4rpx;
  178. .delete {
  179. font-size: 20rpx;
  180. color: #999999;
  181. text-decoration: line-through;
  182. font-weight: normal;
  183. margin-left: 10rpx;
  184. }
  185. }
  186. .reduce {
  187. font-size: 24rpx;
  188. .price {
  189. margin-right: 32rpx;
  190. }
  191. .detail {
  192. }
  193. }
  194. }
  195. }
  196. .popup-content {
  197. position: relative;
  198. padding: 24rpx;
  199. .colse {
  200. position: absolute;
  201. top: 24rpx;
  202. right: 24rpx;
  203. display: block;
  204. width: 40rpx;
  205. height: 40rpx;
  206. text-align: center;
  207. line-height: 40rpx;
  208. color: #999;
  209. }
  210. .title {
  211. text-align: center;
  212. font-size: 30rpx;
  213. margin-bottom: 30rpx;
  214. }
  215. .row {
  216. @extend .cm-flex-between;
  217. margin-top: 24rpx;
  218. font-size: 26rpx;
  219. .reduce {
  220. color: #f83c6c;
  221. }
  222. &.total-price {
  223. font-weight: bold;
  224. }
  225. }
  226. .tip {
  227. margin-top: 24rpx;
  228. margin-bottom: 30rpx;
  229. font-size: 24rpx;
  230. color: #999999;
  231. }
  232. }
  233. </style>