Browse Source

add api

voice
刘嘉炜 4 years ago
parent
commit
8ad6edbe10
  1. 6
      package-lock.json
  2. 1
      package.json
  3. 82
      src/components/integral_order/integral_order.vue
  4. 96
      src/components/membership_order/membership_order.vue
  5. 75
      src/components/reservation_order/reservation_order.vue
  6. 2
      src/js/api.js
  7. 71
      src/pages/collection/detail/detail.vue
  8. 198
      src/pages/order_list/order_list.vue
  9. 135
      src/pages/order_search/order_search.vue
  10. 56
      src/pages/order_send/order_send.vue
  11. 4
      src/store/index.js

6
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",

1
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",

82
src/components/integral_order/integral_order.vue

@ -1,48 +1,74 @@
<template>
<view class="integral-order">
<view class="il-header">
<view>欧轩智能羽毛球馆(永泰店)</view>
<text class="ih-active">待使用</text>
<view class="ih-view">{{orderInfo.good.name || '-'}}</view>
<text :class="['ih-text',orderInfo.pay_status == 1?'ih-active':'']">{{zh_order_status(orderInfo.pay_status)}}</text>
</view>
<view class="il-section">
<view class="is-line">
<view>订单编号</view>
<view>
<view>20195175645666</view>
<view class="il-view">订单编号</view>
<view class="il-view">
<view class="iv-view">{{orderInfo.order_no || '-'}}</view>
</view>
</view>
<view class="is-line">
<view>用户昵称</view>
<view>
<view>周大强</view>
<view class="il-view">用户昵称</view>
<view class="il-view">
<view class="iv-view">{{orderInfo.receiver || '-'}}</view>
</view>
</view>
<view class="is-line">
<view>支付时间</view>
<view>
<view>2019-05-17 11:12:50</view>
<view class="il-view">支付时间</view>
<view class="il-view">
<view class="iv-view">{{orderInfo.pay_time || '-'}}</view>
</view>
</view>
<view class="is-line">
<view>规格</view>
<view>
<view>1只装</view>
<view class="il-view">规格</view>
<view class="il-view">
<view class="iv-view">{{orderInfo.good_attr.name || '-'}}</view>
</view>
</view>
</view>
<view class="il-bot">
<view>邮费¥0.00</view>
<view>实付款 2000积分</view>
<view class="ib-view">邮费¥{{orderInfo.postage || 0}}</view>
<view class="ib-view">实付款 {{orderInfo.pay_integral || 0}}积分</view>
</view>
<view class="il-btns">
<view hover-class="hover-active">发货</view>
<view class="il-btns" v-if="orderInfo.pay_status == 1">
<view class="ib-view" hover-class="hover-active" @click="toShip">发货</view>
</view>
</view>
</template>
<script>
import util from '../../utils/util'
export default {
props: {
orderInfo: {
type: Object,
default: {},
}
},
computed: {
zh_order_status(){
// 1 2 3 4
return status =>{
const _obj = {
'1': '待发货',
'2': '已发货',
'3': '已完成',
'4': '取消兑换',
}
return _obj[`${status}`] || '-'
}
}
},
methods: {
toShip(){
let { orderInfo } = this;
util.routeTo(`/pages/order_send/order_send?order_no=${orderInfo.order_no}`,'nT');
}
}
}
</script>
@ -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;

96
src/components/membership_order/membership_order.vue

@ -1,63 +1,86 @@
<template>
<view class="membership-order">
<view class="mo-header">
<view>欧轩智能羽毛球馆(永泰店)</view>
<text>使用中</text>
<view class="mh-view">{{orderInfo.stadium_name || '-'}}</view>
<text :class="['mh-text', orderInfo.member_card.status == 1?'active':'']">
{{
orderInfo.member_card.status == 1 ? '使用中' :
orderInfo.member_card.status == 0 ? '无效' : '-'
}}
</text>
</view>
<view class="mo-section">
<view class="ms-line">
<view>订单编号</view>
<view>
<view>20195175645666 </view>
<view class="ml-view">订单编号</view>
<view class="ml-view">
<view class="mv-view">{{orderInfo.order_no || '-'}}</view>
</view>
</view>
<view class="ms-line">
<view>用户昵称</view>
<view>
<view>周大强 </view>
<view class="ml-view">用户昵称</view>
<view class="ml-view">
<view class="mv-view">{{orderInfo.nickname || '-'}}</view>
</view>
</view>
<view class="ms-line">
<view>支付时间</view>
<view>
<view>2019-05-17 11:12:50</view>
<view class="ml-view">支付时间</view>
<view class="ml-view">
<view class="mv-view">{{orderInfo.pay_time || '-'}}</view>
</view>
</view>
<view class="ms-line">
<view>会员卡信息</view>
<view>
<view>3000元会员卡</view>
<view class="ml-view">会员卡信息</view>
<view class="ml-view">
<view class="mv-view">{{orderInfo.member_card_name || '-'}}</view>
</view>
</view>
<view class="ms-line">
<view>会员卡余额</view>
<view>
<view><text>¥2800</text></view>
<view class="ml-view">会员卡余额</view>
<view class="ml-view">
<view class="mv-view"><text class="mv-text">¥{{orderInfo.balance || '0'}}</text></view>
</view>
</view>
<view class="ms-line">
<view>场地折扣</view>
<view>
<view>九折</view>
<view class="ml-view">场地折扣</view>
<view class="ml-view">
<view class="mv-view">{{orderInfo.member_card.discount || '-'}}</view>
</view>
</view>
<view class="ms-line">
<view>购买途径</view>
<view>
<view>升级</view>
<view class="ml-view">购买途径</view>
<view class="ml-view">
<view class="mv-view">{{orderInfo.desc || '-'}}</view>
</view>
</view>
</view>
<view class="mo-bot">
<view>支付方式微信支付</view>
<view>实付款 ¥3000</view>
<view class="mb-view">支付方式{{zh_pay_type(orderInfo.pay_type)}}</view>
<view class="mb-view">实付款 ¥{{orderInfo.pay_amount || '-'}}</view>
</view>
</view>
</template>
<script>
export default {
props: {
orderInfo: {
type: Object,
default: {},
}
},
computed: {
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '会员卡支付',
}
return _obj[`${status}`] || '-'
}
},
}
}
</script>
@ -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;

75
src/components/reservation_order/reservation_order.vue

@ -1,59 +1,102 @@
<template>
<view class="reservation-order">
<view class="ro-header">
<view class="rh-view">欧轩智能羽毛球馆(永泰店)</view>
<text class="rh-text rh-active">待使用</text>
<view class="rh-view">{{orderInfo.stadium_name || '-'}}</view>
<text :class="[ 'rh-text', orderInfo.pay_status == 1?'rh-active':'' ]">{{zh_order_status(orderInfo.pay_status)}}</text>
</view>
<view class="ro-section">
<view class="rs-line">
<view class="rl-view">订单编号</view>
<view class="rl-view">
<view class="rv-view">20195175645666</view>
<view class="rv-view">{{orderInfo.order_no || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">用户昵称</view>
<view class="rl-view">
<view class="rv-view">周大强</view>
<view class="rv-view">{{orderInfo.nickname || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">支付时间</view>
<view class="rl-view">
<view class="rv-view">2019-05-17 11:12:50</view>
<view class="rv-view">{{orderInfo.pay_time || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">预定日期</view>
<view class="rl-view">
<view class="rv-view">2019-05-18 周五</view>
<view class="rv-view">{{orderInfo.date || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">预定场次</view>
<view class="rl-view">
<view class="rv-view">1号馆 10:00-11:0011:00-12:00</view>
<view class="rv-view">1号馆 10:00-11:0011:00-12:00</view>
<view class="rv-view">1号馆 10:00-11:0011:00-12:00</view>
<view class="rv-view">1号馆 10:00-11:0011:00-12:00</view>
<view class="rv-view" v-for="(e,i) in orderInfo.sessions" :key="i">{{e.venue_name}} {{e.duration}}</view>
</view>
</view>
</view>
<view class="ro-bot">
<view class="rb-line">
<view class="rl-view">支付方式微信支付</view>
<view class="rl-view">共5场次 合计¥240</view>
<!-- 0微信支付1支付宝支付2会员卡支付 -->
<view class="rl-view">支付方式{{zh_pay_type(orderInfo.pay_type)}}</view>
<view class="rl-view">{{orderInfo.sessions.length || '-'}}场次 合计¥{{orderInfo.amount || '0'}}</view>
</view>
<view class="rb-total">实付款<text class="rt-txt">¥240</text>(折扣0)</view>
<view class="rb-total">实付款<text class="rt-txt">¥{{orderInfo.pay_amount || '0'}}</text>(折扣{{orderInfo.discount_amount || '0'}})</view>
</view>
<view class="ro-bot-line">核销方式商家扫码 2019-05-18 09:50:30</view>
<view class="ro-bot-line">退款时间2019-05-18 09:50:30</view>
<view class="ro-bot-line" v-if="orderInfo.verify_type!=0">核销方式{{zh_verify_type(orderInfo.verify_type)}} {{orderInfo.verify_time || '-'}}</view>
<view class="ro-bot-line" v-if="orderInfo.pay_status == 4">退款时间{{orderInfo.refund_time || '-'}}</view>
</view>
</template>
<script>
export default {
props: {
orderInfo: {
type: Object,
default: {},
}
},
computed: {
zh_verify_type(){
// 1/2/3/4 ///
return status =>{
const _obj = {
'0': '未核销',
'1': '核销码核销',
'2': '人脸核销',
'3': '扫码核销',
'4': '商家扫码',
}
return _obj[`${status}`] || '-'
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '会员卡支付',
}
return _obj[`${status}`] || '-'
}
},
zh_order_status(){
// -101使2使34退
return status =>{
const _obj = {
'-1': '已作废',
'0': '未支付',
'1': '待使用',
'2': '已使用',
'3': '已失效',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
}
}
}
</script>

2
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`, // 积分商城订单-发货

71
src/pages/collection/detail/detail.vue

@ -15,11 +15,11 @@
</view>
</view>
<view class="cd-tab">
<view class="active">全部</view>
<view>退款</view>
<view :class="[curType == 0?'active':'']" @click="tabChangeBtn(0)">全部</view>
<view :class="[curType == -1?'active':'']" @click="tabChangeBtn(-1)">退款</view>
</view>
<view class="cd-list">
<view class="cl-item" v-for="e in receiveList" :key="e">
<view class="cl-item" v-for="e in receiveList" :key="e.id">
<image mode="aspectFill" :src="e.avatar_url"></image>
<view class="ci-info">
<view>{{e.desc || '-'}}</view>
@ -27,8 +27,8 @@
<view>{{e.pay_time || '-'}}</view>
</view>
<view class="ci-price">
<view class="active">{{e.amount || '-'}}</view>
<view>退款成功</view>
<view :class="[e.amount>0?'active':'']">{{e.amount || '-'}}</view>
<view v-if="e.amount<0">{{e.refund_desc || ''}}</view>
</view>
</view>
</view>
@ -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)
}
}

198
src/pages/order_list/order_list.vue

@ -1,11 +1,11 @@
<template>
<view class="order-list">
<view class="ol-header">
<view class="oh-cur-store">
<view class="oh-cur-store" v-if="orderType == 3 || orderType == 4">
<text>当前门店</text>
<picker>
<picker mode="selector" :range="storeList" range-key="name" @change="storeChange">
<view class="ocs-store">
<view>全部</view>
<view>{{curSelectedStore.name || '-'}}</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
@ -22,7 +22,7 @@
<view></view>
</view>
<view class="oc-bot">
<view>成功交易245笔退款25</view>
<view>成功交易{{orderInfo.success_count || 0}}退款{{orderInfo.refund_count || 0}}</view>
<view class="ob-btns">
<image mode="aspectFit" @click="toSearch" src="/static/images/icon/search.png"></image>
<image @click="showClassify" mode="aspectFit" src="/static/images/icon/filter.png"></image>
@ -31,14 +31,10 @@
</view>
</view>
<view class="ol-order-list">
<view class="ool-item" v-if="orderType == 3">
<reservation-order></reservation-order>
</view>
<view class="ool-item" v-if="orderType == 4">
<membership-order></membership-order>
</view>
<view class="ool-item" v-if="orderType == 5">
<integral-order></integral-order>
<view class="ool-item" v-for="(e,i) in orderList" :key="i" >
<reservation-order :order-info="e" v-if="orderType == 3"></reservation-order>
<membership-order :order-info="e" v-if="orderType == 4"></membership-order>
<integral-order :order-info="e" v-if="orderType == 5"></integral-order>
</view>
</view>
<!-- 分类tab -->
@ -48,7 +44,12 @@
{{titleName}}
</view>
<view class="oc-tabs">
<view class="ot-item" v-for="e in classifyArr" :key="e.id">{{e.name}}</view>
<view
v-for="e in classifyArr"
:key="e.id"
:class="['ot-item',e.id === curTabID?'active':'']"
@click="tabChange(e.id)"
>{{e.name}}</view>
</view>
</view>
</view>
@ -60,7 +61,7 @@
<view class="op-time">
<text>开始时间</text>
<view>
<input placeholder="选择时间" disabled :value="periodInfo.start" />
<input placeholder="选择时间" disabled :value="tempTimer.start" />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</view>
@ -69,7 +70,7 @@
<view class="op-time">
<text>截止时间</text>
<view>
<input placeholder="选择时间" disabled :value="periodInfo.end" />
<input placeholder="选择时间" disabled :value="tempTimer.end" />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</view>
@ -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;
}
}
}
}

135
src/pages/order_search/order_search.vue

@ -1,22 +1,133 @@
<template>
<view class="order-search">
<view class="os-bar">
<view>
<image mode="aspectFit" src="/static/images/icon/search.png"></image>
<input placeholder="你输入订单号" />
<image mode="aspectFit" src="/static/images/icon/round_close.png"></image>
</view>
</view>
<view class="os-none">
<view class="os-none" v-if="orderList === null">
<image mode="aspectFit" src="/static/images/icon/no_order.png"></image>
<view>没有该订单数据</view>
</view>
<view class="os-content" v-else>
<view class="os-bar">
<view>
<image mode="aspectFit" src="/static/images/icon/search.png"></image>
<input placeholder="你输入订单号" v-model="searchTxt" confirm-type="search" @confirm="iptConfirm" />
<image v-if="searchTxt!=''" mode="aspectFit" src="/static/images/icon/round_close.png" @click="clearSearch"></image>
</view>
</view>
<view class="os-list">
<view class="ol-item" v-for="(e,i) in orderList" :key="i" >
<reservation-order :order-info="e" v-if="orderType == 3"></reservation-order>
<membership-order :order-info="e" v-if="orderType == 4"></membership-order>
<integral-order :order-info="e" v-if="orderType == 5"></integral-order>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
import reservation_order from '../../components/reservation_order/reservation_order';
import integral_order from '../../components/integral_order/integral_order';
import membership_order from '../../components/membership_order/membership_order';
import { API } from '../../js/api';
import { servers } from '../../js/server';
import util from '../../utils/util';
import { mapState } from 'vuex';
export default {
components: {
'reservation-order': reservation_order,
'membership-order': membership_order,
'integral-order': integral_order,
},
computed: {
...mapState(['brandInfo']),
},
data(){
return {
orderType: '',
searchTxt: '',
orderList: [],
page: 1,
}
},
onLoad(options){
this.orderType = options.type;
},
onReachBottom(){
let { orderType, searchTxt, page } = this;
this.getOrderList({
key: searchTxt,
orderType,
page: ++page
})
},
methods: {
refreshList(){
let { orderType, searchTxt } = this;
this.page = 1;
this.orderList = [];
this.getOrderList({
key: searchTxt,
orderType,
})
},
clearSearch(){
this.searchTxt = '';
},
iptConfirm(e){
let { value } = e.detail;
let { orderType } = this;
this.page = 1;
this.orderList = [];
this.getOrderList({
key: value,
orderType,
})
},
getApiUrl(type = this.orderType){
if(type == 3)return API.reservationOrder;
if(type == 4)return API.membershipOrder;
if(type == 5)return API.integralOrder;
},
getOrderList({
key = "",
page = 1,
page_size = 15,
orderType = this.orderType
}){
let { brandInfo } = this;
util.showLoad();
servers.get({
url: this.getApiUrl(orderType),
data: {
key,
begin: '',
end: '',
status: '',
brand_id: brandInfo.brand.id,
stadium_id: '',
page,
page_size,
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
let { list } = res;
if(page == 1){
let _oL = (!list||list.length<=0) ? null : list; // null
return this.orderList = _oL;
}
let _list = list || [];
if(_list.length<=0)return util.showNone('没有更多!');
this.page = page;
this.orderList = [ ...this.orderList, ..._list ];
})
.catch(util.hideLoad)
},
}
}
</script>
@ -56,6 +167,12 @@ export default {
}
}
}
.os-list{
padding: 0 24upx;
.ol-item{
margin-bottom: 24upx;
}
}
.os-none{
position: fixed;
left: 0;

56
src/pages/order_send/order_send.vue

@ -1,7 +1,7 @@
<template>
<view class="order-send">
<view class="os-warn">温馨提示请确认好订单信息再发货哦</view>
<view class="os-order-num">订单号20201232434589580546</view>
<view class="os-order-num">订单号{{order_no}}</view>
<view class="os-tip">选择物流发货</view>
<view class="os-ipts">
<picker>
@ -13,17 +13,63 @@
</picker>
<view class="oi-frame">
<view>物流单号</view>
<input placeholder="请输入单号" />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
<input v-model="shipmentNumber" placeholder="请输入单号" />
</view>
</view>
<view class="os-btn active" hover-class="hover-active">确定</view>
<view class="os-btn active" hover-class="hover-active" @click="confirmSend">确定</view>
</view>
</template>
<script>
import { API } from '../../js/api';
import { servers } from '../../js/server';
import util from '../../utils/util';
import { mapState } from 'vuex';
export default {
computed: {
...mapState([ 'brandInfo' ]),
},
data(){
return {
order_no: '-',
shipmentNumber: ''
}
},
onLoad(options){
this.order_no = options.order_no;
},
methods: {
confirmSend: util.debounce(function(){
let { order_no, shipmentNumber, brandInfo } = this;
util.showLoad();
servers.get({
url: API.integralOrderSend,
data: {
brand_id: brandInfo.brand.id,
order_no: order_no,
shipment_method: '快递',
shipment_no: shipmentNumber,
},
isDefaultGet: false,
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setTimeout(_=>{
util.previousPageFunction({
fnName: 'refreshList',
query: null
})
util.routeTo();
},1200)
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
},300,300)
}
}
</script>

4
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': '收款记录',

Loading…
Cancel
Save