Commit 358d23ae by chenwq

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

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