index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view>
  3. <view class="priceChange" :class="change === true ? 'on' : ''">
  4. <view 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. </view>
  14. <view class="listChange" v-if="status == 0">
  15. <view
  16. class="item acea-row row-between-wrapper"
  17. v-if="orderInfo.refund_status === 0"
  18. >
  19. <view>商品总价(¥)</view>
  20. <view class="money">
  21. {{ orderInfo.total_price }}<span class="iconfont icon-suozi"></span>
  22. </view>
  23. </view>
  24. <view
  25. class="item acea-row row-between-wrapper"
  26. v-if="orderInfo.refund_status === 0"
  27. >
  28. <view>原始邮费(¥)</view>
  29. <view class="money">
  30. {{ orderInfo.pay_postage }}<span class="iconfont icon-suozi"></span>
  31. </view>
  32. </view>
  33. <view
  34. class="item acea-row row-between-wrapper"
  35. v-if="orderInfo.refund_status === 0"
  36. >
  37. <view>实际支付(¥)</view>
  38. <view class="money">
  39. <input
  40. type="text"
  41. v-model="price"
  42. :class="focus === true ? 'on' : ''"
  43. @focus="priceChange"
  44. />
  45. </view>
  46. </view>
  47. <view
  48. class="item acea-row row-between-wrapper"
  49. v-if="orderInfo.refund_status === 1"
  50. >
  51. <view>实际支付(¥)</view>
  52. <view class="money">
  53. {{ orderInfo.pay_price }}<span class="iconfont icon-suozi"></span>
  54. </view>
  55. </view>
  56. <view
  57. class="item acea-row row-between-wrapper"
  58. v-if="orderInfo.refund_status === 1"
  59. >
  60. <view>退款金额(¥)</view>
  61. <view class="money">
  62. <input
  63. type="text"
  64. v-model="refund_price"
  65. :class="focus === true ? 'on' : ''"
  66. @focus="priceChange"
  67. />
  68. </view>
  69. </view>
  70. </view>
  71. <view class="listChange" v-else>
  72. <textarea
  73. :placeholder="
  74. orderInfo.remark ? orderInfo.remark : '请填写备注信息...'
  75. "
  76. v-model="remark"
  77. ></textarea>
  78. </view>
  79. <view class="modify" @click="save">
  80. {{
  81. status === 1 || orderInfo.refund_status == 0 ? "立即修改" : "确认退款"
  82. }}
  83. </view>
  84. <view
  85. class="modify1"
  86. @click="refuse"
  87. v-if="orderInfo.refund_status == 1 && status == 0"
  88. >
  89. 拒绝退款
  90. </view>
  91. </view>
  92. <view class="mask" @touchmove.prevent v-show="change === true"></view>
  93. </view>
  94. </template>
  95. <style>
  96. .priceChange{position:fixed;width:580upx;height:670upx;background-color:#fff;border-radius:10upx;top:50%;left:50%;margin-left:-290upx;margin-top:-335upx;z-index:666;transition:all 0.3s ease-in-out 0s;transform: scale(0);opacity:0;}
  97. .priceChange.on{opacity:1;transform: scale(1);}
  98. .priceChange .priceTitle{background:url("~@/static/images/pricetitle.jpg") no-repeat;background-size:100% 100%;width:100%;height:160upx;border-radius:10upx 10upx 0 0;text-align:center;font-size:40upx;color:#fff;line-height:160upx;position:relative;}
  99. .priceChange .priceTitle .iconfont{position:absolute;font-size:40upx;right:26upx;top:23upx;width:40upx;height:40upx;line-height:40upx;}
  100. .priceChange .listChange{padding:0 40upx;}
  101. .priceChange .listChange textarea{box-sizing: border-box;}
  102. .priceChange .listChange .item{height:103upx;border-bottom:1px solid #e3e3e3;font-size:32upx;color:#333;}
  103. .priceChange .listChange .item .money{color:#666;width:300upx;text-align:right;}
  104. .priceChange .listChange .item .money .iconfont{font-size:32upx;margin-left:20upx;}
  105. .priceChange .listChange .item .money input{width:100%;height:100%;text-align:right;color:#ccc;}
  106. .priceChange .listChange .item .money input.on{color:#666;}
  107. .priceChange .modify{font-size:32upx;color:#fff;width:490upx;height:90upx;text-align:center;line-height:90upx;border-radius:45upx;background-color:#2291f8;margin:53upx auto 0 auto;}
  108. .priceChange .modify1{font-size:32upx;color:#312b2b;width:490upx;height:90upx;text-align:center;line-height:90upx;border-radius:45upx;background-color:#eee;margin:30upx auto 0 auto;}
  109. .priceChange .listChange textarea {
  110. border: 1px solid #eee;
  111. width: 100%;
  112. height: 200upx;
  113. margin-top: 50upx;
  114. border-radius: 10upx;
  115. color: #333;
  116. padding: 20upx;
  117. }
  118. </style>
  119. <script>
  120. export default {
  121. name: "PriceChange",
  122. components: {},
  123. props: {
  124. change: Boolean,
  125. orderInfo: Object,
  126. status: String
  127. },
  128. data: function() {
  129. return {
  130. focus: false,
  131. price: 0,
  132. refund_price: 0,
  133. remark: ""
  134. };
  135. },
  136. watch: {
  137. orderInfo: function(nVal) {
  138. this.price = this.orderInfo.pay_price;
  139. this.refund_price = this.orderInfo.pay_price;
  140. this.remark = "";
  141. }
  142. },
  143. mounted: function() {
  144. },
  145. methods: {
  146. priceChange: function() {
  147. this.focus = true;
  148. },
  149. close: function() {
  150. this.price = this.orderInfo.pay_price;
  151. this.$emit("closechange", false);
  152. },
  153. save: function() {
  154. let that = this;
  155. that.$emit("savePrice", {
  156. price: that.price,
  157. refund_price: that.refund_price,
  158. type: 1,
  159. remark: that.remark
  160. });
  161. },
  162. refuse: function() {
  163. let that = this;
  164. that.$emit("savePrice", {
  165. price: that.price,
  166. refund_price: that.refund_price,
  167. type: 2,
  168. remark: that.remark
  169. });
  170. }
  171. }
  172. };
  173. </script>