Browse Source

merge dev error

tid1731
刘嘉炜 5 months ago
parent
commit
302c75237c
  1. 21914
      package-lock.json
  2. 1
      package.json
  3. 1
      src/components/end_billing_modal/end_billing_modal.vue
  4. 38
      src/components/fixed_bar/fixed_bar.vue
  5. 22
      src/components/order_refund/button.vue
  6. 57
      src/components/order_refund/fixed.vue
  7. 56
      src/components/order_refund/info.vue
  8. 231
      src/components/order_refund/modal.vue
  9. 4
      src/components/timing_order/timing_order.vue
  10. 2
      src/js/api.js
  11. 6
      src/pages.json
  12. 2
      src/pages/site/confirm/confirm.vue
  13. 8
      src/store/actions.js
  14. 3
      src/store/index.js
  15. 173
      src/subpackage/device/components/brand_change_modal.vue
  16. 30
      src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue
  17. 42
      src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue
  18. 265
      src/subpackage/device/components/order/timing_detail/timing_detail.vue
  19. 56
      src/subpackage/device/pages/index/index.vue
  20. 212
      src/subpackage/device/pages/order_details/order_details.vue
  21. 6
      src/subpackage/order/js/api.js
  22. 110
      src/subpackage/order/pages/curriculum/detail/detail.vue
  23. 434
      src/subpackage/order/pages/retail/detail/detail.vue
  24. 85
      src/subpackage/order/pages/stored_value_card/detail/detail.vue
  25. 379
      src/subpackage/order/pages/timing/detail.vue
  26. 112
      src/subpackage/order/pages/ym_card/detail/detail.vue
  27. 4
      src/utils/util.js
  28. 21311
      yarn.lock

21914
package-lock.json
File diff suppressed because it is too large
View File

1
package.json

@ -64,6 +64,7 @@
"@vue/shared": "^3.0.0", "@vue/shared": "^3.0.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"flyio": "^0.6.2", "flyio": "^0.6.2",
"pinyin-engine": "^1.2.2",
"regenerator-runtime": "^0.12.1", "regenerator-runtime": "^0.12.1",
"sass": "^1.63.3", "sass": "^1.63.3",
"vue": "^2.6.11" "vue": "^2.6.11"

1
src/components/end_billing_modal/end_billing_modal.vue

@ -76,6 +76,7 @@ export default {
// setTimeout(()=>uni.navigateBack(),1200); // setTimeout(()=>uni.navigateBack(),1200);
this.$emit('timeEndBtn'); this.$emit('timeEndBtn');
}) })
.catch(util.hideLoad)
}, },
selectBtn(type){ selectBtn(type){

38
src/components/fixed_bar/fixed_bar.vue

@ -0,0 +1,38 @@
<template>
<view class="fixed-bar" :style="'padding-top:'+ fbHeight +'px;'">
<view class="fb-fixed" id="fb">
<slot></slot>
</view>
</view>
</template>
<script>
import { getNodeMes } from '@/utils/util'
export default {
data(){
return {
fbHeight: 0,
}
},
mounted() {
getNodeMes('#fb', this).then(res => {
this.fbHeight = res?.height || 0
console.log(res)
})
},
}
</script>
<style lang="scss">
.fixed-bar{
}
.fb-fixed{
padding-top: 20upx;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 10;
}
</style>

22
src/components/order_refund/button.vue

@ -0,0 +1,22 @@
<template>
<view class="order-refund-button" @click="$emit('click')">
<slot>退款</slot>
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss">
.order-refund-button{
width: 192upx;
text-align: center;
border-radius: 10upx;
background-color: #fff;
border: 2upx solid $mColor;
@include flcw(32upx, 84upx, $mColor, 500);
}
</style>

57
src/components/order_refund/fixed.vue

@ -0,0 +1,57 @@
<template>
<fixed-bar v-if="isShow">
<view class="order-refund-fixed">
<or-button @click="$emit('click:button')"></or-button>
</view>
</fixed-bar>
</template>
<script>
import fixedBar from "../fixed_bar/fixed_bar.vue";
import orButton from "./button.vue";
import { mapState } from 'vuex';
/**
* 全部订单都能退两次, 所有订单最多只能退2次款
* 只要订单金额是未全退的都能退
* 0元订单不能退
*
*/
export default {
components: {
fixedBar,
orButton
},
props: [ 'pay_amount', 'refund_amount', 'refund_times' ],
computed: {
...mapState([ 'brandInfo' ]),
payAmount(){
let { pay_amount } = this;
return +pay_amount || 0
},
refundAmount(){
let { refund_amount } = this;
return +refund_amount || 0
},
isShow(){
console.log('brandInfo', this.brandInfo)
let { payAmount, refundAmount, refund_times, brandInfo } = this;
if(
payAmount - refundAmount > 0
&&[0, 1].includes(refund_times)
&&brandInfo?.permission?.['1018'] // 退
){
return true
}
return false
}
},
}
</script>
<style lang="scss">
.order-refund-fixed{
padding: 10upx 24upx;
background: #F2F2F7;
@include ctf(flex-end);
}
</style>

56
src/components/order_refund/info.vue

@ -0,0 +1,56 @@
<template>
<view class="refund-info">
<view class="ri-name">退款信息{{ nameKey || '' }}</view>
<view class="ri-line">
<view class="ri-name">退款金额</view>
<view class="ri-value">{{ refund_price }}</view>
</view>
<view class="ri-line">
<view class="ri-name">退款单号</view>
<view class="ri-value">{{ refund_no }}</view>
</view>
<view class="ri-line">
<view class="ri-name">退款时间</view>
<view class="ri-value">{{ refund_time }}</view>
</view>
<view class="ri-line">
<view class="ri-name">退款原因</view>
<view class="ri-value">{{ refund_reason }}</view>
</view>
</view>
</template>
<script>
export default {
props: {
nameKey: { default: '' },
refund_price: { default: '-' },
refund_no: { default: '-' },
refund_time: { default: '-' },
refund_reason: { default: '-' },
}
}
</script>
<style lang="scss">
.refund-info{
padding: 30upx;
border-radius: 10upx;
background: #fff;
.ri-name{
flex-shrink: 0;
@include flcw(28upx, 40upx, #9C9C9F);
&+.ri-line{
margin-top: 16upx;
}
}
.ri-line{
@include ctf(space-between);
.ri-value{
flex-grow: 1;
@include flcw(28upx, 60upx, #1A1A1A);
@include tHide;
}
}
}
</style>

231
src/components/order_refund/modal.vue

@ -0,0 +1,231 @@
<template>
<view class="order-refund-modal">
<view class="orm-mask" v-show="isShow">
<view class="om-content">
<image class="oc-close" mode="aspectFit" src="../../static/images/icon/x_close.png" @click="hide"></image>
<view class="oc-title">退款</view>
<view class="oc-section">
<view class="os-info">
<view class="oi-name">{{ refundInfo.stadium_name || '' }}</view>
<view class="oi-line">订单编号{{ refundInfo.order_no || '' }}</view>
<view class="oi-line">手机号码{{ refundInfo.mobile || '' }}</view>
<view class="os-ipts">
<view class="oi-item">
<view class="oi-name">
<text class="on-txt">*</text>
退款金额
</view>
<view class="oi-right">
<input
class="or-ipt"
type="digit"
v-model="iptInfo.refund_amount"
:disabled="refundInfo.refund_times > 0"
:class="{ 'or-disabled': refundInfo.refund_times > 0 }"
/>
<view class="or-tip">可退{{ refundInfo.refundable_amount || 0 }}</view>
</view>
</view>
<view class="oi-item">
<view class="oi-name">
<text class="on-txt">*</text>
退款积分
</view>
<view class="oi-right">
<input
class="or-ipt" type="digit"
v-model="iptInfo.refund_integral"
:disabled="refundInfo.refund_times > 0"
:class="{ 'or-disabled': refundInfo.refund_times > 0 }"
/>
<view class="or-tip">可退{{ refundInfo.refundable_integral || 0 }}积分</view>
</view>
</view>
</view>
</view>
</view>
<view class="oc-btns">
<view class="ob-item" @click="cancelBtn">取消</view>
<view class="ob-item" @click="confirmBtn">确认</view>
</view>
</view>
</view>
</view>
</template>
<script>
/**
* PM:
* 什么状态下都能退
* 全部订单都能退两次, 所有订单最多只能退2次款
* 只要订单金额是未全退的都能退
* 0元订单不能退
*
*/
import { mapState } from 'vuex';
import { showModal } from '@/utils/util';
export default {
computed: {
...mapState([ 'brandInfo' ])
},
data() {
return {
isShow: false,
refundInfo: {
/**
* @param {String} stadium_name 店铺名称
* @param {String} order_no 订单编号
* @param {String} mobile 手机号码
* @param {String} refundable_amount 退款金额
* @param {String} refundable_integral 退款积分
* @param {Number} refund_times 退款次数
* @param {Function} cancel 取消回调
* @param {Function} confirm 确认回调
*/
},
iptInfo: {
refund_amount: '',
refund_integral: ''
}
}
},
methods: {
show(initData){
let { brandInfo } = this;
if(brandInfo?.permission?.['1018']){
this.isShow = true;
this.init(initData);
}else{
showModal({
content: '您没有退款权限',
})
}
},
init(data){
this.iptInfo.refund_amount = data?.refundable_amount || '0';
this.iptInfo.refund_integral = data?.refundable_integral || '0';
this.refundInfo = data;
},
hide(){
this.isShow = false;
},
cancelBtn() {
this.hide();
this.$emit('click:cancel');
this.refundInfo?.cancel?.(0);
},
confirmBtn() {
let { iptInfo, refundInfo } = this;
this.$emit('click:confirm');
this.refundInfo?.confirm?.(iptInfo);
this.hide();
}
}
}
</script>
<style lang="scss">
.order-refund-modal{}
.orm-mask{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,.5);
z-index: 10;
}
.om-content{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding-bottom: 80upx;
width: 620upx;
border-radius: 10px;
background: #fff;
.oc-close{
position: absolute;
top: 30upx;
right: 30upx;
width: 34upx;
height: 34upx;
}
.oc-title{
padding-top: 78upx;
text-align: center;
@include flcw(32upx, 44upx, #333, 500);
}
.oc-section{
padding: 30upx 30upx 0;
@include ctf(center);
.os-info{
.oi-name{
@include flcw(28upx, 48upx, #333);
}
.oi-line{
@include flcw(28upx, 48upx, #9C9C9F);
}
.os-ipts{
padding-top: 34upx;
.oi-item{
display: flex;
align-items: flex-start;
.oi-name{
@include flcw(28upx, 56upx, #333333);
.on-txt{
color: #EA5061;
}
}
.oi-right{
margin-left: 16upx;
flex-shrink: 0;
width: 312upx;
.or-ipt{
display: block;
box-sizing: border-box;
padding: 0 20upx;
width: 100%;
height: 56upx;
border-radius: 10upx;
border: 2upx solid #D8D8D8;
@include flcw(28upx, 48upx, #9C9C9F);
&.or-disabled{
background: #cecece;
color: #9C9C9F;
}
}
.or-tip{
padding-left: 8upx;
@include flcw(24upx, 48upx, #EA5061);
@include tHide;
}
}
}
}
}
}
.oc-btns{
margin-top: 32upx;
padding: 0 54upx;
@include ctf(space-between);
.ob-item{
width: 240upx;
height: 88upx;
text-align: center;
border: 2upx solid $mColor;
border-radius: 10upx;
@include flcw(32upx, 84upx, $mColor, 500);
&+.ob-item{
background: $mColor;
color: #fff;
}
}
}
}
</style>

4
src/components/timing_order/timing_order.vue

@ -80,8 +80,8 @@ export default {
// _query["stadium_id"] = orderInfo.stadium_id // _query["stadium_id"] = orderInfo.stadium_id
// _query["order_no"] = orderInfo.order_no // _query["order_no"] = orderInfo.order_no
// _query["order_type"] = 1 // _query["order_type"] = 1
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}&order_type=1`
util.routeTo(`/subpackage/device/pages/order_details/order_details?${_str}`,'nT');
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}`
util.routeTo(`/subpackage/order/pages/timing/detail?${_str}`,'nT');
// this.$emit('orderDetailChange'); // this.$emit('orderDetailChange');
}, },
timeEndBtn(){ timeEndBtn(){

2
src/js/api.js

@ -152,6 +152,7 @@ API['writeOff'] = {
API['order'] = { API['order'] = {
reservationDetail:`${ORIGIN}/admin/assistant/stadiumOrder/detail`, //k-订单管理-场馆预约订单-预约场馆订单详情/ 次卡订单详情 reservationDetail:`${ORIGIN}/admin/assistant/stadiumOrder/detail`, //k-订单管理-场馆预约订单-预约场馆订单详情/ 次卡订单详情
sessionVerify:`${ORIGIN}/admin/person/number/rule/orderinfo/sessionVerify`, // 次票核销,输入二维码数量核销 sessionVerify:`${ORIGIN}/admin/person/number/rule/orderinfo/sessionVerify`, // 次票核销,输入二维码数量核销
orderRefundList:`${ORIGIN}/admin/stadium/order/refundList`, // 硬件管理(所有的订单)-退款信息列表(包括预订,计时)
} }
// 20240325 后台功能迁移到小程序端 // 20240325 后台功能迁移到小程序端
@ -169,4 +170,3 @@ API['party'] = {
export default { ORIGIN, API }; export default { ORIGIN, API };

6
src/pages.json

@ -634,6 +634,12 @@
"style" : { "style" : {
"navigationBarTitleText": "租球机订单详情" "navigationBarTitleText": "租球机订单详情"
} }
},
{
"path": "pages/timing/detail",
"style" : {
"navigationBarTitleText": "计时订单详情"
}
} }
] ]
}, },

2
src/pages/site/confirm/confirm.vue

@ -94,7 +94,7 @@ export default {
ocPrice: '', ocPrice: '',
ocReaon: '', ocReaon: '',
ocUsage: 1, // 1 -> 2-> 3-> , 4 -> ocUsage: 1, // 1 -> 2-> 3-> , 4 ->
light_up: false,
light_up: true,
usageLs: [ usageLs: [
{ name: '客户订场', type: 1 }, { name: '散客', type: 2 }, { name: '客户订场', type: 1 }, { name: '散客', type: 2 },
{ name: '锁场', type: 3 }, { name: '挂账', type: 4 }, { name: '锁场', type: 3 }, { name: '挂账', type: 4 },

8
src/store/actions.js

@ -13,5 +13,13 @@ export default {
commit('setBrandInfo',res); commit('setBrandInfo',res);
return res; return res;
}) })
},
getOrderRefundList({commit, state}, order_no){
return servers.get({
url: API.order.orderRefundList,
data: { order_no },
isDefaultGet: false
})
} }
} }

3
src/store/index.js

@ -44,7 +44,8 @@ export default new Vuex.Store({
'1014': '储值卡管理', '1014': '储值卡管理',
'1015': '进场人数异常', '1015': '进场人数异常',
'1016': '系统工具', '1016': '系统工具',
'1017': '钱包提现'
'1017': '钱包提现',
'1018': '退款权限'
}, },
// 场地占用提交页面信息 // 场地占用提交页面信息
occupyInfo: { occupyInfo: {

173
src/subpackage/device/components/brand_change_modal.vue

@ -0,0 +1,173 @@
<template>
<view class="brand-change-modal">
<view class="bcm-mask" v-show="isShow">
<view class="bm-content">
<view class="bc-title">品牌切换</view>
<input type="text" class="bc-ipt" v-model="searchTxt" placeholder="模糊搜索..." />
<view class="bc-tip">当前选中{{ curSelected.name || '-' }}</view>
<view class="bc-tip">Tip控件有bug当前选中与下方不匹配时滑动纠正</view>
<picker-view class="bc-picker-view" immediate-change @change="pickerChange">
<picker-view-column>
<view class="bpv-item" v-for="(e, i) in showBrandList" :key="i">{{ e.name || '-' }}</view>
</picker-view-column>
</picker-view>
<view class="bc-btns">
<view class="bb-item" @click="hide">取消</view>
<view class="bb-item" @click="confirm">确认</view>
</view>
</view>
</view>
</view>
</template>
<script>
import util from '@/utils/util';
import deviceServer from '../js/device_server';
import deviceApi from '../js/device_api';
import PinyinEngine from "pinyin-engine";
export default {
data(){
return {
isShow: false,
searchTxt: '',
brandList: [],
initOptions: {},
pickerIdx: 0,
pyEngine: null,
}
},
computed: {
showBrandList(){
let { brandList, searchTxt, pyEngine } = this;
if(searchTxt&&pyEngine?.query){
let _ls = pyEngine.query(searchTxt);
return _ls || [];
}
return brandList.filter(item=>{
return item.name.includes(searchTxt);
});
},
curSelected(){
let { pickerIdx, showBrandList } = this;
return showBrandList?.[pickerIdx] || {};
}
},
mounted(){
// this.getBrandList();
},
methods: {
confirm(){
let { pickerIdx, showBrandList, initOptions } = this;
console.log('pickerIdx', pickerIdx);
console.log('showBrandList', showBrandList);
this.hide();
if(showBrandList?.length <= 0) return;
let _brand = showBrandList[pickerIdx];
initOptions?.success?.(_brand);
this.$emit('click:confirm', _brand);
},
pickerChange(e){
this.pickerIdx = e?.detail?.value?.[0];
},
async init(options){
if(this.brandList?.length <= 0) await this.getBrandList();
this.initOptions = options;
this.show();
},
show(){
this.isShow = true;
},
hide(){
this.isShow = false;
},
//
getBrandList(){
util.showLoad();
return deviceServer.get({
url: deviceApi.brandList,
data: {},
failMsg: '加载品牌列表失败!'
})
.then(res=>{
util.hideLoad();
let _ls = res || [];
this.brandList = _ls;
if(_ls?.length > 0&&PinyinEngine){
this.pyEngine = new PinyinEngine(_ls, ['name']);
}
})
.catch(util.hideLoad)
},
}
}
</script>
<style lang="scss">
.bcm-mask{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 10;
.bm-content{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 40upx;
width: 620upx;
border-radius: 10px;
background-color: #fff;
}
.bc-title{
text-align: center;
@include flcw(32upx, 44upx, #1a1a1a, 500);
}
.bc-tip{
margin-top: 10upx;
@include flcw(20upx, 30upx, #9A9A9D);
}
.bc-ipt{
box-sizing: border-box;
margin-top: 38upx;
padding: 0 20upx;
height: 88upx;
border-radius: 10upx;
border: 2upx solid #d8d8d8;
@include flcw(28upx, 40upx, #1a1a1a, 500);
}
.bc-picker-view{
margin-top: 20upx;
width: 100%;
height: 300upx;
.bpv-item{
font-size: 28upx;
color: #1a1a1a;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
.bc-btns{
margin-top: 30upx;
@include ctf(space-between);
.bb-item{
width: 240upx;
height: 88upx;
border-radius: 10upx;
border: 2upx solid $mColor;
text-align: center;
@include flcw(32upx, 84upx, $mColor, 500);
&+.bb-item{
background: $mColor;
color: #fff;
}
}
}
}
</style>

30
src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue

@ -161,6 +161,26 @@
<view>微信交易号<text>{{orderInfo.trade_no || ''}}</text></view> <view>微信交易号<text>{{orderInfo.trade_no || ''}}</text></view>
</view> </view>
</view> </view>
<!-- 退款列表 -->
<view v-for="(e, i) in orderInfo.refunds" :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>
<!-- 退款按钮 -->
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="(orderInfo.refunds&&orderInfo.refunds.length) || 0"
@click:button="refunndBtn"
></order-refund-fixed>
<!-- 弹框 绑定ic卡 --> <!-- 弹框 绑定ic卡 -->
<view class="ox-dark-mask" v-if="isShowBindIC" @touchmove.stop.prevent="moveHandle"> <view class="ox-dark-mask" v-if="isShowBindIC" @touchmove.stop.prevent="moveHandle">
<view class="odm-ic-modal"> <view class="odm-ic-modal">
@ -237,7 +257,13 @@ import util from '@/utils/util';
import deviceServer from '../../../js/device_server'; import deviceServer from '../../../js/device_server';
import deviceApi from '../../../js/device_api'; import deviceApi from '../../../js/device_api';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
import orderRefundInfo from '@/components/order_refund/info.vue';
export default { export default {
components: {
'order-refund-fixed': orderRefundFixed,
'order-refund-info': orderRefundInfo,
},
props: { props: {
orderInfo: { orderInfo: {
type: Object, type: Object,
@ -592,6 +618,10 @@ export default {
this.isShowSuccessIC = !this.isShowSuccessIC this.isShowSuccessIC = !this.isShowSuccessIC
this.$emit('okChange'); this.$emit('okChange');
}, },
refunndBtn(){
// this.$emit('refundbtn');
this.$emit('click:refund');
}
} }
} }

42
src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue

@ -98,6 +98,12 @@
<view>优惠券优惠</view> <view>优惠券优惠</view>
<view>-¥{{orderInfo.coupons_amount || 0}}</view> <view>-¥{{orderInfo.coupons_amount || 0}}</view>
</view> </view>
<view class="rs-line"
v-if="orderInfo.extension&&orderInfo.extension.meituan_args&&orderInfo.extension.meituan_args.meituan_coupon_deduction_amount"
>
<view>团购券抵扣</view>
<view>-¥{{ orderInfo.extension.meituan_args.meituan_coupon_deduction_amount || 0}}</view>
</view>
</view> </view>
<view class="rb-total"> <view class="rb-total">
<view>合计支付<text></text><text>{{orderInfo.pay_amount || 0}}</text></view> <view>合计支付<text></text><text>{{orderInfo.pay_amount || 0}}</text></view>
@ -135,14 +141,35 @@
</view> </view>
</view> </view>
<!-- 2022/01/04 PM: 禁用退款功能 -->
<!-- <view class="rs-btn" @click="refunndBtn" v-if="orderInfo.pay_status == 1 || orderInfo.pay_status == 2">退款</view> -->
<!-- 退款列表 -->
<view v-for="(e, i) in orderInfo.refunds" :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>
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="(orderInfo.refunds&&orderInfo.refunds.length) || 0"
@click:button="refunndBtn"
></order-refund-fixed>
</view> </view>
</template> </template>
<script> <script>
import orderRefundFixed from '@/components/order_refund/fixed.vue';
import orderRefundInfo from '@/components/order_refund/info.vue';
export default { export default {
components: {
'order-refund-fixed': orderRefundFixed,
'order-refund-info': orderRefundInfo
},
props: { props: {
orderInfo: { orderInfo: {
type: Object, type: Object,
@ -191,7 +218,7 @@ export default {
return _obj[`${_status}`] || '-' return _obj[`${_status}`] || '-'
}, },
refunndBtn(){ refunndBtn(){
this.$emit('refundbtn');
this.$emit('click:refund');
} }
} }
@ -344,15 +371,6 @@ export default {
} }
} }
.rs-btn{
margin: 24rpx 24rpx 0 auto;
width: 192upx;
line-height: 88upx;
border-radius: 10upx;
background-color: #fff;
text-align: center;
color: $themeColor;
}
} }

265
src/subpackage/device/components/order/timing_detail/timing_detail.vue

@ -1,265 +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 class="td-box" v-if="orderInfo.pay_status == 4">
<view class="tb-title">退款信息</view>
<view class="tb-line">
<view>退款原因<text>{{orderInfo.refund_reason || '-'}}</text></view>
<view>退款时间<text>{{orderInfo.refund_time || '-'}}</text></view>
<view>退款单号<text>{{orderInfo.refund_no || '-'}}</text></view>
</view>
</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>
<!-- 结束计费弹框 -->
<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 deviceServer from '../../../js/device_server';
import deviceApi from '../../../js/device_api';
import { mapState } from 'vuex';
import end_billing_modal from '../../../../../components/end_billing_modal/end_billing_modal.vue';
export default {
components: {
'end-billing-modal': end_billing_modal,
},
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
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}`] || '-'
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '储值卡支付',
'3': '商家主动结束计费',
}
return _obj[`${status}`] || '-'
}
},
},
data() {
return {
isEndBill: false,
}
},
methods: {
completeBtn(){
this.$emit('completeBtn');
},
timeEndBtn(){
this.$emit('refreshPage');
},
}
}
</script>
<style lang="scss" >
@import '~style/public.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;
background-color: skyblue;
}
>view{
flex-grow: 1;
margin-left: 14rpx;
color: #333333;
font-size: 28rpx;
}
}
.th-line{
margin-top: 8rpx;
@include centerFlex(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: #009874;
}
}
}
}
}
.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 centerFlex(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 centerFlex(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;
border-radius: 10rpx;
background-color: #009874;
color: #FFF;
font-size: 32rpx;
line-height: 112rpx;
text-align: center;
}
}
</style>

56
src/subpackage/device/pages/index/index.vue

@ -37,13 +37,12 @@
hover-class="hover-active" hover-class="hover-active"
@click="restartBtn" @click="restartBtn"
>重启</view> >重启</view>
<picker mode="selector" :range="brandList" range-key="name" @change="brandChange">
<view
v-if="isBrandSwitch"
class="ic-btn select-brand"
hover-class="hover-active"
>切换品牌</view>
</picker>
<view
v-if="isBrandSwitch"
class="ic-btn select-brand"
hover-class="hover-active"
@click="interiorBrandSwitch"
>切换品牌</view>
</view> </view>
</view> </view>
@ -60,6 +59,8 @@
</view> </view>
</view> </view>
<brand-change-modal ref="brandChangeModal" ></brand-change-modal>
</view> </view>
</template> </template>
@ -68,7 +69,7 @@ import util from '../../../../utils/util';
import store_name from '../../components/store_name/store_name'; import store_name from '../../components/store_name/store_name';
import deviceServer from '../../js/device_server'; import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api'; import deviceApi from '../../js/device_api';
import brandChangeModal from "../../components/brand_change_modal.vue";
const rootPage = '/subpackage/device' const rootPage = '/subpackage/device'
const tabArr = [ const tabArr = [
{id: 1, name: '照明', path: `/pages/switch_manage/switch_manage`}, {id: 1, name: '照明', path: `/pages/switch_manage/switch_manage`},
@ -94,7 +95,8 @@ const tabArr = [
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
components: { components: {
'store-name': store_name
'store-name': store_name,
'brand-change-modal': brandChangeModal,
}, },
computed: { computed: {
...mapState({ ...mapState({
@ -120,16 +122,14 @@ export default {
}, },
watch: { watch: {
async curStoreInfo(nw, od){ async curStoreInfo(nw, od){
util.hideLoad();
this.getOuxuanacInfo(nw.device_name); this.getOuxuanacInfo(nw.device_name);
this.getHardwareTypeList(nw.id); this.getHardwareTypeList(nw.id);
this.updateAC(nw.device_name); this.updateAC(nw.device_name);
console.log('curStoreInfo', nw, od);
},
isBrandSwitch(nw, od){
if(nw)this.getBrandList();
}, },
switchBrandInfo(nw, od){ switchBrandInfo(nw, od){
if(nw?.id === od?.id)return; if(nw?.id === od?.id)return;
util.showLoad();
let { brandInfo } = this; let { brandInfo } = this;
this.$store.commit('setBrandInfo', { ...brandInfo, brand: nw }); this.$store.commit('setBrandInfo', { ...brandInfo, brand: nw });
this.$store.dispatch('getStoreList', { storeChange: true }); this.$store.dispatch('getStoreList', { storeChange: true });
@ -146,7 +146,6 @@ export default {
}, },
oxAcInfo: {}, oxAcInfo: {},
isBrandSwitch: false, isBrandSwitch: false,
brandList: [],
switchBrandInfo: {}, switchBrandInfo: {},
} }
}, },
@ -175,25 +174,18 @@ export default {
this.initSysBarInfo(); this.initSysBarInfo();
}, },
methods: { methods: {
//
brandChange(e){
let { brandList } = this;
let { value } = e.detail;
this.switchBrandInfo = brandList?.[value] || {};
this.getBrandInfo(brandList?.[value]?.id);
},
//
getBrandList(){
return deviceServer.get({
url: deviceApi.brandList,
data: {},
failMsg: '加载品牌列表失败!'
})
.then(res=>{
console.log('getBrandList --->', res);
this.brandList = res || [];
})
interiorBrandSwitch(){
let { isBrandSwitch } = this;
if(!isBrandSwitch)return;
this.$refs.brandChangeModal.init({
success: e=>{
if(!e?.id)return;
this.switchBrandInfo = { ...e };
this.getBrandInfo(e.id);
}
});
}, },
getBrandInfo(bid){ getBrandInfo(bid){
return deviceServer.get({ return deviceServer.get({
url: deviceApi.brandInfo + `/${bid}`, url: deviceApi.brandInfo + `/${bid}`,

212
src/subpackage/device/pages/order_details/order_details.vue

@ -2,67 +2,56 @@
<view class="order-details"> <view class="order-details">
<block v-if="optionsQuery.order_type==3"> <block v-if="optionsQuery.order_type==3">
<!-- pageInfo.order_type 场次(0)/人次(1) --> <!-- pageInfo.order_type 场次(0)/人次(1) -->
<reservation-site-detail :orderInfo="pageInfo" v-if="pageInfo.order_type == 0" @refundbtn='refundBtn' ></reservation-site-detail>
<reservation-site-detail
v-if="pageInfo.order_type == 0"
:orderInfo="pageInfo"
@click:refund="siteAndPeopleDetailRefund"
></reservation-site-detail>
<reservation-people-detail <reservation-people-detail
v-if="pageInfo.order_type == 1" v-if="pageInfo.order_type == 1"
:orderInfo="pageInfo" :orderInfo="pageInfo"
@recoverBtn="peopleRecoverBtn" @recoverBtn="peopleRecoverBtn"
@okChange="okChange" @okChange="okChange"
@verify="verifyBtn" @verify="verifyBtn"
@click:refund="siteAndPeopleDetailRefund"
></reservation-people-detail> ></reservation-people-detail>
</block> </block>
<timing-detail :orderInfo="pageInfo" @completeBtn="completeBtn" @refreshPage="refreshPage" v-if="optionsQuery.order_type==1"></timing-detail>
<organize-detail :orderInfo="pageInfo" v-if="optionsQuery.order_type==10"></organize-detail> <organize-detail :orderInfo="pageInfo" v-if="optionsQuery.order_type==10"></organize-detail>
<!-- 次卡订场退款弹窗 -->
<view class="refund-mask" v-if="isOrderRefund" @click="isOrderRefund = false">
<view class="rm-content" @click.stop="_=>false">
<view class="rc-tit">退款</view>
<view class="rc-info">
<view class="ri-view">{{ pageInfo.stadium_name || '-' }}</view>
<view class="ri-view">订单编号{{ pageInfo.order_no || '-' }}</view>
<view class="ri-view">手机号码{{ pageInfo.mobile || '-' }}</view>
</view>
<view class="rc-price">
<view class="rp-name"><text class="rn-txt">*</text>退款金额</view>
<view class="rp-frame">
<input class="rf-ipt" v-model="refundPrice" type="digit" placeholder="请输入金额" />
</view>
<view class="rp-tip">最多可退{{ (pageInfo.extension&&pageInfo.extension.refundable_amount) || 0 }}</view>
</view>
<view class="ri-btn" @click="confirmRefund">确认退款</view>
</view>
</view>
<!-- 次票核销弹窗 --> <!-- 次票核销弹窗 -->
<ticket-check <ticket-check
ref="ticketCheckModal" ref="ticketCheckModal"
@confirm="verifyConfirm" @confirm="verifyConfirm"
></ticket-check> ></ticket-check>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view> </view>
</template> </template>
<script> <script>
import timingDetail from '../../components/order/timing_detail/timing_detail.vue'
import reservationSiteDetail from '../../components/order/reservation_site_detail/reservation_site_detail.vue'; import reservationSiteDetail from '../../components/order/reservation_site_detail/reservation_site_detail.vue';
import reservationPeopleDetail from '../../components/order/reservation_people_detail/reservation_people_detail.vue'; import reservationPeopleDetail from '../../components/order/reservation_people_detail/reservation_people_detail.vue';
import organizeDetail from '../../components/order/organize_detail/organize_detail.vue'; import organizeDetail from '../../components/order/organize_detail/organize_detail.vue';
import ticket_check from '../../../../components/order_list/modal/ticket_check.vue'; import ticket_check from '../../../../components/order_list/modal/ticket_check.vue';
import orderRefundModal from '../../../../components/order_refund/modal.vue';
import util from '../../../../utils/util'; import util from '../../../../utils/util';
import deviceServer from '../../js/device_server'; import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api'; import deviceApi from '../../js/device_api';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
export default { export default {
components: { components: {
'timing-detail': timingDetail,
'reservation-site-detail': reservationSiteDetail, 'reservation-site-detail': reservationSiteDetail,
'reservation-people-detail': reservationPeopleDetail, 'reservation-people-detail': reservationPeopleDetail,
'organize-detail': organizeDetail, 'organize-detail': organizeDetail,
'ticket-check': ticket_check, 'ticket-check': ticket_check,
'order-refund-modal': orderRefundModal,
}, },
computed:{ computed:{
titleName(){ titleName(){
let { optionsQuery } = this; let { optionsQuery } = this;
if(optionsQuery.order_type == 1)return '计时订单详情'; //PM: 2021/4/19
if(optionsQuery.order_type == 3)return '预约订单详情'; //PM: 2021/4/19 if(optionsQuery.order_type == 3)return '预约订单详情'; //PM: 2021/4/19
if(optionsQuery.order_type == 4)return '储值卡订单详情'; if(optionsQuery.order_type == 4)return '储值卡订单详情';
if(optionsQuery.order_type == 5)return '积分商城订单详情'; if(optionsQuery.order_type == 5)return '积分商城订单详情';
@ -78,11 +67,6 @@
order_type: -1, order_type: -1,
}, },
pageInfo: {}, pageInfo: {},
// /退 ---
isOrderRefund: false,
refundPrice: '',
// /退 ---
} }
}, },
onLoad(options) { onLoad(options) {
@ -99,6 +83,44 @@
}) })
}, },
methods: { methods: {
// /-退
siteAndPeopleDetailRefund(){
let { pageInfo } = this;
this.$refs.orderRefundModal.show({
stadium_name: pageInfo?.stadium_name ?? '',
order_no: pageInfo?.order_no ?? '',
mobile: pageInfo?.mobile ?? '',
refundable_amount: pageInfo?.extension?.refundable_amount ?? 0,
refundable_integral: pageInfo?.extension?.refundable_integral ?? 0,
refund_times: pageInfo?.refunds?.length ?? 0,
confirm: e => {
this.siteAndPeopleRefund({
order_no: pageInfo?.order_no ?? '',
amount: e?.refund_amount || 0,
integral: e?.refund_integral || 0,
})
}
});
},
// -退(/)
siteAndPeopleRefund({ order_no = '', amount = 0, integral = 0}){
util.showLoad();
deviceServer.get({
url: deviceApi.orderRefund,
data: { order_no, amount, integral },
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setTimeout(this.refreshPage, 1200);
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
},
verifyConfirm(){ verifyConfirm(){
let { optionsQuery } = this; let { optionsQuery } = this;
this.getPageInfo({ this.getPageInfo({
@ -116,40 +138,17 @@
}, },
refreshPage(){ refreshPage(){
let { optionsQuery } = this; let { optionsQuery } = this;
this.isOrderRefund = false;
this.refundPrice = '';
this.getPageInfo({ this.getPageInfo({
orderType: optionsQuery.order_type, orderType: optionsQuery.order_type,
stadium_id: optionsQuery.stadium_id, stadium_id: optionsQuery.stadium_id,
order_no: optionsQuery.order_no, order_no: optionsQuery.order_no,
}) })
}, },
refundBtn(){
this.isOrderRefund = true;
},
confirmRefund: util.debounce(function(){
let { pageInfo, refundPrice } = this;
deviceServer.get({
url: deviceApi.orderRefund,
data: { order_no: pageInfo.order_no || '', amount: refundPrice || 0, integral: 0 }, // integral 0
isDefaultGet: false
})
.then(res=>{
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setTimeout(this.refreshPage, 1200);
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
}, 300, true),
// //
peopleRecoverBtn(){ peopleRecoverBtn(){
this.okChange(); // this.okChange(); //
}, },
getApiUrl(type){ getApiUrl(type){
if(type == 1)return deviceApi.timeOrderDetail;
if(type == 3)return deviceApi.reservationDetail; if(type == 3)return deviceApi.reservationDetail;
if(type == 10)return deviceApi.organizeOrderDetail; if(type == 10)return deviceApi.organizeOrderDetail;
@ -183,38 +182,6 @@
order_no: optionsQuery.order_no, order_no: optionsQuery.order_no,
}) })
}, },
// -
completeBtn(){
let { pageInfo } = this
util.showModal({
title: '提示',
content: '是否确认完结订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm){
util.showLoad();
deviceServer.get({
url: deviceApi.timeOrderComplete, //
data: {
brand_id: pageInfo.brand_id,
order_no: pageInfo.order_no,
},
failMsg: '请求失败!'
})
.then(res=>{
util.hideLoad();
util.showNone('操作成功!');
this.refreshPage()
util.previousPageFunction({
fnName: 'refreshList',
query: { isLoad: false},
});
})
}
}
})
},
} }
} }
</script> </script>
@ -225,82 +192,5 @@
} }
.refund-mask{
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background-color: rgba($color: #000, $alpha: .5);
.rm-content{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
padding: 80upx;
background-color: #fff;
width: 620upx;
border-radius: 10upx;
.rc-tit{
margin-bottom: 30upx;
text-align: center;
font-size: 32upx;
font-weight: 500;
color: #1A1A1A;
}
.rc-info{
margin-bottom: 34upx;
.ri-view{
line-height: 40upx;
font-size: 28upx;
color: #9C9C9F;
@include textHide(1);
&:first-child{
font-weight: 500;
color: #1A1A1A;
}
}
}
.rc-price{
margin-bottom: 32upx;
.rp-name{
margin-bottom: 8upx;
font-size: 28upx;
line-height: 48upx;
color: #1A1A1A;
.rn-txt{
color: #EA5061;
}
}
.rp-frame{
padding: 0 20upx;
height: 88upx;
border-radius: 10upx;
border: 2upx solid #D8D8D8;
.rf-ipt{
width: 100%;
height: 100%;
font-size: 28upx;
color: #1A1A1A;
}
}
.rp-tip{
font-size: 24upx;
color: #EA5061;
}
}
.ri-btn{
margin: 0 auto;
width: 240upx;
line-height: 88upx;
text-align: center;
border-radius: 10upx;
font-size: 32upx;
font-weight: 500;
color: #fff;
background-color: $themeColor;
}
}
}
</style> </style>

6
src/subpackage/order/js/api.js

@ -42,6 +42,12 @@ export const ORDER_API = {
billingOrderDetail: `${ORIGIN}/admin/stadium/billing/order/detail`, // 散客计时订单详情 billingOrderDetail: `${ORIGIN}/admin/stadium/billing/order/detail`, // 散客计时订单详情
timeOrderEnd: `${ORIGIN}/admin/assistant/timeOrder/end`, //k-订单管理-订单计时结束 timeOrderEnd: `${ORIGIN}/admin/assistant/timeOrder/end`, //k-订单管理-订单计时结束
timeOrderComplete:`${ORIGIN}/admin/assistant/timeOrder/complete`, //【20220208】k-订单管理-计时订单完结 timeOrderComplete:`${ORIGIN}/admin/assistant/timeOrder/complete`, //【20220208】k-订单管理-计时订单完结
// 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`, // 年月卡订单-订单退款
} }
export default ORDER_API; export default ORDER_API;

110
src/subpackage/order/pages/curriculum/detail/detail.vue

@ -86,21 +86,29 @@
<a-line :value="orderInfo.trade_no || '-'"> <a-line :value="orderInfo.trade_no || '-'">
<block slot="name">交易流水</block> <block slot="name">交易流水</block>
</a-line> </a-line>
<block v-if="orderInfo.order_status == 3">
<a-line :value="orderInfo.refund_no || '-'">
<block slot="name">退款单号</block>
</a-line>
<a-line :value="orderInfo.refund_time || '-'">
<block slot="name">退款时间</block>
</a-line>
<a-line :value="'¥' + (orderInfo.refund_amount || '0')">
<block slot="name">退款金额</block>
</a-line>
</block>
</view> </view>
<!-- 退款列表 -->
<view v-for="(e, i) in refundList" :key="i" style="padding: 0 0 24rpx;">
<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>
<!-- 课程订单只支持一次退款refund_times 写死为1间接 -->
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="refundTimes"
@click:button="refunndBtn"
></order-refund-fixed>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view> </view>
</template> </template>
@ -109,50 +117,104 @@ import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import util from '../../../../../utils/util'; import util from '../../../../../utils/util';
import { ORDER_API } from '../../../js/api'; import { ORDER_API } from '../../../js/api';
import server from '../../../js/server'; import server from '../../../js/server';
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 { export default {
computed: { computed: {
course_period_nums_give(){ course_period_nums_give(){
let { orderInfo } = this; let { orderInfo } = this;
let _num = orderInfo.course_period_nums_give || 0; let _num = orderInfo.course_period_nums_give || 0;
return (_num + '').replace('-', '') return (_num + '').replace('-', '')
},
refundTimes(){
// 退refund_times + 1
let _num = this.refundList?.length || 0;
return _num + 1;
} }
}, },
// (' 0- 1- 2- 3-退 4-') // (' 0- 1- 2- 3-退 4-')
components: { components: {
'a-line': a_line, 'a-line': a_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
}, },
data(){ data(){
return { return {
orderInfo: { orderInfo: {
user_info: {} user_info: {}
}
},
refundList: [], // 退
} }
}, },
onLoad(options){ onLoad(options){
this.getInfo(options.order_no); this.getInfo(options.order_no);
this.getRefundTimes(options.order_no);
}, },
methods: { methods: {
refunndBtn(){
let { orderInfo, refundTimes } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.extension?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.student_phone ?? '',
refundable_amount: orderInfo?.extension?.refundable_amount ?? 0,
refundable_integral: orderInfo?.extension?.refundable_integral ?? 0,
refund_times: refundTimes,
confirm: e => {
this.venueCourseOrderRefund({
order_no: orderInfo?.order_no ?? '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0
})
}
});
},
venueCourseOrderRefund({ order_no = '', amount = 0, integral = 0}){
util.showLoad();
server.get({
url: ORDER_API.venueCourseOrderRefund,
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.getInfo(order_no);
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);
}
},
getInfo(order_no){ getInfo(order_no){
util.showLoad();
server.get({ server.get({
url: ORDER_API.venueCourse_orderInfo, url: ORDER_API.venueCourse_orderInfo,
data: { order_no }, data: { order_no },
failMsg: '加载失败!' failMsg: '加载失败!'
}) })
.then(res=>{ .then(res=>{
util.hideLoad();
this.orderInfo = res || {}; this.orderInfo = res || {};
}) })
.catch(util.hideLoad)
}, },
getPayType: util.order_pay_type_txt, getPayType: util.order_pay_type_txt,
// getPayType(type){
// // [012, 3]
// let _obj = {
// 0: '',
// 1: '',
// 2: '',
// 3: '',
// }
// return _obj[type] || '-'
// }
} }
} }
</script> </script>

434
src/subpackage/order/pages/retail/detail/detail.vue

@ -2,36 +2,36 @@
<view class="retail-container"> <view class="retail-container">
<view class="rc-header"> <view class="rc-header">
<view class="ra-header"> <view class="ra-header">
<image mode="aspectFit" src="/static/images/icon/retail/storeIcon.png"></image>
<text>{{ orderInfo.stadium_name || '-' }}</text>
<view></view>
</view>
<view class="rh-name">
<view class="rh-name-line">
<view>
<view>微信昵称</view>
<text>{{ orderInfo.nickname || '-' }}</text>
</view>
<view :style="{color:getStatus(orderInfo.pay_status)==='已退款'?'#EA5061':'#9C9C9F'}">{{ getStatus(orderInfo.pay_status) }}</view>
</view>
<view class="rh-name-line">
<view>
<view>手机号码</view>
<text>{{ orderInfo.mobile || '-' }}</text>
</view>
</view>
<!-- <view class="rh-name-line">
<view>
<view>身份</view>
<text>{{ orderInfo.sys_optuname || '-' }}</text>
</view>
</view> -->
<view class="rh-name-line">
<view>
<view>下单途径</view>
<text>{{ orderInfo.retail_source || '-' }}</text>
</view>
</view>
<image mode="aspectFit" src="/static/images/icon/retail/storeIcon.png"></image>
<text>{{ orderInfo.stadium_name || '-' }}</text>
<view></view>
</view>
<view class="rh-name">
<view class="rh-name-line">
<view>
<view>微信昵称</view>
<text>{{ orderInfo.nickname || '-' }}</text>
</view>
<view :style="{color:getStatus(orderInfo.pay_status)==='已退款'?'#EA5061':'#9C9C9F'}">{{ getStatus(orderInfo.pay_status) }}</view>
</view>
<view class="rh-name-line">
<view>
<view>手机号码</view>
<text>{{ orderInfo.mobile || '-' }}</text>
</view>
</view>
<!-- <view class="rh-name-line">
<view>
<view>身份</view>
<text>{{ orderInfo.sys_optuname || '-' }}</text>
</view>
</view> -->
<view class="rh-name-line">
<view>
<view>下单途径</view>
<text>{{ orderInfo.retail_source || '-' }}</text>
</view>
</view>
</view> </view>
</view> </view>
<view class="rc-goods-info" v-if="orderInfo.retail_order_goods&&orderInfo.retail_order_goods.length"> <view class="rc-goods-info" v-if="orderInfo.retail_order_goods&&orderInfo.retail_order_goods.length">
@ -39,37 +39,37 @@
<view class="rgi-goods-ls"> <view class="rgi-goods-ls">
<view class="rgl-item" v-for="(e, i) in orderInfo.retail_order_goods" :key="i"> <view class="rgl-item" v-for="(e, i) in orderInfo.retail_order_goods" :key="i">
<view class="rgl-item-desc"> <view class="rgl-item-desc">
<view>{{ e.erp_retail_goods ? (e.erp_retail_goods.goods_name || '-') : (e.name || '-') }}</view>
<view>{{ e.price || 0 }}</view>
</view>
<view class="rgl-item-sku">sku{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_sku : '-') : '-' }}</view>
<view class="rgl-item-type-spec">
<view>型号{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_type : '-') : '-' }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规格{{ e.spec || '-' }}</view>
<text>x{{ e.nums || 0 }}</text>
</view>
<view v-if="orderInfo.retail_order_goods.length - 1 == i ? false : true" class="rgl-item-bottom-line"></view>
<view>{{ e.erp_retail_goods ? (e.erp_retail_goods.goods_name || '-') : (e.name || '-') }}</view>
<view>{{ e.price || 0 }}</view>
</view>
<view class="rgl-item-sku">sku{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_sku : '-') : '-' }}</view>
<view class="rgl-item-type-spec">
<view>型号{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_type : '-') : '-' }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规格{{ e.spec || '-' }}</view>
<text>x{{ e.nums || 0 }}</text>
</view>
<view v-if="orderInfo.retail_order_goods.length - 1 == i ? false : true" class="rgl-item-bottom-line"></view>
</view> </view>
</view> </view>
</view> </view>
<view class="rc-total-amount-info">
<view class="rc-total-amount-line">
<view>金额小计</view>
<text>{{ orderInfo.amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>积分抵扣</view>
<text>{{ orderInfo.deduction_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>折扣金额</view>
<text>-{{ orderInfo.discount_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>优惠券优惠</view>
<text>-{{ orderInfo.coupons_amount || 0 }}</text>
</view>
<view class="rgi-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</view>
<view class="rc-total-amount-info">
<view class="rc-total-amount-line">
<view>金额小计</view>
<text>{{ orderInfo.amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>积分抵扣</view>
<text>{{ orderInfo.deduction_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>折扣金额</view>
<text>-{{ orderInfo.discount_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>优惠券优惠</view>
<text>-{{ orderInfo.coupons_amount || 0 }}</text>
</view> </view>
<view class="rgi-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</view>
</view>
<view class="rc-pay-info"> <view class="rc-pay-info">
<!-- 订单编号 --> <!-- 订单编号 -->
<view class="rpi-tit">支付详情</view> <view class="rpi-tit">支付详情</view>
@ -78,33 +78,28 @@
<p-line :keyname="'支付方式'" :value="orderInfo.extension ? orderInfo.extension.pay_type_text || '-' : '-'"></p-line> <p-line :keyname="'支付方式'" :value="orderInfo.extension ? orderInfo.extension.pay_type_text || '-' : '-'"></p-line>
<p-line :keyname="'支付时间'" :value="orderInfo.pay_time || '-'"></p-line> <p-line :keyname="'支付时间'" :value="orderInfo.pay_time || '-'"></p-line>
</view> </view>
<!-- <view v-if="orderInfo.refunds&&orderInfo.refunds.length">
<view class="rc-refund-info" v-for="(item, index) in orderInfo.refunds" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="item.refund_amount ? '¥' + item.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.refund_reason || '-'"></p-line>
</view>
</view> -->
<!-- <view v-if="orderInfo.refund_no">
<view class="rc-refund-info">
<view class="rpi-tit">退款信息</view>
<p-line :keyname="'退款金额:'" :value="orderInfo.refund_amount ? '¥' + orderInfo.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="orderInfo.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="orderInfo.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="orderInfo.refund_reason || '商家主动退款'"></p-line>
</view>
</view> -->
<view v-if="refundList.length">
<view class="rc-refund-info" v-for="(item, index) in refundList" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="`¥${item.amount}`"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.reason || '商家主动退款'"></p-line>
</view>
</view>
<!-- 退款列表 -->
<view v-for="(e, i) in refundList" :key="i" style="padding: 24rpx 0 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>
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="refundList&&refundList.length"
@click:button="refunndBtn"
></order-refund-fixed>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view> </view>
</template> </template>
@ -114,16 +109,22 @@ import server from '../../../js/server';
import util from '../../../../../utils/util'; import util from '../../../../../utils/util';
import s_line from '../../../components/s_line/s_line.vue'; import s_line from '../../../components/s_line/s_line.vue';
import p_line from '../../../components/p_line/p_line.vue'; import p_line from '../../../components/p_line/p_line.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';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
export default { export default {
components: { components: {
's-line': s_line, 's-line': s_line,
'p-line': p_line, 'p-line': p_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
}, },
data(){ data(){
return { return {
orderInfo: {}, orderInfo: {},
refundList: []
refundList: []
} }
}, },
computed:{ computed:{
@ -131,19 +132,74 @@ export default {
}, },
onLoad(options){ onLoad(options){
this.getOrderInfo(options.order_no); this.getOrderInfo(options.order_no);
this.retailOrderInfoRefundList({
order_no: options.order_no,
brand_id: this.brandInfo.brand.id
})
}, },
methods: { 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 || 0,
confirm: e => {
console.log('refund' , e)
// this.venueCourseOrderRefund({
// order_no: orderInfo?.order_no ?? '',
// amount: e.refund_amount || 0,
// integral: e.refund_integral || 0
// })
this.confirmRefundReq({
order_no: orderInfo?.order_no || '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0
})
}
});
},
confirmRefundReq({ order_no = '', amount = 0, integral = 0}){
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 || '操作失败!');
}
})
.then(_=>{
setTimeout(_=>{
let { orderInfo } = this;
this.getOrderInfo(orderInfo?.order_no || '');
this.retailOrderInfoRefundList({
order_no: orderInfo?.order_no || '',
brand_id: orderInfo?.brand_id || ''
})
}, 1200);
})
.catch(util.hideLoad)
},
// payTypeTxt: util.order_pay_type_txt, // payTypeTxt: util.order_pay_type_txt,
payTypeTxt(payType, cardNo) {
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: `储值卡支付 ${cardNo ? '(' + cardNo + ')' : ''}`,
3: '现金支付',
4: '其他'
};
return _obj[payType] || '-'
},
payTypeTxt(payType, cardNo) {
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: `储值卡支付 ${cardNo ? '(' + cardNo + ')' : ''}`,
3: '现金支付',
4: '其他'
};
return _obj[payType] || '-'
},
getStatus(status){ getStatus(status){
let _obj = { let _obj = {
1: '交易成功', 1: '交易成功',
@ -160,21 +216,24 @@ export default {
}) })
.then(res=>{ .then(res=>{
this.orderInfo = res || {}; this.orderInfo = res || {};
// this.orderInfo.refunds = [
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason },
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason }
// ];
server.get({
url: ORDER_API.retailOrderInfoRefundList,
data: { order_no, brand_id: this.brandInfo.brand.id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.refundList = res.list;
});
// this.orderInfo.refunds = [
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason },
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason }
// ];
}); });
}, },
retailOrderInfoRefundList({ order_no, brand_id }){
server.get({
url: ORDER_API.retailOrderInfoRefundList,
data: { order_no, brand_id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.refundList = res?.list || [];
});
}
} }
} }
@ -189,57 +248,57 @@ export default {
margin-bottom: 26upx; margin-bottom: 26upx;
padding: 0 24upx; padding: 0 24upx;
background-color: #fff; background-color: #fff;
.ra-header {
position: relative;
padding: 30upx 0;
@include centerFlex(flex-start);
>image {
width: 32upx;
height: 30upx;
margin-right: 14upx;
}
>text {
font-size: 28upx;
font-weight: 500;
color: #1A1A1A;
.ra-header {
position: relative;
padding: 30upx 0;
@include centerFlex(flex-start);
>image {
width: 32upx;
height: 30upx;
margin-right: 14upx;
}
>text {
font-size: 28upx;
font-weight: 500;
color: #1A1A1A;
}
>view {
position: absolute;
bottom: 0%;
width: 100%;
height: 2upx;
background-color: #D8D8D8;
}
}
.rh-name{
padding: 18upx 0;
.rh-name-line {
@include centerFlex(space-between);
font-size: 28upx;
font-weight: 400;
margin-bottom: 10upx;
>view {
&:first-child {
color: #9C9C9F;
@include centerFlex(flex-start);
flex-grow: 1;
>view {
width: 152upx;
flex-shrink: 0;
}
>text {
color: #1A1A1A;
@include textHide(1);
}
} }
>view {
position: absolute;
bottom: 0%;
width: 100%;
height: 2upx;
background-color: #D8D8D8;
&:nth-child(2) {
flex-shrink: 0;
} }
} }
.rh-name{
padding: 18upx 0;
.rh-name-line {
@include centerFlex(space-between);
font-size: 28upx;
font-weight: 400;
margin-bottom: 10upx;
>view {
&:first-child {
color: #9C9C9F;
@include centerFlex(flex-start);
flex-grow: 1;
>view {
width: 152upx;
flex-shrink: 0;
}
>text {
color: #1A1A1A;
@include textHide(1);
}
}
&:nth-child(2) {
flex-shrink: 0;
}
}
}
}
} }
} }
.rc-goods-info{ .rc-goods-info{
@ -256,32 +315,32 @@ export default {
.rgl-item{ .rgl-item{
padding-top: 30upx; padding-top: 30upx;
// border-bottom: 2upx solid #D8D8D8; // border-bottom: 2upx solid #D8D8D8;
color: #9C9C9F;
font-size: 28upx;
.rgl-item-desc {
display: flex;
justify-content: space-between;
margin-bottom: 20upx;
color: #1A1A1A;
}
.rgl-item-sku {
margin-bottom: 10upx;
}
.rgl-item-type-spec {
display: flex;
justify-content: space-between;
align-items: flex-end;
>text {
color: #1A1A1A;
}
}
.rgl-item-bottom-line {
width: 100%;
height: 2upx;
background-color: #D8D8D8;
margin-top: 18upx;
}
color: #9C9C9F;
font-size: 28upx;
.rgl-item-desc {
display: flex;
justify-content: space-between;
margin-bottom: 20upx;
color: #1A1A1A;
}
.rgl-item-sku {
margin-bottom: 10upx;
}
.rgl-item-type-spec {
display: flex;
justify-content: space-between;
align-items: flex-end;
>text {
color: #1A1A1A;
}
}
.rgl-item-bottom-line {
width: 100%;
height: 2upx;
background-color: #D8D8D8;
margin-top: 18upx;
}
} }
} }
} }
@ -324,15 +383,4 @@ export default {
color: #1A1A1A; color: #1A1A1A;
} }
} }
.rc-refund-info{
padding: 30upx;
margin-top: 24upx;
background-color: #fff;
.rpi-tit{
margin-bottom: 16upx;
line-height: 44upx;
font-size: 28upx;
color: #9C9C9F;
}
}
</style> </style>

85
src/subpackage/order/pages/stored_value_card/detail/detail.vue

@ -65,24 +65,27 @@
</view> </view>
</view> </view>
<view class="svc-box" v-for="(e, i) in orderInfo.refunds" :key="i">
<view class="svc-line">
<view class="sl-txt" style="margin-bottom: 20rpx;"><text>退款信息{{i+1}}</text></view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>退款金额</text>{{ e.amount || 0 }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>退款单号</text>{{ e.refund_no || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>退款时间</text>{{ e.refund_time || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>退款原因</text>{{ e.reason || '-' }}</view>
</view>
</view>
<!-- 退款列表 -->
<view v-for="(e, i) in orderInfo.refunds" :key="i" style="padding: 24upx 0upx 0upx;">
<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>
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="(orderInfo.refunds && orderInfo.refunds.length) || 0"
@click:button="refunndBtn"
></order-refund-fixed>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view> </view>
</template> </template>
@ -91,9 +94,15 @@ import s_line from '../../../components/s_line/s_line.vue';
import { ORDER_API } from '../../../js/api'; import { ORDER_API } from '../../../js/api';
import server from '../../../js/server'; import server from '../../../js/server';
import util from '../../../../../utils/util'; import util from '../../../../../utils/util';
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 { export default {
components: { components: {
's-line': s_line, 's-line': s_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
}, },
computed: { computed: {
cardInfo(){ cardInfo(){
@ -116,6 +125,46 @@ export default {
this.getOrderInfo({ order_no: options.order_no }); this.getOrderInfo({ order_no: options.order_no });
}, },
methods: { methods: {
refunndBtn(){
let { orderInfo } = this;
let _pay_amount = +orderInfo?.pay_amount || 0;
let _refund_amount = +orderInfo?.refund_amount || 0;
let _deduction_integral = +orderInfo?.deduction_integral || 0;
let _refund_integral = +orderInfo?.refund_integral || 0;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.stadium?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: _pay_amount - _refund_amount,
refundable_integral: _deduction_integral - _refund_integral,
refund_times: orderInfo?.refunds?.length || 0,
confirm: e => {
this.userValueCardRefundFixed({
order_no: orderInfo?.order_no ?? '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0
})
}
});
},
userValueCardRefundFixed({ order_no = '', amount = 0, integral = 0}){
util.showLoad();
server.get({
url: ORDER_API.userValueCardRefundFixed,
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 }), 1200));
},
payStatus(status){ payStatus(status){
if(status == 1)return '已付款'; if(status == 1)return '已付款';
if(status == 4)return '已退款'; if(status == 4)return '已退款';

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

@ -0,0 +1,379 @@
<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>

112
src/subpackage/order/pages/ym_card/detail/detail.vue

@ -53,7 +53,30 @@
<p-line :keyname="'创建途径'" :value="orderInfo.source || '-'" ></p-line> <p-line :keyname="'创建途径'" :value="orderInfo.source || '-'" ></p-line>
</view> </view>
<!-- 退款列表 -->
<view v-for="(e, i) in refundList" :key="i">
<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> </view>
<order-refund-fixed
:pay_amount="_extension.refundable_amount || 0"
:refund_amount="0"
:refund_times="(refundList&&refundList.length) || 0"
@click:button="refunndBtn"
></order-refund-fixed>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view> </view>
</template> </template>
@ -67,6 +90,9 @@
import a_line from '../../../../../components/order_list/a_line/a_line.vue'; import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import s_line from '../../../components/s_line/s_line.vue'; import s_line from '../../../components/s_line/s_line.vue';
import p_line from '../../../components/p_line/p_line.vue'; import p_line from '../../../components/p_line/p_line.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';
import util from '../../../../../utils/util'; import util from '../../../../../utils/util';
import { ORDER_API } from '../../../js/api'; import { ORDER_API } from '../../../js/api';
import server from '../../../js/server'; import server from '../../../js/server';
@ -75,7 +101,14 @@ export default {
'a-line': a_line, 'a-line': a_line,
's-line': s_line, 's-line': s_line,
'p-line': p_line, 'p-line': p_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
},
computed: {
_extension(){
return this.orderInfo?.extension || {}
}
}, },
data(){ data(){
return { return {
@ -84,16 +117,79 @@ export default {
extension: {} extension: {}
}, },
optionsQuery: {}, optionsQuery: {},
refundInfo: {},
refundList: []
} }
}, },
onLoad(options){ onLoad(options){
this.getCardInfo({ this.getCardInfo({
id: options.id, id: options.id,
card_no: options.card_no card_no: options.card_no
});
this.optionsQuery = options || {};
})
.then(res=>{
if(res.order_no)this.getRefundInfo(res.order_no || '');
})
this.optionsQuery = options;
}, },
methods: { methods: {
refunndBtn(){
let { orderInfo, _extension, refundList } = this;
this.$refs.orderRefundModal.show({
stadium_name: _extension?.name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: +_extension?.refundable_amount || 0,
refundable_integral: 0,
refund_times: refundList?.length || 0,
confirm: e => {
this.userMonthlyCardRefundFixed({
order_no: orderInfo?.order_no || '',
amount: +e.refund_amount || 0,
integral: +e.refund_integral || 0
});
}
});
},
async getRefundInfo(order_no){
try{
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
let _ls = _refundRes?.data?.data?.list || [];
this.refundList = _ls;
console.log('refundRes', _refundRes);
}catch(err){
console.warn('getRefundTimes err', err);
}
},
// -退
userMonthlyCardRefundFixed({ order_no = '', amount = 0, integral = 0 }){
util.showLoad();
server.post({
url: ORDER_API.userMonthlyCardRefundFixed,
data: { order_no, amount, deduction_integral: 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.getCardInfo({
id: this.optionsQuery?.id,
card_no: this.optionsQuery?.card_no
})
.then(res=>{
if(res.order_no)this.getRefundInfo(res.order_no || '');
})
}, 1200)
);
},
previewImg(url){ previewImg(url){
if(!url)return if(!url)return
uni.previewImage({ urls: [ url ] }); uni.previewImage({ urls: [ url ] });
@ -166,14 +262,18 @@ export default {
}, },
getCardInfo({id, card_no}){ getCardInfo({id, card_no}){
util.showLoad(); util.showLoad();
server.get({
return server.get({
url: ORDER_API.userMonthlyCardInfo, url: ORDER_API.userMonthlyCardInfo,
data: { id, card_no }, data: { id, card_no },
failMsg: '加载失败!' failMsg: '加载失败!'
}) })
.then(res=>{ .then(res=>{
util.hideLoad(); util.hideLoad();
this.orderInfo = res || {};
return this.orderInfo = res || {};
})
.catch(err=>{
util.hideLoad();
console.warn('getCardInfo err', err);
}) })
}, },
toRecord(){ toRecord(){
@ -187,7 +287,7 @@ export default {
<style lang="scss"> <style lang="scss">
@import '~style/public.scss'; @import '~style/public.scss';
.ym-card-info{ .ym-card-info{
@include isPd;
} }
.yci-box{ .yci-box{
padding: 30upx; padding: 30upx;

4
src/utils/util.js

@ -186,7 +186,7 @@ function previousPageFunction({fnName,query}){
} }
// 获取节点信息 // 获取节点信息
function getNodeMes(selector,_this=null){
export function getNodeMes(selector,_this=null){
return new Promise(rs=>{ return new Promise(rs=>{
let query = _this ? uni.createSelectorQuery().in(_this) : uni.createSelectorQuery(); let query = _this ? uni.createSelectorQuery().in(_this) : uni.createSelectorQuery();
query.select(selector).boundingClientRect(res=>{ query.select(selector).boundingClientRect(res=>{
@ -395,7 +395,7 @@ function order_pay_type_txt(status = ''){
0: '微信支付', 0: '微信支付',
1: '支付宝支付', 1: '支付宝支付',
2: '会员卡支付', 2: '会员卡支付',
3: '商家主动',
3: '商家主动结束计费',
}; };
return _obj[status] || '-' return _obj[status] || '-'
} }

21311
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save