commit c476affba40536eab11c087240608f91e03162aa
Author: ZhaoYang <565837861@qq.com>
Date: Thu Feb 26 18:23:35 2026 +0800
兽医端小程序,首页,分类,封装接口
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..35410ca
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..4987eca
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..639900d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..f5a49d9
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/wxamp-ymtxMerchant.iml b/.idea/wxamp-ymtxMerchant.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/wxamp-ymtxMerchant.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..1ed57c4
--- /dev/null
+++ b/app.js
@@ -0,0 +1,19 @@
+// app.js
+App({
+ onLaunch() {
+ // 展示本地存储能力
+ const logs = wx.getStorageSync('logs') || []
+ logs.unshift(Date.now())
+ wx.setStorageSync('logs', logs)
+
+ // 登录
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ }
+ })
+ },
+ globalData: {
+ userInfo: null
+ }
+})
diff --git a/app.json b/app.json
new file mode 100644
index 0000000..65c9d33
--- /dev/null
+++ b/app.json
@@ -0,0 +1,69 @@
+{
+ "pages": [
+ "pages/home/home",
+ "pages/login/login",
+ "pages/message/message",
+ "pages/personal/personal"
+ ],
+ "subPackages": [
+ {
+ "root": "pagesA",
+ "pages": [
+ "pages/askingSy/askingSy"
+ ]
+ },
+ {
+ "root": "pagesB",
+ "pages": [
+ "pages/repository/repository"
+ ],
+ "independent": true
+ }
+ ],
+
+ "tabBar": {
+ "color": "#2E2E2E",
+ "selectedColor": "#50C1BA",
+ "borderStyle": "black",
+ "list": [
+ {
+ "pagePath": "pages/home/home",
+ "text": "首页",
+ "iconPath": "pages/images/home.png",
+ "selectedIconPath": "pages/images/home1.png"
+ },
+ {
+ "pagePath": "pages/message/message",
+ "text": "消息",
+ "iconPath": "pages/images/xx.png",
+ "selectedIconPath": "pages/images/xx1.png"
+ },
+ {
+ "pagePath": "pages/personal/personal",
+ "text": "我的",
+ "iconPath": "pages/images/wd.png",
+ "selectedIconPath": "pages/images/wd1.png"
+ }
+ ]
+ },
+
+ "window": {
+ "backgroundColor": "#86D8D0",
+ "navigationBarBackgroundColor": "#86D8D0",
+ "navigationBarTextStyle": "white"
+ },
+ "renderer": "webview",
+ "rendererOptions": {
+ "skyline": {
+ "defaultDisplayBlock": true,
+ "defaultContentBox": true,
+ "tagNameStyleIsolation": "legacy",
+ "disableABTest": true,
+ "sdkVersionBegin": "3.0.0",
+ "sdkVersionEnd": "15.255.255"
+ }
+ },
+ "componentFramework": "glass-easel",
+ "sitemapLocation": "sitemap.json",
+ "lazyCodeLoading": "requiredComponents"
+}
diff --git a/app.wxss b/app.wxss
new file mode 100644
index 0000000..ae5ffaa
--- /dev/null
+++ b/app.wxss
@@ -0,0 +1,15 @@
+@import'/utils/font.wxss';
+
+.container {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+ padding: 200rpx 0;
+ box-sizing: border-box;
+}
+
+page {
+ font-family: '思源宋体 Light' !important;
+}
\ No newline at end of file
diff --git a/components/navigation-bar/navigation-bar.js b/components/navigation-bar/navigation-bar.js
new file mode 100644
index 0000000..e93f90f
--- /dev/null
+++ b/components/navigation-bar/navigation-bar.js
@@ -0,0 +1,105 @@
+Component({
+ options: {
+ multipleSlots: true // 在组件定义时的选项中启用多slot支持
+ },
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ extClass: {
+ type: String,
+ value: ''
+ },
+ title: {
+ type: String,
+ value: ''
+ },
+ background: {
+ type: String,
+ value: ''
+ },
+ color: {
+ type: String,
+ value: ''
+ },
+ back: {
+ type: Boolean,
+ value: true
+ },
+ loading: {
+ type: Boolean,
+ value: false
+ },
+ homeButton: {
+ type: Boolean,
+ value: false,
+ },
+ animated: {
+ // 显示隐藏的时候opacity动画效果
+ type: Boolean,
+ value: true
+ },
+ show: {
+ // 显示隐藏导航,隐藏的时候navigation-bar的高度占位还在
+ type: Boolean,
+ value: true,
+ observer: '_showChange'
+ },
+ // back为true的时候,返回的页面深度
+ delta: {
+ type: Number,
+ value: 1
+ },
+ },
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ displayStyle: ''
+ },
+ lifetimes: {
+ attached() {
+ const rect = wx.getMenuButtonBoundingClientRect()
+ wx.getSystemInfo({
+ success: (res) => {
+ const isAndroid = res.platform === 'android'
+ const isDevtools = res.platform === 'devtools'
+ this.setData({
+ ios: !isAndroid,
+ innerPaddingRight: `padding-right: ${res.windowWidth - rect.left}px`,
+ leftWidth: `width: ${res.windowWidth - rect.left }px`,
+ safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${res.safeArea.top}px); padding-top: ${res.safeArea.top}px` : ``
+ })
+ }
+ })
+ },
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ _showChange(show) {
+ const animated = this.data.animated
+ let displayStyle = ''
+ if (animated) {
+ displayStyle = `opacity: ${
+ show ? '1' : '0'
+ };transition:opacity 0.5s;`
+ } else {
+ displayStyle = `display: ${show ? '' : 'none'}`
+ }
+ this.setData({
+ displayStyle
+ })
+ },
+ back() {
+ const data = this.data
+ if (data.delta) {
+ wx.navigateBack({
+ delta: data.delta
+ })
+ }
+ this.triggerEvent('back', { delta: data.delta }, {})
+ }
+ },
+})
diff --git a/components/navigation-bar/navigation-bar.json b/components/navigation-bar/navigation-bar.json
new file mode 100644
index 0000000..4a20f17
--- /dev/null
+++ b/components/navigation-bar/navigation-bar.json
@@ -0,0 +1,5 @@
+{
+ "component": true,
+ "styleIsolation": "apply-shared",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/navigation-bar/navigation-bar.wxml b/components/navigation-bar/navigation-bar.wxml
new file mode 100644
index 0000000..be9a663
--- /dev/null
+++ b/components/navigation-bar/navigation-bar.wxml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/navigation-bar/navigation-bar.wxss b/components/navigation-bar/navigation-bar.wxss
new file mode 100644
index 0000000..8bd379e
--- /dev/null
+++ b/components/navigation-bar/navigation-bar.wxss
@@ -0,0 +1,96 @@
+.weui-navigation-bar {
+ --weui-FG-0:rgba(0,0,0,.9);
+ --height: 44px;
+ --left: 16px;
+}
+.weui-navigation-bar .android {
+ --height: 48px;
+}
+
+.weui-navigation-bar {
+ overflow: hidden;
+ color: var(--weui-FG-0);
+ flex: none;
+}
+
+.weui-navigation-bar__inner {
+ position: relative;
+ top: 0;
+ left: 0;
+ height: calc(var(--height) + env(safe-area-inset-top));
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+ padding-top: env(safe-area-inset-top);
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.weui-navigation-bar__left {
+ position: relative;
+ padding-left: var(--left);
+ display: flex;
+ flex-direction: row;
+ align-items: flex-start;
+ height: 100%;
+ box-sizing: border-box;
+}
+
+.weui-navigation-bar__btn_goback_wrapper {
+ padding: 11px 18px 11px 16px;
+ margin: -11px -18px -11px -16px;
+}
+
+.weui-navigation-bar__btn_goback_wrapper.weui-active {
+ opacity: 0.5;
+}
+
+.weui-navigation-bar__btn_goback {
+ font-size: 12px;
+ width: 12px;
+ height: 24px;
+ -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
+ background-color: var(--weui-FG-0);
+}
+
+.weui-navigation-bar__center {
+ font-size: 17px;
+ text-align: center;
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+ font-weight: bold;
+ flex: 1;
+ height: 100%;
+}
+
+.weui-navigation-bar__loading {
+ margin-right: 4px;
+ align-items: center;
+}
+
+.weui-loading {
+ font-size: 16px;
+ width: 16px;
+ height: 16px;
+ display: block;
+ background: transparent url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='80px' height='80px' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A") no-repeat;
+ background-size: 100%;
+ margin-left: 0;
+ animation: loading linear infinite 1s;
+}
+
+@keyframes loading {
+ from {
+ transform: rotate(0);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
diff --git a/pages/home/home.js b/pages/home/home.js
new file mode 100644
index 0000000..900b722
--- /dev/null
+++ b/pages/home/home.js
@@ -0,0 +1,301 @@
+import http from '../../utils/api'
+const baseUrl = require('../../utils/baseUrl')
+Page({
+ data: {
+ // 轮播图数据
+ currentSwiper: 0,
+ baseUrl: baseUrl,
+ swiperList: [],
+ articleList:[
+ {title:'文章发布',describe:'快速发布养殖知识',icon:'/pages/images/fkjy.png'},
+ {title:'在线学习',describe:'视频培训发布',icon:'/pages/images/tx.png'}
+ ],
+ // 通知公告数据
+ currentNotice: 0,
+ noticeList: [],
+ forum: [],
+ suffer: [],
+ // 添加用户数据
+ user: {},
+ county: ''
+ },
+
+ // 查询用户信息
+ getUserInfo() {
+ http.UserInfo({
+ data: {},
+ success: res => {
+ console.log(111,res);
+ this.setData({
+ user: res.data.user.area
+ })
+ }
+ })
+ },
+
+ // 在线问答列表
+ getforumList() {
+ http.forumList({
+ data: {},
+ success: res => {
+ const zxwd = []
+ zxwd.push(res.rows[0])
+ this.setData({
+ forum: zxwd
+ })
+ }
+ })
+ },
+
+ // 经验分享列表
+ getexperience() {
+ http.experience({
+ data: {},
+ success: res => {
+ const zyfx = []
+ zyfx.push(res.rows[0])
+ this.setData({
+ suffer: zyfx
+ })
+ }
+ })
+ },
+
+ // 轮播
+ getCarousel() {
+ http.carousel({
+ data: {},
+ success: res => {
+ this.setData({
+ swiperList: res.rows
+ })
+ }
+ })
+ },
+
+ // 灾害/通知公告
+ getDisaster() {
+ http.disaster({
+ data: {},
+ success: res => {
+ // 处理通知数据,添加时间戳
+ const notices = res.rows.map(item => {
+ return {
+ ...item,
+ // // 判断是否是24小时内的通知
+ // isNew: this.isNewNotification(item.createdTime)
+ }
+ })
+ this.setData({
+ noticeList: notices
+ })
+ }
+ })
+ },
+
+ // // 判断通知是否在24小时内
+ // isNewNotification(createdTime) {
+ // if (!createdTime) return false
+ // const noticeTime = new Date(createdTime.replace(/-/g, '/')).getTime()
+ // const now = new Date().getTime()
+ // const twentyFourHours = 24 * 60 * 60 * 1000
+ // return now - noticeTime < twentyFourHours
+ // },
+
+ // 区域划分跳转
+ bindXzqh() {
+ wx.navigateTo({
+ url: '/pagesB/pages/administrativeDivision/administrativeDivision',
+ })
+ },
+
+ // AI问诊
+ bindAI() {
+ wx.navigateTo({
+ url: '/pagesA/pages/wzai/wzai',
+ })
+ },
+
+ // 问兽医
+ bindWsy() {
+ wx.navigateTo({
+ url: '/pagesA/pages/askingSy/askingSy',
+ })
+ },
+
+ // 找专家
+ bindZj() {
+ wx.navigateTo({
+ url: '/pagesA/pages/expert/expert',
+ })
+ },
+
+ // 去买药
+ bindYao() {
+ wx.navigateTo({
+ url: '/pagesA/pages/medicine/medicine',
+ })
+ },
+
+
+ // 问答列表
+ bindwdlist() {
+ wx.navigateTo({
+ url: '/pagesB/pages/forumlist/forumlist',
+ })
+ },
+
+ // 问答详情
+ bindTw(e) {
+ console.log(e);
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `/pagesB/pages/onlineAsk/onlineAsk?id=${id}`,
+ })
+ },
+
+ // 经验分享列表
+ viewexperience() {
+ wx.navigateTo({
+ url: '/pagesB/pages/experienceList/experienceList',
+ })
+ },
+
+ // 经验分享详情
+ bindfx(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `/pagesB/pages/experienceDetails/experienceDetails?id=${id}`,
+ })
+ },
+
+
+
+ // 查看所有问题
+ viewAllQuestions() {
+ this.bindwdlist()
+ },
+
+ // 获取当前位置信息
+ getLocation() {
+ let that = this;
+ // 腾讯获取的密钥
+ let key = 'AOBBZ-6LUK7-WXGXX-HJUXS-HHUM5-FWFPJ'
+ wx.getLocation({
+ isHighAccuracy: true,
+ type: 'gcj02',
+ success: function (res) {
+ let latitude = res.latitude;
+ let longitude = res.longitude;
+ wx.request({
+ url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=${key}`,
+ success: res => {
+ that.setData({
+ county: res.data.result.address_component.district //城市
+ });
+ }
+ })
+ }
+ })
+ },
+
+ onLoad() {
+ this.getDisaster()
+ this.getCarousel()
+ this.getLocation()
+ this.getforumList()
+ this.getexperience()
+ },
+
+ onShow() {
+ this.resetSwiper()
+ this.getUserInfo()
+ },
+
+ // 重置轮播图(解决轮播不自动播放的问题)
+ resetSwiper() {
+ setTimeout(() => {
+ if (this.data.swiperList.length > 0) {
+ this.setData({
+ currentSwiper: this.data.currentSwiper
+ })
+ }
+ }, 300)
+ },
+
+ // 轮播图变化事件
+ onSwiperChange(e) {
+ const current = e.detail.current;
+ this.setData({
+ currentSwiper: current
+ });
+ },
+
+ // 轮播图指示器点击
+ onIndicatorTap(e) {
+ const index = e.currentTarget.dataset.index;
+ this.setData({
+ currentSwiper: index
+ });
+ },
+
+
+ // 轮播图点击
+ onSwiperTap(e) {
+ console.log(1111, e);
+ var id = e.currentTarget.dataset.value.carouselId
+ wx.navigateTo({
+ url: `/pagesA/pages/carouselDetail/carouselDetail?id=${id}`,
+ })
+ },
+
+
+ onReady() {
+ // 当前网络状态
+ wx.getNetworkType({
+ success: function (res) {
+ // 返回网络类型, 有效值:
+ // wifi/2g/3g/4g/unknown(Android下不常见的网络类型)/none(无网络)
+ console.log(res);
+ var networkType = res.networkType
+ if (networkType !== 'unknown') {
+ wx.showToast({
+ title: '当前使用"' + networkType + '"网络',
+ icon: 'none',
+ duration: 1000
+ })
+ }
+ }
+ })
+ },
+
+ // 下拉刷新
+ onPullDownRefresh() {
+ wx.showNavigationBarLoading()
+
+ // 重新加载所有数据
+ Promise.all([
+ new Promise(resolve => this.getUserInfo(resolve)),
+ new Promise(resolve => this.getDisaster(resolve)),
+ new Promise(resolve => this.getCarousel(resolve)),
+ new Promise(resolve => this.getforumList(resolve)),
+ new Promise(resolve => this.getexperience(resolve))
+ ]).then(() => {
+ wx.showToast({
+ title: '刷新成功',
+ icon: 'none',
+ duration: 1000
+ })
+ wx.hideNavigationBarLoading()
+ wx.stopPullDownRefresh()
+ }).catch(() => {
+ wx.hideNavigationBarLoading()
+ wx.stopPullDownRefresh()
+ })
+ },
+
+ // 页面滚动
+ onPageScroll(e) {
+ // 可以根据需要添加滚动效果
+ }
+});
\ No newline at end of file
diff --git a/pages/home/home.json b/pages/home/home.json
new file mode 100644
index 0000000..ead5209
--- /dev/null
+++ b/pages/home/home.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText":"与牧同行",
+ "enablePullDownRefresh": true,
+ "backgroundTextStyle": "dark",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/home/home.wxml b/pages/home/home.wxml
new file mode 100644
index 0000000..e5f58ab
--- /dev/null
+++ b/pages/home/home.wxml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{user.name || '去选择'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.adsType}}
+ {{item.title}}
+ {{item.subtitle}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 接受咨询
+ 回复问诊单信息
+ 快捷回复
+
+
+
+ 远程诊疗
+ 足不出户方便快捷
+
+
+ 方案制定
+ 制定专业的治疗方案
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+ {{item.describe}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
+ {{item.nickName}}
+
+
+
+ {{item.createdAt}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
+ {{item.vetName}}
+
+
+
+ {{item.publishTime}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/home/home.wxss b/pages/home/home.wxss
new file mode 100644
index 0000000..1f1675d
--- /dev/null
+++ b/pages/home/home.wxss
@@ -0,0 +1,501 @@
+/* 页面容器 */
+.home-container {
+ width: 100%;
+ min-height: 100vh;
+ background: linear-gradient(180deg, #86D8D0 0%, #a9dfda 30%, #cfe9e7 60%, #ECF8F7 90%);
+ padding-top: env(safe-area-inset-top);
+ }
+
+ /* 主要内容区域 */
+ .box {
+ width: 93%;
+ margin: 0 auto;
+ padding-bottom: 40rpx;
+ }
+
+ /* AI问诊 */
+ .Aidiagnosis {
+ position: fixed;
+ right: 0;
+ bottom: 150px;
+ margin: 0 auto;
+ z-index: 100;
+ }
+
+ .Aidiagnosis image {
+ width: 120rpx;
+ height: 120rpx;
+ border-radius: 50%;
+ }
+
+ .orientation{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 10rpx;
+ }
+
+ /* 定位 */
+ .orientation2 {
+ display: flex;
+ align-items: center;
+ padding: 20rpx 0;
+ color: #fff;
+ font-weight: bold;
+ font-size: 26rpx;
+ }
+
+ .orientation image {
+ width: 40rpx;
+ height: 40rpx;
+ margin-right: 10rpx;
+ }
+
+ .orientation3{
+ display: flex;
+ align-items: center;
+ color: #fff;
+ }
+
+ /* 轮播图区域 - 已修复 */
+ .swiper-container {
+ position: relative;
+ border-radius: 20rpx;
+ overflow: hidden;
+ box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.1);
+ animation: scaleIn 0.6s ease-out 0.4s both;
+ }
+
+ @keyframes scaleIn {
+ from {
+ opacity: 0;
+ transform: scale(0.95);
+ }
+
+ to {
+ opacity: 1;
+ transform: scale(1);
+ }
+ }
+
+ .custom-swiper {
+ border-radius: 20rpx;
+ }
+
+ .swiper-item {
+ position: relative;
+ height: 360rpx;
+ overflow: hidden;
+ border-radius: 20rpx;
+ transition: transform 0.5s ease;
+ }
+
+ .swiper-item.active {
+ transform: scale(1.02);
+ }
+
+ .swiper-image {
+ width: 100%;
+ height: 100%;
+ transition: transform 8s ease;
+ }
+
+ .swiper-mask {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.3), transparent 50%);
+ }
+
+ .swiper-content {
+ position: absolute;
+ bottom: 60rpx;
+ left: 40rpx;
+ z-index: 2;
+ max-width: 60%;
+ }
+
+ .swiper-tag {
+ display: inline-block;
+ padding: 6rpx 20rpx;
+ background: rgba(76, 175, 80, 0.9);
+ color: white;
+ font-size: 20rpx;
+ border-radius: 20rpx;
+ margin-bottom: 16rpx;
+ backdrop-filter: blur(10rpx);
+ }
+
+ .swiper-title {
+ display: block;
+ font-size: 36rpx;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin-bottom: 8rpx;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
+ line-height: 1.4;
+ }
+
+ .swiper-desc {
+ display: block;
+ font-size: 24rpx;
+ color: rgba(255, 255, 255, 0.9);
+ text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.2);
+ }
+
+ .swiper-gradient {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 120rpx;
+ background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
+ }
+
+ .custom-indicator {
+ position: absolute;
+ bottom: 30rpx;
+ right: 30rpx;
+ display: flex;
+ align-items: center;
+ z-index: 3;
+ }
+
+ .indicator-dot {
+ width: 12rpx;
+ height: 12rpx;
+ border-radius: 50%;
+ background: rgba(255, 255, 255, 0.5);
+ margin: 0 6rpx;
+ transition: all 0.3s ease;
+ }
+
+ .indicator-dot.active {
+ width: 40rpx;
+ background: #96DBD4;
+ border-radius: 6rpx;
+ }
+
+ /* 卡片类型 */
+ .kap {
+ animation: kapIn 0.5s ease-out 0.5s both;
+ }
+
+ @keyframes kapIn {
+ from {
+ opacity: 0;
+ }
+
+ to {
+ opacity: 1;
+ }
+ }
+
+ .card {
+ width: 100%;
+ display: grid;
+ grid-template-columns: 1.1fr 2fr;
+ column-gap: 20rpx;
+ margin: 20rpx 0;
+ }
+
+ .card2 {
+ background-color: #F8918C;
+ border-radius: 25rpx;
+ padding: 30rpx 20rpx 120rpx;
+ }
+
+ .card2 view:nth-child(1) {
+ font-size: 38rpx;
+ color: #fff;
+ font-weight: bold;
+ letter-spacing: 0.1em;
+ }
+
+ .card2_1 {
+ margin: 10rpx 0;
+ font-size: 26rpx;
+ color: #FDE8E1;
+ }
+
+ .card3 {
+ display: grid;
+ grid-template-rows: 1fr 1fr;
+ row-gap: 20rpx;
+ }
+
+ .card3>view {
+ border-radius: 25rpx;
+ padding: 0 0 0 20rpx;
+ }
+
+ .card3_1 {
+ background-color: #5EBEB8;
+ }
+
+ .card3_1 view:last-child {
+ color: #D9F0EE;
+ }
+
+ .card3_2 {
+ background-color: #E9B770;
+ }
+
+ .card3_2 view:last-child {
+ color: #F4E8DB;
+ }
+
+ .card3_kp view:first-child {
+ font-size: 38rpx;
+ color: #fff;
+ margin: 30rpx 0 10rpx 0;
+ }
+
+ .card3_kp view:last-child {
+ font-size: 26rpx;
+ }
+
+
+ /* 文章发布-视频培训 */
+ .article1_1{
+ width:100%;
+ box-sizing: border-box;
+ background-color: #fff;
+ border-radius: 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 10rpx 30rpx;
+ margin-top: 30rpx;
+ }
+ .article2 view:first-child{
+ font-weight: bold;
+ }
+ .article2 view:last-child{
+ color: #C5C6CC;
+ font-size: 24rpx;
+ margin-top: 10rpx;
+ }
+ .article3 image{
+ width: 100rpx;
+ }
+
+
+ /* 用户提问板块 */
+ .user-question-section {
+ background: #FFFFFF;
+ border-radius: 24rpx;
+ padding: 32rpx;
+ margin: 40rpx 0 20rpx;
+ box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.06);
+ animation: slideUp 0.8s ease-out 0.8s both;
+ }
+
+ @keyframes slideUp {
+ from {
+ opacity: 0;
+ transform: translateY(60rpx);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ /* 标题区域 */
+ .question-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 40rpx;
+ padding-bottom: 24rpx;
+ border-bottom: 1px solid rgba(150, 219, 212, 0.3);
+ }
+
+ .question-title {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .title-text {
+ font-size: 38rpx;
+ font-weight: bold;
+ color: #7ad1cb;
+ margin-bottom: 8rpx;
+ position: relative;
+ padding-left: 20rpx;
+ }
+
+ .title-text::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 50%;
+ transform: translateY(-50%);
+ width: 8rpx;
+ height: 32rpx;
+ background: #60C0B9;
+ border-radius: 4rpx;
+ }
+
+ .title-text1_1 {
+ font-size: 38rpx;
+ font-weight: bold;
+ color: #7499C8;
+ margin-bottom: 8rpx;
+ position: relative;
+ padding-left: 20rpx;
+ }
+
+ .title-text1_1::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 50%;
+ transform: translateY(-50%);
+ width: 8rpx;
+ height: 32rpx;
+ background: #79b2d3;
+ border-radius: 4rpx;
+ }
+
+ .title-sub {
+ font-size: 24rpx;
+ color: #999;
+ padding-left: 20rpx;
+ }
+
+ .view-all {
+ display: flex;
+ align-items: center;
+ font-size: 26rpx;
+ color: #60C0B9;
+ padding: 12rpx 24rpx;
+ background: rgba(96, 192, 185, 0.1);
+ border-radius: 30rpx;
+ transition: all 0.3s ease;
+ }
+
+ .view-all:active {
+ background: rgba(96, 192, 185, 0.2);
+ transform: scale(0.98);
+ }
+
+ .view-all1_1{
+ display: flex;
+ align-items: center;
+ font-size: 26rpx;
+ color: #608ac0;
+ padding: 12rpx 24rpx;
+ background: rgba(96, 192, 185, 0.1);
+ border-radius: 30rpx;
+ transition: all 0.3s ease;
+ }
+
+ .view-all1_1:active {
+ background: rgba(131, 158, 199, 0.2);
+ transform: scale(0.98);
+ }
+
+ /* 问题元信息 */
+ .question-meta {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: 28rpx;
+ }
+
+ .question-tag {
+ flex: 1;
+ display: flex;
+ align-items: flex-start;
+ gap: 12rpx;
+ }
+
+ .tag-text {
+ font-size: 30rpx;
+ color: #333;
+ line-height: 1.5;
+ font-weight: 500;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ }
+
+ /* 用户信息 */
+ .question-info {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 28rpx;
+ padding-bottom: 20rpx;
+ border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
+ }
+
+ .user-info {
+ display: flex;
+ align-items: center;
+ gap: 16rpx;
+ }
+
+ .user-avatar {
+ width: 64rpx;
+ height: 64rpx;
+ border-radius: 50%;
+ background: #E0F2F1;
+ border: 2rpx solid #60C0B9;
+ }
+
+ .user-detail {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .user-name {
+ font-size: 26rpx;
+ font-weight: 500;
+ color: #333;
+ margin-bottom: 6rpx;
+ }
+
+ .time-info {
+ font-size: 22rpx;
+ color: #999;
+ background: rgba(0, 0, 0, 0.04);
+ padding: 6rpx 16rpx;
+ border-radius: 16rpx;
+ }
+
+ .post-footer {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ }
+
+ .post-meta {
+ display: flex;
+ align-items: center;
+ gap: 25rpx;
+ }
+
+ .meta-item {
+ display: flex;
+ align-items: center;
+ gap: 8rpx;
+ }
+
+ .meta-icon {
+ width: 28rpx;
+ height: 28rpx;
+ opacity: 0.5;
+ }
+
+ .meta-count {
+ font-size: 26rpx;
+ font-weight: 600;
+ color: #64748b;
+ }
\ No newline at end of file
diff --git a/pages/images/EZSx3exf4cjI.woff b/pages/images/EZSx3exf4cjI.woff
new file mode 100644
index 0000000..a044948
Binary files /dev/null and b/pages/images/EZSx3exf4cjI.woff differ
diff --git a/pages/images/EZSx3exf4cjI.woff2 b/pages/images/EZSx3exf4cjI.woff2
new file mode 100644
index 0000000..778e3e9
Binary files /dev/null and b/pages/images/EZSx3exf4cjI.woff2 differ
diff --git a/pages/images/dw.png b/pages/images/dw.png
new file mode 100644
index 0000000..6d50af6
Binary files /dev/null and b/pages/images/dw.png differ
diff --git a/pages/images/fkjy.png b/pages/images/fkjy.png
new file mode 100644
index 0000000..f2743b0
Binary files /dev/null and b/pages/images/fkjy.png differ
diff --git a/pages/images/home.png b/pages/images/home.png
new file mode 100644
index 0000000..30f306e
Binary files /dev/null and b/pages/images/home.png differ
diff --git a/pages/images/home1.png b/pages/images/home1.png
new file mode 100644
index 0000000..f827aa1
Binary files /dev/null and b/pages/images/home1.png differ
diff --git a/pages/images/logout.png b/pages/images/logout.png
new file mode 100644
index 0000000..c84488c
Binary files /dev/null and b/pages/images/logout.png differ
diff --git a/pages/images/smrz.png b/pages/images/smrz.png
new file mode 100644
index 0000000..eec18d1
Binary files /dev/null and b/pages/images/smrz.png differ
diff --git a/pages/images/tx.png b/pages/images/tx.png
new file mode 100644
index 0000000..29ee3b1
Binary files /dev/null and b/pages/images/tx.png differ
diff --git a/pages/images/wd.png b/pages/images/wd.png
new file mode 100644
index 0000000..21efdc6
Binary files /dev/null and b/pages/images/wd.png differ
diff --git a/pages/images/wd1.png b/pages/images/wd1.png
new file mode 100644
index 0000000..ab91dfd
Binary files /dev/null and b/pages/images/wd1.png differ
diff --git a/pages/images/xx.png b/pages/images/xx.png
new file mode 100644
index 0000000..62d55b9
Binary files /dev/null and b/pages/images/xx.png differ
diff --git a/pages/images/xx1.png b/pages/images/xx1.png
new file mode 100644
index 0000000..3aea74a
Binary files /dev/null and b/pages/images/xx1.png differ
diff --git a/pages/login/login.js b/pages/login/login.js
new file mode 100644
index 0000000..3b8de5f
--- /dev/null
+++ b/pages/login/login.js
@@ -0,0 +1,199 @@
+import http from '../../utils/api'
+Page({
+ data: {
+ isAgree: true, // 是否同意协议
+ showAgreementModal: false, // 是否显示协议弹窗
+ modalTitle: '', // 弹窗标题
+ modalContent: '', // 弹窗内容
+ isLoading: false, // 是否显示加载中,
+ phoneData: {},
+ },
+
+ onLoad() {
+ this.login()
+ },
+
+
+ // 登录获取
+ login() {
+ // 小程序接口
+ var that = this
+ wx.login({
+ success(res) {
+ //登录接口
+ http.login({
+ data: {
+ code: res.code,
+ clientType: 'vet-app'
+ },
+ success: function (res) {
+ console.log(111111,res);
+ if (res.data) {
+ that.setData({
+ phoneData: res.data
+ })
+ wx.showToast({
+ title: res.data.message,
+ icon: 'none',
+ duration: 2000
+ });
+ }
+
+ if (res.data.token) {
+ wx.setStorageSync('token', res.data.token)
+ wx.switchTab({
+ url: '/pages/home/home'
+ });
+ }
+ },
+
+ })
+ },
+ fail: (error) => {
+ console.log('登录失败!' + error);
+ }
+ })
+ },
+
+
+
+ // 获取用户手机号
+ getPhoneNumber(e) {
+ if (!this.data.isAgree) {
+ wx.showToast({
+ title: '请先同意协议',
+ icon: 'none',
+ duration: 2000
+ });
+ return;
+ }
+
+ // 显示加载中
+ this.setData({
+ isLoading: true
+ });
+
+ // 检查是否获取到手机号
+ if (e.detail.errMsg === "getPhoneNumber:ok") {
+ // 这里应该将加密数据发送到后端进行解密
+ this.data.phoneData.encryptedData = e.detail.encryptedData
+ this.data.phoneData.iv = e.detail.iv
+ http.getPhoneNumber({
+ data: this.data.phoneData,
+ success: res => {
+ if (res.code == 200) {
+ wx.setStorageSync('token', res.token)
+
+ setTimeout(() => {
+ wx.switchTab({
+ url: '/pages/home/home'
+ });
+ }, 1500);
+
+ this.setData({
+ isLoading: false
+ })
+ wx.showToast({
+ title: '登录成功',
+ icon: 'success',
+ duration: 2000
+ });
+ }else{
+ wx.showToast({
+ title: res.msg,
+ icon: 'none',
+ duration: 2000
+ });
+ this.setData({
+ isLoading:false
+ })
+ }
+ }
+ })
+ } else {
+ // 用户拒绝授权
+ this.setData({
+ isLoading: false
+ });
+
+ wx.showToast({
+ title: '需要手机号授权才能登录',
+ icon: 'none',
+ duration: 2000
+ });
+ }
+ },
+
+ // 切换协议同意状态
+ toggleAgreement() {
+ this.setData({
+ isAgree: !this.data.isAgree
+ });
+ },
+
+ // 显示用户协议
+ showAgreement() {
+ const content = `欢迎您使用与牧同行服务!
+一、服务说明
+与牧同行为您提供智慧放牧管理、牲畜追踪、草场监测等服务。通过我们的平台,您可以更高效地管理牧场资源,提升放牧效率。
+二、账号注册
+1. 您需要使用手机号完成注册
+2. 您应保证提供的信息真实、准确、完整
+3. 您对账号安全负全部责任
+三、使用规范
+1. 不得利用本服务从事任何违法违规活动
+2. 不得干扰或破坏本服务的正常运行
+3. 遵守相关法律法规和平台规则
+四、服务变更与终止
+我们可能根据需要变更服务内容,如您不同意变更,可停止使用本服务。
+五、免责声明
+对于不可抗力、网络问题等导致的服务中断,我们不承担相应责任。
+六、法律适用
+本协议受中华人民共和国法律管辖。
+感谢您选择与牧同行!`;
+
+ this.setData({
+ showAgreementModal: true,
+ modalTitle: '用户协议',
+ modalContent: content
+ });
+ },
+
+ // 显示隐私政策
+ showPrivacy() {
+ const content = `与牧同行隐私政策
+我们深知个人信息对您的重要性,并会尽全力保护您的个人信息安全可靠。我们致力于维持您对我们的信任,恪守以下原则保护您的个人信息:权责一致原则、目的明确原则、选择同意原则、最少够用原则、确保安全原则、主体参与原则、公开透明原则等。
+一、我们如何收集和使用您的个人信息
+我们仅会出于本政策所述的以下目的,收集和使用您的个人信息:
+1. 账号注册:手机号
+2. 服务提供:位置信息、设备信息
+3. 安全保障:登录日志、操作记录
+二、我们如何共享、转让、公开披露您的个人信息
+1. 我们不会与任何公司、组织和个人共享您的个人信息
+2. 我们不会将您的个人信息转让给任何公司、组织和个人
+3. 我们仅会在法律要求的情况下公开披露您的个人信息
+三、我们如何保护您的个人信息
+1. 我们已使用符合业界标准的安全防护措施保护您提供的个人信息
+2. 我们会采取合理可行的措施,确保未收集无关的个人信息
+四、您的权利
+您有权访问、更正、删除您的个人信息,以及改变您授权同意的范围或撤回授权。
+五、我们如何处理儿童的个人信息
+我们的服务主要面向成人。如果没有父母或监护人的同意,儿童不应创建自己的个人信息主体账户。
+六、本政策如何更新
+我们可能适时修订本政策内容,并通过公告等方式通知您。
+如有任何疑问,请通过客服渠道联系我们。`;
+
+ this.setData({
+ showAgreementModal: true,
+ modalTitle: '隐私政策',
+ modalContent: content
+ });
+ },
+
+ // 隐藏弹窗
+ hideModal() {
+ this.setData({
+ showAgreementModal: false
+ });
+ }
+})
\ No newline at end of file
diff --git a/pages/login/login.json b/pages/login/login.json
new file mode 100644
index 0000000..eb96e05
--- /dev/null
+++ b/pages/login/login.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText":"登录",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/login/login.wxml b/pages/login/login.wxml
new file mode 100644
index 0000000..10336ad
--- /dev/null
+++ b/pages/login/login.wxml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 牧
+
+
+
+ 与牧同行
+
+
+
+
+
+ 欢迎回来
+ 请使用手机号快捷登录
+
+
+
+
+
+
+
+
+ ✓
+
+
+ 我已阅读并同意
+ 《用户协议》
+ 和
+ 《隐私政策》
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{modalContent}}
+
+
+
+
+
+
+
+
+ 登录中...
+
+
+
\ No newline at end of file
diff --git a/pages/login/login.wxss b/pages/login/login.wxss
new file mode 100644
index 0000000..0e8bf36
--- /dev/null
+++ b/pages/login/login.wxss
@@ -0,0 +1,506 @@
+/* pages/login/login.wxss */
+
+.login-container {
+ height: 100vh;
+ width: 100%;
+ position: relative;
+ overflow: hidden;
+ background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 100%);
+}
+
+/* 波浪背景 */
+.wave-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 400rpx;
+ overflow: hidden;
+}
+
+.wave {
+ position: absolute;
+ bottom: 0;
+ width: 200%;
+ height: 100%;
+ background: linear-gradient(90deg, #86D8D0 0%, #A8E6CF 100%);
+ border-radius: 0 0 50% 50%;
+ animation: waveMove 15s linear infinite;
+}
+
+.wave-1 {
+ opacity: 0.7;
+ animation-delay: 0s;
+}
+
+.wave-2 {
+ opacity: 0.5;
+ animation-delay: 5s;
+ background: linear-gradient(90deg, #7ACCC4 0%, #98D6C6 100%);
+}
+
+.wave-3 {
+ opacity: 0.3;
+ animation-delay: 10s;
+ background: linear-gradient(90deg, #6EC0B8 0%, #88C6BD 100%);
+}
+
+@keyframes waveMove {
+ 0% {
+ transform: translateX(0) rotate(0deg);
+ }
+
+ 50% {
+ transform: translateX(-25%) rotate(1deg);
+ }
+
+ 100% {
+ transform: translateX(-50%) rotate(0deg);
+ }
+}
+
+/* 装饰元素 */
+.decorations {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+}
+
+.cloud {
+ position: absolute;
+ background-color: rgba(255, 255, 255, 0.9);
+ border-radius: 100rpx;
+}
+
+.cloud-1 {
+ width: 120rpx;
+ height: 40rpx;
+ top: 120rpx;
+ left: 10%;
+ box-shadow:
+ 20rpx 0 0 0 rgba(255, 255, 255, 0.9),
+ 40rpx 0 0 0 rgba(255, 255, 255, 0.9);
+}
+
+.cloud-2 {
+ width: 90rpx;
+ height: 30rpx;
+ top: 80rpx;
+ right: 15%;
+ box-shadow:
+ 15rpx 0 0 0 rgba(255, 255, 255, 0.9),
+ 30rpx 0 0 0 rgba(255, 255, 255, 0.9);
+}
+
+.cloud-3 {
+ width: 70rpx;
+ height: 25rpx;
+ top: 180rpx;
+ left: 70%;
+ box-shadow:
+ 12rpx 0 0 0 rgba(255, 255, 255, 0.9),
+ 24rpx 0 0 0 rgba(255, 255, 255, 0.9);
+}
+
+.grass {
+ position: absolute;
+ bottom: 0;
+ width: 8rpx;
+ background-color: #86D8D0;
+ border-radius: 4rpx 4rpx 0 0;
+}
+
+.grass-1 {
+ height: 80rpx;
+ left: 20%;
+}
+
+.grass-2 {
+ height: 60rpx;
+ left: 35%;
+}
+
+.grass-3 {
+ height: 100rpx;
+ left: 50%;
+}
+
+.grass:before,
+.grass:after {
+ content: '';
+ position: absolute;
+ width: 8rpx;
+ background-color: #86D8D0;
+ border-radius: 4rpx;
+}
+
+.grass:before {
+ height: 40rpx;
+ transform: rotate(-30deg);
+ top: -20rpx;
+ left: -10rpx;
+}
+
+.grass:after {
+ height: 30rpx;
+ transform: rotate(30deg);
+ top: -15rpx;
+ right: -10rpx;
+}
+
+.sheep {
+ position: absolute;
+ bottom: 120rpx;
+ right: 20%;
+ width: 80rpx;
+ height: 50rpx;
+ background-color: white;
+ border-radius: 50%;
+ box-shadow:
+ -15rpx -10rpx 0 0 white,
+ 15rpx -8rpx 0 0 white;
+}
+
+.sheep:before {
+ content: '';
+ position: absolute;
+ width: 20rpx;
+ height: 20rpx;
+ background-color: #333;
+ border-radius: 50%;
+ top: -5rpx;
+ left: 15rpx;
+}
+
+/* 主要内容区域 */
+.main-content {
+ position: relative;
+ z-index: 10;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ padding: 0 60rpx;
+ padding-top: 120rpx;
+}
+
+/* Logo区域 */
+.logo-section {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ margin-bottom: 120rpx;
+}
+
+.logo-container {
+ margin-bottom: 40rpx;
+}
+
+.logo-circle {
+ width: 180rpx;
+ height: 180rpx;
+ border-radius: 50%;
+ background: linear-gradient(135deg, #86D8D0 0%, #6BC4BC 100%);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow:
+ 0 20rpx 40rpx rgba(134, 216, 208, 0.3),
+ inset 0 -4rpx 8rpx rgba(107, 196, 188, 0.4),
+ inset 0 4rpx 8rpx rgba(255, 255, 255, 0.8);
+ position: relative;
+}
+
+.logo-circle:before {
+ content: '';
+ position: absolute;
+ width: 160rpx;
+ height: 160rpx;
+ border-radius: 50%;
+ border: 2rpx solid rgba(255, 255, 255, 0.3);
+}
+
+.logo-inner {
+ width: 140rpx;
+ height: 140rpx;
+ border-radius: 50%;
+ background: white;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow:
+ inset 0 4rpx 8rpx rgba(134, 216, 208, 0.2),
+ 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
+}
+
+.logo-text {
+ font-size: 64rpx;
+ font-weight: bold;
+ color: #86D8D0;
+ letter-spacing: 4rpx;
+}
+
+.app-title {
+ font-size: 56rpx;
+ font-weight: 700;
+ color: #333;
+ margin-bottom: 16rpx;
+ letter-spacing: 2rpx;
+}
+
+
+
+/* 登录区域 */
+.login-section {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.welcome-text {
+ text-align: center;
+ margin-bottom: 80rpx;
+}
+
+.welcome-main {
+ display: block;
+ font-size: 44rpx;
+ font-weight: 600;
+ color: #333;
+ margin-bottom: 16rpx;
+}
+
+.welcome-desc {
+ display: block;
+ font-size: 28rpx;
+ color: #888;
+ font-weight: 300;
+}
+
+/* 手机号登录按钮 */
+.phone-login-btn {
+ width: 100%;
+ height: 100rpx;
+ border-radius: 50rpx;
+ background: linear-gradient(to right, #86D8D0, #6BC4BC);
+ box-shadow:
+ 0 12rpx 24rpx rgba(134, 216, 208, 0.3),
+ 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
+ margin-bottom: 50rpx;
+ transition: all 0.3s ease;
+}
+
+.phone-btn-hover {
+ transform: translateY(-4rpx);
+ box-shadow:
+ 0 16rpx 32rpx rgba(134, 216, 208, 0.4),
+ 0 6rpx 16rpx rgba(0, 0, 0, 0.12);
+}
+
+.btn-inner {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+}
+
+.btn-inner image {
+ width: 45rpx;
+ height: 45rpx;
+ padding: 0 20rpx;
+}
+
+
+.btn-text {
+ color: white;
+ font-size: 34rpx;
+ font-weight: 500;
+ letter-spacing: 2rpx;
+}
+
+/* 协议确认 */
+.agreement-section {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.agreement-checkbox {
+ width: 30rpx;
+ height: 30rpx;
+ border: 2rpx solid #ccc;
+ border-radius: 6rpx;
+ margin-right: 16rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ transition: all 0.2s ease;
+}
+
+.agreement-checkbox.checked {
+ background-color: #86D8D0;
+ border-color: #86D8D0;
+}
+
+.checkmark {
+ color: white;
+ font-size: 24rpx;
+ font-weight: bold;
+}
+
+.agreement-text {
+ font-size: 24rpx;
+ color: #888;
+ display: flex;
+ align-items: center;
+}
+
+.link {
+ color: #86D8D0;
+}
+
+/* 底部装饰 */
+.bottom-decor {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 60rpx;
+ overflow: hidden;
+}
+
+.bottom-wave {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 200%;
+ height: 200%;
+ background: linear-gradient(90deg, #86D8D0 0%, #A8E6CF 100%);
+ border-radius: 50% 50% 0 0;
+ animation: bottomWave 20s linear infinite;
+}
+
+@keyframes bottomWave {
+ 0% {
+ transform: translateX(0) rotate(0deg);
+ }
+
+ 50% {
+ transform: translateX(-25%) rotate(0.5deg);
+ }
+
+ 100% {
+ transform: translateX(-50%) rotate(0deg);
+ }
+}
+
+/* 协议弹窗 */
+.agreement-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.modal-mask {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.5);
+}
+
+.modal-content {
+ position: relative;
+ width: 85%;
+ max-height: 80%;
+ background-color: white;
+ border-radius: 24rpx;
+ overflow: hidden;
+ box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
+}
+
+.modal-header {
+ padding: 40rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.modal-title {
+ font-size: 36rpx;
+ font-weight: 600;
+ color: #333;
+}
+
+.modal-close {
+ font-size: 48rpx;
+ color: #999;
+ line-height: 1;
+}
+
+.modal-body {
+ max-height: 600rpx;
+ padding: 20rpx;
+ box-sizing: border-box;
+}
+
+.modal-text {
+ font-size: 28rpx;
+ color: #666;
+ line-height: 1.8;
+ padding: 20rpx 0;
+}
+
+/* 加载提示 */
+.loading-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.5);
+ z-index: 1001;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.loading-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.loading-spinner {
+ width: 80rpx;
+ height: 80rpx;
+ border: 6rpx solid rgba(134, 216, 208, 0.2);
+ border-top-color: #86D8D0;
+ border-radius: 50%;
+ animation: loadingSpin 1s linear infinite;
+ margin-bottom: 30rpx;
+}
+
+@keyframes loadingSpin {
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
+
+.loading-text {
+ font-size: 28rpx;
+ color: #fff;
+ font-weight: 300;
+}
\ No newline at end of file
diff --git a/pages/message/message.js b/pages/message/message.js
new file mode 100644
index 0000000..61d74e3
--- /dev/null
+++ b/pages/message/message.js
@@ -0,0 +1,66 @@
+// pages/message/message.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/message/message.json b/pages/message/message.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/message/message.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/message/message.wxml b/pages/message/message.wxml
new file mode 100644
index 0000000..5bbb092
--- /dev/null
+++ b/pages/message/message.wxml
@@ -0,0 +1,2 @@
+
+pages/message/message.wxml
\ No newline at end of file
diff --git a/pages/message/message.wxss b/pages/message/message.wxss
new file mode 100644
index 0000000..2251458
--- /dev/null
+++ b/pages/message/message.wxss
@@ -0,0 +1 @@
+/* pages/message/message.wxss */
\ No newline at end of file
diff --git a/pages/personal/personal.js b/pages/personal/personal.js
new file mode 100644
index 0000000..74b5804
--- /dev/null
+++ b/pages/personal/personal.js
@@ -0,0 +1,66 @@
+// pages/personal/personal.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/personal/personal.json b/pages/personal/personal.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/personal/personal.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/personal/personal.wxml b/pages/personal/personal.wxml
new file mode 100644
index 0000000..dfe0524
--- /dev/null
+++ b/pages/personal/personal.wxml
@@ -0,0 +1,2 @@
+
+pages/personal/personal.wxml
\ No newline at end of file
diff --git a/pages/personal/personal.wxss b/pages/personal/personal.wxss
new file mode 100644
index 0000000..565c5ad
--- /dev/null
+++ b/pages/personal/personal.wxss
@@ -0,0 +1 @@
+/* pages/personal/personal.wxss */
\ No newline at end of file
diff --git a/pagesA/pages/askingSy/askingSy.js b/pagesA/pages/askingSy/askingSy.js
new file mode 100644
index 0000000..cd87bc3
--- /dev/null
+++ b/pagesA/pages/askingSy/askingSy.js
@@ -0,0 +1,66 @@
+// pagesA/pages/askingSy/askingSy.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pagesA/pages/askingSy/askingSy.json b/pagesA/pages/askingSy/askingSy.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pagesA/pages/askingSy/askingSy.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pagesA/pages/askingSy/askingSy.wxml b/pagesA/pages/askingSy/askingSy.wxml
new file mode 100644
index 0000000..2930432
--- /dev/null
+++ b/pagesA/pages/askingSy/askingSy.wxml
@@ -0,0 +1,2 @@
+
+pagesA/pages/askingSy/askingSy.wxml
\ No newline at end of file
diff --git a/pagesA/pages/askingSy/askingSy.wxss b/pagesA/pages/askingSy/askingSy.wxss
new file mode 100644
index 0000000..19af59e
--- /dev/null
+++ b/pagesA/pages/askingSy/askingSy.wxss
@@ -0,0 +1 @@
+/* pagesA/pages/askingSy/askingSy.wxss */
\ No newline at end of file
diff --git a/pagesB/pages/repository/repository.js b/pagesB/pages/repository/repository.js
new file mode 100644
index 0000000..185cc30
--- /dev/null
+++ b/pagesB/pages/repository/repository.js
@@ -0,0 +1,66 @@
+// pagesB/pages/repository/repository.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pagesB/pages/repository/repository.json b/pagesB/pages/repository/repository.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pagesB/pages/repository/repository.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pagesB/pages/repository/repository.wxml b/pagesB/pages/repository/repository.wxml
new file mode 100644
index 0000000..15b0224
--- /dev/null
+++ b/pagesB/pages/repository/repository.wxml
@@ -0,0 +1,2 @@
+
+pagesB/pages/repository/repository.wxml
\ No newline at end of file
diff --git a/pagesB/pages/repository/repository.wxss b/pagesB/pages/repository/repository.wxss
new file mode 100644
index 0000000..b112a0e
--- /dev/null
+++ b/pagesB/pages/repository/repository.wxss
@@ -0,0 +1 @@
+/* pagesB/pages/repository/repository.wxss */
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
new file mode 100644
index 0000000..2d37eb8
--- /dev/null
+++ b/project.config.json
@@ -0,0 +1,41 @@
+{
+ "appid": "wxf03bf1d9f08c05f0",
+ "compileType": "miniprogram",
+ "libVersion": "3.14.2",
+ "packOptions": {
+ "ignore": [],
+ "include": []
+ },
+ "setting": {
+ "coverView": true,
+ "es6": true,
+ "postcss": true,
+ "minified": true,
+ "enhance": true,
+ "showShadowRootInWxmlPanel": true,
+ "packNpmRelationList": [],
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "compileWorklet": false,
+ "uglifyFileName": false,
+ "uploadWithSourceMap": true,
+ "packNpmManually": false,
+ "minifyWXSS": true,
+ "minifyWXML": true,
+ "localPlugins": false,
+ "condition": false,
+ "swc": false,
+ "disableSWC": true,
+ "disableUseStrict": false,
+ "useCompilerPlugins": false
+ },
+ "condition": {},
+ "editorSetting": {
+ "tabIndent": "auto",
+ "tabSize": 2
+ },
+ "simulatorPluginLibVersion": {}
+}
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
new file mode 100644
index 0000000..d4bd5d0
--- /dev/null
+++ b/project.private.config.json
@@ -0,0 +1,24 @@
+{
+ "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+ "projectname": "wxamp-ymtxMerchant",
+ "setting": {
+ "compileHotReLoad": true,
+ "skylineRenderEnable": true,
+ "urlCheck": true,
+ "coverView": true,
+ "lazyloadPlaceholderEnable": false,
+ "preloadBackgroundData": false,
+ "autoAudits": false,
+ "useApiHook": true,
+ "useApiHostProcess": true,
+ "showShadowRootInWxmlPanel": true,
+ "useStaticServer": false,
+ "useLanDebug": false,
+ "showES6CompileOption": false,
+ "bigPackageSizeSupport": false,
+ "checkInvalidKey": true,
+ "ignoreDevUnusedFiles": true
+ },
+ "libVersion": "3.14.2",
+ "condition": {}
+}
\ No newline at end of file
diff --git a/sitemap.json b/sitemap.json
new file mode 100644
index 0000000..ca02add
--- /dev/null
+++ b/sitemap.json
@@ -0,0 +1,7 @@
+{
+ "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+ "rules": [{
+ "action": "allow",
+ "page": "*"
+ }]
+}
\ No newline at end of file
diff --git a/utils/api.js b/utils/api.js
new file mode 100644
index 0000000..990dd82
--- /dev/null
+++ b/utils/api.js
@@ -0,0 +1,242 @@
+//在这里面定义所有接口,一个文件管理所有接口,易于维护
+import { http } from './http'; // 引入刚刚封装好的http模块,import属于ES6的语法,微信开发者工具必须打开ES6转ES5选项
+
+// 授权登录接口
+function login(params) {
+ http('/auth/wechat/login', 'post', params)
+}
+
+// 获取手机号接口
+function getPhoneNumber(params) {
+ http('/auth/wechat/bind', 'post', params)
+}
+
+// 轮播
+function carousel(params) {
+ http('/muhu/ads/list', 'get', params)
+}
+
+// 轮播详情
+function carouselDetail(params) {
+ http('/muhu/ads/' + params.data.id, 'get', params)
+}
+
+// 通知公告
+function disaster(params) {
+ http('/muhu/warning/list', 'get', params)
+}
+
+// 通知公告详情
+function disasterDetail(params) {
+ http('/muhu/warning/' + params.data.id, 'get', params)
+}
+
+// 地图导航药店诊所
+function pharmacy(params) {
+ http('/muhu/info/list', 'get', params)
+}
+
+// 办事指南
+function guidance(params) {
+ http('/muhu/guide/list', 'get', params)
+}
+
+// AI问诊快捷词列表
+function inquiry(params) {
+ http('/system/base/list', 'get', params)
+}
+
+// AI问诊模糊搜索
+function search(params) {
+ http('/system/base/search', 'get', params)
+}
+
+// 销售市场
+function sales(params) {
+ http('/muhu/sales/list', 'get', params)
+}
+
+// 饲料市场
+function feed(params) {
+ http('/muhu/feed/list', 'get', params)
+}
+
+// 市场趋势
+function trend(params) {
+ http('/muhu/trend/list', 'get', params)
+}
+
+// 问兽医-问诊单列表
+function wzd(params) {
+ http('/muhu/consultation/list', 'get', params)
+}
+
+// 问兽医-问诊单新增
+function wzdAdd(params) {
+ http('/muhu/consultation', 'post', params)
+}
+
+// 问兽医-兽医回复详情
+function wzdxq(params) {
+ http('/vet/comments/list', 'get', params)
+}
+
+// 专家列表
+function expertsList(params) {
+ http('/vet/experts/list', 'get', params)
+}
+
+// 药品推荐列表
+function recommendationList(params) {
+ http('/system/recommendation/list', 'get', params)
+}
+
+// 药品推荐详情
+function recommendationXq(params) {
+ http('/system/recommendation/'+ params.data.id , 'get', params)
+}
+
+// 知识库查询列表
+function queryList(params) {
+ http('/system/query/list', 'get', params)
+}
+
+// 知识库查询提示
+function tipList(params) {
+ http('/system/tip/list', 'get', params)
+}
+
+// 在线培训文章发布
+function article(params) {
+ http('/vet/knowledge/published/list', 'get', params)
+}
+
+// 文章分类字典
+function articleZd(params) {
+ http('/system/dict/data/list', 'get', params)
+}
+
+// 在线培训文章发布详情
+function articleDetails(params) {
+ http('/vet/knowledge/published/' + params.data.id, 'get', params)
+}
+
+// 政策解读列表
+function policyelucidation(params) {
+ http('/system/interpretation/published/list', 'get', params)
+}
+
+// 政策解读详情
+function policyeDetails(params) {
+ http('/system/interpretation/published/' + params.data.id, 'get', params)
+}
+
+// 政策解读类型字典
+function policyeZd(params) {
+ http('/system/dict/data/list', 'get', params)
+}
+
+// 行政区划
+function areaChildren(params) {
+ http('/muhu/user/areaChildren', 'get', params)
+}
+
+// 提交行政区划信息
+function userCode(params) {
+ http('/muhu/user/saveUserAreaCode/' + params.data.areaCode, 'put', params)
+}
+
+// 查询用户信息
+function UserInfo(params) {
+ http('/muhu/user/getUserInfo', 'get', params)
+}
+
+// 视频列表
+function videoList(params) {
+ http('/vet/training/public/list', 'get', params)
+}
+
+// 视频详情
+function videoDetails(params) {
+ http('/vet/training/public/'+params.data.id, 'get', params)
+}
+
+// 视频字典
+function videoZd(params) {
+ http('/system/dict/data/list', 'get', params)
+}
+
+//在线问答列表
+function forumList(params) {
+ http('/system/questions/list', 'get', params)
+}
+
+//在线问答详情
+function forumDetails(params) {
+ http('/system/questions/'+params.data.id, 'get', params)
+}
+
+//在线问答新增帖子
+function forumAdd(params) {
+ http('/system/questions', 'post', params)
+}
+
+//在线问答详情回复
+function forumReply(params) {
+ http('/system/answers/list', 'get', params)
+}
+
+//新增回复
+function commentReply(params) {
+ http('/system/answers', 'post', params)
+}
+
+// 经验分享列表
+function experience(params) {
+ http('/vet/article/list', 'get', params)
+}
+
+// 经验分享详情
+function experienceDetails(params) {
+ http('/vet/article/' + params.data.id, 'get', params)
+}
+
+// 经验分享分类字典
+function experiencezd(params) {
+ http('/vet/article/options', 'get', params)
+}
+
+// 实名认证
+function realName(params) {
+ http('/muhu/user/auth/submit', 'post', params)
+}
+
+// 上传修改头像
+function revise(params) {
+ http('/muhu/user', 'put', params)
+}
+
+// 个人中心反馈建议
+function feedback(params) {
+ http('/muhu/feedback', 'post', params)
+}
+
+// 预警类型
+function warningType(params) {
+ http('/system/dict/data/list', 'get', params)
+}
+
+// 个人中心今日问诊
+function today(params) {
+ http('/muhu/consultation/today', 'get', params)
+}
+
+
+export default { // 暴露接口
+ login,carousel,disaster,pharmacy,guidance,getPhoneNumber,inquiry,policyeDetails,
+ search,trend,feed,sales,wzd,wzdxq,wzdAdd,expertsList,recommendationList,policyeZd,
+ recommendationXq,queryList,tipList,article,articleDetails,articleZd,policyelucidation,
+ areaChildren,userCode,UserInfo,videoList,videoZd,videoDetails,forumList,forumAdd,forumDetails,
+ forumReply,commentReply,experience,experiencezd,experienceDetails,realName,revise,feedback,
+ warningType,disasterDetail,today,carouselDetail
+}
diff --git a/utils/baseUrl.js b/utils/baseUrl.js
new file mode 100644
index 0000000..3de0bb9
--- /dev/null
+++ b/utils/baseUrl.js
@@ -0,0 +1,5 @@
+// var baseUrl = 'https://wx.chenhaitech.com/ymtx-prod-api'
+var baseUrl = 'http://192.168.101.109:8080'
+// var baseUrl = 'http://192.168.101.105:8082'
+// var baseUrl = 'http://192.168.101.111:8081'
+module.exports = baseUrl
diff --git a/utils/font.wxss b/utils/font.wxss
new file mode 100644
index 0000000..3bb894a
--- /dev/null
+++ b/utils/font.wxss
@@ -0,0 +1,8 @@
+
+@font-face {
+ font-family: "思源宋体 Light" !important;
+ font-weight: 300;
+ src: url("/pages/images/EZSx3exf4cjI.woff2") format("woff2"),
+ url("/pages/images/EZSx3exf4cjI.woff") format("woff");
+ font-display: swap;
+}
\ No newline at end of file
diff --git a/utils/http.js b/utils/http.js
new file mode 100644
index 0000000..fd7798e
--- /dev/null
+++ b/utils/http.js
@@ -0,0 +1,102 @@
+var baseUrl = require('../utils/baseUrl')
+var ajaxtimes = 0
+var isShowingTokenExpiredModal = false // 新增:标记是否正在显示token过期弹窗
+
+module.exports = {
+ http(url, method, params) {
+ //发送一次请求就加1
+ ajaxtimes++
+ let token = 'token' // 获取token,自行获取token和签名,token和签名表示每个接口都要发送的数据
+ let sign = 'sign' // 获取签名 (后台怎么定义的,就传什么)
+ let data = {
+ token,
+ sign
+ }
+
+ wx.showLoading({
+ title: '加载中...',
+ })
+
+ let urls = baseUrl + url
+ if (params.data) { // 在这里判断一下data是否存在,params表示前端需要传递的数据,params是一个对象,有三组键值对,data:表示请求要发送的数据,success:成功的回调,fail:失败的回调,这三个字段可缺可无,其余字段会忽略
+ for (let key in params.data) { // 在这里判断传过来的参数值为null,就删除这个属性
+ if (params.data[key] == null || params.data[key] == 'null') {
+ delete params.data[key]
+ }
+ }
+ data = {
+ ...data,
+ ...params.data
+ }
+ }
+
+ if (params.id) {
+ urls = urls + '/' + params.id
+ }
+ // console.log(urls);
+ var value = null
+ try {
+ value = wx.getStorageSync('token')
+ if (value) {
+ // console.log(value);
+ }
+ } catch (e) {
+ // Do something when catch error
+ }
+ wx.request({
+ url: urls, // 就是拼接上前缀,此接口域名是开放接口,可访问
+ method: method, // 判断请求类型,除了值等于'post'外,其余值均视作get 其他的请求类型也可以自己加上的 method: method == 'post' ? 'post' : 'get'
+ data,
+ header: {
+ 'content-type': 'application/json',
+ 'Authorization':'Bearer '+ value
+ },
+ success(res) {
+ // console.log(res);
+ if(res.data.code == 401){
+ // 只在没有显示弹窗时才显示
+ if (!isShowingTokenExpiredModal) {
+ isShowingTokenExpiredModal = true
+ wx.showModal({
+ title: '提示',
+ content: '登录已过期,请重新登录',
+ success (res) {
+ if (res.confirm) {
+ // 重置标记
+ isShowingTokenExpiredModal = false
+ wx.reLaunch({
+ url: '/pages/login/login',
+ })
+ } else if (res.cancel) {
+ // 重置标记
+ isShowingTokenExpiredModal = false
+ }
+ },
+ // 确保在模态框关闭时重置标记
+ complete: function() {
+ // 如果success回调没有执行(例如直接点击蒙层关闭),在这里重置标记
+ setTimeout(() => {
+ isShowingTokenExpiredModal = false
+ }, 300)
+ }
+ })
+ }
+ // 401错误时,不调用params.success,直接返回
+ return
+ } else {
+ params.success && params.success(res.data)
+ }
+ },
+ fail(err) {
+ params.fail && params.fail(err)
+ },
+ complete(){
+ //完成一次请求就减一
+ ajaxtimes--;
+ if(ajaxtimes===0){
+ wx.hideLoading()
+ }
+ },
+ })
+ }
+}
\ No newline at end of file
diff --git a/utils/tool.wxs b/utils/tool.wxs
new file mode 100644
index 0000000..797bd6e
--- /dev/null
+++ b/utils/tool.wxs
@@ -0,0 +1,45 @@
+// 通知
+function type(name) {
+ if(name=='紧急'){
+ return 'urgent'
+ }else if(name=='重要'){
+ return 'important'
+ }else{
+ return 'normal'
+ }
+}
+
+// 严重程度区分
+function ztLevel(type) {
+ if(type=='轻度'){
+ return 'low'
+ }else if(type=='中度'){
+ return 'moderate'
+ }else{
+ return 'high'
+ }
+}
+
+// 药品标签
+function medicineType(type) {
+ if(type=='处方药'){
+ return 'prescription'
+ }else if(type=='非处方药'){
+ return 'otc'
+ }else if(type=='中成药'){
+ return 'chinese'
+ }else{
+ return 'health'
+ }
+}
+
+
+
+
+
+
+module.exports = {
+ type:type,
+ ztLevel:ztLevel,
+ medicineType:medicineType
+}
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
new file mode 100644
index 0000000..764bc2c
--- /dev/null
+++ b/utils/util.js
@@ -0,0 +1,19 @@
+const formatTime = date => {
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
+}
+
+const formatNumber = n => {
+ n = n.toString()
+ return n[1] ? n : `0${n}`
+}
+
+module.exports = {
+ formatTime
+}