Browse Source

del old timing order

tid1731
刘嘉炜 5 months ago
parent
commit
613d038fb9
  1. 194
      src/components/end_billing_modal/end_billing_modal.vue
  2. 185
      src/components/timing_order/timing_order.vue
  3. 1
      src/js/api.js
  4. 12
      src/pages.json
  5. 12
      src/pages/order_list/order_list.vue
  6. 4
      src/pages/order_search/order_search.vue
  7. 1
      src/subpackage/device/js/device_api.js
  8. 16
      src/subpackage/order/components/order_list/header.vue
  9. 1
      src/subpackage/order/js/api.js
  10. 53
      src/subpackage/order/pages/order_list/order_list.vue
  11. 8
      src/subpackage/order/pages/order_manage/order_manage.vue
  12. 379
      src/subpackage/order/pages/timing/detail.vue

194
src/components/end_billing_modal/end_billing_modal.vue

@ -1,194 +0,0 @@
<template>
<!-- 弹框 结束计费 -->
<view class="ox-dark-mask" @touchmove.stop.prevent="moveHandle" @click.stop="">
<view class="odm-end-modal" >
<view class="oem-close">
<image src="/static/images/icon/x_close.png" @click="closeChange"></image>
</view>
<view class="oem-tit">结束计费</view>
<view class="oem-line">操作人{{orderInfo.end_bill_operator_name || '-'}}</view>
<view class="oem-line">时长合计<text class="ol-txt1">{{orderInfo.extension.duration || '-'}}</text></view>
<view class="oem-line">金额合计<text class="ol-txt2">¥{{orderInfo.amount || 0}}</text></view>
<view class="oem-box">
<view @click="selectBtn(1)">
<image :class="[selectType==1?'ob-img':'']" :src="selectType==1?'/static/images/icon/selected_ring.png':''"></image>
<view :class="[selectType==1?'ov-active':'']">停止计时</view>
</view>
<view @click="selectBtn(2)">
<image :class="[selectType==2?'ob-img':'']" :src="selectType==2?'/static/images/icon/selected_ring.png':''"></image>
<view :class="[selectType==2?'ov-active':'']">完结订单</view>
</view>
</view>
<view class="oem-tips">*<text>请输入金额</text></view>
<view class="oem-ipt"><input type="digit" v-model="input_amount"/></view>
<view class="oem-btn" hover-class="hover-active" @click="confirmChange" >确认</view>
</view>
</view>
</template>
<script>
import util from '@/utils/util';
import deviceApi from '../../subpackage/device/js/device_api.js';
import deviceServer from '../../subpackage/device/js/device_server.js';
import { mapState } from 'vuex';
export default {
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
computed: {
...mapState(['brandInfo']),
},
data() {
return {
input_amount: "",
selectType: 1, //1() 2()
}
},
methods: {
moveHandle(){},
closeChange(){
this.$emit('close');
},
confirmChange(){
let { brandInfo, orderInfo, input_amount, selectType } = this
if(input_amount == '')return util.showNone('请输入金额!');
util.showLoad();
deviceServer.get({
url: deviceApi.timeOrderEnd,
data: {
brand_id: brandInfo.brand.id,
order_no: orderInfo.order_no,
pay_amount: parseFloat(input_amount),
end_type: selectType==1?'end_timing':selectType==2?'end_order':'',
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
util.showNone('操作成功!');
this.$emit('close');
// setTimeout(()=>uni.navigateBack(),1200);
this.$emit('timeEndBtn');
})
.catch(util.hideLoad)
},
selectBtn(type){
this.selectType = type
},
},
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.odm-end-modal{
position: absolute;
left: 65rpx;
top: 12%;
background-color: #fff;
width: 620rpx;
padding: 30rpx 0rpx 60rpx;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.oem-close{
width: 100%;
@include centerFlex(flex-end);
>image{
width: 32rpx;
height: 32rpx;
margin-right: 30rpx;
}
}
.oem-tit {
color: #1A1A1A;
font-size: 32rpx;
font-weight: 700;
margin: 16rpx 0rpx 34rpx;
}
.oem-line{
width: 456rpx;
color: #1A1A1A;
font-size: 28rpx;
line-height: 48rpx;
.ol-txt1{
color: #009874;
}
.ol-txt2{
color: #FF873D;
}
}
.oem-box{
margin: 58rpx 0 48rpx;
width: 456rpx;
@include centerFlex(space-between);
>view{
@include centerFlex(flex-start);
>image{
flex-shrink: 0;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 2rpx solid #D8D8D8;
&.ob-img{
width: 32rpx;
height: 32rpx;
border: 0rpx solid #D8D8D8;
}
}
>view{
margin-left: 12rpx;
font-size: 28rpx;
line-height: 48rpx;
color: #9C9C9F;
&.ov-active{
color: #1A1A1A;
}
}
}
}
.oem-tips{
width: 456rpx;
margin: 0rpx 0rpx 8rpx;
color: #EA5061;
font-size: 28rpx;
>text{
color: #333333;
}
}
.oem-ipt{
width: 456rpx;
border: 2rpx solid #D8D8D8;
border-radius: 10rpx;
& input {
flex-grow: 1;
height: 88rpx;
color: #1A1A1A;
font-size: 28rpx;
padding: 0rpx 20rpx;
}
}
.oem-btn{
width: 240rpx;
height: 88rpx;
margin-top: 60rpx;
border-radius: 10rpx;
background-color: #009874;
color: #FFF;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
}
}
</style>

185
src/components/timing_order/timing_order.vue

@ -1,185 +0,0 @@
<template>
<view class="timing-order" @click="toOrderDetails">
<view class="ro-header">
<view class="rh-view">{{orderInfo.stadium_name || '-'}}</view>
<text :class="[ 'rh-text', orderInfo.pay_status == 0?'rh-active':'' ]">{{zh_order_status(orderInfo.pay_status)}}</text>
</view>
<view class="ro-section">
<view class="rs-line">
<view class="rl-view">订单编号</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.order_no || '-'}}</view>
</view>
<image class="rl-image" src="/static/images/icon/arrow_b2.png"></image>
</view>
<!-- 场时有 人时没有 order_type: 1场时 2人时 -->
<view class="rs-line" v-if="orderInfo.order_type == 1">
<view class="rl-view">项目</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.project_name || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">时长</view>
<view class="rl-view">
<view :class="[ 'rv-view', orderInfo.pay_status == 0?'rv-active':'' ]">{{ orderInfo.extension.duration || '-'}}</view>
</view>
</view>
<view class="rs-btn" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==false"><view @click.stop="isEndBill=true">结束计费</view></view>
</view>
<view class="ro-bot" v-if="orderInfo.pay_status != 0">
<view class="rb-total">实付款 <text class="rt-txt"> ¥{{orderInfo.pay_amount || 0}}</text></view>
</view>
<!-- 结束计费弹框 -->
<end-billing-modal
v-if="isEndBill==true"
@close="isEndBill=false"
@timeEndBtn="timeEndBtn"
:orderInfo="orderInfo"
></end-billing-modal>
</view>
</template>
<script>
import util from '@/utils/util';
import end_billing_modal from '../end_billing_modal/end_billing_modal.vue';
export default {
components: {
'end-billing-modal': end_billing_modal,
},
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
computed: {
zh_order_status(){
// 01
let { orderInfo } = this
return status =>{
const _obj = {
'0': orderInfo.early_end_timing==true?'待支付':'计费中',
'1': '已完成',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
},
},
data() {
return {
isEndBill: false,
}
},
methods:{
toOrderDetails(){
let { orderInfo } = this
// let _query = {}
// _query["stadium_id"] = orderInfo.stadium_id
// _query["order_no"] = orderInfo.order_no
// _query["order_type"] = 1
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}`
util.routeTo(`/subpackage/order/pages/timing/detail?${_str}`,'nT');
// this.$emit('orderDetailChange');
},
timeEndBtn(){
this.$emit('refreshList');
},
}
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.timing-order{
padding: 0 24upx;
border-radius: 10upx;
background-color: #fff;
.ro-header{
margin-bottom: 18upx;
height: 98upx;
line-height: 96upx;
border-bottom: 2upx solid #D8D8D8;
@include centerFlex(space-between);
.rh-view{
flex-grow: 1;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
}
.rh-text{
margin-left: 20upx;
flex-shrink: 0;
font-size: 28upx;
color: #9C9C9F;
}
.rh-active{
color: $themeColor;
}
}
.ro-section{
padding-bottom: 30upx;
.rs-line{
display: flex;
.rl-view,.rv-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
}
.rl-view{
&:first-child{
flex-shrink: 0;
}
&+.rl-view{
flex-grow: 1;
.rv-view{
@include textHide(1);
}
}
}
.rv-active{
color: $themeColor;
}
>.rl-image{
width: 32rpx;
height: 32rpx;
}
}
.rs-btn{
margin-top: 8rpx;
@include centerFlex(flex-end);
>view{
width: 192rpx;
height: 80rpx;
border: 2rpx solid #009874;
border-radius: 10rpx;
color: #009874;
font-size: 32rpx;
font-weight: 500;
text-align: center;
line-height: 80rpx;
}
}
}
.ro-bot{
padding-top: 20upx;
padding-bottom: 30upx;
border-top: 2upx solid #D8D8D8;
.rb-total{
line-height: 40upx;
text-align: right;
font-size: 24upx;
color: #9c9c9f;
.rt-txt{
color: #1A1A1A;
margin-left: 10rpx;
}
}
}
}
</style>

1
src/js/api.js

@ -30,7 +30,6 @@ export const API = {
// reservationOrder: `${ORIGIN}/admin/stadium/order/list`, // 预约订单
reservationOrder:`${ORIGIN}/admin/assistant/stadiumOrder/list`, //k-订单管理-预约订单列表 PM:2021/4/19
timeOrder:`${ORIGIN}/admin/assistant/timeOrder/list`, //k-订单管理-计时订单列表 PM:2021/4/19
membershipOrder: `${ORIGIN}/admin/member_card/order/list`, // 会员卡订单

12
src/pages.json

@ -480,12 +480,6 @@
"root": "subpackage/order",
"pages": [
{
"path": "pages/order_list/order_list",
"style" : {
"navigationBarTitleText": "订单"
}
},
{
"path": "pages/timekeeping/order_search",
"style" : {
"navigationBarTitleText": "订单搜索"
@ -640,12 +634,6 @@
"style" : {
"navigationBarTitleText": "租球机订单详情"
}
},
{
"path": "pages/timing/detail",
"style" : {
"navigationBarTitleText": "计时订单详情"
}
}
]
},

12
src/pages/order_list/order_list.vue

@ -50,7 +50,6 @@
<reservation-order :order-info="e" v-if="orderType == 3" @verify="reservationVerify(i)"></reservation-order>
<membership-order :order-info="e" v-if="orderType == 4"></membership-order>
<integral-order :order-info="e" v-if="orderType == 5"></integral-order>
<timing-order :order-info="e" @refreshList="refreshList" v-if="orderType == 1"></timing-order>
<organize-order :order-info="e" v-if="orderType == 10" @refreshList="refreshList"></organize-order>
<curriculum :order-info="e" v-if="orderType == 12"></curriculum>
@ -127,7 +126,6 @@
import reservation_order from '../../components/reservation_order/reservation_order';
import integral_order from '../../components/integral_order/integral_order';
import membership_order from '../../components/membership_order/membership_order';
import timing_order from '../../components/timing_order/timing_order.vue';
import organize_order from '../../components/organize_order/organize_order.vue';
// 20210910
import value_card from '../../components/order_list/value_card/value_card.vue'; // 20220725
@ -157,7 +155,6 @@
'reservation-order': reservation_order,
'membership-order': membership_order,
'integral-order': integral_order,
'timing-order': timing_order,
'organize-order': organize_order,
'spectacular-monent': spectacular_monent,
'value-card': value_card,
@ -180,7 +177,7 @@
let { orderType } = this;
return (
orderType == 3 || orderType == 4 ||
orderType == 1 || orderType == 10 ||
orderType == 10 ||
orderType == 18 || orderType == 12 ||
orderType == 18 || orderType == 12 ||
orderType == 15 || orderType == 16 ||
@ -444,7 +441,6 @@
if(type == 3)return API.reservationOrder;
if(type == 4)return API.membershipOrder;
if(type == 5)return API.integralOrder;
if(type == 1)return API.timeOrder;
if(type == 10)return API.organizeOrderList; //
if(type == 12)return API.venueCourseOrderList; //
if(type == 18)return API.userValueCardList; //
@ -488,7 +484,7 @@
delete _obj['status'];
_obj['order_status_in'] = +curTabID === -1 ? '0,1,2,3' : curTabID + ''
}
// :0,1; :/[1/2]
// :0,1;
if(orderType == 3)_obj['order_type'] = appointOrderType;
// , 0430.0507()
@ -549,8 +545,6 @@
return '会员卡订单';
case 5:
return '积分商城订单';
case 1:
return '计时订单';
case 10:
return '约玩订单';
case 12:
@ -596,8 +590,6 @@
return [ {id: '', name: '全部'}, {id: 1, name: '使用中'}, {id: 0, name: '已失效'},];
case 5: // tab
return [ {id: '', name: '全部'}, {id: 1, name: '待发货'}, {id: 2, name: '已发货'}, {id: 3, name: '已完成'}, ];
case 1: // tab ///退 [/0/1/4]
return [ {id: '', name: '全部'}, {id: 0, name: '计费中'}, {id: 1, name: '已完成'}, {id: 4, name: '已退款'}, ];
case 10: // tab ///退 [/0/1/4]
return [ {id: '', name: '全部'}, {id: 1, name: '已付款'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'}, ];
case 12: // tab ///退 [/0/1/4]

4
src/pages/order_search/order_search.vue

@ -17,7 +17,6 @@
<reservation-order :order-info="e" v-if="orderType == 3"></reservation-order>
<membership-order :order-info="e" v-if="orderType == 4"></membership-order>
<integral-order :order-info="e" v-if="orderType == 5"></integral-order>
<timing-order :order-info="e" v-if="orderType == 1"></timing-order>
<organize-order :order-info="e" v-if="orderType == 10"></organize-order>
<!-- 20210910 -->
@ -44,7 +43,6 @@
import reservation_order from '../../components/reservation_order/reservation_order';
import integral_order from '../../components/integral_order/integral_order';
import membership_order from '../../components/membership_order/membership_order';
import timing_order from '../../components/timing_order/timing_order.vue'
import organize_order from '../../components/organize_order/organize_order.vue'
// 20210910
import value_card from '../../components/order_list/value_card/value_card.vue';
@ -71,7 +69,6 @@ export default {
'reservation-order': reservation_order,
'membership-order': membership_order,
'integral-order': integral_order,
'timing-order': timing_order,
'organize-order': organize_order,
// <!-- 20210910 -->
'spectacular-monent': spectacular_monent,
@ -137,7 +134,6 @@ export default {
if(type == 3)return API.reservationOrder;
if(type == 4)return API.membershipOrder;
if(type == 5)return API.integralOrder;
if(type == 1)return API.timeOrder;
if(type == 10)return API.organizeOrderList;
// <!-- 20210910 -->
if(type == 12)return API.venueCourseOrderList; //

1
src/subpackage/device/js/device_api.js

@ -35,7 +35,6 @@ export const DEVICE_API = {
checkIccard:`${ORIGIN}/admin/assistant/checkIccard`, //k-订单管理-校验ic卡
storeHouseList:`${ORIGIN}/admin/assistant/storeHouse/list`, //k-仓库列表
iccardList:`${ORIGIN}/admin/assistant/iccard/list`, //k-ic卡列表
timeOrderDetail:`${ORIGIN}/admin/assistant/timeOrder/detail`, //k-订单管理-计时订单详情
timeOrderEnd:`${ORIGIN}/admin/assistant/timeOrder/end`, //k-订单管理-订单计时结束
timeOrderComplete:`${ORIGIN}/admin/assistant/timeOrder/complete`, //【20220208】k-订单管理-计时订单完结

16
src/subpackage/order/components/order_list/header.vue

@ -37,10 +37,18 @@ export default {
'period-modal': periodModal
},
props: {
startTime: String,
endTime: String,
successCount: Number,
refundCount: Number,
startTime: {
default: ''
},
endTime: {
default: ''
},
successCount: {
default: 0
},
refundCount: {
default: 0
},
},
data(){
return {

1
src/subpackage/order/js/api.js

@ -47,7 +47,6 @@ export const ORDER_API = {
// 20240614 tid1523 统一退款
venueCourseOrderRefund:`${ORIGIN}/admin/venueCourse/orderRefund`, // 课程订单-退款
userValueCardRefundFixed:`${ORIGIN}/admin/userValueCard/refundFixed`, // 储值卡订单-退款
timeOrderDetail:`${ORIGIN}/admin/assistant/timeOrder/detail`, //k-订单管理-计时订单详情
orderRefund:`${ORIGIN}/admin/stadium/order/refund`, // A订单管理-场馆预订订单-订单退款 (零售订单、场地、次卡)
userMonthlyCardRefundFixed:`${ORIGIN}/admin/userMonthlyCard/refundFixed`, // 年月卡订单-订单退款
}

53
src/subpackage/order/pages/order_list/order_list.vue

@ -1,53 +0,0 @@
<template>
<view class="order-list">
<order-list-header
ref="orderListHeader"
@change:stadium="changeStadium"
@click:time="showPeriodModal"
@click:filter="showFilterModal"
></order-list-header>
<period-modal
ref="periodModal"
></period-modal>
<filter-modal ref="filterModal"></filter-modal>
</view>
</template>
<script>
import orderListHeader from "../../components/order_list/header.vue";
import periodModal from "../../components/order_list/period_modal.vue";
import filterModal from "../../components/order_list/filter_modal.vue";
export default {
components: {
'order-list-header': orderListHeader,
'period-modal': periodModal,
'filter-modal': filterModal
},
async onLoad(options){
let _list = await this.$refs.orderListHeader.initStadiumSelect(options.brand_id)
},
methods: {
showFilterModal(){
this.$refs.filterModal.show();
},
changeStadium(e){
console.log('changeStadium:', e)
},
showPeriodModal(){
this.$refs.periodModal.init({
star: '2020-08-01',
end: '2020-08-27',
success: res=>{
console.log('success:', res)
}
});
},
}
}
</script>
<style lang="scss">
.order-list{
}
</style>

8
src/subpackage/order/pages/order_manage/order_manage.vue

@ -48,7 +48,7 @@ export default {
util.routeTo(getTabRoutePath() + `?order_type=${ele.orderType}`,'nT');
},
isFinish(key){
let _endKeyArr = [ 1, 2, 3, 4, 5, 7, 9, 10, 14, 16, 15, 13, 6, 8, 11, 12, 18, 19, 22, 23];
let _endKeyArr = [ 1, 2, 4, 5, 7, 9, 10, 14, 16, 15, 13, 6, 8, 11, 12, 18, 19, 22, 23];
return _endKeyArr.includes(key);
}
}
@ -67,7 +67,8 @@ function getTabList(){
tabArr: [
{ id: 1, name: '订场订单', key: 1, iconName: 'order_14', orderType: 3 },
{ id: 2, name: '次卡订单', key: 2, iconName: 'order_2', orderType: 3 },
{ id: 3, name: '计时订单', key: 3, iconName: 'order_6', orderType: 1 },
{ id: 11, name: '散客计时订单', key: 22, iconName: 'order_22', orderType: 2 },
{ id: 12, name: '场地计时订单', key: 23, iconName: 'order_23', orderType: 1 },
{ id: 4, name: '储值卡订单', key: 4, iconName: 'order_1', orderType: 21 },
{ id: 10, name: '年月卡订单', key: 19, iconName: 'order_19', orderType: 20 },
{ id: 5, name: '课程订单', key: 5, iconName: 'order_8', orderType: 12 },
@ -76,8 +77,7 @@ function getTabList(){
{ id: 8, name: '商城订单', key: 8, iconName: 'order_4', orderType: 2 },
{ id: 9, name: '积分兑换订单', key: 9, iconName: 'order_5', orderType: 5 },
{ id: 9, name: '零售订单', key: 18, iconName: 'order_18', orderType: 19 },
{ id: 11, name: '散客计时订单', key: 22, iconName: 'order_22', orderType: 2 },
{ id: 12, name: '场地计时订单', key: 23, iconName: 'order_23', orderType: 1 },
]
}

379
src/subpackage/order/pages/timing/detail.vue

@ -1,379 +0,0 @@
<template>
<view class="timing-details">
<view class="td-head">
<view class="th-store">
<image :src="orderInfo.stadium_logo || ''"></image>
<view>{{orderInfo.stadium_name || '-'}}</view>
</view>
<view class="th-line">
<view>订单编号<text>{{orderInfo.order_no || '-'}}</text></view>
<view><text :class="[orderInfo.pay_status == 0?'tl-active':'']">{{zh_order_status(orderInfo.pay_status)}}</text></view>
</view>
<view class="th-line">
<view>创建时间<text>{{orderInfo.model.created_at || '-'}}</text></view>
</view>
<view class="th-line">
<view>用户昵称<text>{{orderInfo.nickname || '-'}}</text></view>
</view>
</view>
<view class="td-box">
<view class="tb-title">计时信息</view>
<view class="tb-line">
<!-- 项目 场时有 人时没有 order_type: 1场时 2人时 -->
<view v-if="orderInfo.order_type==1">项目<text>{{orderInfo.project_name || '-'}}({{orderInfo.venue_name || '-'}})</text></view>
<view>进场时间<text>{{orderInfo.start_time || '-'}}</text></view>
<!-- 离场时间 已完成显示 -->
<view v-if="orderInfo.pay_status != 0">离场时间<text>{{orderInfo.end_time || '-'}}</text></view>
<view>时长合计<text>{{orderInfo.extension.duration || '-'}}</text></view>
</view>
<view class="tb-section" v-if="!(orderInfo.pay_status== 0&&orderInfo.early_end_timing==false)">
<view class="ts-line">
<view>金额小计</view>
<view>¥{{orderInfo.amount || 0}}</view>
</view>
<view class="ts-line">
<view>积分抵扣</view>
<view>-¥{{orderInfo.deduction_amount ||0}}</view>
</view>
<view class="ts-line">
<view>折扣金额</view>
<view>-¥{{orderInfo.discount_amount||0}}</view>
</view>
<view class="ts-line">
<view>优惠券优惠</view>
<view>-¥{{orderInfo.coupons_amount || 0}}</view>
</view>
<view class="ts-total">
<view>合计支付<text></text><text>{{orderInfo.pay_amount ||0}}</text></view>
</view>
</view>
</view>
<view class="td-box" v-if="orderInfo.pay_status != 0">
<view class="tb-title">支付信息</view>
<view class="tb-line">
<view>支付方式<text>{{zh_pay_type(orderInfo.pay_type)}}</text></view>
<view>支付时间<text>{{orderInfo.pay_time || '-'}}</text></view>
<view v-if="orderInfo.pay_type==0">微信交易号<text>{{orderInfo.trade_no || ''}}</text></view>
<view v-if="orderInfo.pay_type==3">操作人<text>{{orderInfo.end_bill_operator_name || ''}}</text></view>
</view>
</view>
<!-- 退款列表 -->
<view v-for="(e, i) in refundList" :key="i" style="padding: 24rpx 24rpx 0;">
<order-refund-info
:refund_price="e.amount || 0"
:refund_no="e.refund_no || '-'"
:refund_time="e.refund_time || '-'"
:refund_reason="e.reason || '-'"
:nameKey="i + 1"
></order-refund-info>
</view>
<view class="td-btn" @click="isEndBill = true" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==false">结束计费</view>
<view class="td-btn" @click="completeBtn" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==true">完结订单</view>
<!-- 退款按钮拦 -->
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="(refundList&&refundList.length) || 0"
@click:button="refunndBtn"
></order-refund-fixed>
<!-- 结束计费弹框 -->
<end-billing-modal
v-if="isEndBill==true"
@close="isEndBill=false"
@timeEndBtn="timeEndBtn"
:orderInfo="orderInfo"
></end-billing-modal>
<!-- 退款弹窗 -->
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
<script>
import util from '@/utils/util';
import { ORDER_API } from '../../js/api';
import server from '../../js/server';
import { mapState } from 'vuex';
import end_billing_modal from '@/components/end_billing_modal/end_billing_modal.vue';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
import orderRefundModal from '@/components/order_refund/modal.vue';
import orderRefundInfo from '@/components/order_refund/info.vue';
export default {
components: {
'end-billing-modal': end_billing_modal,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
},
computed: {
...mapState(['brandInfo']),
zh_order_status(){
// 01
let { orderInfo } = this
return status =>{
const _obj = {
'0': orderInfo.early_end_timing==true?'待支付':'计费中',
'1': '已完成',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
},
},
data() {
return {
isEndBill: false,
orderInfo: {},
refundList: [], // 退
}
},
onLoad(options){
this.getOrderInfo({
order_no: options?.order_no || '',
stadium_id: options?.stadium_id || ''
})
this.getRefundTimes(options?.order_no || '');
},
methods: {
refunndBtn(){
let { orderInfo, refundList } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: orderInfo?.extension?.refundable_amount ?? 0,
refundable_integral: orderInfo?.extension?.refundable_integral ?? 0,
refund_times: refundList?.length || -1,
confirm: e => {
this.orderRefund({
order_no: orderInfo?.order_no || '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0,
stadium_id: orderInfo?.stadium_id || ''
})
}
});
},
orderRefund({ order_no = '', amount = 0, integral = 0, stadium_id = ''}){
util.showLoad();
server.get({
url: ORDER_API.orderRefund,
data: { order_no, amount, integral },
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
.finally(_=>setTimeout(_=>{
this.getOrderInfo({ order_no, stadium_id });
this.getRefundTimes(order_no);
}, 1200));
},
async getRefundTimes(order_no){
try{
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
let _refundLs = _refundRes?.data?.data?.list || [];
this.refundList = _refundLs;
}catch(err){
console.warn('getRefundTimes err', err);
}
},
getOrderInfo({ order_no, stadium_id }){
util.showLoad();
server.get({
url: ORDER_API.timeOrderDetail,
data: { order_no, stadium_id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
this.orderInfo = res || {}
})
.catch(util.hideLoad)
},
zh_pay_type: util.order_pay_type_txt,
completeBtn(){
this.$emit('completeBtn');
},
timeEndBtn(){
let { orderInfo } = this;
this.getOrderInfo({
order_no: orderInfo?.order_no || '',
stadium_id: orderInfo?.stadium_id || ''
})
},
// -
completeBtn(){
let { orderInfo } = this
util.showModal({
title: '提示',
content: '是否确认完结订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm)this.timeOrderComplete({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || '',
stadium_id: orderInfo?.stadium_id || ''
})
}
})
},
//
timeOrderComplete({ brand_id, order_no, stadium_id }){
util.showLoad();
server.get({
url: ORDER_API.timeOrderComplete, //
data: { brand_id, order_no },
failMsg: '请求失败!'
})
.then(res=>{
util.hideLoad();
util.showNone('操作成功!');
setTimeout(_=>{
this.getOrderInfo({ order_no, stadium_id });
util.previousPageFunction({
fnName: 'refreshList',
query: { isLoad: false},
});
}, 1200)
})
.catch(util.hideLoad)
}
}
}
</script>
<style lang="scss" >
.timing-details{
margin-bottom: 24rpx;
.td-head{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx 10rpx 0px 0px;
.th-store{
padding-bottom: 26rpx;
margin-bottom: 18rpx;
border-bottom: 2rpx solid #D8D8D8;
display: flex;
justify-content: flex-start;
>image{
flex-shrink: 0;
width: 40rpx;
height: 40rpx;
}
>view{
flex-grow: 1;
margin-left: 14rpx;
color: #333333;
font-size: 28rpx;
}
}
.th-line{
margin-top: 8rpx;
@include ctf(space-between);
>view{
line-height: 40rpx;
font-size: 28rpx;
&:first-child{
color: #9A9A9D;
>text{
color: #333333;
}
}
&:nth-child(2){
>text{
color: #9A9A9D;
}
.tl-active{
color: $mColor;
}
}
}
}
}
.td-box{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx;
.tb-title{
color: #9A9A9D;
font-size: 28rpx;
margin-bottom: 20rpx;
}
.tb-line{
>view{
line-height: 52rpx;
font-size: 28rpx;
color: #9A9A9D;
>text{
color: #333333;
}
}
}
.tb-section{
margin-top: 30rpx;
border-top: 2rpx solid #D8D8D8;
.ts-line{
margin-top: 26rpx;
@include ctf(space-between);
>view{
color: #333333;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 24rpx;
margin-right: 8rpx;
}
}
}
.ts-total{
margin-top: 22rpx;
@include ctf(flex-end);
>view{
color: #333333;
font-size: 28rpx;
>text{
color: #FF873D;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 36rpx;
margin-right: 8rpx;
}
}
}
}
}
}
.td-btn{
height: 112rpx;
margin: 80rpx 24rpx 10upx;
border-radius: 10rpx;
background-color: $mColor;
color: #FFF;
font-size: 32rpx;
line-height: 112rpx;
text-align: center;
}
}
</style>
Loading…
Cancel
Save