refundMsg.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <style lang="scss" scoped>
  2. .app-content{
  3. height: calc(100vh - 30rpx * 2);
  4. padding: 30rpx;
  5. background: #FFFFFF;
  6. .radioBtn{
  7. width: 30rpx;
  8. height: 30rpx;
  9. margin-right: 10rpx;
  10. border: 1px solid #ddd;
  11. border-radius: 50%;
  12. &.active{
  13. position: relative;
  14. border: 1px solid #3385ff;
  15. &:after{
  16. content: '';
  17. position: absolute;
  18. width: 18rpx;
  19. height: 18rpx;
  20. background: #3385ff;
  21. border-radius: 50%;
  22. }
  23. }
  24. }
  25. .refund-item-list{
  26. display: flex;
  27. padding-bottom: 30rpx;
  28. border-bottom: 1px solid #dddddd;
  29. .refund-label{
  30. width: 200rpx;
  31. text{color: red;}
  32. }
  33. .list{
  34. margin-bottom: 10rpx;
  35. .list-title{
  36. height: 60rpx;
  37. padding-bottom: 20rpx;
  38. }
  39. .list-val{
  40. input{
  41. width: 150rpx;
  42. border: 1px solid #ddd;
  43. }
  44. text{
  45. padding: 0 30rpx;
  46. }
  47. }
  48. }
  49. }
  50. .refund-item{
  51. display: flex;
  52. padding: 20rpx 0;
  53. .refund-label{width: 200rpx;text{color: red;}}
  54. input{
  55. border: 1px solid #ddd;
  56. }
  57. textarea{
  58. width: calc(100% - 210rpx);
  59. border: 1px solid #ddd;
  60. height:150rpx;
  61. }
  62. }
  63. .btn-box{
  64. .btn{
  65. width: 200rpx;
  66. height: 60rpx;
  67. border: 1px solid #666666;
  68. border-radius: 10rpx;
  69. &.active{
  70. background: #3385ff;
  71. color: #fff;
  72. border: 1px solid #3385ff;
  73. }
  74. }
  75. }
  76. }
  77. </style>
  78. <template>
  79. <view class="app-content">
  80. <view class="flex refund-item">
  81. <view class="refund-label">退款方式:</view>
  82. <view class="flex list">
  83. <view class="flex" >{{refundType==1?'退货并退款':'仅退款'}}</view>
  84. </view>
  85. </view>
  86. <view class="refund-item-list" v-if="refundType==1">
  87. <view class="refund-label">选择商品:</view>
  88. <view>
  89. <view class="list" v-for="(res,i) in product" :key="i">
  90. <view class="flex list-title" >
  91. {{res.itemName}} {{`¥${res.itemPrice}`}}
  92. </view>
  93. <view class="flex list-val">
  94. <input type="text" @focus="isMonitor = true" disabled v-model="res.bigNum"><text>扎</text>
  95. <input type="text" @focus="isMonitor = true" disabled v-model="res.smallNum"><text>支</text>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="flex refund-item">
  101. <view class="refund-label">订单原价:</view>
  102. <view class="list">{{parseFloat(prePrice)||0}}</view>
  103. </view>
  104. <view class="flex refund-item" v-if="discountType == 4">
  105. <view class="refund-label">红包优惠:</view>
  106. <view class="list">
  107. <text style="color:red;margin-right:20rpx;">-{{parseFloat(discountAmount) || 0}}</text>
  108. <text v-if="parseFloat(realPrice) == parseFloat(refundMoney)" style="color:red;">红包已退还</text>
  109. </view>
  110. </view>
  111. <view class="flex refund-item">
  112. <view class="refund-label">实付金额:</view>
  113. <view class="list">{{parseFloat(realPrice)||0}}</view>
  114. </view>
  115. <view class="flex refund-item">
  116. <view class="refund-label"><text></text>退款金额:</view>
  117. <input type="text" disabled v-model="refundMoney">
  118. </view>
  119. <view class=" refund-item">
  120. <view class="refund-label">备注:</view>
  121. <textarea disabled v-model="remark" />
  122. </view>
  123. </view>
  124. </template>
  125. <script>
  126. import { refundDetail } from "@/api/refund/index";
  127. export default {
  128. data() {
  129. return {
  130. isMonitor:true,
  131. product:'',
  132. refundMoney:0,
  133. refundType:1,
  134. remark:'',
  135. refundInfo:{},
  136. realPrice:0,
  137. prePrice:0,
  138. discountType:0,
  139. discountAmount:0
  140. };
  141. },
  142. onShow() {
  143. },
  144. methods: {
  145. init() {
  146. refundDetail({
  147. orderSn: this.option.orderSn
  148. }).then(res=>{
  149. this.refundInfo = res.data
  150. this.product = res.data.itemInfo;
  151. this.refundType = res.data.refundType;
  152. this.refundMoney = res.data.refundPrice;
  153. this.remark = res.data.remark;
  154. this.prePrice = res.data.orderInfo.prePrice
  155. this.discountType = res.data.orderInfo.discountType || 0
  156. this.discountAmount = res.data.orderInfo.discountAmount || 0
  157. if(this.discountType == 4){
  158. let realPrice = (Number(res.data.orderInfo.prePrice) - Number(res.data.orderInfo.discountAmount)).toFixed(2)
  159. this.realPrice = parseFloat(realPrice)
  160. }else{
  161. this.realPrice = parseFloat(res.data.orderInfo.realPrice)
  162. }
  163. })
  164. },
  165. }
  166. };
  167. </script>