diff --git a/app.json b/app.json
index 65c9d33..337f3eb 100644
--- a/app.json
+++ b/app.json
@@ -9,13 +9,17 @@
{
"root": "pagesA",
"pages": [
- "pages/askingSy/askingSy"
+ "pages/carouselDetail/carouselDetail"
]
},
{
"root": "pagesB",
"pages": [
- "pages/repository/repository"
+ "pages/administrativeDivision/administrativeDivision",
+ "pages/training/training",
+ "pages/wzDetails/wzDetails",
+ "pages/spDetails/spDetails",
+ "pages/publishAdd/publishAdd"
],
"independent": true
}
diff --git a/pages/home/home.js b/pages/home/home.js
index 900b722..d76aa24 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -7,8 +7,7 @@ Page({
baseUrl: baseUrl,
swiperList: [],
articleList:[
- {title:'文章发布',describe:'快速发布养殖知识',icon:'/pages/images/fkjy.png'},
- {title:'在线学习',describe:'视频培训发布',icon:'/pages/images/tx.png'}
+ {title:'发布信息',describe:'快速发布养殖知识|视频培训发布',icon:'/pages/images/fkjy.png'},
],
// 通知公告数据
currentNotice: 0,
@@ -33,6 +32,15 @@ Page({
})
},
+
+ // 跳转发布信息
+ bindPx() {
+ wx.navigateTo({
+ url: '/pagesB/pages/training/training',
+ })
+ },
+
+
// 在线问答列表
getforumList() {
http.forumList({
@@ -73,34 +81,7 @@ Page({
})
},
- // 灾害/通知公告
- 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() {
@@ -200,7 +181,6 @@ Page({
},
onLoad() {
- this.getDisaster()
this.getCarousel()
this.getLocation()
this.getforumList()
@@ -276,7 +256,6 @@ Page({
// 重新加载所有数据
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))
diff --git a/pages/home/home.wxml b/pages/home/home.wxml
index e5f58ab..da8165c 100644
--- a/pages/home/home.wxml
+++ b/pages/home/home.wxml
@@ -17,10 +17,6 @@
-
-
-
-
@@ -71,7 +67,7 @@
-
+
{{item.title}}
{{item.describe}}
diff --git a/pages/home/home.wxss b/pages/home/home.wxss
index 1f1675d..78e70d4 100644
--- a/pages/home/home.wxss
+++ b/pages/home/home.wxss
@@ -13,21 +13,7 @@
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;
@@ -267,7 +253,7 @@
display: flex;
align-items: center;
justify-content: space-between;
- padding: 10rpx 30rpx;
+ padding: 20rpx 30rpx;
margin-top: 30rpx;
}
.article2 view:first-child{
@@ -276,7 +262,7 @@
.article2 view:last-child{
color: #C5C6CC;
font-size: 24rpx;
- margin-top: 10rpx;
+ margin-top: 20rpx;
}
.article3 image{
width: 100rpx;
diff --git a/pages/images/sjh.png b/pages/images/sjh.png
new file mode 100644
index 0000000..eecea1b
Binary files /dev/null and b/pages/images/sjh.png differ
diff --git a/pagesA/images/jh.png b/pagesA/images/jh.png
new file mode 100644
index 0000000..ce4d71f
Binary files /dev/null and b/pagesA/images/jh.png differ
diff --git a/pagesA/pages/askingSy/askingSy.js b/pagesA/pages/askingSy/askingSy.js
deleted file mode 100644
index cd87bc3..0000000
--- a/pagesA/pages/askingSy/askingSy.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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
deleted file mode 100644
index 8835af0..0000000
--- a/pagesA/pages/askingSy/askingSy.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/pagesA/pages/askingSy/askingSy.wxml b/pagesA/pages/askingSy/askingSy.wxml
deleted file mode 100644
index 2930432..0000000
--- a/pagesA/pages/askingSy/askingSy.wxml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-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
deleted file mode 100644
index 19af59e..0000000
--- a/pagesA/pages/askingSy/askingSy.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* pagesA/pages/askingSy/askingSy.wxss */
\ No newline at end of file
diff --git a/pagesA/pages/carouselDetail/carouselDetail.js b/pagesA/pages/carouselDetail/carouselDetail.js
new file mode 100644
index 0000000..c75096e
--- /dev/null
+++ b/pagesA/pages/carouselDetail/carouselDetail.js
@@ -0,0 +1,154 @@
+import http from '../../../utils/api';
+const baseUrl = require('../../../utils/baseUrl');
+
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ baseUrl: baseUrl,
+ detailInfo: {},
+ id: null,
+ cardAnimation: {} // 卡片动画数据
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ if (options.id) {
+ this.setData({ id: options.id });
+ this.getCarouselDetail(options.id);
+ this.initAnimation();
+ } else {
+ wx.showToast({
+ title: '参数错误',
+ icon: 'none'
+ });
+ }
+ },
+
+ /**
+ * 初始化卡片动画
+ */
+ initAnimation() {
+ const animation = wx.createAnimation({
+ duration: 600,
+ timingFunction: 'ease-out',
+ delay: 100
+ });
+
+ animation.translateY(0).opacity(1).step();
+
+ this.setData({
+ cardAnimation: animation.export()
+ });
+ },
+
+ /**
+ * 获取轮播详情
+ */
+ getCarouselDetail(id) {
+ wx.showLoading({ title: '加载中...', mask: true });
+
+ http.carouselDetail({
+ data: { id: id },
+ success: (res) => {
+ wx.hideLoading();
+ console.log('轮播详情:', res);
+
+ if (res && res.code === 200 && res.data) {
+ this.setData({
+ detailInfo: res.data
+ });
+ wx.setNavigationBarTitle({
+ title: res.data.title || '轮播详情'
+ });
+ } else {
+ wx.showToast({
+ title: res?.msg || '数据加载失败',
+ icon: 'none'
+ });
+ }
+ },
+ fail: (err) => {
+ wx.hideLoading();
+ console.error('请求失败:', err);
+ wx.showToast({
+ title: '网络错误',
+ icon: 'none'
+ });
+ }
+ });
+ },
+
+ /**
+ * 颜色调整函数(用于渐变效果)
+ */
+ adjustColor(hex, percent) {
+ if (!hex) return '#4CAF50';
+ // 简单实现:如果传入颜色,返回稍浅的版本
+ // 这里为了简化,直接返回原色稍微变浅,实际项目中可使用颜色处理库
+ return hex;
+ },
+
+ /**
+ * 图片加载错误处理
+ */
+ imageLoadError(e) {
+ console.warn('图片加载失败', e);
+
+ },
+
+
+ /**
+ * 返回上一页
+ */
+ goBack() {
+ wx.navigateBack({
+ delta: 1
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {},
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {},
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {},
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {},
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {},
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {},
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+ const { title, imageUrl } = this.data.detailInfo;
+ return {
+ title: title || '轮播详情',
+ imageUrl: this.data.baseUrl + (imageUrl || ''),
+ path: `/pages/carousel/detail/detail?id=${this.data.id}`
+ };
+ }
+});
\ No newline at end of file
diff --git a/pagesA/pages/carouselDetail/carouselDetail.json b/pagesA/pages/carouselDetail/carouselDetail.json
new file mode 100644
index 0000000..faa193e
--- /dev/null
+++ b/pagesA/pages/carouselDetail/carouselDetail.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText":"轮播详情",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pagesA/pages/carouselDetail/carouselDetail.wxml b/pagesA/pages/carouselDetail/carouselDetail.wxml
new file mode 100644
index 0000000..8903e06
--- /dev/null
+++ b/pagesA/pages/carouselDetail/carouselDetail.wxml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+ ←
+
+
+
+
+ {{detailInfo.adsType}}
+
+
+
+
+
+
+
+
+ {{detailInfo.title || '无标题'}}
+ {{detailInfo.subtitle || '暂无副标题'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 📐
+
+ 图片尺寸
+ {{detailInfo.imageSize}}
+
+
+
+
+
+ 👁️
+
+ 浏览次数
+ {{detailInfo.viewCount}}
+
+
+
+
+
+
+ 📅
+
+ 创建时间
+ {{detailInfo.createdAt}}
+
+
+
+
+
+ 🔄
+
+ 更新时间
+ {{detailInfo.updatedAt}}
+
+
+
+
+
+ ⚡
+
+ 状态
+
+
+ {{detailInfo.isActive === 1 ? '有效' : '无效'}}
+
+
+
+
+
+
+
+
+
+
+ ✨
+ 长期有效
+
+
+
\ No newline at end of file
diff --git a/pagesA/pages/carouselDetail/carouselDetail.wxss b/pagesA/pages/carouselDetail/carouselDetail.wxss
new file mode 100644
index 0000000..a2bb5b5
--- /dev/null
+++ b/pagesA/pages/carouselDetail/carouselDetail.wxss
@@ -0,0 +1,284 @@
+.carousel-detail-container {
+ min-height: 100vh;
+ background-color: var(--bg-color, #F8F9FA);
+ position: relative;
+ padding-bottom: 40rpx;
+ }
+
+ /* 沉浸式头部 */
+ .hero-section {
+ position: relative;
+ width: 100%;
+ height: 600rpx;
+ overflow: hidden;
+ }
+
+ .hero-image {
+ width: 100%;
+ height: 100%;
+ filter: brightness(0.9);
+ transition: transform 0.3s ease;
+ }
+
+ .hero-image:active {
+ transform: scale(1.02);
+ }
+
+ .hero-overlay {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 200rpx;
+ pointer-events: none;
+ }
+
+ /* 毛玻璃返回按钮 */
+ .nav-back {
+ position: absolute;
+ top: 60rpx;
+ left: 30rpx;
+ width: 72rpx;
+ height: 72rpx;
+ border-radius: 36rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 40rpx;
+ color: #333;
+ z-index: 10;
+ }
+
+ .glass {
+ background: rgba(255, 255, 255, 0.25);
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ border: 1rpx solid rgba(255, 255, 255, 0.3);
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
+ }
+
+ .page-title {
+ position: absolute;
+ top: 60rpx;
+ right: 30rpx;
+ padding: 16rpx 32rpx;
+ border-radius: 40rpx;
+ font-size: 26rpx;
+ color: #333;
+ font-weight: 500;
+ z-index: 10;
+ letter-spacing: 1rpx;
+ }
+
+ /* 主要内容卡片 */
+ .content-card {
+ margin: -100rpx 30rpx 0;
+ background: rgba(255, 255, 255, 0.95);
+ backdrop-filter: blur(20px);
+ -webkit-backdrop-filter: blur(20px);
+ border-radius: 48rpx;
+ padding: 48rpx 32rpx;
+ box-shadow: 0 30rpx 60rpx rgba(0, 0, 0, 0.1),
+ 0 10rpx 30rpx rgba(0, 0, 0, 0.05);
+ position: relative;
+ z-index: 5;
+ border: 1rpx solid rgba(255, 255, 255, 0.5);
+ opacity: 0;
+ transform: translateY(50rpx);
+ animation: cardFloat 0.6s ease-out forwards;
+ }
+
+ @keyframes cardFloat {
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ /* 标题区域 */
+ .title-section {
+ margin-bottom: 40rpx;
+ }
+
+ .main-title {
+ display: block;
+ font-size: 56rpx;
+ font-weight: 700;
+ line-height: 1.3;
+ margin-bottom: 16rpx;
+ letter-spacing: -0.5rpx;
+ }
+
+ .sub-title {
+ display: block;
+ font-size: 30rpx;
+ color: #666;
+ line-height: 1.5;
+ font-weight: 400;
+ opacity: 0.8;
+ }
+
+ /* 装饰分割线 */
+ .divider {
+ display: flex;
+ align-items: center;
+ margin: 30rpx 0 40rpx;
+ }
+
+ .divider-line {
+ flex: 1;
+ height: 2rpx;
+ opacity: 0.2;
+ }
+
+ .divider-dot {
+ width: 8rpx;
+ height: 8rpx;
+ border-radius: 4rpx;
+ margin: 0 20rpx;
+ opacity: 0.5;
+ }
+
+ /* 信息网格 */
+ .info-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 24rpx;
+ margin-bottom: 40rpx;
+ }
+
+ .info-item {
+ background: rgba(0, 0, 0, 0.02);
+ border-radius: 28rpx;
+ padding: 28rpx 20rpx;
+ display: flex;
+ align-items: center;
+ border: 1rpx solid rgba(0, 0, 0, 0.03);
+ transition: all 0.3s ease;
+ }
+
+ .info-item:active {
+ transform: scale(0.98);
+ background: rgba(0, 0, 0, 0.04);
+ }
+
+ .info-icon {
+ font-size: 48rpx;
+ margin-right: 20rpx;
+ filter: drop-shadow(0 4rpx 8rpx rgba(0, 0, 0, 0.1));
+ }
+
+ .info-content {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .info-label {
+ font-size: 22rpx;
+ color: #999;
+ margin-bottom: 8rpx;
+ letter-spacing: 0.5rpx;
+ }
+
+ .info-value {
+ font-size: 28rpx;
+ font-weight: 600;
+ color: #333;
+ word-break: break-all;
+ }
+
+ /* 状态特殊样式 */
+ .status-item .info-content {
+ flex-direction: row;
+ align-items: center;
+ justify-content: space-between;
+ }
+
+ .status-badge {
+ display: flex;
+ align-items: center;
+ padding: 8rpx 16rpx;
+ border-radius: 40rpx;
+ border-width: 1rpx;
+ border-style: solid;
+ background-color: rgba(76, 175, 80, 0.1);
+ }
+
+ .status-dot {
+ width: 16rpx;
+ height: 16rpx;
+ border-radius: 8rpx;
+ margin-right: 8rpx;
+ animation: pulse 2s infinite;
+ }
+
+ @keyframes pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.6; }
+ }
+
+ .status-text {
+ font-size: 24rpx;
+ font-weight: 500;
+ }
+
+ /* 备注区域 */
+ .remark-section {
+ background: rgba(0, 0, 0, 0.02);
+ border-radius: 28rpx;
+ padding: 28rpx;
+ margin-bottom: 40rpx;
+ display: flex;
+ border-left: 8rpx solid var(--text-color, #2E7D32);
+ }
+
+ .remark-icon {
+ font-size: 40rpx;
+ margin-right: 20rpx;
+ }
+
+ .remark-content {
+ flex: 1;
+ font-size: 28rpx;
+ color: #444;
+ line-height: 1.6;
+ }
+
+
+ /* 始终有效标识 */
+ .always-valid {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 30rpx;
+ padding: 20rpx;
+ background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
+ border-radius: 40rpx;
+ border: 1rpx solid rgba(255, 215, 0, 0.3);
+ }
+
+ .valid-icon {
+ font-size: 32rpx;
+ margin-right: 12rpx;
+ animation: starTwinkle 1.5s infinite;
+ }
+
+ @keyframes starTwinkle {
+ 0%, 100% { opacity: 1; transform: scale(1); }
+ 50% { opacity: 0.7; transform: scale(1.1); }
+ }
+
+ .valid-text {
+ font-size: 26rpx;
+ color: #B8860B;
+ font-weight: 500;
+ }
+
+ /* 响应式调整 */
+ @media (min-width: 768px) {
+ .content-card {
+ max-width: 700rpx;
+ margin: -100rpx auto 0;
+ }
+ }
\ No newline at end of file
diff --git a/pagesB/images/bo.png b/pagesB/images/bo.png
new file mode 100644
index 0000000..70f5106
Binary files /dev/null and b/pagesB/images/bo.png differ
diff --git a/pagesB/images/hf.png b/pagesB/images/hf.png
new file mode 100644
index 0000000..02b5a9f
Binary files /dev/null and b/pagesB/images/hf.png differ
diff --git a/pagesB/images/lll.png b/pagesB/images/lll.png
new file mode 100644
index 0000000..e40135b
Binary files /dev/null and b/pagesB/images/lll.png differ
diff --git a/pagesB/images/sou.png b/pagesB/images/sou.png
new file mode 100644
index 0000000..f90d5d6
Binary files /dev/null and b/pagesB/images/sou.png differ
diff --git a/pagesB/pages/administrativeDivision/administrativeDivision.js b/pagesB/pages/administrativeDivision/administrativeDivision.js
new file mode 100644
index 0000000..028d847
--- /dev/null
+++ b/pagesB/pages/administrativeDivision/administrativeDivision.js
@@ -0,0 +1,286 @@
+import http from '../../../utils/api'
+
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ regionList: [], // 当前显示的区域列表
+ selectedRegions: [], // 已选择的区域路径
+ currentParentCode: '', // 当前父级code
+ loading: false,
+ showPicker: false,
+ regionTitle: '请选择区域',
+ autoShowPicker: false // 新增:控制是否自动弹出选择器
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ // 首次加载,获取第一级数据
+ this.getRegionData('', () => {
+ // 首次加载完成后自动弹出选择器
+ this.setData({
+ showPicker: true,
+ regionTitle: '请选择区域'
+ })
+ })
+ },
+
+ // 获取区域数据
+ getRegionData(parentCode, callback) {
+ this.setData({
+ loading: true
+ })
+
+ http.areaChildren({
+ data: {
+ parentCode: parentCode || ''
+ },
+ success: res => {
+ console.log('区域数据响应:', res)
+ if (res.code === 200 && res.data && res.data.length > 0) {
+ this.setData({
+ regionList: res.data,
+ currentParentCode: parentCode,
+ loading: false
+ })
+ } else {
+ // 没有更多数据了,说明已经是最后一级
+ this.setData({
+ loading: false,
+ regionList: []
+ })
+
+ // 如果是最后一级,关闭选择器
+ if (this.data.showPicker) {
+ this.setData({
+ showPicker: false
+ })
+ wx.showToast({
+ title: '已选择到最后一级',
+ icon: 'none'
+ })
+ }
+ }
+
+ // 执行回调
+ if (callback) {
+ callback()
+ }
+ },
+ fail: err => {
+ console.error('请求失败:', err)
+ this.setData({
+ loading: false
+ })
+ wx.showToast({
+ title: '加载失败',
+ icon: 'none'
+ })
+
+ if (callback) {
+ callback()
+ }
+ }
+ })
+ },
+
+ // 开始选择(点击按钮时调用)
+ startSelection() {
+ // 如果还没有选择任何区域,重新加载第一级
+ if (this.data.selectedRegions.length === 0) {
+ this.getRegionData('', () => {
+ this.setData({
+ showPicker: true,
+ regionTitle: '请选择区域'
+ })
+ })
+ } else {
+ // 如果有已选择的区域,加载下一级
+ const lastRegion = this.data.selectedRegions[this.data.selectedRegions.length - 1]
+ this.loadAndShowNextLevel(lastRegion.code)
+ }
+ },
+
+ // 加载并显示下一级区域选择器
+ loadAndShowNextLevel(parentCode) {
+ this.getRegionData(parentCode, () => {
+ if (this.data.regionList.length > 0) {
+ // 有下一级数据,自动弹出选择器
+ this.setData({
+ showPicker: true,
+ regionTitle: `请选择${this.data.selectedRegions[this.data.selectedRegions.length - 1].name}的下一级区域`
+ })
+ } else {
+ // 没有下一级数据,提示用户
+ wx.showToast({
+ title: '已经是最后一级,无法继续选择',
+ icon: 'none'
+ })
+ }
+ })
+ },
+
+ // 关闭选择器
+ closePicker() {
+ this.setData({
+ showPicker: false
+ })
+ },
+
+ // 选择区域
+ selectRegion(e) {
+ const index = e.currentTarget.dataset.index
+ const region = this.data.regionList[index]
+
+ console.log('选择的区域:', region)
+
+ // 获取当前已选择的最后一级
+ const lastSelectedRegion = this.data.selectedRegions.length > 0 ?
+ this.data.selectedRegions[this.data.selectedRegions.length - 1] :
+ null
+
+ // 检查是否是同级选择(替换最后一级)
+ const isSameLevel = lastSelectedRegion &&
+ lastSelectedRegion.parentCode === region.parentCode
+
+ let selectedRegions = [...this.data.selectedRegions]
+
+ if (isSameLevel) {
+ // 同级选择,替换最后一级
+ selectedRegions[selectedRegions.length - 1] = {
+ code: region.code,
+ name: region.name,
+ parentCode: region.parentCode
+ }
+ } else {
+ // 选择下一级,添加到路径
+ selectedRegions.push({
+ code: region.code,
+ name: region.name,
+ parentCode: region.parentCode
+ })
+ }
+
+ this.setData({
+ selectedRegions
+ })
+
+ // 关闭当前选择器
+ this.setData({
+ showPicker: false
+ })
+
+ // 延迟一段时间后自动加载并显示下一级选择器
+ setTimeout(() => {
+ this.loadAndShowNextLevel(region.code)
+ }, 300)
+ },
+
+ // 重新选择(点击已选择的任意层级)
+ reSelectRegion(e) {
+ const index = e.currentTarget.dataset.index
+
+ // 截断到指定级别(包括点击的层级)
+ const selectedRegions = this.data.selectedRegions.slice(0, index + 1)
+
+ this.setData({
+ selectedRegions
+ })
+
+ // 获取该层级的数据
+ const targetRegion = selectedRegions[selectedRegions.length - 1]
+
+ // 获取点击层级的同级数据并显示选择器
+ this.getRegionData(targetRegion.parentCode, () => {
+ this.setData({
+ showPicker: true,
+ regionTitle: index === 0 ?
+ '请选择区域' :
+ `请选择${this.data.selectedRegions[index - 1]?.name || '区域'}的下一级`
+ })
+ })
+ },
+
+ // 完成选择
+ completeSelection() {
+ if (this.data.selectedRegions.length === 0) {
+ wx.showToast({
+ title: '请先选择区域',
+ icon: 'none'
+ })
+ return
+ }
+
+ const lastRegion = this.data.selectedRegions[this.data.selectedRegions.length - 1]
+
+ // 这里可以调用你的业务接口,传递parentCode
+ this.submitRegion(lastRegion.code)
+ },
+
+ // 提交选择的区域(示例)
+ submitRegion(parentCode) {
+ console.log('提交的parentCode:', parentCode)
+ console.log('完整选择路径:', this.data.selectedRegions)
+ http.userCode({
+ data: {
+ areaCode: parentCode
+ },
+ success: res => {
+ console.log(11111, res);
+ if (res.code == 200) {
+ wx.showModal({
+ title: '选择完成',
+ content: `已选择到: ${this.data.selectedRegions.map(r => r.name).join(' > ')}`,
+ showCancel: false,
+ success: (res) => {
+ if (res.confirm) {
+ wx.switchTab({
+ url: '/pages/home/home',
+ })
+ }
+ }
+ })
+ }
+ }
+ })
+
+
+ },
+
+ // 重置选择
+ resetSelection() {
+ wx.showModal({
+ title: '确认重置',
+ content: '确定要重置所有选择吗?',
+ success: (res) => {
+ if (res.confirm) {
+ this.setData({
+ selectedRegions: [],
+ regionList: [],
+ currentParentCode: '',
+ showPicker: false
+ })
+
+ // 重新获取第一级数据
+ this.getRegionData('', () => {
+ // 重置后自动弹出第一级选择器
+ this.setData({
+ showPicker: true,
+ regionTitle: '请选择区域'
+ })
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ }
+})
\ No newline at end of file
diff --git a/pagesB/pages/administrativeDivision/administrativeDivision.json b/pagesB/pages/administrativeDivision/administrativeDivision.json
new file mode 100644
index 0000000..d5f59cc
--- /dev/null
+++ b/pagesB/pages/administrativeDivision/administrativeDivision.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText":"区域选择",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pagesB/pages/administrativeDivision/administrativeDivision.wxml b/pagesB/pages/administrativeDivision/administrativeDivision.wxml
new file mode 100644
index 0000000..24e78af
--- /dev/null
+++ b/pagesB/pages/administrativeDivision/administrativeDivision.wxml
@@ -0,0 +1,95 @@
+
+
+
+ 已选择:
+
+
+ {{item.name}}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+
+
+
+ {{item.name}}
+
+ ›
+
+
+
+
+
+ {{selectedRegions.length > 0 ? '已选择到最后一级' : '暂无区域数据'}}
+
+
+
+
+
+
+
+
+
+ 使用说明:
+ 1. 点击"开始选择区域"开始选择\n2. 选择后会加载下一级区域\n3. 点击已选择区域的任意级别可以重新选择\n4. 选择最后一级时会直接替换\n5. 完成选择后点击"完成选择"按钮
+
+
\ No newline at end of file
diff --git a/pagesB/pages/administrativeDivision/administrativeDivision.wxss b/pagesB/pages/administrativeDivision/administrativeDivision.wxss
new file mode 100644
index 0000000..524ead8
--- /dev/null
+++ b/pagesB/pages/administrativeDivision/administrativeDivision.wxss
@@ -0,0 +1,316 @@
+.container {
+ padding: 30rpx;
+ min-height: 100vh;
+ background: #f5f5f5;
+}
+
+/* 已选择路径 */
+.selected-path {
+ background: white;
+ border-radius: 16rpx;
+ padding: 30rpx;
+ margin-bottom: 30rpx;
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
+}
+
+.path-title {
+ font-size: 28rpx;
+ color: #666;
+ display: block;
+ margin-bottom: 20rpx;
+}
+
+.path-items {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ margin-bottom: 20rpx;
+}
+
+.path-item {
+ display: flex;
+ align-items: center;
+ padding: 12rpx 20rpx;
+ background: #f0f8ff;
+ border-radius: 8rpx;
+ margin-right: 10rpx;
+ margin-bottom: 10rpx;
+ cursor: pointer;
+}
+
+.path-item:active {
+ background: #e1f0ff;
+}
+
+.path-item.last {
+ background: #e6f7ff;
+ border: 1rpx solid #1890ff;
+}
+
+.path-item text:first-child {
+ font-size: 28rpx;
+ color: #1890ff;
+ font-weight: 500;
+}
+
+.separator {
+ margin-left: 10rpx;
+ color: #999;
+}
+
+
+/* 选择按钮 */
+.select-btn-container {
+ margin: 40rpx 0;
+}
+
+.select-btn {
+ width: 100%;
+ background: linear-gradient(135deg, #1890ff, #096dd9);
+ color: white;
+ border-radius: 12rpx;
+ font-size: 32rpx;
+ height: 88rpx;
+ line-height: 88rpx;
+ border: none;
+}
+
+.select-btn::after {
+ border: none;
+}
+
+.select-btn[loading] {
+ opacity: 0.8;
+}
+
+.select-btn:active {
+ opacity: 0.9;
+}
+
+/* 操作按钮 */
+.action-buttons {
+ display: flex;
+ gap: 20rpx;
+ margin-top: 50rpx;
+}
+
+.btn {
+ flex: 1;
+ border-radius: 12rpx;
+ font-size: 28rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ border: none;
+}
+
+.btn::after {
+ border: none;
+}
+
+.complete-btn {
+ background: #07c160;
+ color: white;
+}
+
+.complete-btn[disabled] {
+ background: #ccc;
+ color: #999;
+}
+
+.complete-btn:active:not([disabled]) {
+ background: #06ad56;
+}
+
+.reset-btn {
+ background: #fff;
+ color: #ff4d4f;
+ border: 1rpx solid #ff4d4f !important;
+}
+
+.reset-btn:active {
+ background: #fff5f5;
+}
+
+/* 选择器模态框 */
+.picker-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 1000;
+}
+
+.picker-mask {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.5);
+ animation: fadeIn 0.3s ease;
+}
+
+.picker-content {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background: white;
+ border-radius: 32rpx 32rpx 0 0;
+ max-height: 70vh;
+ display: flex;
+ flex-direction: column;
+ animation: slideUp 0.3s ease;
+}
+
+.picker-header {
+ padding: 32rpx 40rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ position: relative;
+}
+
+.picker-title {
+ font-size: 32rpx;
+ color: #333;
+ font-weight: 600;
+ flex: 1;
+ text-align: center;
+}
+
+.picker-close {
+ font-size: 48rpx;
+ color: #999;
+ position: absolute;
+ right: 30rpx;
+ top: 50%;
+ transform: translateY(-50%);
+ width: 60rpx;
+ height: 60rpx;
+ text-align: center;
+ line-height: 60rpx;
+}
+
+.picker-close:active {
+ background: #f5f5f5;
+ border-radius: 50%;
+}
+
+.picker-body {
+ flex: 1;
+ overflow: hidden;
+}
+
+/* 加载状态 */
+.loading-container {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ height: 300rpx;
+}
+
+.loading-spinner {
+ width: 60rpx;
+ height: 60rpx;
+ border: 4rpx solid #f0f0f0;
+ border-top-color: #1890ff;
+ border-radius: 50%;
+ animation: spin 1s linear infinite;
+ margin-bottom: 20rpx;
+}
+
+.loading-text {
+ font-size: 28rpx;
+ color: #999;
+}
+
+/* 区域列表 */
+.region-list {
+ height: 60vh;
+}
+
+.region-item {
+ padding: 32rpx 40rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.region-item:active {
+ background: #f5f5f5;
+}
+
+.region-info {
+ flex: 1;
+}
+
+.region-name {
+ font-size: 30rpx;
+ color: #333;
+ display: block;
+ margin-bottom: 8rpx;
+}
+
+.arrow {
+ color: #ccc;
+ font-size: 36rpx;
+ margin-left: 20rpx;
+}
+
+/* 空状态 */
+.empty-state {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 200rpx;
+}
+
+.empty-text {
+ font-size: 28rpx;
+ color: #999;
+}
+
+/* 使用说明 */
+.instruction {
+ margin-top: 60rpx;
+ padding: 24rpx;
+ background: white;
+ border-radius: 12rpx;
+ border-left: 6rpx solid #1890ff;
+}
+
+.instruction-title {
+ font-size: 28rpx;
+ color: #1890ff;
+ font-weight: 600;
+ display: block;
+ margin-bottom: 16rpx;
+}
+
+.instruction-text {
+ font-size: 26rpx;
+ color: #666;
+ line-height: 1.6;
+ white-space: pre-line;
+}
+
+/* 动画 */
+@keyframes fadeIn {
+ from { opacity: 0; }
+ to { opacity: 1; }
+}
+
+@keyframes slideUp {
+ from { transform: translateY(100%); }
+ to { transform: translateY(0); }
+}
+
+@keyframes spin {
+ from { transform: rotate(0deg); }
+ to { transform: rotate(360deg); }
+}
\ No newline at end of file
diff --git a/pagesB/pages/publishAdd/publishAdd.js b/pagesB/pages/publishAdd/publishAdd.js
new file mode 100644
index 0000000..2639ad4
--- /dev/null
+++ b/pagesB/pages/publishAdd/publishAdd.js
@@ -0,0 +1,580 @@
+import http from '../../../utils/api'
+const baseUrl = require('../../../utils/baseUrl')
+
+Page({
+ data: {
+ baseUrl,
+ currentTab: 'article',
+
+ // 文章相关
+ articleForm: {
+ title: '',
+ subtitle: '',
+ category: '',
+ content: '',
+ coverImage: '' // 这里存储服务器返回的文件名
+ },
+ articleCoverTemp: '', // 本地临时路径,用于预览
+ articleCategory: null,
+ articleCategories: [],
+
+ // 视频相关
+ videoForm: {
+ title: '',
+ description: '',
+ category: '',
+ videoUrl: '', // 这里存储服务器返回的视频文件名
+ coverImage: '' // 这里存储服务器返回的封面文件名
+ },
+ videoCoverTemp: '', // 本地临时路径,用于预览
+ videoUrlTemp: '', // 本地临时路径,用于显示
+ videoCategory: null,
+ videoCategories: [],
+
+ // UI状态
+ submitting: false,
+ isUploading: false, // 防止重复上传
+ showLoadingMask: false, // 显示加载遮罩层
+ loadingText: '发布中...', // 加载提示文字
+
+ // 表单验证状态
+ articleFormValid: false,
+ videoFormValid: false,
+ },
+
+ onLoad() {
+ this.getArticleCategories()
+ this.getVideoCategories()
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+ // 页面卸载时重置状态
+ this.setData({
+ submitting: false,
+ showLoadingMask: false
+ });
+ },
+
+ // 获取文章分类
+ getArticleCategories() {
+ http.articleZd({
+ data: {
+ dictType: 'article_category'
+ },
+ success: res => {
+ if (res.rows) {
+ this.setData({
+ articleCategories: res.rows
+ })
+ }
+ }
+ })
+ },
+
+ // 获取视频分类
+ getVideoCategories() {
+ http.videoZd({
+ data: {
+ dictType: 'video_category'
+ },
+ success: res => {
+ if (res.rows) {
+ this.setData({
+ videoCategories: res.rows
+ })
+ }
+ }
+ })
+ },
+
+ // 切换标签
+ switchTab(e) {
+ const type = e.currentTarget.dataset.type
+ if (type === this.data.currentTab) return
+ this.setData({ currentTab: type })
+ },
+
+ // 验证文章表单
+ validateArticleForm() {
+ const { articleForm } = this.data
+ const isValid = !!(articleForm.title?.trim() && articleForm.category && articleForm.content?.trim())
+ this.setData({ articleFormValid: isValid })
+ return isValid
+ },
+
+ // 验证视频表单
+ validateVideoForm() {
+ const { videoForm } = this.data
+ const isValid = !!(videoForm.title?.trim() && videoForm.category && videoForm.videoUrl)
+ this.setData({ videoFormValid: isValid })
+ return isValid
+ },
+
+ // 文章输入处理
+ onArticleInput(e) {
+ const field = e.currentTarget.dataset.field
+ const value = e.detail.value
+ this.setData({
+ [`articleForm.${field}`]: value
+ }, () => {
+ this.validateArticleForm()
+ })
+ },
+
+ // 视频输入处理
+ onVideoInput(e) {
+ const field = e.currentTarget.dataset.field
+ const value = e.detail.value
+ this.setData({
+ [`videoForm.${field}`]: value
+ }, () => {
+ this.validateVideoForm()
+ })
+ },
+
+ // 文章分类选择
+ onArticleCategoryChange(e) {
+ const index = e.detail.value
+ const category = this.data.articleCategories[index]
+ this.setData({
+ 'articleForm.category': category.dictValue,
+ articleCategory: category
+ }, () => {
+ this.validateArticleForm()
+ })
+ },
+
+ // 视频分类选择
+ onVideoCategoryChange(e) {
+ const index = e.detail.value
+ const category = this.data.videoCategories[index]
+ this.setData({
+ 'videoForm.category': category.dictValue,
+ videoCategory: category
+ }, () => {
+ this.validateVideoForm()
+ })
+ },
+
+ // 选择封面图片(文章或视频)
+ chooseCover(e) {
+ if (this.data.isUploading) {
+ wx.showToast({
+ title: '正在上传中,请稍候',
+ icon: 'none'
+ });
+ return;
+ }
+
+ const type = e.currentTarget.dataset.type
+
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['image'],
+ sourceType: ['album', 'camera'],
+ sizeType: ['compressed'],
+ success: (res) => {
+ if (res.tempFiles && res.tempFiles.length > 0) {
+ this.setData({
+ isUploading: true
+ });
+
+ // 显示加载提示
+ wx.showLoading({
+ title: '上传图片中...',
+ mask: true
+ });
+
+ // 上传图片
+ this.uploadImage(res.tempFiles[0].tempFilePath, type);
+ }
+ }
+ });
+ },
+
+ // 上传单张图片
+ uploadImage(tempPath, type) {
+ wx.uploadFile({
+ url: baseUrl + '/common/upload',
+ header: {
+ 'Authorization': 'Bearer ' + wx.getStorageSync('token')
+ },
+ filePath: tempPath,
+ name: 'file',
+ success: (uploadRes) => {
+ try {
+ const result = JSON.parse(uploadRes.data);
+ if (result.code === 200 || result.fileName) {
+ const serverPath = result.fileName || result.url;
+
+ if (type === 'article') {
+ // 文章封面
+ this.setData({
+ articleCoverTemp: tempPath,
+ 'articleForm.coverImage': serverPath,
+ isUploading: false
+ });
+ } else {
+ // 视频封面
+ this.setData({
+ videoCoverTemp: tempPath,
+ 'videoForm.coverImage': serverPath,
+ isUploading: false
+ }, () => {
+ this.validateVideoForm();
+ });
+ }
+
+ wx.hideLoading();
+ wx.showToast({
+ title: '上传成功',
+ icon: 'success'
+ });
+ } else {
+ throw new Error(result.msg || '上传失败');
+ }
+ } catch (error) {
+ wx.hideLoading();
+ this.setData({
+ isUploading: false
+ });
+ wx.showToast({
+ title: error.message || '上传失败',
+ icon: 'none'
+ });
+ }
+ },
+ fail: (error) => {
+ wx.hideLoading();
+ this.setData({
+ isUploading: false
+ });
+ wx.showToast({
+ title: '网络请求失败',
+ icon: 'none'
+ });
+ }
+ });
+ },
+
+ // 选择视频
+ chooseVideo() {
+ if (this.data.isUploading) {
+ wx.showToast({
+ title: '正在上传中,请稍候',
+ icon: 'none'
+ });
+ return;
+ }
+
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['video'],
+ sourceType: ['album', 'camera'],
+ maxDuration: 300,
+ success: (res) => {
+ if (res.tempFiles && res.tempFiles.length > 0) {
+ this.setData({
+ isUploading: true,
+ videoUrlTemp: res.tempFiles[0].tempFilePath // 先显示本地路径
+ });
+
+ // 显示加载提示
+ wx.showLoading({
+ title: '上传视频中...',
+ mask: true
+ });
+
+ // 上传视频
+ this.uploadVideo(res.tempFiles[0].tempFilePath);
+ }
+ }
+ });
+ },
+
+ // 上传视频
+ uploadVideo(tempPath) {
+ wx.uploadFile({
+ url: baseUrl + '/common/upload',
+ header: {
+ 'Authorization': 'Bearer ' + wx.getStorageSync('token')
+ },
+ filePath: tempPath,
+ name: 'file',
+ success: (uploadRes) => {
+ try {
+ const result = JSON.parse(uploadRes.data);
+ if (result.code === 200 || result.fileName) {
+ const serverPath = result.fileName || result.url;
+
+ this.setData({
+ 'videoForm.videoUrl': serverPath,
+ isUploading: false
+ }, () => {
+ this.validateVideoForm();
+ });
+
+ wx.hideLoading();
+ wx.showToast({
+ title: '上传成功',
+ icon: 'success'
+ });
+ } else {
+ throw new Error(result.msg || '上传失败');
+ }
+ } catch (error) {
+ wx.hideLoading();
+ this.setData({
+ videoUrlTemp: '', // 上传失败清空临时路径
+ isUploading: false
+ });
+ wx.showToast({
+ title: error.message || '上传失败',
+ icon: 'none'
+ });
+ }
+ },
+ fail: (error) => {
+ wx.hideLoading();
+ this.setData({
+ videoUrlTemp: '', // 上传失败清空临时路径
+ isUploading: false
+ });
+ wx.showToast({
+ title: '网络请求失败',
+ icon: 'none'
+ });
+ }
+ });
+ },
+
+ // 提交文章
+ submitArticle() {
+ const { articleForm, submitting, isUploading } = this.data
+
+ if (submitting) return
+
+ // 检查是否还有图片正在上传
+ if (isUploading) {
+ wx.showToast({
+ title: '图片正在上传中,请稍后提交',
+ icon: 'none'
+ });
+ return;
+ }
+
+ // 表单验证
+ if (!this.validateArticleForm()) {
+ if (!articleForm.title?.trim()) {
+ this.showError('请输入文章标题')
+ } else if (!articleForm.category) {
+ this.showError('请选择文章分类')
+ } else if (!articleForm.content?.trim()) {
+ this.showError('请输入文章内容')
+ }
+ return
+ }
+
+ // 显示加载遮罩层
+ this.setData({
+ submitting: true,
+ showLoadingMask: true,
+ loadingText: '发布中...'
+ });
+
+ // 构建提交数据
+ const submitData = {
+ title: articleForm.title.trim(),
+ subtitle: articleForm.subtitle?.trim() || '',
+ content: articleForm.content.trim(),
+ coverImage: articleForm.coverImage || '',
+ category: articleForm.category
+ }
+
+ // 调用接口
+ http.articleAdd({
+ data: submitData,
+ success: (res) => {
+ if (res.code == 200) {
+ this.setData({
+ loadingText: '发布成功'
+ });
+
+ setTimeout(() => {
+ this.setData({
+ submitting: false,
+ showLoadingMask: false
+ });
+
+ wx.showToast({
+ title: '发布成功',
+ icon: 'success',
+ duration: 1500,
+ success: () => {
+ setTimeout(() => {
+ wx.navigateBack()
+ }, 1500);
+ }
+ });
+ }, 1000);
+ } else {
+ this.setData({
+ loadingText: '发布失败'
+ });
+
+ setTimeout(() => {
+ this.setData({
+ submitting: false,
+ showLoadingMask: false
+ });
+
+ wx.showToast({
+ title: res.msg || '发布失败,请重试',
+ icon: 'none',
+ duration: 2000
+ });
+ }, 1000);
+ }
+ },
+ fail: (err) => {
+ this.setData({
+ loadingText: '网络错误'
+ });
+
+ setTimeout(() => {
+ this.setData({
+ submitting: false,
+ showLoadingMask: false
+ });
+
+ wx.showToast({
+ title: '网络异常,请检查网络后重试',
+ icon: 'none',
+ duration: 2000
+ });
+ }, 1000);
+ }
+ })
+ },
+
+ // 提交视频
+ submitVideo() {
+ const { videoForm, submitting, isUploading } = this.data
+
+ if (submitting) return
+
+ // 检查是否还有图片或视频正在上传
+ if (isUploading) {
+ wx.showToast({
+ title: '文件正在上传中,请稍后提交',
+ icon: 'none'
+ });
+ return;
+ }
+
+ // 表单验证
+ if (!this.validateVideoForm()) {
+ if (!videoForm.title?.trim()) {
+ this.showError('请输入视频标题')
+ } else if (!videoForm.category) {
+ this.showError('请选择视频分类')
+ } else if (!videoForm.videoUrl) {
+ this.showError('请选择视频')
+ }
+ return
+ }
+
+ // 显示加载遮罩层
+ this.setData({
+ submitting: true,
+ showLoadingMask: true,
+ loadingText: '发布中...'
+ });
+
+ // 构建提交数据
+ const submitData = {
+ title: videoForm.title.trim(),
+ description: videoForm.description?.trim() || '',
+ videoUrl: videoForm.videoUrl,
+ coverImage: videoForm.coverImage || '',
+ category: videoForm.category
+ }
+
+ // 调用接口
+ http.videoAdd({
+ data: submitData,
+ success: (res) => {
+ if (res.code == 200) {
+ this.setData({
+ loadingText: '发布成功'
+ });
+
+ setTimeout(() => {
+ this.setData({
+ submitting: false,
+ showLoadingMask: false
+ });
+
+ wx.showToast({
+ title: '发布成功',
+ icon: 'success',
+ duration: 1500,
+ success: () => {
+ setTimeout(() => {
+ wx.navigateBack()
+ }, 1500);
+ }
+ });
+ }, 1000);
+ } else {
+ this.setData({
+ loadingText: '发布失败'
+ });
+
+ setTimeout(() => {
+ this.setData({
+ submitting: false,
+ showLoadingMask: false
+ });
+
+ wx.showToast({
+ title: res.msg || '发布失败,请重试',
+ icon: 'none',
+ duration: 2000
+ });
+ }, 1000);
+ }
+ },
+ fail: (err) => {
+ this.setData({
+ loadingText: '网络错误'
+ });
+
+ setTimeout(() => {
+ this.setData({
+ submitting: false,
+ showLoadingMask: false
+ });
+
+ wx.showToast({
+ title: '网络异常,请检查网络后重试',
+ icon: 'none',
+ duration: 2000
+ });
+ }, 1000);
+ }
+ })
+ },
+
+ // 显示错误提示
+ showError(msg) {
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ duration: 2000
+ });
+ }
+})
\ No newline at end of file
diff --git a/pagesB/pages/publishAdd/publishAdd.json b/pagesB/pages/publishAdd/publishAdd.json
new file mode 100644
index 0000000..734e9ba
--- /dev/null
+++ b/pagesB/pages/publishAdd/publishAdd.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText":"发布",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pagesB/pages/publishAdd/publishAdd.wxml b/pagesB/pages/publishAdd/publishAdd.wxml
new file mode 100644
index 0000000..9b70b6c
--- /dev/null
+++ b/pagesB/pages/publishAdd/publishAdd.wxml
@@ -0,0 +1,205 @@
+
+
+
+
+
+
+
+
+
+
+
+ 发布文章
+
+
+ 发布视频
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagesB/pages/publishAdd/publishAdd.wxss b/pagesB/pages/publishAdd/publishAdd.wxss
new file mode 100644
index 0000000..f4eb7ae
--- /dev/null
+++ b/pagesB/pages/publishAdd/publishAdd.wxss
@@ -0,0 +1,457 @@
+.container {
+ min-height: 100vh;
+ background: linear-gradient(145deg, #f8f9ff 0%, #f0f2f6 100%);
+ position: relative;
+}
+
+/* 背景装饰 */
+.bg-decoration {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ pointer-events: none;
+ z-index: 0;
+}
+
+.circle {
+ position: absolute;
+ border-radius: 50%;
+ background: linear-gradient(135deg, rgba(7, 193, 96, 0.1) 0%, rgba(7, 193, 96, 0.05) 100%);
+}
+
+.circle-1 {
+ width: 400rpx;
+ height: 400rpx;
+ top: -100rpx;
+ right: -100rpx;
+ background: linear-gradient(135deg, rgba(64, 169, 255, 0.1) 0%, rgba(64, 169, 255, 0.05) 100%);
+}
+
+.circle-2 {
+ width: 300rpx;
+ height: 300rpx;
+ bottom: 100rpx;
+ left: -100rpx;
+ background: linear-gradient(135deg, rgba(255, 184, 0, 0.1) 0%, rgba(255, 184, 0, 0.05) 100%);
+}
+
+/* 切换卡片 */
+.tab-card {
+ margin: 30rpx 30rpx 20rpx;
+ background: rgba(255, 255, 255, 0.9);
+ backdrop-filter: blur(20px);
+ border-radius: 60rpx;
+ padding: 10rpx;
+ box-shadow:
+ 0 20rpx 40rpx rgba(0, 0, 0, 0.06),
+ 0 8rpx 20rpx rgba(0, 0, 0, 0.03),
+ inset 0 2rpx 4rpx rgba(255, 255, 255, 0.8);
+ border: 1px solid rgba(255, 255, 255, 0.9);
+ position: relative;
+ z-index: 10;
+ transition: all 0.3s ease;
+}
+
+/* 内层标签容器 */
+.category-tab {
+ display: flex;
+ background: rgba(0, 0, 0, 0.02);
+ border-radius: 56rpx;
+ padding: 6rpx;
+ gap: 6rpx;
+}
+
+/* 单个标签项 */
+.tab-item {
+ flex: 1;
+ text-align: center;
+ padding: 24rpx 0;
+ position: relative;
+ border-radius: 50rpx;
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
+ cursor: pointer;
+ overflow: hidden;
+}
+
+/* 标签文字 */
+.tab-text {
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #666;
+ letter-spacing: 2rpx;
+ position: relative;
+ z-index: 2;
+ transition: all 0.3s ease;
+}
+
+/* 选中状态 - 渐变背景 */
+.tab-item.active {
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ box-shadow:
+ 0 10rpx 20rpx rgba(102, 126, 234, 0.3),
+ 0 4rpx 8rpx rgba(0, 0, 0, 0.1),
+ inset 0 2rpx 4rpx rgba(255, 255, 255, 0.5);
+ transform: translateY(-2rpx);
+}
+
+/* 选中状态的文字 */
+.tab-item.active .tab-text {
+ color: #ffffff;
+ font-weight: 600;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
+}
+
+/* 添加光泽效果 */
+.tab-item.active::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(45deg,
+ rgba(255, 255, 255, 0.3) 0%,
+ rgba(255, 255, 255, 0.2) 20%,
+ transparent 50%);
+ border-radius: 50rpx;
+ pointer-events: none;
+ z-index: 1;
+}
+
+/* 添加微光动画 */
+.tab-item.active::after {
+ content: '';
+ position: absolute;
+ top: -50%;
+ left: -50%;
+ width: 200%;
+ height: 200%;
+ background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
+ opacity: 0.5;
+ animation: shimmer 3s infinite;
+ pointer-events: none;
+ z-index: 1;
+}
+
+/* 悬停效果 */
+@media (hover: hover) {
+ .tab-item:hover:not(.active) {
+ background: rgba(255, 255, 255, 0.8);
+ transform: translateY(-2rpx);
+ box-shadow: 0 8rpx 16rpx rgba(0, 0, 0, 0.05);
+ }
+
+ .tab-item:hover:not(.active) .tab-text {
+ color: #333;
+ }
+}
+
+/* 点击效果 */
+.tab-item:active {
+ transform: scale(0.98);
+}
+
+/* 微光动画 */
+@keyframes shimmer {
+ 0% {
+ transform: translateX(-100%) translateY(-100%) rotate(45deg);
+ opacity: 0;
+ }
+
+ 20% {
+ opacity: 0.5;
+ }
+
+ 40% {
+ transform: translateX(100%) translateY(100%) rotate(45deg);
+ opacity: 0;
+ }
+
+ 100% {
+ transform: translateX(100%) translateY(100%) rotate(45deg);
+ opacity: 0;
+ }
+}
+
+
+.tab-item.active:nth-child(1) {
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+}
+
+.tab-item.active:nth-child(2) {
+ background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);
+}
+
+.tab-item.active-bottom {
+ position: relative;
+}
+
+.tab-item.active-bottom::after {
+ content: '';
+ position: absolute;
+ bottom: -10rpx;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 60rpx;
+ height: 4rpx;
+ background: linear-gradient(90deg, #667eea, #764ba2);
+ border-radius: 4rpx;
+ animation: slideIn 0.3s ease;
+}
+
+/* 表单容器 */
+.form-container {
+ padding: 0 30rpx 40rpx;
+ position: relative;
+ z-index: 10;
+}
+
+.form-card {
+ background: rgba(255, 255, 255, 0.9);
+ backdrop-filter: blur(20px);
+ border-radius: 32rpx;
+ margin-bottom: 20rpx;
+ padding: 30rpx;
+ box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.02),
+ 0 2rpx 8rpx rgba(0, 0, 0, 0.01);
+ border: 1px solid rgba(255, 255, 255, 0.8);
+}
+
+.form-item {
+ width: 100%;
+}
+
+.label-wrapper {
+ display: flex;
+ align-items: center;
+ margin-bottom: 20rpx;
+}
+
+.label {
+ font-size: 28rpx;
+ font-weight: 600;
+ color: #333;
+ margin-right: 8rpx;
+}
+
+.required {
+ font-size: 24rpx;
+ color: #ff6b6b;
+ margin-left: 8rpx;
+}
+
+.optional {
+ font-size: 24rpx;
+ color: #999;
+ background: rgba(0, 0, 0, 0.03);
+ padding: 4rpx 12rpx;
+ border-radius: 20rpx;
+ margin-left: 8rpx;
+}
+
+.input {
+ width: 100%;
+ height: 88rpx;
+ background: #f8f9fc;
+ border-radius: 20rpx;
+ padding: 0 30rpx;
+ font-size: 28rpx;
+ color: #333;
+ border: 2rpx solid transparent;
+ box-sizing: border-box;
+}
+
+.input:focus {
+ border-color: #07c160;
+ background: #fff;
+}
+
+.placeholder {
+ color: #b8b8b8;
+ font-size: 28rpx;
+}
+
+.textarea {
+ width: 100%;
+ min-height: 240rpx;
+ background: #f8f9fc;
+ border-radius: 20rpx;
+ padding: 24rpx 30rpx;
+ font-size: 28rpx;
+ color: #333;
+ border: 2rpx solid transparent;
+ box-sizing: border-box;
+}
+
+.textarea:focus {
+ border-color: #07c160;
+ background: #fff;
+}
+
+.word-count {
+ display: block;
+ text-align: right;
+ font-size: 24rpx;
+ color: #999;
+ margin-top: 12rpx;
+}
+
+/* 分类选择器 */
+.category-selector {
+ width: 100%;
+ min-height: 88rpx;
+ display: flex;
+ align-items: center;
+}
+
+.category-badge {
+ display: inline-block;
+ padding: 16rpx 32rpx;
+ border-radius: 40rpx;
+ color: #648ac2;
+ font-size: 28rpx;
+ font-weight: 500;
+ box-shadow: 0 8rpx 16rpx rgba(0, 0, 0, 0.1);
+ letter-spacing: 1rpx;
+}
+
+.category-placeholder {
+ width: 100%;
+ height: 88rpx;
+ background: #f8f9fc;
+ border-radius: 20rpx;
+ padding: 0 30rpx;
+ font-size: 28rpx;
+ line-height: 88rpx;
+ color: #b8b8b8;
+ border: 2rpx solid transparent;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.category-placeholder .arrow {
+ font-size: 40rpx;
+ color: #999;
+ transform: rotate(90deg);
+ display: inline-block;
+}
+
+/* 上传器 */
+.uploader-wrapper {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+
+.uploader {
+ width: 220rpx;
+ height: 220rpx;
+ background: #f8f9fc;
+ border-radius: 24rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow: hidden;
+ border: 2rpx dashed #ddd;
+}
+
+.preview {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.upload-placeholder {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+
+.upload-placeholder .plus {
+ font-size: 60rpx;
+ color: #ccc;
+ line-height: 1;
+ margin-bottom: 8rpx;
+}
+
+.upload-placeholder .hint {
+ font-size: 22rpx;
+ color: #999;
+}
+
+.upload-tip {
+ font-size: 22rpx;
+ color: #999;
+ margin-top: 12rpx;
+}
+
+/* 视频选择器 */
+.video-picker {
+ width: 100%;
+ min-height: 120rpx;
+ background: #f8f9fc;
+ border-radius: 20rpx;
+ padding: 20rpx 30rpx;
+ box-sizing: border-box;
+ border: 2rpx dashed #ddd;
+}
+
+.video-info {
+ display: flex;
+ align-items: center;
+}
+
+.video-name {
+ font-size: 26rpx;
+ color: #333;
+ flex: 1;
+ word-break: break-all;
+}
+
+.video-placeholder {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 16rpx;
+ height: 80rpx;
+}
+
+.video-placeholder .plus {
+ font-size: 40rpx;
+ color: #ccc;
+}
+
+.video-placeholder .hint {
+ font-size: 26rpx;
+ color: #999;
+}
+
+/* 提交按钮 */
+.btn-wrapper {
+ margin-top: 40rpx;
+ padding: 0 20rpx;
+}
+
+.submit-btn {
+ width: 100%;
+ height: 96rpx;
+ background: linear-gradient(135deg, #07c160 0%, #08994d 100%);
+ color: #ffffff;
+ font-size: 32rpx;
+ font-weight: 600;
+ border-radius: 48rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 20rpx 40rpx rgba(7, 193, 96, 0.3);
+ border: none;
+}
+
+.submit-btn.disabled {
+ background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
+ box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.1);
+}
\ No newline at end of file
diff --git a/pagesB/pages/repository/repository.js b/pagesB/pages/repository/repository.js
deleted file mode 100644
index 185cc30..0000000
--- a/pagesB/pages/repository/repository.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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
deleted file mode 100644
index 8835af0..0000000
--- a/pagesB/pages/repository/repository.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/pagesB/pages/repository/repository.wxml b/pagesB/pages/repository/repository.wxml
deleted file mode 100644
index 15b0224..0000000
--- a/pagesB/pages/repository/repository.wxml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-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
deleted file mode 100644
index b112a0e..0000000
--- a/pagesB/pages/repository/repository.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* pagesB/pages/repository/repository.wxss */
\ No newline at end of file
diff --git a/pagesB/pages/spDetails/spDetails.js b/pagesB/pages/spDetails/spDetails.js
new file mode 100644
index 0000000..4deb4bd
--- /dev/null
+++ b/pagesB/pages/spDetails/spDetails.js
@@ -0,0 +1,381 @@
+// pages/training/videoDetail/videoDetail.js
+import http from '../../../utils/api'
+const baseUrl = require('../../../utils/baseUrl')
+
+Page({
+ data: {
+ baseUrl: baseUrl,
+ video: {},
+ videoUrl: '',
+ loading: true,
+ fullScreen: false,
+ isPlaying: false,
+ isMuted: false,
+ loop: false,
+ playbackRate: 1,
+ currentTime: 0,
+ duration: 0,
+ videoTags: [],
+ videoError: false,
+ autoplay: false,
+ controlsVisible: true,
+ controlsTimer: null,
+ lastTouchTime: 0,
+ },
+
+ onLoad(options) {
+ console.log('页面参数:', options)
+ this.getVideoDetails(options.id)
+ },
+
+ onReady() {
+ this.videoContext = wx.createVideoContext('videoPlayer', this)
+ console.log('视频上下文创建成功')
+ },
+
+ onUnload() {
+ // 清除定时器
+ if (this.data.controlsTimer) {
+ clearTimeout(this.data.controlsTimer)
+ }
+ // 页面卸载时停止播放
+ if (this.videoContext) {
+ this.videoContext.pause()
+ }
+ },
+
+ // 获取视频详情
+ getVideoDetails(id) {
+ this.setData({
+ loading: true,
+ videoError: false
+ })
+
+ http.videoDetails({
+ data: { id },
+ success: res => {
+ console.log('视频详情响应:', res)
+ if (res.code === 200 && res.data) {
+ const video = res.data
+ console.log('视频数据:', video)
+
+ // 处理视频URL
+ let videoUrl = ''
+ if (video.videoUrl) {
+ videoUrl = this.data.baseUrl + video.videoUrl
+ console.log('视频完整URL:', videoUrl)
+ }
+
+ // 处理视频标签
+ const tags = video.tags ? video.tags.split(',').filter(tag => tag.trim()) : []
+
+ this.setData({
+ video: video,
+ videoUrl: videoUrl,
+ videoTags: tags,
+ loading: false
+ })
+
+ // 设置页面标题
+ wx.setNavigationBarTitle({
+ title: video.title.substring(0, 12) + (video.title.length > 12 ? '...' : '')
+ })
+
+ } else {
+ wx.showToast({
+ title: res.msg || '视频不存在',
+ icon: 'none',
+ duration: 2000
+ })
+ setTimeout(() => {
+ wx.navigateBack()
+ }, 2000)
+ }
+ },
+ fail: err => {
+ console.error('获取视频详情失败:', err)
+ this.setData({
+ loading: false,
+ videoError: true
+ })
+ wx.showToast({
+ title: '加载失败,请重试',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ })
+ },
+
+ // 返回上一页
+ goBack() {
+ wx.navigateBack()
+ },
+
+ // 视频加载完成
+ onVideoLoaded(e) {
+ console.log('视频元数据加载完成:', e.detail)
+ this.setData({
+ duration: e.detail.duration || 0,
+ videoError: false
+ })
+ },
+
+ // 视频播放错误
+ onVideoError(e) {
+ console.error('视频播放错误详情:', e.detail)
+ this.setData({
+ videoError: true,
+ isPlaying: false
+ })
+
+ wx.showModal({
+ title: '播放错误',
+ content: '视频加载失败,请检查网络或视频链接',
+ showCancel: true,
+ confirmText: '重试',
+ success: (res) => {
+ if (res.confirm) {
+ this.retryVideo()
+ }
+ }
+ })
+ },
+
+ // 视频播放事件
+ onVideoPlay(e) {
+ console.log('视频开始播放')
+ this.setData({
+ isPlaying: true,
+ videoError: false
+ })
+
+ // 播放时隐藏控制栏
+ if (this.data.fullScreen) {
+ this.hideControls()
+ }
+ },
+
+ // 视频暂停事件
+ onVideoPause(e) {
+ console.log('视频暂停')
+ this.setData({
+ isPlaying: false
+ })
+
+ // 暂停时显示控制栏
+ if (this.data.fullScreen) {
+ this.showControls()
+ }
+ },
+
+ // 视频播放结束
+ onVideoEnded(e) {
+ console.log('视频播放结束')
+ this.setData({
+ isPlaying: false,
+ currentTime: 0
+ })
+
+ // 结束播放时显示控制栏
+ if (this.data.fullScreen) {
+ this.showControls()
+ }
+ },
+
+ // 时间更新事件
+ onTimeUpdate(e) {
+ const currentTime = e.detail.currentTime
+ const duration = e.detail.duration
+
+ // 更新当前时间和总时长
+ this.setData({
+ currentTime: currentTime,
+ duration: duration > 0 ? duration : this.data.duration
+ })
+ },
+
+ // 全屏切换事件
+ onFullScreenChange(e) {
+ const fullScreen = e.detail.fullScreen
+ console.log('全屏状态变化:', fullScreen)
+
+ this.setData({
+ fullScreen: fullScreen,
+ controlsVisible: !fullScreen
+ })
+
+ if (fullScreen) {
+ wx.setKeepScreenOn({ keepScreenOn: true })
+ // 进入全屏后自动播放
+ setTimeout(() => {
+ this.videoContext.play()
+ }, 300)
+ } else {
+ wx.setKeepScreenOn({ keepScreenOn: false })
+ // 退出全屏时暂停
+ this.videoContext.pause()
+ }
+ },
+
+ // 进入全屏
+ enterFullScreen() {
+ this.videoContext.requestFullScreen({ direction: 90 })
+ },
+
+ // 退出全屏
+ exitFullScreen() {
+ this.videoContext.exitFullScreen()
+ },
+
+ // 切换播放状态
+ togglePlay() {
+ console.log('切换播放状态,当前状态:', this.data.isPlaying)
+ if (this.data.videoError) {
+ this.retryVideo()
+ return
+ }
+
+ if (this.data.isPlaying) {
+ this.videoContext.pause()
+ } else {
+ this.videoContext.play()
+ }
+ },
+
+ // 切换静音
+ toggleMute() {
+ const isMuted = !this.data.isMuted
+ this.setData({ isMuted: isMuted })
+ this.videoContext.muted(isMuted)
+
+ wx.showToast({
+ title: isMuted ? '已静音' : '已取消静音',
+ icon: 'none',
+ duration: 800
+ })
+ },
+
+ // 切换循环
+ toggleLoop() {
+ const loop = !this.data.loop
+ this.setData({ loop: loop })
+ this.videoContext.loop(loop)
+
+ wx.showToast({
+ title: loop ? '开启循环播放' : '关闭循环播放',
+ icon: 'none',
+ duration: 800
+ })
+ },
+
+ // 切换播放速度
+ toggleSpeed() {
+ const speeds = [0.5, 0.75, 1, 1.25, 1.5, 2]
+ const currentIndex = speeds.indexOf(this.data.playbackRate)
+ const nextIndex = (currentIndex + 1) % speeds.length
+ const nextSpeed = speeds[nextIndex]
+
+ this.setData({ playbackRate: nextSpeed })
+ this.videoContext.playbackRate(nextSpeed)
+
+ wx.showToast({
+ title: `播放速度 ${nextSpeed}x`,
+ icon: 'none',
+ duration: 800
+ })
+ },
+
+ // 重试播放
+ retryVideo() {
+ console.log('重试播放视频')
+ this.setData({
+ videoError: false,
+ loading: true
+ })
+
+ // 重新加载视频
+ setTimeout(() => {
+ this.setData({ loading: false })
+ if (this.videoContext) {
+ this.videoContext.seek(0)
+ this.videoContext.play()
+ }
+ }, 500)
+ },
+
+ // 触摸控制
+ onTouchControl(e) {
+ const type = e.currentTarget.dataset.type
+ const currentTime = this.data.currentTime
+ const duration = this.data.duration
+
+ if (type === 'backward') {
+ const newTime = Math.max(0, currentTime - 10)
+ this.setData({ currentTime: newTime })
+ this.videoContext.seek(newTime)
+
+ wx.showToast({
+ title: '-10秒',
+ icon: 'none',
+ duration: 500
+ })
+ } else if (type === 'forward') {
+ const newTime = Math.min(duration, currentTime + 10)
+ this.setData({ currentTime: newTime })
+ this.videoContext.seek(newTime)
+
+ wx.showToast({
+ title: '+10秒',
+ icon: 'none',
+ duration: 500
+ })
+ }
+ },
+
+ // 触摸移动
+ onTouchMove() {
+ if (this.data.fullScreen) {
+ this.showControls()
+ this.hideControls()
+ }
+ },
+
+ // 显示控制栏
+ showControls() {
+ this.setData({ controlsVisible: true })
+
+ // 清除之前的定时器
+ if (this.data.controlsTimer) {
+ clearTimeout(this.data.controlsTimer)
+ }
+
+ // 3秒后自动隐藏控制栏
+ const timer = setTimeout(() => {
+ if (this.data.isPlaying && this.data.fullScreen) {
+ this.setData({ controlsVisible: false })
+ }
+ }, 3000)
+
+ this.setData({ controlsTimer: timer })
+ },
+
+ // 隐藏控制栏
+ hideControls() {
+ if (this.data.controlsTimer) {
+ clearTimeout(this.data.controlsTimer)
+ }
+
+ const timer = setTimeout(() => {
+ if (this.data.isPlaying && this.data.fullScreen) {
+ this.setData({ controlsVisible: false })
+ }
+ }, 3000)
+
+ this.setData({ controlsTimer: timer })
+ },
+
+
+
+
+})
\ No newline at end of file
diff --git a/pagesB/pages/spDetails/spDetails.json b/pagesB/pages/spDetails/spDetails.json
new file mode 100644
index 0000000..c01e590
--- /dev/null
+++ b/pagesB/pages/spDetails/spDetails.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText":"视频详情",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pagesB/pages/spDetails/spDetails.wxml b/pagesB/pages/spDetails/spDetails.wxml
new file mode 100644
index 0000000..f9b654f
--- /dev/null
+++ b/pagesB/pages/spDetails/spDetails.wxml
@@ -0,0 +1,174 @@
+
+
+
+ {{video.title}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 返回
+
+ {{video.title}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{formatTime(currentTime)}}
+
+
+
+
+
+
+ {{formatTime(duration)}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{playbackRate}}x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{video.publisherName}}
+ {{video.publisherDesc || '视频发布者'}}
+
+
+
+
+
+ 标签
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+
+
+ 视频加载失败
+ 重试
+
+
\ No newline at end of file
diff --git a/pagesB/pages/spDetails/spDetails.wxss b/pagesB/pages/spDetails/spDetails.wxss
new file mode 100644
index 0000000..9cf2bd0
--- /dev/null
+++ b/pagesB/pages/spDetails/spDetails.wxss
@@ -0,0 +1,664 @@
+.video-detail-container {
+ min-height: 100vh;
+ background: linear-gradient(135deg, #0f172a 0%, #1a1e2c 100%);
+ position: relative;
+ }
+
+ /* 导航栏 */
+ .nav-bar {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 88rpx;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.9) 100%);
+ backdrop-filter: blur(20rpx);
+ z-index: 1000;
+ border-bottom: 1rpx solid rgba(255, 255, 255, 0.08);
+ }
+
+ .nav-title {
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #fff;
+ text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
+ }
+
+
+
+
+ /* 视频播放器区域 */
+ .video-player-section {
+ width: 100%;
+ height: 500rpx;
+ position: relative;
+ background: #000;
+ overflow: hidden;
+ }
+
+ .video-player {
+ width: 100%;
+ height: 100%;
+ background: #000;
+ }
+
+ /* 视频封面 */
+ .video-cover {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: #000;
+ z-index: 2;
+ }
+
+ .cover-image {
+ width: 100%;
+ height: 100%;
+ opacity: 0.9;
+ }
+
+ .cover-play-btn {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 120rpx;
+ height: 120rpx;
+ background: rgba(0, 0, 0, 0.6);
+ backdrop-filter: blur(20rpx);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 3rpx solid rgba(255, 255, 255, 0.3);
+ box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.5);
+ }
+
+ .cover-play-btn .play-icon {
+ width: 50rpx;
+ height: 50rpx;
+ margin-left: 8rpx;
+ filter: brightness(2);
+ }
+
+ /* 全屏控制栏 */
+ .fullscreen-controls {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 10;
+ opacity: 1;
+ transition: opacity 0.3s;
+ }
+
+ .fullscreen-controls.hidden {
+ opacity: 0;
+ pointer-events: none;
+ }
+
+ .fullscreen-top-bar {
+ padding: 80rpx 40rpx 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
+ height: 120rpx;
+ }
+
+ .top-bar-left {
+ display: flex;
+ align-items: center;
+ gap: 16rpx;
+ padding: 16rpx 28rpx;
+ background: rgba(0, 0, 0, 0.6);
+ border-radius: 40rpx;
+ backdrop-filter: blur(20rpx);
+ border: 1rpx solid rgba(255, 255, 255, 0.1);
+ }
+
+ .back-text {
+ color: #fff;
+ font-size: 28rpx;
+ font-weight: 500;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
+ }
+
+ .top-bar-title {
+ font-size: 32rpx;
+ color: #fff;
+ max-width: 400rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-weight: 600;
+ text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.5);
+ padding: 12rpx 24rpx;
+ background: rgba(0, 0, 0, 0.5);
+ border-radius: 20rpx;
+ backdrop-filter: blur(10rpx);
+ }
+
+ /* 中间播放按钮 */
+ .center-play-btn {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 160rpx;
+ height: 160rpx;
+ background: rgba(0, 0, 0, 0.7);
+ backdrop-filter: blur(30rpx);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 4rpx solid rgba(255, 255, 255, 0.3);
+ z-index: 20;
+ box-shadow:
+ 0 12rpx 60rpx rgba(0, 0, 0, 0.5),
+ inset 0 0 0 1rpx rgba(255, 255, 255, 0.1);
+ animation: pulse 2s infinite;
+ }
+
+ @keyframes pulse {
+ 0% {
+ box-shadow:
+ 0 12rpx 60rpx rgba(0, 0, 0, 0.5),
+ inset 0 0 0 1rpx rgba(255, 255, 255, 0.1);
+ }
+ 50% {
+ box-shadow:
+ 0 12rpx 80rpx rgba(52, 152, 219, 0.4),
+ inset 0 0 0 1rpx rgba(52, 152, 219, 0.3);
+ }
+ 100% {
+ box-shadow:
+ 0 12rpx 60rpx rgba(0, 0, 0, 0.5),
+ inset 0 0 0 1rpx rgba(255, 255, 255, 0.1);
+ }
+ }
+
+ .play-large-icon {
+ width: 70rpx;
+ height: 70rpx;
+ margin-left: 10rpx;
+ filter: brightness(2) drop-shadow(0 4rpx 8rpx rgba(0, 0, 0, 0.5));
+ }
+
+ .play-ripple {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 0;
+ height: 0;
+ border-radius: 50%;
+ border: 2rpx solid rgba(255, 255, 255, 0.4);
+ animation: ripple 2s infinite;
+ }
+
+ @keyframes ripple {
+ 0% {
+ width: 0;
+ height: 0;
+ opacity: 1;
+ }
+ 100% {
+ width: 240rpx;
+ height: 240rpx;
+ opacity: 0;
+ }
+ }
+
+ /* 底部控制栏 */
+ .fullscreen-bottom-bar {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding: 0 40rpx 80rpx;
+ background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
+ }
+
+ .fullscreen-progress {
+ display: flex;
+ align-items: center;
+ gap: 24rpx;
+ margin-bottom: 60rpx;
+ padding: 0 20rpx;
+ }
+
+ .progress-time {
+ font-size: 26rpx;
+ color: rgba(255, 255, 255, 0.95);
+ min-width: 90rpx;
+ text-align: center;
+ font-weight: 500;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.5);
+ }
+
+ .progress-slider-container {
+ flex: 1;
+ position: relative;
+ height: 8rpx;
+ background: rgba(255, 255, 255, 0.2);
+ border-radius: 4rpx;
+ overflow: hidden;
+ }
+
+ .progress-bg {
+ width: 100%;
+ height: 100%;
+ background: rgba(255, 255, 255, 0.1);
+ border-radius: 4rpx;
+ }
+
+ .progress-current {
+ height: 100%;
+ background: linear-gradient(90deg, #3498db, #9b59b6);
+ border-radius: 4rpx;
+ transition: width 0.1s;
+ }
+
+ .progress-thumb {
+ position: absolute;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ width: 28rpx;
+ height: 28rpx;
+ background: #fff;
+ border-radius: 50%;
+ box-shadow:
+ 0 4rpx 12rpx rgba(0, 0, 0, 0.5),
+ 0 0 0 2rpx #3498db;
+ }
+
+ .bottom-controls {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 80rpx;
+ padding: 30rpx 50rpx;
+ background: rgba(0, 0, 0, 0.7);
+ border-radius: 80rpx;
+ backdrop-filter: blur(30rpx);
+ margin: 0 auto;
+ max-width: 700rpx;
+ border: 1rpx solid rgba(255, 255, 255, 0.1);
+ }
+
+ .control-item {
+ width: 90rpx;
+ height: 90rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 50%;
+ background: rgba(255, 255, 255, 0.1);
+ transition: all 0.2s;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.3);
+ }
+
+ .control-item:active {
+ background: rgba(255, 255, 255, 0.2);
+ transform: scale(0.9);
+ }
+
+ .control-icon {
+ width: 44rpx;
+ height: 44rpx;
+ filter: brightness(2) drop-shadow(0 2rpx 4rpx rgba(0, 0, 0, 0.3));
+ }
+
+ .speed-text {
+ color: #fff;
+ font-size: 30rpx;
+ font-weight: 700;
+ background: linear-gradient(135deg, #3498db, #9b59b6);
+ padding: 12rpx 28rpx;
+ border-radius: 40rpx;
+ box-shadow: 0 6rpx 24rpx rgba(52, 152, 219, 0.4);
+ }
+
+ /* 触摸控制区域 */
+ .touch-control-left,
+ .touch-control-center,
+ .touch-control-right {
+ position: absolute;
+ top: 120rpx;
+ bottom: 200rpx;
+ z-index: 5;
+ }
+
+ .touch-control-left {
+ left: 0;
+ width: 30%;
+ }
+
+ .touch-control-center {
+ left: 30%;
+ width: 40%;
+ }
+
+ .touch-control-right {
+ left: 70%;
+ width: 30%;
+ }
+
+ /* 非全屏播放按钮 */
+ .normal-play-btn {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 120rpx;
+ height: 120rpx;
+ background: rgba(0, 0, 0, 0.7);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 3;
+ border: 3rpx solid rgba(255, 255, 255, 0.3);
+ backdrop-filter: blur(10rpx);
+ box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.5);
+ }
+
+ .normal-play-btn .play-icon {
+ width: 50rpx;
+ height: 50rpx;
+ margin-left: 8rpx;
+ filter: brightness(2);
+ }
+
+ /* 视频信息区域 */
+ .video-info-section {
+ height: calc(100vh - 500rpx);
+ background: linear-gradient(180deg, #1a1e2c 0%, #0f172a 100%);
+ }
+
+ .video-header {
+ padding: 50rpx 40rpx 40rpx;
+ border-bottom: 1rpx solid rgba(255, 255, 255, 0.08);
+ }
+
+ .video-title {
+ font-size: 40rpx;
+ font-weight: 800;
+ color: #fff;
+ line-height: 1.3;
+ margin-bottom: 30rpx;
+ letter-spacing: 0.5rpx;
+ text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
+ }
+
+ .video-description {
+ font-size: 30rpx;
+ color: rgba(255, 255, 255, 0.85);
+ line-height: 1.6;
+ margin-bottom: 40rpx;
+ }
+
+ .video-stats {
+ display: flex;
+ gap: 30rpx;
+ flex-wrap: wrap;
+ }
+
+ .stat-item {
+ display: flex;
+ align-items: center;
+ gap: 14rpx;
+ font-size: 26rpx;
+ color: rgba(255, 255, 255, 0.7);
+ padding: 14rpx 28rpx;
+ background: rgba(255, 255, 255, 0.08);
+ border-radius: 40rpx;
+ backdrop-filter: blur(10rpx);
+ }
+
+
+
+ /* 发布者信息 */
+ .publisher-section {
+ padding: 40rpx;
+ display: flex;
+ align-items: center;
+ gap: 30rpx;
+ border-bottom: 1rpx solid rgba(255, 255, 255, 0.08);
+ background: rgba(255, 255, 255, 0.03);
+ margin: 0 20rpx;
+ border-radius: 24rpx;
+ margin-top: 20rpx;
+ }
+
+ .publisher-avatar {
+ width: 120rpx;
+ height: 120rpx;
+ border-radius: 50%;
+ border: 4rpx solid #3498db;
+ box-shadow:
+ 0 12rpx 40rpx rgba(52, 152, 219, 0.5),
+ 0 0 0 1rpx rgba(255, 255, 255, 0.1);
+ background: #1e293b;
+ }
+
+ .publisher-info {
+ flex: 1;
+ }
+
+ .publisher-name {
+ font-size: 36rpx;
+ font-weight: 700;
+ color: #fff;
+ margin-bottom: 12rpx;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
+ }
+
+ .publisher-desc {
+ font-size: 26rpx;
+ color: rgba(255, 255, 255, 0.6);
+ line-height: 1.4;
+ }
+
+ /* 标签区域 */
+ .tags-section {
+ padding: 40rpx;
+ background: rgba(255, 255, 255, 0.03);
+ margin: 20rpx;
+ border-radius: 24rpx;
+ }
+
+ .section-title {
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #fff;
+ margin-bottom: 30rpx;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
+ }
+
+ .tags-container {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 20rpx;
+ }
+
+ .tag-item {
+ padding: 16rpx 36rpx;
+ background: linear-gradient(135deg, #3498db, #2ecc71);
+ color: white;
+ border-radius: 40rpx;
+ font-size: 26rpx;
+ font-weight: 600;
+ box-shadow: 0 6rpx 24rpx rgba(52, 152, 219, 0.4);
+ transition: all 0.2s;
+ }
+
+ .tag-item:active {
+ transform: scale(0.95);
+ box-shadow: 0 4rpx 16rpx rgba(52, 152, 219, 0.3);
+ }
+
+ /* 加载中 */
+ .loading-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(135deg, #0f172a 0%, #1a1e2c 100%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ z-index: 2000;
+ }
+
+ .loading-spinner {
+ position: relative;
+ width: 140rpx;
+ height: 140rpx;
+ margin-bottom: 50rpx;
+ }
+
+ .spinner-circle {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 100%;
+ height: 100%;
+ border: 10rpx solid transparent;
+ border-top-color: #3498db;
+ border-right-color: #3498db;
+ border-radius: 50%;
+ animation: spinnerRotate 1.2s linear infinite;
+ box-shadow: 0 0 20rpx rgba(52, 152, 219, 0.3);
+ }
+
+ @keyframes spinnerRotate {
+ 0% {
+ transform: translate(-50%, -50%) rotate(0deg);
+ }
+ 100% {
+ transform: translate(-50%, -50%) rotate(360deg);
+ }
+ }
+
+ .loading-text {
+ font-size: 32rpx;
+ color: rgba(255, 255, 255, 0.8);
+ letter-spacing: 3rpx;
+ font-weight: 500;
+ text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
+ }
+
+ /* 错误提示 */
+ .error-container {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ z-index: 2000;
+ background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(26, 30, 44, 0.95));
+ padding: 80rpx 60rpx;
+ border-radius: 40rpx;
+ backdrop-filter: blur(40rpx);
+ border: 1rpx solid rgba(255, 255, 255, 0.1);
+ min-width: 500rpx;
+ box-shadow:
+ 0 20rpx 80rpx rgba(0, 0, 0, 0.5),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.1);
+ }
+
+ .error-icon {
+ width: 140rpx;
+ height: 140rpx;
+ margin-bottom: 40rpx;
+ filter: brightness(1.5) drop-shadow(0 4rpx 12rpx rgba(0, 0, 0, 0.3));
+ }
+
+ .error-text {
+ font-size: 36rpx;
+ color: #fff;
+ margin-bottom: 50rpx;
+ font-weight: 700;
+ text-align: center;
+ text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
+ }
+
+ .retry-btn {
+ padding: 24rpx 80rpx;
+ background: linear-gradient(135deg, #3498db, #2980b9);
+ color: white;
+ border-radius: 50rpx;
+ font-size: 32rpx;
+ font-weight: 700;
+ box-shadow:
+ 0 12rpx 40rpx rgba(52, 152, 219, 0.5),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.3);
+ transition: all 0.2s;
+ letter-spacing: 2rpx;
+ }
+
+ .retry-btn:active {
+ transform: scale(0.95);
+ box-shadow:
+ 0 6rpx 24rpx rgba(52, 152, 219, 0.4),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.2);
+ }
+
+ /* 响应式调整 */
+ @media screen and (max-width: 750rpx) {
+ .video-player-section {
+ height: 450rpx;
+ }
+
+ .video-info-section {
+ height: calc(100vh - 450rpx);
+ }
+
+ .video-title {
+ font-size: 36rpx;
+ }
+
+ .video-description {
+ font-size: 28rpx;
+ }
+
+ .bottom-controls {
+ gap: 60rpx;
+ padding: 25rpx 40rpx;
+ max-width: 650rpx;
+ }
+
+ .center-play-btn {
+ width: 140rpx;
+ height: 140rpx;
+ }
+
+ .play-large-icon {
+ width: 60rpx;
+ height: 60rpx;
+ }
+
+ .fullscreen-top-bar {
+ padding: 60rpx 30rpx 0;
+ }
+
+ .fullscreen-bottom-bar {
+ padding: 0 30rpx 60rpx;
+ }
+ }
\ No newline at end of file
diff --git a/pagesB/pages/training/training.js b/pagesB/pages/training/training.js
new file mode 100644
index 0000000..659aa0a
--- /dev/null
+++ b/pagesB/pages/training/training.js
@@ -0,0 +1,402 @@
+import http from '../../../utils/api'
+const baseUrl = require('../../../utils/baseUrl')
+
+Page({
+ data: {
+ currentTab: 0,
+ searchKeyword: '',
+ articleActiveCategory: 0,
+ videoActiveCategory: '全部',
+ baseUrl: baseUrl,
+
+ // 文章相关
+ allArticles: [],
+ filteredArticles: [],
+ articlePageNo: 1,
+ articlePageSize: 10,
+ articleTotal: 0,
+ articleHasMore: true,
+ articleLoading: false,
+ articleRequested: false, // 标记文章数据是否已请求
+
+ // 视频相关
+ allVideos: [],
+ filteredVideos: [],
+ videoPageNo: 1,
+ videoPageSize: 10,
+ videoTotal: 0,
+ videoHasMore: true,
+ videoLoading: false,
+ videoRequested: false, // 标记视频数据是否已请求
+
+ // 字典数据
+ wzzd: [],
+ videoType: []
+ },
+
+ onLoad() {
+ this.getarticleZd()
+ this.getvideoZd()
+ this.loadInitialData()
+ },
+
+ // 加载初始数据
+ loadInitialData() {
+ if (this.data.currentTab === 0) {
+ this.resetArticleParams()
+ this.getArticleList(true)
+ } else {
+ this.resetVideoParams()
+ this.getVideoList(true)
+ }
+ },
+
+ // 文章字典
+ getarticleZd() {
+ http.articleZd({
+ data: {
+ dictType: 'article_category'
+ },
+ success: res => {
+ this.setData({
+ wzzd: res.rows
+ })
+ }
+ })
+ },
+
+ // 视频字典
+ getvideoZd() {
+ http.videoZd({
+ data: {
+ dictType: 'video_category'
+ },
+ success: res => {
+ this.setData({
+ videoType: res.rows
+ })
+ }
+ })
+ },
+
+ // 获取文章列表(支持搜索和分类)
+ getArticleList(isRefresh = false) {
+ if (this.data.articleLoading && !isRefresh) return
+
+ this.setData({
+ articleLoading: true
+ })
+
+ const params = {
+ pageNo: this.data.articlePageNo,
+ pageSize: this.data.articlePageSize
+ }
+
+ // 添加搜索关键词
+ if (this.data.searchKeyword && this.data.searchKeyword.trim()) {
+ params.searchKey = this.data.searchKeyword.trim()
+ }
+
+ // 添加分类筛选
+ if (this.data.articleActiveCategory !== 0) {
+ const categoryDict = this.data.wzzd.find(item => item.dictSort === this.data.articleActiveCategory)
+ if (categoryDict) {
+ params.category = categoryDict.dictLabel
+ }
+ }
+
+ http.article({
+ data: params,
+ success: res => {
+ const newArticles = res.rows || []
+ const total = res.total || 0
+
+ let allArticles, filteredArticles
+ if (isRefresh) {
+ allArticles = newArticles
+ filteredArticles = newArticles
+ } else {
+ allArticles = [...this.data.allArticles, ...newArticles]
+ filteredArticles = [...this.data.filteredArticles, ...newArticles]
+ }
+
+ const hasMore = this.data.articlePageNo * this.data.articlePageSize < total
+
+ this.setData({
+ allArticles,
+ filteredArticles,
+ articleTotal: total,
+ articleHasMore: hasMore,
+ articleLoading: false,
+ articleRequested: true
+ })
+
+ // 如果是下拉刷新,停止刷新动画
+ if (isRefresh) {
+ wx.stopPullDownRefresh()
+ }
+ },
+ fail: () => {
+ this.setData({
+ articleLoading: false
+ })
+ wx.showToast({
+ title: '加载失败',
+ icon: 'error',
+ duration: 2000
+ })
+ }
+ })
+ },
+
+ // 获取视频列表(支持搜索和分类)
+ getVideoList(isRefresh = false) {
+ if (this.data.videoLoading && !isRefresh) return
+
+ this.setData({
+ videoLoading: true
+ })
+
+ const params = {
+ pageNo: this.data.videoPageNo,
+ pageSize: this.data.videoPageSize
+ }
+
+ // 添加搜索关键词
+ if (this.data.searchKeyword && this.data.searchKeyword.trim()) {
+ params.searchKey = this.data.searchKeyword.trim()
+ }
+
+ // 添加分类筛选
+ if (this.data.videoActiveCategory !== '全部') {
+ params.category = this.data.videoActiveCategory
+ }
+
+ http.videoList({
+ data: params,
+ success: res => {
+ const newVideos = res.rows || []
+ const total = res.total || 0
+
+ let allVideos, filteredVideos
+ if (isRefresh) {
+ allVideos = newVideos
+ filteredVideos = newVideos
+ } else {
+ allVideos = [...this.data.allVideos, ...newVideos]
+ filteredVideos = [...this.data.filteredVideos, ...newVideos]
+ }
+
+ const hasMore = this.data.videoPageNo * this.data.videoPageSize < total
+
+ this.setData({
+ allVideos,
+ filteredVideos,
+ videoTotal: total,
+ videoHasMore: hasMore,
+ videoLoading: false,
+ videoRequested: true
+ })
+
+ // 如果是下拉刷新,停止刷新动画
+ if (isRefresh) {
+ wx.stopPullDownRefresh()
+ }
+ },
+ fail: () => {
+ this.setData({
+ videoLoading: false
+ })
+ wx.showToast({
+ title: '加载失败',
+ icon: 'error',
+ duration: 2000
+ })
+ }
+ })
+ },
+
+ // 重置文章参数
+ resetArticleParams() {
+ this.setData({
+ articlePageNo: 1,
+ articleTotal: 0,
+ articleHasMore: true,
+ allArticles: [],
+ filteredArticles: []
+ })
+ },
+
+ // 重置视频参数
+ resetVideoParams() {
+ this.setData({
+ videoPageNo: 1,
+ videoTotal: 0,
+ videoHasMore: true,
+ allVideos: [],
+ filteredVideos: []
+ })
+ },
+
+ // 切换主选项卡
+ switchTab(e) {
+ const tab = parseInt(e.currentTarget.dataset.tab)
+ if (tab === this.data.currentTab) return
+
+ this.setData({
+ currentTab: tab,
+ searchKeyword: ''
+ })
+
+ // 延迟加载新tab的数据,确保切换动画完成
+ setTimeout(() => {
+ if (tab === 0) {
+ if (!this.data.articleRequested) {
+ this.resetArticleParams()
+ this.getArticleList(true)
+ }
+ } else {
+ if (!this.data.videoRequested) {
+ this.resetVideoParams()
+ this.getVideoList(true)
+ }
+ }
+ }, 300)
+ },
+
+ // 搜索输入
+ onSearchInput(e) {
+ const keyword = e.detail.value
+ this.setData({
+ searchKeyword: keyword
+ })
+
+ // 防抖处理,500ms后执行搜索
+ clearTimeout(this.searchTimer)
+ this.searchTimer = setTimeout(() => {
+ this.performSearch()
+ }, 500)
+ },
+
+ // 执行搜索
+ performSearch() {
+ if (this.data.currentTab === 0) {
+ this.resetArticleParams()
+ this.getArticleList(true)
+ } else {
+ this.resetVideoParams()
+ this.getVideoList(true)
+ }
+ },
+
+ // 选择文章分类
+ selectArticleCategory(e) {
+ const category = Number(e.currentTarget.dataset.category)
+ if (category === this.data.articleActiveCategory) return
+
+ this.setData({
+ articleActiveCategory: category
+ })
+
+ // 重置并重新加载数据
+ this.resetArticleParams()
+ this.getArticleList(true)
+ },
+
+ // 选择视频分类
+ selectVideoCategory(e) {
+ const category = e.currentTarget.dataset.category
+ if (category === this.data.videoActiveCategory) return
+
+ this.setData({
+ videoActiveCategory: category
+ })
+
+ // 重置并重新加载数据
+ this.resetVideoParams()
+ this.getVideoList(true)
+ },
+
+ // 查看文章详情
+ viewArticleDetail(e) {
+ const id = e.currentTarget.dataset.id
+ console.log('查看文章详情', id)
+ wx.navigateTo({
+ url: `/pagesB/pages/wzDetails/wzDetails?id=${id}`
+ })
+ },
+
+ // 播放视频
+ playVideo(e) {
+ const id = e.currentTarget.dataset.id
+ console.log('播放视频', id)
+ wx.navigateTo({
+ url: `/pagesB/pages/spDetails/spDetails?id=${id}`
+ })
+ },
+
+
+ // 跳转发布页
+ bindPublish(){
+ wx.navigateTo({
+ url: '/pagesB/pages/publishAdd/publishAdd',
+ })
+ },
+
+
+ // 下拉刷新
+ onPullDownRefresh() {
+ wx.showNavigationBarLoading()
+
+ if (this.data.currentTab === 0) {
+ this.resetArticleParams()
+ this.getArticleList(true)
+ } else {
+ this.resetVideoParams()
+ this.getVideoList(true)
+ }
+
+ // 重置搜索关键词
+ this.setData({
+ searchKeyword: ''
+ })
+ },
+
+ // 上拉加载更多
+ onReachBottom() {
+ if (this.data.currentTab === 0) {
+ if (!this.data.articleHasMore || this.data.articleLoading) {
+ wx.showToast({
+ title: '已加载全部',
+ icon: 'none',
+ duration: 1000
+ })
+ return
+ }
+
+ this.setData({
+ articlePageNo: this.data.articlePageNo + 1
+ })
+ this.getArticleList(false)
+ } else {
+ if (!this.data.videoHasMore || this.data.videoLoading) {
+ wx.showToast({
+ title: '已加载全部',
+ icon: 'none',
+ duration: 1000
+ })
+ return
+ }
+
+ this.setData({
+ videoPageNo: this.data.videoPageNo + 1
+ })
+ this.getVideoList(false)
+ }
+ },
+
+ // 页面显示时刷新数据
+ onShow() {
+ // 如果需要返回时刷新数据,可以在这里调用
+ }
+})
\ No newline at end of file
diff --git a/pagesB/pages/training/training.json b/pagesB/pages/training/training.json
new file mode 100644
index 0000000..867b5eb
--- /dev/null
+++ b/pagesB/pages/training/training.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText":"在线培训",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pagesB/pages/training/training.wxml b/pagesB/pages/training/training.wxml
new file mode 100644
index 0000000..3b4f92b
--- /dev/null
+++ b/pagesB/pages/training/training.wxml
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+ 文章
+
+
+
+ 视频
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 全部
+
+
+
+ {{item.dictLabel}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.category}}
+
+
+
+
+
+ {{item.title}}
+ {{item.subtitle}}
+
+
+
+
+ {{item.expertName}}
+
+
+
+ {{item.publishTime}}
+
+
+
+
+
+
+ {{item.viewCount}}
+
+
+
+
+
+
+
+
+
+ 上拉加载更多
+
+
+
+
+
+ 加载中...
+
+
+ 已加载全部
+
+
+
+
+
+
+
+
+
+
+ 暂无相关文章
+ 换个关键词试试吧
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 全部视频
+
+
+
+ {{item.dictLabel}}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.category}}
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+ {{item.publisherName}}
+
+
+
+
+ {{item.auditTime}}
+
+
+ {{item.viewCount}}
+
+
+
+
+
+
+
+
+
+
+ 上拉加载更多
+
+
+
+
+
+ 加载中...
+
+
+ 已加载全部
+
+
+
+
+
+
+
+
+
+
+ 暂无相关视频
+ 换个关键词试试吧
+
+
+
+
+
+
+
+ 发布
+
+
+
+
\ No newline at end of file
diff --git a/pagesB/pages/training/training.wxss b/pagesB/pages/training/training.wxss
new file mode 100644
index 0000000..c5d0e0a
--- /dev/null
+++ b/pagesB/pages/training/training.wxss
@@ -0,0 +1,1105 @@
+.training-container {
+ min-height: 100vh;
+ background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
+ padding: 20rpx 30rpx 100rpx;
+ position: relative;
+ overflow-x: hidden;
+}
+
+/* 头部样式优化 */
+.header {
+ text-align: center;
+ margin-bottom: 50rpx;
+ padding-top: 60rpx;
+ position: relative;
+ z-index: 1;
+}
+
+.title {
+ font-size: 56rpx;
+ font-weight: 800;
+ color: transparent;
+ background: linear-gradient(45deg, #3498db, #2ecc71, #3498db);
+ background-size: 200% auto;
+ -webkit-background-clip: text;
+ background-clip: text;
+ margin-bottom: 20rpx;
+ letter-spacing: 1rpx;
+ position: relative;
+ display: inline-block;
+ animation: gradientText 3s ease infinite;
+}
+
+@keyframes gradientText {
+ 0%, 100% {
+ background-position: 0% center;
+ }
+ 50% {
+ background-position: 100% center;
+ }
+}
+
+.title::after {
+ content: '';
+ position: absolute;
+ bottom: -8rpx;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 80rpx;
+ height: 4rpx;
+ background: linear-gradient(45deg, #3498db, #2ecc71);
+ border-radius: 2rpx;
+}
+
+.subtitle {
+ font-size: 28rpx;
+ color: #64748b;
+ letter-spacing: 2rpx;
+ font-weight: 400;
+ opacity: 0.9;
+ position: relative;
+ padding-top: 10rpx;
+}
+
+.header-decoration {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ pointer-events: none;
+ z-index: -1;
+}
+
+.decoration-circle {
+ position: absolute;
+ border-radius: 50%;
+ background: linear-gradient(45deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
+ animation: float 6s ease-in-out infinite;
+}
+
+.circle-1 {
+ width: 120rpx;
+ height: 120rpx;
+ top: 20rpx;
+ left: 10%;
+ animation-delay: 0s;
+}
+
+.circle-2 {
+ width: 80rpx;
+ height: 80rpx;
+ top: 60rpx;
+ right: 15%;
+ animation-delay: 2s;
+}
+
+.circle-3 {
+ width: 60rpx;
+ height: 60rpx;
+ top: 100rpx;
+ left: 20%;
+ animation-delay: 4s;
+}
+
+@keyframes float {
+ 0%, 100% {
+ transform: translateY(0) scale(1);
+ }
+ 50% {
+ transform: translateY(-20rpx) scale(1.05);
+ }
+}
+
+/* 主选项卡样式优化 */
+.tabs {
+ display: flex;
+ background: rgba(255, 255, 255, 0.95);
+ backdrop-filter: blur(10rpx);
+ border-radius: 18rpx;
+ margin-bottom: 30rpx;
+ box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.08),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.9);
+ border: 1rpx solid rgba(226, 232, 240, 0.8);
+ position: relative;
+ overflow: hidden;
+ z-index: 1;
+ padding: 6rpx;
+ height: 88rpx;
+}
+
+.tab-item {
+ flex: 1;
+ text-align: center;
+ font-size: 32rpx;
+ color: #64748b;
+ position: relative;
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+ border-radius: 12rpx;
+ z-index: 2;
+ letter-spacing: 1rpx;
+}
+
+.tab-item.active {
+ color: #ffffff;
+ font-weight: 600;
+ text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.1);
+}
+
+.tab-slider {
+ position: absolute;
+ top: 6rpx;
+ width: calc(50% - 6rpx);
+ height: calc(100% - 12rpx);
+ background: linear-gradient(135deg, #3498db, #2ecc71);
+ border-radius: 12rpx;
+ transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
+ box-shadow: 0 4rpx 20rpx rgba(52, 152, 219, 0.25),
+ 0 2rpx 8rpx rgba(52, 152, 219, 0.15);
+ z-index: 1;
+}
+
+.tab-slider.left {
+ left: 6rpx;
+ transform: translateX(0);
+}
+
+.tab-slider.right {
+ left: 6rpx;
+ transform: translateX(100%);
+}
+
+.tab-highlight {
+ position: absolute;
+ bottom: -6rpx;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 24rpx;
+ height: 4rpx;
+ background: linear-gradient(135deg, #3498db, #2ecc71);
+ border-radius: 2rpx;
+ opacity: 0;
+ transition: all 0.3s ease;
+ box-shadow: 0 2rpx 6rpx rgba(52, 152, 219, 0.3);
+}
+
+.tab-item.active .tab-highlight {
+ opacity: 1;
+ animation: highlightPulse 2s ease infinite;
+}
+
+@keyframes highlightPulse {
+ 0%, 100% {
+ box-shadow: 0 2rpx 6rpx rgba(52, 152, 219, 0.3);
+ transform: translateX(-50%) scale(1);
+ }
+ 50% {
+ box-shadow: 0 2rpx 12rpx rgba(52, 152, 219, 0.5);
+ transform: translateX(-50%) scale(1.1);
+ }
+}
+
+/* 内容区域 */
+.content-section {
+ animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+@keyframes slideUp {
+ from {
+ opacity: 0;
+ transform: translateY(40rpx);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+/* 搜索框样式优化 */
+.search-box {
+ position: relative;
+ margin-bottom: 30rpx;
+ animation: slideIn 0.8s ease;
+}
+
+@keyframes slideIn {
+ from {
+ opacity: 0;
+ transform: translateX(-30rpx);
+ }
+ to {
+ opacity: 1;
+ transform: translateX(0);
+ }
+}
+
+.search-input {
+ background: rgba(255, 255, 255, 0.95);
+ backdrop-filter: blur(10rpx);
+ border-radius: 25rpx;
+ padding: 20rpx 40rpx 20rpx 100rpx;
+ font-size: 28rpx;
+ box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.08),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.8);
+ border: 1rpx solid rgba(255, 255, 255, 0.5);
+ transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
+ position: relative;
+ z-index: 2;
+}
+
+.search-input:focus {
+ border-color: rgba(52, 152, 219, 0.3);
+ box-shadow: 0 12rpx 40rpx rgba(52, 152, 219, 0.15),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.8);
+ transform: translateY(-2rpx);
+}
+
+.search-icon {
+ position: absolute;
+ left: 40rpx;
+ top: 50%;
+ transform: translateY(-50%);
+ width: 36rpx;
+ height: 36rpx;
+ z-index: 3;
+ transition: all 0.3s ease;
+}
+
+.search-decoration {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border-radius: 25rpx;
+ overflow: hidden;
+ z-index: 1;
+}
+
+.search-wave {
+ position: absolute;
+ top: 0;
+ left: -100%;
+ width: 200%;
+ height: 100%;
+ background: linear-gradient(90deg,
+ transparent,
+ rgba(52, 152, 219, 0.1),
+ transparent);
+ animation: waveFlow 3s ease-in-out infinite;
+}
+
+@keyframes waveFlow {
+ 0% {
+ transform: translateX(0);
+ }
+ 100% {
+ transform: translateX(50%);
+ }
+}
+
+.placeholder-style {
+ color: #94a3b8;
+ font-size: 28rpx;
+}
+
+/* 分类筛选样式优化 */
+.category-scroll {
+ white-space: nowrap;
+ margin-bottom: 30rpx;
+ padding: 0 10rpx;
+}
+
+.category-list {
+ display: inline-flex;
+ gap: 20rpx;
+}
+
+.category-item {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ padding: 20rpx 36rpx;
+ background: rgba(255, 255, 255, 0.9);
+ backdrop-filter: blur(10rpx);
+ border-radius: 25rpx;
+ font-size: 28rpx;
+ color: #64748b;
+ transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
+ position: relative;
+ overflow: hidden;
+ white-space: nowrap;
+ font-weight: 500;
+ min-width: 120rpx;
+}
+
+.category-item:active {
+ transform: scale(0.96);
+}
+
+.category-item.active {
+ background: linear-gradient(135deg, #3498db, #2ecc71);
+ color: white;
+ border-color: transparent;
+ font-weight: 600;
+}
+
+.category-indicator {
+ position: absolute;
+ bottom: 8rpx;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 6rpx;
+ height: 6rpx;
+ background: white;
+ border-radius: 50%;
+ opacity: 0;
+ transition: all 0.3s ease;
+}
+
+.category-item.active .category-indicator {
+ opacity: 1;
+ animation: indicatorBounce 1s ease infinite;
+}
+
+@keyframes indicatorBounce {
+ 0%, 100% {
+ transform: translateX(-50%) translateY(0);
+ }
+ 50% {
+ transform: translateX(-50%) translateY(-4rpx);
+ }
+}
+
+/* 文章列表样式优化 */
+.articles-list {
+ margin-top: 10rpx;
+}
+
+.article-card {
+ background: rgba(255, 255, 255, 0.95);
+ backdrop-filter: blur(10rpx);
+ border-radius: 25rpx;
+ margin-bottom: 35rpx;
+ overflow: hidden;
+ box-shadow: 0 10rpx 35rpx rgba(0, 0, 0, 0.08),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.8);
+ border: 1rpx solid rgba(255, 255, 255, 0.5);
+ transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
+ position: relative;
+ opacity: 0;
+ transform: translateY(30rpx);
+ animation: cardAppear 0.6s ease forwards;
+}
+
+@keyframes cardAppear {
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.article-card:nth-child(1) {
+ animation-delay: 0.1s;
+}
+
+.article-card:nth-child(2) {
+ animation-delay: 0.2s;
+}
+
+.article-card:nth-child(3) {
+ animation-delay: 0.3s;
+}
+
+.article-card:nth-child(4) {
+ animation-delay: 0.4s;
+}
+
+.article-card:nth-child(5) {
+ animation-delay: 0.5s;
+}
+
+.article-card:active {
+ transform: translateY(-8rpx);
+ box-shadow: 0 20rpx 50rpx rgba(0, 0, 0, 0.15),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.8);
+}
+
+.article-card::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 4rpx;
+ background: linear-gradient(45deg, #3498db, #2ecc71);
+ opacity: 0;
+ transition: opacity 0.4s ease;
+ z-index: 2;
+}
+
+.article-card:active::before {
+ opacity: 1;
+}
+
+.article-cover-container {
+ position: relative;
+ height: 320rpx;
+ overflow: hidden;
+ border-radius: 25rpx 25rpx 0 0;
+}
+
+.article-cover {
+ width: 100%;
+ height: 100%;
+ transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+.article-card:active .article-cover {
+ transform: scale(1.08);
+}
+
+.cover-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.3));
+}
+
+.category-tag {
+ position: absolute;
+ top: 25rpx;
+ right: 25rpx;
+ background: rgba(52, 152, 219, 0.95);
+ backdrop-filter: blur(10rpx);
+ color: white;
+ padding: 10rpx 25rpx;
+ border-radius: 20rpx;
+ font-size: 22rpx;
+ font-weight: 600;
+ box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.2);
+ z-index: 2;
+}
+
+.article-hover-effect {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(45deg, transparent, rgba(52, 152, 219, 0.1), transparent);
+ opacity: 0;
+ transition: opacity 0.4s ease;
+}
+
+.article-card:active .article-hover-effect {
+ opacity: 1;
+}
+
+.article-info {
+ padding: 35rpx;
+}
+
+.article-title {
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #1e293b;
+ margin-bottom: 20rpx;
+ line-height: 1.4;
+ letter-spacing: 0.5rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ transition: color 0.3s ease;
+}
+
+.article-card:active .article-title {
+ color: #3498db;
+}
+
+.article-desc {
+ font-size: 26rpx;
+ color: #64748b;
+ line-height: 1.6;
+ margin-bottom: 25rpx;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.article-meta {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 25rpx;
+ padding-bottom: 25rpx;
+ border-bottom: 1rpx solid rgba(226, 232, 240, 0.8);
+}
+
+.meta-item {
+ display: flex;
+ align-items: center;
+ gap: 10rpx;
+}
+
+.meta-icon {
+ width: 30rpx;
+ height: 30rpx;
+ transition: all 0.3s ease;
+ border-radius: 50%;
+}
+
+.meta-item:active .meta-icon {
+ opacity: 1;
+ transform: scale(1.1);
+}
+
+.meta-text {
+ font-size: 24rpx;
+ color: #94a3b8;
+ font-weight: 400;
+}
+
+.article-stats {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+}
+
+.stat-item {
+ display: flex;
+ align-items: center;
+ gap: 10rpx;
+ font-size: 24rpx;
+ color: #64748b;
+ font-weight: 500;
+}
+
+.stat-icon {
+ width: 28rpx;
+ height: 28rpx;
+ opacity: 0.7;
+ transition: all 0.3s ease;
+}
+
+.stat-item:active .stat-icon {
+ opacity: 1;
+ transform: scale(1.1);
+}
+
+/* 视频列表样式*/
+.videos-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 20rpx;
+ margin-top: 20rpx;
+}
+
+.video-card {
+ background: rgba(255, 255, 255, 0.95);
+ backdrop-filter: blur(10rpx);
+ border-radius: 25rpx;
+ overflow: hidden;
+ box-shadow: 0 10rpx 35rpx rgba(0, 0, 0, 0.08),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.8);
+ border: 1rpx solid rgba(255, 255, 255, 0.5);
+ transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
+ position: relative;
+ opacity: 0;
+ transform: scale(0.9);
+ animation: videoCardAppear 0.6s ease forwards;
+}
+
+@keyframes videoCardAppear {
+ to {
+ opacity: 1;
+ transform: scale(1);
+ }
+}
+
+.video-card:nth-child(1) {
+ animation-delay: 0.1s;
+}
+
+.video-card:nth-child(2) {
+ animation-delay: 0.2s;
+}
+
+.video-card:nth-child(3) {
+ animation-delay: 0.3s;
+}
+
+.video-card:nth-child(4) {
+ animation-delay: 0.4s;
+}
+
+.video-card:nth-child(5) {
+ animation-delay: 0.5s;
+}
+
+.video-card:nth-child(6) {
+ animation-delay: 0.6s;
+}
+
+.video-card:active {
+ transform: scale(0.95);
+ box-shadow: 0 20rpx 50rpx rgba(0, 0, 0, 0.15),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.8);
+}
+
+.video-card::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 4rpx;
+ background: linear-gradient(45deg, #3498db, #2ecc71);
+ opacity: 0;
+ transition: opacity 0.4s ease;
+ z-index: 2;
+}
+
+.video-card:active::before {
+ opacity: 1;
+}
+
+.video-cover-container {
+ position: relative;
+ height: 280rpx;
+ overflow: hidden;
+ border-radius: 25rpx 25rpx 0 0;
+}
+
+.video-cover {
+ width: 100%;
+ height: 100%;
+ transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+.video-card:active .video-cover {
+ transform: scale(1.08);
+}
+
+.video-duration {
+ position: absolute;
+ bottom: 15rpx;
+ right: 15rpx;
+ background: rgba(0, 0, 0, 0.9);
+ backdrop-filter: blur(10rpx);
+ color: white;
+ padding: 8rpx 18rpx;
+ border-radius: 15rpx;
+ font-size: 22rpx;
+ font-weight: 600;
+ z-index: 2;
+}
+
+.play-button {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 80rpx;
+ height: 80rpx;
+ background: rgba(255, 255, 255, 0.3);
+ backdrop-filter: blur(10rpx);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 2;
+ transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+.video-card:active .play-button {
+ transform: translate(-50%, -50%) scale(1.1);
+ box-shadow: 0 15rpx 40rpx rgba(0, 0, 0, 0.4),
+ inset 0 1rpx 0 rgba(255, 255, 255, 0.8);
+}
+
+.play-icon {
+ width: 30rpx;
+ height: 30rpx;
+ margin-left: 4rpx;
+ transition: transform 0.3s ease;
+}
+
+.video-card:active .play-icon {
+ transform: scale(1.1);
+}
+
+.play-ripple {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 0;
+ height: 0;
+ border-radius: 50%;
+ background: rgba(255, 255, 255, 0.3);
+ transition: all 0.6s ease;
+}
+
+.video-card:active .play-ripple {
+ width: 120rpx;
+ height: 120rpx;
+ animation: playRipple 0.8s ease-out;
+}
+
+@keyframes playRipple {
+ from {
+ opacity: 1;
+ transform: translate(-50%, -50%) scale(0);
+ }
+ to {
+ opacity: 0;
+ transform: translate(-50%, -50%) scale(1);
+ }
+}
+
+.video-hover-effect {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(45deg, transparent, rgba(52, 152, 219, 0.1), transparent);
+ opacity: 0;
+ transition: opacity 0.4s ease;
+}
+
+.video-card:active .video-hover-effect {
+ opacity: 1;
+}
+
+.video-info {
+ padding: 25rpx;
+}
+
+.video-title {
+ font-size: 28rpx;
+ font-weight: 700;
+ color: #1e293b;
+ margin-bottom: 20rpx;
+ line-height: 1.4;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ letter-spacing: 0.5rpx;
+}
+
+.video-instructor {
+ display: flex;
+ align-items: center;
+ margin-bottom: 20rpx;
+ gap: 12rpx;
+}
+
+.instructor-avatar {
+ width: 40rpx;
+ height: 40rpx;
+ border-radius: 50%;
+ border: 2rpx solid rgba(52, 152, 219, 0.3);
+ box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
+ transition: all 0.3s ease;
+}
+
+.video-card:active .instructor-avatar {
+ border-color: #3498db;
+ transform: scale(1.05);
+}
+
+.instructor-name {
+ font-size: 24rpx;
+ color: #64748b;
+ font-weight: 500;
+}
+
+.video-meta {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.video-meta-item {
+ display: flex;
+ align-items: center;
+ gap: 8rpx;
+ font-size: 22rpx;
+ color: #94a3b8;
+}
+
+.video-meta-item image {
+ width: 22rpx;
+ height: 22rpx;
+ opacity: 0.6;
+ transition: all 0.3s ease;
+}
+
+.video-meta-item:active image {
+ opacity: 1;
+ transform: scale(1.1);
+}
+
+
+/* 新增视频气泡按钮 */
+.create-btn-container {
+ position: fixed;
+ bottom: 40rpx;
+ right: 15rpx;
+ z-index: 100;
+ }
+
+ .create-btn {
+ width: 120rpx;
+ height: 120rpx;
+ background: linear-gradient(135deg, #6D9EFF 0%, #4A7CFF 100%);
+ border-radius: 50%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 8rpx 32rpx rgba(74, 144, 226, 0.3);
+ transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
+ position: relative;
+ overflow: hidden;
+ }
+
+ .create-btn::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(255, 255, 255, 0.1);
+ opacity: 0;
+ transition: opacity 0.2s ease;
+ }
+
+ .create-btn:active {
+ transform: scale(0.95);
+ box-shadow: 0 4rpx 20rpx rgba(74, 144, 226, 0.4);
+ }
+
+ .create-btn:active::after {
+ opacity: 1;
+ }
+
+ .btn-icon {
+ width: 40rpx;
+ height: 40rpx;
+ margin-bottom: 10rpx;
+ }
+
+ .btn-text {
+ font-size: 26rpx;
+ color: white;
+ font-weight: 600;
+ letter-spacing: 0.5rpx;
+ }
+
+/* 空状态样式优化 */
+.empty-state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 150rpx 0;
+ text-align: center;
+ position: relative;
+}
+
+.empty-animation {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 300rpx;
+ height: 300rpx;
+}
+
+.empty-circle {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 100rpx;
+ height: 100rpx;
+ border: 8rpx solid rgba(52, 152, 219, 0.1);
+ border-radius: 50%;
+ animation: emptyFloat 4s ease-in-out infinite;
+}
+
+.empty-circle.circle-2 {
+ width: 150rpx;
+ height: 150rpx;
+ border-width: 6rpx;
+ animation-delay: 1s;
+}
+
+.empty-circle.circle-3 {
+ width: 200rpx;
+ height: 200rpx;
+ border-width: 4rpx;
+ animation-delay: 2s;
+}
+
+@keyframes emptyFloat {
+ 0%, 100% {
+ transform: translate(-50%, -50%) scale(1);
+ opacity: 0.3;
+ }
+ 50% {
+ transform: translate(-50%, -50%) scale(1.1);
+ opacity: 0.1;
+ }
+}
+
+.empty-text {
+ font-size: 32rpx;
+ color: #64748b;
+ font-weight: 600;
+ margin-bottom: 15rpx;
+ letter-spacing: 1rpx;
+ position: relative;
+ z-index: 1;
+}
+
+.empty-hint {
+ font-size: 26rpx;
+ color: #94a3b8;
+ position: relative;
+ z-index: 1;
+}
+
+/* 加载更多样式 */
+.load-more,
+.loading-more,
+.no-more {
+ text-align: center;
+ padding: 40rpx 0;
+ font-size: 26rpx;
+ color: #94a3b8;
+ position: relative;
+}
+
+.loading-more {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 15rpx;
+}
+
+.loading-dot {
+ width: 16rpx;
+ height: 16rpx;
+ background: #3498db;
+ border-radius: 50%;
+ animation: loadingDot 1.4s infinite ease-in-out both;
+}
+
+.loading-dot:nth-child(1) {
+ animation-delay: -0.32s;
+}
+
+.loading-dot:nth-child(2) {
+ animation-delay: -0.16s;
+}
+
+@keyframes loadingDot {
+ 0%, 80%, 100% {
+ transform: scale(0);
+ opacity: 0.3;
+ }
+ 40% {
+ transform: scale(1);
+ opacity: 1;
+ }
+}
+
+.no-more {
+ color: #64748b;
+ position: relative;
+}
+
+.no-more::before,
+.no-more::after {
+ content: '';
+ position: absolute;
+ top: 50%;
+ width: 100rpx;
+ height: 1rpx;
+ background: rgba(100, 116, 139, 0.2);
+}
+
+.no-more::before {
+ left: 20%;
+}
+
+.no-more::after {
+ right: 20%;
+}
+
+/* 响应式调整 */
+@media screen and (max-width: 750rpx) {
+ .videos-grid {
+ grid-template-columns: 1fr;
+ }
+
+ .articles-list {
+ padding: 0 10rpx;
+ }
+
+ .category-item {
+ font-size: 26rpx;
+ padding: 18rpx 28rpx;
+ min-width: 110rpx;
+ }
+
+ .header {
+ padding-top: 40rpx;
+ }
+
+ .title {
+ font-size: 48rpx;
+ }
+
+ .tabs {
+ height: 80rpx;
+ }
+
+ .tab-item {
+ font-size: 30rpx;
+ }
+
+ .no-more::before,
+ .no-more::after {
+ width: 80rpx;
+ }
+
+ .no-more::before {
+ left: 15%;
+ }
+
+ .no-more::after {
+ right: 15%;
+ }
+}
+
+/* 滚动条样式 */
+::-webkit-scrollbar {
+ width: 0;
+ height: 0;
+ color: transparent;
+}
\ No newline at end of file
diff --git a/pagesB/pages/wzDetails/wzDetails.js b/pagesB/pages/wzDetails/wzDetails.js
new file mode 100644
index 0000000..8a0f73e
--- /dev/null
+++ b/pagesB/pages/wzDetails/wzDetails.js
@@ -0,0 +1,99 @@
+import http from '../../../utils/api'
+const baseUrl = require('../../../utils/baseUrl')
+
+Page({
+ data: {
+ baseUrl: baseUrl,
+ article: {}, // 文章详情
+ loading: true, // 加载状态
+ },
+
+ onLoad(options) {
+ this.getArticleDetails(options.id)
+ },
+
+ // 获取文章详情
+ getArticleDetails(id) {
+ this.setData({
+ loading: true
+ })
+
+ http.articleDetails({
+ data: { id },
+ success: res => {
+ console.log('文章详情:', res)
+ if (res.code === 200 && res.data) {
+ // 解析富文本内容
+ const article = res.data
+ // 这里可以处理富文本内容的样式
+ article.content = this.formatRichContent(article.content)
+
+ this.setData({
+ article: article,
+ loading: false
+ })
+
+ // 设置页面标题
+ wx.setNavigationBarTitle({
+ title: article.title.substring(0, 10) + (article.title.length > 10 ? '...' : '')
+ })
+ } else {
+ wx.showToast({
+ title: '文章不存在',
+ icon: 'error'
+ })
+ setTimeout(() => {
+ wx.navigateBack()
+ }, 2000)
+ }
+ },
+ fail: err => {
+ console.error('获取文章详情失败:', err)
+ this.setData({
+ loading: false
+ })
+ wx.showToast({
+ title: '加载失败',
+ icon: 'error'
+ })
+ }
+ })
+ },
+
+
+ // 格式化富文本内容
+ formatRichContent(content) {
+ // 这里可以添加自定义样式,比如给图片添加样式
+ return content.replace(/
+
+
+
+
+
+
+
+
+ {{article.category}}
+
+
+
+
+
+
+ {{article.title}}
+ {{article.subtitle}}
+
+
+
+
+
+ {{article.expertName}}
+ {{article.publishTime}}
+
+
+
+ {{article.viewCount}} 阅读
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagesB/pages/wzDetails/wzDetails.wxss b/pagesB/pages/wzDetails/wzDetails.wxss
new file mode 100644
index 0000000..8b993b1
--- /dev/null
+++ b/pagesB/pages/wzDetails/wzDetails.wxss
@@ -0,0 +1,322 @@
+.article-detail-container {
+ min-height: 100vh;
+ background: #f8fafc;
+ position: relative;
+ }
+
+
+ /* 文章内容容器 */
+ .article-content {
+ height: 100vh;
+ position: relative;
+ }
+
+ /* 文章封面 */
+ .article-cover {
+ position: relative;
+ height: 500rpx;
+ overflow: hidden;
+ }
+
+ .cover-image {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ }
+
+ .cover-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
+ }
+
+ .cover-gradient {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 200rpx;
+ background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
+ }
+
+ .cover-category {
+ position: absolute;
+ top: 40rpx;
+ right: 40rpx;
+ background: rgba(52, 152, 219, 0.95);
+ backdrop-filter: blur(10rpx);
+ color: white;
+ padding: 12rpx 28rpx;
+ border-radius: 25rpx;
+ font-size: 24rpx;
+ font-weight: 600;
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.2);
+ z-index: 2;
+ }
+
+ /* 文章主体 */
+ .article-body {
+ background: white;
+ border-radius: 40rpx 40rpx 0 0;
+ margin-top: -40rpx;
+ position: relative;
+ z-index: 10;
+ padding-bottom: 50rpx;
+ }
+
+ .title-section {
+ padding: 50rpx 40rpx 40rpx;
+ border-bottom: 1rpx solid #f1f5f9;
+ }
+
+ .article-title {
+ font-size: 44rpx;
+ font-weight: 800;
+ color: #1e293b;
+ line-height: 1.4;
+ margin-bottom: 20rpx;
+ letter-spacing: 0.5rpx;
+ }
+
+ .article-subtitle {
+ font-size: 30rpx;
+ color: #64748b;
+ line-height: 1.6;
+ margin-bottom: 40rpx;
+ padding-bottom: 30rpx;
+ border-bottom: 1rpx dashed #e2e8f0;
+ }
+
+ /* 专家信息 */
+ .expert-info {
+ display: flex;
+ align-items: center;
+ gap: 20rpx;
+ margin-top: 30rpx;
+ }
+
+ .expert-avatar {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ border: 3rpx solid white;
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
+ }
+
+ .expert-detail {
+ flex: 1;
+ }
+
+ .expert-name {
+ font-size: 28rpx;
+ font-weight: 600;
+ color: #1e293b;
+ margin-bottom: 8rpx;
+ }
+
+ .publish-time {
+ font-size: 24rpx;
+ color: #94a3b8;
+ }
+
+ .view-count {
+ display: flex;
+ align-items: center;
+ gap: 10rpx;
+ background: rgba(226, 232, 240, 0.3);
+ padding: 12rpx 20rpx;
+ border-radius: 25rpx;
+ font-size: 24rpx;
+ color: #64748b;
+ }
+
+ .view-icon {
+ width: 28rpx;
+ height: 28rpx;
+ opacity: 0.7;
+ }
+
+ /* 富文本内容 */
+ .rich-content {
+ padding: 40rpx;
+ font-size: 32rpx;
+ line-height: 1.8;
+ color: #334155;
+ }
+
+ .rich-content h1,
+ .rich-content h2,
+ .rich-content h3 {
+ color: #1e293b;
+ margin: 40rpx 0 20rpx;
+ font-weight: 700;
+ }
+
+ .rich-content h1 {
+ font-size: 40rpx;
+ }
+
+ .rich-content h2 {
+ font-size: 36rpx;
+ }
+
+ .rich-content h3 {
+ font-size: 32rpx;
+ }
+
+ .rich-content p {
+ margin-bottom: 30rpx;
+ }
+
+ .rich-content ul,
+ .rich-content ol {
+ margin: 20rpx 0 20rpx 40rpx;
+ }
+
+ .rich-content li {
+ margin-bottom: 15rpx;
+ position: relative;
+ }
+
+ .rich-content ul li:before {
+ content: '•';
+ color: #3498db;
+ font-weight: bold;
+ position: absolute;
+ left: -25rpx;
+ }
+
+ .rich-content strong {
+ color: #1e293b;
+ font-weight: 700;
+ }
+
+ .rich-content a {
+ color: #3498db;
+ text-decoration: underline;
+ }
+
+
+
+
+ /* 加载中 */
+ .loading-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(255, 255, 255, 0.95);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ z-index: 2000;
+ }
+
+ .loading-spinner {
+ position: relative;
+ width: 120rpx;
+ height: 120rpx;
+ margin-bottom: 40rpx;
+ }
+
+ .spinner-circle {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 100%;
+ height: 100%;
+ border: 8rpx solid rgba(52, 152, 219, 0.1);
+ border-radius: 50%;
+ animation: spinnerRotate 2s linear infinite;
+ }
+
+ .spinner-circle.circle-2 {
+ width: 80%;
+ height: 80%;
+ border-width: 6rpx;
+ animation-delay: 0.2s;
+ }
+
+ .spinner-circle.circle-3 {
+ width: 60%;
+ height: 60%;
+ border-width: 4rpx;
+ animation-delay: 0.4s;
+ }
+
+ @keyframes spinnerRotate {
+ 0% {
+ transform: translate(-50%, -50%) rotate(0deg);
+ }
+ 100% {
+ transform: translate(-50%, -50%) rotate(360deg);
+ }
+ }
+
+ .loading-text {
+ font-size: 28rpx;
+ color: #64748b;
+ letter-spacing: 1rpx;
+ }
+
+ /* 回到顶部 */
+ .back-to-top {
+ position: fixed;
+ right: 40rpx;
+ bottom: 160rpx;
+ width: 80rpx;
+ height: 80rpx;
+ background: rgba(255, 255, 255, 0.95);
+ backdrop-filter: blur(10rpx);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.15);
+ border: 1rpx solid rgba(226, 232, 240, 0.8);
+ transition: all 0.3s ease;
+ z-index: 90;
+ }
+
+ .back-to-top:active {
+ transform: scale(0.95);
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.2);
+ }
+
+ .top-icon {
+ width: 36rpx;
+ height: 36rpx;
+ }
+
+ /* 响应式调整 */
+ @media screen and (max-width: 750rpx) {
+ .article-cover {
+ height: 400rpx;
+ }
+
+ .article-title {
+ font-size: 38rpx;
+ }
+
+ .article-subtitle {
+ font-size: 28rpx;
+ }
+
+ .rich-content {
+ font-size: 30rpx;
+ }
+
+ .action-bar {
+ padding: 0 30rpx;
+ }
+
+ .comment-btn {
+ padding: 18rpx 30rpx;
+ }
+ }
\ No newline at end of file
diff --git a/utils/api.js b/utils/api.js
index 990dd82..e77e778 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -21,92 +21,7 @@ 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)
}
@@ -121,20 +36,16 @@ function articleDetails(params) {
http('/vet/knowledge/published/' + params.data.id, 'get', params)
}
-// 政策解读列表
-function policyelucidation(params) {
- http('/system/interpretation/published/list', 'get', params)
+// 文章新增
+function articleAdd(params) {
+ http('/vet/knowledge', 'post', params)
}
-// 政策解读详情
-function policyeDetails(params) {
- http('/system/interpretation/published/' + params.data.id, 'get', params)
+// 视频新增
+function videoAdd(params) {
+ http('/vet/training', 'post', params)
}
-// 政策解读类型字典
-function policyeZd(params) {
- http('/system/dict/data/list', 'get', params)
-}
// 行政区划
function areaChildren(params) {
@@ -166,6 +77,16 @@ function videoZd(params) {
http('/system/dict/data/list', 'get', params)
}
+
+
+
+
+
+
+
+
+
+
//在线问答列表
function forumList(params) {
http('/system/questions/list', 'get', params)
@@ -221,10 +142,6 @@ function feedback(params) {
http('/muhu/feedback', 'post', params)
}
-// 预警类型
-function warningType(params) {
- http('/system/dict/data/list', 'get', params)
-}
// 个人中心今日问诊
function today(params) {
@@ -233,10 +150,8 @@ function today(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,
+ login,carousel,getPhoneNumber,article,articleDetails,articleZd,
areaChildren,userCode,UserInfo,videoList,videoZd,videoDetails,forumList,forumAdd,forumDetails,
forumReply,commentReply,experience,experiencezd,experienceDetails,realName,revise,feedback,
- warningType,disasterDetail,today,carouselDetail
+ today,carouselDetail,videoAdd,articleAdd
}