<template>
|
<view class="yy">
|
<view class="yy_title">欢迎回来,{{userInfo.sysuser.username}}~</view>
|
<view class="yy_info">{{getWeek()}}</view>
|
<view class="yy_cate">
|
<view class="yy_cate_item" style="margin-bottom: 40rpx;">
|
<image src="/pagesA/static/yingshou_ic_zongdingdan@2x.png" mode="widthFix"></image>
|
<view class="yy_cate_item_info">
|
<text>{{info.todayOrderCount || 0}}</text>
|
<text>今日订单</text>
|
</view>
|
</view>
|
<view class="yy_cate_item" style="margin-bottom: 40rpx;">
|
<image src="/pagesA/static/yingshou_ic_zongwancheng@2x.png" mode="widthFix"></image>
|
<view class="yy_cate_item_info">
|
<text>{{info.ongoingOrderCount || 0}}</text>
|
<text>进行中订单</text>
|
</view>
|
</view>
|
<view class="yy_cate_item">
|
<image src="/pagesA/static/yingshou_ic_zongyingshou@2x.png" mode="widthFix"></image>
|
<view class="yy_cate_item_info">
|
<text>{{info.packageIncome || 0}}</text>
|
<text>套餐收入(元)</text>
|
</view>
|
</view>
|
<view class="yy_cate_item">
|
<image src="/pagesA/static/yingshou_ic_siji@2x.png" mode="widthFix"></image>
|
<view class="yy_cate_item_info">
|
<text>{{info.totalIncome || 0}}</text>
|
<text>今日收入(元)</text>
|
</view>
|
</view>
|
</view>
|
<view class="yy_image" @click="jump(1)">
|
<image src="/pagesA/static/home_img_zulingxuzhi.png" mode="widthFix"></image>
|
</view>
|
<view class="yy_image" @click="jump(2)">
|
<image src="/pagesA/static/home_img_zulingxuzhi@2.png" mode="widthFix"></image>
|
</view>
|
<view class="yy_image" @click="jump(3)">
|
<image src="/pagesA/static/home_img_zulingxuzhi@.png" mode="widthFix"></image>
|
</view>
|
<view class="yy_btn" @click="logout">退出登录</view>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
computed: {
|
...mapState(['userInfo'])
|
},
|
data() {
|
return {
|
info: null
|
};
|
},
|
onLoad() {
|
this.getData()
|
},
|
methods: {
|
jump(type) {
|
if (type === 1) {
|
uni.navigateTo({
|
url: '/pages/operationList/operationList'
|
})
|
} else if (type === 2) {
|
uni.navigateTo({
|
url: '/pages/order/order'
|
})
|
} else {
|
uni.navigateTo({
|
url: '/pages/businessOverview/businessOverview'
|
})
|
}
|
},
|
getData() {
|
this.$u.api.operationCenter({})
|
.then(res => {
|
if (res.code == 200) {
|
this.info = res.data
|
}
|
})
|
},
|
getWeek() {
|
let today = new Date();
|
let dayOfWeek = today.getDay();
|
let weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
|
let weekdayName = weekdays[dayOfWeek];
|
|
const date = new Date();
|
const month = date.getMonth() + 1;
|
const day = date.getDate();
|
|
return month + '月' + day + '日' + ',' + weekdayName;
|
},
|
logout() {
|
uni.showLoading({ title: '加载中' });
|
this.$u.api.logout()
|
.then(res => {
|
if (res.code === 200) {
|
uni.hideLoading();
|
this.$store.commit('setUserInfo', res.data)
|
uni.navigateBack({ delta: 1 });
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.yy {
|
width: 100%;
|
padding: 40rpx 30rpx;
|
box-sizing: border-box;
|
.yy_title {
|
font-weight: 600;
|
font-size: 40rpx;
|
color: #333333;
|
}
|
.yy_info {
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #999999;
|
margin-top: 24rpx;
|
}
|
.yy_cate {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background: #F8F9FB;
|
border-radius: 20rpx;
|
margin-top: 30rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
flex-wrap: wrap;
|
.yy_cate_item {
|
width: 50%;
|
display: flex;
|
align-items: center;
|
image {
|
width: 68rpx;
|
height: 68rpx;
|
margin-right: 24rpx;
|
}
|
.yy_cate_item_info {
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
text {
|
&:nth-child(1) {
|
font-weight: normal;
|
font-size: 32rpx;
|
color: #222222;
|
}
|
&:nth-child(2) {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #999999;
|
margin-top: 12rpx;
|
}
|
}
|
}
|
}
|
}
|
.yy_image {
|
width: 100%;
|
height: 182rpx;
|
margin-top: 30rpx;
|
image {
|
width: 100%;
|
}
|
}
|
.yy_btn {
|
position: fixed;
|
left: 50%;
|
bottom: calc(env(safe-area-inset-bottom) + 40rpx);
|
width: 200rpx;
|
height: 72rpx;
|
transform: translate(-50%, 0);
|
line-height: 72rpx;
|
text-align: center;
|
border-radius: 36rpx;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #01B6AD;
|
border: 1rpx solid #01B6AD;
|
}
|
}
|
</style>
|