index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="px-20">
  4. <view class="flex justify-between mt-24">
  5. <view class="flex-1 mt-8">
  6. <view class="fs-36 fw-500 lh-50rpx">{{orderInfo._status._msg}}</view>
  7. <view class="w-486 fs-24 text--w111-999 lh-34rpx mt-12">{{orderInfo._status.desc}}</view>
  8. </view>
  9. <image :src="orderInfo._status.pic" class="w-172 h-172"></image>
  10. </view>
  11. <statusLine :type="orderInfo._status._type" :applyType="orderInfo.apply_type"></statusLine>
  12. <view class="bg--w111-fff rd-16rpx mt-20 pt-32 pl-24 pr-24 pb-32"
  13. v-if="[2,3].includes(orderInfo.apply_type)">
  14. <view class="flex-between-center">
  15. <text class="fs-32 fw-500">商家地址</text>
  16. <text class="inline-block copy_btn fs-22" @click="copyAddress">复制</text>
  17. </view>
  18. <view class="mt-28 fs-28 lh-40rpx">
  19. <text>{{orderInfo._status.refund_name}}</text>
  20. <text class="pl-20">{{orderInfo._status.refund_phone}}</text>
  21. </view>
  22. <view class="w-full fs-24 lh-34rpx text--w111-999 mt-8 line2">{{orderInfo._status.refund_address}}</view>
  23. </view>
  24. <view class="bg--w111-fff rd-16rpx mt-20 pt-32 pl-24 pr-24 pb-32">
  25. <view class="flex justify-between order_goods" v-for="(item,index) in cartInfo" :key="index">
  26. <image class="w-136 h-136 rd-16rpx" :src='item.productInfo.attrInfo.image' v-if="item.productInfo.attrInfo"></image>
  27. <image class="w-136 h-136 rd-16rpx" :src='item.productInfo.image' v-else></image>
  28. <view class="flex-1 h-136 pl-20 flex-col justify-between">
  29. <view class="w-full fs-28 lh-40rpx line2">{{item.productInfo.store_name}}</view>
  30. <view class="flex-between-center fs-24 lh-34rpx">
  31. <text class="text--w111-999">购买数量: 1</text>
  32. <text>购买售价:{{item.productInfo.attrInfo ? item.productInfo.attrInfo.price : item.productInfo.price}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="bt mt-32">
  37. <view class="pt-32 flex-between-center fs-28">
  38. <text>退款原因</text>
  39. <text>{{orderInfo.refund_reason}}</text>
  40. </view>
  41. <view class="pt-32 flex-between-center fs-28">
  42. <text>退款金额</text>
  43. <text class="font-color fs-36 Regular">¥{{parseFloat(orderInfo.refunded_price) || orderInfo.refund_price}}</text>
  44. </view>
  45. <view class="pt-32 flex-between-center fs-28">
  46. <text>申请件数</text>
  47. <text>{{orderInfo.refund_num}}</text>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="bg--w111-fff rd-16rpx mt-20 pt-32 pl-24 pr-24 pb-32">
  52. <view class="cell flex-between-center">
  53. <text class="fs-28">订单编号</text>
  54. <view>
  55. <text class="fs-28 pr-12">{{orderInfo.store_order_sn}}</text>
  56. <text class="inline-block copy_btn fs-22" @click="copy(orderInfo.store_order_sn)">复制</text>
  57. </view>
  58. </view>
  59. <view class="cell flex-between-center fs-28">
  60. <text>申请时间</text>
  61. <text>{{orderInfo._add_time}}</text>
  62. </view>
  63. <view class="cell flex-between-center fs-28">
  64. <text>售后类型</text>
  65. <text v-if="orderInfo.apply_type == 1">仅退款</text>
  66. <text v-else-if="[2,3].includes(orderInfo.apply_type)">退货退款</text>
  67. <text v-else-if="orderInfo.apply_type == 4">商家主动退款</text>
  68. </view>
  69. <view class="cell flex-between-center">
  70. <text class="fs-28">售后单号</text>
  71. <view>
  72. <text class="fs-28 pr-12">{{orderInfo.order_id}}</text>
  73. <text class="inline-block copy_btn fs-22" @click="copy(orderInfo.order_id)">复制</text>
  74. </view>
  75. </view>
  76. <view class="bt mt-32">
  77. <view class="pt-32 flex justify-between fs-28" v-if="orderInfo.remark">
  78. <text>备注说明</text>
  79. <view class="w-462 line2 lh-40rpx text-right">{{orderInfo.remark}}</view>
  80. </view>
  81. <view class="pt-32 flex justify-between fs-28" v-if="orderInfo.refund_img && orderInfo.refund_img.length">
  82. <text>售后凭证</text>
  83. <view class="w-462 flex justify-end" v-if="orderInfo.refund_img.length < 5">
  84. <view class='pictrue mr-8' v-for="(item,index) in orderInfo.refund_img" :key="index">
  85. <image class="w-88 h-88 rd-8rpx" :src='item' mode="aspectFill" ></image>
  86. </view>
  87. </view>
  88. <scroll-view scroll-x="true" scroll-with-animation
  89. class="white-nowrap vertical-middle w-462" show-scrollbar="false" v-else>
  90. <view class="inline-block mr-12" v-for="(item,index) in orderInfo.refund_img" :key="index">
  91. <image class="w-88 h-88 rd-8rpx" :src="item"></image>
  92. </view>
  93. </scroll-view>
  94. </view>
  95. <view class="pt-32 flex justify-between fs-28">
  96. <text>退款方式</text>
  97. <view class="w-462 line2 lh-40rpx text-right">{{orderInfo.refund_price_type}}</view>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="bg--w111-fff rd-16rpx mt-20 pt-32 pl-24 pr-24 pb-32" v-if="[2,3].includes(orderInfo.apply_type) && orderInfo._status._type== 5">
  102. <view class="fs-28 fw-500">退货信息</view>
  103. <view class="bt mt-32">
  104. <view class="pt-32 flex justify-between fs-28">
  105. <text>退货方式</text>
  106. <view class="w-462 line2 lh-40rpx text-right">{{orderInfo.apply_type == 2 ? '快递退回' : '到店退货'}}</view>
  107. </view>
  108. <view class="pt-32 flex justify-between fs-28" v-if="orderInfo.apply_type == 2">
  109. <text>物流公司</text>
  110. <view class="w-462 line2 lh-40rpx text-right">{{orderInfo.refund_express_name}}</view>
  111. </view>
  112. <view class="pt-32 flex justify-between fs-28" v-if="orderInfo.apply_type == 2">
  113. <text>物流单号</text>
  114. <view class="w-462 line2 lh-40rpx text-right">{{orderInfo.refund_express}}</view>
  115. </view>
  116. <view class="pt-32 flex justify-between fs-28">
  117. <text>退货说明</text>
  118. <view class="w-462 line2 lh-40rpx text-right">{{orderInfo.refund_explain}}</view>
  119. </view>
  120. <view class="pt-32 flex justify-between fs-28" v-if="orderInfo.refund_goods_img.length">
  121. <text>售后凭证</text>
  122. <view class="w-462 flex justify-end" v-if="orderInfo.refund_goods_img.length < 5">
  123. <view class='pictrue mr-8' v-for="(item,index) in orderInfo.refund_goods_img" :key="index">
  124. <image :src='item' mode="aspectFill" class="w-88 h-88 rd-8rpx"></image>
  125. </view>
  126. </view>
  127. <scroll-view scroll-x="true" scroll-with-animation
  128. class="white-nowrap vertical-middle w-462" show-scrollbar="false" v-else>
  129. <view class="inline-block mr-12" v-for="(item,index) in orderInfo.refund_goods_img" :key="index">
  130. <image class="w-88 h-88 rd-8rpx" :src="item"></image>
  131. </view>
  132. </scroll-view>
  133. </view>
  134. <view class="pt-32 flex justify-between fs-28">
  135. <text>联系电话</text>
  136. <view class="w-462 line2 lh-40rpx text-right">{{orderInfo.refund_phone}}</view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="h-200"></view>
  142. <view class='fixed-lb bt w-full bg--w111-fff pb-safe'>
  143. <view class="h-96 px-20 flex-y-center justify-end">
  144. <view class="btn w-144 h-56 rd-30rpx flex-center fs-24 border bg--w111-fff"
  145. v-if="[0,1,2,4,5].includes(orderInfo.refund_type) && orderInfo.is_cancel == 0"
  146. @tap='cancelRefundOrder'>撤销售后</view>
  147. <view class="btn w-144 h-56 rd-30rpx flex-center fs-24 text--w111-fff bg-color"
  148. v-if="orderInfo.refund_type == 4 && orderInfo.is_cancel == 0 && orderInfo.apply_type == 2"
  149. @tap='refundInput'>退回商品</view>
  150. <view class="btn w-144 h-56 rd-30rpx flex-center fs-24 text--w111-fff bg-color"
  151. v-if="[5,6].includes(orderInfo.refund_type) && orderInfo.apply_type == 2"
  152. @tap='refundLogistics'>返件信息</view>
  153. <view class="btn w-144 h-56 rd-30rpx flex-center fs-24 border bg--w111-fff"
  154. v-if="orderInfo.refund_type == 3 && orderInfo.is_cancel == 0" @click="refundAgain">再次申请</view>
  155. </view>
  156. </view>
  157. </view>
  158. </template>
  159. <script>
  160. import {
  161. getRefundOrderDetail,
  162. orderAgain,
  163. orderTake,
  164. cancelRefundOrder,
  165. orderRefundAgain
  166. } from '@/api/order.js';
  167. import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
  168. import { getUserInfo } from '@/api/user.js';
  169. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  170. import {toLogin} from '@/libs/login.js';
  171. import {mapGetters} from "vuex";
  172. import colors from "@/mixins/color";
  173. import statusLine from '../components/statusLine/index'
  174. import { HTTP_REQUEST_URL } from '@/config/app';
  175. export default {
  176. components: {
  177. statusLine,
  178. },
  179. mixins: [colors],
  180. data() {
  181. return {
  182. imgHost: HTTP_REQUEST_URL,
  183. giveData: {
  184. give_integral: 0,
  185. give_coupon: []
  186. },
  187. giveCartInfo: [],
  188. config: {
  189. qrc: {
  190. code: "",
  191. size: 360, // 二维码大小
  192. level: 4, //等级 0~4
  193. bgColor: '#FFFFFF', //二维码背景色 默认白色
  194. color: ['#333', '#333'], //边框颜色支持渐变色
  195. }
  196. },
  197. order_id: '',
  198. evaluate: 0,
  199. cartInfo: [], //购物车产品
  200. pid: 0, //上级订单ID
  201. split: [], //分单商品
  202. orderInfo: {
  203. system_store: {},
  204. _status: {}
  205. }, //订单详情
  206. system_store: {},
  207. isGoodsReturn: false, //是否为退款订单
  208. status: {}, //订单底部按钮状态
  209. refund_close: false,
  210. isClose: false,
  211. pay_close: false,
  212. pay_order_id: '',
  213. totalPrice: '0',
  214. isAuto: false, //没有授权的不会自动授权
  215. isShowAuth: false, //是否隐藏授权
  216. routineContact: 0,
  217. express_num: '',
  218. invoice_func: false,
  219. invoiceData: {},
  220. invoice_id: 0,
  221. invChecked: '',
  222. moreBtn: false,
  223. invShow: false,
  224. aleartStatus: false, //发票弹窗
  225. special_invoice: false,
  226. invList: [],
  227. userInfo: {},
  228. isReturen: '',
  229. showQrcode:false
  230. };
  231. },
  232. computed: {
  233. isExpress(){
  234. if((this.orderInfo.shipping_type === 1 || this.orderInfo.shipping_type === 3) && this.orderInfo.product_type==0){
  235. return true
  236. }else{
  237. return false
  238. }
  239. },
  240. ...mapGetters(['isLogin']),
  241. },
  242. onLoad: function(options) {
  243. if (options.order_id) {
  244. this.$set(this, 'order_id', options.order_id);
  245. this.isReturen = options.isReturen;
  246. }
  247. if (options.invoice_id) {
  248. this.invoice_id = options.invoice_id
  249. }
  250. },
  251. onShow() {
  252. uni.removeStorageSync('form_type_cart');
  253. if (this.isLogin) {
  254. this.getOrderInfo();
  255. this.getUserInfo();
  256. } else {
  257. toLogin()
  258. }
  259. },
  260. methods: {
  261. onLoadFun() {
  262. this.getOrderInfo();
  263. this.getUserInfo();
  264. this.isShowAuth = false
  265. },
  266. // 授权关闭
  267. authColse: function(e) {
  268. this.isShowAuth = e
  269. },
  270. getpreviewImage: function(index, num) {
  271. uni.previewImage({
  272. urls: num ? this.orderInfo.refund_img : this.orderInfo.refund_goods_img,
  273. current: num ? this.orderInfo.refund_img[index] : this.orderInfo.refund_goods_img[index]
  274. });
  275. },
  276. cancelRefundOrder(orderId) {
  277. let that = this;
  278. uni.showModal({
  279. title: '取消申请',
  280. content: '您确认放弃此次申请吗?',
  281. success: (res) => {
  282. if (res.confirm) {
  283. cancelRefundOrder(that.order_id).then(res => {
  284. return that.$util.Tips({
  285. title: '操作成功',
  286. icon: 'success'
  287. }, {
  288. tab: 4,
  289. url: '/pages/users/user_return_list/index'
  290. });
  291. }).catch(err => {
  292. return that.$util.Tips({
  293. title: err
  294. });
  295. })
  296. }
  297. }
  298. })
  299. },
  300. refundInput() {
  301. uni.navigateTo({
  302. url: `/pages/goods/order_refund_goods/index?orderId=` + this.order_id
  303. })
  304. },
  305. goGoodCall() {
  306. let url = `/pages/extension/customer_list/chat?orderId=${this.order_id}&isReturen=${this.isReturen}`
  307. let obj = {
  308. store_name: this.orderInfo.order_id,
  309. path: `/pages/goods/order_details/index?order_id=${this.orderInfo.order_id}`,
  310. image: ''
  311. }
  312. this.$util.getCustomer(this.userInfo,url,obj,1)
  313. },
  314. /**
  315. * 事件回调
  316. *
  317. */
  318. onChangeFun: function(e) {
  319. let opt = e;
  320. let action = opt.action || null;
  321. let value = opt.value != undefined ? opt.value : null;
  322. (action && this[action]) && this[action](value);
  323. },
  324. /**
  325. * 拨打电话
  326. */
  327. makePhone: function() {
  328. uni.makePhoneCall({
  329. phoneNumber: this.system_store.phone
  330. })
  331. },
  332. /**
  333. * 打开地图
  334. *
  335. */
  336. showMaoLocation: function() {
  337. if (!this.system_store.latitude || !this.system_store.longitude) return this.$util.Tips({
  338. title: '缺少经纬度信息无法查看地图!'
  339. });
  340. uni.openLocation({
  341. latitude: parseFloat(this.system_store.latitude),
  342. longitude: parseFloat(this.system_store.longitude),
  343. scale: 8,
  344. name: this.system_store.name,
  345. address: this.system_store.address + this.system_store.detailed_address,
  346. success: function() {
  347. },
  348. });
  349. },
  350. /**
  351. * 获取用户信息
  352. *
  353. */
  354. getUserInfo: function() {
  355. let that = this;
  356. getUserInfo().then(res => {
  357. that.userInfo = res.data;
  358. })
  359. },
  360. /**
  361. * 获取订单详细信息
  362. *
  363. */
  364. getOrderInfo: function() {
  365. let that = this;
  366. uni.showLoading({
  367. title: "正在加载中"
  368. });
  369. getRefundOrderDetail(this.order_id).then(res => {
  370. let _type = res.data._status._type;
  371. uni.hideLoading();
  372. that.$set(that, 'orderInfo', res.data);
  373. let cartInfo = res.data.cartInfo;
  374. let cartObj = [],giftObj = [];
  375. cartInfo.forEach(item => {
  376. if (item.is_gift == 1) {
  377. giftObj.push(item)
  378. } else {
  379. cartObj.push(item)
  380. }
  381. })
  382. that.$set(that, 'cartInfo', cartObj);
  383. that.$set(that, 'giveCartInfo', giftObj);
  384. }).catch(err => {
  385. uni.hideLoading();
  386. if (err.status == 403) {
  387. uni.navigateTo({
  388. url: '/pages/goods/order_list/index'
  389. })
  390. } else {
  391. that.$util.Tips({
  392. title: err
  393. }, '/pages/goods/order_list/index');
  394. }
  395. });
  396. },
  397. copy: function(code) {
  398. let that = this;
  399. uni.setClipboardData({
  400. data: code
  401. });
  402. },
  403. copyAddress() {
  404. uni.setClipboardData({
  405. data: this.orderInfo._status.refund_name + this.orderInfo._status.refund_phone + this.orderInfo._status.refund_address
  406. });
  407. },
  408. /**
  409. * 打电话
  410. */
  411. goTel: function() {
  412. uni.makePhoneCall({
  413. phoneNumber: this.orderInfo.delivery_id
  414. })
  415. },
  416. goPage(type, url){
  417. if(type == 1){
  418. uni.navigateTo({
  419. url
  420. })
  421. }else if(type == 2){
  422. uni.switchTab({
  423. url
  424. })
  425. }else if(type == 3){
  426. uni.navigateBack();
  427. }
  428. },
  429. // 返件信息
  430. refundLogistics(){
  431. uni.navigateTo({
  432. url: '/pages/goods/goods_logistics/index?orderId='+ this.order_id + '&type=refund'
  433. })
  434. },
  435. // 再次申请售后
  436. refundAgain(){
  437. orderRefundAgain(this.orderInfo.id).then(res=>{
  438. this.$util.Tips({
  439. title: res.msg
  440. }, '/pages/users/user_return_list/index');
  441. }).catch(err => {
  442. return this.$util.Tips({
  443. title: err
  444. });
  445. })
  446. },
  447. }
  448. }
  449. </script>
  450. <style lang="scss">
  451. .order_goods ~ .order_goods{
  452. margin-top: 32rpx;
  453. }
  454. .Regular {
  455. font-family: Regular;
  456. }
  457. .copy_btn{
  458. width: 68rpx;
  459. height: 36rpx;
  460. background: #F5F5F5;
  461. border-radius: 20rpx;
  462. text-align:center;
  463. line-height:36rpx;
  464. }
  465. .btn ~ .btn{
  466. margin-left: 16rpx;
  467. }
  468. .bt{
  469. border-top:1rpx solid #eee;
  470. }
  471. .border{
  472. border: 1rpx solid #ccc;
  473. }
  474. .border_bt{
  475. border-bottom: 1rpx solid #eee;
  476. }
  477. .cell ~ .cell{
  478. margin-top: 32rpx;
  479. }
  480. </style>