commit e3262d5e6b074bfb988a7d64839e47d4f7c61344 Author: ZhaoYang <565837861@qq.com> Date: Fri Dec 26 19:11:33 2025 +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..9ab2396 --- /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-ymtxUser.iml b/.idea/wxamp-ymtxUser.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/wxamp-ymtxUser.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..2cc1cbd --- /dev/null +++ b/app.json @@ -0,0 +1,83 @@ +{ + "pages": [ + "pages/home/home", + "pages/news/news", + "pages/map/map", + "pages/personal/personal" + ], + "subPackages": [ + { + "root": "pagesA", + "pages": [ + "pages/socialWork/socialWork" + ] + }, + { + "root": "pagesB", + "pages": [ + "pages/apple/apple" + ], + "independent": true + } + ], + "window": { + "navigationBarBackgroundColor": "#86D8D0", + "navigationBarTextStyle": "white" + }, + "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/news/news", + "text": "消息", + "iconPath": "pages/images/xx.png", + "selectedIconPath": "pages/images/xx1.png" + }, + { + "pagePath": "pages/map/map", + "text": "导航", + "iconPath": "pages/images/dh.png", + "selectedIconPath": "pages/images/dh1.png" + }, + { + "pagePath": "pages/personal/personal", + "text": "我的", + "iconPath": "pages/images/wd.png", + "selectedIconPath": "pages/images/wd1.png" + } + ] + }, + "requiredPrivateInfos": [ + "getLocation", + "chooseAddress", + "chooseLocation", + "startLocationUpdateBackground" + ], + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + }, + "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" +} \ No newline at end of file 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..f917088 --- /dev/null +++ b/pages/home/home.js @@ -0,0 +1,252 @@ +Page({ + data: { + // 轮播图数据 + currentSwiper: 0, + swiperList: [{ + id: 1, + image: '/pages/images/banner1.png', + tag: '疫病防治', + title: '春季牛羊常见病预防指南', + desc: '专业兽医教你科学预防', + isActive: false + }, + { + id: 2, + image: '/pages/images/banner2.png', + tag: '专家直播', + title: '畜牧养殖新技术分享会', + desc: '今晚8点准时开播', + isActive: false + }, + { + id: 3, + image: '/pages/images/banner3.png', + tag: '市场动态', + title: '最新牛羊肉价格行情', + desc: '实时掌握市场变化', + isActive: false + }, + { + id: 4, + image: '/pages/images/banner4.png', + tag: '在线问诊', + title: 'AI智能诊断上线', + desc: '24小时在线解答', + isActive: false + } + ], + + // 通知公告数据 + currentNotice: 0, + noticeList: [{ + id: 1, + type: 'urgent', + typeName: '紧急', + content: '关于春季动物疫病防控的重要通知,请各位牧民及时查看并做好预防工作', + time: '03-15 14:30' + }, + { + id: 2, + type: 'important', + typeName: '重要', + content: '兽药购买资质审核流程更新,请相关商家及时上传最新资质文件', + time: '03-14 09:15' + }, + { + id: 3, + type: 'normal', + typeName: '通知', + content: '平台将于3月20日进行系统升级,升级期间部分功能可能无法正常使用', + time: '03-13 16:45' + } + ], + }, + + + //获取当前位置信息 + getLocation() { + let that = this; + // 腾讯获取的密钥 + let key = 'AOBBZ-6LUK7-WXGXX-HJUXS-HHUM5-FWFPJ' + wx.getLocation({ + isHighAccuracy: true, + type: 'gcj02', + success: function (res) { + console.log(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 => { + console.log(res); + that.setData({ + county: res.data.result.address_component.district //城市 + }); + + } + }) + } + }) + }, + + onLoad() { + // 初始化数据 + this.initSwiperActiveState(); + this.getLocation() + }, + + onShow() { + + }, + + + + // 初始化轮播图激活状态 + initSwiperActiveState() { + const swiperList = this.data.swiperList.map((item, index) => ({ + ...item, + isActive: index === this.data.currentSwiper + })); + this.setData({ + swiperList + }); + }, + + // 轮播图变化事件 + onSwiperChange(e) { + const current = e.detail.current; + const swiperList = this.data.swiperList.map((item, index) => ({ + ...item, + isActive: index === current + })); + + this.setData({ + currentSwiper: current, + swiperList + }); + }, + + // 轮播图指示器点击 + onIndicatorTap(e) { + const index = e.currentTarget.dataset.index; + this.setData({ + currentSwiper: index + }); + }, + + // 轮播图点击 + onSwiperTap(e) { + const id = e.currentTarget.dataset.id; + const item = this.data.swiperList.find(item => item.id === id); + + if (!item) return; + + console.log('轮播图点击:', item); + + wx.showToast({ + title: `进入${item.tag}`, + icon: 'none', + duration: 1000 + }); + + // 根据不同类型跳转不同页面 + switch (id) { + case 1: + wx.navigateTo({ + url: '/pages/knowledge/detail?id=' + id + }); + break; + case 2: + wx.navigateTo({ + url: '/pages/live/detail?id=' + id + }); + break; + case 3: + wx.navigateTo({ + url: '/pages/market/detail?id=' + id + }); + break; + case 4: + wx.navigateTo({ + url: '/pages/consult/ai' + }); + break; + default: + // 默认跳转到详情页 + wx.navigateTo({ + url: '/pages/detail/index?id=' + id + }); + } + }, + + + // 通知点击 - 使用catchtap防止事件冒泡 + onNoticeTap(e) { + const id = e.currentTarget.dataset.id; + console.log('通知点击:', id); + + // 显示当前点击的通知内容 + const notice = this.data.noticeList.find(item => item.id === id); + if (notice) { + wx.showModal({ + title: notice.typeName, + content: notice.content, + showCancel: true, + cancelText: '关闭', + confirmText: '查看详情', + success: (res) => { + if (res.confirm) { + wx.navigateTo({ + url: '/pages/notice/detail?id=' + id + }); + } + } + }); + } + }, + + // 更多通知 + gotoNotices() { + wx.navigateTo({ + url: '' + }); + }, + + + 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() + setTimeout(function () { + wx.showToast({ + title: '刷新成功', + icon: 'none', + duration: 1000 + }) + wx.hideNavigationBarLoading() + wx.stopPullDownRefresh() + }, 1000) + }, + + // 页面滚动 + 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..aa2ff42 --- /dev/null +++ b/pages/home/home.json @@ -0,0 +1,8 @@ +{ + "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..46c9c29 --- /dev/null +++ b/pages/home/home.wxml @@ -0,0 +1,133 @@ + + + + + + + {{county}} + + + + + + + + + + + + {{item.tag}} + {{item.title}} + {{item.desc}} + + + + + + + + + + + + + + + + + + 问兽医 + 智能匹配医生 + 平均5分钟恢复 + + + + 找专家 + 智能匹配医生 + + + 去买药 + 制定专业的治疗方案 + + + + + + + + 养殖知识库 + 快速查询养殖知识 + + + 在线培训 + 提高养殖技能 + + + 政策解读 + 提供政策指导 + + + + + + + + + + + + {{item.typeName}} + {{item.time}} + + {{item.content}} + + + + + + + + + + + + + + + + 用户提问 + 看看其他养殖户遇到的问题 + + + 查看全部 + + + + + + + + + 【羊】 + 发烧、流鼻涕、越来越瘦是什么原因?应该怎么治疗? + + + + + + + 2025-12-25 + + + + + + \ No newline at end of file diff --git a/pages/home/home.wxss b/pages/home/home.wxss new file mode 100644 index 0000000..0cbfcb5 --- /dev/null +++ b/pages/home/home.wxss @@ -0,0 +1,518 @@ +/* 页面容器 */ +.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; +} + +/* 定位 */ +.orientation { + 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; +} + +/* 轮播图区域 */ +.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: 30rpx; + background: #96DBD4; + border-radius: 6rpx; +} + +/* 卡片类型 */ +.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; +} + +/* 知识库 */ +.repository { + width: 100%; + display: grid; + grid-template-columns: 1fr 1fr 1fr; + column-gap: 20rpx; +} + +.repository>view { + padding: 20rpx 0 20rpx 20rpx; + border-radius: 20rpx; +} + +.zsk view:first-child { + color: #fff; + margin-bottom: 5rpx; +} + +.zsk view:last-child { + background-color: #fff; + font-size: 22rpx; + display: inline-block; + padding: 0 10rpx; +} + +.repository1_1 { + background-color: #6CAB86; +} + +.repository1_2 { + background-color: #017D77; +} + +.repository1_3 { + background-color: #FD8140; +} + +/* 通知公告区域 */ +.notice-section { + background: #FFFFFF; + border-radius: 20rpx; + padding: 20rpx 20rpx 0; + margin: 20rpx 0; + box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.05); + animation: fadeIn 0.6s ease-out 0.6s both; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +.notice-content { + position: relative; +} + +.notice-swiper { + height: 200rpx; +} + +.notice-item { + padding: 20rpx 0; + transition: all 0.3s ease; + display: flex; + flex-direction: column; + position: relative; +} + +.notice-item.highlight { + background: rgba(76, 175, 80, 0.05); + border-radius: 12rpx; + padding: 20rpx; + margin: -10rpx -10rpx 0; +} + +.notice-item-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16rpx; +} + +.notice-type { + padding: 4rpx 16rpx; + border-radius: 20rpx; + font-size: 22rpx; + font-weight: 500; +} + +.notice-type.urgent { + background: rgba(244, 67, 54, 0.1); + color: #F44336; +} + +.notice-type.important { + background: rgba(255, 152, 0, 0.1); + color: #FF9800; +} + +.notice-type.normal { + background: rgba(33, 150, 243, 0.1); + color: #2196F3; +} + +.notice-time { + font-size: 22rpx; + color: #999999; +} + +.notice-text { + font-size: 28rpx; + color: #333333; + line-height: 1.5; + flex: 1; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + +/* 用户提问板块 - 优化样式 */ +.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: #333; + 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-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); +} + + + + + + +/* 问题元信息 */ +.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-icon { + font-size: 28rpx; + font-weight: bold; + color: #60C0B9; + background: rgba(96, 192, 185, 0.1); + padding: 6rpx 16rpx; + border-radius: 12rpx; + flex-shrink: 0; + line-height: 1.4; +} + +.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; +} + +.user-location { + display: flex; + align-items: center; + gap: 6rpx; +} + +.user-location text { + font-size: 22rpx; + color: #999; +} + +.time-info { + font-size: 22rpx; + color: #999; + background: rgba(0, 0, 0, 0.04); + padding: 6rpx 16rpx; + border-radius: 16rpx; +} diff --git a/pages/images/banner1.png b/pages/images/banner1.png new file mode 100644 index 0000000..bfac6ab Binary files /dev/null and b/pages/images/banner1.png differ diff --git a/pages/images/banner2.png b/pages/images/banner2.png new file mode 100644 index 0000000..cec091c Binary files /dev/null and b/pages/images/banner2.png differ diff --git a/pages/images/banner3.png b/pages/images/banner3.png new file mode 100644 index 0000000..e78edf5 Binary files /dev/null and b/pages/images/banner3.png differ diff --git a/pages/images/banner4.png b/pages/images/banner4.png new file mode 100644 index 0000000..f301bb1 Binary files /dev/null and b/pages/images/banner4.png differ diff --git a/pages/images/dh.png b/pages/images/dh.png new file mode 100644 index 0000000..6cdadbc Binary files /dev/null and b/pages/images/dh.png differ diff --git a/pages/images/dh1.png b/pages/images/dh1.png new file mode 100644 index 0000000..5e4f64d Binary files /dev/null and b/pages/images/dh1.png 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/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/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..e453a8f 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..23322fe Binary files /dev/null and b/pages/images/xx1.png differ diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..8b8eb9e --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,52 @@ +// index.js +const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0' + +Component({ + data: { + motto: 'Hello World', + userInfo: { + avatarUrl: defaultAvatarUrl, + nickName: '', + }, + hasUserInfo: false, + canIUseGetUserProfile: wx.canIUse('getUserProfile'), + canIUseNicknameComp: wx.canIUse('input.type.nickname'), + }, + methods: { + // 事件处理函数 + bindViewTap() { + wx.navigateTo({ + url: '../logs/logs' + }) + }, + onChooseAvatar(e) { + const { avatarUrl } = e.detail + const { nickName } = this.data.userInfo + this.setData({ + "userInfo.avatarUrl": avatarUrl, + hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl, + }) + }, + onInputChange(e) { + const nickName = e.detail.value + const { avatarUrl } = this.data.userInfo + this.setData({ + "userInfo.nickName": nickName, + hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl, + }) + }, + getUserProfile(e) { + // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 + wx.getUserProfile({ + desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 + success: (res) => { + console.log(res) + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + }) + }, + }, +}) diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..aa3f1b0 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navigation-bar": "/components/navigation-bar/navigation-bar" + } +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..aab521d --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,28 @@ + + + + + + + + + 昵称 + + + + + + 请使用2.10.4及以上版本基础库 + + + + {{userInfo.nickName}} + + + + {{motto}} + + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..fde665a --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1,63 @@ +/**index.wxss**/ +page { + height: 100vh; + display: flex; + flex-direction: column; +} + +.scrollarea { + flex: 1; + overflow-y: hidden; +} + +.userinfo { + display: flex; + flex-direction: column; + align-items: center; + color: #aaa; + width: 80%; +} + +.userinfo-avatar { + overflow: hidden; + width: 128rpx; + height: 128rpx; + margin: 20rpx; + border-radius: 50%; +} + +.usermotto { + margin-top: 200px; +} + +.avatar-wrapper { + padding: 0; + width: 56px !important; + border-radius: 8px; + margin-top: 40px; + margin-bottom: 40px; +} + +.avatar { + display: block; + width: 56px; + height: 56px; +} + +.nickname-wrapper { + display: flex; + width: 100%; + padding: 16px; + box-sizing: border-box; + border-top: .5px solid rgba(0, 0, 0, 0.1); + border-bottom: .5px solid rgba(0, 0, 0, 0.1); + color: black; +} + +.nickname-label { + width: 105px; +} + +.nickname-input { + flex: 1; +} diff --git a/pages/logs/logs.js b/pages/logs/logs.js new file mode 100644 index 0000000..0c69f70 --- /dev/null +++ b/pages/logs/logs.js @@ -0,0 +1,20 @@ +// logs.js +const util = require('../../utils/util.js') + +Component({ + data: { + logs: [] + }, + lifetimes: { + attached() { + this.setData({ + logs: (wx.getStorageSync('logs') || []).map(log => { + return { + date: util.formatTime(new Date(log)), + timeStamp: log + } + }) + }) + } + }, +}) diff --git a/pages/logs/logs.json b/pages/logs/logs.json new file mode 100644 index 0000000..aa3f1b0 --- /dev/null +++ b/pages/logs/logs.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "navigation-bar": "/components/navigation-bar/navigation-bar" + } +} \ No newline at end of file diff --git a/pages/logs/logs.wxml b/pages/logs/logs.wxml new file mode 100644 index 0000000..7de3ba3 --- /dev/null +++ b/pages/logs/logs.wxml @@ -0,0 +1,7 @@ + + + + + {{index + 1}}. {{log.date}} + + diff --git a/pages/logs/logs.wxss b/pages/logs/logs.wxss new file mode 100644 index 0000000..33f9d9e --- /dev/null +++ b/pages/logs/logs.wxss @@ -0,0 +1,16 @@ +page { + height: 100vh; + display: flex; + flex-direction: column; +} +.scrollarea { + flex: 1; + overflow-y: hidden; +} +.log-item { + margin-top: 20rpx; + text-align: center; +} +.log-item:last-child { + padding-bottom: env(safe-area-inset-bottom); +} diff --git a/pages/map/map.js b/pages/map/map.js new file mode 100644 index 0000000..884f056 --- /dev/null +++ b/pages/map/map.js @@ -0,0 +1,120 @@ +// pages/map/map.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + markers: { + longitude: null, + latitude: null + }, + activeTab: '', + }, + + + // 切换标签页 + switchTab(e) { + const tab = e.currentTarget.dataset.tab; + this.setData({ + activeTab: tab + }); + + // 这里可以添加切换标签后的逻辑 + if (tab === 'clinic') { + // 药店诊所相关操作 + console.log('切换到药店诊所'); + } else if (tab === 'guide') { + // 办事指南相关操作 + console.log('切换到办事指南'); + } + }, + + // 获取当前位置信息 + getlocation() { + var that = this + wx.getLocation({ + isHighAccuracy: true, + type: 'gcj02', + success: function (res) { + console.log(res); + that.setData({ + ['markers.longitude']: res.longitude, + ['markers.latitude']: res.latitude + }) + } + }) + }, + + + + // 地图 + getMap() { + wx.chooseLocation({ + success: res => { + console.log(111, res); + this.setData({ + ['markers.longitude']: res.longitude, + ['markers.latitude']: res.latitude + }) + } + }) + }, + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getlocation() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/map/map.json b/pages/map/map.json new file mode 100644 index 0000000..4fa9cca --- /dev/null +++ b/pages/map/map.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText":"地图导航", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/map/map.wxml b/pages/map/map.wxml new file mode 100644 index 0000000..35fded5 --- /dev/null +++ b/pages/map/map.wxml @@ -0,0 +1,32 @@ + + + + + 药店诊所 + + + 办事指南 + + + + + + + + \ No newline at end of file diff --git a/pages/map/map.wxss b/pages/map/map.wxss new file mode 100644 index 0000000..b819e25 --- /dev/null +++ b/pages/map/map.wxss @@ -0,0 +1,157 @@ +/* 页面容器 */ +.page-container { + width: 100%; + min-height: 100vh; + background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); + } + + /* 按钮组样式 */ + .button-group { + width: 92%; + margin: 24rpx auto; + display: flex; + background: #ffffff; + border-radius: 20rpx; + padding: 8rpx; + box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08); + position: relative; + z-index: 10; + } + + /* 按钮基础样式 */ + .button { + flex: 1; + height: 88rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + font-weight: 500; + color: #666; + background: transparent; + border-radius: 16rpx; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + } + + /* 激活状态按钮 */ + .button.active { + background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); + color: #ffffff; + font-weight: 600; + box-shadow: 0 4rpx 16rpx rgba(106, 17, 203, 0.3); + } + + /* 按钮点击效果 */ + .button:active { + transform: scale(0.98); + } + + /* 地图容器 */ + .map-container { + width: 92%; + margin: 0 auto; + border-radius: 24rpx; + overflow: hidden; + box-shadow: 0 12rpx 48rpx rgba(0, 0, 0, 0.15); + height: calc(100vh - 200rpx); + position: relative; + } + + /* 地图本身样式 */ + .map-container map { + width: 100%; + height: 100%; + border-radius: 24rpx; + display: block; /* 确保正确显示 */ + } + + /* 问题修复:移除或修改覆盖层 */ + /* 原来的 ::before 伪元素会覆盖地图,阻挡交互 */ + /* 如果你需要加载状态,可以这样修改: */ + + .map-container.loading::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + opacity: 0.3; /* 降低不透明度 */ + transition: opacity 0.3s; + border-radius: 24rpx; + z-index: -1; /* 放到地图后面 */ + pointer-events: none; /* 关键:不阻挡点击事件 */ + } + + /* 或者完全移除加载状态样式,因为地图有自己的加载状态 */ + + /* 地图控制按钮样式(如果需要添加) */ + .map-controls { + position: absolute; + right: 24rpx; + bottom: 40rpx; + display: flex; + flex-direction: column; + gap: 16rpx; + z-index: 100; + } + + .map-control-btn { + width: 80rpx; + height: 80rpx; + background: rgba(255, 255, 255, 0.95); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.15); + font-size: 36rpx; + font-weight: bold; + color: #333; + transition: all 0.2s; + border: 1rpx solid rgba(0, 0, 0, 0.1); + } + + .map-control-btn:active { + background: rgba(240, 240, 240, 0.95); + transform: scale(0.95); + } + + .map-control-btn.location { + background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); + color: white; + } + + + + /* 响应式适配 */ + @media (max-width: 480px) { + .button-group { + width: 94%; + margin: 20rpx auto; + } + + .map-container { + width: 94%; + height: calc(100vh - 180rpx); + } + + .button { + height: 80rpx; + font-size: 28rpx; + } + + .map-controls { + right: 16rpx; + bottom: 30rpx; + } + + .map-control-btn { + width: 70rpx; + height: 70rpx; + font-size: 32rpx; + } + } \ No newline at end of file diff --git a/pages/news/news.js b/pages/news/news.js new file mode 100644 index 0000000..ea3c099 --- /dev/null +++ b/pages/news/news.js @@ -0,0 +1,66 @@ +// pages/news/news.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/news/news.json b/pages/news/news.json new file mode 100644 index 0000000..f3e0fe1 --- /dev/null +++ b/pages/news/news.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText":"消息", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/news/news.wxml b/pages/news/news.wxml new file mode 100644 index 0000000..2f27e01 --- /dev/null +++ b/pages/news/news.wxml @@ -0,0 +1,2 @@ + +pages/news/news.wxml \ No newline at end of file diff --git a/pages/news/news.wxss b/pages/news/news.wxss new file mode 100644 index 0000000..c142781 --- /dev/null +++ b/pages/news/news.wxss @@ -0,0 +1 @@ +/* pages/news/news.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..e2ceaf6 --- /dev/null +++ b/pages/personal/personal.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText":"个人中心", + "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/socialWork/socialWork.js b/pagesA/pages/socialWork/socialWork.js new file mode 100644 index 0000000..75c63b7 --- /dev/null +++ b/pagesA/pages/socialWork/socialWork.js @@ -0,0 +1,66 @@ +// pagesA/pages/socialWork/socialWork.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pagesA/pages/socialWork/socialWork.json b/pagesA/pages/socialWork/socialWork.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pagesA/pages/socialWork/socialWork.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pagesA/pages/socialWork/socialWork.wxml b/pagesA/pages/socialWork/socialWork.wxml new file mode 100644 index 0000000..9ad8128 --- /dev/null +++ b/pagesA/pages/socialWork/socialWork.wxml @@ -0,0 +1,2 @@ + +pagesA/pages/socialWork/socialWork.wxml \ No newline at end of file diff --git a/pagesA/pages/socialWork/socialWork.wxss b/pagesA/pages/socialWork/socialWork.wxss new file mode 100644 index 0000000..9d3792b --- /dev/null +++ b/pagesA/pages/socialWork/socialWork.wxss @@ -0,0 +1 @@ +/* pagesA/pages/socialWork/socialWork.wxss */ \ No newline at end of file diff --git a/pagesB/pages/apple/apple.js b/pagesB/pages/apple/apple.js new file mode 100644 index 0000000..fe0553c --- /dev/null +++ b/pagesB/pages/apple/apple.js @@ -0,0 +1,66 @@ +// pagesB/pages/apple/apple.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pagesB/pages/apple/apple.json b/pagesB/pages/apple/apple.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pagesB/pages/apple/apple.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pagesB/pages/apple/apple.wxml b/pagesB/pages/apple/apple.wxml new file mode 100644 index 0000000..8961198 --- /dev/null +++ b/pagesB/pages/apple/apple.wxml @@ -0,0 +1,2 @@ + +pagesB/pages/apple/apple.wxml \ No newline at end of file diff --git a/pagesB/pages/apple/apple.wxss b/pagesB/pages/apple/apple.wxss new file mode 100644 index 0000000..9402d62 --- /dev/null +++ b/pagesB/pages/apple/apple.wxss @@ -0,0 +1 @@ +/* pagesB/pages/apple/apple.wxss */ \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..24f1f72 --- /dev/null +++ b/project.config.json @@ -0,0 +1,41 @@ +{ + "appid": "wx903a5fea119f2d4a", + "compileType": "miniprogram", + "libVersion": "3.13.0", + "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..2b87105 --- /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-ymtx", + "setting": { + "compileHotReLoad": true, + "skylineRenderEnable": true, + "urlCheck": false, + "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.13.0", + "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..254442e --- /dev/null +++ b/utils/api.js @@ -0,0 +1,13 @@ +//在这里面定义所有接口,一个文件管理所有接口,易于维护 +import { http } from './http'; // 引入刚刚封装好的http模块,import属于ES6的语法,微信开发者工具必须打开ES6转ES5选项 + +function login(params) { // 请求登录接口 + http('/login', 'post', params) // 接口请求的路由地址以及请求方法在此处传递 +} + + + + +export default { // 暴露接口 + login +} diff --git a/utils/baseUrl.js b/utils/baseUrl.js new file mode 100644 index 0000000..648f3b4 --- /dev/null +++ b/utils/baseUrl.js @@ -0,0 +1,4 @@ +//url: 'https://wxamp.chenhaitech.com/tglzw' + url, // 就是拼接上前缀,此接口域名是开放接口,可访问 +var baseUrl = 'https://wx.chenhaitech.com/guoziwei-prod-api' +// var baseUrl = 'http://192.168.101.111:8080' +module.exports = baseUrl diff --git a/utils/font.wxss b/utils/font.wxss new file mode 100644 index 0000000..711917d --- /dev/null +++ b/utils/font.wxss @@ -0,0 +1,8 @@ + +@font-face { + font-family: "思源宋体 Light" !important; + font-weight: 300; + src: url("/pages/assets/img/EZSx3exf4cjI.woff2") format("woff2"), + url("/pages/assets/img/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..a508dea --- /dev/null +++ b/utils/http.js @@ -0,0 +1,85 @@ +var baseUrl = require('../utils/baseUrl') +var ajaxtimes = 0 +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){ + wx.showModal({ + title: '提示', + content: '登录已过期,请重新登录', + success (res) { + if (res.confirm) { + wx.reLaunch({ + url: '/pages/logo/logo', + }) + } else if (res.cancel) { + + } + } + }) + + }else{ + params.success && params.success(res.data) + } + }, + fail(err) { + params.fail && params.fail(err) + }, + complete(){ + //完成一次请求就减一 + ajaxtimes--; + if(ajaxtimes===0){ + wx.hideLoading() + } + }, + }) + } +} diff --git a/utils/tool.wxs b/utils/tool.wxs new file mode 100644 index 0000000..126f031 --- /dev/null +++ b/utils/tool.wxs @@ -0,0 +1,18 @@ +function images(status,value) { + if(value<6){ + return status != '0' ? '/pages/assets/img/jichu.png':'/pages/assets/img/jichu1.png' + }else if(value>5 && value<9){ + return status != '0' ? '/pages/assets/img/tese.png':'/pages/assets/img/tece1.png' + }else{ + return status != '0' ? '/pages/assets/img/mofan.png':'/pages/assets/img/mofan1.png' + } +} + + + + + + +module.exports = { + +} \ 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 +}