PriceChange.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div>
  3. <div class="priceChange" :class="change === true ? 'on' : ''">
  4. <div class="priceTitle">
  5. {{
  6. status == 0
  7. ? orderInfo.refund_status === 1
  8. ? "立即退款"
  9. : "一键改价"
  10. : "订单备注"
  11. }}
  12. <span class="iconfont icon-guanbi" @click="close"></span>
  13. </div>
  14. <div class="listChange" v-if="status == 0">
  15. <div
  16. class="item acea-row row-between-wrapper"
  17. v-if="orderInfo.refund_status === 0"
  18. >
  19. <div>商品总价(¥)</div>
  20. <div class="money">
  21. {{ orderInfo.total_price }}<span class="iconfont icon-suozi"></span>
  22. </div>
  23. </div>
  24. <div
  25. class="item acea-row row-between-wrapper"
  26. v-if="orderInfo.refund_status === 0"
  27. >
  28. <div>原始邮费(¥)</div>
  29. <div class="money">
  30. {{ orderInfo.pay_postage }}<span class="iconfont icon-suozi"></span>
  31. </div>
  32. </div>
  33. <div
  34. class="item acea-row row-between-wrapper"
  35. v-if="orderInfo.refund_status === 0"
  36. >
  37. <div>实际支付(¥)</div>
  38. <div class="money">
  39. <input
  40. type="text"
  41. v-model="price"
  42. :class="focus === true ? 'on' : ''"
  43. @focus="priceChange"
  44. />
  45. </div>
  46. </div>
  47. <div
  48. class="item acea-row row-between-wrapper"
  49. v-if="orderInfo.refund_status === 1"
  50. >
  51. <div>实际支付(¥)</div>
  52. <div class="money">
  53. {{ orderInfo.pay_price }}<span class="iconfont icon-suozi"></span>
  54. </div>
  55. </div>
  56. <div
  57. class="item acea-row row-between-wrapper"
  58. v-if="orderInfo.refund_status === 1"
  59. >
  60. <div>退款金额(¥)</div>
  61. <div class="money">
  62. <input
  63. type="text"
  64. v-model="refund_price"
  65. :class="focus === true ? 'on' : ''"
  66. @focus="priceChange"
  67. />
  68. </div>
  69. </div>
  70. </div>
  71. <div class="listChange" v-else>
  72. <textarea
  73. :placeholder="
  74. orderInfo.remark ? orderInfo.remark : '请填写备注信息...'
  75. "
  76. v-model="remark"
  77. ></textarea>
  78. </div>
  79. <div class="modify" @click="save">
  80. {{
  81. status === 1 || orderInfo.refund_status == 0 ? "立即修改" : "确认退款"
  82. }}
  83. </div>
  84. <div
  85. class="modify1"
  86. @click="refuse"
  87. v-if="orderInfo.refund_status === 1 && status === 0"
  88. >
  89. 拒绝退款
  90. </div>
  91. </div>
  92. <div class="mask" @touchmove.prevent v-show="change === true"></div>
  93. </div>
  94. </template>
  95. <style scoped>
  96. .priceChange .listChange textarea {
  97. border: 1px solid #eee;
  98. width: 100%;
  99. height: 2rem;
  100. margin-top: 0.5rem;
  101. border-radius: 0.1rem;
  102. color: #333;
  103. padding: 0.2rem;
  104. }
  105. </style>
  106. <script>
  107. export default {
  108. name: "PriceChange",
  109. components: {},
  110. props: {
  111. change: Boolean,
  112. orderInfo: Object,
  113. status: String
  114. },
  115. data: function() {
  116. return {
  117. focus: false,
  118. price: 0,
  119. refund_price: 0,
  120. remark: ""
  121. };
  122. },
  123. watch: {
  124. orderInfo: function() {
  125. this.price = this.orderInfo.pay_price;
  126. this.refund_price = this.orderInfo.pay_price;
  127. this.remark = "";
  128. }
  129. },
  130. mounted: function() {},
  131. methods: {
  132. priceChange: function() {
  133. this.focus = true;
  134. },
  135. close: function() {
  136. this.price = this.orderInfo.pay_price;
  137. this.$emit("closechange", false);
  138. },
  139. save: function() {
  140. let that = this;
  141. that.$emit("savePrice", {
  142. price: that.price,
  143. refund_price: that.refund_price,
  144. type: 1,
  145. remark: that.remark
  146. });
  147. },
  148. refuse: function() {
  149. let that = this;
  150. that.$emit("savePrice", {
  151. price: that.price,
  152. refund_price: that.refund_price,
  153. type: 2,
  154. remark: that.remark
  155. });
  156. }
  157. }
  158. };
  159. </script>