From 1746305c7e0f5f26d5a8fb0e5b26dfdfa6a73c24 Mon Sep 17 00:00:00 2001 From: itgaojian163 Date: Mon, 20 Jan 2025 17:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 7 +- app.wxss | 18 ++- components/content-loading/loading.js | 24 ++++ components/content-loading/loading.json | 4 + components/content-loading/loading.wxml | 4 + components/content-loading/loading.wxss | 52 ++++++++ pages/company/company.js | 114 ++++++++---------- pages/company/company.wxml | 66 ++++------ pages/company/company.wxss | 12 +- pages/domain/domain.js | 68 ++++++++++- pages/domain/domain.wxml | 84 +++---------- pages/index/index.js | 71 +++++++++-- pages/index/index.json | 3 +- pages/index/index.wxml | 4 +- pages/invest-detail/invest-detail.js | 55 +++++++++ pages/invest-detail/invest-detail.json | 4 + pages/invest-detail/invest-detail.wxml | 31 +++++ pages/invest-detail/invest-detail.wxss | 90 ++++++++++++++ pages/plates/plates.js | 52 ++++++++ pages/plates/plates.json | 3 + pages/plates/plates.wxml | 11 ++ pages/plates/plates.wxss | 34 ++++++ pages/policy-detail/policy-detail.js | 53 ++++++++ pages/policy-detail/policy-detail.json | 3 + pages/policy-detail/policy-detail.wxml | 11 ++ pages/policy-detail/policy-detail.wxss | 28 +++++ pages/policy/policy.js | 67 +++++++++- pages/policy/policy.json | 4 +- pages/policy/policy.wxml | 46 +++---- pages/policy/policy.wxss | 12 +- .../superiority-detail/superiority-detail.js | 54 +++++++++ .../superiority-detail.json | 4 + .../superiority-detail.wxml | 11 ++ .../superiority-detail.wxss | 28 +++++ pages/unique-detail/unique-detail.js | 53 ++++++++ pages/unique-detail/unique-detail.json | 4 + pages/unique-detail/unique-detail.wxml | 11 ++ pages/unique-detail/unique-detail.wxss | 28 +++++ utils/api/commonApi.js | 15 +++ utils/api/domainApi.js | 19 +++ utils/api/indexApi.js | 8 ++ utils/api/policyApi.js | 19 +++ utils/util.js | 19 ++- 43 files changed, 1077 insertions(+), 231 deletions(-) create mode 100644 components/content-loading/loading.js create mode 100644 components/content-loading/loading.json create mode 100644 components/content-loading/loading.wxml create mode 100644 components/content-loading/loading.wxss create mode 100644 pages/invest-detail/invest-detail.js create mode 100644 pages/invest-detail/invest-detail.json create mode 100644 pages/invest-detail/invest-detail.wxml create mode 100644 pages/invest-detail/invest-detail.wxss create mode 100644 pages/plates/plates.js create mode 100644 pages/plates/plates.json create mode 100644 pages/plates/plates.wxml create mode 100644 pages/plates/plates.wxss create mode 100644 pages/policy-detail/policy-detail.js create mode 100644 pages/policy-detail/policy-detail.json create mode 100644 pages/policy-detail/policy-detail.wxml create mode 100644 pages/policy-detail/policy-detail.wxss create mode 100644 pages/superiority-detail/superiority-detail.js create mode 100644 pages/superiority-detail/superiority-detail.json create mode 100644 pages/superiority-detail/superiority-detail.wxml create mode 100644 pages/superiority-detail/superiority-detail.wxss create mode 100644 pages/unique-detail/unique-detail.js create mode 100644 pages/unique-detail/unique-detail.json create mode 100644 pages/unique-detail/unique-detail.wxml create mode 100644 pages/unique-detail/unique-detail.wxss create mode 100644 utils/api/commonApi.js create mode 100644 utils/api/policyApi.js diff --git a/app.json b/app.json index 2b514dd..caf8da3 100644 --- a/app.json +++ b/app.json @@ -5,7 +5,12 @@ "pages/policy/policy", "pages/invest/invest", "pages/company/company", - "pages/garden/garden" + "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", diff --git a/app.wxss b/app.wxss index 9af45ce..102aaca 100644 --- a/app.wxss +++ b/app.wxss @@ -38,13 +38,10 @@ page::after { } .container { - width: 100vw; display: flex; flex-direction: column; - align-items: center; justify-content: flex-start; box-sizing: border-box; - overflow: scroll; } .mt-10 { @@ -84,6 +81,7 @@ page::after { width: 90%; height: 3rpx; background-color: #F0F0F0; + align-self: center; } .divider-v-100 { @@ -195,6 +193,14 @@ page::after { width: 100%; } +.line-1 { + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; + width: 100%; +} + .line-noappoint { @@ -234,4 +240,10 @@ page::after { .font-30 { font-size: 30rpx; +} + +.news-content { + padding: 42rpx; + font-size: 28rpx; + color: #242424; } \ No newline at end of file diff --git a/components/content-loading/loading.js b/components/content-loading/loading.js new file mode 100644 index 0000000..fa59c26 --- /dev/null +++ b/components/content-loading/loading.js @@ -0,0 +1,24 @@ +// components/content-loading/loading.js +Component({ + + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) \ No newline at end of file diff --git a/components/content-loading/loading.json b/components/content-loading/loading.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/content-loading/loading.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/content-loading/loading.wxml b/components/content-loading/loading.wxml new file mode 100644 index 0000000..61243fc --- /dev/null +++ b/components/content-loading/loading.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/components/content-loading/loading.wxss b/components/content-loading/loading.wxss new file mode 100644 index 0000000..09b5f42 --- /dev/null +++ b/components/content-loading/loading.wxss @@ -0,0 +1,52 @@ +/* components/content-loading/loading.wxss */ +/* components/page-loading/page-loading.wxss */ +.page-body { + width: 100vw; + height: 100vh; + background-color: rgba(255, 255, 255, 1); + z-index: 1; + position: absolute; + top: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex: 1; +} + +.loading { + position: relative; + width: 50px; +} + +.loading:before, +.loading:after { + position: absolute; + width: 20px; + height: 20px; + content: ""; + animation: jumping 0.5s infinite alternate; + background: rgba(0, 0, 0, 0); +} + +.loading:before { + left: 0; +} + +.loading:after { + right: 0; + animation-delay: 0.15s; +} + +@keyframes jumping { + 0% { + transform: scale(1) translateY(0px) rotateX(0deg); + box-shadow: 0 0 0 rgba(0, 0, 0, 0); + } + + 100% { + transform: scale(1.2) translateY(-25px) rotateX(45deg); + background: #256742; + box-shadow: 0 25px 40px #256742; + } +} \ No newline at end of file diff --git a/pages/company/company.js b/pages/company/company.js index 87c7d64..422c392 100644 --- a/pages/company/company.js +++ b/pages/company/company.js @@ -1,66 +1,58 @@ // pages/company/company.js +import DomainService from '../../utils/api/domainApi'; +import utils from '../../utils/util' +const app = getApp(); Page({ - /** - * 页面的初始数据 - */ - data: { + /** + * 页面的初始数据 + */ + data: { + bean: {}, //详情 + showPageLoading: true + }, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var id = options.id + if (id) { + this.getDetail(id) + } else { + wx.navigateBack() + } + }, + getDetail(id) { + var _self = this + DomainService.doGetKeyEnterprise({ + id: id + }) + .then(res => { + if (res.guDongList && res.guDongList.length > 0) { + res.guDongList.forEach(item => { + item.surname = item.name.substr(0, 1) + }) + } + if (res) { + res.content = utils.formatHtml(res.content) + _self.setData({ + bean: res + }) + } + }, err => { + wx.showToast({ + icon: 'none', + title: '网络错误(company)', + }) + }) + }, + callPhone() { + var _self = this + if (_self.data.bean.lianXi.phone) { + wx.makePhoneCall({ + phoneNumber: _self.data.bean.lianXi.phone, + }) + } + } }) \ No newline at end of file diff --git a/pages/company/company.wxml b/pages/company/company.wxml index 1d36d09..dbf7a0f 100644 --- a/pages/company/company.wxml +++ b/pages/company/company.wxml @@ -1,29 +1,29 @@ - 内蒙古好友发科技有限公司 - 状态 + {{bean.name}} + 存续 - + 工商信息 - + 企业法人 - 企业法人 + {{bean.faRen}} 注册资本 - 10000万 + {{bean.ziBen}} @@ -33,7 +33,7 @@ 成立日期 - 2024-23-23 + {{bean.chengLi}} @@ -43,59 +43,43 @@ 注册地址 - 内蒙古呼和浩特市 + {{bean.zhuCeDiZhi}} 股东信息 - 主要人员 + - + - - 姓名 + {{item.surname}} + {{item.name}} 认缴出资额: - 999.99万人名币 + {{item.chuZi}} 持股比例: - 99.99% - - - - - - 姓名 - - - 认缴出资额: - 999.99万人名币 - - - 持股比例: - 99.99% + {{item.biLi}}% 企业介绍 - - - 企业简介 - 企业简介 - 企业简介 - 企业简介 - 企业简介 - - - 联系我们 - + + + + 联系方式 + 地址:{{bean.lianXi.name}} + 电话:{{bean.lianXi.phone}} + + + 联系我们 \ No newline at end of file diff --git a/pages/company/company.wxss b/pages/company/company.wxss index 8a9a573..425ee22 100644 --- a/pages/company/company.wxss +++ b/pages/company/company.wxss @@ -95,6 +95,10 @@ page { align-items: flex-start; justify-content: flex-start; flex: 1; + width: 50%; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; } .info-item .title { @@ -255,9 +259,9 @@ page { .desc-title { font-family: Source Han Sans CN; - font-weight: 500; - font-size: 27rpx; + font-weight: bold; + font-size: 32rpx; color: #303030; - line-height: 27rpx; + line-height: 32rpx; margin-top: 60rpx; -} +} \ No newline at end of file diff --git a/pages/domain/domain.js b/pages/domain/domain.js index ec63ae8..58b043c 100644 --- a/pages/domain/domain.js +++ b/pages/domain/domain.js @@ -20,6 +20,8 @@ Page({ imgBasePath: app.globalData.imgPath, domainInfo: {}, //产业基础 isAreaExpand: false, + industryAreaList: [], //产业园区 + platesList: [], //产业图谱 }, /** @@ -36,15 +38,20 @@ Page({ _self.getDomainInfo() //特色产业 _self.getDomainCategory() + //产业图谱 + _self.getPlates() //重点企业 _self.getKeyEnterprise() + //产业园区 + _self.getIndustryArea() + setTimeout(() => { _self.setData({ showPageLoading: false }) }, 2000); }, - onReady() { + countWidth() { var _self = this setTimeout(_ => { const query = wx.createSelectorQuery().in(this) @@ -74,6 +81,7 @@ Page({ } }, err => { wx.showToast({ + icon: "none", title: '网络错误(domainInfo)', }) }) @@ -90,10 +98,41 @@ Page({ } }, err => { wx.showToast({ + icon: "none", title: '网络错误(domainCategory)', }) }) }, + //特色产业详情 + goUniqueDetail(e) { + wx.navigateTo({ + url: '/pages/unique-detail/unique-detail?id=' + e.currentTarget.dataset.id, + }) + }, + //产业图谱 + getPlates() { + var _self = this + DomainService.doGetPlates() + .then(res => { + if (res) { + _self.setData({ + platesList: res.rows + }) + } + _self.countWidth() + }, err => { + wx.showToast({ + icon: "none", + title: '网络错误(plates)', + }) + }) + }, + //产业图谱详情 + goPlates(e) { + wx.navigateTo({ + url: '/pages/plates/plates?id=' + e.currentTarget.dataset.id, + }) + }, //重点企业 getKeyEnterprise() { var _self = this @@ -106,10 +145,26 @@ Page({ } }, err => { wx.showToast({ + icon: "none", title: '网络错误(domainEnterprise)', }) }) }, + //产业园区 + getIndustryArea() { + var _self = this + DomainService.doGetIndustryArea() + .then(res => { + _self.setData({ + industryAreaList: res.rows + }) + }, err => { + wx.showToast({ + icon: "none", + title: '网络错误(IndustryArea)', + }) + }) + }, //监听scroll-view滚动 scrollPlates(e) { var _self = this @@ -131,9 +186,9 @@ Page({ }) }, //公司详情 - showCompany() { + showCompany(e) { wx.navigateTo({ - url: '/pages/company/company', + url: '/pages/company/company?id=' + e.currentTarget.dataset.id, }) }, onPullDownRefresh() { @@ -141,8 +196,15 @@ Page({ _self.setData({ showPageLoading: true }) + //产业基础 + _self.getDomainInfo() + //特色产业 _self.getDomainCategory() + //重点企业 _self.getKeyEnterprise() + //产业园区 + _self.getIndustryArea() + _self.getPlates() setTimeout(() => { wx.stopPullDownRefresh() _self.setData({ diff --git a/pages/domain/domain.wxml b/pages/domain/domain.wxml index ecbe77d..4c8af62 100644 --- a/pages/domain/domain.wxml +++ b/pages/domain/domain.wxml @@ -22,7 +22,7 @@ - + {{item.directoriesName}} @@ -39,54 +39,12 @@ - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - - - - 电子信息 - + + + + {{item.newsContentTitle}} + + @@ -102,7 +60,7 @@ - + {{item.name}} @@ -121,26 +79,12 @@ - - - 内蒙古呼和浩特 - - - - 内蒙古呼和浩特 - - - - 内蒙古呼和浩特 - - - - 内蒙古呼和浩特 - - - - 内蒙古呼和浩特 - + + + + {{item.newsContentTitle}} + + diff --git a/pages/index/index.js b/pages/index/index.js index 2dcb554..0c42c82 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -61,21 +61,21 @@ Page({ this.setData({ screenWidth: screenWidth - 34 }) - setTimeout(() => { - var temp = [] - for (let i = 0; i < 10; i++) { - temp.push(i) - } - _self.setData({ - testList: temp - }) - _self.countWidth() - }, 2000); + // setTimeout(() => { + // var temp = [] + // for (let i = 0; i < 10; i++) { + // temp.push(i) + // } + // _self.setData({ + // testList: temp + // }) + // _self.countWidth() + // }, 2000); setTimeout(() => { _self.setData({ showPageLoading: false }) - }, 300); + }, 1000); //获取简介 this.getDescVideo() //介绍 @@ -94,13 +94,13 @@ Page({ var _self = this IndexService.doGetDescVideo() .then(res => { - console.log(res) _self.setData({ descVideoUrl: _self.data.imgBasePath + res.rows[0].fileList[0].contentFileFileId, descVideoCover: _self.data.imgBasePath + res.rows[0].fileList[0].contentFileCoverId }) }, err => { wx.showToast({ + icon: "none", title: '网络错误(video)', }) }) @@ -118,6 +118,7 @@ Page({ }, err => { console.log(err) wx.showToast({ + icon: "none", title: '网络错误(简介)', }) }) @@ -145,6 +146,7 @@ Page({ }, err => { console.log(err) wx.showToast({ + icon: "none", title: '网络错误(数据统计)', }) }) @@ -161,11 +163,18 @@ Page({ } }, err => { wx.showToast({ + icon: "none", title: '网络错误(投资机会)', }) }) }, - //地区概况,资源条件,气候条件,基础设施 + goInvestDetail(e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '/pages/invest-detail/invest-detail?id=' + id, + }) + }, + //投资环境详情 getInvestArea(id) { var _self = this IndexService.doGetInvestArea({ @@ -179,10 +188,12 @@ Page({ } }, err => { wx.showToast({ + icon: "none", title: '网络错误(InvestArea)', }) }) }, + //投资优势 getSuperiority() { var _self = this IndexService.doGetSuperiorityList() @@ -192,12 +203,20 @@ Page({ superiorityList: res }) } + _self.countWidth() }, err => { wx.showToast({ + icon: "none", title: '网络错误(superiority)', }) }) }, + //投资优势详情 + goSuperiorityDetail(e) { + wx.navigateTo({ + url: '/pages/superiority-detail/superiority-detail?id=' + e.currentTarget.dataset.id, + }) + }, //获取投资环境分类 getInvestAreaCategory() { var _self = this @@ -211,6 +230,7 @@ Page({ } }, err => { wx.showToast({ + icon: "none", title: '网络错误(InvestCategory)', }) console.log(err) @@ -306,4 +326,29 @@ Page({ url: '/pages/invest/invest', }) }, + onPullDownRefresh() { + var _self = this + _self.setData({ + showPageLoading: true + }) + setTimeout(() => { + wx.stopPullDownRefresh() + _self.setData({ + showPageLoading: false + }) + }, 2000); + //获取简介 + _self.getDescVideo() + //介绍 + _self.getDesc() + //数据统计 + _self.getStatistics() + //投资机会 + _self.getInvest() + //默认获取地区概况 + _self.getInvestAreaCategory() + //投资环境 + _self.getSuperiority() + + } }) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json index b58254b..7933411 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -3,5 +3,6 @@ "mp-loading": "weui-miniprogram/loading/loading", "mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet", "bottom-sheet": "/components/fui-bottom-popup/fui-bottom-popup" - } + }, + "enablePullDownRefresh": true } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 5c319df..2e08a58 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -84,7 +84,7 @@ - + {{item.directoriesName}} @@ -108,7 +108,7 @@ --> - + {{item.title}} 查看详情 > diff --git a/pages/invest-detail/invest-detail.js b/pages/invest-detail/invest-detail.js new file mode 100644 index 0000000..f66eb5c --- /dev/null +++ b/pages/invest-detail/invest-detail.js @@ -0,0 +1,55 @@ +// pages/invest-detail/invest-detail.js +import IndexService from '../../utils/api/indexApi'; +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.getDetailBean(id) + } else { + wx.navigateBack() + } + }, + getDetailBean(id) { + var _self = this + IndexService.doGetInvestDetail({ + id: id + }) + .then(res => { + _self.setData({ + showPageLoading: false + }) + if (res) { + wx.setNavigationBarTitle({ + title: res.title, + }) + res.content = utils.formatHtml(res.content) + _self.setData({ + bean: res + }) + } + }, err => { + _self.setData({ + showPageLoading: false + }) + wx.showToast({ + title: '网络错误', + }) + }) + + } +}) \ No newline at end of file diff --git a/pages/invest-detail/invest-detail.json b/pages/invest-detail/invest-detail.json new file mode 100644 index 0000000..aa6e978 --- /dev/null +++ b/pages/invest-detail/invest-detail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "详情" +} \ No newline at end of file diff --git a/pages/invest-detail/invest-detail.wxml b/pages/invest-detail/invest-detail.wxml new file mode 100644 index 0000000..db4810c --- /dev/null +++ b/pages/invest-detail/invest-detail.wxml @@ -0,0 +1,31 @@ + + + {{bean.title}} + + + 预计总投资 + {{bean.money}}{{bean.moneyUnit}} + + + + 所属产业 + {{bean.type}} + + + + 占地面积 + {{bean.area}}{{bean.areaUnit}} + + + + 用地类型 + {{bean.landType}} + + + + + + + + + \ No newline at end of file diff --git a/pages/invest-detail/invest-detail.wxss b/pages/invest-detail/invest-detail.wxss new file mode 100644 index 0000000..23661a6 --- /dev/null +++ b/pages/invest-detail/invest-detail.wxss @@ -0,0 +1,90 @@ +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; +} + + +.p-container { + display: flex; + flex-direction: column; + padding: 28rpx; + border-radius: 5rpx; +} + +.chance-item-attrs { + background: #FFFFFF; + border-radius: 13rpx; + display: flex; + flex-direction: row; + justify-content: space-between; + background: rgba(240, 240, 240, 0.59); + align-items: center; + margin-top: 10rpx; +} + +.chance-attr { + display: flex; + flex-direction: column; + padding: 20rpx; +} + +.chance-attr .title { + font-size: 16rpx; + color: #757575; +} + +.chance-attr .content { + font-size: 24rpx; + margin-top: 10rpx; + color: #F99E00; +} + +.divide-line { + width: 1rpx; + height: 33rpx; + background: rgba(204, 226, 214, 0.35); +} + +.chance-item-content { + font-family: STZhongsong; + font-weight: 400; + font-size: 16rpx; + color: #8E8E8E; + margin-top: 10rpx; +} + +.chance-item-title .more { + width: 107rpx; + height: 36rpx; + background: linear-gradient(0deg, #F99E00 0%, #FF8282 100%); + border-radius: 3rpx; + font-family: Source Han Sans CN; + font-weight: 400; + font-size: 16rpx; + color: #FFFFFF; + text-align: center; + line-height: 36rpx; +} \ No newline at end of file diff --git a/pages/plates/plates.js b/pages/plates/plates.js new file mode 100644 index 0000000..a4bfa58 --- /dev/null +++ b/pages/plates/plates.js @@ -0,0 +1,52 @@ +// 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 + }, + + /** + * 生命周期函数--监听页面加载 + */ + 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({ + title: '网络错误(unique)', + }) + }) + } +}) \ No newline at end of file diff --git a/pages/plates/plates.json b/pages/plates/plates.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/plates/plates.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/plates/plates.wxml b/pages/plates/plates.wxml new file mode 100644 index 0000000..91ad5b8 --- /dev/null +++ b/pages/plates/plates.wxml @@ -0,0 +1,11 @@ + + {{bean.title}} + + 发布:{{bean.newsContentAuthor}} + 发布时间:{{bean.newsContentPublishTime}} + + + + + + \ No newline at end of file diff --git a/pages/plates/plates.wxss b/pages/plates/plates.wxss new file mode 100644 index 0000000..3775bde --- /dev/null +++ b/pages/plates/plates.wxss @@ -0,0 +1,34 @@ +/* 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; +} + + +img { + width: 100%; + margin: 8px 0; +} \ No newline at end of file diff --git a/pages/policy-detail/policy-detail.js b/pages/policy-detail/policy-detail.js new file mode 100644 index 0000000..0bbc346 --- /dev/null +++ b/pages/policy-detail/policy-detail.js @@ -0,0 +1,53 @@ +// pages/superiority-detail/superiority-detail.js +import PolicyService from '../../utils/api/policyApi'; +import utils from '../../utils/util'; +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + showPageLoading: true, + bean: {}, + imgBasePath: app.globalData.imgPath + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var id = options.id + if (id) { + this.getDetailData(id) + } else { + wx.navigateBack() + } + }, + getDetailData(id) { + var _self = this + PolicyService.doGetDetail(id) + .then(res => { + _self.setData({ + showPageLoading: false + }) + if (res) { + res.newsContentContent = utils.formatHtml(res.newsContentContent) + _self.setData({ + bean: res + }) + wx.setNavigationBarTitle({ + title: res.newsContentTitle, + }) + } + }, err => { + _self.setData({ + showPageLoading: false + }) + wx.showToast({ + icon: 'none', + title: '网络错误', + }) + }) + } +}) \ No newline at end of file diff --git a/pages/policy-detail/policy-detail.json b/pages/policy-detail/policy-detail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/policy-detail/policy-detail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/policy-detail/policy-detail.wxml b/pages/policy-detail/policy-detail.wxml new file mode 100644 index 0000000..91ad5b8 --- /dev/null +++ b/pages/policy-detail/policy-detail.wxml @@ -0,0 +1,11 @@ + + {{bean.title}} + + 发布:{{bean.newsContentAuthor}} + 发布时间:{{bean.newsContentPublishTime}} + + + + + + \ No newline at end of file diff --git a/pages/policy-detail/policy-detail.wxss b/pages/policy-detail/policy-detail.wxss new file mode 100644 index 0000000..854a92b --- /dev/null +++ b/pages/policy-detail/policy-detail.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; +} diff --git a/pages/policy/policy.js b/pages/policy/policy.js index d22c5d0..2aa141e 100644 --- a/pages/policy/policy.js +++ b/pages/policy/policy.js @@ -1,25 +1,86 @@ // pages/policy/policy.js +import PolicyService from '../../utils/api/policyApi'; +const app = getApp(); + Page({ /** * 页面的初始数据 */ data: { - curTab: 1, isLoading: false, hasMore: true, triggered: false, + policyList: [], //政策 + pageShowLoading: true, //显示页面加载 + currentId: '8e20af26-fed2-4829-a87c-9eddd6311d7c', + keywords: '', + showContentLoading: true }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.getPolicyList(this.data.keywords) + }, + inputValue(e) { + var _self = this + _self.setData({ + keywords: e.detail.value + }) + }, + doSearch() { + var _self = this + _self.getPolicyList(_self.data.keywords) + _self.setData({ + keywords: '' + }) + }, + getPolicyList(k) { + var _self = this + _self.setData({ + showContentLoading: true + }) + PolicyService.doGetPolicyList({ + newsDirectoriesId: _self.data.currentId, + keywords: k + }) + .then(res => { + _self.setData({ + showContentLoading: false + }) + if (res) { + if (res.rows && res.rows.length <= 0) { + wx.showToast({ + icon: 'none', + title: '暂无数据', + }) + } else { + _self.setData({ + policyList: res.rows + }) + } + } + }, err => { + _self.setData({ + showContentLoading: false + }) + wx.showToast({ + title: '网络错误(policy)', + }) + }) + }, + //详情 + goDetail(e) { + wx.navigateTo({ + url: '/pages/policy-detail/policy-detail?id=' + e.currentTarget.dataset.id, + }) }, changeTab(e) { this.setData({ - curTab: e.currentTarget.dataset.index + currentId: e.currentTarget.dataset.id }) + this.getPolicyList(this.data.keywords) } }) \ No newline at end of file diff --git a/pages/policy/policy.json b/pages/policy/policy.json index 8835af0..4d1544a 100644 --- a/pages/policy/policy.json +++ b/pages/policy/policy.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "content-loading": "/components/content-loading/loading" + } } \ No newline at end of file diff --git a/pages/policy/policy.wxml b/pages/policy/policy.wxml index 1f8d17a..b1776e8 100644 --- a/pages/policy/policy.wxml +++ b/pages/policy/policy.wxml @@ -1,34 +1,34 @@ - + - + - - 国家政策 + + 国家政策 - - 地方政策 + + 地方政策 - - - - - 锡林郭勒盟惠企政策“大礼包”——奖励补贴类(八) - - 内蒙古自治区锡林郭勒盟发展和改革委员会 - 2024-12-27 - - - - - - - - - + + + + + + {{item.newsContentTitle}} + + {{item.newsContentAuthor}} + {{item.newsContentPublishTime}} + + + + + + + + \ No newline at end of file diff --git a/pages/policy/policy.wxss b/pages/policy/policy.wxss index 91adec0..2bcdc09 100644 --- a/pages/policy/policy.wxss +++ b/pages/policy/policy.wxss @@ -1,14 +1,20 @@ /* pages/policy/policy.wxss */ page { background-color: white; + +} + +.p-body { + display: flex; + flex-direction: column; + height: 100vh; } .scrollarea { flex: 1; overflow-y: hidden; - height: 85vh; - width: 100vw; overflow: hidden; + height: 85vh; } .search-box { @@ -87,7 +93,7 @@ page { display: flex; flex-direction: column; justify-content: flex-start; - padding: 30rpx; + margin: 20rpx 40rpx 20rpx 40rpx; } .policy-item-title { diff --git a/pages/superiority-detail/superiority-detail.js b/pages/superiority-detail/superiority-detail.js new file mode 100644 index 0000000..f67c5a3 --- /dev/null +++ b/pages/superiority-detail/superiority-detail.js @@ -0,0 +1,54 @@ +// pages/superiority-detail/superiority-detail.js +import IndexService from '../../utils/api/indexApi'; +import utils from '../../utils/util' +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + showPageLoading: true, + bean: {}, + imgBasePath: app.globalData.imgPath + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var id = options.id + if (id) { + this.getDetailData(id) + } else { + wx.navigateBack() + } + }, + getDetailData(id) { + var _self = this + IndexService.doGetSuperiorityDetail({ + newsDirectoriesId: id + }) + .then(res => { + _self.setData({ + showPageLoading: false + }) + if (res && res.rows) { + res.rows[0].newsContentContent = utils.formatHtml(res.rows[0].newsContentContent) + _self.setData({ + bean: res.rows[0] + }) + wx.setNavigationBarTitle({ + title: res.rows[0].newsContentTitle, + }) + } + }, err => { + _self.setData({ + showPageLoading: false + }) + wx.showToast({ + title: '网络错误', + }) + }) + } +}) \ No newline at end of file diff --git a/pages/superiority-detail/superiority-detail.json b/pages/superiority-detail/superiority-detail.json new file mode 100644 index 0000000..aa6e978 --- /dev/null +++ b/pages/superiority-detail/superiority-detail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "详情" +} \ No newline at end of file diff --git a/pages/superiority-detail/superiority-detail.wxml b/pages/superiority-detail/superiority-detail.wxml new file mode 100644 index 0000000..91ad5b8 --- /dev/null +++ b/pages/superiority-detail/superiority-detail.wxml @@ -0,0 +1,11 @@ + + {{bean.title}} + + 发布:{{bean.newsContentAuthor}} + 发布时间:{{bean.newsContentPublishTime}} + + + + + + \ No newline at end of file diff --git a/pages/superiority-detail/superiority-detail.wxss b/pages/superiority-detail/superiority-detail.wxss new file mode 100644 index 0000000..854a92b --- /dev/null +++ b/pages/superiority-detail/superiority-detail.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; +} diff --git a/pages/unique-detail/unique-detail.js b/pages/unique-detail/unique-detail.js new file mode 100644 index 0000000..5e34c0d --- /dev/null +++ b/pages/unique-detail/unique-detail.js @@ -0,0 +1,53 @@ +// 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 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var id = options.id + if (id) { + this.getDetail(id) + } else { + wx.navigateBack() + } + }, + getDetail(id) { + var _self = this + DomainService.doGetDetail({ + newsDirectoriesId: id + }) + .then(res => { + _self.setData({ + showPageLoading: false + }) + if (res && res.rows) { + wx.setNavigationBarTitle({ + title: res.rows[0].newsContentTitle, + }) + res.rows[0].newsContentContent = utils.formatHtml(res.rows[0].newsContentContent) + _self.setData({ + bean: res.rows[0] + }) + } + }, err => { + _self.setData({ + showPageLoading: false + }) + wx.showToast({ + title: '网络错误(unique)', + }) + }) + } +}) \ No newline at end of file diff --git a/pages/unique-detail/unique-detail.json b/pages/unique-detail/unique-detail.json new file mode 100644 index 0000000..aa6e978 --- /dev/null +++ b/pages/unique-detail/unique-detail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "详情" +} \ No newline at end of file diff --git a/pages/unique-detail/unique-detail.wxml b/pages/unique-detail/unique-detail.wxml new file mode 100644 index 0000000..91ad5b8 --- /dev/null +++ b/pages/unique-detail/unique-detail.wxml @@ -0,0 +1,11 @@ + + {{bean.title}} + + 发布:{{bean.newsContentAuthor}} + 发布时间:{{bean.newsContentPublishTime}} + + + + + + \ No newline at end of file diff --git a/pages/unique-detail/unique-detail.wxss b/pages/unique-detail/unique-detail.wxss new file mode 100644 index 0000000..d123033 --- /dev/null +++ b/pages/unique-detail/unique-detail.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/utils/api/commonApi.js b/utils/api/commonApi.js new file mode 100644 index 0000000..17052ba --- /dev/null +++ b/utils/api/commonApi.js @@ -0,0 +1,15 @@ +import { + request +} from "../http"; + +// 管理地址 +const apiPath = { + investDetail: "/news-content/listpage?rows=1&page=1", //投资优势 +} +class CommonService { + static doGetInvestDetail(data) { + return request(apiPath.investDetail, "GET", data) + } +} + +export default CommonService; \ No newline at end of file diff --git a/utils/api/domainApi.js b/utils/api/domainApi.js index 7448fce..03726c9 100644 --- a/utils/api/domainApi.js +++ b/utils/api/domainApi.js @@ -7,6 +7,10 @@ const apiPath = { domainCategory: "/news-directories/list?directoriesParentId=b04b4dc3-020a-4a9f-a567-464d27f70b19", //特色产业 keyEnterprise: "/query/sql/q2984a0f", //重点企业 domainInfo: "/news-content/listpage?newsDirectoriesId=2c76e2a0-37b2-4144-9d92-64376e5a22c3", //产业基础 + industryArea: "/news-content/listpage?newsDirectoriesId=df975b5b-74bf-4c5d-a4bc-10acb6f32e81", //产业园区 + plates: "/news-content/listpage?newsDirectoriesId=40d9b2e3-a609-4f45-9833-acbfdb16ce56", //产业图谱 + newDetail: "/news-content/listpage", //详情 + detail: "/news-content/get/" } class DomainService { static doGetDomainCategory() { @@ -15,9 +19,24 @@ class DomainService { static doGetKeyEnterprise() { return request(apiPath.keyEnterprise, "GET") } + static doGetKeyEnterprise(data) { + return request(apiPath.keyEnterprise, "GET", data) + } static doGetDomainInfo() { return request(apiPath.domainInfo, "GET") } + static doGetIndustryArea() { + return request(apiPath.industryArea, "GET") + } + static doGetPlates() { + return request(apiPath.plates, "GET") + } + static doGetDetail(data) { + return request(apiPath.newDetail, "GET", data) + } + static doDetail(url) { + return request(apiPath.detail + url, "GET") + } } export default DomainService; \ No newline at end of file diff --git a/utils/api/indexApi.js b/utils/api/indexApi.js index c864159..ac5d300 100644 --- a/utils/api/indexApi.js +++ b/utils/api/indexApi.js @@ -10,6 +10,8 @@ const apiPath = { invest: "/query/sql/q428ea76", investAreaInfo: "/news-content/listpage?rows=1&page=1", //地区概况 //资源条件 //气候条件 //基础设施 categoryList: "/news-directories/list", //投资优势 投资环境 + superiosityDetail: "/news-content/listpage?rows=1&page=1", //投资优势详情 + investDetail: "", //投资机会详情 } class IndexService { static doGetDescVideo() { @@ -24,6 +26,9 @@ class IndexService { static doGetInvest() { return request(apiPath.invest, "GET") } + static doGetInvestDetail(data) { + return request(apiPath.invest, "GET", data) + } static doGetInvestArea(data) { return request(apiPath.investAreaInfo, "GET", data) } @@ -37,6 +42,9 @@ class IndexService { directoriesParentId: 'd3ba3ff5-6d9e-4aed-9331-73e50b5ac598' }) } + static doGetSuperiorityDetail(data) { + return request(apiPath.superiosityDetail, "GET", data) + } } export default IndexService; \ No newline at end of file diff --git a/utils/api/policyApi.js b/utils/api/policyApi.js new file mode 100644 index 0000000..f884829 --- /dev/null +++ b/utils/api/policyApi.js @@ -0,0 +1,19 @@ +import { + request +} from "../http"; + +// 管理地址 +const apiPath = { + policyList: "/news-content/listpage", //政策列表 + policyDetail: "/news-content/get/", //政策详情 +} +class PolicyService { + static doGetPolicyList(data) { + return request(apiPath.policyList, "GET", data) + } + static doGetDetail(id) { + return request(apiPath.policyDetail + id, "GET") + } +} + +export default PolicyService; \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index c925d4c..0105d2d 100644 --- a/utils/util.js +++ b/utils/util.js @@ -75,12 +75,27 @@ const randomRgbaColor = () => { // 随机生成RGBA颜色 return `rgba(${r},${g},${b},${alpha})`; // 返回rgba(r,g,b,a)格式颜色 } - +const formatRichText = (html) => { + let newContent = html.replace(/)*>/gi, function (match, capture) { + match = match.replace(/style="(^")+"/gi, '').replace(/style='(^')+'/gi, ''); + match = match.replace(/width="(^")+"/gi, '').replace(/width='(^')+'/gi, ''); + match = match.replace(/height="(^")+"/gi, '').replace(/height='(^')+'/gi, ''); + return match; + }); + newContent = newContent.replace(/style="(^")+"/gi, function (match, capture) { + match = match.replace(/width:(^;)+;/gi, 'max-width:100%;').replace(/width:(^;)+;/gi, 'max-width:100%;'); + return match; + }); + newContent = newContent.replace(/)*\/>/gi, ''); + newContent = newContent.replace(/\