index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <!-- 退款页、一键改价页、订单备注页、立即退款立即退货页 -->
  3. <view>
  4. <!-- <view class="priceChange" :class="[change === true ? 'on' : '',status == 2 && !isRefund?'goodsOn':'']"> -->
  5. <view class="priceChange" :class="[change === true ? 'on' : '']">
  6. <view class="priceChange-box">
  7. <!-- status == 0? orderInfo.refund_status === 1? "立即退款": "一键改价": "订单备注" -->
  8. <view class="priceTitle">
  9. {{
  10. status == 8?'退款原因': status == 0?"一键改价": status == 1?'订单备注': isRefund?'退款审核':'退款审核'
  11. }}
  12. <view class="btn acea-row row-center row-middle" @click="close">
  13. <span class="iconfont icon-ic_close"></span>
  14. </view>
  15. </view>
  16. <!-- 一键改价 -->
  17. <view class="listChange" v-if="status == 0">
  18. <view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 0">
  19. <view>商品原价</view>
  20. <view class="money">
  21. ¥{{ orderInfo.total_price }}
  22. </view>
  23. </view>
  24. <view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 0">
  25. <view>商品邮费</view>
  26. <view class="money">
  27. ¥{{ orderInfo.pay_postage }}
  28. </view>
  29. </view>
  30. <view class="item acea-row row-between-wrapper" v-if="orderInfo.refund_status === 0">
  31. <view>修改价格</view>
  32. <view class="money">
  33. <input type="text" v-model="price" :cursor-spacing="40" always-embed :class="focus === true ? 'on' : ''" @focus="priceChange" />
  34. </view>
  35. <text class="iconfont icon-ic_edit"></text>
  36. </view>
  37. </view>
  38. <!-- 立即退款 -->
  39. <!-- <view class="listChange" v-if="status == 2">
  40. <view v-if="isRefund" class="item acea-row row-between-wrapper">
  41. <view>实际支付(¥)</view>
  42. <view class="money">
  43. {{ orderInfo.pay_price }}<span class="iconfont icon-suozi"></span>
  44. </view>
  45. </view>
  46. <view v-if="isRefund" class="item acea-row row-between-wrapper">
  47. <view>退款金额(¥)</view>
  48. <view class="money">
  49. <input type="text" v-model="refund_price" :class="focus === true ? 'on' : ''" @focus="priceChange" />
  50. </view>
  51. </view>
  52. <view class="title" v-if="!isRefund">同意退货退款</view>
  53. </view> -->
  54. <!-- 退款审核 -->
  55. <view class="listChange" v-if="status == 2">
  56. <view class="item acea-row row-between-wrapper">
  57. <view>审核状态</view>
  58. <view class="money acea-row row-right">
  59. <view class="radio-item acea-row row-middle" :class="{ on: isAgree }" @click="agreeChange(true)">
  60. <text class="iconfont" :class="isAgree?'icon-ic_Selected':'icon-ic_unselect'"></text>同意退{{isRefund?'款':'货'}}
  61. </view>
  62. <view v-if="orderInfo.refund_type != 4 && orderInfo.refund_type != 5" class="radio-item acea-row row-middle" :class="{ on: !isAgree }" @click="agreeChange(false)">
  63. <text class="iconfont" :class="isAgree?'icon-ic_unselect':'icon-ic_Selected'"></text>拒绝退款
  64. </view>
  65. </view>
  66. </view>
  67. <view class="item acea-row row-between-wrapper" v-if="isAgree && isRefund">
  68. <view>退款金额</view>
  69. <view class="money">
  70. <input type="text" v-model="refund_price" :cursor-spacing="50" :class="focus === true ? 'on' : ''" always-embed @focus="priceChange" />
  71. </view>
  72. <text class="iconfont icon-ic_edit"></text>
  73. </view>
  74. <view class="item acea-row row-between" v-if="!isAgree">
  75. <view>拒绝原因</view>
  76. <view class="money acea-row row-right">
  77. <textarea class="reason" placeholder="请输入" v-model="refuse_reason" fixed :cursor-spacing="100"></textarea>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="listChange" v-if="status == 1">
  82. <textarea placeholder="请填写备注信息..." v-model="remark" fixed :cursor-spacing="100"></textarea>
  83. </view>
  84. <!-- <view class="listChange" v-if="status == 8">
  85. <textarea placeholder="请填写退款原因..." v-model="refuse_reason"></textarea>
  86. </view> -->
  87. <view class="modify-box acea-row">
  88. <view class="cancel btn-box" @click="close">取消</view>
  89. <view class="modify btn-box" @click="refuse" v-if="status == 8">确定</view>
  90. <view class="modify btn-box" @click="onConfirm" v-if="status == 2 && !isRefund">确定</view>
  91. <view class="modify btn-box" @click="save" v-if="status == 1 || status == 0">确定</view>
  92. <view class="modify btn-box" @click="onConfirm" v-if="status == 2 && isRefund">确定</view>
  93. </view>
  94. <slot name="bottom"></slot>
  95. </view>
  96. <view class="safe-area-inset-bottom"></view>
  97. </view>
  98. <view class="mask" @touchmove.prevent v-show="change === true"></view>
  99. </view>
  100. </template>
  101. <style lang="scss" scoped>
  102. .safe-area-inset-bottom {
  103. height: 0;
  104. height: constant(safe-area-inset-bottom);
  105. height: env(safe-area-inset-bottom);
  106. }
  107. .mask {
  108. z-index: 99;
  109. }
  110. .priceChange .reGoods {
  111. padding: 0 25upx;
  112. margin-top: 50upx;
  113. }
  114. .priceChange .reGoods .bnt {
  115. width: 250upx;
  116. height: 90upx;
  117. background-color: #2291f8;
  118. font-size: 32upx;
  119. color: #fff;
  120. text-align: center;
  121. line-height: 90upx;
  122. border-radius: 45upx;
  123. }
  124. .priceChange .reGoods .bnt.grey {
  125. background-color: #eee;
  126. color: #312b2b;
  127. }
  128. .priceChange {
  129. position: fixed;
  130. bottom: 0;
  131. left: 0;
  132. z-index: 99999;
  133. width: 100%;
  134. border-radius: 40rpx 40rpx 0 0;
  135. background: #FFFFFF;
  136. transform: translateY(100%);
  137. transition: transform 0.3s;
  138. }
  139. .priceChange.on {
  140. transform: translateY(0);
  141. }
  142. .priceChange-box {}
  143. .priceChange.goodsOn {
  144. height: 380upx;
  145. }
  146. .priceChange .priceTitle {
  147. position: relative;
  148. height: 108rpx;
  149. text-align: center;
  150. font-weight: 500;
  151. font-size: 32rpx;
  152. line-height: 108rpx;
  153. color: #333333;
  154. }
  155. .priceChange .priceTitle .btn {
  156. position: absolute;
  157. top: 50%;
  158. right: 32rpx;
  159. width: 36rpx;
  160. height: 36rpx;
  161. border-radius: 50%;
  162. margin-top: -18rpx;
  163. background: #EEEEEE;
  164. text-align: center;
  165. line-height: 36rpx;
  166. }
  167. .priceChange .priceTitle .iconfont {
  168. vertical-align: text-bottom;
  169. font-weight: normal;
  170. font-size: 24rpx;
  171. }
  172. .priceChange .listChange {
  173. padding: 32rpx;
  174. min-height: 260rpx;
  175. }
  176. .priceChange .listChange .item {
  177. margin-bottom: 64rpx;
  178. font-size: 28rpx;
  179. line-height: 40rpx;
  180. color: #333333;
  181. &:last-child {
  182. margin-bottom: 0;
  183. }
  184. }
  185. .priceChange .listChange .title {
  186. font-size: 32rpx;
  187. text-align: center;
  188. margin-top: 52rpx;
  189. }
  190. .priceChange .listChange .item .money {
  191. flex: 1;
  192. text-align: right;
  193. font-family: Regular;
  194. font-size: 36rpx;
  195. }
  196. .priceChange .listChange .item .iconfont {
  197. margin-left: 8rpx;
  198. font-size: 32rpx;
  199. }
  200. .priceChange .listChange .item .money input {
  201. color: #FF7E00;
  202. }
  203. .priceChange .listChange .item .money input.on {
  204. // color: #666;
  205. }
  206. .priceChange .modify-box {
  207. padding: 20rpx;
  208. }
  209. .priceChange .btn-box {
  210. flex: 1;
  211. height: 72rpx;
  212. border: 2rpx solid #4C88FF;
  213. border-radius: 36rpx;
  214. margin-right: 16rpx;
  215. text-align: center;
  216. font-weight: 500;
  217. font-size: 26rpx;
  218. line-height: 68rpx;
  219. color: #4C88FF;
  220. &:last-child {
  221. margin-right: 0;
  222. }
  223. }
  224. .priceChange .modify {
  225. border-color: #2A7EFB;
  226. background: #2A7EFB;
  227. color: #FFFFFF;
  228. }
  229. .priceChange .modify1 {
  230. font-size: 32upx;
  231. color: #312b2b;
  232. width: 490upx;
  233. height: 90upx;
  234. text-align: center;
  235. line-height: 90upx;
  236. border-radius: 45upx;
  237. background-color: #eee;
  238. margin: 30upx auto 0 auto;
  239. }
  240. .priceChange .listChange textarea {
  241. box-sizing: border-box;
  242. border: 2rpx solid #CCCCCC;
  243. width: 100%;
  244. height: 224rpx;
  245. padding: 20rpx;
  246. border-radius: 16rpx;
  247. font-size: 28rpx;
  248. line-height: 40rpx;
  249. color: #333;
  250. }
  251. .radio-item {
  252. font-size: 28rpx;
  253. color: #999999;
  254. +.radio-item {
  255. margin-left: 48rpx;
  256. }
  257. .iconfont {
  258. margin-right: 12rpx;
  259. font-size: 32rpx;
  260. }
  261. &.on {
  262. color: #333333;
  263. .iconfont {
  264. color: #2A7EFB;
  265. }
  266. }
  267. }
  268. .reason {
  269. width: 462rpx !important;
  270. height: 80rpx !important;
  271. padding: 0 !important;
  272. border: 0 !important;
  273. }
  274. </style>
  275. <script>
  276. export default {
  277. name: "PriceChange",
  278. components: {},
  279. props: {
  280. change: {
  281. type: Boolean,
  282. default: false
  283. },
  284. orderInfo: {
  285. type: Object,
  286. default: () => {}
  287. },
  288. status: {
  289. type: String,
  290. default: ""
  291. },
  292. isRefund: {
  293. type: Number || String,
  294. default: 0
  295. }
  296. },
  297. data: function() {
  298. return {
  299. focus: false,
  300. price: 0,
  301. refund_price: 0,
  302. remark: "",
  303. refuse_reason: '',
  304. isAgree: true,
  305. };
  306. },
  307. watch: {
  308. orderInfo: function(nVal) {
  309. this.price = this.orderInfo.pay_price;
  310. this.refund_price = this.orderInfo.pay_price;
  311. this.remark = this.orderInfo.remark;
  312. },
  313. change(val) {
  314. if (val) {
  315. this.isAgree = true
  316. this.refuse_reason = ''
  317. }
  318. },
  319. isRefund(val) {
  320. console.log(val)
  321. },
  322. },
  323. methods: {
  324. priceChange: function() {
  325. this.focus = true;
  326. },
  327. close: function() {
  328. this.price = this.orderInfo.pay_price;
  329. this.$emit("closechange", false);
  330. },
  331. save: function() {
  332. let that = this;
  333. // if (!that.isAgree) {
  334. // that.refuse();
  335. // return
  336. // }
  337. that.$emit("savePrice", {
  338. price: that.price,
  339. refund_price: that.refund_price,
  340. type: 1,
  341. remark: that.remark
  342. });
  343. },
  344. refuse: function() {
  345. let that = this;
  346. that.$emit("savePrice", {
  347. price: that.price,
  348. refund_price: that.refund_price,
  349. type: 2,
  350. remark: that.remark,
  351. refuse_reason: that.refuse_reason
  352. });
  353. },
  354. agreeChange(value) {
  355. this.isAgree = value;
  356. if (this.isAgree) {
  357. this.refuse_reason = '';
  358. }
  359. },
  360. onConfirm() {
  361. if (this.status == 1) {
  362. this.save();
  363. }
  364. if (this.status == 2) {
  365. if (this.isRefund) {
  366. if (this.isAgree) {
  367. this.save();
  368. } else {
  369. this.refuse();
  370. }
  371. } else {
  372. if (this.isAgree) {
  373. this.save();
  374. } else {
  375. this.refuse();
  376. }
  377. }
  378. }
  379. },
  380. }
  381. };
  382. </script>