index.vue 12 KB

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