Browse Source

发病接口

Shan9312 6 months ago
parent
commit
5a1bb2919a

+ 4 - 1
env/.env

@@ -7,10 +7,13 @@ VITE_WX_APPID = 'wx79ae77033cd2c4a2'
 # h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
 VITE_APP_PUBLIC_BASE= /unibest/
 # VITE_SERVER_BASEURL = 'http://tmrwatch.cn:8082'
-VITE_SERVER_BASEURL = 'http://kpttest.kptyun.com'
+# VITE_SERVER_BASEURL = 'http://kpttest.kptyun.com'
+VITE_SERVER_BASEURL = 'http://192.168.1.244:8091'
 # VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run' 
 VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload'
 
 # h5是否需要配置代理
 VITE_APP_PROXY='true'
 VITE_APP_PROXY_PREFIX = '/api'
+
+

+ 1 - 13
pages.config.ts

@@ -18,7 +18,7 @@ export default defineUniPages({
   },
   tabBar: {
     color: '#999999',
-    selectedColor: '#f59e0b',
+    selectedColor: '#D4A017',
     backgroundColor: '#F8F8F8',
     borderStyle: 'black',
     height: '50px',
@@ -32,18 +32,6 @@ 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/personal.png',
         selectedIconPath: 'static/tabbar/personalHL.png',

+ 1 - 1
src/interceptors/request.ts

@@ -54,7 +54,7 @@ const httpInterceptor = {
       // })
     }
     // 1. 请求超时
-    options.timeout = 10000 // 10s
+    options.timeout = options.timeout || 20000 // 10s
     // 2. (可选)添加小程序端请求头标识
     options.header = {
       platform, // 可选,与 uniapp 定义的平台一致,告诉后台来源

+ 20 - 13
src/pages.json

@@ -15,7 +15,7 @@
   },
   "tabBar": {
     "color": "#999999",
-    "selectedColor": "#f59e0b",
+    "selectedColor": "#D4A017",
     "backgroundColor": "#F8F8F8",
     "borderStyle": "black",
     "height": "50px",
@@ -38,29 +38,29 @@
     ]
   },
   "pages": [
+    {
+      "path": "pages/my/my",
+      "type": "home",
+      "style": {
+        "navigationBarTitleText": "我的",
+        "navigationBarBackgroundColor": "#c08e10"
+      }
+    },
     {
       "path": "pages/index/index",
       "type": "home",
       "style": {
-        "navigationBarBackgroundColor": "#f59e0b",
+        "navigationBarBackgroundColor": "#c08e10",
         "navigationBarTitleText": "首页"
       }
     },
     {
-      "path": "pages/my/my",
-      "type": "home",
+      "path": "pages/about/about",
+      "type": "page",
       "style": {
-        "navigationBarTitleText": "我的",
-        "navigationBarBackgroundColor": "#f59e0b"
+        "navigationBarTitleText": "工作台"
       }
     },
-    // {
-    //   "path": "pages/about/about",
-    //   "type": "page",
-    //   "style": {
-    //     "navigationBarTitleText": "工作台"
-    //   }
-    // },
     {
       "path": "pages/approach/approach",
       "type": "page",
@@ -96,6 +96,13 @@
         "navigationBarTitleText": "意见反馈"
       }
     },
+    {
+      "path": "pages/illness/illness",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "发病录入"
+      }
+    },
     {
       "path": "pages/login/login",
       "type": "page",

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

@@ -81,6 +81,8 @@ const diseaseCategories = ref([
   },
 ])
 
+
+
 const handleSelect = (ids) => {
   selectSubIds.value = ids.value
   diseaseStore.setSelectedSubCategoryIds(selectSubIds.value)
@@ -90,8 +92,12 @@ const handleSelect = (ids) => {
 const submitSelection = () => {
   // 在这里处理选中的子类IDs,例如提交到服务器或存储到本地
   console.log('Selected SubCategory IDs:', selectSubIds.value)
+  uni.navigateTo({ url: '/pages/illness/illness' })
 }
 
+// 二位数组拍平转一数组
+function handleChoose{}
+
 let serchObj = reactive({
   searchNum: '',
   historyList: [],

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

@@ -141,7 +141,7 @@ function handleLogin() {
   font-family: 'Times New Roman', Times, serif;
   font-size: 56rpx;
   font-weight: 600;
-  color: #f99304;
+  color: #d4a017;
 }
 .h3 {
   padding-left: 10rpx;
@@ -190,18 +190,18 @@ function handleLogin() {
 .wd-icon-user[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 ::v-deep .wd-icon-lock-on:before,
 .wd-icon-lock-on[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 ::v-deep .wd-icon-lock-off:before,
 .wd-icon-lock-on[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 </style>

+ 3 - 3
src/pages/feedBack/feedBack.vue

@@ -104,18 +104,18 @@ function handleSubmit() {
 .wd-icon-user[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 ::v-deep .wd-icon-lock-on:before,
 .wd-icon-lock-on[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 ::v-deep .wd-icon-lock-off:before,
 .wd-icon-lock-on[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 </style>

+ 199 - 0
src/pages/illness/illness.vue

@@ -0,0 +1,199 @@
+<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="cowId"
+          clearable
+          v-model="model.cowId"
+          placeholder="请输入牛号"
+          :rules="[{ required: true, message: '请填写牛号' }]"
+        />
+        <wd-cell title="是否诊断" title-width="100px" prop="isDiagnosed" right required>
+          <wd-switch v-model="model.isDiagnosed" />
+        </wd-cell>
+        <view v-if="model.isDiagnosed == 1">
+          <wd-cell title="诊断" title-width="100px" prop="diagnosticState" right required>
+            <view>
+              <wd-radio-group v-model="model.diagnosticState" shape="dot" inline @change="change">
+                <wd-radio :value="item.value" v-for="item in baseList" :key="item.value">
+                  {{ item.label }}
+                </wd-radio>
+              </wd-radio-group>
+            </view>
+          </wd-cell>
+          <wd-cell title="疾病" title-width="100px" prop="value1" right required>
+            <text v-for="child in diseaseChoseList">{{ child.name }}</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.isTreatment" shape="button" inline @change="change">
+                <wd-radio :value="1">是</wd-radio>
+                <wd-radio :value="2">否</wd-radio>
+              </wd-radio-group>
+            </view>
+          </wd-cell>
+          <wd-cell
+            title="治疗方案"
+            title-width="100px"
+            prop="value1"
+            right
+            required
+            v-if="model.isTreatment == 1"
+          >
+            <text></text>
+            <wd-icon
+              name="arrow-right"
+              size="18px"
+              color="#BFBFBF"
+              @click="handleCaseRoute"
+            ></wd-icon>
+          </wd-cell>
+        </view>
+        <wd-calendar
+          label="日期"
+          prop="date"
+          label-width="100px"
+          type="datetime"
+          :hide-second="true"
+          v-model="model.date"
+          :min-date="minDate"
+          :max-date="maxDate"
+          :disabled-date="disableFutureDates"
+          @confirm="handleConfirm"
+        />
+
+        <wd-textarea
+          label="备注信息"
+          label-width="100px"
+          v-model="model.remarks"
+          :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'
+import { getConfigSys, postModel } from '@/service/index/common'
+
+defineOptions({
+  name: 'neckRing',
+})
+
+// 请求诊断类型
+let baseList = reactive<[]>
+async function getConfigBase() {
+  const { data } = await getConfigSys({
+    option_name: 'diagnosticState',
+  })
+  baseList = data
+  console.log(data, '事件列表')
+}
+function handleConfirm({ value }) {
+  console.log(new Date(value).toString(), '8888')
+}
+
+// 日期选择器
+const today = new Date()
+const minDate = ref(new Date(2010, 1, 1)) // 可选择的最早日期
+const maxDate = ref(today)
+
+const disableFutureDates = (date: Date) => {
+  return date > today
+}
+
+const model = reactive<{
+  isDiagnosed: number // 是否诊断
+  cowId: number // 牛号
+  date: number
+  operatorAt: string | number // 日期
+  remarks: string // 备注
+  operatorId: number // 备用字段
+  operatorName: string
+  diagnosticState: number // 诊断状态
+  isTreatment: number // 1是 治疗 2 否
+}>({
+  date: Date.now(),
+  isDiagnosed: 0,
+  cowId: 4,
+  operatorAt: '',
+  remarks: 'test',
+  operatorId: 1,
+  operatorName: '郝闪闪',
+  diagnosticState: 1,
+  isTreatment: 2,
+})
+
+// 疾病页面
+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) {
+        console.log(model, '表单数据')
+        model.operatorAt = parseInt(model.date / 1000)
+        model.isDiagnosed = model.isDiagnosed ? 1 : 0
+        const formObj = {
+          eventSource: 1,
+          eventType: 9,
+          cowId: model.cowId,
+          timestamp: parseInt(new Date().getTime() / 1000),
+          meta: JSON.stringify(model),
+        }
+        postModel(formObj).then((res) => {
+          console.log(res, '122')
+        })
+      }
+    })
+    .catch((error) => {
+      console.log(error, 'error')
+    })
+}
+// 取消
+function goBack() {
+  uni.navigateBack({
+    delta: 1,
+  })
+}
+
+onMounted(() => {
+  getConfigBase()
+})
+</script>
+
+<style lang="scss" scoped>
+.container {
+  background: #fff;
+}
+</style>

+ 2 - 12
src/pages/index/components/works.vue

@@ -344,7 +344,7 @@ function handleChange({ value, label }) {
 .cattle-num {
   font-size: 28rpx;
   font-weight: 500;
-  color: #f4940d;
+  color: #d4a017;
 }
 .card {
   position: relative;
@@ -374,17 +374,7 @@ function handleChange({ value, label }) {
   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;
 }

+ 25 - 48
src/pages/index/index.vue

@@ -3,7 +3,7 @@
 {
   style: {
     //navigationStyle: 'custom',  // 用来隐藏顶部 首页 的导航
-    navigationBarBackgroundColor: '#f59e0b',
+    navigationBarBackgroundColor: '#c08e10',
     navigationBarTitleText: '首页',
   },
 }
@@ -51,12 +51,20 @@
 
 <script lang="ts" setup>
 import { ref } from 'vue'
+import { getConfigSys } from '@/service/index/common'
 import Works from './components/works.vue'
 
 defineOptions({
   name: 'Home',
 })
 
+// 请求事件列表接口
+async function getConfigSysList() {
+  const { data } = await getConfigSys({
+    option_name: 'eventType',
+  })
+  console.log(data, '事件列表')
+}
 const tab = ref<number>(0)
 const active = ref<boolean>(false)
 
@@ -80,6 +88,8 @@ const navList = ref([
         title: '肉牛进场',
         url: '/pages/approach/approach',
         icon: 'icon-jinchang1',
+        value: 1,
+        label: '入场',
       },
 
       {
@@ -120,8 +130,10 @@ const navList = ref([
         id: '2-1',
         img: '../../static/images/work/fabing.png',
         title: '发病',
-        url: '/pages/treat/treat',
+        url: '/pages/illness/illness',
         icon: 'icon-fabingjizhi',
+        value: 9,
+        label: '发病',
       },
       {
         id: '2-2',
@@ -153,47 +165,8 @@ const navList = ref([
       },
     ],
   },
-  // {
-  //   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)
-
 // 工作待办跳转
 const switchPage = () => {
   uni.switchTab({ url: '/pages/about/about' })
@@ -215,7 +188,9 @@ const watchNotice = () => {
   uni.navigateTo({ url: '/pages/notice/notice' })
 }
 
-onMounted(() => {})
+onMounted(() => {
+  getConfigSysList()
+})
 
 // 测试 uni API 自动引入
 onLoad(() => {
@@ -229,7 +204,7 @@ onLoad(() => {
   // overflow: hidden;
 }
 .item-title {
-  font-size: 28rpx;
+  font-size: 30rpx;
 }
 .work-item {
   // border: 1px solid red;
@@ -249,11 +224,12 @@ onLoad(() => {
   z-index: 10;
 }
 .header-bg {
-  background: linear-gradient(to bottom, #f59e0b, #f5d198);
+  // background: linear-gradient(180deg, #e3b655 0%, #d4a017 50%, #c08e10 100%);
+  background: linear-gradient(180deg, #c08e10 0%, #d4a017 50%, #e3b655 100%);
 }
 .icon {
-  font-size: 34px !important;
-  color: #f59e0b;
+  font-size: 36px !important;
+  color: #d4a017;
 }
 
 .input-box {
@@ -273,7 +249,8 @@ onLoad(() => {
   z-index: -1;
   height: 222rpx;
   text-align: center;
-  background: linear-gradient(to bottom, #f59e0b, #fffbeb);
+  // background: linear-gradient(to bottom, #D4A017, #fffbeb);
+  background: linear-gradient(180deg, #e3b655 0%, #d4a017 50%, #c08e10 100%);
 }
 .inputs {
   border-radius: 10%;
@@ -310,7 +287,7 @@ onLoad(() => {
   }
   .num1 {
     font-size: 28rpx;
-    color: #f59e0b;
+    color: #d4a017;
   }
 }
 </style>

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

@@ -1,276 +0,0 @@
-<!-- 使用 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>

+ 6 - 6
src/pages/login/component/weixin.vue

@@ -105,26 +105,26 @@ const loginWithWeChat = (e) => {
 <style lang="scss" scoped>
 //
 .con-top {
-  color: #f99304;
   font-size: 56rpx;
+  color: #d4a017;
 }
 .h3 {
   font-size: 36rpx;
 }
 
 .btn {
-  color: #fff;
-  border-radius: 60rpx;
   height: 80rpx;
-  line-height: 80rpx;
-  font-size: 16px;
   margin: 30rpx auto;
   font-family: PingFang SC;
+  font-size: 16px;
+  line-height: 80rpx;
+  color: #fff;
+  border-radius: 60rpx;
 }
 
 .user {
-  background-color: #eea441;
   margin-bottom: 50rpx;
+  background-color: #eea441;
 }
 .tel {
   background-color: #2a9d8f;

+ 3 - 3
src/pages/login/login.vue

@@ -149,7 +149,7 @@ onMounted(() => {})
   font-family: 'Times New Roman', Times, serif;
   font-size: 56rpx;
   font-weight: 600;
-  color: #f99304;
+  color: #d4a017;
 }
 .h3 {
   padding-left: 10rpx;
@@ -198,12 +198,12 @@ onMounted(() => {})
 .wd-icon-user[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 ::v-deep .wd-icon-lock-on:before,
 .wd-icon-lock-on[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 </style>

+ 99 - 23
src/pages/my/my.vue

@@ -3,7 +3,7 @@
 {
   style: {
     navigationBarTitleText: '我的',
-    navigationBarBackgroundColor: '#f59e0b',
+    navigationBarBackgroundColor: '#c08e10',
   },
 }
 </route>
@@ -14,14 +14,35 @@
       <view class="user-box flex">
         <!-- 左边 -->
         <view class="flex">
-          <image src="../../static/logo.png" mode="scaleToFill" class="imgs" />
+          <!-- 头像更换 -->
+          <wd-img-cropper
+            v-model="show"
+            :img-src="src"
+            @confirm="handleConfirm"
+            @cancel="handleCancel"
+          ></wd-img-cropper>
+          <view class="profile imgs content">
+            <view v-if="!imgSrc" @click="upload" class="mt-4">
+              <wd-icon name="fill-camera" custom-class="img-icon" font-size="28px"></wd-icon>
+            </view>
+            <wd-img
+              v-if="imgSrc"
+              round
+              width="140rpx"
+              height="140rpx"
+              :src="imgSrc"
+              mode="aspectFit"
+              custom-class="profile-img"
+              @click="upload"
+            />
+          </view>
+          <!-- <image src="../../static/logo.png" mode="scaleToFill" class="imgs" /> -->
           <view class="user-text pt-4">
             <text>好闪闪</text>
             <view>牧场-兽医部-技术员</view>
           </view>
         </view>
         <!-- 右边 -->
-        <!-- <view>消息</view> -->
       </view>
     </view>
     <!-- 工具 -->
@@ -31,7 +52,7 @@
         <view class="tool-box">
           <view class="tool-item" v-for="(item, index) in workList" :key="index">
             <i class="iconfont icon" :class="item.icon"></i>
-            <view class="mt-1">{{ item.name }}</view>
+            <view class="mt-1 center">{{ item.name }}</view>
           </view>
         </view>
       </view>
@@ -39,8 +60,8 @@
     <!-- 个人信息 -->
     <view class="user-tool px-4 pt-1 pb-1 flex mb-2" v-for="(item, index) in userList" :key="index">
       <view>
-        <image class="icons mr-1" :src="item.img" mode="scaleToFill" />
-        {{ item.name }}
+        <i class="iconfont icon" :class="item.img"></i>
+        <text class="rg-title">{{ item.name }}</text>
       </view>
       <navigator :url="item.url">
         <wd-icon name="arrow-right" color="#8e8e8e" size="22px"></wd-icon>
@@ -64,37 +85,93 @@ const userList = ref([
   {
     id: 1,
     name: '修改密码',
-    img: '../../static/images/tool/editPsd.png',
+    img: 'icon-xiugaimima',
     url: '/pages/editPassword/editPassword',
   },
   {
     id: 2,
-    name: '客服服务',
-    img: '../../static/images/tool/user.png',
+    name: '联系客户',
+    img: 'icon-lianxikefu',
     url: '/pages/editPassword/editPassword',
   },
   {
     id: 3,
     name: '意见反馈',
-    img: '../../static/images/tool/advice.png',
+    img: 'icon-yijianfankui1',
     url: '/pages/feedBack/feedBack',
   },
   {
     id: 4,
     name: '服务条款',
-    img: '../../static/images/tool/service.png',
+    img: 'icon-fuwutiaokuan1',
     url: '/pages/serviceText/serviceText',
   },
 ])
+
+// 头像
+const src = ref<string>('')
+const imgSrc = ref<string>('')
+const show = ref<boolean>(false)
+
+function upload() {
+  uni.chooseImage({
+    count: 1,
+    success: (res) => {
+      const tempFilePaths = res.tempFilePaths[0]
+      src.value = tempFilePaths
+      show.value = true
+    },
+  })
+}
+function handleConfirm(event) {
+  const { tempFilePath } = event
+  imgSrc.value = tempFilePath
+  const file = dataURLtoFile(tempFilePath, 'tu.jpeg')
+  console.log(file, 'file')
+}
+
+//将base64格式图片转换为文件形式
+// ajax请求,用formdata进行传输,file为上面由base64转的file。
+function dataURLtoFile(dataurl, filename) {
+  var arr = dataurl.split(','),
+    mime = arr[0].match(/:(.*?);/)[1],
+    bstr = atob(arr[1]),
+    n = bstr.length,
+    u8arr = new Uint8Array(n)
+  while (n--) {
+    u8arr[n] = bstr.charCodeAt(n)
+  }
+  return new File([u8arr], filename, { type: mime })
+}
+
+function imgLoaderror(res) {
+  console.log('加载失败', res)
+}
+function imgLoaded(res) {
+  console.log('加载成功', res)
+}
+function handleCancel(event) {
+  console.log('取消', event)
+}
 onMounted(() => {})
 
 onLoad(() => {})
 </script>
 
 <style lang="scss" scoped>
+::v-deep .wd-img-cropper__footer,
+.wd-img-cropper__footer--button[data-v-d9f3c9d7] {
+  bottom: 70px !important;
+}
+::v-deep .wd-icon,
+.wd-icon.data-v-d4a8410a {
+  font-size: 32px;
+}
 .icon {
+  display: inline-block;
+  margin: 0 auto;
   font-size: 32px !important;
-  color: #f59e0b;
+  color: #d4a017;
 }
 .containe {
   font-size: 28rpx;
@@ -106,7 +183,8 @@ onLoad(() => {})
   overflow: hidden;
   color: #fbeed8;
   text-align: center;
-  background: linear-gradient(to bottom, #f59e0b, #f6c986);
+  // background: linear-gradient(to bottom, #d4a017, #f6c986);
+  background: linear-gradient(180deg, #c08e10 0%, #d4a017 50%, #e3b655 100%);
 }
 .user-box {
   justify-content: space-between;
@@ -117,7 +195,8 @@ onLoad(() => {})
     width: 140rpx;
     height: 140rpx;
     margin-right: 20rpx;
-    background: #fff;
+    // background: #fff;
+    background-color: #323233;
     border: 1px solid #fff;
     border-radius: 50%;
   }
@@ -142,15 +221,7 @@ onLoad(() => {})
   font-weight: 450;
   border-bottom: 1px dotted #eee;
 }
-.icon {
-  width: 80rpx;
-  height: 80rpx;
-}
-.icons {
-  top: -4rpx;
-  width: 56rpx;
-  height: 56rpx;
-}
+
 .tool-item {
   width: 22%;
   padding: 10rpx 0;
@@ -174,4 +245,9 @@ onLoad(() => {})
   background-color: #fff;
   border-bottom: 1px dotted #f5f5f5;
 }
+.rg-title {
+  position: relative;
+  top: -10rpx;
+  left: 14rpx;
+}
 </style>

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

@@ -118,7 +118,7 @@ function handleForget() {
   font-family: 'Times New Roman', Times, serif;
   font-size: 56rpx;
   font-weight: 600;
-  color: #f99304;
+  color: #d4a017;
 }
 .h3 {
   padding-left: 10rpx;
@@ -167,19 +167,19 @@ function handleForget() {
 .wd-icon-user[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 ::v-deep .wd-icon-lock-on:before,
 .wd-icon-lock-on[data-v-7f3ba649]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 
 ::v-deep .wd-icon-evaluation:before,
 .wd-icon-lock-on[data-v-d4a8410a]:before {
   padding: 0 20rpx;
   font-size: 46rpx;
-  color: #f99304;
+  color: #d4a017;
 }
 </style>

+ 33 - 0
src/service/index/common.ts

@@ -0,0 +1,33 @@
+import { http } from '@/utils/http'
+import { platform } from '@/utils/platform'
+let API = ''
+if (process.env.NODE_ENV == 'development' && platform == 'h5') {
+  API = '/api'
+} else {
+  API = ''
+}
+export interface IFooItem {
+  id: string
+  name: string
+}
+
+/** GET 请求 事件列表 */
+export interface IConfigSys {
+  option_name: string
+}
+export const getConfigSys = (data: IConfigSys) => {
+  return http.get<IConfigSys>(`${API}/api/v1/config/system/base/config/options`, data)
+}
+
+/** POST 发病 请求 */
+export interface modelForm {
+  eventType: Number
+  meta: any
+  cowId: Number
+  timestamp: string
+  backup: string
+  eventSource: Number // 1小程序 2pc
+}
+export const postModel = (data: modelForm) => {
+  return http.post<modelForm>(`${API}/api/v1/event/submit`, data)
+}

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

@@ -1,4 +1,11 @@
 import { http } from '@/utils/http'
+import { platform } from '@/utils/platform'
+let API = ''
+if (process.env.NODE_ENV == 'development' && platform == 'h5') {
+  API = '/api'
+} else {
+  API = ''
+}
 export interface IFooItem {
   id: string
   name: string
@@ -23,3 +30,12 @@ export interface IFooItem {
 // export const getAuth = (data) => {
 //   return http.post<IFooItem>('/auth', data)
 // }
+
+export interface IConfigSys {
+  option_name: string
+}
+
+/** GET 请求 */
+export const getConfigSys = (data: IConfigSys) => {
+  return http.get<IConfigSys>(`${API}/api/v1/config/system/base/config/options`, data)
+}

BIN
src/static/tabbar/homeHL.png


BIN
src/static/tabbar/personalHL.png


File diff suppressed because it is too large
+ 0 - 0
src/style/iconfont.css


+ 1 - 1
src/style/index.scss

@@ -11,7 +11,7 @@
 :root,
 page {
   // 修改按主题色
-  --wot-color-theme: #f0883a;
+  --wot-color-theme: #d4a017;
 
   // 修改按钮背景色
   // --wot-button-primary-bg-color: green;

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

@@ -5,7 +5,6 @@
 
 interface NavigateToOptions {
   url: "/pages/my/my" |
-       "/pages/index/index2" |
        "/pages/index/index" |
        "/pages/about/about" |
        "/pages/approach/approach" |
@@ -13,6 +12,7 @@ interface NavigateToOptions {
        "/pages/disease/disease" |
        "/pages/editPassword/editPassword" |
        "/pages/feedBack/feedBack" |
+       "/pages/illness/illness" |
        "/pages/login/login" |
        "/pages/neckRing/neckRing" |
        "/pages/notice/notice" |

Some files were not shown because too many files changed in this diff