3
0
Fork 0
web-store-retail-h5/components/distribution/performanceDistribution.vue

340 lines
7.0 KiB
Vue
Raw Normal View History

2025-03-23 09:29:40 +08:00
<template>
<view>
<view class="date-selector-container">
<view class="date-selector-wrapper">
<view class="date-selector-header">
<text class="date-selector-title">选择查询时间</text>
</view>
<view class="date-selector-content">
<view class="date-picker-item">
<picker
:range="selYearList"
:value="index"
range-key="label"
@change="changeYear"
>
<view class="date-picker-display">
<view class="date-picker-label">年份</view>
<view class="date-picker-value">
<text class="date-text">{{ whatYear }}</text>
<text class="date-unit"></text>
<u-icon name="arrow-down" color="#005BAC" size="24"></u-icon>
</view>
</view>
</picker>
</view>
<view class="date-picker-separator"></view>
<view class="date-picker-item">
<picker
:range="selMounthList"
:value="index"
range-key="label"
@change="bindPickerChange"
>
<view class="date-picker-display">
<view class="date-picker-label">月份</view>
<view class="date-picker-value">
<text class="date-text">{{ whatMounth }}</text>
<text class="date-unit"></text>
<u-icon name="arrow-down" color="#005BAC" size="24"></u-icon>
</view>
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="width-auto"> </view>
</view>
</template>
2025-03-23 09:29:40 +08:00
<script>
import { getPlaceNewAddAchieve } from '@/config/distribute.js'
export default {
data() {
return {
index: 0,
show: false,
achieveData: {},
2025-03-23 09:29:40 +08:00
whatMounth: '',
yjType: 1,
showType: false,
selMounthList: [],
yjTypeList: [],
yearShow: false,
whatYear: '',
selYearList: [
{
value: 0,
label: new Date().getFullYear() - 1,
},
{
value: 1,
label: new Date().getFullYear(),
},
],
mounthList: [
{
value: 1,
label: 1 + '月',
},
{
value: 2,
label: 2 + '月',
},
{
value: 3,
label: 3 + '月',
},
{
value: 4,
label: 4 + '月',
},
{
value: 5,
label: 5 + '月',
},
{
value: 6,
label: 6 + '月',
},
{
value: 7,
label: 7 + '月',
},
{
value: 8,
label: 8 + '月',
},
{
value: 9,
label: 9 + '月',
},
{
value: 10,
label: 10 + '月',
},
{
value: 11,
label: 11 + '月',
},
{
value: 12,
label: 12 + '月',
},
],
}
},
created() {
this.getMounth()
},
methods: {
goDetail(index) {
uni.navigateTo({
url: '/pages/performanceEchart/index?ifDetail=' + index,
})
},
2025-03-23 09:29:40 +08:00
changeYear(e) {
this.whatYear = this.selYearList[e.detail.value].label
this.getPlaceNewAddAchieve()
},
bindPickerChange(e) {
this.whatMounth = e.detail.value + 1
this.getPlaceNewAddAchieve()
},
2025-03-23 09:29:40 +08:00
// 获取当前年/月
getMounth() {
this.whatMounth = new Date().getMonth() + 1
let selMounth = []
this.mounthList.forEach(item => {
// if (item.value <= this.whatMounth) {
// selMounth.push(item)
// }
selMounth.push(item)
})
this.selMounthList = selMounth
this.whatYear = new Date().getFullYear()
},
getPlaceNewAddAchieve() {
getPlaceNewAddAchieve({
monthType: this.whatMounth,
achievementType: this.yjType,
year: this.whatYear,
}).then(res => {
this.achieveData = res.data
})
},
},
}
</script>
2025-03-23 09:29:40 +08:00
<style lang="scss" scoped>
::v-deep .uni-picker {
width: 100%;
}
2025-03-23 09:29:40 +08:00
// 新的日期选择器样式
.date-selector-container {
// width: 100%;
// margin-bottom: 20rpx;
padding: 10rpx;
}
2025-03-23 09:29:40 +08:00
.date-selector-wrapper {
background: linear-gradient(135deg, #005bac 0%, #0074d9 100%);
border-radius: 20rpx;
padding: 20rpx 20rpx;
box-shadow: 0 6rpx 24rpx rgba(0, 91, 172, 0.12);
position: relative;
overflow: hidden;
}
2025-03-23 09:29:40 +08:00
.date-selector-wrapper::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="30" r="1.5" fill="rgba(255,255,255,0.08)"/><circle cx="60" cy="80" r="2.5" fill="rgba(255,255,255,0.06)"/></svg>')
no-repeat;
background-size: cover;
pointer-events: none;
}
2025-03-23 09:29:40 +08:00
.date-selector-header {
margin-bottom: 16rpx;
}
2025-03-23 09:29:40 +08:00
.date-selector-title {
color: #ffffff;
font-size: 24rpx;
font-weight: 600;
opacity: 0.9;
}
2025-03-23 09:29:40 +08:00
.date-selector-content {
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
z-index: 1;
}
2025-03-23 09:29:40 +08:00
.date-picker-item {
flex: 1;
background: rgba(255, 255, 255, 0.95);
border-radius: 12rpx;
padding: 16rpx 16rpx;
backdrop-filter: blur(10rpx);
transition: all 0.3s ease;
}
2025-03-23 09:29:40 +08:00
.date-picker-item:active {
transform: scale(0.98);
background: rgba(255, 255, 255, 0.9);
}
.date-picker-separator {
width: 20rpx;
height: 2rpx;
background: rgba(255, 255, 255, 0.6);
margin: 0 12rpx;
border-radius: 1rpx;
}
.date-picker-display {
display: flex;
flex-direction: column;
align-items: center;
gap: 6rpx;
}
.date-picker-label {
font-size: 22rpx;
color: #666666;
font-weight: 500;
margin-bottom: 2rpx;
}
2025-03-23 09:29:40 +08:00
.date-picker-value {
display: flex;
align-items: center;
justify-content: center;
gap: 4rpx;
}
2025-03-23 09:29:40 +08:00
.date-text {
font-size: 32rpx;
font-weight: 700;
color: #005bac;
line-height: 1;
}
2025-03-23 09:29:40 +08:00
.date-unit {
font-size: 22rpx;
color: #005bac;
font-weight: 500;
margin-right: 6rpx;
}
2025-03-23 09:29:40 +08:00
.title {
padding: 10rpx 0;
margin-top: 10rpx;
}
2025-03-23 09:29:40 +08:00
.width-auto {
background-color: #fff;
padding: 0 22rpx;
width: 690rpx;
margin: 0 auto;
padding-bottom: 20rpx;
}
2025-03-23 09:29:40 +08:00
.listrefor {
color: #ffffff;
border-radius: 10rpx;
padding: 32rpx 21rpx;
margin-top: 25rpx;
display: flex;
justify-content: space-between;
2025-03-23 09:29:40 +08:00
.flex_item:nth-child(1) {
width: 40%;
}
2025-03-23 09:29:40 +08:00
.flex_item:nth-child(2) {
width: 35%;
}
2025-03-23 09:29:40 +08:00
.flex_item:nth-child(3) {
width: 25%;
}
2025-03-23 09:29:40 +08:00
.text1 {
font-size: 28rpx;
}
2025-03-23 09:29:40 +08:00
.text2 {
font-size: 30rpx;
font-weight: bold;
margin-top: 30rpx;
}
}
2025-03-23 09:29:40 +08:00
.bg1 {
background: linear-gradient(180deg, #fc7c7c 0%, #f65757 100%);
}
2025-03-23 09:29:40 +08:00
.bg2 {
background: linear-gradient(180deg, #ff9354 0%, #ff7f36 100%);
}
2025-03-23 09:29:40 +08:00
.bg3 {
background: linear-gradient(180deg, #677af9 0%, #697bf2 100%);
}
</style>