首页样式等逻辑完善

This commit is contained in:
BianLzhaoMin 2024-10-23 09:10:06 +08:00
parent dccf64980d
commit 09413863b5
4 changed files with 71 additions and 6 deletions

View File

@ -761,6 +761,12 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/workPlan/custody/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/workPlan/dayPlan/index",
"style": {

View File

@ -0,0 +1,9 @@
<template>
<view>现场监护</view>
</template>
<script>
export default {}
</script>
<style></style>

View File

@ -54,9 +54,9 @@
<!-- 选择周的时候日历 -->
<view v-show="activeType === 2">
<view class="week-th">
<view v-for="item in weekList" :key="item">
<view v-for="(item, index) in weekList" :key="item">
<text>{{ item.title }}</text>
<text v-if="item !== '分公司'" style="margin-top: 6rpx">{{ item.time }}</text>
<text v-if="index !== 0" style="margin-top: 6rpx">{{ weekTimeChange(index) }}</text>
</view>
</view>
@ -79,8 +79,8 @@
<view>工程名称</view>
<view>作业人数</view>
<view>
<text>周二</text>
<text>10/22</text>
<text>{{ currentWeekDay }}</text>
<text>{{ currentDays }}</text>
</view>
</view>
@ -189,11 +189,25 @@ export default {
}
],
days: [],
// currentWeekDay: this.$moment().day(),
currentDays: this.$moment().format('MM-DD'),
customDates: {
'2023-06-15': '自定义内容'
}
}
},
computed: {
weekTimeChange() {
return index => {
return this.$moment(this.weekStart)
.add(index - 1, 'days')
.format('MM-DD')
}
},
currentWeekDay() {
return this.onTransWeek(this.$moment(this.currentDay).day())
}
},
mounted() {
this.generateCalendar()
},
@ -252,8 +266,10 @@ export default {
changeDay(delta) {
if (delta > 0) {
this.currentDay = this.$moment(this.currentDay).add(1, 'days').format('YYYY-MM-DD')
this.currentDays = this.$moment(this.currentDays).add(1, 'days').format('MM-DD')
} else {
this.currentDay = this.$moment(this.currentDay).subtract(1, 'days').format('YYYY-MM-DD')
this.currentDays = this.$moment(this.currentDays).subtract(1, 'days').format('MM-DD')
}
},
changeWeek(delta) {
@ -269,6 +285,34 @@ export default {
console.log('选择的日期', day.date)
//
},
onTransWeek(num) {
let weekStr = ''
switch (num) {
case 0:
weekStr = '周日'
break
case 1:
weekStr = '周一'
break
case 2:
weekStr = '周二'
break
case 3:
weekStr = '周三'
break
case 4:
weekStr = '周四'
break
case 5:
weekStr = '周五'
break
case 6:
weekStr = '周六'
break
}
return weekStr
},
onCheckTime(type) {
this.activeType = type
}

View File

@ -3,7 +3,7 @@
<view class="custody">
<h4>现场监护</h4>
<view class="custody-content">
<view class="icon-box">
<view class="icon-box" @tap="onJumpCustody">
<image src="@/static/realName/attendance_statistics.png" mode="scaleToFill" />
现场监护
</view>
@ -12,7 +12,13 @@
</template>
<script>
export default {}
export default {
methods: {
onJumpCustody() {
uni.navigateTo({ url: '/pages/workPlan/custody/index' })
}
}
}
</script>
<style lang="scss" scoped>