刘嘉炜
5 months ago
22 changed files with 10200 additions and 10875 deletions
-
2package.json
-
2src/components/fixed_bar/fixed_bar.vue
-
7src/components/order_refund/modal.vue
-
49src/components/order_refund/permission_btn.vue
-
6src/pages.json
-
3src/store/actions.js
-
2src/subpackage/order/components/order_list/header.vue
-
2src/subpackage/order/js/api.js
-
18src/subpackage/order/pages/order_manage/order_manage.vue
-
23src/subpackage/order/pages/timekeeping/modules/order_detail/bf_button.vue
-
37src/subpackage/order/pages/timekeeping/modules/order_detail/bottom_fixed.vue
-
23src/subpackage/order/pages/timekeeping/modules/order_detail/fixed_button.vue
-
8src/subpackage/order/pages/timekeeping/modules/order_list/site.vue
-
62src/subpackage/order/pages/timekeeping/modules/order_search/search_bar.vue
-
126src/subpackage/order/pages/timekeeping/order_detail/common.js
-
108src/subpackage/order/pages/timekeeping/order_detail/deposit.vue
-
186src/subpackage/order/pages/timekeeping/order_detail/person.vue
-
212src/subpackage/order/pages/timekeeping/order_detail/site.vue
-
44src/subpackage/order/pages/timekeeping/order_list.vue
-
132src/subpackage/order/pages/timekeeping/order_search.vue
-
BINsrc/subpackage/order/static/images/round_close.png
-
20023yarn.lock
@ -0,0 +1,49 @@ |
|||
<template> |
|||
<view class="permissinon-btn"> |
|||
<or-button v-if="isShow" @click="$emit('click:button')"><slot>退款</slot></or-button> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import orButton from "./button.vue"; |
|||
import { mapState } from 'vuex'; |
|||
/** |
|||
* 全部订单都能退两次, 所有订单最多只能退2次款 |
|||
* 只要订单金额是未全退的,都能退 |
|||
* 0元订单不能退 |
|||
* |
|||
*/ |
|||
export default { |
|||
components: { |
|||
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(){ |
|||
let { payAmount, refundAmount, refund_times, brandInfo } = this; |
|||
console.log('brandInfo', payAmount, refundAmount, refund_times, brandInfo) |
|||
if( |
|||
payAmount - refundAmount > 0 |
|||
&&[0, 1].includes(refund_times) |
|||
// &&brandInfo?.permission?.['1018'] // 退款权限 |
|||
){ |
|||
return true |
|||
} |
|||
return false |
|||
} |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
</style> |
@ -1,23 +0,0 @@ |
|||
<template> |
|||
<view class="bf-button"> |
|||
<slot>取消预约</slot> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
|
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.bf-button{ |
|||
padding: 0 32upx; |
|||
display: inline-block; |
|||
min-width: 192upx; |
|||
text-align: center; |
|||
border-radius: 10upx; |
|||
background: #fff; |
|||
@include flcw(32upx, 88upx, $mColor, 500); |
|||
} |
|||
</style> |
@ -1,43 +1,24 @@ |
|||
<template> |
|||
<view class="bottom-fixed"> |
|||
<view class="bf-placeholder" :style="'height:' + placeholderHeight +'px;'"></view> |
|||
<view class="bf-content"> |
|||
<view class="bc-btns"> |
|||
<slot></slot> |
|||
</view> |
|||
<fixed-bar> |
|||
<view class="bottom-fixed"> |
|||
<slot></slot> |
|||
</view> |
|||
</view> |
|||
</fixed-bar> |
|||
</template> |
|||
|
|||
<script> |
|||
import fixed_bar from "@/components/fixed_bar/fixed_bar.vue"; |
|||
export default { |
|||
data(){ |
|||
return { |
|||
placeholderHeight: 0, |
|||
} |
|||
}, |
|||
created(){ |
|||
let query = uni.createSelectorQuery().in(this); |
|||
query.select('.bf-content') |
|||
.fields( |
|||
{ size:true }, |
|||
data => { |
|||
this.placeholderHeight = data.height; |
|||
} |
|||
); |
|||
query.exec() |
|||
components: { |
|||
'fixed-bar': fixed_bar |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.bf-content{ |
|||
position: fixed; |
|||
bottom: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
.bottom-fixed{ |
|||
padding: 10upx 24upx; |
|||
background: #f2f2f7; |
|||
background: #F2F2F7; |
|||
@include ctf(flex-end); |
|||
} |
|||
</style> |
@ -1,23 +0,0 @@ |
|||
<template> |
|||
<view class="fixed-button"> |
|||
<slot>click</slot> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
|
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.fixed-button{ |
|||
padding: 0 32upx; |
|||
display: inline-block; |
|||
min-width: 192upx; |
|||
text-align: center; |
|||
border-radius: 10upx; |
|||
background: #fff; |
|||
@include flcw(32upx, 88upx, $mColor, 500); |
|||
} |
|||
</style> |
@ -0,0 +1,62 @@ |
|||
<template> |
|||
<view class="search-bar"> |
|||
<view class="sb-box"> |
|||
<image class="sb-search-icon" mode="aspectFit" src="/subpackage/order/static/images/search.png"></image> |
|||
<input class="sb-ipt" placeholder="你输入订单号" v-model="searchTxt" confirm-type="search" @confirm="iptConfirm" /> |
|||
<image class="sb-clear-icon" v-if="searchTxt!=''" mode="aspectFit" src="/subpackage/order/static/images/round_close.png" @click="clearSearch"></image> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
searchTxt: '' |
|||
} |
|||
}, |
|||
methods: { |
|||
iptConfirm(){ |
|||
this.$emit('confirm:search', this.searchTxt); |
|||
}, |
|||
clearSearch(){ |
|||
this.searchTxt = ''; |
|||
this.$emit('click:clear', ''); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.search-bar{ |
|||
margin-bottom: 24upx; |
|||
height: 144upx; |
|||
background-color: #fff; |
|||
@include ctf(center); |
|||
.sb-box{ |
|||
padding: 0 20upx; |
|||
height: 92upx; |
|||
width: 702upx; |
|||
border-radius: 10upx; |
|||
background-color: #f2f2f7; |
|||
@include ctf(center); |
|||
.sb-search-icon{ |
|||
margin-right: 20upx; |
|||
flex-shrink: 0; |
|||
width: 40upx; |
|||
height: 40upx; |
|||
} |
|||
.sb-clear-icon{ |
|||
flex-shrink: 0; |
|||
margin-right: 0; |
|||
margin-left: 20upx; |
|||
width: 32upx; |
|||
height: 32upx; |
|||
} |
|||
.sb-ipt{ |
|||
flex-grow: 1; |
|||
@include flcw(32upx, 44upx, #1A1A1A); |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,126 @@ |
|||
import { ORDER_API } from '../../../js/api'; |
|||
import server from '../../../js/server'; |
|||
import { showLoad, hideLoad, showNone, showModal } from '@/utils/util'; |
|||
|
|||
|
|||
// 获取订单详情
|
|||
export function getOrderDetail({ |
|||
brand_id = '', order_no = '' |
|||
}){ |
|||
showLoad(); |
|||
return server.get({ |
|||
url: ORDER_API.billingOrderDetail, |
|||
data: { |
|||
brand_id, order_no |
|||
}, |
|||
failMsg: '加载失败!' |
|||
}) |
|||
.then(res=>{ |
|||
hideLoad(); |
|||
// this.orderInfo = res || {};
|
|||
return res; |
|||
}) |
|||
.catch(err=>{ |
|||
hideLoad(); |
|||
showNone('加载失败!'); |
|||
console.warn('getOrderDetail err -->', err); |
|||
}) |
|||
} |
|||
|
|||
// 完结订单
|
|||
export function endOrderServer({ |
|||
brand_id, order_no, stadium_id |
|||
}){ |
|||
showLoad(); |
|||
return server.get({ |
|||
url: ORDER_API.timeOrderComplete, |
|||
data: { |
|||
brand_id, order_no, stadium_id |
|||
}, |
|||
failMsg: '操作失败!' |
|||
}) |
|||
.then(res=>{ |
|||
hideLoad(); |
|||
showNone('操作成功!'); |
|||
return res; |
|||
}) |
|||
.catch(err=>{ |
|||
hideLoad(); |
|||
showNone('操作失败!'); |
|||
console.warn('endOrderServer err -->', err); |
|||
}) |
|||
} |
|||
|
|||
// 取消订单
|
|||
export function cancelOrderServer({ |
|||
brand_id, order_no, reason = '' |
|||
}){ |
|||
showLoad(); |
|||
return server.get({ |
|||
url: ORDER_API.subscribeCancel, |
|||
data: { |
|||
brand_id, order_no, reason |
|||
}, |
|||
failMsg: '操作失败!' |
|||
}) |
|||
.then(res=>{ |
|||
hideLoad(); |
|||
showNone('操作成功!'); |
|||
return res; |
|||
}) |
|||
.catch(err=>{ |
|||
hideLoad(); |
|||
showNone('操作失败!'); |
|||
console.warn('cancelOrderServer err -->', err); |
|||
|
|||
}) |
|||
} |
|||
|
|||
// 完结订单弹窗
|
|||
export function finishOrder({ |
|||
brand_id, order_no, stadium_id, opts = {} |
|||
}){ |
|||
showModal({ |
|||
title: '提示', |
|||
content: '是否确认完结订单?', |
|||
showCancel: true, |
|||
success: modalRes=>{ |
|||
if(modalRes.confirm)endOrderServer({ |
|||
brand_id: brand_id || '', |
|||
order_no: order_no || '', |
|||
stadium_id: stadium_id || '' |
|||
}) |
|||
.finally(res=>{ |
|||
// setTimeout(()=>{
|
|||
// this.getOrderDetail({
|
|||
// brand_id: brand_id || '',
|
|||
// order_no: order_no || ''
|
|||
// });
|
|||
// }, 1000);
|
|||
opts?.finally?.(res); |
|||
}); |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function siteAndPeopleRefundServer({ order_no = '', amount = 0, integral = 0 }){ |
|||
showLoad(); |
|||
return server.post({ |
|||
url: ORDER_API.orderRefund, |
|||
data: { |
|||
order_no, amount, integral |
|||
}, |
|||
failMsg: '操作失败!' |
|||
}) |
|||
.then(res=>{ |
|||
hideLoad(); |
|||
showNone('操作成功!'); |
|||
// this.orderInfo = res || {};
|
|||
return 'success'; |
|||
}) |
|||
.catch(err=>{ |
|||
hideLoad(); |
|||
showNone('操作失败!'); |
|||
console.warn('getOrderDetail err -->', err); |
|||
}) |
|||
} |
@ -0,0 +1,132 @@ |
|||
<template> |
|||
<view class="order-search"> |
|||
<search-bar |
|||
@confirm:search="searchOrder" |
|||
></search-bar> |
|||
<view class="os-list"> |
|||
<block v-for="(e, i) in orderList" :key="i"> |
|||
<view class="tl-item" v-if="e.order_type === 1"> |
|||
<site-list-item :order="e"></site-list-item> |
|||
</view> |
|||
<view class="tl-item" v-if="e.order_type === 2"> |
|||
<person-list-item :order="e"></person-list-item> |
|||
</view> |
|||
<view class="tl-item" v-if="e.order_type === 3"> |
|||
<deposit-list-item :order="e"></deposit-list-item> |
|||
</view> |
|||
</block> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import search_bar from './modules/order_search/search_bar.vue'; |
|||
|
|||
import personListItem from "./modules/order_list/person.vue"; |
|||
import siteListItem from "./modules/order_list/site.vue"; |
|||
import depositListItem from "./modules/order_list/deposit.vue"; |
|||
|
|||
import { ORDER_API } from '../../js/api'; |
|||
import server from '../../js/server'; |
|||
import { showLoad, hideLoad, showNone } from '@/utils/util'; |
|||
const enumOrderType = { |
|||
site: '1', // 场时 |
|||
person: '2' // 人时 |
|||
} |
|||
export default { |
|||
components: { |
|||
'search-bar': search_bar, |
|||
|
|||
'person-list-item': personListItem, |
|||
'site-list-item': siteListItem, |
|||
'deposit-list-item': depositListItem, |
|||
}, |
|||
data() { |
|||
return { |
|||
orderList: [], |
|||
page: 1, |
|||
optionsQuery: { |
|||
brand_id: '', |
|||
order_type: '', |
|||
}, |
|||
searchTxt: '' |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
this.optionsQuery = options; |
|||
}, |
|||
onReachBottom(){ |
|||
let { page, optionsQuery, searchTxt } = this; |
|||
this.getOrderList({ |
|||
brand_id: optionsQuery?.brand_id || '', |
|||
order_type: optionsQuery?.order_type || '', |
|||
key: searchTxt || '', |
|||
page: ++page |
|||
}) |
|||
}, |
|||
methods: { |
|||
searchOrder(value){ |
|||
let { optionsQuery } = this; |
|||
this.searchTxt = value; |
|||
this.getOrderList({ |
|||
brand_id: optionsQuery.brand_id, |
|||
order_type: optionsQuery.order_type, |
|||
key: value |
|||
}) |
|||
}, |
|||
/** |
|||
* @param {String} brand_id 品牌id |
|||
* @param {String} stadium_id 场馆id |
|||
* @param {String} status 支付状态:未支付/已支付/已退款/反馈[0/1/2/3] |
|||
* @param {String} start 开始时间 |
|||
* @param {String} end 结束时间 |
|||
* @param {String} order_type 订单类型:场时/人时[1/2] |
|||
* @param {String} status_text 已关闭/计费中/待支付/待使用/使用中/已失效/已完成/已抵扣/已退款/已取消预约 |
|||
* @param {String} key 搜索关键字 |
|||
* |
|||
* */ |
|||
getOrderList({ |
|||
brand_id = '', stadium_id = '', |
|||
status = '', start = '', end = '', |
|||
order_type = '', page = 1, page_size = 20, |
|||
status_text = '', key = '' |
|||
}){ |
|||
showLoad(); |
|||
server.get({ |
|||
url: ORDER_API.billingOrderList, |
|||
data: { |
|||
brand_id, stadium_id, status, |
|||
start, end, order_type: this.getReqOrderType(order_type), page, page_size, |
|||
status_text, key |
|||
}, |
|||
failMsg: '加载失败!' |
|||
}) |
|||
.then(res=>{ |
|||
hideLoad(); |
|||
let { list, ...info } = res; |
|||
let _list = list || []; |
|||
if(page == 1)return this.orderList = _list; |
|||
if(_list?.length <= 0)return showNone('没有更多数据了!'); |
|||
this.page = page; |
|||
this.orderList = [...this.orderList, ..._list]; |
|||
|
|||
}) |
|||
}, |
|||
// 获取请求订单类型 |
|||
getReqOrderType(type){ |
|||
if(type === enumOrderType.site)return '1,3'; // 场时需要同时加载押金订单 |
|||
return type; |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.os-list{ |
|||
padding: 24upx; |
|||
@include isPd(24upx); |
|||
.tl-item + .tl-item{ |
|||
margin-top: 24upx; |
|||
} |
|||
} |
|||
</style> |
After Width: 32 | Height: 32 | Size: 369 B |
20023
yarn.lock
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue