Commit e47ea524 by 张立顺

功能联调完成

1 parent d7bd9661
@font-face { @font-face {
font-family: "number"; font-family: "number";
src: url("https://img02.glsx.com.cn/weapp/resource/saas/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf"); src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf");
} }
@font-face { @font-face {
font-family: "numberBold"; font-family: "numberBold";
src: url("https://img02.glsx.com.cn/weapp/resource/saas/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf"); src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf");
} }
image { image {
......
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
Component({
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
this.triggerEvent('tapCalendar')
},
dateChange(e) {
let { current, source } = e.detail
// console.log(source)
// console.log(current)
/**
* 根据官方 source 来进行判断swiper的change事件是通过什么来触发的,autoplay是自动轮播。
* touch是用户手动滑动。其他的就是未知问题。抖动问题主要由于未知问题引起的,所以做了限制
* 只有在自动轮播和用户主动触发才去改变current值,达到规避了抖动bug
*/
source == 'touch' &&
this.setData({
current
})
},
bindDateChange: function (e) {
var date = e.detail.value
console.log(date)
this.setData({
date: date
})
this.post_data.year = date
this.renderHtml()
},
choose(e) {
let { dateType, minDate, maxDate } = this.data
let { data } = e.currentTarget.dataset
// console.log((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data)))
console.log(minDate && Date.parse(minDate) > Date.parse(data))
console.log(maxDate && Date.parse(maxDate) < Date.parse(data))
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
monChoose(e) {
let { data, type } = e.currentTarget.dataset
if (data.disable) return false
this[CalendarFunction][type](e)
},
done() {
let { dateType } = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
console.log(value)
this.setData({
current: value
})
},
bindYearChange(e) {
let { value } = e.detail
this.setData({
yearCurrent: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
showShortcutPickerYear() {
this.setData({
showShortcutYear: !this.data.showShortcutYear
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
},
changeModel() {
let { dayType } = this.data
this.setData({
dayType: dayType == 0 ? 1 : 0
})
}
},
ready() {
// console.log(this)
// return
this[CalendarFunction] = new Calendar(this)
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot />
</view>
<!-- 弹框模式 -->
<!-- 先取消 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar" />
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{(isFullSucreen&&!showConfirm)?"isFullSucreen":""}} ' style="height:{{height}};">
<!-- 按日期选择 开始 -->
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<!-- <block wx:if="{{rangeAll && dateType == 'range'}}"> -->
<!-- bindtap="chooseAll" -->
<view class="calender-all" style="color:{{calenderColor}};" bindtap="changeModel">
{{dateObj['tips'][dayType]}}
</view>
<!-- </block> -->
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image src="./images/close.png" class='calender-close-image' />
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<!-- <block hidden="{{!dayType}}"> -->
<picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut&&dayType}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}' />
</view>
</picker>
<picker class='calender-subtitle' value="{{yearCurrent}}" bindcancel='showShortcutPickerYear' range="{{monPickList}}" wx:elif='{{shortcut&&!dayType}}' bindchange="bindYearChange">
<view class='calender-subtitle-text' bindtap="showShortcutPickerYear`">
{{monPickList[yearCurrent]}}
<view class='arrow {{showShortcutYear}}' />
</view>
</picker>
<view class='calender-subtitle' wx:else>{{monPickList[current]}}</view>
<!-- </block> -->
<!-- <block hidden="{{dayType}}"> -->
<!-- </block> -->
</block>
<view class='calendar-weekdays' hidden="{{!dayType}}">
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<!-- 日期 -->
<swiper hidden="{{!dayType}}" class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}' />
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper>
<!-- 月份 wx:if="{{!dayType}}" -->
<div class='calenderMonth'>
<swiper hidden="{{dayType}}" class='calender-year ' bindchange='dateChange' current='{{yearCurrent}}' vertical='{{vertical}}'>
<block wx:for="{{yearList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<swiper-item class="calenderMonth">
<block wx:for="{{item}}" wx:for-item="monItem" wx:for-index="monIndex" wx:key="monIndex">
<view bindtap="monChoose" data-type="month" data-index="{{monIndex}}" data-yearindex="{{index}}" data-data="{{monItem}}" class="monItem {{monItem.start?'active':''}} {{monItem.select?'select':''}} {{monItem.end?'end':''}} {{monItem.disable?'disable':''}}">
<view>{{monItem.label}}</view>
<view class="text" wx:if="{{monItem.start}}">开始</view>
<view class="text" wx:if="{{monItem.end}}">结束</view>
</view>
</block>
</swiper-item>
</block>
</swiper>
</div>
</view>
<!-- 月份 结束 -->
<view class='calender-footer {{isFullSucreen?true:""}} ' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 100%;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, .5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender .5s forwards;
color: #333;
}
.calender-view.true {
border-radius: 40rpx 40rpx 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: 34px !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender .5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.10);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: 88rpx;
text-align: center;
position: relative;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: 40rpx;
transform: translateY(-50%);
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: 28rpx;
}
.calender-subtitle .arrow {
width: 14rpx;
height: 14rpx;
border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent;
transform: rotate(45deg) translateY(-4rpx);
margin-left: 16rpx;
transition: all .3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(-4rpx);
}
.calender-close {
position: absolute;
width: 40rpx;
height: 40rpx;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: 24rpx;
height: 24rpx;
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: 24rpx;
line-height: 60rpx;
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: 20rpx 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: #F2F3F5;
text-shadow: 0 4rpx 20rpx #F2F3F5;
font-size: 320rpx;
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: 32rpx;
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: 8rpx;
}
.calender-day.disable {
opacity: .25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: 14rpx;
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-year {
/* display: flex;
flex-wrap: wrap; */
width: 100%;
height: 100%;
}
.calenderMonth {
display: flex;
flex-wrap: wrap;
width: 100%;
height: 100%;
}
.monItem {
box-sizing: border-box;
width: 25%;
height: 186rpx;
font-size: 32rpx;
/* text-align: center; */
/* line-height: 186rpx; */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-wrap: wrap;
color: #666666;
border: 1rpx solid #fff;
}
.monItem .text {
font-size: 20rpx;
margin-top: 5rpx;
}
.monItem.select {
color: #3582EE;
/* background: #3582EE;
opacity: 0.1; */
background-color: rgba(53, 130, 238, .1);
}
.monItem.active {
color: #fff;
background: #3582EE;
border-radius: 8px 0px 0px 8px;
}
.monItem.end {
color: #fff;
background: #3582EE;
border-radius: 0px 8px 8px 0px;
}
.monItem.disable {
color: #C8C9CC;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 14rpx 32rpx;
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: 72rpx;
font-size: 28rpx;
color: #fff;
border-radius: 999rpx;
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: .3;
}
\ No newline at end of file \ No newline at end of file
export default {
properties: {
calenderHeight: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: String,
optionalTypes: [Number]
},
title: String, // 标题名称
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#00A479'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: Number,
optionalTypes: [Number],
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean,
isComponents: Boolean
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
monPickList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: [],
date: '',
yearCurrent: 0,
yearList: [],
rangeMonth: {},
// MonthShowList: [
// {
// label: '1月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '2月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '3月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '4月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '5月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '6月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '7月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '8月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '9月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '10月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '11月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '12月',
// disable: false,
// start: false,
// end: false,
// select: false
// }
// ],
dayType: 1, // 1 日期 0 月份 默认日期
dateObj: {
// switch:'按月份',
// type:'day',
tips: ['按日期', '按月份']
}
}
}
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
Component({
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
this.triggerEvent('tapCalendar')
},
dateChange(e) {
let { current, source } = e.detail
// console.log(source)
console.log(current)
/**
* 根据官方 source 来进行判断swiper的change事件是通过什么来触发的,autoplay是自动轮播。
* touch是用户手动滑动。其他的就是未知问题。抖动问题主要由于未知问题引起的,所以做了限制
* 只有在自动轮播和用户主动触发才去改变current值,达到规避了抖动bug
*/
source == 'touch' &&
this.setData({
current
})
},
bindDateChange: function (e) {
var date = e.detail.value
console.log(date)
this.setData({
date: date
})
this.post_data.year = date
this.renderHtml()
},
choose(e) {
let { dateType, minDate, maxDate } = this.data
let { data } = e.currentTarget.dataset
// console.log((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data)))
console.log(minDate && Date.parse(minDate) > Date.parse(data))
console.log(maxDate && Date.parse(maxDate) < Date.parse(data))
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
monChoose(e) {
let { dateType } = this.data
let { data, type } = e.currentTarget.dataset
if (data.disable) return false
this[CalendarFunction][dateType](e)
},
done() {
let { dateType } = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
console.log(value)
this.setData({
current: value
})
},
bindYearChange(e) {
let { value } = e.detail
this.setData({
yearCurrent: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
showShortcutPickerYear() {
this.setData({
showShortcutYear: !this.data.showShortcutYear
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
},
changeModel() {
let { dayType } = this.data
this.setData({
dayType: dayType == 0 ? 1 : 0
})
}
},
ready() {
// console.log(this)
// return
this[CalendarFunction] = new Calendar(this)
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot />
</view>
<!-- 弹框模式 -->
<!-- 先取消 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar" />
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{(isFullSucreen&&!showConfirm)?"isFullSucreen":""}} ' style="height:{{height}};">
<!-- 按日期选择 开始 -->
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<!-- <block wx:if="{{rangeAll && dateType == 'range'}}"> -->
<!-- bindtap="chooseAll" -->
<!-- <view class="calender-all" style="color:{{calenderColor}};" bindtap="changeModel">
{{dateObj['tips'][dayType]}}
</view> -->
<!-- </block> -->
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image src="./images/close.png" class='calender-close-image' />
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<!-- <block hidden="{{!dayType}}"> -->
<!-- <picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut&&dayType}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}' />
</view>
</picker> -->
<!-- wx:elif='{{shortcut&&!dayType}}' -->
<picker class='calender-subtitle' value="{{yearCurrent}}" bindcancel='showShortcutPickerYear' range="{{monPickList}}" bindchange="bindYearChange">
<view class='calender-subtitle-text' bindtap="showShortcutPickerYear`">
{{monPickList[yearCurrent]}}
<view class='arrow {{showShortcutYear}}' />
</view>
</picker>
</block>
<view class='calendar-weekdays' hidden="{{!dayType}}">
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<!-- 日期 -->
<!-- <swiper hidden="{{!dayType}}" class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}' />
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper> -->
<!-- 月份 wx:if="{{!dayType}}" hidden="{{dayType}}" -->
<div class='calenderMonth'>
<swiper class='calender-year ' bindchange='dateChange' current='{{yearCurrent}}' vertical='{{vertical}}'>
<block wx:for="{{yearList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<swiper-item class="calenderMonth">
<block wx:for="{{item}}" wx:for-item="monItem" wx:for-index="monIndex" wx:key="monIndex">
<!-- {{monItem.end?'end':''}} {{monItem.select?'select':''}}-->
<view bindtap="monChoose" data-type="month" data-index="{{monIndex}}" data-yearindex="{{index}}" data-data="{{monItem}}" class="monItem {{monItem.active?'active':''}} {{monItem.disable?'disable':''}}">
<view>{{monItem.label}}</view>
<!-- <view class="text" wx:if="{{monItem.start}}">开始</view>
<view class="text" wx:if="{{monItem.end}}">结束</view> -->
</view>
</block>
</swiper-item>
</block>
</swiper>
</div>
</view>
<!-- 月份 结束 -->
<view class='calender-footer {{isFullSucreen?true:""}} ' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 100%;
height: 100%;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, .5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender .5s forwards;
color: #333;
}
.calender-view.true {
border-radius: 40rpx 40rpx 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: 34px !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender .5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.10);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: 88rpx;
text-align: center;
position: relative;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: 40rpx;
transform: translateY(-50%);
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: 28rpx;
}
.calender-subtitle .arrow {
width: 14rpx;
height: 14rpx;
border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent;
transform: rotate(45deg) translateY(-4rpx);
margin-left: 16rpx;
transition: all .3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(-4rpx);
}
.calender-close {
position: absolute;
width: 40rpx;
height: 40rpx;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: 24rpx;
height: 24rpx;
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: 24rpx;
line-height: 60rpx;
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: 20rpx 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: #F2F3F5;
text-shadow: 0 4rpx 20rpx #F2F3F5;
font-size: 320rpx;
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: 32rpx;
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: 8rpx;
}
.calender-day.disable {
opacity: .25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: 14rpx;
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-year {
/* display: flex;
flex-wrap: wrap; */
width: 100%;
height: 100%;
}
.calenderMonth {
display: flex;
flex-wrap: wrap;
width: 100%;
height: 100%;
}
.monItem {
box-sizing: border-box;
width: 25%;
height: 186rpx;
font-size: 32rpx;
/* text-align: center; */
/* line-height: 186rpx; */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-wrap: wrap;
color: #666666;
border: 1rpx solid #fff;
}
.monItem .text {
font-size: 20rpx;
margin-top: 5rpx;
}
.monItem.select {
color: #3582EE;
/* background: #3582EE;
opacity: 0.1; */
background-color: rgba(53, 130, 238, .1);
}
.monItem.active {
color: #fff;
background: #3582EE;
/* border-radius: 8px 0px 0px 8px; */
border-radius: 8px ;
}
.monItem.end {
color: #fff;
background: #3582EE;
border-radius: 0px 8px 8px 0px;
}
.monItem.disable {
color: #C8C9CC;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 14rpx 32rpx;
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: 72rpx;
font-size: 28rpx;
color: #fff;
border-radius: 999rpx;
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: .3;
}
\ No newline at end of file \ No newline at end of file
export default {
properties: {
calenderHeight: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: String,
optionalTypes: [Number]
},
title: String, // 标题名称
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#00A479'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误
type: Number,
optionalTypes: [Number],
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean,
isComponents: Boolean
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
monPickList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: [],
date: '',
yearCurrent: 0,
yearList: [],
rangeMonth: {},
// MonthShowList: [
// {
// label: '1月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '2月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '3月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '4月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '5月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '6月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '7月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '8月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '9月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '10月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '11月',
// disable: false,
// start: false,
// end: false,
// select: false
// },
// {
// label: '12月',
// disable: false,
// start: false,
// end: false,
// select: false
// }
// ],
dayType: 1, // 1 日期 0 月份 默认日期
dateObj: {
// switch:'按月份',
// type:'day',
tips: ['按日期', '按月份']
}
}
}
...@@ -12,8 +12,15 @@ export const checkYqdSuper = (userInfo,globalData) => { ...@@ -12,8 +12,15 @@ export const checkYqdSuper = (userInfo,globalData) => {
// const app = getApp() // const app = getApp()
// ?.globalData // ?.globalData
// console.log(app); // console.log(app);
console.log(userInfo,'userInfo');
globalData.isYqdSuper = userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType globalData.isYqdSuper = userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType
globalData.isStaff = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType globalData.isStaff = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
const loginRole = userInfo.loginRole
if (loginRole) {
globalData.isYqdSuper = [2,3].includes(loginRole)
globalData.isStaff = loginRole == 4
globalData.isSuper = loginRole == 1
}
console.log(globalData.isStaff); console.log(globalData.isStaff);
} }
// 获取园区店信息 // 获取园区店信息
......
...@@ -37,5 +37,17 @@ module.exports = { ...@@ -37,5 +37,17 @@ module.exports = {
params.inputStatus = 0 params.inputStatus = 0
// params.payType = 1 // params.payType = 1
return api.post('dj.api.smartcarlife.weapp.waitinputorder.count', params) return api.post('dj.api.smartcarlife.weapp.waitinputorder.count', params)
} },
/** 查询负责人产值 */
goodsOrderOutputValueBelong(data) {
return api.post('dj.api.smartcarlife.goodsOrderOutputValueBelong.listOutputValue', data)
},
/** 首页统计数据 */
userStat(data) {
return api.post('dj.api.smartcarlife.user.stat', data)
},
} }
// filter.wxs
var dateFormat = function (date) {
// console.log(date)
if (!date) return
var dates = date.split('-')
var day = dates[2] ? dates[2] + '日' : ''
var month = parseInt(dates[1])
// month = month < 10 ? month.substr(1, 1) : month
return dates[0] + '年' + month + '月' + day
}
var dateFormatSlash = function (date) {
// console.log(date)
if (!date) return
var dates = date.split('-')
var year = dates[0].slice(-2)
var month = dates[1]
var day = dates[2] || ''
console.log(day)
// var day = dates[2] ? dates[2] + '日' : ''
// var month = parseInt(dates[1])
// month = month < 10 ? month.substr(1, 1) : month
if (day) {
return [year, month, day].join('/')
} else {
return [year, month].join('/')
}
// return year[0] + '年' + month + '月' + day
}
var dateFormatYear = function (date) {
// console.log(date)
if (!date) return
var dates = date.split('-')
var year = dates[0].slice(-2)
var month = dates[1]
var day = dates[2]
// var day = dates[2] ? dates[2] + '日' : ''
// var month = parseInt(dates[1])
// month = month < 10 ? month.substr(1, 1) : month
return [month, day].join('/')
// return month + '月' + day + '日'
}
var dateFormatMonth = function (date) {
// console.log(date)
if (!date) return
var dates = date.split('-')
var year = dates[0]
var month = dates[1]
var day = dates[2]
// var day = dates[2] ? dates[2] + '日' : ''
// var month = parseInt(dates[1])
// month = month < 10 ? month.substr(1, 1) : month
return [year, month].join('/')
// return month + '月' + day + '日'
}
var moneyFormat = function (money) {
return money.toFixed(2)
}
var nullFormat = function (params) {
if (params == null) {
return '0'
} else {
return params
}
}
var rateFormat = function (params) {
if (params == null || params == false) {
return '-'
} else {
return params + '%'
}
}
var rateFormatAbs = function (params) {
if (params == null || params == false) {
return '-'
} else {
return Math.abs(params) + '%'
}
}
var toDecimal2 = function (params) {
// debugger
// console.log(params)
var data = params.toString().split('.')
var num = data[1]
// console.log(data, num)
if (num) {
if (num.length == 1) {
num = '.' + num + '0'
} else {
num = '.' + num
}
} else {
num = '.00'
}
return data[0] + num
}
var formatCoupon = function (params) {
// console.log(params)
if (!params) return
var data = params.split('-')
// console.log(data)
return data[0]
}
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
return item.replace(reg, ' ')
}
/*
* 导出
*/
module.exports = {
dateFormat: dateFormat,
moneyFormat: moneyFormat,
nullFormat: nullFormat,
rateFormat: rateFormat,
dateFormatSlash: dateFormatSlash,
dateFormatYear: dateFormatYear,
dateFormatMonth: dateFormatMonth,
rateFormatAbs: rateFormatAbs,
toDecimal2: toDecimal2,
formatCoupon: formatCoupon,
replaceItemText: replaceItemText
}
// tabIndex/pages/index/index.js // tabIndex/pages/index/index.js
import mixins from './index_mixins' import mixins from './index_mixins'
import api from '../../api.js' import api from '../../api.js'
import NP from 'number-precision'
import { env } from '~/config' import { env } from '~/config'
import { getYQInfo } from '~/store/index' import { getYQInfo } from '~/store/index'
const app = getApp() const app = getApp()
...@@ -13,7 +14,6 @@ Page({ ...@@ -13,7 +14,6 @@ Page({
...mixins.data, ...mixins.data,
navBarHeight: 0, navBarHeight: 0,
delayShow: false, delayShow: false,
showRemark: false, showRemark: false,
methodUpdateInfo: { methodUpdateInfo: {
value: '' value: ''
...@@ -21,10 +21,11 @@ Page({ ...@@ -21,10 +21,11 @@ Page({
isStaff: false, isStaff: false,
showOrderpop: false, showOrderpop: false,
waitInputCount: 0, waitInputCount: 0,
shopSideSelectPopup: false, shopSideSelectPopup: false,
navStyle: 'background-color: rgba(0,0,0,0);', flag: true,
flag: true dateObj: {
beginDateStr: ''
}
}, },
tipsEvent() { tipsEvent() {
this.setData({ this.setData({
...@@ -142,7 +143,7 @@ Page({ ...@@ -142,7 +143,7 @@ Page({
let { userInfo } = this.data let { userInfo } = this.data
// 判断是不是门店员工 // 判断是不是门店员工
if (userInfo.merchantType && !userInfo.isSuper && type == 2) { if (userInfo.merchantType && !userInfo.isSuper && type == 2) {
if ((item.type = 'scanCode')) { if (item.type == 'scanCode') {
wx.scanCode({ wx.scanCode({
success(res) { success(res) {
let { result } = res let { result } = res
...@@ -193,6 +194,30 @@ Page({ ...@@ -193,6 +194,30 @@ Page({
this.setTab(tableBtn, value) this.setTab(tableBtn, value)
this.getMerchantCouponList() this.getMerchantCouponList()
}, },
// 切换日历
tapCalendar() {
console.log(this.data.whiteArrow)
this.setData({
whiteArrow: !this.data.whiteArrow
})
},
monthSelect(e) {
let { date } = e.detail
// let {date} = this.data
let { label, date: selectDate } = date
// let [year, month] = selectDate.split('-')
// const endDate = new Date(year, month, 0).format('yyyy-MM-dd')
this.setData({
// dta
['dateObj.label']: label + '份',
['dateObj.dataMonth']: selectDate
// ['dateObj.beginDateStr']: selectDate + '-01',
// ['dateObj.endDateStr']: endDate
})
let { subIndex, merchantRange } = this.data
this.getOutputValue({ subIndex, merchantRange })
// console.log(date)
},
rangeSelect(e) { rangeSelect(e) {
// console.log(e) // console.log(e)
let { tableBtn } = this.data let { tableBtn } = this.data
...@@ -282,24 +307,24 @@ Page({ ...@@ -282,24 +307,24 @@ Page({
.catch(err => {}) .catch(err => {})
}, },
getPageData() { // getPageData() {
api.getHomeReport().then(res => { // api.getHomeReport().then(res => {
wx.$util.hideLoading() // wx.$util.hideLoading()
console.log(res) // console.log(res)
let { code, data, message } = res // let { code, data, message } = res
if (code == 0) { // if (code == 0) {
this.setData({
report: data
})
} else {
this.showToast(message)
}
// this.setData({ // this.setData({
// flag: true // report: data
// }) // })
}) // } else {
this.getMerchantCouponList() // this.showToast(message)
}, // }
// // this.setData({
// // flag: true
// // })
// })
// this.getMerchantCouponList()
// },
getMerchantCouponList() { getMerchantCouponList() {
let { orderByTypeEnum, tableSort, tableObj, startDate, endDate, totalTableSum, tableWidth } = this.data let { orderByTypeEnum, tableSort, tableObj, startDate, endDate, totalTableSum, tableWidth } = this.data
let target = tableObj[tableSort].sort let target = tableObj[tableSort].sort
...@@ -355,11 +380,117 @@ Page({ ...@@ -355,11 +380,117 @@ Page({
} }
} }
}, },
getOutputValue(yqdInfo) {
let { dateObj, userInfo } = this.data
let { subIndex, merchantRange } = yqdInfo
// let { userInfo } = this.data
// 1-超管 2-商户管理员 3-区域督导 4-驻店人员
const merchantId = merchantRange[subIndex].merchantId || ''
const loginRole = userInfo.subLoginUser.loginRole
this.setData({
loginRole
})
if (!loginRole) return false //没有不用展示就是没有
// let {usb}
// if (merchantRange) {
// }
let params = {
dataMonth: dateObj.dataMonth,
merchantId
}
api
.goodsOrderOutputValueBelong(params)
.then(result => {
console.log(result, 'result')
let { code, data } = result
if (code == 0) {
let rateValue = NP.divide(data?.totalOutputValue || 0, data?.totalTargetOutputValue || 0)
rateValue = NP.times(rateValue, 100)
rateValue = NP.round(rateValue, 2)
// item.rateValuePercent = rateValue + '%'
console.log(rateValue, 'rateValue')
if (data.areaSupervisionList && data.areaSupervisionList.length) {
data.areaSupervisionList.forEach(item => {
let rateValue = NP.divide(item?.outputValue, item?.targetOutputValue)
rateValue = NP.times(rateValue, 100)
rateValue = NP.round(rateValue, 2)
item.rateValue = rateValue
// 百分比
item.rateValuePercent = rateValue + '%'
})
}
if (data.outoutValueList && data.outoutValueList.length) {
data.outoutValueList.forEach(item => {
let rateValue = NP.divide(item?.outputValue, item?.targetOutputValue)
rateValue = NP.times(rateValue, 100)
rateValue = NP.round(rateValue, 2)
item.rateValue = rateValue
item.rateValuePercent = rateValue + '%'
})
}
console.log(data, 'data')
this.setData({
outputValueObj: {
...data,
rateValue,
rateValuePercent: rateValue ? rateValue + '%' : '0%'
}
})
}
})
.catch(err => {})
},
getUserStat() {
api
.userStat({})
.then(result => {
// console.log(result, 'result')
let { code, data } = result
if (code == 0) {
this.setData({
userStat: data
})
}
})
.catch(err => {})
},
initTime() {
//.format('yyyy-MM-dd')
let data = new Date()
// let NewYearDay = new Date().format('yyyy')
// let month = new Date().format('MM')
// console.log(NewYearDay)
// 选择 本月
const year = data.getFullYear()
const month = data.getMonth()
// const startDate = new Date(year, month, 1).format('yyyy-MM-dd')
const dataMonth = new Date(year, month + 1, 0).format('yyyy-MM')
// const yearMonth = new Date(year, month, 1).format('yyyy-MM-dd')
this.setData({
dateObj: {
// beginDateStr: startDate,
// endDateStr: endDate,
// month: month + 1,
// today: today,
dataMonth,
pointUnit: 1, // 1日,2月,默认日
// type: 'year',
type: 'month',
label: month + 1 + '月份'
}
})
},
init(userInfo) { init(userInfo) {
getYQInfo(userInfo).then(result => { getYQInfo(userInfo).then(result => {
console.log(result) console.log(result)
// console.log(app.globalData.isYqdSuper) // console.log(app.globalData.isYqdSuper)
this.getPageData() // this.getPageData()
wx.$util.hideLoading()
this.getMerchantCouponList()
this.initTime()
this.getUserStat()
this.getOutputValue(result)
this.setData({ this.setData({
...result ...result
}) })
...@@ -386,6 +517,7 @@ Page({ ...@@ -386,6 +517,7 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
// console.log(options) // console.log(options)
options && this.checkShowOrderPop(options) options && this.checkShowOrderPop(options)
let today = new Date() let today = new Date()
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"order-switchPopup": "/components/orderSwitchPopup/orderSwitchPopup", "order-switchPopup": "/components/orderSwitchPopup/orderSwitchPopup",
"side-select-popup": "/components/SideSelectPopup/SideSelectPopup" "side-select-popup": "/components/SideSelectPopup/SideSelectPopup",
"CalendarMonthSingle": "/components/CalendarMonthSingle/CalendarMonth",
"van-progress": "@vant/weapp/progress/index"
} }
} }
...@@ -67,6 +67,9 @@ page ::-webkit-scrollbar { ...@@ -67,6 +67,9 @@ page ::-webkit-scrollbar {
} }
.navigation-title-text { .navigation-title-text {
font-weight: 500;
font-size: 28rpx;
color: #333333;
text-align: center; text-align: center;
max-width: calc(100% - 24rpx); max-width: calc(100% - 24rpx);
} }
...@@ -135,7 +138,7 @@ page ::-webkit-scrollbar { ...@@ -135,7 +138,7 @@ page ::-webkit-scrollbar {
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
.content { .contentUtil {
padding: 0 20rpx; padding: 0 20rpx;
} }
...@@ -234,6 +237,7 @@ page ::-webkit-scrollbar { ...@@ -234,6 +237,7 @@ page ::-webkit-scrollbar {
font-family: numberBold; font-family: numberBold;
font-size: 36rpx; font-size: 36rpx;
color: #2D2D33; color: #2D2D33;
font-weight: 700;
} }
.icon { .icon {
...@@ -251,7 +255,254 @@ page ::-webkit-scrollbar { ...@@ -251,7 +255,254 @@ page ::-webkit-scrollbar {
} }
} }
.myPerformance {
box-sizing: border-box;
margin-top: 50rpx;
margin-bottom: 50rpx;
padding: 0 15rpx;
.title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
}
.label {
margin-top: 16rpx;
text-align: right;
font-size: 20rpx;
color: #999999;
}
.content {
display: flex;
width: 100%;
justify-content: space-between;
// align-items: flex-end;
align-items: center;
.lable {
display: flex;
font-size: 20rpx;
color: #666666;
.value {
font-weight: 600;
font-size: 20rpx;
color: #3582EE;
}
}
.progress {
flex: 1;
padding: 30rpx;
}
.target {
display: flex;
flex-direction: column;
text-align: right;
.label {
font-size: 20rpx;
color: #999999;
}
.value {
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
}
}
.totalPerformanceCon {
border: 1rpx solid #E4E6EE;
border-radius: 20rpx;
.merchantNum {
display: flex;
justify-content: center;
margin: 32rpx auto;
width: 638rpx;
height: 36rpx;
text-align: center;
font-size: 24rpx;
font-face: PingFangSC;
background: #F5F9FE;
border-radius: 20rpx;
font-weight: 600;
.num {
color: #3582eeff;
}
}
.total {
padding: 0 46rpx;
}
.mrechantItemCon {
box-sizing: border-box;
padding: 22rpx 16rpx;
background: #F7F8FA;
border-radius: 20rpx;
.selfPerformanceCon+.selfPerformanceCon {
margin-top: 20rpx;
}
}
}
.selfPerformanceCon {
position: relative;
box-sizing: border-box;
width: 100%;
height: 190rpx;
padding: 32rpx 24rpx;
// padding-left: 24rpx;
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
&::after {
position: absolute;
left: 0;
top: 38rpx;
content: '';
display: block;
clear: both;
width: 4rpx;
height: 24rpx;
background: #3582EE;
border-radius: 0 4rpx 4rpx 0;
}
.header {
// width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.merchantName {
font-weight: 600;
font-size: 24rpx;
color: #555555;
}
.staffName {
font-weight: 400;
font-size: 24rpx;
color: #555555;
}
}
// .label {
// margin-top: 16rpx;
// text-align: right;
// font-size: 20rpx;
// color: #999999;
// }
// .content {
// display: flex;
// width: 100%;
// justify-content: space-between;
// // align-items: flex-end;
// align-items: center;
// .lable {
// display: flex;
// font-size: 20rpx;
// color: #666666;
// .value {
// font-weight: 600;
// font-size: 20rpx;
// color: #3582EE;
// }
// }
// .progress {
// flex: 1;
// padding: 30rpx;
// }
// .target {
// display: flex;
// flex-direction: column;
// text-align: right;
// .label {
// font-size: 20rpx;
// color: #999999;
// }
// .value {
// font-weight: 500;
// font-size: 32rpx;
// color: #333333;
// }
// }
// }
}
.nothingTips {
box-sizing: border-box;
width: 100%;
height: 190rpx;
padding: 53rpx 0;
// line-height: 190rpx;
text-align: center;
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
font-weight: 500;
color: #888888;
.text {
font-size: 24rpx;
margin-bottom: 12rpx;
}
.text2 {
font-size: 20rpx;
}
}
}
.dateNum {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #333333;
.arrow {
// width: 10rpx;
// height: 6rpx;
width: 40rpx;
height: 40rpx;
margin-left: 12rpx;
// transform: translateY(25%);
transition: all 0.5s;
}
.move {
transform: rotate(-180deg) translateY(0);
}
}
.table-control { .table-control {
height: 96rpx; height: 96rpx;
......
<!-- src引入filter.wxs, module给模块起名 -->
<wxs src="../index.wxs" module="filter" />
<navigation-bar <navigation-bar
bindnavbarReady="navbarReady" bindnavbarReady="navbarReady"
showMenu="{{ true }}" showMenu="{{ true }}"
...@@ -38,42 +40,108 @@ ...@@ -38,42 +40,108 @@
<view class="totalCon"> <view class="totalCon">
<view class="item"> <view class="item">
<view class="label">累计产值</view> <view class="label">累计产值</view>
<veiw class="number"><text class="unit">¥</text>968945999.99</veiw> <veiw class="number"><text class="unit">¥</text>{{userStat.totalOrderMoney||0}}</veiw>
</view> </view>
<view class="item"> <view class="item">
<view class="label">转化率</view> <view class="label">转化率</view>
<veiw class="number">103%</veiw> <veiw class="number">{{userStat.upgradeRate||0}}%</veiw>
</view> </view>
</view> </view>
<view class="customStatistic"> <view class="customStatistic">
<veiw class="customItem" wx:for="{{ totalList }}" wx:key="index"> <veiw class="customItem" wx:for="{{ totalList }}" wx:key="index">
<veiw class="label">{{item.name}}</veiw> <veiw class="label">{{item.name}}</veiw>
<view class="number"><text class="unit" wx:if="{{item.unit}}">{{item.unit}}</text>{{item.value}}</view> <view class="number"><text class="unit" wx:if="{{item.unit}}">{{item.unit}}</text>{{userStat[item.itemName]||0}}</view>
<view class="icon"> <view class="icon">
<image src="../../images/customIcon0{{item.index}}.png" mode="" binderror="" bindload=""></image> <image src="../../images/customIcon0{{item.index}}.png" mode="" binderror="" bindload=""></image>
</view> </view>
</veiw> </veiw>
</view> </view>
</view> </view>
<view class="myPerformance"> <view class="myPerformance" wx:if="loginRole">
<view class="title">我的绩效</view> <view class="title ">
<view class="totalPerformanceCon" wx:if="{{ false }}"></view> <view class="conTitle">
<view class="selfPerformanceCon" wx:elif="{{ true }}"> 我的绩效
</view>
<CalendarMonthSingle
monType="{{true}}"
allowSameDay
shortcut
bindselect='monthSelect'
bindtapCalendar='tapCalendar'
dateType='single'
calenderColor='#3582EE'
vertical
minDate="2020-10-01"
maxDate="{{dateObj.today}}"
forceFullSucreen="{{bottomLift>0?true:false}}"
isComponents>
<view class="item dateNum">
{{dateObj.label}}
<view class="arrow {{whiteArrow?'move':''}}">
<image src="../../images/arrSolid.png" />
</view>
</view>
</CalendarMonthSingle>
</view>
<view class="totalPerformanceCon" wx:if="{{ loginRole&&loginRole!=4 }}">
<view class="merchantNum">
汇总门店: <view class="num">{{outputValueObj.shopCount||0}}</view> 家
</view>
<view class="total">
<view class="label">当月目标</view>
<view class="content">
<view class="lable">
<view>产值完成比</view>
<view class="value">{{outputValueObj.rateValuePercent}}</view>
</view>
<!-- <view class="chart">¥ 0</view> -->
<van-progress class="progress" pivot-text="{{outputValueObj.totalOutputValue||0}}" percentage="{{outputValueObj.rateValue>100?100:outputValueObj.rateValue}}" />
<view class="target">
<view class="value">{{outputValueObj.totalTargetOutputValue||0}}</view>
</view>
</view>
</view>
<view class="mrechantItemCon">
<view class="selfPerformanceCon" wx:for="{{outputValueObj.outoutValueList}}" wx:key="index" >
<view class="header"> <view class="header">
<view class="merchantName">江西运通汽车城西销售服务有限公司</view> <view class="merchantName">{{item.merchantName}}</view>
<view class="staffName">驻店员工谢婷婷</view> <view class="staffName">驻店员工{{item.residentManager}}</view>
</view> </view>
<view class="label">当月目标</view>
<view class="content"> <view class="content">
<view class="lable"> <view class="lable">
<view>产值完成比</view> <view>产值完成比</view>
<view class="value">100%</view> <view class="value">{{item.rateValuePercent}}</view>
</view> </view>
<view class="chart">¥ 0</view> <!-- <view class="chart">¥ 0</view> -->
<van-progress class="progress" pivot-text="{{item.rateValue}}" percentage="{{item.rateValue>100?100:item.rateValue}}" />
<view class="target"> <view class="target">
<view class="value">{{item.targetOutputValue||0}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="selfPerformanceCon" wx:elif="{{ loginRole&&loginRole == 4 }}">
<block wx:for="{{items.areaSupervisionList||[]}}">
<view class="header">
<view class="merchantName">{{item.merchantName}}</view>
<view class="staffName">驻店员工{{item.residentManager}}</view>
</view>
<view class="label">当月目标</view> <view class="label">当月目标</view>
<view class="value">442654</view> <view class="content">
<view class="lable">
<view>产值完成比</view>
<view class="value">{{item.rateValuePercent}}</view>
</view>
<!-- <view class="chart">¥ 0</view> -->
<van-progress class="progress" pivot-text="{{item.rateValue}}" percentage="{{item.rateValue>100?100:item.rateValue}}" />
<view class="target">
<view class="value">{{item.targetOutputValue||0}}</view>
</view> </view>
</view> </view>
</block>
</view> </view>
<view class="nothingTips" wx:else> <view class="nothingTips" wx:else>
<view class="text">本月绩效未设置</view> <view class="text">本月绩效未设置</view>
......
export default { export default {
data: { data: {
navStyle: 'background-color: rgba(0,0,0,0);',
subIndex: 0, subIndex: 0,
menu: [ menu: [
{ {
...@@ -60,32 +61,32 @@ export default { ...@@ -60,32 +61,32 @@ export default {
totalList: [ totalList: [
{ {
name: '服务客户', name: '服务客户',
value: '985634', itemName: 'totalCustomer',
index: 1 index: 1
}, },
{ {
name: '已预约客户', name: '已预约客户',
value: '985634', itemName: 'totalInvited',
index: 2 index: 2
}, },
{ {
name: '待预约客户', name: '待预约客户',
value: '985634', itemName: 'totalWaitToInvited',
index: 3 index: 3
}, },
{ {
name: '转化订单', name: '转化订单',
value: '985634', itemName: 'totalUpgrade',
index: 4 index: 4
}, },
{ {
name: '战败订单', name: '战败订单',
value: '985634', itemName: 'totalNotUpgrade',
index: 5 index: 5
}, },
{ {
name: '客单价', name: '客单价',
value: '985634', itemName: 'customerUnitPrice',
unit: '¥', unit: '¥',
index: 6 index: 6
} }
......
...@@ -133,7 +133,7 @@ class Calendar { ...@@ -133,7 +133,7 @@ class Calendar {
end: new Date().format(`yyyy${separator}MM`) end: new Date().format(`yyyy${separator}MM`)
} }
}) })
console.log(yearList) // console.log(yearList)
} }
/**初始化日期 */ /**初始化日期 */
init(date) { init(date) {
......
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"CalendarMonth": "../../components/CalendarMonth/CalendarMonth" "CalendarMonth": "/components/CalendarMonth/CalendarMonth"
} }
} }
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
<view class="item dateNum"> <view class="item dateNum">
<block wx:if="{{dateObj.type=='year'}}">{{dateObj.label}}年</block> <block wx:if="{{dateObj.type=='year'}}">{{dateObj.label}}年</block>
<block wx:else> <block wx:else>
{{filter.dateFormatSlash(dateObj.start)}}-{{filter.dateFormatSlash(dateObj.end)}} <!-- {{filter.dateFormatSlash(dateObj.beginDateStr)}}-{{filter.dateFormatSlash(dateObj.endDateStr)}} -->
五月份
</block> </block>
<!-- <block wx:elif="{{dateObj.type=='month'}}">{{dateObj.label}}</block> --> <!-- <block wx:elif="{{dateObj.type=='month'}}">{{dateObj.label}}</block> -->
<!-- <block wx:elif="{{dateObj.type=='year'}}">{{dateObj.label}}</block> --> <!-- <block wx:elif="{{dateObj.type=='year'}}">{{dateObj.label}}</block> -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!