index.vue 6.6 KB

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