Commit 8227837f by 前端

工资

1 parent 9818363b
<template>
<view class="calendar-container">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title"><text>本月出勤</text></view>
</view>
<view class="calendar-box">
<view class="calendar-years">
<view class="calendar-year">{{ year }}年{{ month }}月</view>
</view>
<view class="calendar-body">
<view class="calendar-weekdays">
<view class="calendar-weekday" v-for="weekday in weekdays" :key="weekday">
{{ weekday }}
</view>
</view>
<view class="calendar-dates">
<view class="calendar-date" v-for="(date, index) in dates" :key="index">
<template v-if="date">
<view class="date-num">{{ date }}</view>
<!-- <view class="date-desc">出勤</view> -->
<view class="date-desc date-card">未打卡</view>
</template>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'calendar',
props: {
// 是否显示周标题
showWeekdays: {
type: Boolean,
default: true
},
open: {
type: Boolean,
default: false
}
},
data() {
return {
// 当前所处日期 年月日
nowDate: '7',
datesd: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
// 当前所处年
year: new Date().getFullYear(),
// 当前所处月
month: new Date().getMonth() + 1,
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
showNextMonth: true //是否显示查看下个月操作箭头,暂时只能看后一个月
}
},
computed: {
dates() {
const firstDayOfMonth = new Date(this.year, this.month - 1, 1)
const lastDayOfMonth = new Date(this.year, this.month, 0)
const dates = []
for (let i = 0, len = this.datesd.length; i < len; i++) {
dates.push(this.datesd[i])
}
if (firstDayOfMonth.getDay() == 0) {
// 第一行只有一天的情况
for (let i = 1; i <= 6; i++) {
dates.unshift(null)
}
} else {
for (let i = 1; i < firstDayOfMonth.getDay(); i++) {
dates.unshift(null)
}
}
console.log(dates)
return dates
}
},
watch: {
// month: {
// handler() {
// // 日期格式化获取当前月份
// const todayMonth = uni.$jy.formatDate(new Date(), 'M')
// // 日期格式化获取当前年
// const y = uni.$jy.formatDate(new Date(), 'YYYY')
// if (Number(todayMonth) == 12) {
// if (this.year > Number(y)) {
// this.showNextMonth = false
// return
// }
// }
// if (Number(y) < this.year) {
// this.showNextMonth = true
// return
// }
// if (Number(y) == this.year) {
// if (this.month < Number(todayMonth)) {
// this.showNextMonth = true
// return
// }
// let a = Math.abs(this.month - Number(todayMonth))
// if (a == 1) {
// this.showNextMonth = false
// return
// }
// }
// this.showNextMonth = true
// return
// }
// }
},
methods: {
/* 上个月 */
prevMonth() {
if (this.month === 1) {
this.year -= 1
this.month = 12
} else {
this.month -= 1
}
let callMonth = this.month >= 10 ? String(this.month) : '0' + String(this.month)
let callBackDate = String(this.year) + '-' + callMonth
this.$emit('prev', callBackDate)
},
/* 下个月 */
nextMonth() {
if (this.month === 12) {
this.year += 1
this.month = 1
} else {
this.month += 1
}
let callMonth = this.month >= 10 ? String(this.month) : '0' + String(this.month)
let callBackDate = String(this.year) + '-' + callMonth
this.$emit('next', callBackDate)
},
/** 回显每日日期文本
* @param {Object} date
*/
isTodayText(date) {
if (date === this.nowDate) {
return '今天'
}
// return uni.$jy.formatDate(date, 'D')
},
/* 每日点击事件 */
itemHandle(item) {
this.$emit('item-cilck', item)
}
}
}
</script>
<style scoped lang="scss">
.nav-bar {
width: 100%;
height: 96rpx;
margin-top: 48rpx;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
font-weight: 700;
font-size: 32rpx;
color: #1a1a1a;
flex: 1;
text-align: center;
text {
margin-left: -96rpx;
}
}
}
.calendar-box {
width: calc(100vw - 128rpx);
margin: 30rpx auto 0;
height: calc(100vh - 220rpx);
background: #ffffff;
border-radius: 48rpx;
padding: 64rpx;
box-sizing: border-box;
.calendar-years {
color: #1a1a1a;
font-size: 64rpx;
font-weight: 600;
}
.calendar-weekdays {
display: flex;
height: 80rpx;
margin-top: 30rpx;
.calendar-weekday {
flex: 1;
font-size: 28rpx;
color: #808291;
text-align: right;
}
}
.calendar-dates {
display: flex;
flex-wrap: wrap;
.calendar-date {
width: calc(100% / 7);
height: calc((100vh - 550rpx) / 5);
padding: 32rpx;
box-sizing: border-box;
border: 2rpx solid #808291;
+ .calendar-date {
border-left: none;
border-top: none;
}
&:nth-child(7n + 1) {
border-left: 2rpx solid #808291;
}
&:nth-child(-n + 7) {
border-top: 2rpx solid #808291;
}
.date-desc {
position: relative;
font-size: 26rpx;
margin-top: 30rpx;
padding-left: 30rpx;
&::before {
content: '';
position: absolute;
width: 12rpx;
top: 12rpx;
left: 0rpx;
height: 12rpx;
background: #2cca74;
border-radius: 50%;
}
&.date-card {
color: #eb4e4e;
&::before {
background: #eb4e4e;
}
}
}
}
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-07 13:49:15
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-07 13:57:40
* @FilePath: \gl-tape\components\HomeFrame\components\Income\History.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<view class="history-container">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title"><text>历史收入记录</text></view>
</view>
<view class="history-box">
<view class="chart-box"></view>
<view class="income-box"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="scss">
.nav-bar {
width: 100%;
height: 96rpx;
margin-top: 48rpx;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
font-weight: 700;
font-size: 32rpx;
color: #1a1a1a;
flex: 1;
text-align: center;
text {
margin-left: -96rpx;
}
}
}
.history-box {
width: calc(100vw - 128rpx);
margin: 30rpx auto 0;
height: calc(100vh - 220rpx);
box-sizing: border-box;
display: flex;
.chart-box {
background: #ffffff;
border-radius: 48rpx;
flex: 1;
}
.income-box {
background-image: linear-gradient(180deg, #faf9f7 0%, #ffffff 28%);
border: 4rpx solid #ffffff;
box-shadow: inset 0 4rpx 8rpx 0 #ffffff80;
border-radius: 48rpx;
width: 648rpx;
margin-left: 48rpx;
}
}
</style>
<template>
<view class="calendar-container">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title"><text>晋升介绍</text></view>
</view>
<view class="calendar-box"></view>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="scss">
.nav-bar {
width: 100%;
height: 96rpx;
margin-top: 48rpx;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
font-weight: 700;
font-size: 32rpx;
color: #1a1a1a;
flex: 1;
text-align: center;
text {
margin-left: -96rpx;
}
}
}
.calendar-box {
width: calc(100vw - 128rpx);
margin: 30rpx auto 0;
height: calc(100vh - 220rpx);
background: #ffffff;
border-radius: 48rpx;
padding: 64rpx;
box-sizing: border-box;
}
</style>
<template>
<view class="income-container">
<view class="income-body">
<view class="income-store">
<view class="store-header"></view>
<view class="my-store"></view>
</view>
<view class="income-item"></view>
<view class="income-item"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="scss">
.income-container {
padding-right: 66rpx;
}
.income-body {
display: grid;
grid-template-columns: repeat(3, 1fr);
column-gap: 48rpx;
height: calc(100vh - 260rpx);
margin-top: 32rpx;
.income-store {
.my-store {
background-image: linear-gradient(180deg, #f4fbfe 0%, #ffffff 50%);
border: 4rpx solid #ffffff;
box-shadow: inset 0 4rpx 8rpx 0 rgba(255, 255, 255, 0.5);
border-radius: 48rpx;
height: 50vh;
}
}
.income-item {
height: 100%;
background-image: linear-gradient(180deg, #faf9f7 0%, #ffffff 28%);
border: 4rpx solid #ffffff;
box-shadow: inset 0 4rpx 8rpx 0 rgba(255, 255, 255, 0.5);
border-radius: 48rpx;
}
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-12-31 16:53:31
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-06 15:35:18
* @LastEditTime: 2025-01-07 10:22:28
* @FilePath: \gl-tape\components\HomeFrame\components\Point.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -11,20 +11,24 @@
<view class="tab-box">
<view @click="selectTab(index)" :class="{ 'tab-item': true, active: activeIndex == index }" v-for="(i, index) in tabList" :key="index">{{ i.name }}</view>
</view>
<point></point>
<component :is="tabName"></component>
</view>
</template>
<script type="text/ecmascript-6">
import Point from './Point/index.vue'
import Income from './Income/index.vue'
export default {
name: '',
components: {
Point
Point,
Income
},
data () {
return {
activeIndex:1,
activeIndex:0,
componentList:['Point','Income'],
tabName: 'Point',
tabList:[{
name:'积分权益',
},{
......@@ -35,6 +39,7 @@ export default {
methods: {
selectTab(index){
this.activeIndex = index
this.tabName = this.componentList[index]
}
},
}
......
......@@ -69,9 +69,12 @@ import rulePoint from './components/Point/RulePoint.vue'
import LevelPoint from './components/Point/LevelPoint.vue'
import Course from './components/Point/Course.vue'
import Ranking from './components/Point/Ranking.vue'
import Calendar from './components/Income/Calendar.vue'
import Promotion from './components/Income/Promotion.vue'
import History from './components/Income/History.vue'
export default {
mixins: [myClick, uploader],
components: { RecordList, CustomerFile, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint },
components: { RecordList, CustomerFile, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History },
props: {
id: [String, Number],
finishDoneText: String,
......@@ -83,8 +86,8 @@ export default {
data() {
return {
transfer: '',
showHome: true,
pointComponentName: 'dayPoint',
showHome: false,
pointComponentName: 'History',
userInfo: {},
tabIndex: 0
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!