Commit 358d23ae by chenwq

feat(tasks): 新增独立日报创建页面

- 新增pages/tasks/dailyReportCreate.uvue独立日报创建页面
- 在pages.json中注册该页面的路由配置
- 改造原DailyReport组件的创建逻辑,改为跳转至新页面并添加失败回退逻辑
- 优化CustomForm组件提交按钮的样式以匹配设计规范
- 移除日报表单中的个人/门店/品牌范围选择标签
1 parent cab97d57
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<un-button <un-button
class="custom-form__submit" class="custom-form__submit"
type="success" type="primary"
:block="true" :block="true"
:customStyle="submitButtonStyle" :customStyle="submitButtonStyle"
@click="submitForm"> @click="submitForm">
...@@ -144,9 +144,11 @@ const placeholderStyle = { ...@@ -144,9 +144,11 @@ const placeholderStyle = {
const submitButtonStyle = { const submitButtonStyle = {
width: "100%", width: "100%",
height: "var(--tasks-submit-height, 50px)", height: "var(--tasks-submit-height, 44px)",
borderRadius: "9px", borderRadius: "12px",
backgroundColor: "#21a84f", backgroundColor: "var(--tasks-primary, #2f6af7)",
borderColor: "var(--tasks-primary, #2f6af7)",
boxShadow: "0 8px 16px rgba(47, 106, 247, 0.18)",
marginTop: "2px" marginTop: "2px"
} as UTSJSONObject; } as UTSJSONObject;
...@@ -408,11 +410,12 @@ onMounted((): void => { ...@@ -408,11 +410,12 @@ onMounted((): void => {
.custom-form__submit { .custom-form__submit {
width: 100%; width: 100%;
margin-top: 2px; margin-top: 2px;
border-radius: 12px;
} }
.custom-form__submit-text { .custom-form__submit-text {
font-size: 17px; font-size: 15px;
font-weight: 700; font-weight: 600;
color: #ffffff; color: #ffffff;
} }
</style> </style>
...@@ -103,6 +103,13 @@ ...@@ -103,6 +103,13 @@
} }
}, },
{ {
"path": "pages/tasks/dailyReportCreate",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "新增日报"
}
},
{
"path": "pages/common/orderEntry/index", "path": "pages/common/orderEntry/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
......
...@@ -217,7 +217,12 @@ function onScrollToLower(): void { ...@@ -217,7 +217,12 @@ function onScrollToLower(): void {
} }
function onCreateDailyReport(): void { function onCreateDailyReport(): void {
uni.navigateTo({
url: "/pages/tasks/dailyReportCreate",
fail: (_err: AnyOrNull): void => {
showCreateForm.value = true; showCreateForm.value = true;
}
});
} }
function onBackToList(): void { function onBackToList(): void {
......
...@@ -8,22 +8,12 @@ ...@@ -8,22 +8,12 @@
</view> </view>
</view> </view>
<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">
<view class="daily-form__title-row"> <view class="daily-form__title-row">
<image class="daily-form__title-icon" <image class="daily-form__title-icon"
mode="aspectFit" mode="aspectFit"
src="/static/images/tabbar/record-active.png" /> src="/static/images/tabbar/record-active.png" />
<text class="daily-form__title">{{ activeScopeTitle }}</text> <text class="daily-form__title">日报</text>
</view> </view>
<CustomForm <CustomForm
...@@ -36,26 +26,15 @@ ...@@ -36,26 +26,15 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { computed, ref } from "vue";
import CustomForm from "@/components/CustomForm.uvue"; import CustomForm from "@/components/CustomForm.uvue";
import { DAILY_REPORT_FORM_ITEMS } from "../constants/dailyReportForm.uts"; import { DAILY_REPORT_FORM_ITEMS } from "../constants/dailyReportForm.uts";
const reportScopes = ["个人", "门店", "品牌"];
const activeScopeIndex = ref<number>(0);
const dailyReportFormItems = DAILY_REPORT_FORM_ITEMS; const dailyReportFormItems = DAILY_REPORT_FORM_ITEMS;
const emit = defineEmits<{ const emit = defineEmits<{
back: [] back: []
}>(); }>();
const activeScopeTitle = computed((): string => {
if (activeScopeIndex.value == 1) return "门店日报";
if (activeScopeIndex.value == 2) return "品牌日报";
return "个人日报";
});
function onSubmitDailyReport(data: UTSJSONObject): void { function onSubmitDailyReport(data: UTSJSONObject): void {
console.log("[DailyReportForm] submit", data); console.log("[DailyReportForm] submit", data);
uni.showToast({ title: "提交成功", icon: "success" }); uni.showToast({ title: "提交成功", icon: "success" });
......
<template>
<layout-root :page-vars="taskPageVars as UTSJSONObject">
<view class="daily-create-page">
<DailyReportForm @back="onBack" />
</view>
</layout-root>
</template>
<script setup lang="uts">
import DailyReportForm from "./components/DailyReportForm.uvue";
import taskPageVars from "./styles/index.vars.uts";
function onBack(): void {
uni.navigateBack();
}
</script>
<style scoped lang="scss">
@import "./styles/common.scss";
.daily-create-page {
width: 100%;
height: 100%;
min-height: 0;
display: flex;
flex-direction: column;
background-color: var(--tasks-bg-page, #f3f5f9);
padding: var(--tasks-layout-padding, 14px 16px 0);
box-sizing: border-box;
overflow: hidden;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!