index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view>
  3. <view class="priceChange" :class="change === true ? 'on' : ''">
  4. <view class="priceTitle">
  5. {{ status == 0 ? "一键改价" : status == 1 ? "订单备注" : "立即退款" }}
  6. <span class="iconfont icon-guanbi" @click="close"></span>
  7. </view>
  8. <view class="listChange" v-if="status == 0">
  9. <view class="item acea-row row-between-wrapper">
  10. <view>商品总价(¥)</view>
  11. <view class="money">
  12. <input
  13. type="number"
  14. class="color_black"
  15. v-model="orderInfo.total_price"
  16. @input="setValue"
  17. />
  18. </view>
  19. </view>
  20. <view class="item acea-row row-between-wrapper">
  21. <view>实际支付邮费(¥)</view>
  22. <view class="money">
  23. <input
  24. type="number"
  25. class="color_black"
  26. v-model="orderInfo.pay_postage"
  27. @input="setValue"
  28. />
  29. </view>
  30. </view>
  31. <view
  32. class="item acea-row row-between-wrapper"
  33. >
  34. <view>实际支付金额(¥)</view>
  35. <view class="money">
  36. {{ Number(this.orderInfo.total_price) + Number(this.orderInfo.pay_postage) - Number(this.orderInfo.coupon_price) - Number(this.orderInfo.integral_price)}}<span class="iconfont icon-suozi"></span>
  37. </view>
  38. </view>
  39. <view v-if="orderInfo.coupon_price>0" class="item acea-row row-between-wrapper">
  40. <view>优惠金额(¥)</view>
  41. <view class="money">
  42. {{ orderInfo.coupon_price }}<span class="iconfont icon-suozi"></span>
  43. </view>
  44. </view>
  45. <view v-if="orderInfo.integral_price>0" class="item acea-row row-between-wrapper">
  46. <view>积分抵扣(¥)</view>
  47. <view class="money">
  48. {{ orderInfo.integral_price }}<span class="iconfont icon-suozi"></span>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="listChange" v-else>
  53. <textarea
  54. :placeholder="orderInfo.remark ? orderInfo.remark : '请填写备注信息...'"
  55. v-model="remark"
  56. ></textarea>
  57. </view>
  58. <view class="modify" @click="save">
  59. {{
  60. status == 0 ? "立即修改" : "确认提交"
  61. }}
  62. </view>
  63. </view>
  64. <view class="mask" @touchmove.prevent v-show="change === true"></view>
  65. </view>
  66. </template>
  67. <style>
  68. .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;}
  69. .priceChange.on{opacity:1;transform: scale(1);}
  70. .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;}
  71. .priceChange .priceTitle .iconfont{position:absolute;font-size:40upx;right:26upx;top:23upx;width:40upx;height:40upx;line-height:40upx;}
  72. .priceChange .listChange{padding:0 40upx;}
  73. .priceChange .listChange textarea{box-sizing: border-box;}
  74. .priceChange .listChange .item{height:103upx;border-bottom:1px solid #e3e3e3;font-size:32upx;color:#333;}
  75. .priceChange .listChange .item .money{color:#666;width:200upx;text-align:right;}
  76. .priceChange .listChange .item .money .color_black{color: #333;}
  77. .priceChange .listChange .item .money .iconfont{font-size:32upx;margin-left:20upx;}
  78. .priceChange .listChange .item .money input{width:100%;height:100%;text-align:right;color:#ccc;}
  79. .priceChange .listChange .item .money input.on{color:#666;}
  80. .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;}
  81. .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;}
  82. .priceChange .listChange textarea {
  83. border: 1px solid #eee;
  84. width: 100%;
  85. height: 200upx;
  86. margin-top: 50upx;
  87. border-radius: 10upx;
  88. color: #333;
  89. padding: 20upx;
  90. }
  91. </style>
  92. <script>
  93. // +----------------------------------------------------------------------
  94. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  95. // +----------------------------------------------------------------------
  96. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  97. // +----------------------------------------------------------------------
  98. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  99. // +----------------------------------------------------------------------
  100. // | Author: CRMEB Team <admin@crmeb.com>
  101. // +----------------------------------------------------------------------
  102. export default {
  103. name: "PriceChange",
  104. components: {},
  105. props: {
  106. change: Boolean,
  107. orderInfo: Object,
  108. status: String
  109. },
  110. data: function() {
  111. return {
  112. focus: false,
  113. price: 0,
  114. actual_price: 0,
  115. refund_price: 0,
  116. remark: ""
  117. };
  118. },
  119. watch: {
  120. orderInfo: function(nVal) {
  121. this.price = this.orderInfo.pay_price;
  122. this.actual_price = this.orderInfo.total_price + this.orderInfo.pay_postage - this.orderInfo.coupon_price
  123. this.refund_price = this.orderInfo.pay_price;
  124. this.remark = this.orderInfo.remark;
  125. }
  126. },
  127. mounted: function() {
  128. },
  129. methods: {
  130. priceChange: function() {
  131. this.focus = true;
  132. },
  133. close: function() {
  134. this.price = this.orderInfo.pay_price;
  135. this.$emit("closechange", false);
  136. },
  137. setValue: function(){
  138. this.price = this.orderInfo.total_price + this.orderInfo.pay_postage - this.orderInfo.coupon_price
  139. },
  140. save: function() {
  141. let that = this;
  142. that.$emit("savePrice", {
  143. price: that.price,
  144. refund_price: that.refund_price,
  145. type: 1,
  146. remark: that.remark,
  147. orderInfo: that.orderInfo
  148. });
  149. },
  150. refuse: function() {
  151. let that = this;
  152. that.$emit("savePrice", {
  153. price: that.price,
  154. refund_price: that.refund_price,
  155. type: 2,
  156. remark: that.remark
  157. });
  158. }
  159. }
  160. };
  161. </script>