Shan9312 6 months ago
parent
commit
c47c47eed9

+ 3 - 0
.vscode/settings.json

@@ -61,5 +61,8 @@
     ".eslintrc.cjs": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,.stylelintrc.*,.eslintrc-auto-import.json,.editorconfig,.commitlint.cjs",
     "vite.config.ts": "tsconfig.*.json,uno.config.ts,tsconfig.json,uni-pages.d.ts",
     "manifest.config.ts": "manifest.config.ts,pages.config.ts"
+  },
+  "[json]": {
+    "editor.defaultFormatter": "vscode.json-language-features"
   }
 }

+ 12 - 12
pages.config.ts

@@ -32,18 +32,18 @@ export default defineUniPages({
         pagePath: 'pages/index/index',
         text: '首页',
       },
-      {
-        iconPath: 'static/tabbar/work.png',
-        selectedIconPath: 'static/tabbar/workHL.png',
-        pagePath: 'pages/workAll/workAll',
-        text: '工作台',
-      },
-      {
-        iconPath: 'static/tabbar/tong.png',
-        selectedIconPath: 'static/tabbar/tongHL.png',
-        pagePath: 'pages/about/about',
-        text: '分析',
-      },
+      // {
+      //   iconPath: 'static/tabbar/work.png',
+      //   selectedIconPath: 'static/tabbar/workHL.png',
+      //   pagePath: 'pages/workAll/workAll',
+      //   text: '工作台',
+      // },
+      // {
+      //   iconPath: 'static/tabbar/tong.png',
+      //   selectedIconPath: 'static/tabbar/tongHL.png',
+      //   pagePath: 'pages/about/about',
+      //   text: '分析',
+      // },
       {
         iconPath: 'static/tabbar/personal.png',
         selectedIconPath: 'static/tabbar/personalHL.png',

+ 6 - 0
src/App.vue

@@ -17,6 +17,12 @@ onHide(() => {
 </script>
 
 <style lang="scss">
+/* #ifdef H5 */
+uni-page-head {
+  display: none;
+}
+/* #endif */
+
 #app {
   background-color: #f5f5f5;
 }

+ 36 - 18
src/pages.json

@@ -29,18 +29,6 @@
         "pagePath": "pages/index/index",
         "text": "首页"
       },
-      {
-        "iconPath": "static/tabbar/work.png",
-        "selectedIconPath": "static/tabbar/workHL.png",
-        "pagePath": "pages/workAll/workAll",
-        "text": "工作台"
-      },
-      {
-        "iconPath": "static/tabbar/tong.png",
-        "selectedIconPath": "static/tabbar/tongHL.png",
-        "pagePath": "pages/about/about",
-        "text": "分析"
-      },
       {
         "iconPath": "static/tabbar/personal.png",
         "selectedIconPath": "static/tabbar/personalHL.png",
@@ -51,18 +39,25 @@
   },
   "pages": [
     {
-      "path": "pages/index/index",
+      "path": "pages/my/my",
+      "type": "home",
+      "style": {
+        "navigationBarTitleText": "我的",
+        "navigationBarBackgroundColor": "#f59e0b"
+      }
+    },
+    {
+      "path": "pages/index/index2",
       "type": "home",
       "style": {
-        "navigationStyle": "custom",
         "navigationBarTitleText": "首页"
       }
     },
     {
-      "path": "pages/my/my",
+      "path": "pages/index/index",
       "type": "home",
       "style": {
-        "navigationStyle": "custom",
+        "navigationBarBackgroundColor": "#f59e0b",
         "navigationBarTitleText": "首页"
       }
     },
@@ -87,6 +82,13 @@
         "navigationBarTitleText": "新增信息"
       }
     },
+    {
+      "path": "pages/disease/disease",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "疾病"
+      }
+    },
     {
       "path": "pages/editPassword/editPassword",
       "type": "page",
@@ -119,14 +121,16 @@
       "path": "pages/notice/notice",
       "type": "page",
       "style": {
-        "navigationBarTitleText": "消息"
+        "navigationBarTitleText": "消息",
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/phone/phone",
       "type": "page",
       "style": {
-        "navigationBarTitleText": "手机登录"
+        "navigationBarTitleText": "手机登录",
+        "navigationStyle": "custom"
       }
     },
     {
@@ -164,6 +168,20 @@
         "navigationBarTitleText": "服务条款"
       }
     },
+    {
+      "path": "pages/treat/treat",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "诊断录入"
+      }
+    },
+    {
+      "path": "pages/treatMent/treatMent",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "治疗方案"
+      }
+    },
     {
       "path": "pages/untyNeckRing/untyNeckRing",
       "type": "page",

+ 132 - 0
src/pages/disease/disease.vue

@@ -0,0 +1,132 @@
+<route lang="json5" type="page">
+{
+  style: { navigationBarTitleText: '疾病' },
+}
+</route>
+
+<template>
+  <view class="text-center">
+    <wd-search
+      placeholder="请输入疾病名称"
+      cancel-txt="搜索"
+      v-model="serchObj.searchNum"
+      light
+      @cancel="doSearch"
+      @focus="showKeyBoard"
+    />
+
+    <view>
+      <wd-collapse v-model="value">
+        <wd-collapse-item
+          v-for="(category, index) in diseaseCategories"
+          :key="index"
+          :title="category.name"
+          name="item1"
+        >
+          <view class="child-category">
+            <wd-checkbox-group @change="handleSelect" v-model="ids" cell>
+              <wd-checkbox
+                v-for="(subCategory, subIndex) in category.subCategories"
+                :key="subIndex"
+                :modelValue="subCategory.id"
+                style="text-align: left"
+              >
+                {{ subCategory.name }}
+              </wd-checkbox>
+            </wd-checkbox-group>
+          </view>
+        </wd-collapse-item>
+      </wd-collapse>
+    </view>
+    <view class="footer mt-5 pb-20 center">
+      <wd-button type="primary" size="large" class="px-8" @click="submitSelection">确 定</wd-button>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { reactive, ref } from 'vue'
+import { useDiseaseStore } from '@/store'
+
+defineOptions({
+  name: 'Terat',
+})
+
+// pina 管里
+const diseaseStore = useDiseaseStore()
+const selectSubIds = ref<number[]>([])
+onMounted(() => {
+  selectSubIds.value = diseaseStore.getSelectedSubCategoryIds()
+})
+//
+const value = ref<number[]>([])
+const ids = ref<number[]>([])
+// 模拟的疾病分类数据
+const diseaseCategories = ref([
+  {
+    id: 1,
+    name: '感染性疾病', // 一级分类名称
+    subCategories: [
+      { id: 101, name: '病毒性疾病' },
+      { id: 102, name: '细菌性疾病' },
+    ],
+  },
+  {
+    id: 2,
+    name: '非感染性疾病',
+    subCategories: [
+      { id: 201, name: '遗传性疾病' },
+      { id: 202, name: '代谢性疾病' },
+    ],
+  },
+])
+
+const handleSelect = (ids) => {
+  selectSubIds.value = ids.value
+  diseaseStore.setSelectedSubCategoryIds(selectSubIds.value)
+  console.log(diseaseStore.selectedSubCategoryIds, ids, '9999')
+}
+
+const submitSelection = () => {
+  // 在这里处理选中的子类IDs,例如提交到服务器或存储到本地
+  console.log('Selected SubCategory IDs:', selectSubIds.value)
+}
+
+let serchObj = reactive({
+  searchNum: '',
+  historyList: [],
+})
+const visible = ref<boolean>(false)
+
+function showKeyBoard() {
+  visible.value = true
+}
+
+//用户搜索时将搜索文字存储
+function doSearch(searchStr) {
+  const val = searchStr.value.trim()
+  if (val) {
+    const history = serchObj.historyList.filter((item) => item !== val)
+    history.unshift(val)
+    if (history.length > 6) {
+      history.pop()
+    }
+    serchObj.historyList = history
+    uni.setStorageSync('history', JSON.stringify(serchObj.historyList))
+    uni.navigateTo({ url: `/pages/searchDetail/searchDetail?serch=${searchStr.value}` })
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+//
+.parent-category {
+  margin: 10px 0;
+  font-weight: bold;
+  color: gray; /* 一级分类不可点击,设置不同样式 */
+}
+
+.child-category {
+  margin-left: 20px;
+}
+</style>

+ 1 - 0
src/pages/editPassword/editPassword.vue

@@ -2,6 +2,7 @@
 {
   style: {
     navigationBarTitleText: '修改密码',
+
     // navigationBarBackgroundColor: '#f6d7a7',
   },
 }

+ 1 - 0
src/pages/feedBack/feedBack.vue

@@ -2,6 +2,7 @@
 {
   style: {
     navigationBarTitleText: '意见反馈',
+
     // navigationBarBackgroundColor: '#f6d7a7',
   },
 }

+ 237 - 0
src/pages/index/components/works.vue

@@ -0,0 +1,237 @@
+<route lang="json5">
+{
+  style: {
+    navigationBarTitleText: '工作台',
+  },
+}
+</route>
+
+<template>
+  <view class="overflow-hidden">
+    <view class="wraper">
+      <wd-sidebar v-model="active" @change="handleChange">
+        <wd-sidebar-item
+          v-for="(item, index) in categories"
+          :key="index"
+          :value="index"
+          :label="item.label"
+          :disabled="item.disabled"
+          :is-dot="item.num"
+        />
+      </wd-sidebar>
+      <view class="content" :style="`transform: translateY(-${active * 100}%)`">
+        <scroll-view
+          v-for="(item, index) in categories"
+          :key="index"
+          class="category"
+          scroll-y
+          scroll-with-animation
+          :show-scrollbar="false"
+          :scroll-top="scrollTop"
+          :throttle="false"
+        >
+          <wd-cell :title="item.title" value="待办事件" class="title-border"></wd-cell>
+          <view v-show="item.title == activeTitle">
+            <view v-if="activeTitle == item.label">
+              <view class="card" v-for="(child, index) in item.children" :key="index">
+                <!-- 诊断 -->
+                <view v-if="item.label == '诊断'">
+                  <view class="card-not" :style="{ backgroundColor: getColor(item.title) }">
+                    {{ item.title }}
+                  </view>
+                  <text class="cattle-num mb-2">牛号: 23874166</text>
+                  <wd-row>
+                    <wd-col :span="12">
+                      <view>
+                        栏舍:
+                        <text>5A-1001</text>
+                      </view>
+                    </wd-col>
+                    <wd-col :span="12">
+                      <view>
+                        备注:
+                        <text>12</text>
+                      </view>
+                    </wd-col>
+                  </wd-row>
+                </view>
+                <!-- 治疗 -->
+                <view v-if="item.label == '治疗'">
+                  <view class="card-not" :style="{ backgroundColor: getColor(item.title) }">
+                    {{ item.title }}
+                  </view>
+                  <text class="cattle-num mb-2">牛号: 23874166</text>
+                  <wd-row>
+                    <wd-col :span="12">
+                      <view>
+                        栏舍:
+                        <text>5A-1001</text>
+                      </view>
+                    </wd-col>
+                    <wd-col :span="12">
+                      <view>
+                        备注:
+                        <text>12</text>
+                      </view>
+                    </wd-col>
+                  </wd-row>
+                </view>
+              </view>
+            </view>
+          </view>
+        </scroll-view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref, nextTick } from 'vue'
+
+const active = ref<number>(0)
+const scrollTop = ref<number>(0)
+const activeTitle = ref<string>('诊断')
+
+// 品种与颜色的映射
+const breedColors = {
+  诊断: '#B22222',
+  治疗: '#228B22',
+  免疫: '#FF4500',
+  驱虫: '#B8860B',
+  进场: '#9ACD32',
+  离场: '#8B4513',
+}
+
+// 获取颜色的方法
+const getColor = (breed) => {
+  return breedColors[breed] || '#CCCCCC' // 如果品种没有匹配到颜色,使用默认颜色
+}
+
+// 工作台菜单数据
+const categories = ref([
+  {
+    label: '诊断',
+    title: '诊断',
+    children: [
+      { title: '标题文字', label: '这是描述这是描述' },
+      { title: '标题文字', label: '这是描述这是描述' },
+    ],
+    disabled: false,
+    num: 0,
+  },
+  {
+    label: '治疗',
+    title: '治疗',
+    children: [
+      { title: '标题文字', label: '这是描述这是描述' },
+      { title: '标题文字', label: '这是描述这是描述' },
+    ],
+    disabled: false,
+    num: 10,
+  },
+  {
+    label: '免疫',
+    title: '免疫',
+    children: [{ title: '标题文字', label: '这是描述这是描述' }],
+    disabled: false,
+    num: 3,
+  },
+  {
+    label: '驱虫',
+    title: '驱虫',
+    children: [{ title: '标题文字', label: '这是描述这是描述' }],
+    disabled: false,
+    num: 0,
+  },
+  {
+    label: '进场',
+    title: '进场',
+    children: [{ title: '标题文字', label: '这是描述这是描述' }],
+    disabled: false,
+    num: 1,
+  },
+  {
+    label: '离场',
+    title: '离场',
+    children: [{ title: '标题文字', label: '这是描述这是描述' }],
+    disabled: false,
+    num: 1,
+  },
+])
+
+// 切换菜单
+function handleChange({ value, label }) {
+  activeTitle.value = label
+  active.value = value
+  scrollTop.value = -1
+  nextTick(() => {
+    scrollTop.value = 0
+  })
+}
+</script>
+
+<style lang="scss" scoped>
+.cattle-num {
+  font-size: 28rpx;
+  font-weight: 500;
+  color: #f4940d;
+}
+.card {
+  position: relative;
+  display: flex;
+  flex-direction: column;
+  padding: 20rpx;
+  margin: 20rpx;
+  font-size: 26rpx;
+  text-align: left;
+  background-color: #fff;
+  border-radius: 10rpx;
+  box-shadow: 0 8rpx 12rpx rgba(0, 0, 0, 0.1);
+  transition: transform 0.2s ease, box-shadow 0.2s ease;
+  //   height: 80rpx;
+}
+.card-not {
+  position: absolute;
+  top: 60rpx;
+  right: -30rpx; /* 控制标签的水平位置 */
+  padding: 5rpx 40rpx; /* 控制标签的宽度 */
+  clip-path: polygon(20px 0, 0 100%, 100% 100%, calc(100% - 20px) 0); /* 创建等腰梯形 */
+  font-size: 24rpx;
+  font-weight: bold;
+  color: #fff;
+  text-align: center;
+  background-color: #ff5733;
+  transform: rotate(45deg); /* 旋转45度 */
+  transform-origin: right top; /* 设置旋转点 */
+}
+// .card-text {
+//   position: absolute;
+//   bottom: 0;
+//   display: block;
+//   width: 80rpx;
+//   //   height: 40rpx;
+//   font-size: 24rpx;
+//   color: #fff;
+//   text-align: center;
+//   background: #36a8ff;
+// }
+.title-border {
+  border-bottom: 1rpx solid #eee;
+}
+.wraper {
+  display: flex;
+  height: calc(100vh - var(--window-top));
+  height: calc(100vh - var(--window-top) - constant(safe-area-inset-bottom));
+  height: calc(100vh - var(--window-top) - env(safe-area-inset-bottom));
+  overflow: hidden;
+}
+.content {
+  flex: 1;
+  background: #fff;
+  transition: transform 0.4s ease;
+}
+.category {
+  box-sizing: border-box;
+  height: 100%;
+}
+</style>

+ 155 - 125
src/pages/index/index.vue

@@ -2,59 +2,48 @@
 <route lang="json5" type="home">
 {
   style: {
-    navigationStyle: 'custom',
+    //navigationStyle: 'custom',  // 用来隐藏顶部 首页 的导航
+    navigationBarBackgroundColor: '#f59e0b',
     navigationBarTitleText: '首页',
   },
 }
 </route>
 <template>
-  <view class="containe px-4">
-    <!-- 渐变色 -->
-    <view class="top-content"></view>
-    <view
-      class="overflow-hidden header header-fixed header-bg"
-      :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
-    >
-      <wd-badge modelValue="12" @click="watchNotice">
-        <wd-icon name="dong" size="48rpx" />
-      </wd-badge>
-      <view class="input-box mt-2" @click="handleSerch">
+  <view class="containe">
+    <!-- 搜索框 -->
+    <view class="header header-fixed header-bg">
+      <view class="input-box" @click="handleSerch">
         <wd-icon name="search" />
         请输入牛号
       </view>
     </view>
-    <!-- 进度 -->
-    <view class="work shadow-xl">
-      <view class="mt-4 mb-4 px-2 pb-2 title">工作进度</view>
-      <view class="work-box flex justify-around">
-        <wd-circle
-          customClass="z-index: -1; position: reletive;"
-          v-model="current"
-          color="#f59e0b"
-          :strokeWidth="15"
-          :text="`已完成${current}%`"
-        ></wd-circle>
-        <view class="do-work" @click="switchPage">
-          <text>待办事件:</text>
-          <text class="num">{{ 4 }}/</text>
-          <text class="num1">{{ 20 }}</text>
+    <!-- 菜单悬浮按钮  -->
+    <wd-fab v-model:active="active"></wd-fab>
+    <!-- 弹出层导航 -->
+    <wd-popup v-model="active" position="right" custom-style="padding:40rpx 20rpx  ;width:90%">
+      <view v-for="(item, index) in navList" :key="item.id">
+        <view class="mt-4 mb-4 px-2 title">{{ item.name }}</view>
+        <view class="work-box-t flex justify-left flex-row flex-wrap">
+          <view class="work-item mb-4 px-2" v-for="(child, index) in item.children" :key="index">
+            <navigator :url="child.url">
+              <image :src="child.img" mode="scaleToFill" class="image" />
+              <view class="item-title">
+                {{ child.title }}
+              </view>
+            </navigator>
+          </view>
         </view>
       </view>
-    </view>
-    <!-- 常用工具 -->
-    <view class="work mt-4 shadow-xl work-t">
-      <view class="mt-4 mb-4 px-2 title">常用工具</view>
-      <view class="work-box-t flex justify-left flex-row flex-wrap">
-        <view class="work-item mb-4 px-2" v-for="item in workList" :key="item.id">
-          <navigator :url="item.url">
-            <image :src="item.img" mode="scaleToFill" class="image" />
-            <view class="item-title">
-              {{ item.title }}
-            </view>
-          </navigator>
-        </view>
-      </view>
-    </view>
+    </wd-popup>
+    <!-- 标签页 -->
+    <wd-tabs v-model="tab" class="pt-3 overflow-hiddren">
+      <wd-tab title="工作台(待办20)">
+        <Works></Works>
+      </wd-tab>
+      <wd-tab title="分析">
+        <view>hhh</view>
+      </wd-tab>
+    </wd-tabs>
     <!-- 加载 -->
     <!-- <Loading></Loading> -->
   </view>
@@ -62,94 +51,135 @@
 
 <script lang="ts" setup>
 import { ref } from 'vue'
+import Works from './components/works.vue'
 
 defineOptions({
   name: 'Home',
 })
 
+const tab = ref<number>(0)
+const active = ref<boolean>(false)
+
 // 获取屏幕边界到安全区域距离
 const { safeAreaInsets } = uni.getSystemInfoSync()
-const workList = reactive([
-  {
-    id: '1-1',
-    img: '../../static/images/work/jinchang.png',
-    title: '购牛',
-    url: '/pages/purchase/purchase',
-  },
-  {
-    id: '1-2',
-    img: '../../static/images/work/lichang.png',
-    title: '入场',
-    url: '/pages/approach/approach',
-  },
-  {
-    id: 5,
-    img: '../../static/images/work/bohuan1.png',
-    title: '脖环绑定',
-    url: '/pages/neckRing/neckRing',
-  },
-  {
-    id: 1,
-    img: '../../static/images/work/weight.png',
-    title: '称重登记',
-    url: '/pages/weight/weight',
-  },
-  {
-    id: 5,
-    img: '../../static/images/work/bohuan1.png',
-    title: '脖环解绑',
-    url: '/pages/untyNeckRing/untyNeckRing',
-  },
-  {
-    id: 2,
-    img: '../../static/images/work/zhiliao.png',
-    title: '登记治疗',
-    url: '',
-  },
+const navList = ref([
   {
-    id: 3,
-    img: '../../static/images/work/fabing.png',
-    title: '诊断',
-    url: '',
-  },
-  {
-    id: 4,
-    img: '../../static/images/work/liuchan.png',
-    title: '流产登记',
-    url: '',
-  },
+    id: '1',
+    name: '牛只事件',
+    children: [
+      {
+        id: '1-1',
+        img: '../../static/images/work/jinchang.png',
+        title: '购牛',
+        url: '/pages/purchase/purchase',
+      },
+      {
+        id: '1-2',
+        img: '../../static/images/work/lichang.png',
+        title: '肉牛进场',
+        url: '/pages/approach/approach',
+      },
 
-  {
-    id: 6,
-    img: '../../static/images/work/result.png',
-    title: '治疗结果',
-    url: '',
-  },
-  {
-    id: 7,
-    img: '../../static/images/work/faqing.png',
-    title: '发情',
-    url: '',
-  },
-  {
-    id: 8,
-    img: '../../static/images/work/peizhong.png',
-    title: '配种',
-    url: '',
+      {
+        id: '1-3',
+        img: '../../static/images/work/bohuan1.png',
+        title: '脖环绑定',
+        url: '/pages/neckRing/neckRing',
+      },
+      {
+        id: '1-5',
+        img: '../../static/images/work/weight.png',
+        title: '称重',
+        url: '/pages/weight/weight',
+      },
+      {
+        id: '1-6',
+        img: '../../static/images/work/bohuan1.png',
+        title: '脖环解绑',
+        url: '/pages/untyNeckRing/untyNeckRing',
+      },
+      {
+        id: '1-2',
+        img: '../../static/images/work/lichang.png',
+        title: '繁殖进场',
+        url: '/pages/approach/approach',
+      },
+    ],
   },
   {
-    id: 9,
-    img: '../../static/images/work/yunjian.png',
-    title: '孕检登记',
-    url: '',
-  },
-  {
-    id: 10,
-    img: '../../static/images/work/jinweichan.png',
-    title: '进围产',
-    url: '',
+    id: '2',
+    name: '兽医事件',
+    children: [
+      {
+        id: '2-1',
+        img: '../../static/images/work/fabing.png',
+        title: '发病',
+        url: '/pages/treat/treat',
+      },
+      {
+        id: '2-2',
+        img: '../../static/images/work/zhiliao.png',
+        title: '去势',
+        url: '',
+      },
+      {
+        id: '2-2',
+        img: '../../static/images/work/zhiliao.png',
+        title: '检疫',
+        url: '',
+      },
+      {
+        id: '2-2',
+        img: '../../static/images/work/zhiliao.png',
+        title: '驱虫',
+        url: '',
+      },
+      {
+        id: '2-2',
+        img: '../../static/images/work/zhiliao.png',
+        title: '免疫',
+        url: '',
+      },
+    ],
   },
+  // {
+  //   id: '3',
+  //   name: '繁殖事件',
+  //   children: [
+  //     {
+  //       id: '3-1',
+  //       img: '../../static/images/work/liuchan.png',
+  //       title: '流产登记',
+  //       url: '',
+  //     },
+  //     {
+  //       id: '3-2',
+  //       img: '../../static/images/work/faqing.png',
+  //       title: '发情',
+  //       url: '',
+  //     },
+  //     {
+  //       id: '3-3',
+  //       img: '../../static/images/work/peizhong.png',
+  //       title: '配种',
+  //       url: '',
+  //     },
+  //     {
+  //       id: '3-4',
+  //       img: '../../static/images/work/yunjian.png',
+  //       title: '孕检登记',
+  //       url: '',
+  //     },
+  //     {
+  //       id: '3-5',
+  //       img: '../../static/images/work/jinweichan.png',
+  //       title: '进围产',
+  //       url: '',
+  //     },
+  //   ],
+  // },
 ])
+
 const current = ref(20)
 let earTag = ref<string | null>(null)
 
@@ -183,6 +213,10 @@ onLoad(() => {
 </script>
 
 <style lang="scss" scoped>
+.containe {
+  height: 100%;
+  // overflow: hidden;
+}
 .item-title {
   font-size: 28rpx;
 }
@@ -194,7 +228,7 @@ onLoad(() => {
   text-align: center;
 }
 .header {
-  padding: 32rpx;
+  padding: 32rpx 54rpx;
   margin-right: -32rpx;
   margin-left: -32rpx;
 }
@@ -205,20 +239,16 @@ onLoad(() => {
 }
 .header-bg {
   background: linear-gradient(to bottom, #f59e0b, #f5d198);
-  // background-color: #fafafa;
 }
 .image {
   width: 100rpx;
   height: 100rpx;
   margin-bottom: 30rpx;
 }
-.containe {
-  // background: #fafafa;
-  // position: relative;
-}
+
 .input-box {
   height: 80rpx;
-  margin-top: 44rpx;
+  // margin-top: 10rpx;
   line-height: 80rpx;
   color: #6b7280;
   text-align: center;
@@ -231,7 +261,7 @@ onLoad(() => {
   right: 0;
   left: 0;
   z-index: -1;
-  height: 422rpx;
+  height: 222rpx;
   text-align: center;
   background: linear-gradient(to bottom, #f59e0b, #fffbeb);
 }

+ 276 - 0
src/pages/index/index2.vue

@@ -0,0 +1,276 @@
+<!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page;推荐使用json5,更强大,且允许注释 -->
+<route lang="json5" type="home">
+{
+  style: {
+    navigationBarTitleText: '首页',
+  },
+}
+</route>
+<template>
+  <view class="containe px-4">
+    <!-- 渐变色 -->
+    <view class="top-content"></view>
+    <view
+      class="overflow-hidden header header-fixed header-bg"
+      :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
+    >
+      <wd-badge modelValue="12" @click="watchNotice">
+        <wd-icon name="dong" size="48rpx" />
+      </wd-badge>
+      <view class="input-box mt-2" @click="handleSerch">
+        <wd-icon name="search" />
+        请输入牛号
+      </view>
+    </view>
+    <!-- 进度 -->
+    <view class="work shadow-xl">
+      <view class="mt-4 mb-4 px-2 pb-2 title">工作进度</view>
+      <view class="work-box flex justify-around">
+        <wd-circle
+          customClass="z-index: -1; position: reletive;"
+          v-model="current"
+          color="#f59e0b"
+          :strokeWidth="15"
+          :text="`已完成${current}%`"
+        ></wd-circle>
+        <view class="do-work" @click="switchPage">
+          <text>待办事件:</text>
+          <text class="num">{{ 4 }}/</text>
+          <text class="num1">{{ 20 }}</text>
+        </view>
+      </view>
+    </view>
+    <!-- 常用工具 -->
+    <view class="work mt-4 shadow-xl work-t">
+      <view class="mt-4 mb-4 px-2 title">常用工具</view>
+      <view class="work-box-t flex justify-left flex-row flex-wrap">
+        <view class="work-item mb-4 px-2" v-for="item in workList" :key="item.id">
+          <navigator :url="item.url">
+            <image :src="item.img" mode="scaleToFill" class="image" />
+            <view class="item-title">
+              {{ item.title }}
+            </view>
+          </navigator>
+        </view>
+      </view>
+    </view>
+    <!-- 加载 -->
+    <!-- <Loading></Loading> -->
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+
+defineOptions({
+  name: 'Home',
+})
+
+// 获取屏幕边界到安全区域距离
+const { safeAreaInsets } = uni.getSystemInfoSync()
+const workList = reactive([
+  {
+    id: '1',
+    img: '../../static/images/work/jinchang.png',
+    title: '购牛',
+    url: '/pages/purchase/purchase',
+  },
+  {
+    id: '2',
+    img: '../../static/images/work/lichang.png',
+    title: '入场',
+    url: '/pages/approach/approach',
+  },
+  {
+    id: '3',
+    img: '../../static/images/work/bohuan1.png',
+    title: '脖环绑定',
+    url: '/pages/neckRing/neckRing',
+  },
+  {
+    id: '4',
+    img: '../../static/images/work/weight.png',
+    title: '称重登记',
+    url: '/pages/weight/weight',
+  },
+  {
+    id: '5',
+    img: '../../static/images/work/bohuan1.png',
+    title: '脖环解绑',
+    url: '/pages/untyNeckRing/untyNeckRing',
+  },
+  {
+    id: '6',
+    img: '../../static/images/work/fabing.png',
+    title: '诊断',
+    url: '/pages/treat/treat',
+  },
+  {
+    id: '7',
+    img: '../../static/images/work/zhiliao.png',
+    title: '登记治疗',
+    url: '',
+  },
+
+  {
+    id: 4,
+    img: '../../static/images/work/liuchan.png',
+    title: '流产登记',
+    url: '',
+  },
+
+  {
+    id: 6,
+    img: '../../static/images/work/result.png',
+    title: '治疗结果',
+    url: '',
+  },
+  {
+    id: 7,
+    img: '../../static/images/work/faqing.png',
+    title: '发情',
+    url: '',
+  },
+  {
+    id: 8,
+    img: '../../static/images/work/peizhong.png',
+    title: '配种',
+    url: '',
+  },
+  {
+    id: 9,
+    img: '../../static/images/work/yunjian.png',
+    title: '孕检登记',
+    url: '',
+  },
+  {
+    id: 10,
+    img: '../../static/images/work/jinweichan.png',
+    title: '进围产',
+    url: '',
+  },
+])
+const current = ref(20)
+let earTag = ref<string | null>(null)
+
+// 工作待办跳转
+const switchPage = () => {
+  uni.switchTab({ url: '/pages/about/about' })
+}
+// 搜索页面跳转
+const handleSerch = () => {
+  uni.navigateTo({ url: '/pages/serch/serch' })
+}
+
+// 常用工具页面跳转
+const addBattle = (val) => {
+  console.log(val, '工具类型')
+  uni.navigateTo({ url: '/pages/battleForm/battleForm?type=1' })
+}
+
+// 查看消息
+const watchNotice = () => {
+  uni.$emit('pageSwitch', true)
+  uni.navigateTo({ url: '/pages/notice/notice' })
+}
+
+onMounted(() => {})
+
+// 测试 uni API 自动引入
+onLoad(() => {
+  console.log('onload')
+})
+</script>
+
+<style lang="scss" scoped>
+.item-title {
+  font-size: 28rpx;
+}
+.work-item {
+  // border: 1px solid red;
+  width: 20%;
+  height: 200rpx;
+  font-size: 32rpx;
+  text-align: center;
+}
+.header {
+  padding: 32rpx;
+  margin-right: -32rpx;
+  margin-left: -32rpx;
+}
+.header-fixed {
+  position: sticky;
+  top: 0;
+  z-index: 10;
+}
+.header-bg {
+  background: linear-gradient(to bottom, #f59e0b, #f5d198);
+  // background-color: #fafafa;
+}
+.image {
+  width: 100rpx;
+  height: 100rpx;
+  margin-bottom: 30rpx;
+}
+.containe {
+  // background: #fafafa;
+  // position: relative;
+}
+.input-box {
+  height: 80rpx;
+  margin-top: 44rpx;
+  line-height: 80rpx;
+  color: #6b7280;
+  text-align: center;
+  background: #fff;
+  border-radius: 44rpx;
+}
+.top-content {
+  position: fixed;
+  top: 0;
+  right: 0;
+  left: 0;
+  z-index: -1;
+  height: 422rpx;
+  text-align: center;
+  background: linear-gradient(to bottom, #f59e0b, #fffbeb);
+}
+.inputs {
+  border-radius: 10%;
+}
+.cards {
+  margin: 10rpx 0;
+}
+.work {
+  padding: 10rpx;
+  font-size: 28rpx;
+  color: $uni-text-color;
+  background-color: $uni-text-color-inverse;
+  border-radius: 28rpx;
+  // box-shadow: 8rpx 16rpx 32rpx 0 $uni-bg-color-grey;
+  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
+}
+.title {
+  font-size: 36rpx;
+  font-weight: 600;
+  color: #333;
+}
+
+.work-box {
+  .do-work {
+    margin-top: 74rpx;
+    font-size: 36rpx;
+    font-weight: 600;
+    color: #ea580c;
+  }
+  .num {
+    padding-left: 14rpx;
+    font-size: 36rpx;
+    color: #ea580c;
+  }
+  .num1 {
+    font-size: 28rpx;
+    color: #f59e0b;
+  }
+}
+</style>

+ 1 - 0
src/pages/login/login.vue

@@ -2,6 +2,7 @@
 {
   style: {
     navigationBarTitleText: '登录',
+
     // navigationBarBackgroundColor: '#f6d7a7',
   },
 }

+ 4 - 4
src/pages/my/my.vue

@@ -2,15 +2,15 @@
 <route lang="json5" type="home">
 {
   style: {
-    navigationStyle: 'custom',
-    navigationBarTitleText: '首页',
+    navigationBarTitleText: '我的',
+    navigationBarBackgroundColor: '#f59e0b',
   },
 }
 </route>
 <template>
   <view class="containe">
     <!-- 渐变色 -->
-    <view class="top-content px-6 pt-18">
+    <view class="top-content px-6 pt-8">
       <view class="user-box flex">
         <!-- 左边 -->
         <view class="flex">
@@ -132,7 +132,7 @@ onLoad(() => {})
 }
 .user-box {
   justify-content: space-between;
-  height: 160rpx;
+  height: 260rpx;
   // border: 4px solid #000;
   .imgs {
     width: 140rpx;

+ 1 - 1
src/pages/notice/notice.vue

@@ -1,6 +1,6 @@
 <route lang="json5" type="page">
 {
-  style: { navigationBarTitleText: '消息' },
+  style: { navigationBarTitleText: '消息', navigationStyle: 'custom' },
 }
 </route>
 

+ 1 - 1
src/pages/phone/phone.vue

@@ -1,6 +1,6 @@
 <route lang="json5" type="page">
 {
-  style: { navigationBarTitleText: '手机登录' },
+  style: { navigationBarTitleText: '手机登录', navigationStyle: 'custom' },
 }
 </route>
 

+ 2 - 1
src/pages/serviceText/serviceText.vue

@@ -2,6 +2,7 @@
 {
   style: {
     navigationBarTitleText: '服务条款',
+
     // navigationBarBackgroundColor: '#f6d7a7',
   },
 }
@@ -57,7 +58,7 @@ defineOptions({
 }
 
 .title {
-  font-weight: 600;
   font-size: 32rpx;
+  font-weight: 600;
 }
 </style>

+ 150 - 0
src/pages/treat/treat.vue

@@ -0,0 +1,150 @@
+<route lang="json5" type="page">
+{
+  style: {
+    navigationBarTitleText: '诊断录入',
+  },
+}
+</route>
+
+<template>
+  <view class="container">
+    <wd-form ref="form" :model="model" class="px-2">
+      <wd-cell-group border custom-class="group" title="诊断信息">
+        <wd-input
+          label="牛号"
+          label-width="100px"
+          prop="value2"
+          clearable
+          v-model="model.value2"
+          placeholder="请输入牛号"
+          required
+        />
+        <wd-cell title="诊断" title-width="100px" prop="value1" right required>
+          <view>
+            <wd-radio-group v-model="model.type" shape="dot" inline @change="change">
+              <wd-radio :value="1">治疗</wd-radio>
+              <wd-radio :value="2">正常</wd-radio>
+              <wd-radio :value="3">淘汰</wd-radio>
+            </wd-radio-group>
+          </view>
+        </wd-cell>
+        <wd-cell title="疾病" title-width="100px" prop="value1" right required>
+          <text></text>
+          <wd-icon name="arrow-right" size="18px" color="#BFBFBF" @click="handleRoute"></wd-icon>
+        </wd-cell>
+
+        <wd-cell title="是否治疗" title-width="100px" prop="value1" right required>
+          <view>
+            <wd-radio-group v-model="model.type" shape="button" inline @change="change">
+              <wd-radio :value="1">是</wd-radio>
+              <wd-radio :value="0">否</wd-radio>
+            </wd-radio-group>
+          </view>
+        </wd-cell>
+        <wd-cell title="治疗方案" title-width="100px" prop="value1" right required>
+          <text></text>
+          <wd-icon
+            name="arrow-right"
+            size="18px"
+            color="#BFBFBF"
+            @click="handleCaseRoute"
+          ></wd-icon>
+        </wd-cell>
+
+        <wd-calendar
+          label="日期"
+          prop="date"
+          label-width="100px"
+          type="datetime"
+          hide-second
+          v-model="model.date"
+          :min-date="minDate"
+          :max-date="maxDate"
+          :disabled-date="disableFutureDates"
+        />
+
+        <wd-textarea
+          label="备注信息"
+          label-width="100px"
+          v-model="model.remark"
+          :maxlength="200"
+          clearable
+          show-word-limit
+          placeholder="请输入备注"
+          auto-height
+        />
+      </wd-cell-group>
+      <view class="footer mt-5 pb-20 center">
+        <wd-button type="info" size="medium" class="mr-4" @click="goBack">取消</wd-button>
+        <wd-button type="primary" size="medium" @click="handleSubmit">提交</wd-button>
+      </view>
+    </wd-form>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { reactive, ref } from 'vue'
+
+defineOptions({
+  name: 'neckRing',
+})
+// 品种选择
+const columns = ref(['选项1', '选项2', '选项3', '选项4', '选项5', '选项6', '选项7'])
+
+function handleConfirm({ value }) {
+  value.value = value
+}
+
+// 日期选择器
+const today = new Date()
+const minDate = ref(new Date(2000, 0, 1)) // 可选择的最早日期
+const maxDate = ref(today)
+
+const disableFutureDates = (date: Date) => {
+  return date > today
+}
+
+const model = reactive<{
+  value1: string
+  value2: string
+  date: number
+  type: number
+}>({
+  value1: '',
+  value2: '',
+  date: Date.now(),
+  type: 1,
+})
+
+// 疾病页面
+function handleRoute() {
+  uni.navigateTo({ url: '/pages/disease/disease' })
+}
+
+// 方案页面
+function handleCaseRoute() {
+  uni.navigateTo({ url: '/pages/treatMent/treatMent' })
+}
+const form = ref()
+
+function handleSubmit() {
+  form.value
+    .validate()
+    .then(({ valid, errors }) => {
+      if (valid) {
+        // showSuccess({
+        //   msg: '校验通过',
+        // })
+      }
+    })
+    .catch((error) => {
+      console.log(error, 'error')
+    })
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+  background: #fff;
+}
+</style>

+ 97 - 0
src/pages/treatMent/treatMent.vue

@@ -0,0 +1,97 @@
+<route lang="json5" type="page">
+{
+  style: { navigationBarTitleText: '治疗方案' },
+}
+</route>
+
+<template>
+  <view class="text-center">
+    <view>
+      <!-- 卡片 -->
+      <view class="mx-2 rpx-2 left card">
+        <view>
+          方案名称:
+          <text class="not">治疗感冒</text>
+        </view>
+        <view>
+          方案类型:
+          <text class="not">治疗感冒</text>
+        </view>
+        <view>处方详情</view>
+        <view>
+          <view>
+            药品种类:
+            <text class="not">治疗感冒</text>
+          </view>
+          <view>
+            药品名称:
+            <text class="not">治疗感冒</text>
+          </view>
+          <view>
+            单次用量:
+            <text class="not">1袋/1次</text>
+          </view>
+          <view>
+            用药方法:
+            <text class="not">口服</text>
+          </view>
+          <view>
+            用药天数:
+            <text class="not">3天</text>
+          </view>
+          <view>
+            用药频率:
+            <text class="not">1天2次</text>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+defineOptions({
+  name: 'Notice',
+})
+</script>
+
+<style lang="scss" scoped>
+//
+.card {
+  display: flex;
+  flex-direction: column;
+  padding: 20rpx;
+  margin: 20rpx;
+  text-align: left;
+  background-color: #fff;
+  border-radius: 10rpx;
+  box-shadow: 0 8rpx 12rpx rgba(0, 0, 0, 0.1);
+  transition: transform 0.2s ease, box-shadow 0.2s ease;
+}
+
+.card:hover {
+  box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.2);
+  transform: translateY(-5rpx);
+}
+
+.not {
+  padding-left: 6rpx;
+  font-size: 26rpx;
+  color: #333;
+}
+.card-title {
+  margin-bottom: 10rpx;
+  font-size: 18rpx;
+  font-weight: bold;
+  color: #333;
+}
+.card-selected {
+  background-color: #e8f5e9;
+  border: 2rpx solid #4caf50;
+}
+
+.card-unselected {
+  background-color: #f9f9f9;
+  border: 2rpx solid #ddd;
+}
+</style>

+ 34 - 0
src/store/disease.ts

@@ -0,0 +1,34 @@
+import { defineStore } from 'pinia'
+import { reactive, ref } from 'vue'
+
+export const useDiseaseStore = defineStore(
+  'disease',
+  () => {
+    // state
+    const selectedSubCategoryIds = ref<number[]>([])
+
+    // actions
+    const setSelectedSubCategoryIds = (ids: number[]) => {
+      selectedSubCategoryIds.value = ids
+    }
+
+    const clearSelectedSubCategoryIds = () => {
+      selectedSubCategoryIds.value = []
+    }
+
+    // getters
+    const getSelectedSubCategoryIds = () => {
+      return selectedSubCategoryIds.value
+    }
+
+    return {
+      selectedSubCategoryIds,
+      setSelectedSubCategoryIds,
+      clearSelectedSubCategoryIds,
+      getSelectedSubCategoryIds,
+    }
+  },
+  {
+    persist: true, // 持久化选项
+  },
+)

+ 1 - 0
src/store/index.ts

@@ -15,3 +15,4 @@ export default store
 
 // 模块统一导出
 export * from './user'
+export * from './disease'

+ 1 - 1
src/style/index.scss

@@ -1,4 +1,4 @@
-// @import './iconfont.css';
+@import './iconfont.css';
 
 .test {
   // 可以通过 @apply 多个样式封装整体样式

+ 7 - 3
src/types/uni-pages.d.ts

@@ -4,11 +4,13 @@
 // Generated by vite-plugin-uni-pages
 
 interface NavigateToOptions {
-  url:  "/pages/index/index" |
-       "/pages/my/my" |
+  url: "/pages/my/my" |
+       "/pages/index/index2" |
+       "/pages/index/index" |
        "/pages/about/about" |
        "/pages/approach/approach" |
        "/pages/battleForm/battleForm" |
+       "/pages/disease/disease" |
        "/pages/editPassword/editPassword" |
        "/pages/feedBack/feedBack" |
        "/pages/login/login" |
@@ -20,6 +22,8 @@ interface NavigateToOptions {
        "/pages/searchDetail/searchDetail" |
        "/pages/serch/serch" |
        "/pages/serviceText/serviceText" |
+       "/pages/treat/treat" |
+       "/pages/treatMent/treatMent" |
        "/pages/untyNeckRing/untyNeckRing" |
        "/pages/weight/weight" |
        "/pages/workAll/workAll" |
@@ -28,7 +32,7 @@ interface NavigateToOptions {
 interface RedirectToOptions extends NavigateToOptions {}
 
 interface SwitchTabOptions {
-  url: "/pages/index/index" | "/pages/workAll/workAll" | "/pages/about/about" | "/pages/my/my"
+  url: "/pages/index/index" | "/pages/my/my"
 }
 
 type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;