Commit 77b17490 by chenwq

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

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