diff --git a/package-lock.json b/package-lock.json
index eb835cc..d78ed18 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10060,6 +10060,12 @@
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true
},
+ "numeral": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/numeral/-/numeral-2.0.6.tgz",
+ "integrity": "sha1-StCAk21EPCVhrtnyGX7//iX05QY=",
+ "dev": true
+ },
"nwsapi": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz",
diff --git a/package.json b/package.json
index 056f716..0304dd9 100644
--- a/package.json
+++ b/package.json
@@ -80,6 +80,7 @@
"mini-types": "*",
"miniprogram-api-typings": "*",
"node-sass": "^4.14.1",
+ "numeral": "^2.0.6",
"postcss-comment": "^2.0.0",
"sass-loader": "^10.0.2",
"vue-template-compiler": "^2.6.11",
diff --git a/src/components/integral_order/integral_order.vue b/src/components/integral_order/integral_order.vue
index a49dd96..54755d9 100644
--- a/src/components/integral_order/integral_order.vue
+++ b/src/components/integral_order/integral_order.vue
@@ -1,48 +1,74 @@
- 订单编号:
-
- 20195175645666
+ 订单编号:
+
+ {{orderInfo.order_no || '-'}}
- 用户昵称:
-
- 周大强
+ 用户昵称:
+
+ {{orderInfo.receiver || '-'}}
- 支付时间:
-
- 2019-05-17 11:12:50
+ 支付时间:
+
+ {{orderInfo.pay_time || '-'}}
- 规格:
-
- 1只装
+ 规格:
+
+ {{orderInfo.good_attr.name || '-'}}
- 邮费:¥0.00
- 实付款: 2000积分
+ 邮费:¥{{orderInfo.postage || 0}}
+ 实付款: {{orderInfo.pay_integral || 0}}积分
-
- 发货
+
+ 发货
@@ -59,13 +85,13 @@ export default {
line-height: 96upx;
border-bottom: 2upx solid #D8D8D8;
@include centerFlex(space-between);
- >view{
+ .ih-view{
flex-grow: 1;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
}
- >text{
+ .ih-text{
margin-left: 20upx;
flex-shrink: 0;
font-size: 28upx;
@@ -79,18 +105,18 @@ export default {
padding: 0 20upx 20upx;
.is-line{
display: flex;
- view{
+ .il-view,.iv-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
}
- >view{
+ .il-view{
&:first-child{
flex-shrink: 0;
}
- &+view{
+ &+.il-view{
flex-grow: 1;
- >view{
+ .iv-view{
@include textHide(1);
}
}
@@ -102,13 +128,13 @@ export default {
padding: 20upx;
border-top: 2upx solid #D8D8D8;
@include centerFlex(space-between);
- >view{
+ .ib-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
min-width: 50%;
@include textHide(1);
- &+view{
+ &+.ib-view{
text-align: right;
}
}
@@ -117,7 +143,7 @@ export default {
padding-bottom: 20upx;
padding-right: 36upx;
@include centerFlex(flex-end);
- >view{
+ .ib-view{
width: 176upx;
height: 72upx;
line-height: 68upx;
diff --git a/src/components/membership_order/membership_order.vue b/src/components/membership_order/membership_order.vue
index 7b44149..b19a624 100644
--- a/src/components/membership_order/membership_order.vue
+++ b/src/components/membership_order/membership_order.vue
@@ -1,63 +1,86 @@
- 订单编号:
-
- 20195175645666
+ 订单编号:
+
+ {{orderInfo.order_no || '-'}}
- 用户昵称:
-
- 周大强
+ 用户昵称:
+
+ {{orderInfo.nickname || '-'}}
- 支付时间:
-
- 2019-05-17 11:12:50
+ 支付时间:
+
+ {{orderInfo.pay_time || '-'}}
- 会员卡信息:
-
- 3000元会员卡
+ 会员卡信息:
+
+ {{orderInfo.member_card_name || '-'}}
- 会员卡余额:
-
- ¥2800
+ 会员卡余额:
+
+ ¥{{orderInfo.balance || '0'}}
- 场地折扣:
-
- 九折
+ 场地折扣:
+
+ {{orderInfo.member_card.discount || '-'}}
- 购买途径:
-
- 升级
+ 购买途径:
+
+ {{orderInfo.desc || '-'}}
- 支付方式:微信支付
- 实付款: ¥3000
+ 支付方式:{{zh_pay_type(orderInfo.pay_type)}}
+ 实付款: ¥{{orderInfo.pay_amount || '-'}}
@@ -73,35 +96,38 @@ export default {
line-height: 96upx;
border-bottom: 2upx solid #D8D8D8;
@include centerFlex(space-between);
- >view{
+ .mh-view{
font-size: 28upx;
font-weight: 500;
color: #1a1a1a;
@include textHide(1);
}
- >text{
+ .mh-text{
flex-shrink: 0;
font-size: 28upx;
- color: $themeColor;
+ color: #9C9C9F;
+ &.active{
+ color: $themeColor;
+ }
}
}
.mo-section{
padding-bottom: 30upx;
.ms-line{
display: flex;
- view{
+ .ml-view,.mv-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
}
- >view{
+ .ml-view{
&:first-child{
flex-shrink: 0;
}
- &+view{
+ &+.ml-view{
flex-grow: 1;
- >view{
- >text{
+ .mv-view{
+ .mv-text{
color: #1A1A1A;
}
@include textHide(1);
@@ -114,7 +140,7 @@ export default {
height: 90upx;
border-top: 2upx solid #D8D8D8;
@include centerFlex(space-between);
- >view{
+ .mb-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
diff --git a/src/components/reservation_order/reservation_order.vue b/src/components/reservation_order/reservation_order.vue
index 3a87678..7f2b095 100644
--- a/src/components/reservation_order/reservation_order.vue
+++ b/src/components/reservation_order/reservation_order.vue
@@ -1,59 +1,102 @@
订单编号:
- 20195175645666
+ {{orderInfo.order_no || '-'}}
用户昵称:
- 周大强
+ {{orderInfo.nickname || '-'}}
支付时间:
- 2019-05-17 11:12:50
+ {{orderInfo.pay_time || '-'}}
预定日期:
- 2019-05-18 周五
+ {{orderInfo.date || '-'}}
预定场次:
- 1号馆 10:00-11:00;11:00-12:00
- 1号馆 10:00-11:00;11:00-12:00
- 1号馆 10:00-11:00;11:00-12:00
- 1号馆 10:00-11:00;11:00-12:00
+ {{e.venue_name}} {{e.duration}}
- 支付方式:微信支付
- 共5场次 合计:¥240
+
+ 支付方式:{{zh_pay_type(orderInfo.pay_type)}}
+ 共{{orderInfo.sessions.length || '-'}}场次 合计:¥{{orderInfo.amount || '0'}}
- 实付款¥240(折扣0)
+ 实付款¥{{orderInfo.pay_amount || '0'}}(折扣{{orderInfo.discount_amount || '0'}})
- 核销方式:商家扫码 2019-05-18 09:50:30
- 退款时间:2019-05-18 09:50:30
+ 核销方式:{{zh_verify_type(orderInfo.verify_type)}} {{orderInfo.verify_time || '-'}}
+ 退款时间:{{orderInfo.refund_time || '-'}}
diff --git a/src/js/api.js b/src/js/api.js
index ec96a06..4c6616b 100644
--- a/src/js/api.js
+++ b/src/js/api.js
@@ -19,7 +19,9 @@ export const API = {
reservationOrder:`${ORIGIN}/admin/stadium/order/list`, // 预约订单
membershipOrder:`${ORIGIN}/admin/member_card/order/list`, // 会员卡订单
+
integralOrder:`${ORIGIN}/admin/shop/order/list`, // 积分商城订单
+ integralOrderSend:`${ORIGIN}/admin/shop/order/ship`, // 积分商城订单-发货
diff --git a/src/pages/collection/detail/detail.vue b/src/pages/collection/detail/detail.vue
index e21bec1..956bb9b 100644
--- a/src/pages/collection/detail/detail.vue
+++ b/src/pages/collection/detail/detail.vue
@@ -15,11 +15,11 @@
- 全部
- 退款
+ 全部
+ 退款
-
+
{{e.desc || '-'}}
@@ -27,8 +27,8 @@
{{e.pay_time || '-'}}
- {{e.amount || '-'}}
- 退款成功
+ {{e.amount || '-'}}
+ {{e.refund_desc || ''}}
@@ -46,6 +46,7 @@ export default {
detail: {}, // 收入概况
receiveList: [],
timerArr: [], // 时间选择数据
+ curType: 0,
curSelectedDate: {
year: '',
month: '',
@@ -58,21 +59,49 @@ export default {
this.storeInfo = _query.store;
this.detail = _query.detail;
this.timerArr = this.getTimerArr(_query.detail.date);
- this.getDetail({});
- console.log('_query.detail',_query.detail)
+
+ this.getDetail({
+ date: _query.detail.date,
+ type: this.curType,
+ stadium_id: _query.store.id,
+ });
},
methods: {
+ tabChangeBtn(type){
+ if(this.curType == type)return;
+ let { curSelectedDate, storeInfo } = this;
+ this.curType = type;
+ this.getDetail({
+ date: `${curSelectedDate.year}-${curSelectedDate.month}-${curSelectedDate.date}`,
+ type: type,
+ stadium_id: storeInfo.id,
+ })
+ },
dateChange(e){
let { value } = e.detail;
- let { detail } = this;
-
+ let { timerArr, curType, storeInfo } = this;
+ let _curTime = util.jsonPar(util.jsonStr(this.curSelectedDate));
+
+ let _obj = {
+ year: _curTime.year,
+ month: timerArr[0][value[0]],
+ date: timerArr[1][value[1]],
+ }
+
+ this.curSelectedDate = _obj;
+
+ this.getDetail({
+ date: `${_obj.year}-${_obj.month}-${_obj.date}`,
+ type: curType,
+ stadium_id: storeInfo.id,
+ })
},
getTimerArr(curDate){
let _dateObj = new Date(curDate);
let _year = _dateObj.getFullYear();
- let _month = util.formatNumber(_dateObj.getMonth());
+ let _month = util.formatNumber(_dateObj.getMonth()+1);
let _date = util.formatNumber(_dateObj.getDate());
- let _dateAmount = new Date(_year, _month, 0).getDate();
+ let _dateAmount = new Date(_year, _month, 0).getDate(); // 当月总天数
this.setCurDate(_year, _month, _date);
return [
new Array(12).fill(1).map((e,i)=>util.formatNumber(i+1)),
@@ -80,20 +109,6 @@ export default {
]
},
- getDateObj(curDate){
- let _dateObj = new Date(curDate);
- let _year = _dateObj.getFullYear();
- let _month = util.formatNumber(_dateObj.getMonth());
- let _date = util.formatNumber(_dateObj.getDate());
- let _dateAmount = new Date(_year, _month, 0).getDate();
-
- return {
- year: _year,
- month: _month,
- date: _date,
- dateAmount: _dateAmount,
- }
- },
setCurDate(y,m,d){
this.curSelectedDate = {
year: y,
@@ -102,10 +117,11 @@ export default {
}
},
getDetail({
- date='2020-09-20',
+ date='2020-08-10',
type=0,
stadium_id='',
}){
+ util.showLoad();
servers.get({
url: API.collectionDetails,
data: {
@@ -116,9 +132,10 @@ export default {
failMsg: '加载失败!'
})
.then(e=>{
- console.log('明细',e);
+ util.hideLoad();
this.receiveList = e.list || [];
})
+ .catch(util.hideLoad)
}
}
diff --git a/src/pages/order_list/order_list.vue b/src/pages/order_list/order_list.vue
index e10db9c..453f1a1 100644
--- a/src/pages/order_list/order_list.vue
+++ b/src/pages/order_list/order_list.vue
@@ -1,11 +1,11 @@
@@ -60,7 +61,7 @@
开始时间
-
+
@@ -69,7 +70,7 @@
截止时间
-
+
@@ -88,20 +89,21 @@
import util from '../../utils/util';
import { servers } from '../../js/server';
import { API } from '../../js/api';
+ import { mapState } from 'vuex';
const resClassify = [ // 预约tab
- {id:0,name:'全部'},
+ {id:'',name:'全部'},
{id:1,name:'待使用'},
{id:2,name:'已使用'},
{id:3,name:'已失效'},
{id:4,name:'已退款'},
];
const memClassify = [ // 会员tab
- {id:0,name:'全部'},
+ {id:'',name:'全部'},
{id:1,name:'使用中'},
- {id:2,name:'已失效'},
+ {id:0,name:'已失效'},
]
const intClassify = [ // 积分tab
- {id:0,name:'全部'},
+ {id:'',name:'全部'},
{id:1,name:'待发货'},
{id:2,name:'已发货'},
{id:3,name:'已完成'},
@@ -127,19 +129,52 @@
if(orderType == 4)return '会员卡订单';
if(orderType == 5)return '积分商城订单';
return '订单'
- }
+ },
+ ...mapState(['brandInfo']),
},
data(){
return {
- isShowClassify: false,
- isShowPeriod: false,
- periodInfo: {
+ isShowClassify: false, // 是否显示分类弹窗
+ isShowPeriod: false, // 是否显示时间段弹窗
+ curTabID: '', // 当前tabID 对应 接口status 值
+ periodInfo: { // 展示和请求时间
+ start: '',
+ end: ''
+ },
+ tempTimer: { // 弹窗临时时间
start: '',
end: ''
},
orderType: 3, // 3->预约,4->会员,5->积分
+
+ storeList: [ // 店铺列表
+ { id: '', name: '全部' }
+ ],
+
+ curSelectedStore: { id: '', name: '全部' }, // 当前选中店铺
+
+ orderInfo: {}, // 订单信息 退款数等
+ orderList: [], // 订单列表
+ page: 1,
}
},
+ onReachBottom(){
+ let { curTabID, periodInfo, orderType, curSelectedStore, page } = this;
+
+ this.getOrderList({
+ begin: periodInfo.start,
+ end: periodInfo.end,
+ // 订单状态
+ // 预约 - 1 已支付待使用 / 2 已使用 / 3 已失效 / 4 已退款
+ // 会员 - 1 '使用中' / 0 '无效'
+ // 积分 - 1已付款 / 2 已发货 / 3 已完成 / 4 取消兑换
+ status: curTabID,
+ stadium_id: curSelectedStore.id,
+ page: ++page,
+ orderType: orderType,
+ })
+
+ },
onLoad(options){
this.orderType = options.order_type;
this.$nextTick(_=>{
@@ -147,18 +182,59 @@
title: this.titleName
})
})
- this.getReservatioOrder({});
+ this.getStoreList();
+ this.getOrderList({
+ orderType: options.order_type
+ })
},
methods: {
- startTimeChange(res){
- this.periodInfo.start = res.detail.value;
+ refreshList(){
+ let { curTabID, periodInfo, orderType, curSelectedStore, page } = this;
+ this.orderList = [];
+ this.page = 1;
+
+ this.getOrderList({
+ begin: periodInfo.start,
+ end: periodInfo.end,
+ // 订单状态
+ // 预约 - 1 已支付待使用 / 2 已使用 / 3 已失效 / 4 已退款
+ // 会员 - 1 '使用中' / 0 '无效'
+ // 积分 - 1已付款 / 2 已发货 / 3 已完成 / 4 取消兑换
+ status: curTabID,
+ stadium_id: curSelectedStore.id,
+ orderType: orderType,
+ })
},
- endTimeChange(res){
- this.periodInfo.end = res.detail.value;
- console.log(res)
+ tabChange: util.debounce(function(ID){
+ if(this.curTabID === ID)return;
+ this.curTabID = ID;
+ this.hideClassify();
+ this.$nextTick(this.refreshList);
+ },300,300),
+ storeChange(e){
+ let { value } = e.detail;
+ let { storeList } = this;
+ this.curSelectedStore = storeList[value];
+ this.$nextTick(this.refreshList);
+ },
+ // 获取品牌店铺列表
+ getStoreList(){
+ let { brandInfo } = this;
+ servers.get({
+ url: API.stadiumList,
+ data: {
+ brand_id: brandInfo.brand.id,
+ },
+ failMsg: '加载店铺列表失败!',
+ })
+ .then(res=>{
+ let _list = res.list || [];
+ this.storeList = [ ...this.storeList, ..._list ];
+ })
},
toSearch(){
- util.routeTo(`/pages/order_search/order_search`,'nT');
+ let { orderType } = this;
+ util.routeTo(`/pages/order_search/order_search?type=${orderType}`,'nT');
},
showClassify(){
this.isShowClassify = true;
@@ -166,15 +242,26 @@
hideClassify(){
this.isShowClassify = false;
},
+ startTimeChange(res){
+ let { value } = res.detail;
+ this.tempTimer.start = value;
+ },
+ endTimeChange(res){
+ let { value } = res.detail;
+ this.tempTimer.end = value;
+ },
+
confirmPeriod(){
- let { start, end } = this.periodInfo;
+ let { start, end } = this.tempTimer;
if(
!start || !end ||
- new Date(start).getTime()>=new Date(end).getTime()
+ new Date(start.replace(/\-/g,'/')).getTime()>=new Date(end.replace(/\-/g,'/')).getTime()
)return util.showNone('请选择合理时间!');
+ this.periodInfo = { ...this.tempTimer };
this.hidePeriodModal();
+ this.$nextTick(this.refreshList);
},
showPeriodModal(){
this.isShowPeriod = true;
@@ -182,30 +269,52 @@
hidePeriodModal(){
this.isShowPeriod = false;
},
- getReservatioOrder({
- key='',
+ getApiUrl(type = this.orderType){
+ if(type == 3)return API.reservationOrder;
+ if(type == 4)return API.membershipOrder;
+ if(type == 5)return API.integralOrder;
+ },
+ getOrderList({
begin='',
end='',
- status='',
- brand_id='37',
- verify_user_id='160',
+ // 订单状态
+ // 预约 - 1 已支付待使用 / 2 已使用 / 3 已失效 / 4 已退款
+ // 会员 - 1 '使用中' / 0 '无效'
+ // 积分 - 1已付款 / 2 已发货 / 3 已完成 / 4 取消兑换
+ status='',
+ stadium_id='',
+ page=1,
+ page_size=15,
+ orderType = this.orderType
}){
+ let { brandInfo } = this;
+ util.showLoad();
servers.get({
- url: API.reservationOrder,
+ url: this.getApiUrl(orderType),
data: {
- key,
begin,
end,
status,
- brand_id,
- verify_user_id,
+ brand_id: brandInfo.brand.id,
+ stadium_id,
+ page,
+ page_size,
},
failMsg: '加载失败!'
})
.then(res=>{
- console.log(res);
+ util.hideLoad();
+ let { list, ...orderInfo } = res;
+ this.orderInfo = orderInfo
+ let _list = list || [];
+ if(page == 1)return this.orderList = _list;
+ if(_list.length<=0)return util.showNone('没有更多!');
+ this.page = page;
+ this.orderList = [ ...this.orderList, ..._list ];
})
- }
+ .catch(util.hideLoad)
+ },
+
},
}
@@ -326,6 +435,9 @@
font-size: 32upx;
color: #1a1a1a;
@include textHide(1);
+ &.active{
+ color: $themeColor;
+ }
}
}
}
diff --git a/src/pages/order_search/order_search.vue b/src/pages/order_search/order_search.vue
index 03e9bb2..7456b64 100644
--- a/src/pages/order_search/order_search.vue
+++ b/src/pages/order_search/order_search.vue
@@ -1,22 +1,133 @@
-
-
-
-
-
-
-
-
+
没有该订单数据
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -56,6 +167,12 @@ export default {
}
}
}
+ .os-list{
+ padding: 0 24upx;
+ .ol-item{
+ margin-bottom: 24upx;
+ }
+ }
.os-none{
position: fixed;
left: 0;
diff --git a/src/pages/order_send/order_send.vue b/src/pages/order_send/order_send.vue
index 50b39dd..6b49d86 100644
--- a/src/pages/order_send/order_send.vue
+++ b/src/pages/order_send/order_send.vue
@@ -1,7 +1,7 @@
温馨提示:请确认好订单信息再发货哦!
- 订单号:20201232434589580546
+ 订单号:{{order_no}}
选择物流发货
@@ -13,17 +13,63 @@
物流单号
-
-
+
- 确定
+ 确定
diff --git a/src/store/index.js b/src/store/index.js
index f8e027c..b942634 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -9,7 +9,9 @@ export default new Vuex.Store({
// #ifdef MP-WEIXIN
APPID: uni.getAccountInfoSync().miniProgram.appId,
// #endif
- brandInfo: {},
+ brandInfo: {
+ brand: {}
+ },
permissionObj: { // 权限代号对应
'1001': '营业额',
'1002': '收款记录',