diff --git a/pages/home/home.js b/pages/home/home.js index a47f4a1..df2ece8 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -1,10 +1,10 @@ import http from '../../utils/api' -const baseUr = require('../../utils/baseUrl') +const baseUrl = require('../../utils/baseUrl') Page({ data: { // 轮播图数据 currentSwiper: 0, - baseUr: baseUr, + baseUrl: baseUrl, swiperList: [], // 通知公告数据 diff --git a/pages/home/home.wxml b/pages/home/home.wxml index eb1f912..fb30549 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -18,7 +18,7 @@ - + {{item.adsType}} diff --git a/pagesB/pages/policyElucidation/policyElucidation.js b/pagesB/pages/policyElucidation/policyElucidation.js index b795d62..a7a1670 100644 --- a/pagesB/pages/policyElucidation/policyElucidation.js +++ b/pagesB/pages/policyElucidation/policyElucidation.js @@ -1,3 +1,5 @@ +import http from '../../../utils/api' + // policy-interpretation.js Page({ data: { @@ -182,10 +184,21 @@ Page({ }, onLoad: function(options) { - // 初始化时显示所有政策 - this.setData({ - filteredPolicies: this.data.allPolicies - }); + + this.getpolicyelucidation() + }, + + // 政策解读列表 + getpolicyelucidation(){ + http.policyelucidation({ + data:{}, + success:res=>{ + console.log(111111,res); + this.setData({ + filteredPolicies:res.rows + }) + } + }) }, // 搜索输入处理 @@ -250,14 +263,19 @@ Page({ // 政策卡片点击 onPolicyTap: function(e) { const policyId = e.currentTarget.dataset.id; - const policy = this.data.allPolicies.find(p => p.id === policyId); - - if (policy) { - this.setData({ - currentPolicy: policy, - showPolicyDetail: true - }); - } + http.policyeDetails({ + data:{ + id:policyId + }, + success:res=>{ + console.log(333,res); + this.setData({ + showPolicyDetail: true, + currentPolicy: res.data + }) + } + }) + }, // 隐藏政策详情 diff --git a/pagesB/pages/policyElucidation/policyElucidation.wxml b/pagesB/pages/policyElucidation/policyElucidation.wxml index 25eee2e..4378db5 100644 --- a/pagesB/pages/policyElucidation/policyElucidation.wxml +++ b/pagesB/pages/policyElucidation/policyElucidation.wxml @@ -1,4 +1,3 @@ - @@ -70,18 +69,16 @@ - {{item.typeText}} - {{item.date}} + {{item.policyCategory}} + {{item.releaseDate}} {{item.title}} - - {{item.summary}} - + - {{item.source}} + {{item.issuingAgency}} @@ -100,89 +97,29 @@ 政策类型: - {{currentPolicy.typeText}} + {{currentPolicy.policyCategory}} 发布日期: - {{currentPolicy.date}} + {{currentPolicy.releaseDate}} 发布单位: - {{currentPolicy.source}} + {{currentPolicy.issuingAgency}} - - 政策要点 - - - {{index + 1}}. {{item}} - - - 详细解读 - {{currentPolicy.interpretation}} - - - - - 适用对象 - - - - {{item}} - - - - - - - 申报指南 - - - - {{index + 1}} - {{item}} - - - - - - - 专家建议 - - - - - - 张农业 - 农业政策研究员 - - - {{currentPolicy.expertAdvice}} - - - - - - 相关链接 - - - - {{item.name}} - - - + - @@ -190,6 +127,5 @@ 已加载 {{filteredPolicies.length}} 条政策解读 - 数据仅供参考,具体以官方发布为准 \ No newline at end of file diff --git a/pagesB/pages/policyElucidation/policyElucidation.wxss b/pagesB/pages/policyElucidation/policyElucidation.wxss index 5f99eb7..5a19f11 100644 --- a/pagesB/pages/policyElucidation/policyElucidation.wxss +++ b/pagesB/pages/policyElucidation/policyElucidation.wxss @@ -1,4 +1,3 @@ -/* policy-interpretation.wxss */ .container { min-height: 100vh; background-color: #f5f7fa; @@ -129,6 +128,8 @@ font-size: 22rpx; padding: 6rpx 20rpx; border-radius: 20rpx; + background-color: #e8f4ea; + color: #1a5f23; } .policy-tag.financial { @@ -157,22 +158,14 @@ } .policy-title { - font-size: 32rpx; + font-size: 30rpx; font-weight: bold; color: #333; margin-bottom: 20rpx; line-height: 1.4; } - .policy-summary { - font-size: 28rpx; - color: #666; - line-height: 1.5; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; - } + .policy-footer { display: flex; @@ -287,8 +280,6 @@ } .policy-info-row { - display: flex; - flex-wrap: wrap; background-color: #f9f9f9; border-radius: 12rpx; padding: 20rpx; @@ -296,7 +287,6 @@ } .info-item { - width: 50%; margin-bottom: 15rpx; } @@ -352,108 +342,12 @@ text-align: justify; } - .applicable-objects { - display: flex; - flex-wrap: wrap; - gap: 20rpx; - } - - .object-tag { - background-color: #f0f9ff; - color: #1a5b8c; - font-size: 24rpx; - padding: 10rpx 20rpx; - border-radius: 20rpx; - } + + + + - .guide-item { - display: flex; - align-items: flex-start; - margin-bottom: 25rpx; - } - - .guide-step { - width: 40rpx; - height: 40rpx; - background-color: #2d8c3c; - color: white; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - font-size: 24rpx; - margin-right: 20rpx; - flex-shrink: 0; - } - - .guide-text { - flex: 1; - line-height: 1.5; - } - - .expert-advice { - background-color: #f9f9f9; - border-radius: 12rpx; - padding: 25rpx; - } - - .advice-header { - display: flex; - align-items: center; - margin-bottom: 20rpx; - } - - .expert-avatar { - width: 80rpx; - height: 80rpx; - border-radius: 50%; - margin-right: 20rpx; - } - - .expert-info { - display: flex; - flex-direction: column; - } - - .expert-name { - font-size: 28rpx; - font-weight: bold; - color: #333; - } - - .expert-title { - font-size: 24rpx; - color: #999; - margin-top: 5rpx; - } - - .advice-content { - font-size: 26rpx; - color: #666; - line-height: 1.6; - } - - .link-item { - display: flex; - align-items: center; - justify-content: space-between; - padding: 20rpx 0; - border-bottom: 1rpx solid #eee; - } - - .link-item:last-child { - border-bottom: none; - } - - .link-text { - font-size: 28rpx; - color: #1a5f23; - } - - .link-icon { - width: 30rpx; - height: 30rpx; - } + .modal-footer { display: flex; @@ -478,11 +372,7 @@ color: #666; border:1px solid rgb(243, 241, 241); } - - .btn-primary { - background-color: #2d8c3c; - color: white; - } + /* 底部提示 */ .bottom-tip { diff --git a/pagesB/pages/training/training.js b/pagesB/pages/training/training.js index fae7197..98e8e7a 100644 --- a/pagesB/pages/training/training.js +++ b/pagesB/pages/training/training.js @@ -1,11 +1,12 @@ -// pages/training/training.js +import http from '../../../utils/api' +const baseUrl = require('../../../utils/baseUrl') Page({ data: { currentTab: 0, searchKeyword: '', - articleActiveCategory: 'all', + articleActiveCategory: 0, videoActiveCategory: 'all', - + baseUrl:baseUrl, // 文章数据 articles: [ { @@ -249,11 +250,42 @@ Page({ onLoad() { // 初始化数据 this.setData({ - filteredArticles: this.data.articles, + // filteredArticles: this.data.articles, filteredVideos: this.data.videos }); + this.getarticle() + this.getarticleZd() }, + // 文章列表 + getarticle(){ + http.article({ + data:{}, + success:res=>{ + console.log(1111,res); + this.setData({ + filteredArticles:res.rows + }) + } + }) + }, + + // 文章字典 + getarticleZd(){ + http.articleZd({ + data:{ + dictType:'article_category' + }, + success:res=>{ + console.log(2222,res); + this.setData({ + wzzd:res.rows + }) + } + }) + }, + + // 切换主选项卡 switchTab(e) { const tab = parseInt(e.currentTarget.dataset.tab); @@ -292,11 +324,11 @@ Page({ // 选择文章分类 selectArticleCategory(e) { - const category = e.currentTarget.dataset.category; - this.setData({ articleActiveCategory: category }); - this.setData({ - filteredArticles: this.filterArticles(this.data.searchKeyword, category) - }); + console.log(3333,e); + const category = Number(e.currentTarget.dataset.category); + this.setData({ + articleActiveCategory: category + }); }, // 选择视频分类 diff --git a/pagesB/pages/training/training.wxml b/pagesB/pages/training/training.wxml index 8af1f91..56f9d0b 100644 --- a/pagesB/pages/training/training.wxml +++ b/pagesB/pages/training/training.wxml @@ -53,43 +53,20 @@ 全部 - 技术干货 - - - - 商业思维 - - - - 管理技能 - - - - 职业发展 + {{item.dictLabel}} @@ -103,11 +80,10 @@ wx:key="id" bindtap="viewArticleDetail" data-id="{{item.id}}" - animation="{{item.animation}}" > - + {{item.category}} @@ -116,23 +92,23 @@ diff --git a/pagesB/pages/training/training.wxss b/pagesB/pages/training/training.wxss index 9d9607b..3ed584b 100644 --- a/pagesB/pages/training/training.wxss +++ b/pagesB/pages/training/training.wxss @@ -620,6 +620,7 @@ width: 30rpx; height: 30rpx; transition: all 0.3s ease; + border-radius: 50%; } .meta-item:active .meta-icon { diff --git a/utils/api.js b/utils/api.js index fdc3a1a..8e2e1f1 100644 --- a/utils/api.js +++ b/utils/api.js @@ -96,10 +96,37 @@ function tipList(params) { http('/system/tip/list', 'get', params) } +// 在线培训文章发布 +function article(params) { + http('/vet/knowledge/published/list', 'get', params) +} + +// 文章分类字典 +function articleZd(params) { + http('/system/dict/data/list', 'get', params) +} + +// 在线培训文章发布详情 +function articleDetails(params) { + http('/vet/knowledge/published/' + params.data.id, 'get', params) +} + +// 政策解读列表 +function policyelucidation(params) { + http('/system/interpretation/published/list', 'get', params) +} + +// 政策解读详情 +function policyeDetails(params) { + http('/system/interpretation/published/' + params.data.id, 'get', params) +} + + + export default { // 暴露接口 - login,carousel,disaster,pharmacy,guidance,getPhoneNumber,inquiry, + login,carousel,disaster,pharmacy,guidance,getPhoneNumber,inquiry,policyeDetails, search,trend,feed,sales,wzd,wzdxq,wzdAdd,expertsList,recommendationList, - recommendationXq,queryList,tipList + recommendationXq,queryList,tipList,article,articleDetails,articleZd,policyelucidation }