| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439 |
- <template>
- <view>
- <CustomToast ref="customToast" />
- <view class="region pad-24 mar-t-10" v-if="order.isAfter==3">
- <view @tap="checkAfterSaleStatus" class="flex-items-between">
- <view>
- <view class="font-red">
- 售后已关闭
- </view>
- <view v-if="orderAfter.status==4">
- <view class="font38 font-bold ">
- 商家审核不通过
- </view>
- <view class="font28">
- 原因:{{orderAfter.approveRemark}}
- </view>
- </view>
- <view v-if="orderAfter.status==5">
- <view class="font38 font-bold ">
- 商家不同意退款
- </view>
- <view class="font28">
- 原因:{{orderAfter.approveRemark}}
- </view>
- </view>
- <view v-if="orderAfter.status==6">
- <view class="font38 font-bold ">
- 您已取消售后
- </view>
- </view>
- </view>
- <uni-icons color="#a8aeb4" type="right" size="20"></uni-icons>
- </view>
- </view>
- <view class="region pad-24 mar-t-10">
- <view v-if="order.isAfter==0||order.isAfter==3">
- <!-- 待付款状态 -->
- <view v-if="order.status==1">
- <view class="font38 font-bold ">
- 订单待付款,点击立即付款
- </view>
- </view>
- <!-- 待发货状态 -->
- <view v-if="order.status==2" class="flex-items-plus ">
- <uni-icons color="#63b43d" type="checkbox-filled" size="30"></uni-icons>
- <view class="font34 font-bold">
- 买家已付款
- </view>
- </view>
- <!-- 待收货状态 -->
- <view v-if="order.status==3" class="flex-items-between" @tap="checkLogistics">
- <view class="font34 font-bold ">
- 订单已发货,点击查看物流
- </view>
- <uni-icons color="#a8aeb4" type="right" size="20"></uni-icons>
- </view>
- <!-- 已完成状态 -->
- <view v-if="order.status==4">
- <!-- 是否已评价 0否,1是-->
- <view class="flex-items-between ">
- <view class="flex-items">
- <uni-icons color="#63b43d" type="checkbox-filled" size="30"></uni-icons>
- <view class="font34 font-bold">
- 订单已完成
- </view>
- </view>
- <view class="flex-items font-blue font28" @tap="goScore" v-if="order.isEvaluate==0">
- 去评价
- <uni-icons color="#646464" type="right" size="20"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- <view v-if="order.isAfter==1">
- <!-- 售后状态 -->
- <view class="flex-items-between mar-t-10" @tap="checkAfterSaleStatus">
- <view class="font38 font-bold " v-if="orderAfter.status==0">
- 售后已提交,请等待商家审核
- </view>
- <view class="font38 font-bold " v-if="orderAfter.status==1">
- 商家已审核通过,请寄回商品
- </view>
- <view class="font38 font-bold " v-if="orderAfter.status==2">
- 商品已寄出,等待商家退款
- </view>
- <view>
- <uni-icons color="#7f8388" type="right" size="20"></uni-icons>
- </view>
- </view>
- </view>
- <view v-if="order.isAfter==2">
- <view v-if="orderAfter.status==3">
- <view class="flex-items-plus">
- <uni-icons color="#63b43d" type="checkbox-filled" size="30"></uni-icons>
- <view class="font38 font-bold ">
- 售后完成
- </view>
- </view>
- <view class="text-align mar-t-10">
- 钱款{{orderAfter.afterPrice}}元已退回到你**账户
- </view>
- </view>
- </view>
- </view>
- <view class="region pad-24 mar-t-10">
- <view class="flex-items-between">
- <view class="flex-items">
- <uni-icons type="location" size="30"></uni-icons>
- <view class="font-bold">
- {{order.province}}{{order.city}}{{order.area}}{{order.address}}
- </view>
- </view>
- <view class="font-blue" @tap="updateAddress"
- v-if="(order.isAfter==0||order.isAfter==3)&&order.status==2">
- 修改>
- </view>
- </view>
- <view class="mar-t-10 mar-l-40">
- {{order.name}} {{order.mobile}}
- </view>
- </view>
- <view class="gray-line"></view>
- <view class="pad-24 region">
- <view class="flex-items " @tap="goProduct">
- <view>
- <image class=" mar-l-20 productImg" :src="order.images" mode="cover"></image>
- </view>
- <view class="mar-l-20 mar-r-20">
- <view class="font28 pad-b-10 ">
- {{order.productName}}
- </view>
- <view class="pad-tb-16 font-gray">
- <text>
- 规格: {{order.skuName}}
- </text>
- <text class="mar-l-20">
- x{{order.count}}
- </text>
- </view>
- <view class="pad-t-10 ">
- <text class=" font-red font32 font-bold">
- ¥{{order.paymentPrice}}
- </text>
- </view>
- <view class="mar-r-16">
- </view>
- </view>
- </view>
- <view class="gray-line"></view>
- <view class="pad-24">
- <view class="flex-items-between">
- <text>
- 商品总价
- </text>
- <text>
- {{order.paymentPrice}}
- </text>
- </view>
- <view class="flex-items-between mar-t-40">
- <text>
- 运费
- </text>
- <text>
- 0
- </text>
- </view>
- <view class="flex-items-between mar-t-40">
- <text>
- 实付款
- </text>
- <text>
- {{order.paymentPrice}}
- </text>
- </view>
- <view class="flex-items-between mar-t-40">
- <text>
- 订单编号
- </text>
- <text>
- {{order.orderCode}}
- </text>
- </view>
- <!-- <view class="flex-items-between mar-t-40">
- <text>
- 收货信息
- </text>
- <view>
- <view>
- {{order.province}}{{order.city}}{{order.area}}{{order.address}}
- </view>
- <view class="mar-t-10">
- {{order.mobile}} {{order.name}}
- </view>
- </view>
- </view> -->
- <view class="flex-items-between mar-t-40">
- <text>
- 创建时间
- </text>
- <text>
- {{order.createTime}}
- </text>
- </view>
- <view class="flex-items-between mar-t-40">
- <text>
- 付款时间
- </text>
- <text>
- {{order.payTime}}
- </text>
- </view>
- <view class="flex-items-between mar-t-40" v-if="order.status==3||order.status==4">
- <text>
- 发货时间
- </text>
- <text>
- {{order.shipTime}}
- </text>
- </view>
- <view class="flex-items-between mar-t-40" v-if="order.status==4">
- <text>
- 成交时间
- </text>
- <text>
- {{order.confirmTime}}
- </text>
- </view>
- </view>
- </view>
- <view class="navigation">
- <view class="flex-items-between">
- <view class="mar-l-20" @click="$Router.pushTab({name: 'index'})">
- <u-icon name="chat" color="#F95B5B" size="22"></u-icon>
- <view>客服</view>
- </view>
- <view>
- <view v-if="order.isAfter==0||order.isAfter==3">
- <!-- 待付款状态 -->
- <view class="flex-items" v-if="order.status === 1">
- <button class="grayBut mar-r-20" @click="cancelOrder">取消订单</button>
- <button class="orgBut mar-r-20" @click="payOrder">去付款</button>
- </view>
- <!-- 待发货状态 -->
- <view class="flex-items" v-if="order.status === 2">
- <button class="grayBut mar-r-20" @click="submitAfterSale">申请售后</button>
- <button class="orgBut mar-r-20" @click="onceAgainOrder">再来一单</button>
- </view>
- <!-- 待收货状态 -->
- <view class="flex-items" v-if="order.status === 3">
- <button class="grayBut mar-r-20" @click="submitAfterSale">申请售后</button>
- <button class="grayBut mar-r-20" @click="checkLogistics">查看物流</button>
- <button class="orgBut mar-r-20" @click="confirmReceiptDialog">确认收货</button>
- </view>
- <!-- 已完成状态 -->
- <view class="flex-items" v-if="order.status === 4">
- <button class="grayBut mar-r-20" @click="deleteOrder">删除订单</button>
- <button class="grayBut mar-r-20" @click="submitAfterSale">申请售后</button>
- <button class="orgBut mar-r-20" @click="onceAgainOrder">再来一单</button>
- </view>
- </view>
- <!-- 售后中状态 -->
- <view v-if="order.isAfter === 1" class="flex-items">
- <button class="grayBut mar-r-20" @click="onCancelAfter">取消售后</button>
- <button class="orgBut mar-r-20" @click="checkAfterSaleStatus">查看售后进度</button>
- </view>
- <!-- 售后完成状态 -->
- <view v-if="order.isAfter === 2" class="flex-items">
- <button class="grayBut mar-r-20" @click="checkAfterSaleStatus">售后详情</button>
- <button class="orgBut mar-r-20" @click="onceAgainOrder">再来一单</button>
- </view>
- </view>
- </view>
- </view>
- <uni-popup ref="dialog" type="dialog">
- <uni-popup-dialog type="warn" cancelText="取消" confirmText="确认" title="提示" content="确认要取消售后?"
- @confirm="cancel()"></uni-popup-dialog>
- </uni-popup>
- <uni-popup ref="dialog" type="dialog">
- <uni-popup-dialog type="warn" cancelText="取消" confirmText="确认" title="提示" content="确认收货?"
- @confirm="confirmReceipt()"></uni-popup-dialog>
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- orderDetail,
- cancelAfter,
- orderAfterDetail,
- confirmReceipt
- } from '../../config/api.js';
- import CustomToast from '../../components/CustomToast.vue';
- export default {
- components: {
- CustomToast,
- },
- data() {
- return {
- orderAfter: {},
- orderId: "",
- order: {},
- form: {},
- isFirstLoad: true, // 新增标志位,用于判断是否是首次加载
- };
- },
- methods: {
- goScore() {
- this.$route('/pages/order/score?orderId=' + this.order.id)
- },
- updateAddress() {
- this.$route('/pages/order/update-address?orderId=' + this.order.id)
- },
- cancel() {
- cancelAfter({
- id: this.orderAfter.id
- }).then((res) => {
- if (res.code == 200) {
- this.$refs.customToast.showToast('操作成功');
- this.$refs.dialog.close()
- this.getOrderDetail();
- }
- })
- },
- onCancelAfter() {
- this.$refs.dialog.open()
- },
- goProduct() {
- this.$route('/packageShop/pages/detail/index?id=' + this.order.productId)
- },
- getOrderDetail() {
- orderDetail({
- id: this.orderId
- }).then((res) => {
- this.order = res.data;
- this.getAfterDetail()
- });
- },
- getAfterDetail() {
- orderAfterDetail({
- orderId: this.orderId
- }).then((res) => {
- this.orderAfter = res.data
- })
- },
- cancelOrder() {
- console.log('取消订单,订单号:', this.order.orderCode);
- },
- payOrder() {
- // 跳转到支付页面
- this.$route('/pages/order/payment?orderId=' + this.order.id);
- },
- submitAfterSale() {
- this.$route('/pages/order/after?id=' + this.order.id);
- },
- checkLogistics() {
- this.$route('/pages/order/logistics?expressCode=' + this.order.expressCode);
- },
- confirmReceiptDialog() {
- this.$refs.dialog.open()
- this.form = this.order
- },
- confirmReceipt() {
- confirmReceipt(this.form).then((res) => {
- if (res.code == 200) {
- this.$refs.dialog.close()
- this.$refs.customToast.showToast('操作成功');
- this.getOrderDetail()
- }
- })
- },
- deleteOrder() {
- console.log('删除订单,订单号:', this.order.orderCode);
- },
- addToCart() {
- console.log('加入购物车,订单号:', this.order.orderCode);
- },
- onceAgainOrder() {
- console.log('再来一单,订单号:', this.order.orderCode);
- },
- checkAfterSaleStatus() {
- this.$route('/pages/order/after-progress?id=' + this.orderAfter.id);
- }
- },
- onLoad(op) {
- this.orderId = op.id;
- this.getOrderDetail();
- setTimeout(() => {
- this.isFirstLoad = false; // 首次加载完成,将标志位设为 false
- }, 1000)
- },
- onShow() {
- if (!this.isFirstLoad) {
- // 如果不是首次加载,再调用 方法
- this.getOrderDetail();
- }
- }
- };
- </script>
- <style>
- .navigation {
- position: fixed;
- bottom: 0;
- width: 100%;
- border: solid 2rpx #f2f2f2;
- background-color: #ffffff;
- padding: 16rpx 0;
- }
- .grayBut {
- background-color: #f2f2f2;
- padding: 5rpx 30rpx 5rpx 30rpx;
- font-size: 26rpx;
- color: #1b1b1b;
- }
- .orgBut {
- background-color: #F95B5B;
- padding: 5rpx 30rpx 5rpx 30rpx;
- font-size: 26rpx;
- color: #ffffff;
- }
- button::after {
- border: none;
- }
- </style>
|