小程序提交
This commit is contained in:
@ -1,66 +1,76 @@
|
||||
import { baseUrl } from "../../../request";
|
||||
|
||||
// pages/dashboardModule/overviewPerformance/overviewPerformance.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
totalAmount: 0, // 订单总金额
|
||||
netAmount: 0, // 净成交
|
||||
promoCount: 0, // 客户数量
|
||||
superCount: 0, // 主管数量
|
||||
empCount: 0, // 员工数量
|
||||
orderCount: 0, // 下单数量
|
||||
toRelease: 0, // 待释放
|
||||
toSettle: 0, // 可结算
|
||||
settled: 0, // 已结算
|
||||
refunded: 0, // 已退回
|
||||
todayOrderCount: 0, // 今日下单数量
|
||||
todayOrderAmount: 0, // 今日下单总金额
|
||||
todayRefundCount: 0, // 今日退款数量
|
||||
todayRefundAmount: 0, // 今日退款总金额
|
||||
todayPromotionCount: 0, // 今日推广数量
|
||||
monthOrderCount: 0, // 本月下单数量
|
||||
monthOrderAmount: 0, // 本月下单总金额
|
||||
monthRefundCount: 0, // 本月退款数量
|
||||
monthRefundAmount: 0, // 本月退款总金额
|
||||
monthPromotionCount: 0, // 本月推广数量
|
||||
userRole: '', // 用户角色
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
console.log('--->',options);
|
||||
this.fetchPerformance();
|
||||
this.setData({
|
||||
userRole: options.role
|
||||
})
|
||||
let showRole = '';
|
||||
switch (options.role) {
|
||||
case 'manager':
|
||||
showRole = '经理';
|
||||
break;
|
||||
case 'supervisor':
|
||||
showRole = '主管';
|
||||
break;
|
||||
case 'staff':
|
||||
showRole = '员工';
|
||||
break;
|
||||
}
|
||||
this.setData({ showRole });
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
fetchPerformance() {
|
||||
wx.request({
|
||||
url: baseUrl + '/perform/mini/query/dashboard',
|
||||
method: 'POST',
|
||||
header: {
|
||||
Authorization: wx.getStorageSync('token')
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.code === 1) {
|
||||
// 直接把后端 data 对象铺平到页面 data
|
||||
this.setData(res.data.data);
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.data.message || '获取数据失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.showToast({
|
||||
title: '请求失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -1,2 +1,91 @@
|
||||
<!--pages/dashboardModule/overviewPerformance/overviewPerformance.wxml-->
|
||||
<text>pages/dashboardModule/overviewPerformance/overviewPerformance.wxml</text>
|
||||
<view class="flex-col page">
|
||||
<text class="self-center text">{{ showRole }}端绩效总览</text>
|
||||
<view class="flex-col justify-start self-stretch relative group mt-41">
|
||||
<view class="flex-col group_2">
|
||||
|
||||
<!-- 今日数据 -->
|
||||
<view class="flex-row equal-division">
|
||||
<view class="flex-col items-start equal-division-item section">
|
||||
<text class="font_3 text_8">今日数据</text>
|
||||
<text class="font text_10">今日下单数量</text>
|
||||
<text class="font_2 text_12">{{todayOrderCount}}</text>
|
||||
<text class="font text_14">今日订单总金额</text>
|
||||
<text class="font_2 text_16">¥{{todayOrderAmount}}</text>
|
||||
<text class="font text_18">今日退单数量</text>
|
||||
<text class="font_2 text_20">{{todayRefundCount}}</text>
|
||||
<text class="font text_22">今日退款总金额</text>
|
||||
<text class="font_2 text_24">¥{{todayRefundAmount}}</text>
|
||||
<text class="font_4 text_26">今日推广数量</text>
|
||||
<text class="font_2 text_28">{{todayPromotionCount}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 本月数据 -->
|
||||
<view class="flex-col items-start equal-division-item section_2 ml-19">
|
||||
<text class="font_3 text_9">本月数据</text>
|
||||
<text class="font text_11">本月下单数量</text>
|
||||
<text class="font_2 text_13">{{monthOrderCount}}</text>
|
||||
<text class="font text_15">本月订单总金额</text>
|
||||
<text class="font_2 text_17">¥{{monthOrderAmount}}</text>
|
||||
<text class="font text_19">本月退单数量</text>
|
||||
<text class="font_2 text_21">{{monthRefundCount}}</text>
|
||||
<text class="font text_23">本月退款总金额</text>
|
||||
<text class="font_2 text_25">¥{{monthRefundAmount}}</text>
|
||||
<text class="font_4 text_27">本月推广数量</text>
|
||||
<text class="font_2 text_29">{{monthPromotionCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 财务状态 -->
|
||||
<view class="mt-30 flex-col section_3">
|
||||
<text class="self-start font_3">财务状态</text>
|
||||
<view class="mt-26 flex-col self-stretch">
|
||||
<view class="flex-row justify-between items-baseline">
|
||||
<text class="font text_30">待释放</text>
|
||||
<text class="font_2 text_31">{{toRelease}}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-baseline mt-19">
|
||||
<text class="font text_32">可结算</text>
|
||||
<text class="font_2 text_33">{{toSettle}}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-baseline mt-19">
|
||||
<text class="font text_34">已结算</text>
|
||||
<text class="font_2 text_35">{{settled}}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-baseline mt-19">
|
||||
<text class="font text_36">已退回</text>
|
||||
<text class="font_2 text_37">{{refunded}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 底部网格 -->
|
||||
<view class="grid pos">
|
||||
<view class="flex-col items-center grid-item">
|
||||
<text class="font text_2">主管数量</text>
|
||||
<text class="mt-20 font_2">{{superCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item">
|
||||
<text class="font text_3">员工数量</text>
|
||||
<text class="mt-20 font_2">{{empCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item">
|
||||
<text class="font text_4">客户数量</text>
|
||||
<text class="mt-20 font_2">{{promoCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
<text class="font text_5">订单总金额</text>
|
||||
<text class="mt-20 font_2">¥{{totalAmount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
<text class="font text_6">订单净成交</text>
|
||||
<text class="mt-20 font_2">¥{{netAmount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
<text class="font text_7">下单数量</text>
|
||||
<text class="mt-20 font_2">{{orderCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1 +1,252 @@
|
||||
/* pages/dashboardModule/overviewPerformance/overviewPerformance.wxss */
|
||||
.mt-41 {
|
||||
margin-top: 76.88rpx;
|
||||
}
|
||||
.ml-19 {
|
||||
margin-left: 35.63rpx;
|
||||
}
|
||||
.mt-19 {
|
||||
margin-top: 35.63rpx;
|
||||
}
|
||||
.page {
|
||||
padding-top: 71.25rpx;
|
||||
background-color: #fefbf6;
|
||||
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
.text {
|
||||
color: #e67e22;
|
||||
font-size: 45rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
font-weight: 700;
|
||||
line-height: 42.71rpx;
|
||||
}
|
||||
.group {
|
||||
padding-top: 168.75rpx;
|
||||
}
|
||||
.group_2 {
|
||||
margin-right: 33.75rpx;
|
||||
padding: 138.75rpx 0 120rpx 41.25rpx;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
}
|
||||
.equal-division {
|
||||
padding-top: 48.75rpx;
|
||||
}
|
||||
.equal-division-item {
|
||||
flex: 1 1 320.63rpx;
|
||||
}
|
||||
.section {
|
||||
padding: 41.25rpx 33.75rpx 33.75rpx;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.38rpx;
|
||||
height: 684.38rpx;
|
||||
border-left: solid 5.88rpx #e67e22;
|
||||
/* border-right: solid 1.88rpx #e67e22; */
|
||||
border-top: solid 5.88rpx #e67e22;
|
||||
/* border-bottom: solid 1.88rpx #e67e22; */
|
||||
}
|
||||
.font_3 {
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 28.01rpx;
|
||||
color: #e67e22;
|
||||
}
|
||||
.text_8 {
|
||||
line-height: 28.24rpx;
|
||||
}
|
||||
.font {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 22.91rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.text_10 {
|
||||
margin-top: 33.75rpx;
|
||||
line-height: 24.69rpx;
|
||||
}
|
||||
.text_14 {
|
||||
margin-top: 41.25rpx;
|
||||
line-height: 24.75rpx;
|
||||
}
|
||||
.text_18 {
|
||||
margin-top: 41.25rpx;
|
||||
line-height: 24.69rpx;
|
||||
}
|
||||
.text_22 {
|
||||
margin-top: 41.25rpx;
|
||||
line-height: 24.75rpx;
|
||||
}
|
||||
.font_4 {
|
||||
font-size: 26.25rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 24.92rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.text_26 {
|
||||
margin-top: 41.25rpx;
|
||||
}
|
||||
.section_2 {
|
||||
padding: 41.25rpx 33.75rpx 33.75rpx;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.38rpx;
|
||||
height: 684.38rpx;
|
||||
border-left: solid 5.88rpx #f1c40f;
|
||||
/* border-right: solid 1.88rpx #f1c40f; */
|
||||
border-top: solid 5.88rpx #f1c40f;
|
||||
/* border-bottom: solid 1.88rpx #f1c40f; */
|
||||
}
|
||||
.text_9 {
|
||||
color: #f1c40f;
|
||||
line-height: 27.99rpx;
|
||||
}
|
||||
.text_11 {
|
||||
margin-top: 33.75rpx;
|
||||
line-height: 24.69rpx;
|
||||
}
|
||||
.text_15 {
|
||||
margin-top: 41.25rpx;
|
||||
line-height: 24.75rpx;
|
||||
}
|
||||
.text_19 {
|
||||
margin-top: 41.25rpx;
|
||||
line-height: 24.69rpx;
|
||||
}
|
||||
.text_23 {
|
||||
margin-top: 41.25rpx;
|
||||
line-height: 24.75rpx;
|
||||
}
|
||||
.text_27 {
|
||||
margin-top: 41.25rpx;
|
||||
}
|
||||
.section_3 {
|
||||
padding: 37.5rpx 20rpx 37.5rpx 33.75rpx;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.38rpx;
|
||||
border-left: solid 5.88rpx #e67e22;
|
||||
/* border-right: solid 1.88rpx #e67e22; */
|
||||
border-top: solid 5.88rpx #e67e22;
|
||||
/* border-bottom: solid 1.88rpx #e67e22; */
|
||||
}
|
||||
.text_30 {
|
||||
line-height: 24.3rpx;
|
||||
}
|
||||
.text_32 {
|
||||
line-height: 24.3rpx;
|
||||
}
|
||||
.text_34 {
|
||||
line-height: 24.3rpx;
|
||||
}
|
||||
.text_36 {
|
||||
line-height: 24.3rpx;
|
||||
}
|
||||
.grid {
|
||||
height: 306.56rpx;
|
||||
display: grid;
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
row-gap: 32.94rpx;
|
||||
column-gap: 50.19rpx;
|
||||
}
|
||||
.pos {
|
||||
position: absolute;
|
||||
left: 39.38rpx;
|
||||
right: 33rpx;
|
||||
top: 0;
|
||||
}
|
||||
.grid-item {
|
||||
padding: 22.5rpx 0;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.38rpx;
|
||||
border-left: solid 5.88rpx #e67e22;
|
||||
/* border-right: solid 1.88rpx #e67e22; */
|
||||
border-top: solid 5.88rpx #e67e22;
|
||||
/* border-bottom: solid 1.88rpx #e67e22; */
|
||||
}
|
||||
.text_2 {
|
||||
line-height: 24.34rpx;
|
||||
}
|
||||
.font_2 {
|
||||
font-size: 30rpx;
|
||||
font-family: SourceHanSansCN;
|
||||
line-height: 22.91rpx;
|
||||
color: #e67e22;
|
||||
}
|
||||
.text_37 {
|
||||
margin-right: 7.5rpx;
|
||||
}
|
||||
.text_35 {
|
||||
margin-right: 3.75rpx;
|
||||
}
|
||||
.text_33 {
|
||||
margin-right: 3.75rpx;
|
||||
}
|
||||
.text_31 {
|
||||
margin-right: 3.75rpx;
|
||||
}
|
||||
.text_29 {
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_25 {
|
||||
margin-left: 3.75rpx;
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_21 {
|
||||
margin-top: 26.25rpx;
|
||||
line-height: 22.54rpx;
|
||||
}
|
||||
.text_17 {
|
||||
margin-left: 3.75rpx;
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_13 {
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_28 {
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_24 {
|
||||
margin-left: 3.75rpx;
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_20 {
|
||||
margin-top: 26.25rpx;
|
||||
line-height: 22.54rpx;
|
||||
}
|
||||
.text_16 {
|
||||
margin-left: 3.75rpx;
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_12 {
|
||||
margin-top: 26.25rpx;
|
||||
}
|
||||
.text_3 {
|
||||
line-height: 24.28rpx;
|
||||
}
|
||||
.text_4 {
|
||||
line-height: 24.54rpx;
|
||||
}
|
||||
.grid-item_2 {
|
||||
padding: 22.5rpx 0;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.38rpx;
|
||||
border-left: solid 5.88rpx #f1c40f;
|
||||
/* border-right: solid 1.88rpx #f1c40f; */
|
||||
border-top: solid 5.88rpx #f1c40f;
|
||||
/* border-bottom: solid 1.88rpx #f1c40f; */
|
||||
}
|
||||
.text_5 {
|
||||
line-height: 24.49rpx;
|
||||
}
|
||||
.text_6 {
|
||||
line-height: 24.56rpx;
|
||||
}
|
||||
.text_7 {
|
||||
line-height: 24.26rpx;
|
||||
}
|
Reference in New Issue
Block a user