submit-discounts.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="slot">
  3. <view class="line">
  4. <view class="labe">商品金额</view>
  5. <view class="value">
  6. <text>¥</text>
  7. <text>{{data.countPrice}}</text>
  8. </view>
  9. </view>
  10. <view class="line">
  11. <view class="labe">运费</view>
  12. <view class="value" v-if="data.freight==0">
  13. <text>免运费</text>
  14. </view>
  15. <view class="value" v-else>
  16. <text>¥</text>
  17. <text>{{parseFloat(data.freight).toFixed(2)}}</text>
  18. </view>
  19. </view>
  20. <!-- <view class="line">
  21. <view class="labe">立减</view>
  22. <view class="value money">
  23. <text>-</text>
  24. <text>¥</text>
  25. <text>9.00</text>
  26. </view>
  27. </view> -->
  28. <!-- {{JSON.stringify(usingCoupon)}} -->
  29. <view class="line">
  30. <view class="labe">优惠券</view>
  31. <view class="value" v-if="couponList.length<1">
  32. <text>无可用</text>
  33. </view>
  34. <view v-else class="value money" :class="data.discount>0?'money':'gray'" @click="goDiscountsPage">
  35. <template v-if="data.discount>0">
  36. <text>-&yen;{{data.discount}}</text>
  37. <u-tag class="utag" :text="usingCoupon.title" type="success" mode="dark" bg-color="#fd4558" />
  38. </template>
  39. <!-- <text v-else>无可用</text> -->
  40. <view class="more"><u-icon size="20" name="arrow-right"></u-icon></view>
  41. </view>
  42. </view>
  43. <!-- <view class="total">
  44. <text>合计:</text>
  45. <text>¥</text>
  46. <text>{{data.countPrice - data.discount}}</text>
  47. </view> -->
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. props: {
  53. data: {
  54. type: Object,
  55. default: () => {
  56. return {
  57. countPrice:0,
  58. discount:0,
  59. };
  60. }
  61. },
  62. usingCoupon:{
  63. type: Object,
  64. default: () => {
  65. return {};
  66. }
  67. },
  68. couponList:{
  69. type: Array,
  70. default: () => {
  71. return [];
  72. }
  73. },
  74. },
  75. methods: {
  76. goDiscountsPage() {
  77. this.$emit('selCoupon');
  78. return;
  79. uni.navigateTo({
  80. url: '/pages-mine/pages/discounts'
  81. });
  82. }
  83. }
  84. };
  85. </script>
  86. <style lang="scss" scoped>
  87. .slot {
  88. padding: 30rpx 30rpx 0 30rpx;
  89. background-color: $app-theme-bg-color;
  90. margin-top: 24rpx;
  91. }
  92. .line {
  93. display: flex;
  94. justify-content: space-between;
  95. align-items: center;
  96. margin-bottom: 30rpx;
  97. .label {
  98. font-size: 28rpx;
  99. color: $app-theme-text-black-color;
  100. }
  101. .value {
  102. // min-width: 100rpx;
  103. padding-right: 24rpx;
  104. font-size: 28rpx;
  105. color: $app-theme-text-black-color;
  106. flex: 1;
  107. text-align: right;
  108. display: flex;
  109. align-items: center;
  110. justify-content: flex-end;
  111. min-height: 1.2em;
  112. &.money {
  113. color: $app-theme-text-money-color;
  114. }
  115. &.gray {
  116. color: $app-theme-card-gray-color;
  117. position: relative;
  118. .more {
  119. position: absolute;
  120. right: -16rpx;
  121. margin-left: 10rpx;
  122. top: 50%;
  123. transform: translate(-50%, -50%);
  124. }
  125. }
  126. }
  127. }
  128. .total {
  129. border-top: 1rpx solid $app-theme-border-color;
  130. padding: 26rpx 0;
  131. text-align: right;
  132. text:nth-child(1) {
  133. font-size: 28rpx;
  134. color: $app-theme-text-black-color;
  135. }
  136. text:nth-child(2) {
  137. font-size: 20rpx;
  138. color: $app-theme-text-money-color;
  139. }
  140. text:nth-child(3) {
  141. font-size: 28rpx;
  142. color: $app-theme-text-money-color;
  143. }
  144. }
  145. .utag{
  146. margin: 0 10rpx;
  147. }
  148. </style>