Commit 77b17490 by chenwq

style(teamList): 优化代码格式与统一书写规范

压缩模板内多行元素属性为单行写法,标准化JS对象字面量格式,统一CSS颜色码为小写,清理冗余注释与样式间距问题
1 parent 953aed82
......@@ -17,12 +17,7 @@
<div>督导{{userInfo.name || ''}}</div>
</div> -->
<div class="static-info">
<div
class="static-item"
v-for="(item, index) in staticList"
:key="index"
:style="{ flex: `${item.width || 1} 0 0`, background: item.background }"
>
<div class="static-item" v-for="(item, index) in staticList" :key="index" :style="{ flex: `${item.width || 1} 0 0`, background: item.background }">
<div class="label">{{item.label}}</div>
<div class="value">{{staticData[item.key] || '-'}}</div>
</div>
......@@ -49,24 +44,12 @@
<div class="content-box">
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="到底了~"
@load="onLoadMore"
>
<van-list v-model="loading" :finished="finished" finished-text="到底了~" @load="onLoadMore">
<div class="list" v-if="list.length > 0">
<div
class="item content"
v-for="(item, index) in list"
:key="index"
>
<div class="item content" v-for="(item, index) in list" :key="index">
<!-- 顶部状态和标题 -->
<div class="item-top">
<div
class="status text-center"
:style="{ color: statusMap[item.taskStatus].color, backgroundColor: statusMap[item.taskStatus].background }"
>
<div class="status text-center" :style="{ color: statusMap[item.taskStatus].color, backgroundColor: statusMap[item.taskStatus].background }">
{{statusMap[item.taskStatus].name}}
</div>
......@@ -112,21 +95,14 @@
<div v-if="item.taskType == 3" class="list-item">
<div class="progress">
<div class="progress-line"></div>
<div
class="progress-item"
:style="{ width: (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }"
></div>
<div class="progress-item" :style="{ width: (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }"></div>
<div class="num">{{item.audioReviewCompletedCount + '/' + item.audioReviewTotalCount}}</div>
</div>
</div>
<!-- 底部按钮 -->
<div class="btn-box">
<div
@click="jump(item)"
class="btn"
:class="{ 'primary': item.taskStatus != 2 }"
>
<div @click="jump(item)" class="btn" :class="{ 'primary': item.taskStatus != 2 }">
{{item.taskStatus == 2 ? '查看' : '去执行'}}
</div>
</div>
......@@ -164,12 +140,12 @@ export default {
userInfo: {},
staticList: [{
label: '驻店人员',
width: '104px', // 208rpx -> 104px
width: '104px',
key: 'staffCount',
background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)'
}, {
label: '门店数量',
width: '96px', // 192rpx -> 96px
width: '96px',
key: 'shopCount',
background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)'
}, {
......@@ -189,17 +165,17 @@ export default {
}],
tabIndex: 0,
statusMap: {
0: {name: '待完成', color: '#2C66F7', background: '#2c66f71a'},
1: {name: '进行中', color: '#FF9D0A', background: '#ff9d0a1a'},
2: {name: '已完成', color: '#35C376', background: '#35c3761a'},
0: { name: '待完成', color: '#2C66F7', background: '#2c66f71a' },
1: { name: '进行中', color: '#FF9D0A', background: '#ff9d0a1a' },
2: { name: '已完成', color: '#35C376', background: '#35c3761a' },
},
missionMap: {
3: {name: '录音复盘'},
5: {name: '人员带教'},
0: {name: '督导日报'},
1: {name: '本周复盘'},
2: {name: '督导月度计划'},
4: {name: '专项任务'},
3: { name: '录音复盘' },
5: { name: '人员带教' },
0: { name: '督导日报' },
1: { name: '本周复盘' },
2: { name: '督导月度计划' },
4: { name: '专项任务' }
},
list: [],
pageNum: 1,
......@@ -259,12 +235,12 @@ export default {
4: '/packageIndex/pages/specialTask/specialTask'
}
const eventCode = {
3: {view: 'supervisor_recording_view', execute: 'supervisor_recording_execute'},
5: {view: 'supervisor_mentoring_view', execute: 'supervisor_mentoring_execute'},
0: {view: 'supervisor_report_view', execute: 'supervisor_report_execute'},
1: {view: 'supervisor_weeklyReview_view', execute: 'supervisor_weeklyReview_execute'},
2: {view: 'supervisor_monthlyPlan_view', execute: 'supervisor_monthlyPlan_execute'},
4: {view: 'supervisor_specificTask_view', execute: 'supervisor_specificTask_execute'},
3: { view: 'supervisor_recording_view', execute: 'supervisor_recording_execute' },
5: { view: 'supervisor_mentoring_view', execute: 'supervisor_mentoring_execute' },
0: { view: 'supervisor_report_view', execute: 'supervisor_report_execute' },
1: { view: 'supervisor_weeklyReview_view', execute: 'supervisor_weeklyReview_execute' },
2: { view: 'supervisor_monthlyPlan_view', execute: 'supervisor_monthlyPlan_execute' },
4: { view: 'supervisor_specificTask_view', execute: 'supervisor_specificTask_execute' },
}
let status = target.taskStatus != 2 ? 'execute' : 'view'
if (this.$track) {
......@@ -356,7 +332,7 @@ export default {
<style lang="scss" scoped>
/* 样式保留了原小程序的结构,单位已根据 1px = 2rpx 进行换算 */
.team-list-page {
background: #F2F3F7;
background: #f2f3f7;
min-height: 100vh;
position: relative;
padding-bottom: env(safe-area-inset-bottom);
......@@ -410,7 +386,7 @@ export default {
flex: 1;
border-radius: 8px;
font-size: 14px;
color: #FFFFFF;
color: #ffffff;
.label {
margin-bottom: 4px;
}
......@@ -427,10 +403,10 @@ export default {
.sticky-box {
&.is-sticky {
.tab-box {
background: #FFFFFF;
background: #ffffff;
}
.date {
background: #FFFFFF;
background: #ffffff;
}
}
}
......@@ -438,7 +414,7 @@ export default {
height: 15px;
font-size: 12px;
color: #999999;
background: #F2F3F7;
background: #f2f3f7;
padding: 8px 12px;
display: flex;
align-items: center;
......@@ -449,10 +425,10 @@ export default {
.list {
.item {
border-radius: 6px;
background: #FFFFFF;
background: #ffffff;
padding: 12px;
margin-bottom: 12px;
&:last-child{
&:last-child {
margin-bottom: 0;
}
.item-top {
......@@ -476,7 +452,7 @@ export default {
align-items: center;
font-size: 12px;
color: #999999;
.label{
.label {
flex-shrink: 0;
}
.icon {
......@@ -529,7 +505,7 @@ export default {
border-radius: 30px;
opacity: 1;
border: 1px solid #2c66f780;
color: #2C66F7;
color: #2c66f7;
font-size: 13px;
font-weight: 500;
&.primary {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!