From f1f041d1a1e1221e35b69f7bd8998980d9d83fb7 Mon Sep 17 00:00:00 2001 From: itgaojian163 Date: Mon, 20 Jan 2025 17:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=AD=E5=8C=BA=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 106 +++++++++++++------------ app.wxss | 4 + pages/domain/domain.js | 4 +- pages/domain/domain.wxml | 2 +- pages/industry-area/industry-area.js | 54 +++++++++++++ pages/industry-area/industry-area.json | 4 + pages/industry-area/industry-area.wxml | 13 +++ pages/industry-area/industry-area.wxss | 28 +++++++ pages/unique-detail/unique-detail.js | 3 +- pages/unique-detail/unique-detail.wxml | 1 + 10 files changed, 163 insertions(+), 56 deletions(-) create mode 100644 pages/industry-area/industry-area.js create mode 100644 pages/industry-area/industry-area.json create mode 100644 pages/industry-area/industry-area.wxml create mode 100644 pages/industry-area/industry-area.wxss diff --git a/app.json b/app.json index caf8da3..33766be 100644 --- a/app.json +++ b/app.json @@ -1,54 +1,56 @@ { - "pages": [ - "pages/index/index", - "pages/domain/domain", - "pages/policy/policy", - "pages/invest/invest", - "pages/company/company", - "pages/garden/garden", - "pages/superiority-detail/superiority-detail", - "pages/invest-detail/invest-detail", - "pages/unique-detail/unique-detail", - "pages/plates/plates", - "pages/policy-detail/policy-detail" - ], - "window": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "达拉特招商", - "navigationBarBackgroundColor": "#ffffff" - }, - "tabBar": { - "color": "#797979", - "selectedColor": "#28804F", - "borderStyle": "white", - "list": [{ - "pagePath": "pages/index/index", - "selectedIconPath": "/imgs/ic_bottom_index_sel.png", - "iconPath": "/imgs/ic_bottom_index_normal.png", - "text": "首页" - }, - { - "pagePath": "pages/domain/domain", - "selectedIconPath": "/imgs/ic_bottom_domain_sel.png", - "iconPath": "/imgs/ic_bottom_domain_normal.png", - "text": "产业" - }, - { - "pagePath": "pages/policy/policy", - "selectedIconPath": "/imgs/ic_bottom_policy_sel.png", - "iconPath": "/imgs/ic_bottom_policy_normal.png", - "text": "政策" - } - ] - }, - "style": "v2", - "componentFramework": "glass-easel", - "sitemapLocation": "sitemap.json", - "lazyCodeLoading": "requiredComponents", - "useExtendedLib": { - "weui": true - }, - "usingComponents": { - "page-loading": "/components/page-loading/page-loading" - } + "pages": [ + "pages/index/index", + "pages/domain/domain", + "pages/policy/policy", + "pages/invest/invest", + "pages/company/company", + "pages/garden/garden", + "pages/superiority-detail/superiority-detail", + "pages/invest-detail/invest-detail", + "pages/unique-detail/unique-detail", + "pages/plates/plates", + "pages/policy-detail/policy-detail", + "pages/industry-area/industry-area" + ], + "window": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "达拉特招商", + "navigationBarBackgroundColor": "#ffffff" + }, + "tabBar": { + "color": "#797979", + "selectedColor": "#28804F", + "borderStyle": "white", + "list": [ + { + "pagePath": "pages/index/index", + "selectedIconPath": "/imgs/ic_bottom_index_sel.png", + "iconPath": "/imgs/ic_bottom_index_normal.png", + "text": "首页" + }, + { + "pagePath": "pages/domain/domain", + "selectedIconPath": "/imgs/ic_bottom_domain_sel.png", + "iconPath": "/imgs/ic_bottom_domain_normal.png", + "text": "产业" + }, + { + "pagePath": "pages/policy/policy", + "selectedIconPath": "/imgs/ic_bottom_policy_sel.png", + "iconPath": "/imgs/ic_bottom_policy_normal.png", + "text": "政策" + } + ] + }, + "style": "v2", + "componentFramework": "glass-easel", + "sitemapLocation": "sitemap.json", + "lazyCodeLoading": "requiredComponents", + "useExtendedLib": { + "weui": true + }, + "usingComponents": { + "page-loading": "/components/page-loading/page-loading" + } } \ No newline at end of file diff --git a/app.wxss b/app.wxss index 102aaca..9a5b8f3 100644 --- a/app.wxss +++ b/app.wxss @@ -243,6 +243,10 @@ page::after { } .news-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; padding: 42rpx; font-size: 28rpx; color: #242424; diff --git a/pages/domain/domain.js b/pages/domain/domain.js index 58b043c..c7d34f8 100644 --- a/pages/domain/domain.js +++ b/pages/domain/domain.js @@ -213,9 +213,9 @@ Page({ }, 2000); }, //园区详情 - showGarden() { + showGarden(e) { wx.navigateTo({ - url: '/pages/garden/garden', + url: '/pages/industry-area/industry-area?id=' + e.currentTarget.dataset.id, }) } }) \ No newline at end of file diff --git a/pages/domain/domain.wxml b/pages/domain/domain.wxml index 4c8af62..3192bc5 100644 --- a/pages/domain/domain.wxml +++ b/pages/domain/domain.wxml @@ -80,7 +80,7 @@ - + {{item.newsContentTitle}} diff --git a/pages/industry-area/industry-area.js b/pages/industry-area/industry-area.js new file mode 100644 index 0000000..4b32397 --- /dev/null +++ b/pages/industry-area/industry-area.js @@ -0,0 +1,54 @@ +// pages/unique-detail/unique-detail.js +import DomainService from '../../utils/api/domainApi'; +import utils from '../../utils/util'; +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + bean: {}, + showPageLoading: true, + imgBasePath: app.globalData.imgPath + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var id = options.id + if (id) { + this.getDetail(id) + } else { + wx.navigateBack() + } + }, + getDetail(id) { + var _self = this + DomainService.doDetail(id) + .then(res => { + + if (res) { + wx.setNavigationBarTitle({ + title: res.newsContentTitle, + }) + res.newsContentContent = utils.formatHtml(res.newsContentContent) + _self.setData({ + bean: res + }) + } + _self.setData({ + showPageLoading: false + }) + }, err => { + _self.setData({ + showPageLoading: false + }) + wx.showToast({ + icon: 'none', + title: '网络错误(unique)', + }) + }) + } +}) \ No newline at end of file diff --git a/pages/industry-area/industry-area.json b/pages/industry-area/industry-area.json new file mode 100644 index 0000000..aa6e978 --- /dev/null +++ b/pages/industry-area/industry-area.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "详情" +} \ No newline at end of file diff --git a/pages/industry-area/industry-area.wxml b/pages/industry-area/industry-area.wxml new file mode 100644 index 0000000..51f7c5f --- /dev/null +++ b/pages/industry-area/industry-area.wxml @@ -0,0 +1,13 @@ + + {{bean.title}} + + 发布:{{bean.newsContentAuthor}} + 发布时间:{{bean.newsContentPublishTime}} + + + + + + + + \ No newline at end of file diff --git a/pages/industry-area/industry-area.wxss b/pages/industry-area/industry-area.wxss new file mode 100644 index 0000000..d123033 --- /dev/null +++ b/pages/industry-area/industry-area.wxss @@ -0,0 +1,28 @@ +/* pages/superiority-detail/superiority-detail.wxss */ +page { + background-color: white; +} + +.news-title { + padding: 20rpx 30rpx; + font-size: 34rpx; + font-weight: bold; + color: #242424; + text-align: center; +} + +.news-attr-box { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.news-attr { + font-size: 24rpx; + color: #949494; +} + +.news-attr:nth-of-type(n+2) { + margin-left: 20rpx; +} \ No newline at end of file diff --git a/pages/unique-detail/unique-detail.js b/pages/unique-detail/unique-detail.js index 5e34c0d..fc31261 100644 --- a/pages/unique-detail/unique-detail.js +++ b/pages/unique-detail/unique-detail.js @@ -9,7 +9,8 @@ Page({ */ data: { bean: {}, - showPageLoading: true + showPageLoading: true, + imgBasePath: app.globalData.imgPath }, /** diff --git a/pages/unique-detail/unique-detail.wxml b/pages/unique-detail/unique-detail.wxml index 91ad5b8..62af853 100644 --- a/pages/unique-detail/unique-detail.wxml +++ b/pages/unique-detail/unique-detail.wxml @@ -5,6 +5,7 @@ 发布时间:{{bean.newsContentPublishTime}} +