Refactor(订单):订单列表和详情状态值判断重构
This commit is contained in:
+295
-181
@@ -1,7 +1,15 @@
|
||||
<template>
|
||||
<view class="my-order v12-mx-2" ref="container" @click="handleBody">
|
||||
<view class="m-search-wrap v12-mb-2 v12-mt-3">
|
||||
<u-search placeholder="请输入商品名/订单号" shape="round" :inputStyle="inputStyle" :showAction="false" bgColor="#FFF" v-model="keyword" @search="changeType"></u-search>
|
||||
<u-search
|
||||
v-model="keyword"
|
||||
:inputStyle="inputStyle"
|
||||
:showAction="false"
|
||||
placeholder="请输入商品名/订单号"
|
||||
shape="round"
|
||||
bgColor="#FFF"
|
||||
@search="changeType"
|
||||
/>
|
||||
</view>
|
||||
<view class="m-tab-warp">
|
||||
<u-tabs
|
||||
@@ -11,49 +19,79 @@
|
||||
:inactiveStyle="inactiveStyle"
|
||||
:current="type"
|
||||
:list="tabList"
|
||||
@click="tabChange">
|
||||
</u-tabs>
|
||||
@click="tabChange"
|
||||
/>
|
||||
</view>
|
||||
<!-- <u-tabs lineColor="#FF564A" activeStyle="#FF564A" inactiveStyle="#C2C5CC" :current="type" :list="tabList"
|
||||
@click="tabChange"></u-tabs> -->
|
||||
|
||||
<view class="list v12-ma-0" style="padding: 0rpx 0 30rpx;">
|
||||
<view class="item" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
|
||||
<view class="shop-info flex jc-between ai-center" v-if="order.merName" @click="goStore(order)">
|
||||
<view
|
||||
v-for="(order, orderListIndex) in orderList"
|
||||
:key="orderListIndex"
|
||||
class="item"
|
||||
>
|
||||
<view
|
||||
v-if="order.merName"
|
||||
class="shop-info flex jc-between ai-center"
|
||||
@click="goStore(order)"
|
||||
>
|
||||
<view class="flex ai-center">
|
||||
<image :src="webUrl+'/orderIcon/shop.png'" style="width: 32rpx;height: 32rpx"/>
|
||||
<image
|
||||
:src="webUrl+'/orderIcon/shop.png'"
|
||||
style="width: 32rpx;height: 32rpx"
|
||||
/>
|
||||
<text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ order.merName }}</text>
|
||||
<image :src="webUrl+'/orderIcon/arrow.png'" style="width: 24rpx;height: 24rpx; margin-top: 5rpx"/>
|
||||
<image
|
||||
:src="webUrl+'/orderIcon/arrow.png'"
|
||||
style="width: 24rpx;height: 24rpx; margin-top: 5rpx"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex ai-center">
|
||||
<image :src="webUrl+'/orderIcon/map.png'" style="width: 28rpx;height: 28rpx"/>
|
||||
<image
|
||||
:src="webUrl+'/orderIcon/map.png'"
|
||||
style="width: 28rpx;height: 28rpx"
|
||||
/>
|
||||
<text class="address v12-dark-text v12-font-bold v12-font-24">{{ order.merCityName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="title acea-row row-between-wrapper" style="padding: 0 0 0 30rpx !important;">
|
||||
<view class="acea-row row-middle">
|
||||
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.combinationId > 0">拼团</span>
|
||||
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.seckillId > 0">秒杀</span>
|
||||
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.bargainId > 0">砍价</span>
|
||||
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.storeId > 0">门店</span>
|
||||
<text
|
||||
v-if="order.combinationId || order.seckillId || order.bargainId || order.storeId"
|
||||
class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40"
|
||||
>
|
||||
<text v-if="order.combinationId > 0">拼团</text>
|
||||
<text v-if="order.seckillId > 0">秒杀</text>
|
||||
<text v-if="order.bargainId > 0">砍价</text>
|
||||
<text v-if="order.storeId > 0">门店</text>
|
||||
</text>
|
||||
订单号:{{ order.orderId }}
|
||||
</view>
|
||||
<view class="font-color-white statusTag v12-primary" v-if="order.isTickets===1 && order._status._type === 1">
|
||||
<view
|
||||
v-if="order.isTickets === 1 && parseInt(order._status._type) === 1"
|
||||
class="font-color-white statusTag v12-primary"
|
||||
>
|
||||
待核销
|
||||
</view>
|
||||
<view class="font-color-white statusTag v12-primary" v-else>{{ order.isGiftCardSend || order.isGiftCardReceive ? '礼包' :getStatus(order) }}</view>
|
||||
<view
|
||||
v-else
|
||||
class="font-color-white statusTag v12-primary"
|
||||
>{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : getStatus(order) }}</view>
|
||||
</view>
|
||||
<view @click="goOrderDetails(order)">
|
||||
<view class="item-info acea-row row-between row-top" v-if="order.isGiftCardReceiveBlind === 1">
|
||||
<view
|
||||
v-if="order.isGiftCardReceiveBlind === 1"
|
||||
class="item-info acea-row row-between row-top"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image
|
||||
:src="webUrl+'/orderIcon/盲盒礼包.png'"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info acea-row row-between row-top" v-for="(cart,cartInfoIndex) in order.cartInfo"
|
||||
:key="cartInfoIndex">
|
||||
<view
|
||||
v-for="(cart,cartInfoIndex) in order.cartInfo"
|
||||
:key="cartInfoIndex"
|
||||
class="item-info acea-row row-between row-top"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image
|
||||
v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"
|
||||
@@ -99,66 +137,121 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalPrice acea-row row-between row-middle">
|
||||
<view class="" v-if="order.createTime"><span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span></view>
|
||||
<view class="v12-font-24 v12-dark1-text">共{{ order.totalNum || 0 }}件商品
|
||||
<text class="v12-dark-text v12-font-28 v12-font-bold" v-if="order.isGiftCardReceiveBlind === 0">
|
||||
,总金额
|
||||
<view v-if="order.createTime">
|
||||
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
|
||||
</view>
|
||||
<view class="v12-font-24 v12-dark1-text">
|
||||
共{{ order.totalNum || 0 }}件商品
|
||||
<text v-if="order.isGiftCardReceiveBlind === 0">
|
||||
<text class="v12-dark-text v12-font-28 v12-font-bold">
|
||||
,总金额
|
||||
</text>
|
||||
<text class="v12-font-22 v12-primary-text v12-font-bold">
|
||||
¥
|
||||
</text>
|
||||
<text class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold">
|
||||
{{ force2Decimal(order.payPrice) }}
|
||||
</text>
|
||||
</text>
|
||||
<text class="v12-font-22 v12-primary-text v12-font-bold" v-if="order.isGiftCardReceiveBlind === 0">
|
||||
¥
|
||||
</text>
|
||||
<text v-if="order.isGiftCardReceiveBlind === 0" class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold">{{ force2Decimal(order.payPrice) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom flex jc-between ai-center" v-if="!order.isGiftCardSend">
|
||||
<view class="group-btn"
|
||||
v-if="(Number(order._status._type) === 2 || Number(order._status._type) === 3) &&
|
||||
order.isTickets === 0">
|
||||
<text class="btn-more v12-font-28 v12-font-bold" @click.stop="tapShowMore(order,orderListIndex)">更多</text>
|
||||
<view
|
||||
v-if="!order.isGiftCardSend"
|
||||
class="bottom flex jc-between ai-center"
|
||||
>
|
||||
<view
|
||||
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0"
|
||||
class="group-btn"
|
||||
>
|
||||
<text
|
||||
class="btn-more v12-font-28 v12-font-bold"
|
||||
@click.stop="tapShowMore(order, orderListIndex)"
|
||||
>更多</text>
|
||||
<view class="group-float" v-show="order.showMore">
|
||||
<view class="btn btn-service flex jc-center ai-center v12-font-24" @click="goRoom(order)"
|
||||
v-if="order.merName && order.isGiftCardReceiveBlind === 0">联系商家
|
||||
</view>
|
||||
<view class="btn flex jc-center ai-center v12-font-24" @click="goRefund(order)">申请退款</view>
|
||||
<view
|
||||
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
|
||||
class="btn btn-service flex jc-center ai-center v12-font-24"
|
||||
@click="goRoom(order)"
|
||||
>联系商家</view>
|
||||
<view
|
||||
class="btn flex jc-center ai-center v12-font-24"
|
||||
@click="goRefund(order)"
|
||||
>申请退款</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="v12-justify-between" style="width: 100%">
|
||||
<view>
|
||||
<view class="bnt service" @click="goRoom(order)" v-if="order.isGiftCardReceiveBlind === 0 && order.merName && order._status._type != 0 && Number(order._status._type) !== 9">联系商家</view>
|
||||
<view
|
||||
v-if="order.isGiftCardReceiveBlind === 0 &&
|
||||
order.merName &&
|
||||
parseInt(order._status._type) !== 0 &&
|
||||
parseInt(order._status._type) !== 9
|
||||
"
|
||||
class="bnt service"
|
||||
@click="goRoom(order)"
|
||||
>联系商家</view>
|
||||
</view>
|
||||
<view class="v12-justify-between">
|
||||
<view class="bnt service" @click="goOrderDetails(order)" v-if="['-1','-2','-3'].includes(order._status._type)">查看详情</view>
|
||||
<view class="bnt service" @click="delOrder(order)" v-if="['9'].includes(order._status._type)">删除订单</view>
|
||||
<!-- <view class="bnt v12-primary-text v12-primary-border" @click="takeOrder(order)" v-if="['-2','-3'].includes(order._status._type)">确认收货</view> -->
|
||||
<view
|
||||
class="bnt service"
|
||||
@click="goOrderDetails(order)"
|
||||
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
|
||||
>查看详情</view>
|
||||
<view
|
||||
class="bnt service"
|
||||
@click="delOrder(order)"
|
||||
v-if="[9].includes(parseInt(order._status._type))"
|
||||
>删除订单</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view v-else></view> -->
|
||||
</template>
|
||||
|
||||
<view class="flex">
|
||||
<template v-if="order._status._type == 0">
|
||||
<view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="cancelOrder(order)">取消订单</view>
|
||||
<view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="addressTap(order)">修改地址</view>
|
||||
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="subscribePay(order)">立即付款</view>
|
||||
<template v-if="parseInt(order._status._type) === 0">
|
||||
<view
|
||||
class="bnt cancelBnt v12-dark-text v12-dark-border"
|
||||
@click="cancelOrder(order)"
|
||||
>取消订单</view>
|
||||
<view
|
||||
class="bnt cancelBnt v12-dark-text v12-dark-border"
|
||||
@click="addressTap(order)"
|
||||
>修改地址</view>
|
||||
<view
|
||||
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
|
||||
@click="subscribePay(order)"
|
||||
>立即付款</view>
|
||||
</template>
|
||||
<template v-if="(order._status._type == 1 ) && order.isTickets==0">
|
||||
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="goOrderDetails(order)">查看详情</view>
|
||||
<template v-if="parseInt(order._status._type) === 1 && order.isTickets === 0">
|
||||
<view
|
||||
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
|
||||
@click="goOrderDetails(order)"
|
||||
>查看详情</view>
|
||||
</template>
|
||||
<template v-if="order._status._type == 1 && order.isTickets == 1">
|
||||
<view class="bnt bg-color-lightred" @click="goOrderDetails(order)">立即核销</view>
|
||||
<template v-if="parseInt(order._status._type) === 1 && order.isTickets === 1">
|
||||
<view
|
||||
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
|
||||
@click="goOrderDetails(order)"
|
||||
>立即核销</view>
|
||||
</template>
|
||||
<template v-if="order._status._type == 2 && order.isTickets == 0">
|
||||
<view class="bnt default" v-if="order.isExtendedDelivery==0"
|
||||
@click="toDelay(order.orderId)">延长收货
|
||||
<template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0">
|
||||
<view
|
||||
v-if="order.isExtendedDelivery === 0"
|
||||
class="bnt default"
|
||||
@click="toDelay(order.orderId)"
|
||||
>延长收货
|
||||
</view>
|
||||
<!-- <view class="bnt default v12-radius-40" @click="goLogistics(order)">查看物流</view> -->
|
||||
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="takeOrder(order)">确认收货</view>
|
||||
<view
|
||||
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
|
||||
@click="takeOrder(order)"
|
||||
>确认收货</view>
|
||||
</template>
|
||||
<template v-if="order._status._type == 3">
|
||||
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="goOrderDetails(order)">去评价</view>
|
||||
<template v-if="parseInt(order._status._type) === 3">
|
||||
<view
|
||||
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
|
||||
@click="goOrderDetails(order)"
|
||||
>去评价</view>
|
||||
</template>
|
||||
<template v-if="order._status._type === 4">
|
||||
<template v-if="parseInt(order._status._type) === 4">
|
||||
<view class="bnt bg-color-lightred" @click="goOrderDetails(order)">查看订单</view>
|
||||
</template>
|
||||
</view>
|
||||
@@ -168,8 +261,11 @@
|
||||
{{ Number(order.status) === 0 ? '待支付' : getGiftTips(order.giftCardInfo) }}
|
||||
</view>
|
||||
<view class="flex jc-between ai-center">
|
||||
<view class="bnt btn-service flex jc-center ai-center v12-font-24" @click="goRoom(order)"
|
||||
v-if="order.merName && order.isGiftCardReceiveBlind === 0">联系商家
|
||||
<view
|
||||
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
|
||||
class="bnt btn-service flex jc-center ai-center v12-font-24"
|
||||
@click="goRoom(order)"
|
||||
>联系商家
|
||||
</view>
|
||||
<view class="v12-align-center">
|
||||
<button
|
||||
@@ -188,50 +284,75 @@
|
||||
class="gift-btn service v12-primary-text v12-primary-border"
|
||||
@click="subscribePay(order)"
|
||||
>立即支付</button>
|
||||
<!-- 查看详情 -->
|
||||
<view class="bnt service v12-primary-text v12-primary-border" @click="goOrderDetails(order)">查看详情</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-px-3 v12-pb-4" v-if="order._status._type == 1">
|
||||
<view class="v12-font-22 v12-secondary-dark-text order-tips" v-if="order.isFastPost !== 0">商家已接收您的订单,支付成功后预计{{ getTime(order.isFastPost) }}发货</view>
|
||||
<view
|
||||
v-if="parseInt(order._status._type) === 1 && order.isFastPost !== 0"
|
||||
class="v12-px-3 v12-pb-4"
|
||||
>
|
||||
<view
|
||||
class="v12-font-22 v12-secondary-dark-text order-tips"
|
||||
>商家已接收您的订单,支付成功后预计{{ getTime(order.isFastPost) }}发货</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-modal
|
||||
:show="showExtend"
|
||||
title="确认延长收货时间?"
|
||||
content='每笔订单只能延长一次哦'
|
||||
title="确认延长收货时间?"
|
||||
content='每笔订单只能延长一次哦'
|
||||
showCancelButton
|
||||
@cancel="showExtend=false"
|
||||
@confirm="doneDelay">
|
||||
</u-modal>
|
||||
<view class="noCart" v-if="orderList.length === 0 && page > 1">
|
||||
@cancel="toDelayCancel"
|
||||
@confirm="doneDelay"
|
||||
/>
|
||||
<view
|
||||
v-if="orderList.length === 0 && page > 1"
|
||||
class="noCart"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="webUrl+'/20240102232734472795.png'"/>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
|
||||
<Loading
|
||||
:loaded="loaded"
|
||||
:loading="loading"
|
||||
/>
|
||||
<Payment
|
||||
v-model="pay"
|
||||
:types="payType"
|
||||
:balance="userInfo.nowMoney"
|
||||
@checked="toPay"
|
||||
/>
|
||||
<passkeyborad
|
||||
v-if="isShowPayPwdPop"
|
||||
:money="orderInfo.payPrice"
|
||||
showMoney
|
||||
:show="isShowPayPwdPop"
|
||||
ref='payPwdPop'
|
||||
:money="orderInfo.payPrice"
|
||||
showMoney
|
||||
:show="isShowPayPwdPop"
|
||||
@close="pwdPopClose"
|
||||
@finish="pwdPopFinish"
|
||||
></passkeyborad>
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||
import {getOrderData, getOrderList, orderDelay, editAddress } from "@/api/order";
|
||||
import {cancelOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle, delOrderHandle} from "@/libs/order";
|
||||
import Loading from "@/components/Loading";
|
||||
import Payment from "@/components/Payment";
|
||||
import {mapGetters} from "vuex";
|
||||
import {
|
||||
getOrderData,
|
||||
getOrderList,
|
||||
orderDelay,
|
||||
editAddress
|
||||
} from "@/api/order"
|
||||
import {
|
||||
cancelOrderHandle,
|
||||
payOrderHandle,
|
||||
takeOrderHandle,
|
||||
yuePayOrderHandle,
|
||||
delOrderHandle
|
||||
} from "@/libs/order"
|
||||
import Loading from "@/components/Loading"
|
||||
import Payment from "@/components/Payment"
|
||||
import { mapGetters } from "vuex"
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
|
||||
export default {
|
||||
@@ -262,13 +383,14 @@ export default {
|
||||
},
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
tabList: [
|
||||
{name: '全部'},
|
||||
{name: '待付款'},
|
||||
{name: '待发货'},
|
||||
{name: '待收货/待核销'},
|
||||
{name: '退款/售后'},
|
||||
{name: '待评价'},
|
||||
{name: '已完成'}],
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货/待核销' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
],
|
||||
offlinePayStatus: 2,
|
||||
orderData: {},
|
||||
type: 0,
|
||||
@@ -286,7 +408,7 @@ export default {
|
||||
pageKeyId: Object.freeze('userOrderIndex'),
|
||||
keyword: '',
|
||||
_orderId: ''
|
||||
};
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Loading,
|
||||
@@ -332,13 +454,11 @@ export default {
|
||||
_this._orderId = ''
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.type = this.type || parseInt(this.$yroute.query.type) || 0;
|
||||
this.changeType(this.type);
|
||||
this.type = this.type || parseInt(this.$yroute.query.type) || 0
|
||||
this.changeType(this.type)
|
||||
},
|
||||
onShareAppMessage() {
|
||||
uni.updateShareMenu({
|
||||
@@ -363,8 +483,6 @@ export default {
|
||||
return timeMap[type]
|
||||
},
|
||||
shareGift(item) {
|
||||
console.log(item);
|
||||
|
||||
this.giftItem = item
|
||||
},
|
||||
getGiftTips(giftCardInfo) {
|
||||
@@ -398,7 +516,6 @@ export default {
|
||||
},
|
||||
delOrder(order) {
|
||||
delOrderHandle(order.orderId).then(() => {
|
||||
// this.goBack()
|
||||
this.page = 1
|
||||
this.orderList = [];
|
||||
this.getOrderListReq()
|
||||
@@ -416,7 +533,7 @@ export default {
|
||||
query: {
|
||||
id: order.hotelId
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
async toYuePay(payPwd) {
|
||||
const that = this;
|
||||
@@ -426,19 +543,21 @@ export default {
|
||||
this.payPassword = "";
|
||||
},
|
||||
pwdPopClose() {
|
||||
this.isShowPayPwdPop = false;
|
||||
this.isShowPayPwdPop = false
|
||||
},
|
||||
pwdPopFinish(payPwd) {
|
||||
this.payPassword = payPwd;
|
||||
|
||||
this.toYuePay(payPwd);
|
||||
|
||||
this.isShowPayPwdPop = false;
|
||||
this.payPassword = payPwd
|
||||
this.toYuePay(payPwd)
|
||||
this.isShowPayPwdPop = false
|
||||
},
|
||||
subscribePay(order) {
|
||||
this.orderInfo = order
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: ['7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE', 'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU', '9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'],
|
||||
tmplIds: [
|
||||
'7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE',
|
||||
'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU',
|
||||
'9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'
|
||||
],
|
||||
complete: () => this.pay = true
|
||||
})
|
||||
},
|
||||
@@ -449,10 +568,10 @@ export default {
|
||||
query: {
|
||||
choosMode: 1
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
force2Decimal(v) {
|
||||
return this.$force2Decimal(v);
|
||||
return this.$force2Decimal(v)
|
||||
},
|
||||
goRoom(order) {
|
||||
const params = {
|
||||
@@ -509,11 +628,11 @@ export default {
|
||||
})
|
||||
},
|
||||
setOfflinePayStatus: function (status) {
|
||||
let that = this;
|
||||
that.offlinePayStatus = status;
|
||||
const that = this
|
||||
that.offlinePayStatus = status
|
||||
if (status === 1) {
|
||||
if (that.payType.indexOf("offline") < 0) {
|
||||
that.payType.push("offline");
|
||||
that.payType.push("offline")
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -543,11 +662,11 @@ export default {
|
||||
},
|
||||
getOrderData() {
|
||||
getOrderData().then(res => {
|
||||
this.orderData = res.data;
|
||||
});
|
||||
this.orderData = res.data
|
||||
})
|
||||
},
|
||||
takeOrder(order) {
|
||||
let that = this;
|
||||
const that = this
|
||||
uni.showModal({
|
||||
title: '是否确认收货?',
|
||||
content: '',
|
||||
@@ -557,32 +676,31 @@ export default {
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
takeOrderHandle(order.orderId).finally(() => {
|
||||
that.reload();
|
||||
that.getOrderData();
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
that.reload()
|
||||
that.getOrderData()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
reload() {
|
||||
this.changeType(this.type);
|
||||
this.changeType(this.type)
|
||||
},
|
||||
tabChange(item) {
|
||||
this.type = item.index
|
||||
this.$yroute.query.type = this.type
|
||||
this.changeType();
|
||||
this.changeType()
|
||||
},
|
||||
changeType() {
|
||||
this.orderList = [];
|
||||
this.page = 1;
|
||||
this.loaded = false;
|
||||
this.loading = false;
|
||||
this.getOrderListReq();
|
||||
this.orderList = []
|
||||
this.page = 1
|
||||
this.loaded = false
|
||||
this.loading = false
|
||||
this.getOrderListReq()
|
||||
},
|
||||
getOrderListReq() {
|
||||
if (this.loading || this.loaded) return;
|
||||
this.loading = true;
|
||||
if (this.loading || this.loaded) return
|
||||
this.loading = true
|
||||
const types = {
|
||||
0: 0,
|
||||
1: 1,
|
||||
@@ -597,25 +715,24 @@ export default {
|
||||
page,
|
||||
limit,
|
||||
keyword
|
||||
} = this;
|
||||
} = this
|
||||
getOrderList({
|
||||
page,
|
||||
limit,
|
||||
type,
|
||||
keyword
|
||||
}).then(res => {
|
||||
this.orderList = this.orderList.concat(res.data);
|
||||
this.orderList = this.orderList.concat(res.data)
|
||||
if (this.orderList.length > 0) {
|
||||
this.orderList.forEach(item => {
|
||||
item.showMore = false;
|
||||
})
|
||||
}
|
||||
this.page++;
|
||||
this.loaded = res.data.length < this.limit;
|
||||
this.loading = false;
|
||||
this.loaded = res.data.length < this.limit
|
||||
this.loading = false
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
// console.log('???',this.loading);
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
tapShowMore(order, index) {
|
||||
@@ -623,98 +740,95 @@ export default {
|
||||
this.$set(this.orderList, index, order);
|
||||
},
|
||||
getStatus(order) {
|
||||
const type = Number(order._status._type);
|
||||
const type = parseInt(order._status._type)
|
||||
let status = "";
|
||||
switch (type) {
|
||||
case 0:
|
||||
status = "待付款";
|
||||
status = "待付款"
|
||||
break;
|
||||
case 1:
|
||||
status = "待发货";
|
||||
status = "待发货"
|
||||
break;
|
||||
case 2:
|
||||
status = "待收货";
|
||||
status = "待收货"
|
||||
break;
|
||||
case 3:
|
||||
status = "待评价";
|
||||
status = "待评价"
|
||||
break;
|
||||
case 4:
|
||||
status = "已完成";
|
||||
status = "已完成"
|
||||
break;
|
||||
case -1:
|
||||
status = "退款中";
|
||||
status = "退款中"
|
||||
break;
|
||||
case -2:
|
||||
status = "退款成功";
|
||||
status = "退款成功"
|
||||
break;
|
||||
case -3:
|
||||
status = "退款失败";
|
||||
status = "退款失败"
|
||||
break;
|
||||
case 9:
|
||||
status = "已取消";
|
||||
status = "已取消"
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return status;
|
||||
return status
|
||||
},
|
||||
cancelOrder(order) {
|
||||
cancelOrderHandle(order.orderId)
|
||||
.then(() => {
|
||||
this.getOrderData();
|
||||
this.orderList.splice(this.orderList.indexOf(order), 1);
|
||||
})
|
||||
.catch(() => {
|
||||
this.reload();
|
||||
});
|
||||
cancelOrderHandle(order.orderId).then(() => {
|
||||
this.getOrderData();
|
||||
this.orderList.splice(this.orderList.indexOf(order), 1)
|
||||
}).catch(() => {
|
||||
this.reload()
|
||||
})
|
||||
},
|
||||
paymentTap: function (order) {
|
||||
const that = this;
|
||||
paymentTap(order) {
|
||||
const that = this
|
||||
if (
|
||||
!(order.combinationId > 0 || order.bargainId > 0 || order.seckillId > 0)
|
||||
) {
|
||||
that.setOfflinePayStatus(order.offlinePayStatus);
|
||||
that.setOfflinePayStatus(order.offlinePayStatus)
|
||||
}
|
||||
this.pay = true;
|
||||
this.toPay = type => {
|
||||
payOrderHandle(order.orderId, type, that.from)
|
||||
.then(() => {
|
||||
const type = parseInt(this.$yroute.query.type) || 0;
|
||||
that.changeType(type);
|
||||
that.getOrderData();
|
||||
})
|
||||
.catch(() => {
|
||||
const type = parseInt(that.$yroute.query.type) || 0;
|
||||
that.changeType(type);
|
||||
that.getOrderData();
|
||||
});
|
||||
};
|
||||
payOrderHandle(order.orderId, type, that.from).then(() => {
|
||||
const type = parseInt(this.$yroute.query.type) || 0
|
||||
that.changeType(type);
|
||||
that.getOrderData();
|
||||
}).catch(() => {
|
||||
const type = parseInt(that.$yroute.query.type) || 0
|
||||
that.changeType(type);
|
||||
that.getOrderData();
|
||||
})
|
||||
}
|
||||
},
|
||||
toPay(type) {
|
||||
const that = this;
|
||||
console.log(type, "支付方式");
|
||||
//余额支付需要输入支付密码
|
||||
const that = this
|
||||
// 余额支付需要输入支付密码
|
||||
if (type == "yue") {
|
||||
this.isShowPayPwdPop = true;
|
||||
return;
|
||||
this.isShowPayPwdPop = true
|
||||
return
|
||||
} else {
|
||||
payOrderHandle(this.orderInfo.orderId, type, that.from);
|
||||
payOrderHandle(this.orderInfo.orderId, type, that.from)
|
||||
}
|
||||
},
|
||||
|
||||
toDelay(id) {
|
||||
this.delayId = id;
|
||||
this.showExtend = true;
|
||||
this.delayId = id
|
||||
this.showExtend = true
|
||||
},
|
||||
toDelayCancel() {
|
||||
this.showExtend = false
|
||||
},
|
||||
doneDelay() {
|
||||
orderDelay(this.delayId).then(() => {
|
||||
this.showExtend = false;
|
||||
this.showExtend = false
|
||||
this.reload()
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getOrderListReq();
|
||||
!this.loading && this.getOrderListReq()
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -800,7 +914,7 @@ page {
|
||||
.bottom {
|
||||
border-top: 0rpx solid #eee;
|
||||
height: auto !important;
|
||||
padding: 30rpx !important;
|
||||
padding: 0 30rpx 30rpx 30rpx !important;
|
||||
.bnt {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
@@ -6,11 +6,21 @@
|
||||
<image class="status-img" :src="getStatusImg(orderInfo)" mode=""></image>
|
||||
</view> -->
|
||||
<view :class="refundOrder ? 'on' : ''">
|
||||
<view class="state v12-primary-text v12-font-32 v12-font-bold" v-if="orderInfo.isTickets===1 && orderInfo._status._type == 2">待核销</view>
|
||||
<view class="state v12-primary-text v12-font-32 v12-font-bold" v-else>{{ getStatus(orderInfo) }}</view>
|
||||
<view v-if="getStatus(orderInfo)!=='待付款'" class="v12-mt-2 v12-font-24 v12-secondary-dark-text" :class="{'fails-bg': orderInfo._status._type == -3}">
|
||||
<view
|
||||
v-if="orderInfo.isTickets === 1 && orderInfo._status._type === 2"
|
||||
class="state v12-primary-text v12-font-32 v12-font-bold"
|
||||
>待核销</view>
|
||||
<view
|
||||
v-else
|
||||
class="state v12-primary-text v12-font-32 v12-font-bold"
|
||||
>{{ getStatus(orderInfo) }}</view>
|
||||
<view
|
||||
v-if="getStatus(orderInfo)!=='待付款'"
|
||||
:class="{'fails-bg': orderInfo._status._type === -3}"
|
||||
class="v12-mt-2 v12-font-24 v12-secondary-dark-text"
|
||||
>
|
||||
<view>{{ orderInfo._status._msg }}</view>
|
||||
<view v-if="orderInfo._status._type == -3">驳回原因: {{ orderInfo.refundRejectReason }}</view>
|
||||
<view v-if="orderInfo._status._type === -3">驳回原因: {{ orderInfo.refundRejectReason }}</view>
|
||||
</view>
|
||||
<view class="pending-payments flex ai-center v12-mt-2 v12-font-24 v12-secondary-dark-text" v-else>
|
||||
<text>需支付{{ orderInfo.payPrice }}元,</text>
|
||||
@@ -28,8 +38,7 @@
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="reject-reason" v-if="orderInfo._status._type==-3 && orderInfo.refundRejectReason">驳回原因:{{ orderInfo.refundRejectReason }}</view> -->
|
||||
<view v-if="orderInfo.deliveryId !== null && (orderInfo._status._type == -1 || orderInfo._status._type == -2 || orderInfo._status._type == 4 || orderInfo._status._type == 3 || (orderInfo._status._type == 2 && orderInfo.isTickets!==1))">
|
||||
<view v-if="orderInfo.deliveryId !== null && ([-1, -2, 3, 4].includes(orderInfo._status._type) || (orderInfo._status._type == 2 && orderInfo.isTickets !== 1))">
|
||||
<view
|
||||
v-for="(delivery, index) in orderInfo.deliveryInfo"
|
||||
:key="index"
|
||||
@@ -74,12 +83,18 @@
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="!refundOrder">
|
||||
<view class="code-box flex jc-center ai-center" v-if="orderInfo.isTickets===1 && orderInfo._status._type==2">
|
||||
<view
|
||||
v-if="orderInfo.isTickets === 1 && orderInfo._status._type === 2"
|
||||
class="code-box flex jc-center ai-center"
|
||||
>
|
||||
<image class="code-img" :src="orderInfo.code"/>
|
||||
</view>
|
||||
<template v-else>
|
||||
<div class="writeOff" v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1"
|
||||
style="margin-top: 30rpx;border-radius: 24rpx;">
|
||||
<div
|
||||
v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1"
|
||||
class="writeOff"
|
||||
style="margin-top: 30rpx;border-radius: 24rpx;"
|
||||
>
|
||||
<div class="title">核销信息</div>
|
||||
<div class="grayBg">
|
||||
<div class="pictrue">
|
||||
@@ -968,79 +983,78 @@ export default {
|
||||
if (type == 1 && combination_id > 0) {
|
||||
status.type = 6;
|
||||
status.class_status = 1;
|
||||
} //查看拼团
|
||||
if (type == 2 && delivery_type == "express") status.class_status = 2; //查看物流
|
||||
if (type == 2) status.class_status = 3; //确认收货
|
||||
if (type == 4 || type === 0) status.class_status = 4; //删除订单
|
||||
} // 查看拼团
|
||||
if (type == 2 && delivery_type == "express") status.class_status = 2; // 查看物流
|
||||
if (type == 2) status.class_status = 3; // 确认收货
|
||||
if (type == 4 || type === 0) status.class_status = 4; // 删除订单
|
||||
if (
|
||||
!seckill_id &&
|
||||
!bargain_id &&
|
||||
!combination_id &&
|
||||
(type == 3 || type == 4)
|
||||
!seckill_id &&
|
||||
!bargain_id &&
|
||||
!combination_id &&
|
||||
(type == 3 || type == 4)
|
||||
)
|
||||
status.class_status = 5; //再次购买
|
||||
status.class_status = 5; // 再次购买
|
||||
if (type == 9) {
|
||||
//线下付款
|
||||
// 线下付款
|
||||
status.class_status = 0;
|
||||
this.offlineStatus = false;
|
||||
this.offlineStatus = false
|
||||
}
|
||||
this.status = status;
|
||||
this.status = status
|
||||
},
|
||||
getDetail() {
|
||||
const id = this.id;
|
||||
const id = this.id
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
title: "订单不存在",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
this.loading = true
|
||||
orderDetail(id)
|
||||
.then(res => {
|
||||
this.orderInfo = res.data;
|
||||
this.getOrderStatus();
|
||||
if (this.orderInfo.combinationId > 0) {
|
||||
this.orderTypeName = "拼团订单";
|
||||
this.orderTypeNameStatus = false;
|
||||
} else if (this.orderInfo.bargainId > 0) {
|
||||
this.orderTypeName = "砍价订单";
|
||||
this.orderTypeNameStatus = false;
|
||||
} else if (this.orderInfo.seckillId > 0) {
|
||||
this.orderTypeName = "秒杀订单";
|
||||
this.orderTypeNameStatus = false;
|
||||
} else if (this.orderInfo.isGiftCardReceive === 1 || this.orderInfo.isGiftCardSend === 1) {
|
||||
this.orderTypeName = "礼包订单";
|
||||
this.orderTypeNameStatus = false;
|
||||
orderDetail(id).then(res => {
|
||||
this.orderInfo = res.data
|
||||
this.orderInfo._status._type = parseInt(this.orderInfo._status._type)
|
||||
this.getOrderStatus()
|
||||
if (this.orderInfo.combinationId > 0) {
|
||||
this.orderTypeName = "拼团订单"
|
||||
this.orderTypeNameStatus = false
|
||||
} else if (this.orderInfo.bargainId > 0) {
|
||||
this.orderTypeName = "砍价订单"
|
||||
this.orderTypeNameStatus = false
|
||||
} else if (this.orderInfo.seckillId > 0) {
|
||||
this.orderTypeName = "秒杀订单"
|
||||
this.orderTypeNameStatus = false
|
||||
} else if (this.orderInfo.isGiftCardReceive === 1 || this.orderInfo.isGiftCardSend === 1) {
|
||||
this.orderTypeName = "礼包订单"
|
||||
this.orderTypeNameStatus = false
|
||||
}
|
||||
this.system_store = res.data.systemStore || {}
|
||||
this.mapKey = res.data.mapKay
|
||||
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus)
|
||||
const statusType = this.orderInfo._status._type
|
||||
if([-1, -2, 4, 3].includes(statusType) || (statusType === 2 && this.orderInfo.isTickets !== 1)) {
|
||||
for(let i = 0; i < this.orderInfo.deliveryInfo.length; i++) {
|
||||
this.orderInfo.deliveryInfo[i].estimatedTime = ''
|
||||
this.getExpressInfo(this.orderInfo.deliveryInfo[i], i)
|
||||
if (statusType === 2) {
|
||||
this.getDay(this.orderInfo.deliveryInfo[i], i)
|
||||
}
|
||||
this.system_store = res.data.systemStore || {};
|
||||
this.mapKey = res.data.mapKay;
|
||||
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus);
|
||||
const orderInfo = this.orderInfo
|
||||
if(orderInfo._status._type == -1 || orderInfo._status._type == -2 || orderInfo._status._type == 4 || orderInfo._status._type == 3 || (orderInfo._status._type == 2 && orderInfo.isTickets!==1)) {
|
||||
for(let i = 0; i < orderInfo.deliveryInfo.length; i++) {
|
||||
orderInfo.deliveryInfo[i].estimatedTime = ''
|
||||
this.getExpressInfo(orderInfo.deliveryInfo[i], i)
|
||||
if (orderInfo._status._type === 2) {
|
||||
this.getDay(orderInfo.deliveryInfo[i], i)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
uni.hideLoading()
|
||||
});
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
async toPay(type) {
|
||||
var that = this;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<view class="return-list" ref="container">
|
||||
<view class="goodWrapper" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
|
||||
<view class="iconfont icon-tuikuanzhong powder" v-if="order._status._type === '-1'"></view>
|
||||
<view class="iconfont icon-yituikuan" v-if="order._status._type === '-2'"></view>
|
||||
<image class="iconfont" :src="webUrl+'/20230713110051999762.png'" v-if="order._status._type === '-3'"/>
|
||||
<view class="iconfont icon-tuikuanzhong powder" v-if="parseInt(order._status._type) === -1"></view>
|
||||
<view class="iconfont icon-yituikuan" v-if="parseInt(order._status._type) === -2"></view>
|
||||
<image class="iconfont" :src="webUrl+'/20230713110051999762.png'" v-if="parseInt(order._status._type) === -3"/>
|
||||
<view class="orderNum">订单号:{{ order.orderId }}</view>
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
|
||||
Reference in New Issue
Block a user