页面优化
This commit is contained in:
parent
f1f041d1a1
commit
9e4b03d26d
108
app.json
108
app.json
@ -1,56 +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",
|
||||
"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"
|
||||
}
|
||||
"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",
|
||||
"container-loading": "/components/container-loading/container-loading"
|
||||
}
|
||||
}
|
27
app.wxss
27
app.wxss
@ -137,11 +137,18 @@ page::after {
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
padding: 30rpx;
|
||||
background: linear-gradient(0deg, #6AC191 0%, #256742 100%);
|
||||
border-radius: 7rpx;
|
||||
}
|
||||
|
||||
.address {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #454545;
|
||||
}
|
||||
|
||||
.full-btn:active {
|
||||
background: linear-gradient(0deg, #a6eec6 0%, #63bb89 60%);
|
||||
}
|
||||
@ -210,6 +217,14 @@ page::after {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.desc-font-24 {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #6F6F6F;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
|
||||
.expand-btn {
|
||||
float: right;
|
||||
@ -248,6 +263,14 @@ page::after {
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
padding: 42rpx;
|
||||
font-size: 28rpx;
|
||||
font-size: 24rpx;
|
||||
color: #242424;
|
||||
}
|
||||
|
||||
.item-loading {
|
||||
min-height: 100rpx;
|
||||
align-items: center;
|
||||
align-self: center;
|
||||
justify-content: center;
|
||||
margin-top: 70rpx;
|
||||
}
|
30
components/container-loading/container-loading.js
Normal file
30
components/container-loading/container-loading.js
Normal file
@ -0,0 +1,30 @@
|
||||
// components/container-loading/container-loading.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
loadingState: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
}
|
||||
},
|
||||
observers: {
|
||||
'loadingState': function (newVal) {
|
||||
this.setData({
|
||||
loadingVisible: newVal
|
||||
});
|
||||
}
|
||||
},
|
||||
data: {
|
||||
loadingVisible: true
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
4
components/container-loading/container-loading.json
Normal file
4
components/container-loading/container-loading.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
7
components/container-loading/container-loading.wxml
Normal file
7
components/container-loading/container-loading.wxml
Normal file
@ -0,0 +1,7 @@
|
||||
<view class="container">
|
||||
<view class="loading" wx:if="{{loadingVisible}}">
|
||||
</view>
|
||||
<block wx:if="{{!loadingVisible}}">
|
||||
<slot></slot>
|
||||
</block>
|
||||
</view>
|
48
components/container-loading/container-loading.wxss
Normal file
48
components/container-loading/container-loading.wxss
Normal file
@ -0,0 +1,48 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
min-height: 200rpx;
|
||||
}
|
||||
|
||||
.loading {
|
||||
position: relative;
|
||||
width: 40px;
|
||||
perspective: 500px;
|
||||
align-self: center;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.loading:before,
|
||||
.loading:after {
|
||||
position: absolute;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
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;
|
||||
}
|
||||
}
|
@ -72,12 +72,12 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="desc-title">企业介绍</view>
|
||||
<view class="desc-content mt-20">
|
||||
<view class="news-content mt-20" style="padding: 0rpx;">
|
||||
<rich-text nodes="{{bean.content}}"></rich-text>
|
||||
</view>
|
||||
<view class="desc-title">联系方式</view>
|
||||
<view class="mt-20">地址:{{bean.lianXi.name}}</view>
|
||||
<view class="mt-10">电话:{{bean.lianXi.phone}}</view>
|
||||
<view class="mt-20 address">地址:{{bean.lianXi.name}}</view>
|
||||
<view class="mt-10 address">电话:{{bean.lianXi.phone}}</view>
|
||||
<view class="full-btn mt-20" bind:tap="callPhone">
|
||||
<image class="icon" src="/imgs/ic_phone_white_icon.png"></image>
|
||||
<text class="txt">联系我们</text>
|
||||
|
@ -21,7 +21,11 @@ Page({
|
||||
domainInfo: {}, //产业基础
|
||||
isAreaExpand: false,
|
||||
industryAreaList: [], //产业园区
|
||||
platesList: [], //产业图谱
|
||||
platesList: [], //产业图谱,
|
||||
domainCategoryLoading: true, //特色产业
|
||||
platesLoading: true, //产业图谱
|
||||
keyEnterpriseLoading: true, //重点企业
|
||||
industryLoading: true, //开发园区
|
||||
},
|
||||
|
||||
/**
|
||||
@ -49,7 +53,7 @@ Page({
|
||||
_self.setData({
|
||||
showPageLoading: false
|
||||
})
|
||||
}, 2000);
|
||||
}, 500);
|
||||
},
|
||||
countWidth() {
|
||||
var _self = this
|
||||
@ -89,8 +93,14 @@ Page({
|
||||
//特色产业
|
||||
getDomainCategory() {
|
||||
var _self = this
|
||||
_self.setData({
|
||||
domainCategoryLoading: true
|
||||
})
|
||||
DomainService.doGetDomainCategory()
|
||||
.then(res => {
|
||||
_self.setData({
|
||||
domainCategoryLoading: false
|
||||
})
|
||||
if (res) {
|
||||
_self.setData({
|
||||
domainCategoryList: res
|
||||
@ -112,8 +122,14 @@ Page({
|
||||
//产业图谱
|
||||
getPlates() {
|
||||
var _self = this
|
||||
_self.setData({
|
||||
platesLoading: true
|
||||
})
|
||||
DomainService.doGetPlates()
|
||||
.then(res => {
|
||||
_self.setData({
|
||||
platesLoading: false
|
||||
})
|
||||
if (res) {
|
||||
_self.setData({
|
||||
platesList: res.rows
|
||||
@ -136,8 +152,14 @@ Page({
|
||||
//重点企业
|
||||
getKeyEnterprise() {
|
||||
var _self = this
|
||||
_self.setData({
|
||||
keyEnterpriseLoading: true
|
||||
})
|
||||
DomainService.doGetKeyEnterprise()
|
||||
.then(res => {
|
||||
_self.setData({
|
||||
keyEnterpriseLoading: false
|
||||
})
|
||||
if (res) {
|
||||
_self.setData({
|
||||
keyEnterpriseList: res
|
||||
@ -153,11 +175,19 @@ Page({
|
||||
//产业园区
|
||||
getIndustryArea() {
|
||||
var _self = this
|
||||
_self.setData({
|
||||
industryLoading: true
|
||||
})
|
||||
DomainService.doGetIndustryArea()
|
||||
.then(res => {
|
||||
_self.setData({
|
||||
industryAreaList: res.rows
|
||||
industryLoading: false
|
||||
})
|
||||
if (res && res.rows) {
|
||||
_self.setData({
|
||||
industryAreaList: res.rows
|
||||
})
|
||||
}
|
||||
}, err => {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
@ -210,7 +240,7 @@ Page({
|
||||
_self.setData({
|
||||
showPageLoading: false
|
||||
})
|
||||
}, 2000);
|
||||
}, 500);
|
||||
},
|
||||
//园区详情
|
||||
showGarden(e) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
<view class="func-container">
|
||||
<image class="desc-video" src="https://ts1.cn.mm.bing.net/th/id/R-C.9e45a633e95179a37c907fa2797999ad?rik=aMuPS4TunAh5ZA&riu=http%3a%2f%2fwww.quazero.com%2fuploads%2fallimg%2f140303%2f1-140303214Q2.jpg&ehk=P%2firfYpARc1fHht%2bWpapYR4W15p6SLABE8CBexoeon4%3d&risl=&pid=ImgRaw&r=0"></image>
|
||||
<view class="desc-title">{{domainInfo.newsContentTitle}}</view>
|
||||
<view class="line-noappoint mt-20" style="{{isAreaExpand?'-webkit-line-clamp: 0;':'-webkit-line-clamp: 4;'}}">
|
||||
<view class="line-noappoint mt-20 desc-font-24" style="{{isAreaExpand?'-webkit-line-clamp: 0;':'-webkit-line-clamp: 4;'}}">
|
||||
<rich-text nodes="{{domainInfo.newsContentContent}}"></rich-text>
|
||||
</view>
|
||||
<view class="right-more-bg" bind:tap="areaShowAll">
|
||||
@ -20,16 +20,19 @@
|
||||
<text class="name">特色产业</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="unique-items mb-20">
|
||||
<block wx:for="{{domainCategoryList}}" wx:key="index">
|
||||
<view class="unique-item" bind:tap="goUniqueDetail" data-id="{{item.newsDirectoriesId}}">
|
||||
<image src="{{imgBasePath}}{{item.directoriesPhoto}}" />
|
||||
<text>{{item.directoriesName}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<container-loading loadingState="{{domainCategoryLoading}}">
|
||||
<view class="unique-items mb-20">
|
||||
<block wx:for="{{domainCategoryList}}" wx:key="index">
|
||||
<view class="unique-item" bind:tap="goUniqueDetail" data-id="{{item.newsDirectoriesId}}">
|
||||
<image src="{{imgBasePath}}{{item.directoriesPhoto}}" />
|
||||
<text>{{item.directoriesName}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</container-loading>
|
||||
</view>
|
||||
<!-- 产业图谱 -->
|
||||
|
||||
<view class="func-container mt-20">
|
||||
<view class="item-title-box">
|
||||
<view class="func-title-box">
|
||||
@ -37,19 +40,24 @@
|
||||
<text class="name">产业图谱</text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view id="plates" scroll-x="true" bindscroll="scrollPlates">
|
||||
<view class="plates-content">
|
||||
<block wx:for="{{platesList}}" wx:key="index">
|
||||
<view class="plates-item" bind:tap="goPlates" data-id="{{item.newsContentId}}">
|
||||
<image class="icon" src="{{imgBasePath}}{{item.newsContentCoverList[0].contentCoverId}}"></image>
|
||||
<text class="txt line-1">{{item.newsContentTitle}}</text>
|
||||
<view style="width: 100%;">
|
||||
<container-loading loadingState="{{platesLoading}}">
|
||||
<scroll-view id="plates" scroll-x="true" bindscroll="scrollPlates">
|
||||
<view class="plates-content">
|
||||
<block wx:for="{{platesList}}" wx:key="index">
|
||||
<view class="plates-item" bind:tap="goPlates" data-id="{{item.newsContentId}}">
|
||||
<image class="icon" src="{{imgBasePath}}{{item.newsContentCoverList[0].contentCoverId}}"></image>
|
||||
<text class="txt line-1">{{item.newsContentTitle}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="slider-bar-box mt-20">
|
||||
<view class="slider-bar" style="width: {{sliderWidth}}px;"></view>
|
||||
</scroll-view>
|
||||
<view class="slider-bar-box mt-20">
|
||||
<view class="slider-bar" style="width: {{sliderWidth}}px;"></view>
|
||||
</view>
|
||||
</container-loading>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 重点企业 -->
|
||||
<view class="func-container mt-20">
|
||||
@ -59,16 +67,20 @@
|
||||
<text class="name">重点企业</text>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:for="{{keyEnterpriseList}}" wx:key="index">
|
||||
<view class="enterprise-item" bind:tap="showCompany" data-id="{{item.id}}">
|
||||
<image class="icon" src="{{imgBasePath}}{{item.photo}}" />
|
||||
<view class="enterprise-content">
|
||||
<text class="enterprise-name">{{item.name}}</text>
|
||||
<text class="enterprise-code">社会信用代码:{{item.number}}</text>
|
||||
</view>
|
||||
<container-loading loadingState="{{keyEnterpriseLoading}}">
|
||||
<view style="width: 100%;">
|
||||
<block wx:for="{{keyEnterpriseList}}" wx:key="index">
|
||||
<view class="enterprise-item" bind:tap="showCompany" data-id="{{item.id}}">
|
||||
<image class="icon" src="{{imgBasePath}}{{item.photo}}" />
|
||||
<view class="enterprise-content">
|
||||
<text class="enterprise-name">{{item.name}}</text>
|
||||
<text class="enterprise-code">社会信用代码:{{item.number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="divider-w"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="divider-w"></view>
|
||||
</block>
|
||||
</container-loading>
|
||||
</view>
|
||||
<!-- 开发园区 -->
|
||||
<view class="func-container mt-20">
|
||||
@ -78,14 +90,16 @@
|
||||
<text class="name">开发园区</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="area-box mt-20">
|
||||
<block wx:for="{{industryAreaList}}" wx:key="index">
|
||||
<view class="area-item" bind:tap="showGarden" data-id="{{item.newsContentId}}">
|
||||
<image src="{{imgBasePath}}{{item.newsContentCoverList[0].contentCoverId}}" mode="aspectFill"></image>
|
||||
<text>{{item.newsContentTitle}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<container-loading loadingState="{{industryLoading}}">
|
||||
<view class="area-box mt-20">
|
||||
<block wx:for="{{industryAreaList}}" wx:key="index">
|
||||
<view class="area-item" bind:tap="showGarden" data-id="{{item.newsContentId}}">
|
||||
<image src="{{imgBasePath}}{{item.newsContentCoverList[0].contentCoverId}}" mode="aspectFill"></image>
|
||||
<text>{{item.newsContentTitle}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</container-loading>
|
||||
</view>
|
||||
</view>
|
||||
<page-loading wx:if="{{showPageLoading}}"></page-loading>
|
@ -42,6 +42,9 @@ Page({
|
||||
imgBasePath: app.globalData.imgPath,
|
||||
superiorityList: [], //投资优势,
|
||||
investAreaList: [], //投资环境List
|
||||
investLoading: true,
|
||||
isLoading: true,
|
||||
showInvestLoading: true
|
||||
},
|
||||
onLoad(e) {
|
||||
var _self = this
|
||||
@ -61,16 +64,6 @@ 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(() => {
|
||||
_self.setData({
|
||||
showPageLoading: false
|
||||
@ -89,6 +82,15 @@ Page({
|
||||
//投资环境
|
||||
this.getSuperiority()
|
||||
},
|
||||
onReady() {
|
||||
this.videoContext = wx.createVideoContext('descVideo', this); // 创建videoContext实例
|
||||
console.log(this.videoContext)
|
||||
},
|
||||
onShow() {
|
||||
if (this.videoContext) {
|
||||
this.videoContext.pause()
|
||||
}
|
||||
},
|
||||
//视频介绍
|
||||
getDescVideo() {
|
||||
var _self = this
|
||||
@ -154,8 +156,14 @@ Page({
|
||||
//投资机会
|
||||
getInvest() {
|
||||
var _self = this
|
||||
_self.setData({
|
||||
showInvestLoading: true
|
||||
})
|
||||
IndexService.doGetInvest()
|
||||
.then(res => {
|
||||
_self.setData({
|
||||
showInvestLoading: false
|
||||
})
|
||||
if (res) {
|
||||
_self.setData({
|
||||
investList: res
|
||||
@ -177,10 +185,16 @@ Page({
|
||||
//投资环境详情
|
||||
getInvestArea(id) {
|
||||
var _self = this
|
||||
_self.setData({
|
||||
investLoading: true
|
||||
})
|
||||
IndexService.doGetInvestArea({
|
||||
newsDirectoriesId: id
|
||||
})
|
||||
.then(res => {
|
||||
_self.setData({
|
||||
investLoading: false
|
||||
})
|
||||
if (res) {
|
||||
_self.setData({
|
||||
investAreaBean: res.rows[0]
|
||||
|
@ -2,12 +2,12 @@
|
||||
<view class="body">
|
||||
<!-- 视频简介 -->
|
||||
<view class="func-container">
|
||||
<video class="desc-video" object-fit="fill" custom-cache="{{false}}" src="{{descVideoUrl}}" poster="{{descVideoCover}}" />
|
||||
<video id="descVideo" class="desc-video" object-fit="fill" autoplay="{{false}}" src="{{descVideoUrl}}" poster="{{descVideoCover}}" />
|
||||
<view class="desc-title mb-10">达拉特旗</view>
|
||||
<view class="text-expansion mt-20">
|
||||
<view class="text-expansion__text {{ isExpand ? 'text-expansion__text--expand' : '' }}">
|
||||
<view class="text-expansion__button" bindtap="expandClick">{{ isExpand ? collapseText : expandText }}</view>
|
||||
<rich-text nodes="{{descContent}}"></rich-text>
|
||||
<rich-text class="desc-font-24" nodes="{{descContent}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc-tag-box">
|
||||
@ -65,15 +65,19 @@
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="invest-content">
|
||||
<view class="line-noappoint mt-20" style="{{isAreaExpand?'-webkit-line-clamp: 0;':'-webkit-line-clamp: 4;'}}">
|
||||
<rich-text nodes="{{investAreaBean.newsContentContent}}"></rich-text>
|
||||
<container-loading loadingState="{{investLoading}}">
|
||||
<view class="invest-box">
|
||||
<view class="invest-content">
|
||||
<view class="line-noappoint mt-20 desc-font-24" style="{{isAreaExpand?'-webkit-line-clamp: 0;':'-webkit-line-clamp: 4;'}}">
|
||||
<rich-text nodes="{{investAreaBean.newsContentContent}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-more-bg" bind:tap="areaShowAll">
|
||||
<view class="txt">{{isAreaExpand?'收取':'查看全部'}}</view>
|
||||
<image class="icon" src="/imgs/ic_arrow_right_black.png" mode="aspectFill" style="transform: rotate({{isAreaExpand?-90:0}}deg);"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-more-bg" bind:tap="areaShowAll">
|
||||
<view class="txt">{{isAreaExpand?'收取':'查看全部'}}</view>
|
||||
<image class="icon" src="/imgs/ic_arrow_right_black.png" mode="aspectFill" style="transform: rotate({{isAreaExpand?-90:0}}deg);"></image>
|
||||
</view>
|
||||
</container-loading>
|
||||
</view>
|
||||
<!-- 投资优势 -->
|
||||
<view class="func-container mt-20">
|
||||
@ -107,38 +111,42 @@
|
||||
<image class="icon" src="/imgs/ic_arrow_right_black.png"></image>
|
||||
</view> -->
|
||||
</view>
|
||||
<block wx:for="{{investList}}" wx:key="index">
|
||||
<view class="chance-item-box" data-id="{{item.id}}" bind:tap="goInvestDetail">
|
||||
<view class="chance-item-title">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="more">查看详情 ></view>
|
||||
</view>
|
||||
<view class="chance-item-content line-3">
|
||||
<rich-text nodes="{{item.content}}"></rich-text>
|
||||
</view>
|
||||
<view class="chance-item-attrs">
|
||||
<view class="chance-attr">
|
||||
<text class="title">预计总投资</text>
|
||||
<text class="content">{{item.money}}{{item.moneyUnit}}</text>
|
||||
<container-loading loadingState="{{showInvestLoading}}">
|
||||
<view style="width: 100%;">
|
||||
<block wx:for="{{investList}}" wx:key="index">
|
||||
<view class="chance-item-box" data-id="{{item.id}}" bind:tap="goInvestDetail">
|
||||
<view class="chance-item-title">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="more">查看详情 ></view>
|
||||
</view>
|
||||
<view class="chance-item-content line-3">
|
||||
<rich-text nodes="{{item.content}}"></rich-text>
|
||||
</view>
|
||||
<view class="chance-item-attrs">
|
||||
<view class="chance-attr">
|
||||
<text class="title">预计总投资</text>
|
||||
<text class="content">{{item.money}}{{item.moneyUnit}}</text>
|
||||
</view>
|
||||
<view class="divide-line"></view>
|
||||
<view class="chance-attr">
|
||||
<text class="title">所属产业</text>
|
||||
<text class="content">{{item.type}}</text>
|
||||
</view>
|
||||
<view class="divide-line"></view>
|
||||
<view class="chance-attr">
|
||||
<text class="title">占地面积</text>
|
||||
<text class="content">{{item.area}}{{item.areaUnit}}</text>
|
||||
</view>
|
||||
<view class="divide-line"></view>
|
||||
<view class="chance-attr">
|
||||
<text class="title">用地类型</text>
|
||||
<text class="content">{{item.landType}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="divide-line"></view>
|
||||
<view class="chance-attr">
|
||||
<text class="title">所属产业</text>
|
||||
<text class="content">{{item.type}}</text>
|
||||
</view>
|
||||
<view class="divide-line"></view>
|
||||
<view class="chance-attr">
|
||||
<text class="title">占地面积</text>
|
||||
<text class="content">{{item.area}}{{item.areaUnit}}</text>
|
||||
</view>
|
||||
<view class="divide-line"></view>
|
||||
<view class="chance-attr">
|
||||
<text class="title">用地类型</text>
|
||||
<text class="content">{{item.landType}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</container-loading>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
line-height: 1.5;
|
||||
font-size: 24rpx;
|
||||
font-size: 20rpx;
|
||||
color: #6F6F6F;
|
||||
text-align: justify;
|
||||
max-height: calc(3em * 1.5);
|
||||
@ -192,6 +192,13 @@
|
||||
line-height: 40rpx;
|
||||
text-indent: 2em;
|
||||
}
|
||||
.invest-box{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: content;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.slider-bar-box {
|
||||
width: 40px;
|
||||
|
@ -1,8 +1,7 @@
|
||||
<view class="body">
|
||||
<view class="news-title">{{bean.title}}</view>
|
||||
<view class="news-attr-box">
|
||||
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view>
|
||||
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
|
||||
<view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
|
||||
</view>
|
||||
|
||||
<view class="news-content">
|
||||
|
@ -1,8 +1,7 @@
|
||||
<view class="body">
|
||||
<view class="news-title">{{bean.title}}</view>
|
||||
<view class="news-attr-box">
|
||||
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view>
|
||||
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
|
||||
<view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
|
||||
</view>
|
||||
<view class="news-content">
|
||||
<rich-text nodes="{{bean.newsContentContent}}"></rich-text>
|
||||
|
@ -1,8 +1,7 @@
|
||||
<view class="body">
|
||||
<view class="news-title">{{bean.title}}</view>
|
||||
<view class="news-attr-box">
|
||||
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view>
|
||||
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
|
||||
<view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
|
||||
</view>
|
||||
<view class="news-content">
|
||||
<rich-text nodes="{{bean.newsContentContent}}"></rich-text>
|
||||
|
@ -1,8 +1,7 @@
|
||||
<view class="body">
|
||||
<view class="news-title">{{bean.title}}</view>
|
||||
<view class="news-attr-box">
|
||||
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view>
|
||||
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
|
||||
<view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
|
||||
</view>
|
||||
<view class="news-content">
|
||||
<rich-text nodes="{{bean.newsContentContent}}"></rich-text>
|
||||
|
@ -1,8 +1,7 @@
|
||||
<view class="body">
|
||||
<view class="news-title">{{bean.title}}</view>
|
||||
<view class="news-attr-box">
|
||||
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view>
|
||||
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
|
||||
<view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
|
||||
</view>
|
||||
<view class="news-content">
|
||||
<image wx:if="{{bean.newsContentCoverList.length>0}}" src="{{imgBasePath}}{{bean.newsContentCoverList[0].contentCoverId}}" style="align-self: center;width: 100%;"></image>
|
||||
|
@ -90,6 +90,22 @@ const formatRichText = (html) => {
|
||||
newContent = newContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"');
|
||||
return newContent;
|
||||
}
|
||||
/**
|
||||
* 去除富文本字符串中img的style
|
||||
* richText 富文本字符串
|
||||
*/
|
||||
const removeImgStyleFromRichText = (richText) => {
|
||||
// 匹配 <img> 标签
|
||||
let imgTags = richText.match(/<img[^>]*>/g);
|
||||
if (imgTags) {
|
||||
imgTags.forEach((imgTag) => {
|
||||
// 去除 style 属性
|
||||
let newImgTag = imgTag.replace(/ style="[^"]*"/g, '');
|
||||
richText = richText.replace(imgTag, newImgTag);
|
||||
});
|
||||
}
|
||||
return richText;
|
||||
}
|
||||
module.exports = {
|
||||
formatTime: formatTime,
|
||||
formatDate: formatDate,
|
||||
@ -97,5 +113,6 @@ module.exports = {
|
||||
randomRgba: randomRgbaColor,
|
||||
randomDark: randomDarkColor,
|
||||
randomLight: randomLightColor,
|
||||
formatHtml: formatRichText
|
||||
formatHtml: formatRichText,
|
||||
removeImgStyle: removeImgStyleFromRichText
|
||||
}
|
Loading…
Reference in New Issue
Block a user