index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. <template>
  2. <view class="order-details pos-order-details">
  3. <view class="header acea-row row-middle">
  4. <view class="state" v-if="orderInfo.status == 0">待审核</view>
  5. <view class="state" v-else-if="orderInfo.status == -1">审核未通过</view>
  6. <view class="state" v-else-if="orderInfo.status == 1">待退货</view>
  7. <view class="state" v-else-if="orderInfo.status == 2">待收货</view>
  8. <view class="state" v-else-if="orderInfo.status == 3">已退款</view>
  9. </view>
  10. <view v-if="orderInfo.refund_type == 2 && orderInfo.status > 0" class="orderingUser acea-row row-middle">
  11. <span class="iconfont icon-yonghu2"></span>{{ orderInfo.user && orderInfo.user.nickname }}
  12. </view>
  13. <view v-if="orderInfo.refund_type == 2 && orderInfo.status > 0" class="address">
  14. <view class="name">
  15. {{ orderInfo.mer_delivery_user }}<span class="phone">{{ orderInfo.phone }}</span>
  16. </view>
  17. <view>{{ orderInfo.mer_delivery_address }}</view>
  18. <!-- #ifdef H5 -->
  19. <button class="copy copy-data" :data-clipboard-text="'收货人姓名:'+orderInfo.mer_delivery_user+'\n收货人电话:'+ orderInfo.phone+'\n收货人地址:'+orderInfo.mer_delivery_address">复制</button>
  20. <!-- #endif -->
  21. <!-- #ifdef MP -->
  22. <button class="copy" @tap="copyText">复制</button>
  23. <!-- #endif -->
  24. </view>
  25. <view class="line">
  26. <image src="/static/images/line.jpg" />
  27. </view>
  28. <view class="pos-order-goods">
  29. <navigator :url="`/pages/goods_details/index?id=${item.product.cart_info.product.product_id}`" hover-class="none" class="goods acea-row row-between-wrapper" v-for="(item, index) in orderInfo.refundProduct" :key="index">
  30. <view class="picTxt acea-row row-between-wrapper">
  31. <view class="pictrue">
  32. <image :src="item.product.cart_info.product.image || item.product.cart_info.product.image" />
  33. </view>
  34. <view class="text acea-row row-between row-column">
  35. <view class="info line2">
  36. {{ item.product.cart_info.product.store_name }}
  37. </view>
  38. <view class="attr">{{ item.product.cart_info.productAttr.sku }}</view>
  39. <view class="x-money">¥{{ item.product.cart_info.productAttr.price }}</view>
  40. </view>
  41. </view>
  42. <view class="money">
  43. <view class="num">x{{ item.refund_num }}</view>
  44. </view>
  45. </navigator>
  46. </view>
  47. <view class="wrapper">
  48. <view class="item acea-row row-between">
  49. <view>退款单编号:</view>
  50. <view class="conter acea-row row-middle row-right">
  51. {{ orderInfo.refund_order_sn }}
  52. <!-- #ifdef H5 -->
  53. <button class="copy copy-data" :data-clipboard-text="orderInfo.refund_order_sn">复制</button>
  54. <!-- #endif -->
  55. <!-- #ifdef MP -->
  56. <span class="copy copy-data" @click="copyNum(orderInfo.refund_order_sn)">复制</span>
  57. <!-- #endif -->
  58. </view>
  59. </view>
  60. <view class="item acea-row row-between">
  61. <view>退款金额:</view>
  62. <view class="conter">{{ orderInfo.refund_price }}</view>
  63. </view>
  64. <view class="item acea-row row-between">
  65. <view>申请件数:</view>
  66. <view class="conter">{{ orderInfo.refund_num }}</view>
  67. </view>
  68. <view class="item acea-row row-between">
  69. <view>申请时间:</view>
  70. <view class="conter">{{ orderInfo.create_time }}</view>
  71. </view>
  72. <view class="item acea-row row-between">
  73. <view>退款原因:</view>
  74. <view class="conter">{{ orderInfo.refund_message }}</view>
  75. </view>
  76. <view class="item acea-row row-between">
  77. <view>备注信息:</view>
  78. <view class="conter">{{ orderInfo.mark }}</view>
  79. </view>
  80. </view>
  81. <view style="height:120upx;"></view>
  82. <view class="footer acea-row row-right row-middle" v-if="goname != 'looks'">
  83. <view class="more"></view>
  84. <view class="bnt cancel" @click="modify('1')">订单备注</view>
  85. <navigator class="bnt cancel" v-if="orderInfo.status == 2" :url="'/pages/users/goods_logistics/index?refundId='+orderInfo.refund_order_id+'&merId='+mer_id">查看物流</navigator>
  86. <view class="bnt delivery" v-if="orderInfo.status == 2" @click="confirmOrder">确认收货</view>
  87. </view>
  88. <view>
  89. <view class="priceChange" :class="change === true ? 'on' : ''">
  90. <view class="priceTitle">
  91. 订单备注
  92. <span class="iconfont icon-guanbi" @click="changeclose"></span>
  93. </view>
  94. <view class="listChange">
  95. <textarea
  96. placeholder="请填写备注信息..."
  97. v-model="orderInfo.mer_mark"
  98. ></textarea>
  99. </view>
  100. <view class="modify" @click="save">
  101. 确认提交
  102. </view>
  103. </view>
  104. <view class="mask" @touchmove.prevent v-show="change === true"></view>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. // +----------------------------------------------------------------------
  110. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  111. // +----------------------------------------------------------------------
  112. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  113. // +----------------------------------------------------------------------
  114. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  115. // +----------------------------------------------------------------------
  116. // | Author: CRMEB Team <admin@crmeb.com>
  117. // +----------------------------------------------------------------------
  118. // #ifdef H5
  119. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  120. // #endif
  121. import {
  122. getRefundOrderDetail,
  123. refundOrderReceive,
  124. setRefundMark
  125. } from "@/api/admin";
  126. import {
  127. isMoney
  128. } from '@/utils/validate.js'
  129. export default {
  130. name: "AdminOrder",
  131. components: {
  132. },
  133. props: {},
  134. data: function() {
  135. return {
  136. order: false,
  137. change: false,
  138. order_id: "",
  139. mer_id: '',
  140. mer_mark: '',
  141. orderInfo: {
  142. _status: {},
  143. user: {}
  144. },
  145. status: "",
  146. title: "",
  147. payType: "",
  148. types: "",
  149. clickNum: 1,
  150. goname:''
  151. };
  152. },
  153. watch: {
  154. "$route.params.oid": function(newVal) {
  155. let that = this;
  156. if (newVal != undefined) {
  157. that.order_id = newVal;
  158. that.getIndex();
  159. }
  160. }
  161. },
  162. onLoad: function(option) {
  163. let self = this
  164. this.order_id = option.id
  165. this.mer_id = option.mer_id
  166. this.goname = option.goname
  167. this.getIndex();
  168. // #ifdef H5
  169. this.$nextTick(function() {
  170. var clipboard = new ClipboardJS('.copy-data');
  171. clipboard.on('success', function(e) {
  172. self.$util.Tips({
  173. title:'复制成功'
  174. })
  175. });
  176. clipboard.on('error', function(e) {
  177. self.$util.Tips({
  178. title:'复制失败'
  179. })
  180. });
  181. });
  182. // #endif
  183. },
  184. methods: {
  185. more: function() {
  186. this.order = !this.order;
  187. },
  188. modify: function(status) {
  189. this.change = true;
  190. this.status = status;
  191. },
  192. changeclose: function(msg) {
  193. this.change = false;
  194. },
  195. // 图片预览
  196. getPhotoClickIdx(list, idx) {
  197. uni.previewImage({
  198. current: list[idx], // 传 Number H5端出现不兼容
  199. urls: list
  200. });
  201. },
  202. copyText: function (e) {
  203. // var copy = e.currentTarget.dataset.copy; //data-copy传过来的数值
  204. let arr = [
  205. {
  206. name: "收货人姓名",
  207. value: this.orderInfo.real_name
  208. },
  209. {
  210. name: "收货人电话",
  211. value: this.orderInfo.user_phone
  212. },
  213. {
  214. name: "收货人地址",
  215. value: this.orderInfo.user_address
  216. }
  217. ]
  218. wx.setClipboardData({
  219. data: `${arr.map(item =>`${item.name}: ${item.value}`).join("\n")}`,
  220. success: function (res) {
  221. wx.getClipboardData({
  222. success: function (res) {
  223. wx.showToast({
  224. title: '复制成功'
  225. })
  226. }
  227. })
  228. }
  229. })
  230. },
  231. getIndex: function() {
  232. let that = this;
  233. getRefundOrderDetail(that.mer_id,that.order_id).then(
  234. res => {
  235. that.orderInfo = res.data;
  236. },
  237. err => {
  238. that.$util.Tips({
  239. title: err
  240. }, {
  241. tab: 3,
  242. url: 1
  243. });
  244. }
  245. );
  246. },
  247. // 确认收货
  248. confirmOrder: function() {
  249. let that = this;
  250. uni.showModal({
  251. title: '确认收货',
  252. content: '为保障权益,请收到货确认无误后,再确认收货',
  253. success: function(res) {
  254. if (res.confirm) {
  255. refundOrderReceive(that.mer_id,that.orderInfo.refund_order_id).then(res => {
  256. return that.$util.Tips({
  257. title: '操作成功',
  258. icon: 'success'
  259. }, function() {
  260. that.getIndex()
  261. });
  262. }).catch(err => {
  263. return that.$util.Tips({
  264. title: err
  265. });
  266. })
  267. }
  268. }
  269. })
  270. },
  271. // 提交备注信息
  272. save(){
  273. let that = this;
  274. if (!that.orderInfo.mer_mark) {
  275. return this.$util.Tips({
  276. title: '请输入备注'
  277. })
  278. }
  279. setRefundMark(that.mer_id,that.orderInfo.refund_order_id,{ mer_mark: that.orderInfo.mer_mark }).then(
  280. res => {
  281. that.change = false;
  282. this.$util.Tips({
  283. title: res.message,
  284. icon: 'success'
  285. })
  286. },
  287. err => {
  288. that.change = false;
  289. that.$util.Tips({
  290. title: err
  291. });
  292. }
  293. );
  294. },
  295. // #ifdef MP
  296. copyNum(id) {
  297. uni.setClipboardData({
  298. data: id,
  299. success: function() {
  300. console.log('success');
  301. }
  302. });
  303. },
  304. copyData(id){
  305. uni.setClipboardData({
  306. data: id,
  307. success: function() {
  308. console.log('success');
  309. }
  310. });
  311. },
  312. // #endif
  313. // #ifdef H5
  314. webCopy(item, index) {
  315. let items = item
  316. let indexs = index
  317. let self = this
  318. if (self.clickNum == 1) {
  319. self.clickNum += 1
  320. self.webCopy(items, indexs)
  321. }
  322. }
  323. // #endif
  324. }
  325. };
  326. </script>
  327. <style lang="scss">
  328. .pos-order-details .header {
  329. background: linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  330. background: -webkit-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  331. background: -moz-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  332. }
  333. .pos-order-details .header .state {
  334. font-size: 36upx;
  335. color: #fff;
  336. }
  337. .pos-order-details .header .data {
  338. margin-left: 35upx;
  339. font-size: 28upx;
  340. }
  341. .pos-order-details .header .data .order-num {
  342. font-size: 30upx;
  343. margin-bottom: 8upx;
  344. }
  345. .pos-order-details .remarks {
  346. width: 100%;
  347. height: 86upx;
  348. background-color: #fff;
  349. padding: 0 30upx;
  350. }
  351. .pos-order-details .remarks .iconfont {
  352. font-size: 40upx;
  353. color: #2a7efb;
  354. }
  355. .pos-order-details .remarks input {
  356. width: 630upx;
  357. height: 100%;
  358. font-size: 30upx;
  359. }
  360. .pos-order-details .remarks input::placeholder {
  361. color: #666;
  362. }
  363. .pos-order-details .orderingUser {
  364. font-size: 26upx;
  365. color: #282828;
  366. padding: 0 30upx;
  367. height: 67upx;
  368. background-color: #fff;
  369. margin-top: 16upx;
  370. border-bottom: 1px solid #f5f5f5;
  371. }
  372. .pos-order-details .orderingUser .iconfont {
  373. font-size: 40upx;
  374. color: #2a7efb;
  375. margin-right: 15upx;
  376. }
  377. .pos-order-details .address {
  378. margin-top: 0;
  379. }
  380. .pos-order-details .pos-order-goods {
  381. margin-top: 17upx;
  382. }
  383. .pos-order-details .footer .more {
  384. font-size: 27upx;
  385. color: #aaa;
  386. width: 100upx;
  387. height: 64upx;
  388. text-align: center;
  389. line-height: 64upx;
  390. margin-right: 25upx;
  391. position: relative;
  392. }
  393. .pos-order-details .footer .delivery {
  394. background: linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  395. background: -webkit-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  396. background: -moz-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
  397. }
  398. .pos-order-details .footer .more .order .arrow {
  399. width: 0;
  400. height: 0;
  401. border-left: 11upx solid transparent;
  402. border-right: 11upx solid transparent;
  403. border-top: 20upx solid #e5e5e5;
  404. position: absolute;
  405. left: 15upx;
  406. bottom: -18upx;
  407. }
  408. .pos-order-details .footer .more .order .arrow:before {
  409. content: '';
  410. width: 0;
  411. height: 0;
  412. border-left: 9upx solid transparent;
  413. border-right: 9upx solid transparent;
  414. border-top: 19upx solid #fff;
  415. position: absolute;
  416. left: -10upx;
  417. bottom: 0;
  418. }
  419. .pos-order-details .footer .more .order {
  420. width: 200upx;
  421. background-color: #fff;
  422. border: 1px solid #eee;
  423. border-radius: 10upx;
  424. position: absolute;
  425. top: -200upx;
  426. z-index: 9;
  427. }
  428. .pos-order-details .footer .more .order .item {
  429. height: 77upx;
  430. line-height: 77upx;
  431. }
  432. .pos-order-details .footer .more .order .item~.item {
  433. border-top: 1px solid #f5f5f5;
  434. }
  435. .pos-order-details .footer .more .moreName {
  436. width: 100%;
  437. height: 100%;
  438. }
  439. .order-details .header {
  440. padding: 0 30upx;
  441. height: 150upx;
  442. }
  443. .order-details .header.on {
  444. background-color: #666 !important;
  445. }
  446. .order-details .header .pictrue {
  447. width: 110upx;
  448. height: 110upx;
  449. }
  450. .order-details .header .pictrue image {
  451. width: 100%;
  452. height: 100%;
  453. }
  454. .order-details .header .data {
  455. color: rgba(255, 255, 255, 0.8);
  456. font-size: 24upx;
  457. margin-left: 27upx;
  458. }
  459. .order-details .header.on .data {
  460. margin-left: 0;
  461. }
  462. .order-details .header .data .state {
  463. font-size: 30upx;
  464. font-weight: bold;
  465. color: #fff;
  466. margin-bottom: 7upx;
  467. }
  468. .order-details .nav {
  469. background-color: #fff;
  470. font-size: 26upx;
  471. color: #282828;
  472. padding: 25upx 0;
  473. }
  474. .order-details .nav .navCon {
  475. padding: 0 40upx;
  476. }
  477. .order-details .nav .navCon .on {
  478. font-weight: bold;
  479. color: #e93323;
  480. }
  481. .order-details .nav .progress {
  482. padding: 0 65upx;
  483. margin-top: 10upx;
  484. }
  485. .order-details .nav .progress .line {
  486. width: 100upx;
  487. height: 2upx;
  488. background-color: #939390;
  489. }
  490. .order-details .nav .progress .iconfont {
  491. font-size: 25upx;
  492. color: #939390;
  493. margin-top: -2upx;
  494. width: 30upx;
  495. height: 30upx;
  496. line-height: 33upx;
  497. text-align: center;
  498. margin-right: 0 !important;
  499. }
  500. .order-details .address {
  501. font-size: 26upx;
  502. color: #868686;
  503. background-color: #fff;
  504. padding: 25upx 30upx 30upx 30upx;
  505. position: relative;
  506. }
  507. .order-details .address .name {
  508. font-size: 30upx;
  509. color: #282828;
  510. margin-bottom: 0.1rem;
  511. }
  512. .order-details .address .name .phone {
  513. margin-left: 40upx;
  514. }
  515. .order-details .line {
  516. width: 100%;
  517. height: 3upx;
  518. }
  519. .order-details .line image {
  520. width: 100%;
  521. height: 100%;
  522. display: block;
  523. }
  524. .order-details .wrapper {
  525. background-color: #fff;
  526. margin-top: 12upx;
  527. padding: 30upx;
  528. }
  529. .order-details .wrapper .item {
  530. font-size: 28upx;
  531. color: #282828;
  532. }
  533. .order-details .wrapper .item~.item {
  534. margin-top: 20upx;
  535. }
  536. .order-details .wrapper .item .conter {
  537. color: #868686;
  538. text-align: right;
  539. }
  540. .order-details .wrapper .item .virtual_image {
  541. text-align: left;
  542. margin-left: 50rpx;
  543. }
  544. .order-details .wrapper .item .virtual_image .picture{
  545. width: 106rpx;
  546. height: 106rpx;
  547. border-radius: 8rpx;
  548. margin-right: 10rpx;
  549. &:last-child{
  550. margin-right: 0;
  551. }
  552. }
  553. .order-details .wrapper .item .conter .copy {
  554. font-size: 20rpx;
  555. color: #868686;
  556. border-radius: 3rpx;
  557. border: 1px solid #868686;
  558. padding: 0rpx 15rpx;
  559. margin-left: 24rpx;
  560. height: 40rpx;
  561. display: flex;
  562. align-items: center;
  563. justify-content: center;
  564. border-radius: 16rpx;
  565. }
  566. .address .copy{
  567. font-size: 20rpx;
  568. color: #868686;
  569. border-radius: 3rpx;
  570. border: 1px solid #868686;
  571. padding: 0rpx 15rpx;
  572. height: 40rpx;
  573. display: flex;
  574. align-items: center;
  575. justify-content: center;
  576. border-radius: 16rpx;
  577. position: absolute;
  578. right: 30rpx;
  579. top: 20rpx;
  580. }
  581. .order-details .wrapper .actualPay {
  582. border-top: 1upx solid #eee;
  583. margin-top: 30upx;
  584. padding-top: 30upx;
  585. }
  586. .order-details .wrapper .actualPay .money {
  587. font-weight: bold;
  588. font-size: 30upx;
  589. }
  590. .order-details .footer {
  591. width: 100%;
  592. height: 100upx;
  593. position: fixed;
  594. bottom: 0;
  595. left: 0;
  596. background-color: #fff;
  597. padding: 0 30upx;
  598. border-top: 1px solid #eee;
  599. }
  600. .order-details .footer .bnt {
  601. width: auto;
  602. height: 60upx;
  603. line-height: 60upx;
  604. text-align: center;
  605. line-height: upx;
  606. border-radius: 50upx;
  607. color: #fff;
  608. font-size: 27upx;
  609. padding: 0 3%;
  610. }
  611. .order-details .footer .bnt.cancel {
  612. color: #aaa;
  613. border: 1px solid #ddd;
  614. }
  615. .order-details .footer .bnt.default {
  616. color: #444;
  617. border: 1px solid #444;
  618. }
  619. .order-details .footer .bnt~.bnt {
  620. margin-left: 18upx;
  621. }
  622. .pos-order-goods {
  623. padding: 0 30upx;
  624. background-color: #fff;
  625. }
  626. .pos-order-goods .goods {
  627. height: 185upx;
  628. position: relative;
  629. }
  630. .pos-order-goods .goods~.goods {
  631. border-top: 1px dashed #e5e5e5;
  632. }
  633. .pos-order-goods .goods .picTxt {
  634. width: 515upx;
  635. }
  636. .pos-order-goods .goods .picTxt .pictrue {
  637. width: 130upx;
  638. height: 130upx;
  639. }
  640. .pos-order-goods .goods .picTxt .pictrue image {
  641. width: 100%;
  642. height: 100%;
  643. border-radius: 6upx;
  644. }
  645. .pos-order-goods .goods .picTxt .text {
  646. width: 365upx;
  647. height: 130upx;
  648. }
  649. .pos-order-goods .goods .picTxt .text .info {
  650. font-size: 28upx;
  651. color: #282828;
  652. }
  653. .pos-order-goods .goods .picTxt .text .attr {
  654. font-size: 24upx;
  655. color: #999;
  656. }
  657. .pos-order-goods .goods .money {
  658. width: 164upx;
  659. text-align: right;
  660. font-size: 28upx;
  661. position: absolute;
  662. top: 20rpx;
  663. right: 0;
  664. color: #999999;
  665. }
  666. .pos-order-goods .goods .money .refund_num{
  667. display: inline-block;
  668. margin-left: 10rpx;
  669. }
  670. .pos-order-goods .goods .x-money {
  671. color: #FF9600;
  672. }
  673. .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;}
  674. .priceChange.on{opacity:1;transform: scale(1);}
  675. .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;}
  676. .priceChange .priceTitle .iconfont{position:absolute;font-size:40upx;right:26upx;top:23upx;width:40upx;height:40upx;line-height:40upx;}
  677. .priceChange .listChange{padding:0 40upx;}
  678. .priceChange .listChange textarea{box-sizing: border-box;}
  679. .priceChange .listChange .item{height:103upx;border-bottom:1px solid #e3e3e3;font-size:32upx;color:#333;}
  680. .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;}
  681. .priceChange .listChange textarea {
  682. border: 1px solid #eee;
  683. width: 100%;
  684. height: 200upx;
  685. margin-top: 50upx;
  686. border-radius: 10upx;
  687. color: #333;
  688. padding: 20upx;
  689. }
  690. </style>