Browse Source

首页&登陆页

Shan9312 8 months ago
parent
commit
b402984d50
64 changed files with 301 additions and 63 deletions
  1. 3 2
      env/.env
  2. 2 2
      src/pages-sub/demo/index.vue
  3. 22 1
      src/pages.json
  4. 19 0
      src/pages/battleForm/battleForm.vue
  5. 153 45
      src/pages/index/index.vue
  6. 24 0
      src/pages/login/login.vue
  7. 34 12
      src/pages/my/my.vue
  8. 19 0
      src/pages/serch/serch.vue
  9. 11 0
      src/service/index/auth.ts
  10. 10 0
      src/service/index/foo.ts
  11. BIN
      src/static/images/other/logo.png
  12. BIN
      src/static/images/other/logo2.png
  13. BIN
      src/static/images/other/logo3.png
  14. BIN
      src/static/images/other/主页返回.png
  15. BIN
      src/static/images/other/器具.png
  16. BIN
      src/static/images/other/处方药.png
  17. BIN
      src/static/images/other/库存.png
  18. BIN
      src/static/images/other/抗生素.png
  19. BIN
      src/static/images/other/检疫.png
  20. BIN
      src/static/images/other/消息 (1).png
  21. BIN
      src/static/images/other/消息.png
  22. BIN
      src/static/images/other/硬件.png
  23. BIN
      src/static/images/other/药品分类.png
  24. BIN
      src/static/images/other/菌抗生素.png
  25. BIN
      src/static/images/other/防疫管理.png
  26. BIN
      src/static/images/tool/修改密码.png
  27. BIN
      src/static/images/tool/意见反馈.png
  28. BIN
      src/static/images/tool/服务条款.png
  29. BIN
      src/static/images/tool/联系客服.png
  30. BIN
      src/static/images/tool/蓝牙-F.png
  31. BIN
      src/static/images/work/result.png
  32. BIN
      src/static/images/work/产犊.png
  33. BIN
      src/static/images/work/修蹄.png
  34. BIN
      src/static/images/work/免疫.png
  35. BIN
      src/static/images/work/去牛角.png
  36. BIN
      src/static/images/work/发情.png
  37. BIN
      src/static/images/work/发病.png
  38. BIN
      src/static/images/work/同期.png
  39. BIN
      src/static/images/work/孕检.png
  40. BIN
      src/static/images/work/断奶.png
  41. BIN
      src/static/images/work/治疗.png
  42. BIN
      src/static/images/work/治疗结果上报.png
  43. BIN
      src/static/images/work/流产.png
  44. BIN
      src/static/images/work/禁配.png
  45. BIN
      src/static/images/work/离场.png
  46. BIN
      src/static/images/work/称重.png
  47. BIN
      src/static/images/work/耳标管理.png
  48. BIN
      src/static/images/work/脖环绑定.png
  49. BIN
      src/static/images/work/脖环解除.png
  50. BIN
      src/static/images/work/转群.png
  51. BIN
      src/static/images/work/进围产.png
  52. BIN
      src/static/images/work/进场.png
  53. BIN
      src/static/images/work/配种.png
  54. BIN
      src/static/images/work/销售合同.png
  55. BIN
      src/static/images/work/阉割.png
  56. BIN
      src/static/tabbar/home.png
  57. BIN
      src/static/tabbar/homeHL.png
  58. BIN
      src/static/tabbar/personal.png
  59. BIN
      src/static/tabbar/personalHL.png
  60. BIN
      src/static/tabbar/tong.png
  61. BIN
      src/static/tabbar/tongHL.png
  62. BIN
      src/static/tabbar/work.png
  63. BIN
      src/static/tabbar/workHL.png
  64. 4 1
      src/types/uni-pages.d.ts

+ 3 - 2
env/.env

@@ -7,8 +7,9 @@ VITE_WX_APPID = 'wx79ae77033cd2c4a2'
 # h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
 VITE_APP_PUBLIC_BASE=/unibest/
 
-VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run'
-VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload'
+VITE_SERVER_BASEURL ='http://kpttest.kptyun.com'
+# VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run' 
+# VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload'
 
 # h5是否需要配置代理
 VITE_APP_PROXY=false

+ 2 - 2
src/pages-sub/demo/index.vue

@@ -1,13 +1,13 @@
 <route lang="json5" type="page">
 {
-  style: { navigationBarTitleText: '分包页面 标题' },
+  style: { navigationBarTitleText: '' },
 }
 </route>
 
 <template>
   <view class="text-center">
     <view class="m-8">http://localhost:9000/#/pages-sub/demo/index</view>
-    <view class="text-green-500">分包页面demo</view>
+    <view class="text-green-500">demo</view>
   </view>
 </template>
 

+ 22 - 1
src/pages.json

@@ -72,11 +72,32 @@
         "navigationBarTitleText": "统计"
       }
     },
+    {
+      "path": "pages/battleForm/battleForm",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "新增信息"
+      }
+    },
+    {
+      "path": "pages/login/login",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "欢迎登录"
+      }
+    },
     {
       "path": "pages/my/my",
       "type": "page",
       "style": {
-        "navigationBarTitleText": "我的"
+        "navigationBarTitleText": "欢迎登录"
+      }
+    },
+    {
+      "path": "pages/serch/serch",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "搜索"
       }
     }
   ],

+ 19 - 0
src/pages/battleForm/battleForm.vue

@@ -0,0 +1,19 @@
+<route lang="json5" type="page">
+{
+  style: { navigationBarTitleText: '新增信息' },
+}
+</route>
+
+<template>
+  <view class="text-center">
+    <view class="text-green-500">小牛表单</view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+// code here
+</script>
+
+<style lang="scss" scoped>
+//
+</style>

+ 153 - 45
src/pages/index/index.vue

@@ -8,22 +8,27 @@
 }
 </route>
 <template>
-  <view class="containe px-4 overflow-hidden">
+  <view class="containe px-4">
     <!-- 渐变色 -->
     <view class="top-content"></view>
-    <view class="overflow-hidden pt-2 px-4" :style="{ marginTop: safeAreaInsets?.top + 'px' }">
+    <view
+      class="overflow-hidden header header-fixed header-bg"
+      :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
+    >
       <wd-badge modelValue="12">
-        <wd-icon name="dong" size="26px" />
+        <wd-icon name="dong" size="52rpx" />
       </wd-badge>
+      <view class="input-box mt-2" @click="handleSerch">
+        <wd-icon name="search" />
+        请输入牛号
+      </view>
     </view>
-    <view class="input-box mt-2">
-      <wd-icon name="search" v-model="serchVal" @focus="focus" />
-      请输入牛号
-    </view>
-    <view class="work mt-4 shadow-xl">
-      <view class="mt-4 mb-4 px-2 title">工作进度</view>
-      <view class="work-box">
+    <!-- 进度 -->
+    <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"
@@ -37,28 +42,112 @@
       </view>
     </view>
     <!-- 常用工具 -->
-    <view class="work mt-4 shadow-xl">
+    <view class="work mt-4 shadow-xl work-t">
       <view class="mt-4 mb-4 px-2 title">常用工具</view>
-      <view></view>
+      <view class="work-box-t flex justify-between flex-row flex-wrap">
+        <view
+          class="work-item mb-4 px-4"
+          v-for="item in workList"
+          :key="item.id"
+          @click="addBattle(item)"
+        >
+          <image :src="item.img" mode="scaleToFill" class="image" />
+          <view>
+            {{ item.title }}
+          </view>
+        </view>
+      </view>
     </view>
   </view>
 </template>
 
 <script lang="ts" setup>
-// import PLATFORM from '@/utils/platform'
+import { getAuth } from '@/service/index/auth'
 
 defineOptions({
   name: 'Home',
 })
 
 // 获取屏幕边界到安全区域距离
-const current = ref(20)
 const { safeAreaInsets } = uni.getSystemInfoSync()
-const serchVal = ref('')
-const focus = (val) => {
-  console.log(val, 'focus')
+const workList = reactive([
+  {
+    id: 1,
+    img: '../../static/images/work/称重.png',
+    title: '称重登记',
+  },
+  {
+    id: 2,
+    img: '../../static/images/work/治疗.png',
+    title: '登记治疗',
+  },
+  {
+    id: 3,
+    img: '../../static/images/work/发病.png',
+    title: '诊断',
+  },
+  {
+    id: 4,
+    img: '../../static/images/work/流产.png',
+    title: '流产登记',
+  },
+  {
+    id: 5,
+    img: '../../static/images/work/脖环绑定.png',
+    title: '脖环制定',
+  },
+  {
+    id: 6,
+    img: '../../static/images/work/result.png',
+    title: '治疗结果',
+  },
+  {
+    id: 7,
+    img: '../../static/images/work/发情.png',
+    title: '发情',
+  },
+  {
+    id: 8,
+    img: '../../static/images/work/配种.png',
+    title: '配种',
+  },
+  {
+    id: 9,
+    img: '../../static/images/work/孕检.png',
+    title: '孕检登记',
+  },
+  {
+    id: 10,
+    img: '../../static/images/work/进围产.png',
+    title: '进围产',
+  },
+])
+const current = ref(20)
+
+// 接口请求参数
+const logins = async () => {
+  const { data } = await getAuth({
+    username: 'shanshan',
+    password: '123456',
+  })
+  console.log(data, 'hss')
+}
+
+// 搜索页面跳转
+const handleSerch = () => {
+  uni.navigateTo({ url: '/pages/serch/serch?title=navigate' })
+}
+
+// 常用工具页面跳转
+const addBattle = (val) => {
+  console.log(val, '工具类型')
+  uni.navigateTo({ url: '/pages/battleForm/battleForm?title=1' })
 }
 
+onMounted(() => {
+  logins()
+})
+
 // 测试 uni API 自动引入
 onLoad(() => {
   console.log('onload')
@@ -66,19 +155,42 @@ onLoad(() => {
 </script>
 
 <style lang="scss" scoped>
+.work-item {
+  // border: 1px solid red;
+  width: 22%;
+  font-size: 32rpx;
+  text-align: center;
+  height: 200rpx;
+}
+.header {
+  margin-left: -32rpx;
+  margin-right: -32rpx;
+  padding: 32rpx;
+}
+.header-fixed {
+  position: sticky;
+  z-index: 10;
+  top: 0;
+}
+.header-bg {
+  background: linear-gradient(to bottom, #f59e0b, #f6d7a7);
+  // background-color: #fafafa;
+}
+.image {
+  width: 100rpx;
+  height: 100rpx;
+  margin-bottom: 30rpx;
+}
 .containe {
-  background: #fafafa;
-  overflow: hidden;
-  height: 100vh;
-  position: relative;
-  z-index: -99;
+  // background: #fafafa;
+  // position: relative;
 }
 .input-box {
-  border-radius: 24rpx;
+  border-radius: 44rpx;
   background: #fff;
-  height: 60rpx;
-  margin-top: 10rpx;
-  line-height: 60rpx;
+  height: 80rpx;
+  margin-top: 44rpx;
+  line-height: 74rpx;
   text-align: center;
   color: #6b7280;
 }
@@ -86,51 +198,47 @@ onLoad(() => {
   position: fixed;
   top: 0;
   left: 0;
-  right: 0%;
-  bottom: 0;
+  right: 0;
   background: linear-gradient(to bottom, #f59e0b, #fffbeb);
   z-index: -1;
-  height: 260px;
+  height: 422rpx;
   text-align: center;
 }
 .inputs {
   border-radius: 10%;
 }
 .cards {
-  margin: 10px 0;
+  margin: 10rpx 0;
 }
 .work {
-  border-radius: 10px;
-  overflow-y: scroll;
+  border-radius: 28rpx;
   background-color: $uni-text-color-inverse;
-  font-size: 14px;
+  font-size: 32rpx;
   color: $uni-text-color;
-  padding: 0px 5px 5px 5px;
-  box-shadow: 0 4px 8px 0 $uni-bg-color-grey;
+  padding: 10rpx;
+  box-shadow: 8rpx 16rpx 32rpx 0 $uni-bg-color-grey;
 }
 .title {
-  color: #262626;
-  font-size: 20px;
+  color: #333;
+  font-size: 40rpx;
   font-weight: 600;
 }
-.work-box {
-  display: flex;
-  justify-content: space-around;
 
+.work-box {
   .do-work {
-    font-size: 20px;
+    font-size: 40rpx;
     color: #ea580c;
     font-weight: 600;
-    margin-top: 30px;
+    margin-top: 74rpx;
   }
   .num {
     color: #ea580c;
-    font-size: 20px;
-    padding-left: 15px;
+    font-size: 40rpx;
+    padding-left: 14rpx;
   }
   .num1 {
     color: #f59e0b;
-    font-size: 14px;
+    font-size: 28rpx;
   }
 }
 </style>

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

@@ -0,0 +1,24 @@
+<route lang="json5" type="page">
+{
+  style: { navigationBarTitleText: '欢迎登录' },
+}
+</route>
+
+<template>
+  <view class="text-center">
+    <view class="text-green-500">
+      <view>科湃腾肉牛系统</view>
+      <view></view>
+      <view>用户一键登录</view>
+      <text>我已认真阅读并同意《服务协议》、《隐私政策》</text>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+// code here
+</script>
+
+<style lang="scss" scoped>
+//
+</style>

+ 34 - 12
src/pages/my/my.vue

@@ -1,22 +1,44 @@
-<route lang="json5">
+<route lang="json5" type="page">
 {
-  style: {
-    navigationBarTitleText: '我的',
-  },
+  style: { navigationBarTitleText: '欢迎登录' },
 }
 </route>
 
 <template>
-  <view
-    class="bg-white overflow-hidden pt-2 px-4"
-    :style="{ marginTop: safeAreaInsets?.top + 'px' }"
-  >
-    我的
+  <view class="text-center px-4 pt-20">
+    <view class="con-top">
+      <view class="h1 mb-8 mt-10">科湃腾肉牛系统</view>
+      <view class="h3 mb-10 pt-4">让牧场管理更专业、更简单、更高效</view>
+    </view>
+    <view class="btn mt-10">用户一键登录</view>
+    <text class="mt-10 title">
+      <wd-radio :value="1">我已认真阅读并同意《服务协议》、《隐私政策》</wd-radio>
+    </text>
   </view>
 </template>
 
-<script>
-export default {}
+<script lang="ts" setup>
+// code here
 </script>
 
-<style></style>
+<style lang="scss" scoped>
+//
+.con-top {
+  color: #f59e0b;
+  font-size: 56rpx;
+}
+.h3 {
+  font-size: 36rpx;
+}
+
+.btn {
+  color: #fff;
+  background-color: #f59e0b;
+  border-radius: 70rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 38rpx;
+  width: 90%;
+  margin: 0 auto;
+}
+</style>

+ 19 - 0
src/pages/serch/serch.vue

@@ -0,0 +1,19 @@
+<route lang="json5" type="page">
+{
+  style: { navigationBarTitleText: '搜索' },
+}
+</route>
+
+<template>
+  <view class="text-center">
+    <view class="text-green-500">搜索</view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+// code here
+</script>
+
+<style lang="scss" scoped>
+//
+</style>

+ 11 - 0
src/service/index/auth.ts

@@ -0,0 +1,11 @@
+import { http } from '@/utils/http'
+
+export interface IFooItem {
+  username: string
+  password: string
+}
+
+/** POST 请求 */
+export const getAuth = (data) => {
+  return http.post<IFooItem>('/auth', data)
+}

+ 10 - 0
src/service/index/foo.ts

@@ -13,3 +13,13 @@ export const getFooAPI = (name: string) => {
 export const postFooAPI = (name: string) => {
   return http.post<IFooItem>('/foo', { name }, { name })
 }
+
+export interface IFooItem {
+  id: string
+  name: string
+}
+
+/** POST 请求 */
+export const getAuth = (data) => {
+  return http.post<IFooItem>('/auth', data)
+}

BIN
src/static/images/other/logo.png


BIN
src/static/images/other/logo2.png


BIN
src/static/images/other/logo3.png


BIN
src/static/images/other/主页返回.png


BIN
src/static/images/other/器具.png


BIN
src/static/images/other/处方药.png


BIN
src/static/images/other/库存.png


BIN
src/static/images/other/抗生素.png


BIN
src/static/images/other/检疫.png


BIN
src/static/images/other/消息 (1).png


BIN
src/static/images/other/消息.png


BIN
src/static/images/other/硬件.png


BIN
src/static/images/other/药品分类.png


BIN
src/static/images/other/菌抗生素.png


BIN
src/static/images/other/防疫管理.png


BIN
src/static/images/tool/修改密码.png


BIN
src/static/images/tool/意见反馈.png


BIN
src/static/images/tool/服务条款.png


BIN
src/static/images/tool/联系客服.png


BIN
src/static/images/tool/蓝牙-F.png


BIN
src/static/images/work/result.png


BIN
src/static/images/work/产犊.png


BIN
src/static/images/work/修蹄.png


BIN
src/static/images/work/免疫.png


BIN
src/static/images/work/去牛角.png


BIN
src/static/images/work/发情.png


BIN
src/static/images/work/发病.png


BIN
src/static/images/work/同期.png


BIN
src/static/images/work/孕检.png


BIN
src/static/images/work/断奶.png


BIN
src/static/images/work/治疗.png


BIN
src/static/images/work/治疗结果上报.png


BIN
src/static/images/work/流产.png


BIN
src/static/images/work/禁配.png


BIN
src/static/images/work/离场.png


BIN
src/static/images/work/称重.png


BIN
src/static/images/work/耳标管理.png


BIN
src/static/images/work/脖环绑定.png


BIN
src/static/images/work/脖环解除.png


BIN
src/static/images/work/转群.png


BIN
src/static/images/work/进围产.png


BIN
src/static/images/work/进场.png


BIN
src/static/images/work/配种.png


BIN
src/static/images/work/销售合同.png


BIN
src/static/images/work/阉割.png


BIN
src/static/tabbar/home.png


BIN
src/static/tabbar/homeHL.png


BIN
src/static/tabbar/personal.png


BIN
src/static/tabbar/personalHL.png


BIN
src/static/tabbar/tong.png


BIN
src/static/tabbar/tongHL.png


BIN
src/static/tabbar/work.png


BIN
src/static/tabbar/workHL.png


+ 4 - 1
src/types/uni-pages.d.ts

@@ -7,7 +7,10 @@ interface NavigateToOptions {
   url: "/pages/index/index" |
        "/pages/about/about" |
        "/pages/analyze/analyze" |
-       "/pages/my/my";
+       "/pages/battleForm/battleForm" |
+       "/pages/login/login" |
+       "/pages/my/my" |
+       "/pages/serch/serch";
 }
 interface RedirectToOptions extends NavigateToOptions {}