Commit dac6adbf by liimin

Merge branch 'v1.0.0' of http://192.168.3.233:8090/app/sales-assist-mobile into v1.0.0

2 parents bf15c556 731d15e0
...@@ -6,4 +6,5 @@ ...@@ -6,4 +6,5 @@
node_modules node_modules
assets/images/sprite.png assets/images/sprite.png
assets/css/sprite.scss assets/css/sprite.scss
.codex
/.qoder /.qoder
<template>
<view class="module-entry-grid">
<view class="module-entry-grid__list">
<view v-for="(item, index) in entryItems"
:key="index"
class="module-entry-grid__item"
:class="getItemKey(item) == activeKey ? 'module-entry-grid__item--active' : ''"
@click="onEntryClick(getItemKey(item))">
<image class="module-entry-grid__icon"
mode="aspectFit"
:src="getItemIconSrc(item)" />
<text class="module-entry-grid__label">{{ getItemLabel(item) }}</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { computed } from "vue";
const props = defineProps<{
items: UTSJSONObject[]
activeKey: string
}>();
const emit = defineEmits<{
change: [key: string]
}>();
const entryItems = computed((): UTSJSONObject[] => {
return props.items;
});
function getItemKey(item: UTSJSONObject): string {
const value = item["key"];
return value != null ? `${value}` : "";
}
function getItemLabel(item: UTSJSONObject): string {
const value = item["label"];
return value != null ? `${value}` : "";
}
function getItemIconSrc(item: UTSJSONObject): string {
const key = getItemKey(item);
const fieldName = key == props.activeKey ? "activeIconSrc" : "iconSrc";
const value = item[fieldName];
return value != null ? `${value}` : "";
}
function onEntryClick(key: string): void {
if (key == props.activeKey) return;
emit("change", key);
}
</script>
<style scoped lang="scss">
.module-entry-grid {
width: 100%;
min-height: 40px;
height: 100%;
background-color: var(--module-entry-grid-bg, #ffffff);
border-radius: var(--module-entry-grid-radius, 8px);
box-sizing: border-box;
overflow: visible;
}
.module-entry-grid__list {
width: 100%;
min-height: 40px;
height: 100%;
display: flex;
flex-direction: var(--module-entry-grid-list-direction, row);
flex-wrap: var(--module-entry-grid-list-wrap, nowrap);
align-items: stretch;
align-content: flex-start;
box-sizing: border-box;
padding: var(--module-entry-grid-list-padding, 0px);
}
.module-entry-grid__item {
width: var(--module-entry-grid-item-width, 88px);
min-height: 40px;
height: var(--module-entry-grid-item-height, 40px);
flex-shrink: 0;
display: flex;
flex-direction: var(--module-entry-grid-item-direction, row);
align-items: center;
justify-content: center;
border-radius: var(--module-entry-grid-item-radius, 7px);
background-color: var(--module-entry-grid-item-bg, transparent);
box-sizing: border-box;
margin-right: var(--module-entry-grid-item-gap, 0px);
margin-bottom: var(--module-entry-grid-item-bottom-gap, 0px);
}
.module-entry-grid__item--active {
background-color: var(--module-entry-grid-item-active-bg, #f6f9ff);
}
.module-entry-grid__icon {
width: var(--module-entry-grid-icon-size, 16px);
height: var(--module-entry-grid-icon-size, 16px);
margin-right: var(--module-entry-grid-icon-margin-right, 4px);
margin-bottom: var(--module-entry-grid-icon-margin-bottom, 0px);
}
.module-entry-grid__label {
font-size: var(--module-entry-grid-label-size, 13px);
color: var(--module-entry-grid-label-color, #202939);
font-weight: 400;
}
.module-entry-grid__item--active .module-entry-grid__label {
color: var(--tasks-primary, #2f6af7);
font-weight: 600;
}
</style>
...@@ -54,6 +54,13 @@ export const HOME_FRAME_TABS: TabItem[] = [ ...@@ -54,6 +54,13 @@ export const HOME_FRAME_TABS: TabItem[] = [
iconSrcActive: "/static/images/tabbar/study-active.png", iconSrcActive: "/static/images/tabbar/study-active.png",
iconSrcInactive: "/static/images/tabbar/study.png" iconSrcInactive: "/static/images/tabbar/study.png"
}, },
{
label: "任务",
icon: "home",
name: "Tasks",
iconSrcActive: "/static/images/tabbar/home-active.png",
iconSrcInactive: "/static/images/tabbar/home.png"
},
]; ];
function reLaunchPage(pagesJsonPath: string): void { function reLaunchPage(pagesJsonPath: string): void {
...@@ -97,6 +104,10 @@ export function navigateToTab(index: number, currentTabIndex: number): void { ...@@ -97,6 +104,10 @@ export function navigateToTab(index: number, currentTabIndex: number): void {
switchTabPage("pages/person/myCenter"); switchTabPage("pages/person/myCenter");
return; return;
} }
if (index == 2) {
switchTabPage("pages/tasks/tasks");
return;
}
} }
export function useHomeFrameTabbar(source: HomeFrameTabbarSource) { export function useHomeFrameTabbar(source: HomeFrameTabbarSource) {
......
...@@ -89,6 +89,13 @@ ...@@ -89,6 +89,13 @@
} }
}, },
{ {
"path": "pages/tasks/tasks",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "任务"
}
},
{
"path": "pages/common/orderEntry/index", "path": "pages/common/orderEntry/index",
"style": { "style": {
"navigationBarTitleText": "录单" "navigationBarTitleText": "录单"
...@@ -135,6 +142,12 @@ ...@@ -135,6 +142,12 @@
"selectedIconPath": "static/images/tabbar/home-active.png" "selectedIconPath": "static/images/tabbar/home-active.png"
}, },
{ {
"pagePath": "pages/tasks/tasks",
"text": "任务",
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home-active.png"
},
{
"pagePath": "pages/person/myCenter", "pagePath": "pages/person/myCenter",
"text": "我的", "text": "我的",
"iconPath": "static/images/tabbar/study.png", "iconPath": "static/images/tabbar/study.png",
......
<template>
<view class="task-card daily-report-module">
<view class="task-segment">
<view v-for="(item, index) in reportScopes"
:key="index"
class="task-segment__item"
:class="activeScopeIndex == index ? 'task-segment__item--active' : ''"
@click="activeScopeIndex = index">
<text class="task-segment__text">{{ item }}</text>
</view>
</view>
<view class="daily-form">
<view class="daily-form__title-row">
<image class="daily-form__title-icon"
mode="aspectFit"
src="/static/images/tabbar/record-active.png" />
<text class="daily-form__title">{{ activeScopeTitle }}</text>
</view>
<view class="daily-form__grid">
<view v-for="(item, index) in dailyFields"
:key="index"
class="daily-field">
<text class="daily-field__label">{{ item.label }}</text>
<input class="daily-field__input"
type="number"
:value="item.value"
placeholder="0" />
</view>
</view>
<view class="daily-field daily-field--full">
<text class="daily-field__label">备注</text>
<textarea class="daily-field__textarea"
:auto-height="false"
maxlength="200" />
</view>
<button class="daily-submit-btn">
<image class="daily-submit-btn__icon"
mode="aspectFit"
src="/static/images/tabbar/record-active.png" />
<text class="daily-submit-btn__text">提交日报</text>
</button>
</view>
</view>
</template>
<script setup lang="uts">
import { computed, ref } from "vue";
type DailyField = {
label: string
value: string
}
const reportScopes = ["个人", "门店", "品牌"];
const activeScopeIndex = ref<number>(0);
const dailyFields: DailyField[] = [
{ label: "交车数", value: "0" },
{ label: "触客数", value: "0" },
{ label: "意向客户", value: "0" },
{ label: "成交额", value: "0" }
];
const activeScopeTitle = computed((): string => {
if (activeScopeIndex.value == 1) return "门店日报";
if (activeScopeIndex.value == 2) return "品牌日报";
return "个人日报";
});
</script>
<style scoped lang="scss">
@import "../styles/common.scss";
</style>
<template>
<view class="task-card task-placeholder-module">
<image class="task-placeholder-module__icon"
mode="aspectFit"
src="/static/images/home/setting.png" />
<text class="task-placeholder-module__title">审阅</text>
<text class="task-placeholder-module__desc">审阅模块内容会在这里接入。</text>
</view>
</template>
<script setup lang="uts">
</script>
<style scoped lang="scss">
@import "../styles/common.scss";
</style>
<template>
<view class="task-card task-placeholder-module">
<image class="task-placeholder-module__icon"
mode="aspectFit"
src="/static/images/home/scene-change.png" />
<text class="task-placeholder-module__title">策略</text>
<text class="task-placeholder-module__desc">策略模块内容会在这里接入。</text>
</view>
</template>
<script setup lang="uts">
</script>
<style scoped lang="scss">
@import "../styles/common.scss";
</style>
<template>
<view class="study-module">
<view class="study-side-card">
<text class="study-side-card__title">我的学习时长</text>
<view class="study-duration-box">
<view class="study-duration-item">
<text class="study-duration-item__tag">累计</text>
<text class="study-duration-item__value">0.3小时</text>
</view>
<view class="study-duration-item">
<text class="study-duration-item__tag">本月</text>
<text class="study-duration-item__value">-小时</text>
</view>
</view>
<view class="study-shortcuts">
<view v-for="(item, index) in shortcuts"
:key="index"
class="study-shortcut">
<image class="study-shortcut__icon"
mode="aspectFit"
:src="item.iconSrc" />
<text class="study-shortcut__text">{{ item.label }}</text>
</view>
</view>
</view>
<view class="study-course-panel">
<view class="study-course-tabs">
<view class="study-course-tab study-course-tab--active">
<text class="study-course-tab__text">正在学习</text>
</view>
<view class="study-course-tab">
<text class="study-course-tab__text">全部课程</text>
</view>
</view>
<view class="study-notice">
<text class="study-notice__text">本周学习时长小时</text>
</view>
<view class="study-course-grid">
<view v-for="(item, index) in courses"
:key="index"
class="study-course-card">
<view class="study-course-card__cover">
<text class="study-course-card__type">{{ item.typeText }}</text>
</view>
<view class="study-course-card__body">
<text class="study-course-card__title">{{ item.title }}</text>
<text class="study-course-card__meta">课程时长 {{ item.duration }}</text>
<view class="study-progress-row">
<text class="study-course-card__meta">任务进度</text>
<view class="study-progress">
<view class="study-progress__bar"
:style="{ width: item.progress + '%' }"></view>
</view>
<text class="study-progress__text">{{ item.progress }}%</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="uts">
type StudyShortcut = {
label: string
iconSrc: string
}
type StudyCourse = {
title: string
duration: string
progress: number
typeText: string
}
const shortcuts: StudyShortcut[] = [
{ label: "我的课程", iconSrc: "/static/images/tabbar/study-active.png" },
{ label: "我的考试", iconSrc: "/static/images/tabbar/record-active.png" },
{ label: "我的任务", iconSrc: "/static/images/tabbar/home-active.png" },
{ label: "排行榜", iconSrc: "/static/images/home/start-btn.png" }
];
const courses: StudyCourse[] = [
{ title: "广联数科公司介绍", duration: "0min", progress: 50, typeText: "文档" },
{ title: "课程名称38420940234...", duration: "33min", progress: 0, typeText: "文档" },
{ title: "零售驻店岗管理制度-宣...", duration: "0min", progress: 50, typeText: "文档" },
{ title: "限制考试次数的课程", duration: "14.5min", progress: 50, typeText: "视频" },
{ title: "比亚迪(海豹06)-权...", duration: "5.6min", progress: 76, typeText: "视频" }
];
</script>
<style scoped lang="scss">
@import "../styles/common.scss";
</style>
export type TaskEntryKey = "daily" | "study" | "strategy" | "review";
export const TASK_ENTRY_CONFIGS: UTSJSONObject[] = [
{
key: "daily",
label: "日报",
iconSrc: "/static/images/tabbar/record.png",
activeIconSrc: "/static/images/tabbar/record-active.png"
} as UTSJSONObject,
{
key: "study",
label: "学习",
iconSrc: "/static/images/tabbar/study.png",
activeIconSrc: "/static/images/tabbar/study-active.png"
} as UTSJSONObject,
{
key: "strategy",
label: "策略",
iconSrc: "/static/images/home/scene-change.png",
activeIconSrc: "/static/images/home/scene-change.png"
} as UTSJSONObject,
{
key: "review",
label: "审阅",
iconSrc: "/static/images/home/setting.png",
activeIconSrc: "/static/images/home/setting.png"
} as UTSJSONObject
];
.tasks-page {
width: 100%;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
background-color: var(--tasks-bg-page, #f3f5f9);
box-sizing: border-box;
overflow: hidden;
}
.tasks-layout {
flex: 1;
min-height: 0;
display: flex;
flex-direction: var(--tasks-layout-direction, column);
padding: var(--tasks-layout-padding, 14px 16px 0);
box-sizing: border-box;
overflow: hidden;
}
.tasks-entry-panel {
flex: var(--tasks-entry-panel-flex, 0 0 auto);
width: var(--tasks-entry-panel-width, 100%);
height: var(--tasks-entry-panel-height, auto);
min-height: var(--tasks-entry-panel-min-height, 40px);
display: flex;
flex-direction: column;
background-color: var(--module-entry-grid-bg, #ffffff);
border-radius: var(--module-entry-grid-radius, 8px);
margin-right: var(--tasks-entry-panel-margin-right, 0px);
margin-bottom: var(--tasks-entry-panel-margin-bottom, 12px);
box-sizing: border-box;
overflow: hidden;
}
.tasks-content-panel {
flex: 1;
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.task-card {
width: 100%;
background-color: var(--tasks-bg-card, #ffffff);
border-radius: var(--tasks-card-radius, 12px);
box-sizing: border-box;
}
.task-segment {
height: 38px;
display: flex;
flex-direction: row;
align-items: stretch;
background-color: var(--tasks-bg-card, #ffffff);
border-radius: var(--tasks-segment-radius, 8px);
overflow: hidden;
margin-bottom: 10px;
}
.task-segment__item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
border-bottom: 2px solid transparent;
}
.task-segment__item--active {
border-bottom-color: var(--tasks-primary, #2f6af7);
}
.task-segment__text {
font-size: 13px;
color: var(--tasks-text-secondary, #475569);
}
.task-segment__item--active .task-segment__text {
color: var(--tasks-primary, #2f6af7);
font-weight: 600;
}
.daily-report-module {
padding: var(--tasks-daily-card-padding, 0px);
background-color: transparent;
}
.daily-form {
background-color: var(--tasks-bg-card, #ffffff);
border-radius: var(--tasks-card-radius, 12px);
padding: var(--tasks-daily-form-padding, 16px);
box-sizing: border-box;
}
.daily-form__title-row {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 12px;
}
.daily-form__title-icon {
width: 18px;
height: 18px;
margin-right: 5px;
}
.daily-form__title {
font-size: 17px;
font-weight: 700;
color: var(--tasks-text-primary, #111827);
}
.daily-form__grid {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
.daily-field {
width: var(--tasks-daily-field-width, 48%);
display: flex;
flex-direction: column;
margin-bottom: 12px;
}
.daily-field--full {
width: 100%;
}
.daily-field__label {
font-size: 13px;
font-weight: 600;
color: var(--tasks-text-primary, #202939);
margin-bottom: 6px;
}
.daily-field__input,
.daily-field__textarea {
width: 100%;
background-color: #fbfcfe;
border: 1px solid var(--tasks-input-border, #e2e8f0);
border-radius: 7px;
box-sizing: border-box;
font-size: 15px;
color: var(--tasks-text-primary, #111827);
}
.daily-field__input {
height: 40px;
padding: 0 12px;
}
.daily-field__textarea {
height: var(--tasks-daily-textarea-height, 60px);
padding: 10px 12px;
}
.daily-submit-btn {
width: 100%;
height: var(--tasks-submit-height, 50px);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 9px;
background-color: #21a84f;
margin-top: 2px;
}
.daily-submit-btn::after {
border: none;
}
.daily-submit-btn__icon {
width: 18px;
height: 18px;
margin-right: 6px;
}
.daily-submit-btn__text {
font-size: 17px;
font-weight: 700;
color: #ffffff;
}
.study-module {
flex: 1;
min-height: 0;
display: flex;
flex-direction: var(--tasks-study-layout-direction, column);
}
.study-side-card {
width: var(--tasks-study-side-width, 100%);
flex-shrink: 0;
background-color: rgba(255, 255, 255, 0.88);
border-radius: 14px;
padding: 14px;
box-sizing: border-box;
margin-right: var(--tasks-study-side-margin-right, 0px);
margin-bottom: var(--tasks-study-side-margin-bottom, 12px);
}
.study-side-card__title {
font-size: 14px;
color: var(--tasks-text-primary, #202939);
}
.study-duration-box {
height: 88px;
display: flex;
flex-direction: row;
margin-top: 10px;
background-color: #f6f8ff;
border-radius: 6px;
padding: 10px 8px;
box-sizing: border-box;
}
.study-duration-item {
flex: 1;
display: flex;
flex-direction: column;
}
.study-duration-item__tag {
width: 44px;
height: 20px;
line-height: 20px;
text-align: center;
border-radius: 3px;
background-color: #e8efff;
font-size: 12px;
color: #5b83ff;
}
.study-duration-item__value {
margin-top: 18px;
font-size: 18px;
color: #5b83ff;
}
.study-shortcuts {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-top: 18px;
}
.study-shortcut {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 24px;
}
.study-shortcut__icon {
width: 28px;
height: 28px;
}
.study-shortcut__text {
margin-top: 8px;
font-size: 13px;
color: var(--tasks-text-secondary, #475569);
}
.study-course-panel {
flex: 1;
min-width: 0;
min-height: 0;
background-color: var(--tasks-bg-card, #ffffff);
border-radius: 16px;
padding: var(--tasks-study-course-padding, 12px 18px);
box-sizing: border-box;
overflow: hidden;
}
.study-course-tabs {
height: 32px;
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 8px;
}
.study-course-tab {
width: 160px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-bottom: 3px solid transparent;
}
.study-course-tab--active {
border-bottom-color: var(--tasks-primary, #2f6af7);
}
.study-course-tab__text {
font-size: 14px;
color: var(--tasks-text-secondary, #475569);
}
.study-course-tab--active .study-course-tab__text {
color: var(--tasks-primary, #2f6af7);
font-weight: 600;
}
.study-notice {
height: 20px;
display: flex;
align-items: center;
background-color: #fff3df;
border-radius: 3px;
padding: 0 10px;
margin-bottom: 14px;
}
.study-notice__text {
font-size: 11px;
color: #ff8a00;
}
.study-course-grid {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.study-course-card {
width: var(--tasks-course-card-width, 31%);
min-width: var(--tasks-course-card-min-width, 156px);
background-color: #ffffff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 14px rgba(47, 106, 247, 0.1);
margin-right: 14px;
margin-bottom: 14px;
}
.study-course-card__cover {
height: 78px;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: flex-start;
background: linear-gradient(135deg, #eaf4ff 0%, #b8e4ff 54%, #f4f9ff 100%);
}
.study-course-card__type {
height: 22px;
line-height: 22px;
padding: 0 7px;
background-color: rgba(36, 90, 150, 0.72);
color: #ffffff;
font-size: 12px;
}
.study-course-card__body {
padding: 10px;
box-sizing: border-box;
}
.study-course-card__title {
font-size: 14px;
color: var(--tasks-text-primary, #202939);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.study-course-card__meta {
margin-top: 6px;
font-size: 12px;
color: #7b8798;
}
.study-progress-row {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 6px;
}
.study-progress {
width: 64px;
height: 6px;
background-color: #bcd2ff;
border-radius: 3px;
overflow: hidden;
margin-left: 8px;
}
.study-progress__bar {
height: 6px;
border-radius: 3px;
background-color: #3773f8;
}
.study-progress__text {
font-size: 11px;
color: #4b7dff;
margin-left: 8px;
}
.task-placeholder-module {
flex: 1;
min-height: 260px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.task-placeholder-module__icon {
width: 44px;
height: 44px;
margin-bottom: 12px;
}
.task-placeholder-module__title {
font-size: 18px;
font-weight: 700;
color: var(--tasks-text-primary, #111827);
}
.task-placeholder-module__desc {
margin-top: 8px;
font-size: 14px;
color: var(--tasks-text-secondary, #64748b);
}
export default {
common: {
"--tasks-primary": "#2f6af7",
"--tasks-text-primary": "#111827",
"--tasks-text-secondary": "#475569",
"--tasks-border-soft": "#edf0f5",
"--tasks-input-border": "#e2e8f0",
"--tasks-bg-page": "#f3f5f9",
"--tasks-bg-card": "#ffffff",
"--tasks-card-radius": "12px",
"--tasks-segment-radius": "8px",
"--module-entry-grid-bg": "#ffffff",
"--module-entry-grid-radius": "8px"
},
portrait: {
"--content-box-padding-side": "14px",
"--tasks-layout-direction": "column",
"--tasks-layout-padding": "14px 16px 0",
"--tasks-entry-panel-flex": "0 0 auto",
"--tasks-entry-panel-width": "100%",
"--tasks-entry-panel-height": "40px",
"--tasks-entry-panel-min-height": "40px",
"--tasks-entry-panel-margin-right": "0px",
"--tasks-entry-panel-margin-bottom": "12px",
"--module-entry-grid-list-direction": "row",
"--module-entry-grid-list-wrap": "nowrap",
"--module-entry-grid-list-padding": "0px",
"--module-entry-grid-item-width": "88px",
"--module-entry-grid-item-height": "40px",
"--module-entry-grid-item-direction": "row",
"--module-entry-grid-item-gap": "0px",
"--module-entry-grid-item-bottom-gap": "0px",
"--module-entry-grid-icon-size": "15px",
"--module-entry-grid-icon-margin-right": "4px",
"--module-entry-grid-icon-margin-bottom": "0px",
"--module-entry-grid-label-size": "13px",
"--tasks-daily-form-padding": "16px",
"--tasks-daily-field-width": "48%",
"--tasks-daily-textarea-height": "60px",
"--tasks-submit-height": "50px",
"--tasks-study-layout-direction": "column",
"--tasks-study-side-width": "100%",
"--tasks-study-side-margin-right": "0px",
"--tasks-study-side-margin-bottom": "12px",
"--tasks-study-course-padding": "12px",
"--tasks-course-card-width": "100%",
"--tasks-course-card-min-width": "0px"
},
landscape: {
"--content-box-padding-side": "12px",
"--tasks-layout-direction": "row",
"--tasks-layout-padding": "12px 0 12px",
"--tasks-entry-panel-flex": "0 0 auto",
"--tasks-entry-panel-width": "276px",
"--tasks-entry-panel-height": "100%",
"--tasks-entry-panel-min-height": "260px",
"--tasks-entry-panel-margin-right": "20px",
"--tasks-entry-panel-margin-bottom": "0px",
"--module-entry-grid-list-direction": "row",
"--module-entry-grid-list-wrap": "wrap",
"--module-entry-grid-list-padding": "22px 14px",
"--module-entry-grid-item-width": "33.33%",
"--module-entry-grid-item-height": "72px",
"--module-entry-grid-item-direction": "column",
"--module-entry-grid-item-gap": "0px",
"--module-entry-grid-item-bottom-gap": "16px",
"--module-entry-grid-icon-size": "28px",
"--module-entry-grid-icon-margin-right": "0px",
"--module-entry-grid-icon-margin-bottom": "8px",
"--module-entry-grid-label-size": "14px",
"--tasks-daily-form-padding": "20px",
"--tasks-daily-field-width": "48%",
"--tasks-daily-textarea-height": "72px",
"--tasks-submit-height": "52px",
"--tasks-study-layout-direction": "row",
"--tasks-study-side-width": "276px",
"--tasks-study-side-margin-right": "20px",
"--tasks-study-side-margin-bottom": "0px",
"--tasks-study-course-padding": "12px 18px",
"--tasks-course-card-width": "31%",
"--tasks-course-card-min-width": "156px"
},
resolutions: {
"landscape-1024x768": {
"--tasks-entry-panel-width": "276px",
"--tasks-layout-padding": "12px 0 12px",
"--tasks-course-card-width": "31%"
},
"landscape-816x393": {
"--tasks-entry-panel-width": "220px",
"--tasks-entry-panel-height": "100%",
"--module-entry-grid-list-padding": "18px 10px",
"--module-entry-grid-item-height": "64px",
"--module-entry-grid-icon-size": "24px",
"--tasks-study-side-width": "220px",
"--tasks-course-card-width": "46%",
"--tasks-course-card-min-width": "140px"
},
"portrait-393x816": {
"--tasks-layout-padding": "14px 16px 0"
},
"portrait-414x896": {
"--tasks-layout-padding": "14px 16px 0"
}
}
}
<template>
<TabBarShell ref="shellRef"
:active-tab-index="2"
:page-vars="taskPageVars as UTSJSONObject">
<view class="tasks-page">
<view class="tasks-layout">
<view class="tasks-entry-panel">
<EntryGrid
:items="taskEntryConfigs"
:active-key="activeEntryKey"
@change="onEntryChange" />
</view>
<view class="tasks-content-panel">
<component :is="activeEntryComponent" />
</view>
</view>
</view>
</TabBarShell>
</template>
<script setup lang="uts">
import { computed, ref } from "vue";
import TabBarShell from "@/components/TabBar/TabBarShell.uvue";
import DailyReport from "./components/DailyReport.uvue";
import ReviewPanel from "./components/ReviewPanel.uvue";
import StrategyPanel from "./components/StrategyPanel.uvue";
import StudyPanel from "./components/StudyPanel.uvue";
import EntryGrid from "@/components/EntryGrid.uvue";
import { TASK_ENTRY_CONFIGS, type TaskEntryKey } from "./constants/taskEntries.uts";
import taskPageVars from "./styles/index.vars.uts";
const shellRef = ref(null);
const taskEntryConfigs = TASK_ENTRY_CONFIGS;
const activeEntryKey = ref<TaskEntryKey>("daily");
const entryComponentMap = {
daily: DailyReport,
study: StudyPanel,
strategy: StrategyPanel,
review: ReviewPanel
};
const activeEntryComponent = computed((): any => {
return entryComponentMap[activeEntryKey.value];
});
function onEntryChange(key: string): void {
activeEntryKey.value = key as TaskEntryKey;
}
</script>
<style scoped lang="scss">
@import "./styles/common.scss";
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!