index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <!-- 退款页、一键改价页、订单备注页、立即退款立即退货页 -->
  3. <view>
  4. <view class="priceChange" :class="[change === true ? 'on' : '']">
  5. <view class="priceChange-box">
  6. <view class="priceTitle">
  7. {{
  8. status == 7?'退款单备注':status == 8?'退款原因': status == 0?"一键改价": status == 1?`${title}备注`: isRefund==8?'确认收货':'退款审核'
  9. }}
  10. <view class="bottom_close" @click="close" style="top:36rpx;"><view class="iconfont icon-ic_close f-s-24"></view></view>
  11. </view>
  12. <!-- 一键改价 -->
  13. <view class="listChange" v-if="status == 0">
  14. <view class="item acea-row row-between-wrapper" v-if="orderInfo.refundStatus === 0">
  15. <view>商品原价</view>
  16. <view class="money">
  17. {{$store.getters.priceUnit}}{{ orderInfo.totalPrice }}
  18. </view>
  19. </view>
  20. <view class="item acea-row row-between-wrapper" v-if="orderInfo.refundStatus === 0">
  21. <view>商品邮费</view>
  22. <view class="money">
  23. {{$store.getters.priceUnit}}{{ orderInfo.totalPostage }}
  24. </view>
  25. </view>
  26. <view class="item acea-row row-between-wrapper" v-if="orderInfo.refundStatus === 0">
  27. <view>修改价格</view>
  28. <view class="money">
  29. <input type="text" v-model="price" :cursor-spacing="40" always-embed
  30. :class="focus === true ? 'on' : ''" @focus="priceChange" />
  31. </view>
  32. <text class="iconfont icon-ic_edit"></text>
  33. </view>
  34. </view>
  35. <!-- 立即退款 -->
  36. <!-- <view class="listChange" v-if="status == 2">
  37. <view v-if="isRefund" class="item acea-row row-between-wrapper">
  38. <view>实际支付({{$store.getters.priceUnit}})</view>
  39. <view class="money">
  40. {{ orderInfo.pay_price }}<span class="iconfont icon-suozi"></span>
  41. </view>
  42. </view>
  43. <view v-if="isRefund" class="item acea-row row-between-wrapper">
  44. <view>退款金额({{$store.getters.priceUnit}})</view>
  45. <view class="money">
  46. <input type="text" v-model="refund_price" :class="focus === true ? 'on' : ''" @focus="priceChange" />
  47. </view>
  48. </view>
  49. <view class="title" v-if="!isRefund">同意退货退款</view>
  50. </view> -->
  51. <!-- 退款审核 -->
  52. <view class="listChange" v-if="status == 2">
  53. <view class="item acea-row row-between-wrapper">
  54. <view>审核状态</view>
  55. <view class="money acea-row row-right">
  56. <view class="radio-item acea-row row-middle" :class="{ on: isAgree }"
  57. @click="agreeChange(true)">
  58. <text class="iconfont"
  59. :class="isAgree?'icon-a-ic_CompleteSelect':'icon-ic_unselect'"></text>同意退{{isRefund?'款':'货'}}
  60. </view>
  61. <view v-if="orderInfo.refund_type != 4 && orderInfo.refund_type != 5"
  62. class="radio-item acea-row row-middle" :class="{ on: !isAgree }"
  63. @click="agreeChange(false)">
  64. <text class="iconfont"
  65. :class="isAgree?'icon-ic_unselect':'icon-a-ic_CompleteSelect'"></text>拒绝退款
  66. </view>
  67. </view>
  68. </view>
  69. <view class="item acea-row row-between-wrapper agree-box" v-if="isAgree && !isRefund">
  70. <view class="agree-title">同意退款后,用户会根据下方地址将商品退回</view>
  71. <view class="address-list">
  72. <radio-group @change="radioChange">
  73. <view class="address-list-item acea-row row-between-wrapper"
  74. v-for="(item,index) in addressList" :key="index">
  75. <view class="item-left">
  76. <view class="name-phone">
  77. <text class="name">{{item.receiverName}}</text>
  78. <text class="phone">{{item.receiverPhone}}</text>
  79. <text class="normal" v-if="item.isDefault">默认</text>
  80. </view>
  81. <view class="address line1">
  82. {{item.detail}}
  83. </view>
  84. </view>
  85. <view class="item-right">
  86. <label class="radio">
  87. <radio :value="`${item.id}`" />
  88. </label>
  89. </view>
  90. </view>
  91. </radio-group>
  92. </view>
  93. </view>
  94. <view class="item acea-row row-between" v-if="!isAgree">
  95. <view>拒绝原因</view>
  96. <view class="money acea-row row-right">
  97. <textarea class="reason" placeholder="请输入" v-model="refuse_reason" fixed
  98. :cursor-spacing="100"></textarea>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="listChange" v-if="status == 1||status == 7">
  103. <textarea placeholder="请填写备注信息..." @input="inputChange(remarkInfo)" v-model="remarkInfo" fixed :cursor-spacing="100"></textarea>
  104. </view>
  105. <!-- <view class="listChange" v-if="status == 8">
  106. <textarea placeholder="请填写退款原因..." v-model="refuse_reason"></textarea>
  107. </view> -->
  108. <view class="modify-box acea-row">
  109. <view class="cancel btn-box" @click="close">取消</view>
  110. <view class="modify btn-box" @click="refuse" v-if="status == 8">确定</view>
  111. <view class="modify btn-box" @click="onConfirm" v-if="status == 2 && !isRefund">确定</view>
  112. <view class="modify btn-box" @click="save" v-if="status == 1 || status == 0||status == 7">确定</view>
  113. <view class="modify btn-box" @click="onConfirm" v-if="status == 2 && isRefund">确定</view>
  114. </view>
  115. <slot name="bottom"></slot>
  116. </view>
  117. <view class="safe-area-inset-bottom"></view>
  118. </view>
  119. <view class="mask" @touchmove.prevent v-show="change === true"></view>
  120. </view>
  121. </template>
  122. <script>
  123. import { string } from '../../../../plugin/clipboard/clipboard';
  124. import {
  125. employeeAddressList,
  126. } from '@/api/work.js'
  127. export default {
  128. name: "PriceChange",
  129. components: {},
  130. props: {
  131. // 备注
  132. remark: {
  133. type: String,
  134. default: ''
  135. },
  136. title: {
  137. type: String,
  138. default: '订单'
  139. },
  140. change: {
  141. type: Boolean,
  142. default: false
  143. },
  144. orderInfo: {
  145. type: Object,
  146. default: () => {}
  147. },
  148. status: {
  149. type: String,
  150. default: ""
  151. },
  152. isRefund: {
  153. type: Number || String,
  154. default: 0
  155. },
  156. apiModalType:{
  157. type:string||Number
  158. }
  159. },
  160. data: function() {
  161. return {
  162. focus: false,
  163. price: 0,
  164. refund_price: 0,
  165. remarkInfo: "",
  166. refuse_reason: '',
  167. isAgree: true,
  168. addressList: [],
  169. addressId: ''
  170. };
  171. },
  172. watch: {
  173. orderInfo: function(nVal) {
  174. this.price = this.orderInfo.pay_price;
  175. this.refund_price = this.orderInfo.pay_price;
  176. this.remarkInfo = this.remark;
  177. },
  178. change(val) {
  179. if (val) {
  180. this.isAgree = true
  181. this.refuse_reason = ''
  182. }
  183. },
  184. },
  185. created() {
  186. if( this.status && this.status !=='1' )this.getAddressList()
  187. },
  188. methods: {
  189. inputChange(mark){
  190. this.remarkInfo=mark
  191. },
  192. radioChange: function(evt) {
  193. this.addressId = evt.detail.value
  194. },
  195. getAddressList() {
  196. employeeAddressList().then(res => {
  197. this.addressList = res.data
  198. })
  199. },
  200. priceChange: function() {
  201. this.focus = true;
  202. },
  203. close: function() {
  204. this.orderInfo.merchantRemark = ''
  205. this.price = this.orderInfo.pay_price;
  206. this.$emit("closechange", false);
  207. },
  208. save: function() {
  209. let that = this;
  210. that.$emit("savePrice", {
  211. price: that.price,
  212. type: 1,
  213. remark: that.remarkInfo,
  214. merAddressId: that.addressId
  215. });
  216. },
  217. refuse: function() {
  218. let that = this;
  219. that.$emit("savePrice", {
  220. price: that.price,
  221. type: 2,
  222. remark: that.remarkInfo,
  223. refuse_reason: that.refuse_reason
  224. });
  225. },
  226. agreeChange(value) {
  227. this.addressId = ''
  228. this.isAgree = value;
  229. if (this.isAgree) {
  230. this.refuse_reason = '';
  231. }
  232. },
  233. onConfirm() {
  234. if (this.status == 1) {
  235. this.save();
  236. }
  237. if (this.status == 2) {
  238. if (this.isRefund) {
  239. if (this.isAgree) {
  240. this.save();
  241. } else {
  242. this.refuse();
  243. }
  244. } else {
  245. if (this.isAgree) {
  246. this.save();
  247. } else {
  248. this.refuse();
  249. }
  250. }
  251. }
  252. },
  253. }
  254. };
  255. </script>
  256. <style lang="scss" scoped>
  257. .safe-area-inset-bottom {
  258. height: 0;
  259. height: constant(safe-area-inset-bottom);
  260. height: env(safe-area-inset-bottom);
  261. }
  262. .mask {
  263. z-index: 99;
  264. }
  265. .priceChange .reGoods {
  266. padding: 0 25upx;
  267. margin-top: 50upx;
  268. }
  269. .priceChange .reGoods .bnt {
  270. width: 250upx;
  271. height: 90upx;
  272. background-color: #2291f8;
  273. font-size: 32upx;
  274. color: #fff;
  275. text-align: center;
  276. line-height: 90upx;
  277. border-radius: 45upx;
  278. }
  279. .priceChange .reGoods .bnt.grey {
  280. background-color: #eee;
  281. color: #312b2b;
  282. }
  283. .priceChange {
  284. position: fixed;
  285. bottom: 0;
  286. left: 0;
  287. z-index: 99999;
  288. width: 100%;
  289. border-radius: 40rpx 40rpx 0 0;
  290. background: #FFFFFF;
  291. transform: translateY(100%);
  292. transition: transform 0.3s;
  293. }
  294. .priceChange.on {
  295. transform: translateY(0);
  296. }
  297. .priceChange-box {}
  298. .priceChange.goodsOn {
  299. height: 380upx;
  300. }
  301. .priceChange .priceTitle {
  302. position: relative;
  303. height: 108rpx;
  304. text-align: center;
  305. font-weight: 500;
  306. font-size: 32rpx;
  307. line-height: 108rpx;
  308. color: #333333;
  309. }
  310. .priceChange .priceTitle .btn {
  311. position: absolute;
  312. top: 50%;
  313. right: 32rpx;
  314. width: 36rpx;
  315. height: 36rpx;
  316. border-radius: 50%;
  317. margin-top: -18rpx;
  318. background: #EEEEEE;
  319. text-align: center;
  320. line-height: 36rpx;
  321. }
  322. .priceChange .priceTitle .iconfont {
  323. vertical-align: text-bottom;
  324. font-weight: normal;
  325. font-size: 24rpx;
  326. }
  327. .priceChange .listChange {
  328. padding: 20rpx 24rpx;
  329. min-height: 260rpx;
  330. }
  331. .priceChange .listChange .item {
  332. margin-bottom: 30rpx;
  333. font-size: 28rpx;
  334. line-height: 40rpx;
  335. color: #333333;
  336. &:last-child {
  337. margin-bottom: 0;
  338. }
  339. }
  340. .priceChange .listChange .title {
  341. font-size: 32rpx;
  342. text-align: center;
  343. margin-top: 52rpx;
  344. }
  345. .priceChange .listChange .item .money {
  346. flex: 1;
  347. text-align: right;
  348. font-family: Regular;
  349. font-size: 36rpx;
  350. }
  351. .priceChange .listChange .item .iconfont {
  352. margin-left: 8rpx;
  353. font-size: 32rpx;
  354. }
  355. .priceChange .listChange .item .money input {
  356. color: #FF7E00;
  357. }
  358. .priceChange .listChange .item .money input.on {
  359. // color: #666;
  360. }
  361. .priceChange .modify-box {
  362. padding: 20rpx;
  363. }
  364. .priceChange .btn-box {
  365. flex: 1;
  366. height: 72rpx;
  367. border: 2rpx solid #4C88FF;
  368. border-radius: 36rpx;
  369. margin-right: 16rpx;
  370. text-align: center;
  371. font-weight: 500;
  372. font-size: 26rpx;
  373. line-height: 68rpx;
  374. color: #4C88FF;
  375. &:last-child {
  376. margin-right: 0;
  377. }
  378. }
  379. .priceChange .modify {
  380. border-color: #2A7EFB;
  381. background: #2A7EFB;
  382. color: #FFFFFF;
  383. }
  384. .priceChange .modify1 {
  385. font-size: 32upx;
  386. color: #312b2b;
  387. width: 490upx;
  388. height: 90upx;
  389. text-align: center;
  390. line-height: 90upx;
  391. border-radius: 45upx;
  392. background-color: #eee;
  393. margin: 30upx auto 0 auto;
  394. }
  395. .priceChange .listChange textarea {
  396. box-sizing: border-box;
  397. border: 2rpx solid #CCCCCC;
  398. width: 100%;
  399. height: 224rpx;
  400. padding: 20rpx;
  401. border-radius: 16rpx;
  402. font-size: 28rpx;
  403. line-height: 40rpx;
  404. color: #333;
  405. }
  406. .radio-item {
  407. font-size: 28rpx;
  408. color: #999999;
  409. +.radio-item {
  410. margin-left: 48rpx;
  411. }
  412. .iconfont {
  413. margin-right: 12rpx;
  414. font-size: 32rpx;
  415. }
  416. &.on {
  417. color: #333333;
  418. .iconfont {
  419. color: #2A7EFB;
  420. }
  421. }
  422. }
  423. .reason {
  424. width: 462rpx !important;
  425. height: 80rpx !important;
  426. padding: 0 !important;
  427. border: 0 !important;
  428. }
  429. .agree-box {
  430. .agree-title {
  431. width: 710rpx;
  432. background: rgba(42, 126, 251, 0.1);
  433. border-radius: 10rpx;
  434. padding: 20rpx;
  435. font-family: PingFang SC, PingFang SC;
  436. font-weight: 400;
  437. font-size: 26rpx;
  438. color: #2A7EFB;
  439. }
  440. .address-list {
  441. width: 100%;
  442. padding: 20rpx 10rpx;
  443. .address-list-item {
  444. justify-content: space-between;
  445. margin-bottom: 20rpx;
  446. .name-phone {
  447. text {
  448. margin-right: 20rpx;
  449. }
  450. .name {
  451. font-weight: 500;
  452. font-size: 30rpx;
  453. color: #333333;
  454. }
  455. .phone {
  456. font-weight: 400;
  457. font-size: 30rpx;
  458. color: #333333;
  459. }
  460. .normal {
  461. background: rgba(42, 126, 251, 0.1);
  462. border-radius: 8rpx;
  463. font-size: 22rpx;
  464. color: #2A7EFB;
  465. }
  466. }
  467. .address {
  468. width: 500rpx;
  469. font-size: 24rpx;
  470. color: #999999;
  471. }
  472. }
  473. }
  474. }
  475. .icon-ic_close1{
  476. font-size: 18rpx !important;
  477. color: #333333;
  478. }
  479. </style>