index.vue 6.1 KB

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