Browse Source

add all

voice
刘嘉炜 4 years ago
parent
commit
a9cd13f36a
  1. 2
      src/components/reservation_order/reservation_order.vue
  2. 7
      src/js/api.js
  3. 2
      src/js/server.js
  4. 13
      src/pages.json
  5. 5
      src/pages/index/index.vue
  6. 57
      src/pages/message/detail/detail.vue
  7. 102
      src/pages/message/list/list.vue
  8. 17
      src/pages/order_list/order_list.vue
  9. 14
      src/pages/order_search/order_search.vue
  10. 34
      src/pages/order_send/order_send.vue
  11. 225
      src/pages/turnover/turnover.vue
  12. BIN
      src/static/images/icon/calendar.png
  13. 4
      src/utils/util.js

2
src/components/reservation_order/reservation_order.vue

@ -42,7 +42,7 @@
<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">¥{{orderInfo.pay_amount || '0'}}</text>(折扣{{orderInfo.discount_amount || '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" 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>

7
src/js/api.js

@ -23,8 +23,13 @@ export const API = {
integralOrder:`${ORIGIN}/admin/shop/order/list`, // 积分商城订单
integralOrderSend:`${ORIGIN}/admin/shop/order/ship`, // 积分商城订单-发货
// 营业额统计
turnoverBrand:`${ORIGIN}/admin/assistant/turnover/brand/calc`, // 营业额记录-品牌
turnoverStadium:`${ORIGIN}/admin/assistant/turnover/brand/stadium/calc`, // 营业额记录-门店
// 消息列表
messageList:`${ORIGIN}/brand/message/list`, // 系统消息列表
messageRead:`${ORIGIN}/brand/message/read`, // 查看系统消息
}

2
src/js/server.js

@ -1,6 +1,6 @@
import util from '../utils/util';
// import { app as vm } from '../main';
const islog = false
const islog = true;
export class Server {
request(url,data,method,header,isDefaultGet,failMsg){

13
src/pages.json

@ -1,11 +1,24 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
}
},
{
"path": "pages/message/detail/detail",
"style": {
"navigationBarTitleText": "消息详情"
}
},
{
"path": "pages/message/list/list",
"style": {
"navigationBarTitleText": "消息中心"
}
},
{
"path": "pages/employee/authority_filter/authority_filter",
"style": {
"navigationBarTitleText": "员工筛选"

5
src/pages/index/index.vue

@ -22,7 +22,7 @@
<image class="ih-bg-icon" style="left: 0;" mode="aspectFit" src="/static/images/icon/index/header_bg_a.png"></image>
<image class="ih-bg-icon" mode="aspectFit" src="/static/images/icon/index/header_bg_b.png"></image>
</view>
<view class="ic-notice">
<view class="ic-notice" @click="toNoticeList">
<view class="in-left">
<image src="/static/images/icon/index/notice.png" mode="aspectFit"></image>
<text>消息中心</text>
@ -134,6 +134,9 @@
if(!!app.isLogin())this.getIndexInfo();
},
methods: {
toNoticeList(){
util.routeTo(`/pages/message/list/list`,'nT');
},
isOrderTab(ID){
return ID == 3 || ID == 4 || ID == 5
},

57
src/pages/message/detail/detail.vue

@ -0,0 +1,57 @@
<template>
<view class="message-detail">
<view class="md-title">{{mesInfo.title || '-'}}</view>
<view class="md-time">{{mesInfo.created_at || '-'}}</view>
<rich-text :nodes="mesInfo.content || '-'"></rich-text>
</view>
</template>
<script>
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
export default {
data(){
return {
mesInfo: {}
}
},
onLoad(options){
this.getMesInfo(options.id)
},
methods: {
getMesInfo(id){
servers.get({
url: API.messageRead + `/${id}`,
data: { id },
failMsg: '加载失败!',
})
.then(res=>{
this.mesInfo =res;
})
}
}
}
</script>
<style lang="scss">
@import "../../../style/public.scss";
page{
background-color: #fff;
}
.message-detail{
padding: 40upx;
.md-title{
margin-bottom: 16upx;
line-height: 56upx;
font-size: 40upx;
color: #1a1a1a;
}
.md-time{
margin-bottom: 60upx;
line-height: 34upx;
font-size: 24upx;
color: #b2b2b2;
}
}
</style>

102
src/pages/message/list/list.vue

@ -0,0 +1,102 @@
<template>
<view class="message-list">
<view class="ml-list">
<view class="ml-item" v-for="(e,i) in mesList" :key="e" @click="toDetail(i)">
<view>
<text>{{e.title || '-'}}</text>
<view v-if="e.is_view == 0"></view>
<!-- 0未读 1已读 -->
</view>
<view>{{e.created_at || '-'}}</view>
</view>
</view>
</view>
</template>
<script>
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import util from '../../../utils/util'
export default {
data(){
return {
mesList: [],
page: 1
}
},
onReachBottom(){
let { page } = this;
this.getMesList(++page);
},
onLoad(){
this.getMesList();
},
methods: {
toDetail(i){
let _mesList = [...this.mesList];
_mesList[i].is_view = 1;
this.mesList = _mesList;
util.routeTo(`/pages/message/detail/detail?id=${_mesList[i].id}`,'nT');
},
getMesList(page = 1){
servers.get({
url: API.messageList,
data: {
page,
page_size: 15,
msg_type: 1
},
failMsg: '加载失败!'
})
.then(res=>{
let _list = res.list || [];
if(page == 1)return this.mesList = _list;
this.page = page;
this.mesList = [...this.mesList, ..._list];
console.log('xiaoxi',res);
})
}
}
}
</script>
<style lang="scss" scoped>
@import "../../../style/public.scss";
.message-list{
}
.ml-list{
padding: 24upx;
.ml-item{
padding: 24upx 20upx;
margin-bottom: 24upx;
border-radius: 10upx;
background-color: #fff;
>view{
&:first-child{
position: relative;
display: inline-block;
line-height: 44upx;
font-size: 32upx;
color: #1a1a1a;
text-align: justify;
>view{
position: absolute;
top: 0upx;
right: -16upx;
display: block;
width: 16upx;
height: 16upx;
border-radius: 50%;
background-color: #EA5061;
}
}
&+view{
line-height: 34upx;
font-size: 24upx;
color: #b2b2b2;
}
}
}
}
</style>

17
src/pages/order_list/order_list.vue

@ -5,7 +5,7 @@
<text>当前门店</text>
<picker mode="selector" :range="storeList" range-key="name" @change="storeChange">
<view class="ocs-store">
<view>{{curSelectedStore.name || '-'}}</view>
<view :class="curSelectedStore!=null?'active':''">{{curSelectedStore == null?'全部':(curSelectedStore.name || '-')}}</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
@ -151,7 +151,7 @@
{ id: '', name: '全部' }
],
curSelectedStore: { id: '', name: '全部' }, //
curSelectedStore: null, //
orderInfo: {}, // 退
orderList: [], //
@ -160,7 +160,7 @@
},
onReachBottom(){
let { curTabID, periodInfo, orderType, curSelectedStore, page } = this;
let _curSelectedStore = curSelectedStore || {};
this.getOrderList({
begin: periodInfo.start,
end: periodInfo.end,
@ -169,7 +169,7 @@
// - 1 '使' / 0 ''
// - 1 / 2 / 3 / 4
status: curTabID,
stadium_id: curSelectedStore.id,
stadium_id: _curSelectedStore.id || '',
page: ++page,
orderType: orderType,
})
@ -188,8 +188,10 @@
})
},
methods: {
//
refreshList(){
let { curTabID, periodInfo, orderType, curSelectedStore, page } = this;
let _curSelectedStore = curSelectedStore || {};
this.orderList = [];
this.page = 1;
@ -201,7 +203,7 @@
// - 1 '使' / 0 ''
// - 1 / 2 / 3 / 4
status: curTabID,
stadium_id: curSelectedStore.id,
stadium_id: _curSelectedStore.id,
orderType: orderType,
})
},
@ -346,10 +348,13 @@
border-radius: 10upx;
background-color: #F2F2F7;
@include centerFlex(space-between);
.active{
color: #1a1a1a;
}
>view{
flex-grow: 1;
font-size: 28upx;
color: #1a1a1a;
color: #9C9C9F;
@include textHide(1);
}
>image{

14
src/pages/order_search/order_search.vue

@ -1,17 +1,17 @@
<template>
<view class="order-search">
<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 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-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-list">
<view class="ol-item" v-for="(e,i) in orderList" :key="i" >
<reservation-order :order-info="e" v-if="orderType == 3"></reservation-order>
@ -20,8 +20,6 @@
</view>
</view>
</view>
</view>
</template>

34
src/pages/order_send/order_send.vue

@ -4,10 +4,10 @@
<view class="os-order-num">订单号{{order_no}}</view>
<view class="os-tip">选择物流发货</view>
<view class="os-ipts">
<picker>
<picker :range="expressDelivery" range-key="name" @change="expressChange">
<view class="oi-frame">
<view>物流渠道</view>
<input disabled="" placeholder="中通" />
<input disabled="" placeholder="请选择快递" :value="curExpressDelivery.name || ''" />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
@ -25,29 +25,53 @@ import { API } from '../../js/api';
import { servers } from '../../js/server';
import util from '../../utils/util';
import { mapState } from 'vuex';
const expressDelivery = [
{ name: '顺丰快递', val: 'SF' },
{ name: 'EMS', val: 'EMS' },
{ name: '申通快递', val: 'STO' },
{ name: '圆通快递', val: 'YTO' },
{ name: '韵达快递', val: 'YD' },
{ name: '中通快递', val: 'ZTO' },
{ name: '百世快递', val: 'HTKY' },
{ name: '邮政快递包裹', val: 'YZPY' },
{ name: '天天快递', val: 'HHTT' },
{ name: '京东快递', val: 'JD' },
{ name: '优速快递', val: 'UC' },
{ name: '德邦快递', val: 'DBL' },
{ name: '宅急送', val: 'ZJS' },
{ name: 'TNT快递', val: 'TNT' }
]
export default {
computed: {
...mapState([ 'brandInfo' ]),
},
data(){
return {
expressDelivery, //
curExpressDelivery: {}, //
order_no: '-',
shipmentNumber: ''
shipmentNumber: '',
}
},
onLoad(options){
this.order_no = options.order_no;
},
methods: {
expressChange(e){
let { value } = e.detail;
let { expressDelivery } = this;
this.curExpressDelivery = expressDelivery[value];
},
confirmSend: util.debounce(function(){
let { order_no, shipmentNumber, brandInfo } = this;
let { order_no, shipmentNumber, brandInfo, curExpressDelivery } = this;
util.showLoad();
servers.get({
url: API.integralOrderSend,
data: {
brand_id: brandInfo.brand.id,
order_no: order_no,
shipment_method: '快递',
shipment_method: curExpressDelivery.name,
shipment_no: shipmentNumber,
},
isDefaultGet: false,

225
src/pages/turnover/turnover.vue

@ -1,52 +1,67 @@
<template>
<view class="turnover-container">
<view class="tc-tab">
<view>品牌</view>
<view class="active">门店</view>
<view :class="[tabID == 0?'active':'']" @click="tabChange(0)">品牌</view>
<view :class="[tabID == 1?'active':'']" @click="tabChange(1)">门店</view>
</view>
<view class="tc-total-section">
<view class="tts-address">
<view>欧轩智能羽毛球馆永泰店</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
<view class="tts-address" v-if="tabID == 0">
<view>{{pageInfo.name || '-'}}</view>
<!-- <image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image> -->
</view>
<picker v-else-if="tabID == 1" :range="storeList" range-key="name" @change="storeChange">
<view class="tts-address">
<view>{{curSelectStore.name || '-'}}</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
<view class="tts-money">
<view>2020.08.08-2020.09.21</view>
<view>{{pageInfo.duration || '-'}}</view>
<view>总营业额</view>
<view><text>¥</text>9990.00</view>
<view><text>¥</text>{{pageInfo.total || '0'}}</view>
</view>
</view>
<view class="tc-info-section">
<view class="tis-tab">
<view class="active">日报</view>
<view class="active">近7天</view>
<view>月报</view>
<view>年报</view>
<view :class="[timeTabID == 0?'active':'']" @click="timeTabChange(0)">日报</view>
<view :class="[timeTabID == 1?'active':'']" @click="timeTabChange(1)">近7天</view>
<view :class="[timeTabID == 2?'active':'']" @click="timeTabChange(2)">月报</view>
<view :class="[timeTabID == 3?'active':'']" @click="timeTabChange(3)">年报</view>
</view>
<view class="tis-data">
<view class="td-date">
<text>2020年9月2日(昨天)</text>
<view></view>
<image mode="aspectFit"></image>
<view class="td-date" v-if="timeTabID == 1">
<text>{{beforeSevenDay}}</text>
<!-- <view></view> -->
<!-- <image mode="aspectFit" src="/static/images/icon/calendar.png"></image> -->
</view>
<picker v-else :mode="timePickerMode" :range="timePickerRange" @change="timeChange">
<view class="td-date">
<text>{{dataTime}}</text>
<view></view>
<image mode="aspectFit" src="/static/images/icon/calendar.png"></image>
</view>
</picker>
<view class="td-tip">实际收入</view>
<view class="td-price"><text>¥</text>9999.00</view>
<view class="td-price"><text>¥</text>{{pageInfo.calc.total || 0}}</view>
<view class="td-detail">
<view>
<view>
<text>收款笔数 </text>0
<text>收款笔数 </text>{{pageInfo.calc.in_count || 0}}
</view>
<view>
<text>退款笔数 </text>0
<text>退款笔数 </text>{{pageInfo.calc.out_count || 0}}
</view>
</view>
<view>
<view>
<text>收款金额 </text> 0.00
<text>收款金额 </text> {{pageInfo.calc.in_total || '0.00'}}
</view>
<view>
<text>退款金额 </text> 0.00
<text>退款金额 </text> {{pageInfo.calc.out_total || '0.00'}}
</view>
</view>
@ -57,8 +72,172 @@
</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' ]),
dataTime(){
let { curTime, timeTabID } = this;
if(timeTabID == 0)return util.formatDate({ date: curTime.date, partition: 'zh' });
if(timeTabID == 2)return util.formatDate({ date: `${curTime.month}-01`, partition: 'zh' }).substr(0,8);
if(timeTabID == 3)return `${curTime.year}`;
},
// picker
timePickerMode(){
let { timeTabID } = this;
if(timeTabID == 0)return 'date'
if(timeTabID == 2)return 'multiSelector'
if(timeTabID == 3)return 'selector'
},
// picker
timePickerRange(){
let { timeTabID } = this;
if(timeTabID == 0)return [];
if(timeTabID == 2)return this.getMonthRange();
if(timeTabID == 3)return new Array(10).fill(1).map((e,i)=>new Date().getFullYear()-i);
},
// 7
beforeSevenDay(){
let _date = new Date();
let _beforeSeven = _date.getTime() - (7*24*60*60*1000);
return `${util.formatDate({ date: _beforeSeven, partition: 'zh' }).substr(5)}-${util.formatDate({ date: _date, partition: 'zh' }).substr(5)}`
}
},
data(){
return {
tabID: 0,
timeTabID: 0,
pageInfo: {
calc: {}
},
storeList: [], //
curSelectStore: {}, //
curTime: {
date: '',
month: '',
year: '',
},
}
},
onLoad(){
let { timeTabID } = this;
let _timeObj = this.getTime();
this.getBrandInfo({
type: timeTabID + 1,
date: _timeObj.date,
});
this.getStoreList();
this.curTime = _timeObj;
},
methods: {
refreshPageInfo(){
let { tabID, timeTabID, curSelectStore, curTime } = this;
let _date;
if(timeTabID == 0)_date = curTime.date || ''
if(timeTabID == 1)_date = util.formatDate({}).substr(0,10);
if(timeTabID == 2)_date = curTime.month || ''
if(timeTabID == 3)_date = curTime.year || ''
let _query = {
type: timeTabID + 1,
date: _date,
}
if(tabID == 1)_query.stadium_id = curSelectStore.id;
this.getBrandInfo(_query);
},
storeChange(e){
let { storeList } = this;
let { value } = e.detail;
this.curSelectStore = storeList[value];
this.refreshPageInfo();
},
timeChange(e){
let { value } = e.detail;
let { timeTabID, timePickerRange } = this;
if(timeTabID == 0)return this.curTime.date = value;
if(timeTabID == 2)return this.curTime.month = `${timePickerRange[0][value[0]]}-${timePickerRange[1][value[1]]}`;
if(timeTabID == 3)return this.curTime.year = timePickerRange[value];
this.refreshPageInfo();
},
// picker
getMonthRange(){
let _curDate = new Date();
return [
new Array(5).fill(1).map((e,i)=>_curDate.getFullYear()-i),
new Array(12).fill(1).map((e,i)=>util.formatNumber(i+1))
]
},
//
getTime(){
let _date = new Date();
let _year = _date.getFullYear();
let _month = util.formatNumber(_date.getMonth()+1);
let _day = util.formatNumber(_date.getDate());
return {
date: `${_year}-${_month}-${_day}`,
month: `${_year}-${_month}`,
year: _year
}
},
tabChange: util.debounce(function(type){
this.tabID = type;
this.refreshPageInfo();
},300,300),
timeTabChange: util.debounce(function(type){
this.timeTabID = type;
this.refreshPageInfo();
},300,300),
//
getStoreList(){
let { brandInfo } = this;
servers.get({
url: API.stadiumList,
data: {
brand_id: brandInfo.brand.id,
},
failMsg: '加载店铺列表失败!',
})
.then(res=>{
let _list = res.list || [];
this.storeList = _list;
this.curSelectStore = _list[0] || {};
})
},
getBrandInfo({
date,
type,
stadium_id='',
}){
let { brandInfo } = this;
util.showLoad();
servers.get({
url: API.turnoverBrand,
data: {
brand_id: brandInfo.brand.id,
date,
type,// type=1, 2,3,4
stadium_id
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.pageInfo = res;
})
.catch(util.hideLoad)
}
}
}
</script>
@ -92,6 +271,9 @@ export default {
}
.tc-total-section{
border-bottom: 24upx solid #f2f2f7;
>picker{
width: 100%;
}
.tts-address{
padding-left: 48upx;
padding-right: 44upx;
@ -199,7 +381,6 @@ export default {
>image{
width: 40upx;
height: 40upx;
background-color: #4f7ec8;
}
}
.td-tip{

BIN
src/static/images/icon/calendar.png

After

Width: 40  |  Height: 40  |  Size: 199 B

4
src/utils/util.js

@ -23,8 +23,8 @@ export const formatDate = ({ date= new Date(), partition= '-' }) => {
_date = new Date(date)
}
const year = _date.getFullYear();
const month = _date.getMonth() + 1;
const day = _date.getDate();
const month = formatNumber(_date.getMonth() + 1);
const day = formatNumber(_date.getDate());
if(partition == 'zh')return `${year}${month}${day}`
return [year, month, day].map(formatNumber).join(partition);

Loading…
Cancel
Save