order-alert.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template name="sharealert">
  2. <view class="alert spec">
  3. <view class="model-warp" @click.stop="hideConfirm">
  4. <view class="content" v-if="modelType == 1">
  5. <view class="content-title"></view>
  6. <view class="text-content clearfix">
  7. <view class="text">
  8. <text>您有余额<text class="price_number">¥{{ payModelData.ableUserMoney }}</text>暂未使用,是否需要抵扣订单?</text>
  9. <text>抵扣后您只需再支付<text class="price_number">¥{{ payModelData.pendingPayments }}</text></text></view>
  10. <view class="alert-btn" @click="cancelConfirm(dataInfo)">不抵扣,继续付款</view>
  11. <view class="alert-btn border" @click="paymentConfirm(1, dataInfo)">抵扣,继续付款</view>
  12. </view>
  13. </view>
  14. <view class="content" v-if="modelType == 2">
  15. <view class="content-title"></view>
  16. <view class="text-content clearfix">
  17. <view class="text">您有余额<text class="price_number">¥{{ payModelData.ableUserMoney }}</text>暂未使用,是否需要抵扣订单?抵扣后订单支付完成</view>
  18. <view class="alert-btn" @click="cancelConfirm(dataInfo)">不抵扣,继续付款</view>
  19. <view class="alert-btn border" @click="paymentConfirm(2, dataInfo)">抵扣</view>
  20. </view>
  21. </view>
  22. <view class="content" v-if="modelType == 3">
  23. <view class="content-title"></view>
  24. <view class="text-content clearfix">
  25. <view class="text">目前账户余额剩余<text class="price_number">¥{{ payModelData.ableUserMoney.toFixed(2) }}</text>是否抵扣订单?</view>
  26. <view class="alert-btn" @click="hideConfirm">取消,不抵扣</view>
  27. <view class="alert-btn border" @click="paymentConfirm(3, dataInfo)">抵扣</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. name: 'sharealert',
  36. props: {
  37. modelType: {
  38. type: Number,
  39. default: 3
  40. },
  41. payModelData: {
  42. type: Object
  43. }
  44. },
  45. data() {
  46. return {
  47. dataInfo: {}
  48. }
  49. },
  50. created() {
  51. this.infoData(this.payModelData)
  52. },
  53. methods: {
  54. infoData(el) {
  55. this.dataInfo = el
  56. },
  57. hideConfirm() {
  58. this.$parent.isPayModel = false
  59. },
  60. cancelConfirm(data) {
  61. this.$emit('cancelConfirm', data)
  62. },
  63. paymentConfirm(type, data) {
  64. this.$parent.isPayModel = false
  65. let _data = { type: type, order: data }
  66. this.$emit('paymentConfirm', _data)
  67. },
  68. btnConfirm(data) {
  69. //点击事件
  70. this.$emit('btnConfirm', data)
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. /*弹窗*/
  77. .model-warp.none {
  78. display: none;
  79. }
  80. .model-warp.show {
  81. display: block;
  82. }
  83. .model-warp {
  84. width: 100%;
  85. height: 100%;
  86. background: rgba(0, 0, 0, 0.3);
  87. position: fixed;
  88. top: 0;
  89. left: 0;
  90. z-index: 10000;
  91. transition: all 0.4s;
  92. &.none {
  93. display: none;
  94. }
  95. &.show {
  96. display: block;
  97. }
  98. .content {
  99. width: 540rpx;
  100. min-height: 310rpx;
  101. box-sizing: border-box;
  102. position: absolute;
  103. left: 50%;
  104. top: 50%;
  105. transform: translate(-50%, -50%);
  106. border-radius: 14rpx;
  107. background-color: #ffffff;
  108. padding-top: 180rpx;
  109. .content-title {
  110. position: absolute;
  111. left: 0;
  112. top: -53rpx;
  113. width: 100%;
  114. height: 232rpx;
  115. background: url(https://static.caimei365.com/app/wisa/img/pay-alert-bg.png) no-repeat;
  116. background-size: contain;
  117. }
  118. .text-content {
  119. width: 100%;
  120. min-height: 208rpx;
  121. box-sizing: border-box;
  122. padding: 24rpx;
  123. float: left;
  124. background-color: #ffffff;
  125. border-radius: 0 0 14rpx 14rpx;
  126. .text {
  127. letter-spacing: 2rpx;
  128. line-height: 50rpx;
  129. font-size: $font-size-26;
  130. color: $text-color;
  131. text-align: justify;
  132. margin-bottom: 30rpx;
  133. }
  134. .price_number {
  135. color: $uni-text-color-price;
  136. }
  137. }
  138. .alert-btn {
  139. box-sizing: border-box;
  140. width: 492rpx;
  141. height: 86rpx;
  142. background: $btn-confirm;
  143. line-height: 86rpx;
  144. text-align: center;
  145. border-radius: 43rpx;
  146. color: #ffffff;
  147. margin-top: 20rpx;
  148. border: 1px solid $btn-confirm;
  149. &.border {
  150. background: #fff;
  151. color: $btn-confirm;
  152. }
  153. }
  154. }
  155. }
  156. </style>