index.vue 5.6 KB

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