Browse Source

add all

voice
刘嘉炜 4 years ago
parent
commit
9be64485f4
  1. 13
      src/pages.json
  2. 16
      src/pages/collection/detail/detail.vue
  3. 13
      src/pages/collection/record/record.vue
  4. 54
      src/pages/index/index.vue
  5. 9
      src/pages/merchant_info/merchant_info.vue
  6. 9
      src/pages/merchant_login/merchant_login.vue
  7. 30
      src/pages/order_list/order_list.vue
  8. 26
      src/pages/time_select/year/year.vue
  9. 11
      src/pages/turnover/turnover.vue
  10. 10
      src/pages/web_view/web_view.vue
  11. 17
      src/pages/write_off/confirm/confirm.vue
  12. 4
      src/pages/write_off/list/list.vue

13
src/pages.json

@ -1,17 +1,28 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
} }
}, },
{ {
"path": "pages/time_select/year/year",
"style": {
"navigationBarTitleText": "选择时间"
}
},
{
"path": "pages/web_view/web_view",
"style": {
}
},
{
"path": "pages/message/detail/detail", "path": "pages/message/detail/detail",
"style": { "style": {
"navigationBarTitleText": "消息详情" "navigationBarTitleText": "消息详情"
} }
}, },
{ {
"path": "pages/message/list/list", "path": "pages/message/list/list",
"style": { "style": {

16
src/pages/collection/detail/detail.vue

@ -9,9 +9,9 @@
</view> </view>
</picker> </picker>
<view class="co-total"> <view class="co-total">
<view>{{(detail.in_count || 0) + (detail.out_count || 0)}}</view>
<view>收入 ¥ {{detail.in_sum || 0}}</view>
<view>退款 ¥ {{detail.out_sum || 0}}</view>
<view>{{(receiveInfo.in_total || 0) + (receiveInfo.out_total || 0)}}</view>
<view>收入 ¥ {{receiveInfo.in_amount || 0}}</view>
<view>退款 ¥ {{receiveInfo.out_amount || 0}}</view>
</view> </view>
</view> </view>
<view class="cd-tab"> <view class="cd-tab">
@ -45,13 +45,14 @@ export default {
storeInfo: {}, // storeInfo: {}, //
detail: {}, // detail: {}, //
receiveList: [], receiveList: [],
receiveInfo: {}, //
timerArr: [], // timerArr: [], //
curType: 0, curType: 0,
curSelectedDate: { curSelectedDate: {
year: '', year: '',
month: '', month: '',
date: '', date: '',
}
},
} }
}, },
onLoad(options){ onLoad(options){
@ -133,7 +134,10 @@ export default {
}) })
.then(e=>{ .then(e=>{
util.hideLoad(); util.hideLoad();
this.receiveList = e.list || [];
let { list, ..._info } = e;
this.receiveList = list || [];
this.receiveInfo = _info || {};
console.log(_info)
}) })
.catch(util.hideLoad) .catch(util.hideLoad)
} }
@ -182,7 +186,7 @@ export default {
>view{ >view{
flex-grow: 1; flex-grow: 1;
font-size: 24upx; font-size: 24upx;
color: #1a1a1a;
color: #9C9C9F;
@include textHide(1); @include textHide(1);
&:first-child{ &:first-child{
flex-shrink: 0; flex-shrink: 0;

13
src/pages/collection/record/record.vue

@ -24,10 +24,11 @@
</view> </view>
<view class="cr-list"> <view class="cr-list">
<view class="cl-item" v-for="(e,i) in recordList" :key="i" @click="toDetail(e)"> <view class="cl-item" v-for="(e,i) in recordList" :key="i" @click="toDetail(e)">
<view class="ci-time">{{e.date || '-'}}</view>
<view class="ci-time">{{formatDate(e.date || '') }}</view>
<view class="ci-money">¥{{e.sum || 0}}</view> <view class="ci-money">¥{{e.sum || 0}}</view>
<view class="ci-info"> <view class="ci-info">
<view>收款{{e.in_count || 0}}(<text>¥{{e.in_sum || 0}}</text>)退款{{e.out_count || 0}}(<text>¥{{e.out_sum || 0}}</text>)</view>
<view v-if="e.in_count == 0&&e.out_count == 0">当日无交易</view>
<view v-else>收款{{e.in_count || 0}}(<text>¥{{e.in_sum || 0}}</text>)退款{{e.out_count || 0}}(<text>¥{{e.out_sum || 0}}</text>)</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image> <image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view> </view>
</view> </view>
@ -50,6 +51,12 @@ export default {
new Array(12).fill(1).map((e,i)=>util.formatNumber(i+1)) new Array(12).fill(1).map((e,i)=>util.formatNumber(i+1))
] ]
}, },
formatDate(){
return (date = '') => {
if(util.isSameDay(new Date().getTime(), new Date(date.replace(/\-/g,'/')).getTime()))return '今天'
return util.formatDate({ date: date, partition: 'zh' }).substr(5)
}
}
}, },
data(){ data(){
return { return {
@ -238,7 +245,7 @@ export default {
>view{ >view{
flex-grow: 1; flex-grow: 1;
font-size: 24upx; font-size: 24upx;
color: #1a1a1a;
color: #9C9C9F;
@include textHide(1); @include textHide(1);
&:first-child{ &:first-child{
flex-shrink: 0; flex-shrink: 0;

54
src/pages/index/index.vue

@ -15,7 +15,7 @@
<view>{{isLogin?(indexData.in_count || '0'):'**'}}</view> <view>{{isLogin?(indexData.in_count || '0'):'**'}}</view>
</view> </view>
<view> <view>
<view>款笔数</view>
<view>退款笔数</view>
<view>{{isLogin?(indexData.out_count || '0'):'**'}}</view> <view>{{isLogin?(indexData.out_count || '0'):'**'}}</view>
</view> </view>
</view> </view>
@ -68,47 +68,56 @@
{ {
id: 0, id: 0,
name: '营业额', name: '营业额',
path: '/pages/turnover/turnover'
path: '/pages/turnover/turnover',
serverKey: 1001 //
}, },
{ {
id: 1, id: 1,
name: '收款记录', name: '收款记录',
path: '/pages/collection/record/record'
path: '/pages/collection/record/record',
serverKey: 1002 //
}, },
{ {
id: 2, id: 2,
name: '经营分析', name: '经营分析',
path: ''
path: '',
serverKey: 1003 //
}, },
{ {
id: 3, id: 3,
name: '场馆订单', name: '场馆订单',
path: '/pages/order_list/order_list'
path: '/pages/order_list/order_list',
serverKey: 1004 //
}, },
{ {
id: 4, id: 4,
name: '会员卡订单', name: '会员卡订单',
path: '/pages/order_list/order_list'
path: '/pages/order_list/order_list',
serverKey: 1005 //
}, },
{ {
id: 5, id: 5,
name: '积分订单', name: '积分订单',
path: '/pages/order_list/order_list'
path: '/pages/order_list/order_list',
serverKey: 1006 //
}, },
{ {
id: 6, id: 6,
name: '员工管理', name: '员工管理',
path: '/pages/employee/manage/manage'
path: '/pages/employee/manage/manage',
serverKey: 1007 //
}, },
{ {
id: 7, id: 7,
name: '核销查询', name: '核销查询',
path: '/pages/write_off/list/list'
path: '/pages/write_off/list/list',
serverKey: 1008 //
}, },
{ {
id: 8, id: 8,
name: '场地管理', name: '场地管理',
path: ''
path: '',
serverKey: 1009 //
}, },
]; ];
@ -133,10 +142,24 @@
this.isLogin = app.isLogin(); this.isLogin = app.isLogin();
if(!!app.isLogin())this.getIndexInfo(); if(!!app.isLogin())this.getIndexInfo();
}, },
onShow(){
let { indexData } = this;
if(JSON.stringify(indexData)!='{}'&&!!app.isLogin())this.getIndexInfo();
},
methods: { methods: {
toNoticeList(){ toNoticeList(){
if(!app.isLogin())return this.showAuthor();
util.routeTo(`/pages/message/list/list`,'nT'); util.routeTo(`/pages/message/list/list`,'nT');
}, },
toPageInfo(tabInfo){
let { indexData } = this;
let _permission = indexData.permission || {};
if(!app.isLogin())return this.showAuthor();
if(!tabInfo.path)return util.showNone('暂未开放!');
if(!_permission[tabInfo.serverKey])return util.showNone('暂无权限,请联系管理员开启!')
if(this.isOrderTab(tabInfo.id))return util.routeTo(tabInfo.path + `?order_type=${tabInfo.id}`,'nT');
util.routeTo(tabInfo.path,'nT');
},
isOrderTab(ID){ isOrderTab(ID){
return ID == 3 || ID == 4 || ID == 5 return ID == 3 || ID == 4 || ID == 5
}, },
@ -148,6 +171,7 @@
}) })
.then(res=>{ .then(res=>{
this.indexData = res; this.indexData = res;
this.$store.commit('setBrandInfo',res); this.$store.commit('setBrandInfo',res);
}) })
}, },
@ -210,7 +234,7 @@
util.hideLoad(); util.hideLoad();
if(res.data.code == 0){ if(res.data.code == 0){
let _data = res.data.data; let _data = res.data.data;
if(_data.user.role === '')return util.routeTo(`/pages/merchant_login/merchant_login`,'rT');
if(_data.user.role == '')return util.routeTo(`/pages/merchant_login/merchant_login`,'rL');
util.showNone(res.data.message || '登陆成功!'); util.showNone(res.data.message || '登陆成功!');
uni.setStorageSync('token',_data.token); uni.setStorageSync('token',_data.token);
@ -227,13 +251,9 @@
}).catch(util.hideLoad) }).catch(util.hideLoad)
}, },
toPageInfo(tabInfo){
if(!tabInfo.path)return util.showNone('暂未开放!');
let { indexData } = this;
if(this.isOrderTab(tabInfo.id))return util.routeTo(tabInfo.path + `?order_type=${tabInfo.id}`,'nT');
util.routeTo(tabInfo.path,'nT');
},
toStoreList(){ toStoreList(){
if(!app.isLogin())return this.showAuthor();
let { indexData } = this; let { indexData } = this;
util.routeTo(`/pages/store_list/store_list?brand_id=${indexData.brand.id}`,'nT'); util.routeTo(`/pages/store_list/store_list?brand_id=${indexData.brand.id}`,'nT');
}, },

9
src/pages/merchant_info/merchant_info.vue

@ -13,7 +13,7 @@
</view> </view>
<view class="ml-line"> <view class="ml-line">
<view>银行账号</view> <view>银行账号</view>
<view>{{storeInfo.bank_account || '-'}}</view>
<view>{{bankAccount || '-'}}</view>
</view> </view>
<view class="ml-line"> <view class="ml-line">
<view>开户银行</view> <view>开户银行</view>
@ -27,6 +27,13 @@
import { API } from '../../js/api' import { API } from '../../js/api'
import { servers } from '../../js/server' import { servers } from '../../js/server'
export default { export default {
computed: {
bankAccount(){
let { storeInfo } = this;
let _bank_account = storeInfo.bank_account || '';
return _bank_account.replace(/^(.{3})(?:\d+)(.{2})$/,"$1**********$2");
},
},
data(){ data(){
return { return {
storeInfo: {} storeInfo: {}

9
src/pages/merchant_login/merchant_login.vue

@ -3,13 +3,18 @@
<view class="ml-content"> <view class="ml-content">
<view class="mc-title">请联系管理员添加员工账号</view> <view class="mc-title">请联系管理员添加员工账号</view>
<view class="mc-tip">暂无商家</view> <view class="mc-tip">暂无商家</view>
<view class="mc-btn" hover-class="hover-active">成为商家</view>
<view class="mc-btn" hover-class="hover-active" @click="toWebView">成为商家</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import util from '../../utils/util'
export default { export default {
methods: {
toWebView(){
util.routeTo(`/pages/web_view/web_view`,'rL');
}
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">

30
src/pages/order_list/order_list.vue

@ -15,7 +15,7 @@
<text> <text>
{{ {{
!!periodInfo.start&&!!periodInfo.end ? !!periodInfo.start&&!!periodInfo.end ?
`${periodInfo.start} ~ ${periodInfo.end}`:
`${periodInfo.start.replace(/\-/g,'.')} - ${periodInfo.end.replace(/\-/g,'.')}`:
'请选择时间' '请选择时间'
}} }}
</text> </text>
@ -137,7 +137,7 @@
isShowClassify: false, // isShowClassify: false, //
isShowPeriod: false, // isShowPeriod: false, //
curTabID: '', // tabID status curTabID: '', // tabID status
periodInfo: { //
periodInfo: { //
start: '', start: '',
end: '' end: ''
}, },
@ -176,18 +176,40 @@
}, },
onLoad(options){ onLoad(options){
this.orderType = options.order_type;
let _type = options.order_type
this.orderType = _type;
this.$nextTick(_=>{ this.$nextTick(_=>{
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.titleName title: this.titleName
}) })
}) })
let defaultTime = this.getDefaultTimeLimit(_type);
this.periodInfo = defaultTime;
this.getStoreList(); this.getStoreList();
this.getOrderList({ this.getOrderList({
orderType: options.order_type
begin: defaultTime.start,
end: defaultTime.end,
orderType: _type
}) })
}, },
methods: { methods: {
//
// 3->,4->,5->
getDefaultTimeLimit(type){
let _date = new Date();
let _sevenTimeStemp = 7*24*60*60*1000;
let _beforeSeven = _date.getTime() - _sevenTimeStemp;
let _afterSeven = _date.getTime() + _sevenTimeStemp;
let _obj = {
start: '',
end: ''
}
if(type == 3)_obj['start']=util.formatDate({}),_obj['end'] = util.formatDate({date: _afterSeven});
if(type == 4)_obj['start']=util.formatDate({date: _beforeSeven}),_obj['end'] = util.formatDate({});
console.log(_obj)
return _obj;
},
// //
refreshList(){ refreshList(){
let { curTabID, periodInfo, orderType, curSelectedStore, page } = this; let { curTabID, periodInfo, orderType, curSelectedStore, page } = this;

26
src/pages/time_select/year/year.vue

@ -0,0 +1,26 @@
<template>
<view class="time-year">
<view class="ty-tip">仅保留最近10年日报数据</view>
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
@import "../../../style/public.scss";
.time-year{
.ty-tip{
margin: 0 auto 86upx;
width: 600upx;
height: 166upx;
line-height: 164upx;
text-align: center;
border-bottom: 2upx solid #D8D8D8;
font-size: 28upx;
color: #9C9C9F;
}
}
</style>

11
src/pages/turnover/turnover.vue

@ -142,8 +142,8 @@ export default {
let _date; let _date;
if(timeTabID == 0)_date = curTime.date || '' if(timeTabID == 0)_date = curTime.date || ''
if(timeTabID == 1)_date = util.formatDate({}).substr(0,10); if(timeTabID == 1)_date = util.formatDate({}).substr(0,10);
if(timeTabID == 2)_date = curTime.month || ''
if(timeTabID == 3)_date = curTime.year || ''
if(timeTabID == 2)_date = `${curTime.month}-01` || '' //
if(timeTabID == 3)_date = `${curTime.year}-01-01` || ''//
let _query = { let _query = {
type: timeTabID + 1, type: timeTabID + 1,
@ -163,9 +163,10 @@ export default {
let { value } = e.detail; let { value } = e.detail;
let { timeTabID, timePickerRange } = this; 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];
if(timeTabID == 0) this.curTime.date = value;
if(timeTabID == 2) this.curTime.month = `${timePickerRange[0][value[0]]}-${timePickerRange[1][value[1]]}`;
if(timeTabID == 3) this.curTime.year = timePickerRange[value];
this.refreshPageInfo(); this.refreshPageInfo();
}, },
// picker // picker

10
src/pages/web_view/web_view.vue

@ -0,0 +1,10 @@
<template>
<web-view src="https://www.ouxuanzhineng.cn"></web-view>
</template>
<script>
export default {
onLoad(){
}
}
</script>

17
src/pages/write_off/confirm/confirm.vue

@ -42,9 +42,9 @@
<view class="white" hover-class="hover-active" @click="cancelVerify">不核销</view> <view class="white" hover-class="hover-active" @click="cancelVerify">不核销</view>
</view> </view>
</view> </view>
<view class="woc-fail-modal" v-if="orderInfo == null">
<view class="woc-fail-modal" v-if="orderInfo == null || orderInfo.pay_status !=-1">
<image mode="aspectFit" src="/static/images/icon/write_off_fail.png"></image> <image mode="aspectFit" src="/static/images/icon/write_off_fail.png"></image>
<view>很抱歉获取不到二维码订单信息</view>
<view>{{errorTip}}</view>
<view hover-class="hover-active" @click="cancelVerify">返回</view> <view hover-class="hover-active" @click="cancelVerify">返回</view>
</view> </view>
</view> </view>
@ -63,6 +63,18 @@ export default {
return `${util.get_zh_date(_date)} ${util.get_zh_day(_date)}`; return `${util.get_zh_date(_date)} ${util.get_zh_day(_date)}`;
} }
}, },
errorTip(){
// 2使34退
// 使 使
// 退 退
//
//
let { orderInfo } = this;
if(orderInfo&&orderInfo.pay_status == 2)return '该订单已核销使用';
if(orderInfo&&orderInfo.pay_status == 3)return '该订单已失效';
if(orderInfo&&orderInfo.pay_status == 4)return '该订单已退款';
return '很抱歉,获取不到二维码订单信息';
},
}, },
data(){ data(){
return { return {
@ -122,6 +134,7 @@ export default {
}) })
.then(res=>{ .then(res=>{
util.hideLoad(); util.hideLoad();
if(res.data.code == 0)return this.orderInfo = res.data.data; if(res.data.code == 0)return this.orderInfo = res.data.data;
this.orderInfo = null this.orderInfo = null
util.showNone(res.data.message || '加载失败!'); util.showNone(res.data.message || '加载失败!');

4
src/pages/write_off/list/list.vue

@ -105,7 +105,9 @@ export default {
if(isLoad)util.showLoad(); if(isLoad)util.showLoad();
servers.get({ servers.get({
url: API.verifiedOrderList, url: API.verifiedOrderList,
data: {},
data: {
status: 1
},
failMsg: '获取订单列表失败!' failMsg: '获取订单列表失败!'
}) })
.then(res=>{ .then(res=>{

Loading…
Cancel
Save