فهرست منبع

个人中心模块开发

Shan9312 7 ماه پیش
والد
کامیت
a2c51ffa65

+ 5 - 5
env/.env

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

+ 2 - 1
project.private.config.json

@@ -2,6 +2,7 @@
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
   "projectname": "beefCattle-uni",
   "setting": {
-    "compileHotReLoad": true
+    "compileHotReLoad": true,
+    "urlCheck": false
   }
 }

+ 7 - 0
src/App.vue

@@ -1,6 +1,10 @@
 <script setup lang="ts">
 import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
 
+const globalData = reactive({
+  loading: false,
+})
+
 onLaunch(() => {
   console.log('App Launch')
 })
@@ -13,6 +17,9 @@ onHide(() => {
 </script>
 
 <style lang="scss">
+#app {
+  background-color: #f5f5f5;
+}
 /* stylelint-disable selector-type-no-unknown */
 button::after {
   border: none;

+ 44 - 0
src/components/Loading/index.vue

@@ -0,0 +1,44 @@
+<template>
+  <view class="container">
+    <slot v-if="!loading"></slot>
+    <view v-else class="center">
+      <!-- loading组件可以自己实现, 不想自己写就找个网站cv一下 -->
+      <!-- <loading></loading> -->
+      加载中...
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref, onMounted } from 'vue'
+
+defineOptions({
+  name: 'Loading',
+})
+
+let loading = ref(false)
+
+onMounted(() => {
+  loading = getApp().globalData.loading
+  uni.$on('pageSwitch', (res) => {
+    loading = res
+    getApp().globalData.loading = res
+  })
+})
+</script>
+
+<style lang="scss" scoped>
+.center {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  background-color: rgba(0, 0, 0, 0.6);
+}
+</style>

+ 14 - 1
src/interceptors/request.ts

@@ -28,7 +28,8 @@ const httpInterceptor = {
     // 非 http 开头需拼接地址
     if (!options.url.startsWith('http')) {
       // #ifdef H5
-      // console.log(__VITE_APP_PROXY__)
+      console.log(__VITE_APP_PROXY__, 'hhh')
+      // debugger
       if (JSON.parse(__VITE_APP_PROXY__)) {
         // 啥都不需要做
       } else {
@@ -40,6 +41,17 @@ const httpInterceptor = {
       options.url = baseUrl + options.url
       // #endif
       // TIPS: 如果需要对接多个后端服务,也可以在这里处理,拼接成所需要的地址
+      // const proxyMap = {
+      //   cms: 'http://localhost:8080/cms',
+      //   ums: 'http://localhost:8080/ums',
+      // }
+      // 拦截器部分(上图箭头部分)修改如下
+      // Object.keys(proxyMap).forEach((key) => {
+      //   if (options.url.startsWith(`/${key}`)) {
+      //     options.url = proxyMap[key] + options.url
+      //     console.log(' options.url', options.url)
+      //   }
+      // })
     }
     // 1. 请求超时
     options.timeout = 10000 // 10s
@@ -54,6 +66,7 @@ const httpInterceptor = {
     if (token) {
       options.header.Authorization = `Bearer ${token}`
     }
+    console.log(options.header, ' options.header')
   },
 }
 

+ 42 - 6
src/pages.json

@@ -50,6 +50,14 @@
     ]
   },
   "pages": [
+    {
+      "path": "pages/my/my",
+      "type": "home",
+      "style": {
+        "navigationStyle": "custom",
+        "navigationBarTitleText": "首页"
+      }
+    },
     {
       "path": "pages/index/index",
       "type": "home",
@@ -69,7 +77,7 @@
       "path": "pages/analyze/analyze",
       "type": "page",
       "style": {
-        "navigationBarTitleText": "分析"
+        "navigationBarTitleText": "工作台"
       }
     },
     {
@@ -80,18 +88,24 @@
       }
     },
     {
-      "path": "pages/login/login",
+      "path": "pages/editPassword/editPassword",
       "type": "page",
       "style": {
-        "navigationBarTitleText": "欢迎登录"
+        "navigationBarTitleText": "修改密码"
       }
     },
     {
-      "path": "pages/my/my",
+      "path": "pages/feedBack/feedBack",
       "type": "page",
       "style": {
-        "navigationBarTitleText": "欢迎登录",
-        "navigationBarBackgroundColor": "#f6d7a7"
+        "navigationBarTitleText": "意见反馈"
+      }
+    },
+    {
+      "path": "pages/login/login",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "登录"
       }
     },
     {
@@ -108,6 +122,13 @@
         "navigationBarTitleText": "手机登录"
       }
     },
+    {
+      "path": "pages/regist/regist",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "注册"
+      }
+    },
     {
       "path": "pages/searchDetail/searchDetail",
       "type": "page",
@@ -121,6 +142,21 @@
       "style": {
         "navigationBarTitleText": "搜索"
       }
+    },
+    {
+      "path": "pages/serviceText/serviceText",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "服务条款"
+      }
+    },
+    {
+      "path": "pages/login/component/weixin",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "欢迎登录",
+        "navigationBarBackgroundColor": "#f6d7a7"
+      }
     }
   ],
   "subPackages": []

+ 120 - 9
src/pages/analyze/analyze.vue

@@ -1,22 +1,133 @@
 <route lang="json5">
 {
   style: {
-    navigationBarTitleText: '分析',
+    navigationBarTitleText: '工作台',
   },
 }
 </route>
 
 <template>
-  <view
-    class="bg-white overflow-hidden pt-2 px-4"
-    :style="{ marginTop: safeAreaInsets?.top + 'px' }"
-  >
-    hello~闪闪
+  <view>
+    <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"
+          :icon="item.icon"
+          :disabled="item.disabled"
+        />
+      </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-group :title="item.title" border>
+            <wd-cell
+              v-for="(cell, index) in item.items"
+              :key="index"
+              :title="cell.title"
+              :label="cell.label"
+            >
+              <wd-icon name="github-filled" size="24px"></wd-icon>
+            </wd-cell>
+          </wd-cell-group>
+        </scroll-view>
+      </view>
+    </view>
   </view>
 </template>
 
-<script>
-export default {}
+<script lang="ts" setup>
+import { ref, nextTick } from 'vue'
+
+const active = ref<number>(1)
+const scrollTop = ref<number>(0)
+const subCategories = new Array(24).fill({ title: '标题文字', label: '这是描述这是描述' }, 0, 24)
+const categories = ref([
+  {
+    label: '分类一',
+    title: '标题一',
+    // icon: 'thumb-up',
+    items: subCategories,
+    disabled: false,
+  },
+  {
+    label: '分类二',
+    title: '标题二',
+    // icon: 'thumb-up',
+    items: subCategories,
+    disabled: false,
+  },
+  {
+    label: '分类三',
+    title: '标题三',
+    // icon: 'thumb-up',
+    items: subCategories.slice(0, 18),
+    disabled: false,
+  },
+  {
+    label: '分类四',
+    title: '标题四',
+    // icon: 'thumb-up',
+    items: subCategories.slice(0, 21),
+    disabled: false,
+  },
+  {
+    label: '分类五',
+    title: '标题五',
+    // icon: 'thumb-up',
+    items: subCategories,
+    disabled: false,
+  },
+  {
+    label: '分类六',
+    title: '标题六',
+    // icon: 'thumb-up',
+    items: subCategories.slice(0, 18),
+    disabled: false,
+  },
+  {
+    label: '分类七',
+    title: '标题七',
+    // icon: 'thumb-up',
+    items: subCategories,
+    disabled: true,
+  },
+])
+
+function handleChange({ value }) {
+  active.value = value
+  scrollTop.value = -1
+  nextTick(() => {
+    scrollTop.value = 0
+  })
+}
 </script>
 
-<style></style>
+<style lang="scss" scoped>
+.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.3s ease;
+}
+.category {
+  box-sizing: border-box;
+  height: 100%;
+}
+</style>

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

@@ -0,0 +1,206 @@
+<route lang="json5" type="page">
+{
+  style: {
+    navigationBarTitleText: '修改密码',
+    // navigationBarBackgroundColor: '#f6d7a7',
+  },
+}
+</route>
+
+<template>
+  <view class="text-center container">
+    <view class="pt-10 pb-20 top-box px-5">
+      <image src="../../static/logo.png" mode="scaleToFill" class="logo" />
+      <!-- <view class="con-top">
+            <view class="h1 mb-6 mt-2">科湃腾肉牛系统</view>
+            <view class="h3 mb-10 pt-4">简化牧场管理,从这里开始!</view>
+          </view> -->
+
+      <wd-form ref="form" :model="model">
+        <wd-cell-group border>
+          <!-- <wd-input
+            label-width="160rpx"
+            prop="value1"
+            clearable
+            prefix-icon="user"
+            size="large"
+            v-model="model.value1"
+            placeholder="请输入用户名"
+          /> -->
+          <wd-input
+            label-width="160rpx"
+            prop="oldpassword"
+            size="large"
+            show-password
+            prefix-icon="lock-on"
+            clearable
+            v-model="model.oldpassword"
+            placeholder="请输入原密码"
+            :rules="[{ required: false, validator: validatorPassword, message: '请输入密码' }]"
+          />
+          <wd-input
+            label-width="160rpx"
+            prop="password"
+            size="large"
+            show-password
+            prefix-icon="lock-on"
+            clearable
+            v-model="model.password"
+            placeholder="请输入新密码"
+            :rules="[{ required: false, validator: validatorPassword, message: '请输入新密码' }]"
+          />
+          <wd-input
+            label-width="160rpx"
+            prop="password1"
+            size="large"
+            show-password
+            prefix-icon="lock-off"
+            clearable
+            v-model="model.password1"
+            placeholder="再次确认新密码"
+            :rules="[{ required: false, validator: validatorPassword, message: '请确认新密码' }]"
+          />
+        </wd-cell-group>
+        <view class="flex justify-between mt-4 bot px-4">
+          <!-- <text @click="handleRegist">注册</text> -->
+          <text @click="handleLogin">去登录</text>
+        </view>
+
+        <view class="footer mt-8">
+          <wd-button type="primary" size="large" @click="handleSubmit" block>确认修改</wd-button>
+        </view>
+      </wd-form>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+import { useMessage } from 'wot-design-uni'
+
+defineOptions({
+  name: 'Login',
+})
+
+// 用密码校验
+const validatorPassword = (val) => {
+  if (String(val).length < 6) {
+    return Promise.reject('密码不能少于6个字符')
+  } else {
+    return Promise.resolve()
+  }
+}
+const model = reactive<{
+  password1: string
+  password: string
+  oldpassword: string
+}>({
+  oldpassword: '',
+  password: '',
+  password1: '',
+})
+
+const form = ref()
+const message = useMessage()
+function handleSubmit() {
+  form.value
+    .validate()
+    .then(({ valid, errors }) => {
+      if (valid) {
+        message.show('校验通过')
+      }
+    })
+    .catch((error) => {
+      console.log(error, 'error')
+    })
+}
+
+function handleRegist() {
+  uni.navigateTo({ url: '/pages/regist/regist' })
+}
+
+function handleLogin() {
+  // uni.navigateTo({ url: '/pages/login/login' })
+  uni.switchTab({ url: '/pages/my/my' })
+}
+</script>
+
+<style lang="scss" scoped>
+.bot {
+  font-size: 28rpx;
+  color: #bfbfbf;
+}
+.logo {
+  width: 140rpx;
+  height: 140rpx;
+  border-radius: 50%;
+}
+//
+.con-top {
+  font-family: 'Times New Roman', Times, serif;
+  font-size: 56rpx;
+  font-weight: 600;
+  color: #f99304;
+}
+.h3 {
+  padding-left: 10rpx;
+  // font-family: 'Times New Roman', Times, serif;
+  font-size: 36rpx;
+  // font-style: oblique 4deg;
+  font-weight: 300;
+}
+
+.btn {
+  height: 80rpx;
+  margin: 30rpx auto;
+  font-family: PingFang SC;
+  font-size: 16px;
+  line-height: 80rpx;
+  color: #fff;
+  border-radius: 60rpx;
+}
+
+.user {
+  margin-bottom: 50rpx;
+  background-color: #eea441;
+}
+.tel {
+  background-color: #2a9d8f;
+}
+.container {
+  height: 100vh;
+  background-color: #fff;
+}
+.top-box {
+  // background-color: #fff;
+  //   background: linear-gradient(to bottom, #f6d7a7, #fff);
+}
+::v-deep .wd-radio-group.data-v-a6e3f5b0,
+.wd-radio-group {
+  background-color: transparent;
+}
+::v-deep .title > .wd-radio__label {
+  font-size: 20rpx !important;
+}
+::v-deep .wd-button.is-success.data-v-aa3a6253 {
+  background-color: #2a9d8f !important;
+}
+::v-deep .wd-icon-user:before,
+.wd-icon-user[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+::v-deep .wd-icon-lock-on:before,
+.wd-icon-lock-on[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+::v-deep .wd-icon-lock-off:before,
+.wd-icon-lock-on[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+</style>

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

@@ -0,0 +1,121 @@
+<route lang="json5" type="page">
+{
+  style: {
+    navigationBarTitleText: '意见反馈',
+    // navigationBarBackgroundColor: '#f6d7a7',
+  },
+}
+</route>
+
+<template>
+  <view class="container">
+    <view class="top-box pt-10 pb-10 px-2">
+      <wd-form ref="form" :model="model">
+        <wd-textarea
+          v-model="model.text"
+          :maxlength="200"
+          clearable
+          show-word-limit
+          placeholder="点击填写:我们想听听您的心声,您描述的问题越全,问题越可能有效的解决"
+          :rules="[{ required: false, message: '请输入您的意见' }]"
+        />
+
+        <wd-upload
+          :file-list="fileList"
+          image-mode="aspectFill"
+          :action="action"
+          :limit="6"
+          @change="handleChange"
+          accept="all"
+          multiple
+        ></wd-upload>
+
+        <view class="footer mt-20">
+          <wd-button type="primary" size="large" @click="handleSubmit" block>提 交</wd-button>
+        </view>
+      </wd-form>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+import { useMessage } from 'wot-design-uni'
+
+defineOptions({
+  name: 'Login',
+})
+
+const { loading, data, run } = useUpload({ user: '菲鸽' })
+const fileList = ref<any[]>([
+  {
+    url: 'https://img12.360buyimg.com//n0/jfs/t1/29118/6/4823/55969/5c35c16bE7c262192/c9fdecec4b419355.jpg',
+  },
+])
+
+const action: string =
+  'https://mockapi.eolink.com/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload'
+
+function handleChange({ fileList: files }) {
+  fileList.value = files
+}
+// 用密码校验
+const validatorPassword = (val) => {
+  if (String(val).length < 6) {
+    return Promise.reject('密码不能少于6个字符')
+  } else {
+    return Promise.resolve()
+  }
+}
+const model = reactive<{
+  text: string
+}>({
+  text: '',
+})
+
+const form = ref()
+const message = useMessage()
+function handleSubmit() {
+  form.value
+    .validate()
+    .then(({ valid, errors }) => {
+      if (valid) {
+        console.log(model, fileList, '提交')
+      }
+    })
+    .catch((error) => {
+      console.log(error, 'error')
+    })
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+  width: 90%;
+  padding: 0 10rpx;
+  margin: 20rpx auto;
+  background-color: #fff;
+  // border: 1px solid red;
+  border-radius: 4%;
+  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
+}
+
+::v-deep .wd-icon-user:before,
+.wd-icon-user[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+::v-deep .wd-icon-lock-on:before,
+.wd-icon-lock-on[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+::v-deep .wd-icon-lock-off:before,
+.wd-icon-lock-on[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+</style>

+ 24 - 32
src/pages/index/index.vue

@@ -58,12 +58,12 @@
         </view>
       </view>
     </view>
+    <!-- 加载 -->
+    <Loading></Loading>
   </view>
 </template>
 
 <script lang="ts" setup>
-import { getAuth } from '@/service/index/auth'
-
 defineOptions({
   name: 'Home',
 })
@@ -124,14 +124,6 @@ const workList = reactive([
 ])
 const current = ref(20)
 
-// 接口请求参数
-const logins = async () => {
-  const { data } = await getAuth({
-    username: 'shanshan',
-    password: '123456',
-  })
-  console.log(data, 'hss')
-}
 // 工作待办跳转
 const switchPage = () => {
   uni.switchTab({ url: '/pages/about/about' })
@@ -149,11 +141,10 @@ const addBattle = (val) => {
 
 // 查看消息
 const watchNotice = () => {
+  uni.$emit('pageSwitch', true)
   uni.navigateTo({ url: '/pages/notice/notice' })
 }
-onMounted(() => {
-  // logins()
-})
+onMounted(() => {})
 
 // 测试 uni API 自动引入
 onLoad(() => {
@@ -165,19 +156,19 @@ onLoad(() => {
 .work-item {
   // border: 1px solid red;
   width: 22%;
+  height: 200rpx;
   font-size: 32rpx;
   text-align: center;
-  height: 200rpx;
 }
 .header {
-  margin-left: -32rpx;
-  margin-right: -32rpx;
   padding: 32rpx;
+  margin-right: -32rpx;
+  margin-left: -32rpx;
 }
 .header-fixed {
   position: sticky;
-  z-index: 10;
   top: 0;
+  z-index: 10;
 }
 .header-bg {
   background: linear-gradient(to bottom, #f59e0b, #f5d198);
@@ -193,23 +184,23 @@ onLoad(() => {
   // position: relative;
 }
 .input-box {
-  border-radius: 44rpx;
-  background: #fff;
   height: 80rpx;
   margin-top: 44rpx;
   line-height: 80rpx;
-  text-align: center;
   color: #6b7280;
+  text-align: center;
+  background: #fff;
+  border-radius: 44rpx;
 }
 .top-content {
   position: fixed;
   top: 0;
-  left: 0;
   right: 0;
-  background: linear-gradient(to bottom, #f59e0b, #fffbeb);
+  left: 0;
   z-index: -1;
   height: 422rpx;
   text-align: center;
+  background: linear-gradient(to bottom, #f59e0b, #fffbeb);
 }
 .inputs {
   border-radius: 10%;
@@ -218,34 +209,35 @@ onLoad(() => {
   margin: 10rpx 0;
 }
 .work {
-  border-radius: 28rpx;
-  background-color: $uni-text-color-inverse;
+  padding: 10rpx;
   font-size: 28rpx;
   color: $uni-text-color;
-  padding: 10rpx;
-  box-shadow: 8rpx 16rpx 32rpx 0 $uni-bg-color-grey;
+  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 {
-  color: #333;
   font-size: 36rpx;
   font-weight: 600;
+  color: #333;
 }
 
 .work-box {
   .do-work {
+    margin-top: 74rpx;
     font-size: 36rpx;
-    color: #ea580c;
     font-weight: 600;
-    margin-top: 74rpx;
+    color: #ea580c;
   }
   .num {
-    color: #ea580c;
-    font-size: 36rpx;
     padding-left: 14rpx;
+    font-size: 36rpx;
+    color: #ea580c;
   }
   .num1 {
-    color: #f59e0b;
     font-size: 28rpx;
+    color: #f59e0b;
   }
 }
 </style>

+ 150 - 0
src/pages/login/component/weixin.vue

@@ -0,0 +1,150 @@
+<route lang="json5" type="page">
+{
+  style: {
+    navigationBarTitleText: '欢迎登录',
+    navigationBarBackgroundColor: '#f6d7a7',
+  },
+}
+</route>
+
+<template>
+  <view class="text-center container">
+    <view class="px-5 pt-20 pb-20 top-box">
+      <view class="con-top">
+        <view class="h1 mb-6 mt-8">科湃腾肉牛系统</view>
+        <view class="h3 mb-14 pt-4">简化牧场管理,从这里开始!</view>
+      </view>
+      <!-- <view class="btn mt-10 user" @click="handleWX">用户一键登录</view> -->
+      <view class="footer mt-10">
+        <wd-button
+          type="primary"
+          size="large"
+          open-type="getUserInfo"
+          getuserinfo="loginWithWeChat"
+          block
+        >
+          用户一键登录
+        </wd-button>
+      </view>
+      <view class="footer mt-5">
+        <wd-button size="large" type="success" @click="getPhone" block>手机号安全登录</wd-button>
+      </view>
+      <!-- <view class="btn mt-10 tel" @click="getPhone">手机号安全登录</view> -->
+
+      <view class="mt-5">
+        <wd-radio-group :modelValue="isChecked" inline checked-color="#eea441" @change="setChecked">
+          <wd-radio :value="true" shape="dot" class="title" inline>
+            我已认真阅读并同意《服务协议》、《隐私政策》
+          </wd-radio>
+          <!-- <text>  我已认真阅读并同意《服务协议》、《隐私政策》</text> -->
+        </wd-radio-group>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+defineOptions({
+  name: 'Login',
+})
+
+const isChecked = ref(false)
+const getPhone = () => {
+  uni.navigateTo({ url: '/pages/phone/phone' })
+}
+
+// 选择微信登录
+const handleWX = () => {}
+// 勾选同意
+const setChecked = (val) => {
+  console.log(val, isChecked.value, '000')
+  if (isChecked.value) {
+    isChecked.value = false
+  } else {
+    isChecked.value = true
+  }
+}
+
+// 微信授权登录
+const loginWithWeChat = (e) => {
+  if (e.detail.userInfo) {
+    uni.login({
+      provider: 'weixin',
+      success: (loginRes) => {
+        console.log(loginRes)
+        // 获取微信登录的授权码
+        const code = loginRes.code
+        // TODO: 获取code码 给到后端接口获取用户信息
+        // uni.request({
+        //   url: 'https://your-api.com/wechat-login',
+        //   method: 'POST',
+        //   data: {
+        //     code: loginRes.code,
+        //   },
+        //   success: (res) => {
+        //     if (res.data.success) {
+        //       uni.setStorageSync('userToken', res.data.token)
+        //       uni.showToast({
+        //         title: '登录成功',
+        //       })
+        //     } else {
+        //       uni.showToast({
+        //         title: '登录失败',
+        //         icon: 'none',
+        //       })
+        //     }
+        //   },
+        // })
+      },
+    })
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+//
+.con-top {
+  color: #f99304;
+  font-size: 56rpx;
+}
+.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;
+}
+
+.user {
+  background-color: #eea441;
+  margin-bottom: 50rpx;
+}
+.tel {
+  background-color: #2a9d8f;
+}
+.container {
+  // background-color: #fafafa;
+  height: 100vh;
+}
+.top-box {
+  // background-color: #fff;
+  background: linear-gradient(to bottom, #f6d7a7, #fff);
+}
+::v-deep .wd-radio-group.data-v-a6e3f5b0,
+.wd-radio-group {
+  background-color: transparent;
+}
+::v-deep .title > .wd-radio__label {
+  font-size: 20rpx !important;
+}
+::v-deep .wd-button.is-success.data-v-aa3a6253 {
+  background-color: #2a9d8f !important;
+}
+</style>

+ 189 - 7
src/pages/login/login.vue

@@ -1,26 +1,208 @@
 <route lang="json5" type="page">
 {
-  style: { navigationBarTitleText: '欢迎登录' },
+  style: {
+    navigationBarTitleText: '登录',
+    // navigationBarBackgroundColor: '#f6d7a7',
+  },
 }
 </route>
 
 <template>
-  <view class="text-center">
-    <view class="text-green-500">
-      <view>科湃腾肉牛系统</view>
-      <view></view>
-      <view>用户一键登录</view>
-      <text>我已认真阅读并同意《服务协议》、《隐私政策》</text>
+  <view class="text-center container">
+    <view class="px-5 pt-10 pb-20 top-box">
+      <image src="../../static/logo.png" mode="scaleToFill" class="logo" />
+      <view class="con-top">
+        <view class="h1 mb-6 mt-2">科湃腾肉牛系统</view>
+        <view class="h3 mb-10 pt-4">简化牧场管理,从这里开始!</view>
+      </view>
+
+      <wd-form ref="form" :model="model">
+        <wd-cell-group border>
+          <wd-input
+            label-width="160rpx"
+            prop="username"
+            clearable
+            prefix-icon="user"
+            size="large"
+            v-model="model.username"
+            placeholder="请输入用户名"
+            :rules="[{ required: false, validator: validatorMessage, message: '请输入用户名' }]"
+          />
+          <wd-input
+            label-width="160rpx"
+            prop="password"
+            size="large"
+            show-password
+            prefix-icon="lock-on"
+            clearable
+            v-model="model.password"
+            placeholder="请输入密码"
+            :rules="[{ required: false, validator: validatorPassword, message: '请输入密码' }]"
+          />
+
+          <!-- <view class="flex justify-between mt-4 bot px-4">
+              <text @click="handleRegist">注册 ></text>
+              <text @click="handleForget">修改密码 ></text>
+            </view> -->
+        </wd-cell-group>
+
+        <view class="footer mt-8">
+          <wd-button type="primary" size="large" @click="handleSubmit" block>登 录</wd-button>
+        </view>
+      </wd-form>
     </view>
   </view>
 </template>
 
 <script lang="ts" setup>
+import { ref } from 'vue'
+import { getAuth } from '@/service/index/auth'
+import { useMessage } from 'wot-design-uni'
+import { useUserStore } from '@/store'
+
 defineOptions({
   name: 'Login',
 })
+
+const userStore = useUserStore()
+const model = reactive<{
+  username: string
+  password: string
+}>({
+  username: '',
+  password: '',
+})
+
+const form = ref()
+const message = useMessage()
+
+// 接口请求参数
+async function logins(obj) {
+  const { data } = await getAuth({
+    username: obj.username.trim(),
+    password: obj.password,
+  })
+  console.log(data, '9999')
+  if (data?.token) {
+    const person = {
+      username: model.username,
+      token: data?.token,
+    }
+    userStore.userInfo = person
+  } else {
+    message.show(data)
+  }
+}
+
+// 用户名校验
+const validatorMessage = (val) => {
+  if (String(val).length >= 4) {
+    return Promise.resolve()
+  }
+}
+// 用密码校验
+const validatorPassword = (val) => {
+  if (String(val).length < 6) {
+    return Promise.reject('密码不能少于6个字符')
+  } else {
+    return Promise.resolve()
+  }
+}
+
+function handleSubmit() {
+  form.value
+    .validate()
+    .then(({ valid, errors }) => {
+      if (valid) {
+        logins(model)
+      }
+    })
+    .catch((error) => {
+      console.log(error, 'error')
+    })
+}
+
+function handleRegist() {
+  uni.navigateTo({ url: '/pages/regist/regist' })
+}
+
+function handleForget() {
+  uni.navigateTo({ url: '/pages/forget/forget' })
+}
+
+onMounted(() => {})
 </script>
 
 <style lang="scss" scoped>
+.bot {
+  font-size: 28rpx;
+  color: #bfbfbf;
+}
+.logo {
+  width: 140rpx;
+  height: 140rpx;
+  border-radius: 50%;
+}
 //
+.con-top {
+  font-family: 'Times New Roman', Times, serif;
+  font-size: 56rpx;
+  font-weight: 600;
+  color: #f99304;
+}
+.h3 {
+  padding-left: 10rpx;
+  // font-family: 'Times New Roman', Times, serif;
+  font-size: 36rpx;
+  // font-style: oblique 4deg;
+  font-weight: 300;
+}
+
+.btn {
+  height: 80rpx;
+  margin: 30rpx auto;
+  font-family: PingFang SC;
+  font-size: 16px;
+  line-height: 80rpx;
+  color: #fff;
+  border-radius: 60rpx;
+}
+
+.user {
+  margin-bottom: 50rpx;
+  background-color: #eea441;
+}
+.tel {
+  background-color: #2a9d8f;
+}
+.container {
+  // background-color: #fafafa;
+  height: 100vh;
+}
+.top-box {
+  // background-color: #fff;
+  // background: linear-gradient(to bottom, #f6d7a7, #fff);
+}
+::v-deep .wd-radio-group.data-v-a6e3f5b0,
+.wd-radio-group {
+  background-color: transparent;
+}
+::v-deep .title > .wd-radio__label {
+  font-size: 20rpx !important;
+}
+::v-deep .wd-button.is-success.data-v-aa3a6253 {
+  background-color: #2a9d8f !important;
+}
+::v-deep .wd-icon-user:before,
+.wd-icon-user[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+::v-deep .wd-icon-lock-on:before,
+.wd-icon-lock-on[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
 </style>

+ 182 - 117
src/pages/my/my.vue

@@ -1,150 +1,215 @@
-<route lang="json5" type="page">
+<!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page;推荐使用json5,更强大,且允许注释 -->
+<route lang="json5" type="home">
 {
   style: {
-    navigationBarTitleText: '欢迎登录',
-    navigationBarBackgroundColor: '#f6d7a7',
+    navigationStyle: 'custom',
+    navigationBarTitleText: '首页',
   },
 }
 </route>
-
 <template>
-  <view class="text-center container">
-    <view class="px-5 pt-20 pb-20 top-box">
-      <view class="con-top">
-        <view class="h1 mb-6 mt-8">科湃腾肉牛系统</view>
-        <view class="h3 mb-14 pt-4">简化牧场管理,从这里开始!</view>
-      </view>
-      <!-- <view class="btn mt-10 user" @click="handleWX">用户一键登录</view> -->
-      <view class="footer mt-10">
-        <wd-button
-          type="primary"
-          size="large"
-          open-type="getUserInfo"
-          getuserinfo="loginWithWeChat"
-          block
-        >
-          用户一键登录
-        </wd-button>
+  <view class="containe">
+    <!-- 渐变色 -->
+    <view class="top-content px-6 pt-18">
+      <view class="user-box flex">
+        <!-- 左边 -->
+        <view class="flex">
+          <image src="../../static/logo.png" mode="scaleToFill" class="imgs" />
+          <view class="user-text pt-4">
+            <text>好闪闪</text>
+            <view>技术部:888888</view>
+          </view>
+        </view>
+        <!-- 右边 -->
+        <!-- <view>hhhh</view> -->
       </view>
-      <view class="footer mt-5">
-        <wd-button size="large" type="success" @click="getPhone" block>手机号安全登录</wd-button>
+    </view>
+
+    <!-- 工具 -->
+    <view class="px-4">
+      <view class="tool px-4 pt-2 pb-2">
+        <view class="title">工具栏</view>
+        <view class="tool-box">
+          <view class="tool-item">
+            <image
+              class="icon pb-1"
+              src="../../static/images/tool/editPsd.png"
+              mode="scaleToFill"
+            />
+            <view>脖环管理</view>
+          </view>
+
+          <view class="tool-item">
+            <image
+              class="icon pb-1"
+              src="../../static/images/tool/editPsd.png"
+              mode="scaleToFill"
+            />
+            <view>脖环管理</view>
+          </view>
+
+          <view class="tool-item">
+            <image
+              class="icon pb-1"
+              src="../../static/images/tool/editPsd.png"
+              mode="scaleToFill"
+            />
+            <view>脖环管理</view>
+          </view>
+
+          <view class="tool-item">
+            <image
+              class="icon pb-1"
+              src="../../static/images/tool/editPsd.png"
+              mode="scaleToFill"
+            />
+            <view>脖环管理</view>
+          </view>
+
+          <view class="tool-item">
+            <image
+              class="icon pb-1"
+              src="../../static/images/tool/editPsd.png"
+              mode="scaleToFill"
+            />
+            <view>脖环管理</view>
+          </view>
+
+          <view class="tool-item">
+            <image
+              class="icon pb-1"
+              src="../../static/images/tool/editPsd.png"
+              mode="scaleToFill"
+            />
+            <view>脖环管理</view>
+          </view>
+        </view>
       </view>
-      <!-- <view class="btn mt-10 tel" @click="getPhone">手机号安全登录</view> -->
+    </view>
 
-      <view class="mt-5">
-        <wd-radio-group :modelValue="isChecked" inline checked-color="#eea441" @change="setChecked">
-          <wd-radio :value="true" shape="dot" class="title" inline>
-            我已认真阅读并同意《服务协议》、《隐私政策》
-          </wd-radio>
-          <!-- <text>  我已认真阅读并同意《服务协议》、《隐私政策》</text> -->
-        </wd-radio-group>
+    <!-- 个人信息 -->
+    <view class="user-tool px-4 pt-1 pb-1 flex mb-2">
+      <view>
+        <image class="icons mr-1" src="../../static/images/tool/editPsd.png" mode="scaleToFill" />
+        修改密码
+      </view>
+      <navigator url="/pages/editPassword/editPassword">
+        <wd-icon name="arrow-right" color="#8e8e8e" size="22px"></wd-icon>
+      </navigator>
+    </view>
+    <view class="user-tool px-4 pt-1 pb-1 flex mb-2">
+      <view>
+        <image class="icons mr-1" src="../../static/images/tool/user.png" mode="scaleToFill" />
+        客服服务
       </view>
+      <wd-icon name="arrow-right" color="#8e8e8e" size="22px"></wd-icon>
+    </view>
+    <view class="user-tool px-4 pt-1 pb-1 flex">
+      <view>
+        <image class="icons mr-1" src="../../static/images/tool/advice.png" mode="scaleToFill" />
+        服务条款
+      </view>
+      <navigator url="/pages/serviceText/serviceText">
+        <wd-icon name="arrow-right" color="#8e8e8e" size="20px"></wd-icon>
+      </navigator>
+    </view>
+    <view class="user-tool px-4 pt-1 pb-1 flex">
+      <view>
+        <image class="icons mr-1" src="../../static/images/tool/service.png" mode="scaleToFill" />
+        意见反馈
+      </view>
+      <navigator url="/pages/feedBack/feedBack">
+        <wd-icon name="arrow-right" color="#8e8e8e" size="22px"></wd-icon>
+      </navigator>
     </view>
   </view>
 </template>
 
 <script lang="ts" setup>
-import { ref } from 'vue'
 defineOptions({
-  name: 'Login',
+  name: 'Home',
 })
 
-const isChecked = ref(false)
-const getPhone = () => {
-  uni.navigateTo({ url: '/pages/phone/phone' })
-}
+onMounted(() => {})
 
-// 选择微信登录
-const handleWX = () => {}
-// 勾选同意
-const setChecked = (val) => {
-  console.log(val, isChecked.value, '000')
-  if (isChecked.value) {
-    isChecked.value = false
-  } else {
-    isChecked.value = true
-  }
-}
-
-// 微信授权登录
-const loginWithWeChat = (e) => {
-  if (e.detail.userInfo) {
-    uni.login({
-      provider: 'weixin',
-      success: (loginRes) => {
-        console.log(loginRes)
-        // 获取微信登录的授权码
-        const code = loginRes.code
-        // TODO: 获取code码 给到后端接口获取用户信息
-        // uni.request({
-        //   url: 'https://your-api.com/wechat-login',
-        //   method: 'POST',
-        //   data: {
-        //     code: loginRes.code,
-        //   },
-        //   success: (res) => {
-        //     if (res.data.success) {
-        //       uni.setStorageSync('userToken', res.data.token)
-        //       uni.showToast({
-        //         title: '登录成功',
-        //       })
-        //     } else {
-        //       uni.showToast({
-        //         title: '登录失败',
-        //         icon: 'none',
-        //       })
-        //     }
-        //   },
-        // })
-      },
-    })
-  }
-}
+onLoad(() => {})
 </script>
 
 <style lang="scss" scoped>
-//
-.con-top {
-  color: #f99304;
-  font-size: 56rpx;
+.containe {
+  font-size: 24rpx;
+  color: #333;
 }
-.h3 {
-  font-size: 36rpx;
+.top-content {
+  position: fixed;
+  top: 0;
+  right: 0;
+  left: 0;
+  z-index: -1;
+  height: 260rpx;
+  // border: 1px solid red;
+  color: #fbeed8;
+  text-align: center;
+  background: linear-gradient(to bottom, #f59e0b, #f6c986);
 }
-
-.btn {
-  color: #fff;
-  border-radius: 60rpx;
-  height: 80rpx;
-  line-height: 80rpx;
-  font-size: 16px;
-  margin: 30rpx auto;
-  font-family: PingFang SC;
+.user-box {
+  justify-content: space-between;
+  height: 160rpx;
+  // border: 4px solid #000;
+  .imgs {
+    width: 160rpx;
+    height: 160rpx;
+    margin-right: 20rpx;
+    background: #fff;
+    border: 1px solid #fff;
+    border-radius: 50%;
+  }
+  .user-text {
+    color: #fff;
+    text-align: left;
+  }
 }
-
-.user {
-  background-color: #eea441;
-  margin-bottom: 50rpx;
+.tool {
+  position: relative;
+  top: -60rpx;
+  margin-top: 400rpx;
+  font-size: 24rpx;
+  background: #fff;
+  border-radius: 28rpx;
+  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
 }
-.tel {
-  background-color: #2a9d8f;
+.title {
+  margin-bottom: 20rpx;
+  font-size: 32rpx;
 }
-.container {
-  // background-color: #fafafa;
-  height: 100vh;
+.icon {
+  width: 80rpx;
+  height: 80rpx;
 }
-.top-box {
-  // background-color: #fff;
-  background: linear-gradient(to bottom, #f6d7a7, #fff);
+.icons {
+  width: 50rpx;
+  height: 50rpx;
 }
-::v-deep .wd-radio-group.data-v-a6e3f5b0,
-.wd-radio-group {
-  background-color: transparent;
+.tool-item {
+  width: 22%;
+  padding: 10rpx 0;
+  margin-right: 14rpx;
+  margin-bottom: 10rpx;
+  // border: 1px solid red;
+  text-align: center;
 }
-::v-deep .title > .wd-radio__label {
-  font-size: 20rpx !important;
+.tool-box {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: left;
 }
-::v-deep .wd-button.is-success.data-v-aa3a6253 {
-  background-color: #2a9d8f !important;
+
+.user-tool {
+  justify-content: space-between;
+  height: 60rpx;
+  margin-bottom: 1rpx;
+  line-height: 60rpx;
+  background-color: #fff;
+  border-bottom: 1px dotted #f5f5f5;
 }
 </style>

+ 185 - 0
src/pages/regist/regist.vue

@@ -0,0 +1,185 @@
+<route lang="json5" type="page">
+{
+  style: {
+    navigationBarTitleText: '注册',
+  },
+}
+</route>
+
+<template>
+  <view class="text-center container">
+    <view class="px-5 pt-10 pb-20 top-box">
+      <image src="../../static/logo.png" mode="scaleToFill" class="logo" />
+      <view class="con-top">
+        <view class="h1 mb-6 mt-2">科湃腾肉牛系统</view>
+        <view class="h3 mb-10 pt-4">简化牧场管理,从这里开始!</view>
+      </view>
+
+      <wd-form ref="form" :model="model">
+        <wd-cell-group border>
+          <wd-input
+            label-width="160rpx"
+            prop="value1"
+            clearable
+            prefix-icon="user"
+            size="large"
+            v-model="model.value1"
+            placeholder="请输入用户名"
+          />
+          <wd-input
+            label-width="160rpx"
+            prop="value2"
+            size="large"
+            show-password
+            prefix-icon="lock-on"
+            clearable
+            v-model="model.value2"
+            placeholder="请输入密码"
+          />
+          <wd-input
+            label-width="160rpx"
+            prop="verificationCode"
+            prefix-icon="evaluation"
+            clearable
+            size="large"
+            type="number"
+            v-model="model.verificationCode"
+            placeholder="请输入邀请码"
+          />
+          <view class="flex justify-between mt-4 bot px-4">
+            <text @click="handlelogin">登录 ></text>
+            <text @click="handleForget">修改密码 ></text>
+          </view>
+        </wd-cell-group>
+
+        <view class="footer mt-8">
+          <wd-button type="primary" size="large" @click="handleSubmit" block>提 交</wd-button>
+        </view>
+      </wd-form>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+import { useMessage } from 'wot-design-uni'
+
+defineOptions({
+  name: 'Login',
+})
+
+const model = reactive<{
+  value1: string
+  value2: string
+  verificationCode: number | string
+}>({
+  value1: '',
+  value2: '',
+  verificationCode: '',
+})
+
+const form = ref()
+const message = useMessage()
+function handleSubmit() {
+  form.value
+    .validate()
+    .then(({ valid, errors }) => {
+      if (valid) {
+        message.show('校验通过')
+      }
+    })
+    .catch((error) => {
+      console.log(error, 'error')
+    })
+}
+
+function handlelogin() {
+  // uni.navigateTo({ url: '/pages/login/login' })
+  uni.switchTab({ url: '/pages/my/my' })
+}
+
+function handleForget() {
+  uni.navigateTo({ url: '/pages/forget/forget' })
+}
+</script>
+
+<style lang="scss" scoped>
+.bot {
+  font-size: 28rpx;
+  color: #bfbfbf;
+}
+.logo {
+  width: 140rpx;
+  height: 140rpx;
+  border-radius: 50%;
+}
+//
+.con-top {
+  font-family: 'Times New Roman', Times, serif;
+  font-size: 56rpx;
+  font-weight: 600;
+  color: #f99304;
+}
+.h3 {
+  padding-left: 10rpx;
+  // font-family: 'Times New Roman', Times, serif;
+  font-size: 36rpx;
+  // font-style: oblique 4deg;
+  font-weight: 300;
+}
+
+.btn {
+  height: 80rpx;
+  margin: 30rpx auto;
+  font-family: PingFang SC;
+  font-size: 16px;
+  line-height: 80rpx;
+  color: #fff;
+  border-radius: 60rpx;
+}
+
+.user {
+  margin-bottom: 50rpx;
+  background-color: #eea441;
+}
+.tel {
+  background-color: #2a9d8f;
+}
+.container {
+  // background-color: #fafafa;
+  height: 100vh;
+}
+.top-box {
+  // background-color: #fff;
+  // background: linear-gradient(to bottom, #f6d7a7, #fff);
+}
+::v-deep .wd-radio-group.data-v-a6e3f5b0,
+.wd-radio-group {
+  background-color: transparent;
+}
+::v-deep .title > .wd-radio__label {
+  font-size: 20rpx !important;
+}
+::v-deep .wd-button.is-success.data-v-aa3a6253 {
+  background-color: #2a9d8f !important;
+}
+::v-deep .wd-icon-user:before,
+.wd-icon-user[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+::v-deep .wd-icon-lock-on:before,
+.wd-icon-lock-on[data-v-7f3ba649]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+
+::v-deep .wd-icon-evaluation:before,
+.wd-icon-lock-on[data-v-d4a8410a]:before {
+  padding: 0 20rpx;
+  font-size: 46rpx;
+  color: #f99304;
+}
+</style>

+ 26 - 4
src/pages/serch/serch.vue

@@ -12,6 +12,7 @@
       v-model="serchObj.searchNum"
       light
       @cancel="doSearch"
+      @focus="showKeyBoard"
     />
     <view class="serch px-4 pt-4 flex">
       <text>历史搜索</text>
@@ -27,6 +28,12 @@
         {{ item }}
       </text>
     </view>
+    <!--  -->
+    <wd-number-keyboard
+      v-model:visible="visible"
+      @input="onInput"
+      @delete="onDelete"
+    ></wd-number-keyboard>
   </view>
 </template>
 
@@ -42,6 +49,21 @@ let serchObj = reactive({
   historyList: [],
 })
 
+const visible = ref<boolean>(false)
+
+function showKeyBoard() {
+  visible.value = true
+}
+function onDelete(value) {
+  console.log('删除', value)
+  serchObj.searchNum = serchObj.searchNum.slice(0, -1)
+}
+
+function onInput(value) {
+  console.log(value, serchObj.searchNum, '键盘数字')
+  serchObj.searchNum = `${serchObj.searchNum}${value}`
+}
+
 //用户搜索时将搜索文字存储
 function doSearch(searchStr) {
   const val = searchStr.value.trim()
@@ -81,15 +103,15 @@ onLoad(() => {
 <style lang="scss" scoped>
 //
 .serch {
-  color: #3a3a3a;
-  font-size: 36rpx;
   justify-content: space-between;
+  font-size: 36rpx;
+  color: #3a3a3a;
 }
 .item {
-  background-color: #eae8e8;
-  border-radius: 4rpx;
   display: inline-block;
   margin-right: 10rpx;
   font-size: 24rpx;
+  background-color: #eae8e8;
+  border-radius: 4rpx;
 }
 </style>

+ 63 - 0
src/pages/serviceText/serviceText.vue

@@ -0,0 +1,63 @@
+<route lang="json5" type="page">
+{
+  style: {
+    navigationBarTitleText: '服务条款',
+    // navigationBarBackgroundColor: '#f6d7a7',
+  },
+}
+</route>
+
+<template>
+  <view class="container">
+    <view class="top-box pt-4 pb-10 px-4">
+      <view class="title">一、 服务条款的确认</view>
+      1.
+      本协议内容包括协议正文及所有本网站已经发布的或将来可能发布的各类规则。所有规则为本协议不可分割的组成部分,与协议正文具有同等法律效力。除另行明确声明外,任何由我们及其关联公司提供的服务均受本协议约束。您确认:本协议条款是处理双方权利义务的契约,始终有效,法律另有强制性规定或双方另有特别约定的除外。
+      <br />
+
+      2.
+      您点击同意本协议的,即视为您确认自己具有享受本网站服务、下单购物等相应的权利能力和行为能力,能够独立承担法律责任。
+      <br />
+      3.
+      如果您在18周岁以下,建议您请您的监护人仔细阅读本协议,并在征得您的监护人同意的前提下使用本网站的服务或向本网站提供信息。若您在未征得您的监护人同意的情况下开展了与您民事行为能力不符的民事行为,则您及您的监护人应依照法律规定承担因此而导致的一切法律后果。
+      <br />
+      4.
+      我们保留在英国现行法律允许的范围内独自决定拒绝服务、关闭用户账户、清除或编辑内容、取消订单等权利。
+      <br />
+      <view class="title">二、 账户注册及使用</view>
+
+      1.
+      您应自行诚信向本网站提供真实、准确、完整、合法有效的注册资料,您的注册资料如有变动的,应及时更新。如果您提供的注册资料不合法、不真实、不准确、不详尽的,您需承担因此引起的相应责任及后果,并且我们保留终止您使用本网站各项服务的权利。
+      <br />
+      2.
+      您注册成功后,将产生用户名和密码等账户信息,您可以根据本网站规定改变您的密码。您应谨慎合理地保管、使用您的用户名和密码,并同意和承诺对在您的帐户下发生的所有活动承担责任。您不得以任何形式擅自转让或授权他人使用您在本网站的账户(含用户名及密码)。如您发现自己的个人信息泄密,尤其是您的账户信息(如用户名及密码)发生泄漏或存在安全漏洞,请您立即通知我们,以便我们采取相应措施,必要时您应主动向司法机关报案。
+      <br />
+      3.
+      您同意我们拥有通过邮件、短信、电话等形式,向您以及您确认的收货人发送订单信息、促销活动等信息的权利。如果我们以该等电子形式向您发出通知或消息,将视为您已收到了这些通知或消息。
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+import { useMessage } from 'wot-design-uni'
+
+defineOptions({
+  name: 'Login',
+})
+</script>
+
+<style lang="scss" scoped>
+.container {
+  padding: 0 10rpx;
+  margin: 20rpx auto;
+  background-color: #fff;
+  // border: 1px solid red;
+  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
+}
+
+.title {
+  font-weight: 600;
+  font-size: 32rpx;
+}
+</style>

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

@@ -1,11 +1,20 @@
 import { http } from '@/utils/http'
+import { platform } from '@/utils/platform'
 
+console.log(process.env.NODE_ENV, 'hss----11')
+let API = ''
+if (process.env.NODE_ENV == 'development' && platform == 'h5') {
+  API = '/api'
+} else {
+  API = ''
+}
 export interface IFooItem {
   username: string
   password: string
+  token?: string
 }
 
 /** POST 请求 */
-export const getAuth = (data) => {
-  return http.post<IFooItem>('/auth', data)
+export const getAuth = (data: IFooItem) => {
+  return http.post(`${API}/auth`, data)
 }

+ 4 - 4
src/service/index/foo.ts

@@ -19,7 +19,7 @@ export interface IFooItem {
   name: string
 }
 
-/** POST 请求 */
-export const getAuth = (data) => {
-  return http.post<IFooItem>('/auth', data)
-}
+// /** POST 请求 */
+// export const getAuth = (data) => {
+//   return http.post<IFooItem>('/auth', data)
+// }

BIN
src/static/images/other/测试1.png


+ 0 - 0
src/static/images/tool/意见反馈.png → src/static/images/tool/advice.png


+ 0 - 0
src/static/images/tool/修改密码.png → src/static/images/tool/editPsd.png


+ 0 - 0
src/static/images/tool/服务条款.png → src/static/images/tool/service.png


+ 0 - 0
src/static/images/tool/联系客服.png → src/static/images/tool/user.png


BIN
src/static/logo.png


+ 1 - 1
src/store/user.ts

@@ -1,7 +1,7 @@
 import { defineStore } from 'pinia'
 import { ref } from 'vue'
 
-const initState = { nickname: '', avatar: '' }
+const initState = { nickname: '', avatar: '', username: '', token: '', openId: '' }
 
 export const useUserStore = defineStore(
   'user',

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

@@ -4,16 +4,21 @@
 // Generated by vite-plugin-uni-pages
 
 interface NavigateToOptions {
-  url: "/pages/index/index" |
+  url: "/pages/my/my" |
+       "/pages/index/index" |
        "/pages/about/about" |
        "/pages/analyze/analyze" |
        "/pages/battleForm/battleForm" |
+       "/pages/editPassword/editPassword" |
+       "/pages/feedBack/feedBack" |
        "/pages/login/login" |
-       "/pages/my/my" |
        "/pages/notice/notice" |
        "/pages/phone/phone" |
+       "/pages/regist/regist" |
        "/pages/searchDetail/searchDetail" |
-       "/pages/serch/serch";
+       "/pages/serch/serch" |
+       "/pages/serviceText/serviceText" |
+       "/pages/login/component/weixin";
 }
 interface RedirectToOptions extends NavigateToOptions {}