页面优化

This commit is contained in:
itgaojian163 2025-01-21 12:33:11 +08:00
parent f1f041d1a1
commit 9e4b03d26d
18 changed files with 359 additions and 162 deletions

108
app.json
View File

@ -1,56 +1,56 @@
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/domain/domain", "pages/domain/domain",
"pages/policy/policy", "pages/policy/policy",
"pages/invest/invest", "pages/invest/invest",
"pages/company/company", "pages/company/company",
"pages/garden/garden", "pages/garden/garden",
"pages/superiority-detail/superiority-detail", "pages/superiority-detail/superiority-detail",
"pages/invest-detail/invest-detail", "pages/invest-detail/invest-detail",
"pages/unique-detail/unique-detail", "pages/unique-detail/unique-detail",
"pages/plates/plates", "pages/plates/plates",
"pages/policy-detail/policy-detail", "pages/policy-detail/policy-detail",
"pages/industry-area/industry-area" "pages/industry-area/industry-area"
], ],
"window": { "window": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "达拉特招商", "navigationBarTitleText": "达拉特招商",
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
}, },
"tabBar": { "tabBar": {
"color": "#797979", "color": "#797979",
"selectedColor": "#28804F", "selectedColor": "#28804F",
"borderStyle": "white", "borderStyle": "white",
"list": [ "list": [{
{ "pagePath": "pages/index/index",
"pagePath": "pages/index/index", "selectedIconPath": "/imgs/ic_bottom_index_sel.png",
"selectedIconPath": "/imgs/ic_bottom_index_sel.png", "iconPath": "/imgs/ic_bottom_index_normal.png",
"iconPath": "/imgs/ic_bottom_index_normal.png", "text": "首页"
"text": "首页" },
}, {
{ "pagePath": "pages/domain/domain",
"pagePath": "pages/domain/domain", "selectedIconPath": "/imgs/ic_bottom_domain_sel.png",
"selectedIconPath": "/imgs/ic_bottom_domain_sel.png", "iconPath": "/imgs/ic_bottom_domain_normal.png",
"iconPath": "/imgs/ic_bottom_domain_normal.png", "text": "产业"
"text": "产业" },
}, {
{ "pagePath": "pages/policy/policy",
"pagePath": "pages/policy/policy", "selectedIconPath": "/imgs/ic_bottom_policy_sel.png",
"selectedIconPath": "/imgs/ic_bottom_policy_sel.png", "iconPath": "/imgs/ic_bottom_policy_normal.png",
"iconPath": "/imgs/ic_bottom_policy_normal.png", "text": "政策"
"text": "政策" }
} ]
] },
}, "style": "v2",
"style": "v2", "componentFramework": "glass-easel",
"componentFramework": "glass-easel", "sitemapLocation": "sitemap.json",
"sitemapLocation": "sitemap.json", "lazyCodeLoading": "requiredComponents",
"lazyCodeLoading": "requiredComponents", "useExtendedLib": {
"useExtendedLib": { "weui": true
"weui": true },
}, "usingComponents": {
"usingComponents": { "page-loading": "/components/page-loading/page-loading",
"page-loading": "/components/page-loading/page-loading" "container-loading": "/components/container-loading/container-loading"
} }
} }

View File

@ -137,11 +137,18 @@ page::after {
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 20rpx; padding: 30rpx;
background: linear-gradient(0deg, #6AC191 0%, #256742 100%); background: linear-gradient(0deg, #6AC191 0%, #256742 100%);
border-radius: 7rpx; border-radius: 7rpx;
} }
.address {
font-family: Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #454545;
}
.full-btn:active { .full-btn:active {
background: linear-gradient(0deg, #a6eec6 0%, #63bb89 60%); background: linear-gradient(0deg, #a6eec6 0%, #63bb89 60%);
} }
@ -210,6 +217,14 @@ page::after {
width: 100%; width: 100%;
} }
.desc-font-24 {
font-size: 24rpx;
font-weight: 400;
font-size: 20rpx;
color: #6F6F6F;
line-height: 32rpx;
}
.expand-btn { .expand-btn {
float: right; float: right;
@ -248,6 +263,14 @@ page::after {
justify-content: center; justify-content: center;
align-items: flex-start; align-items: flex-start;
padding: 42rpx; padding: 42rpx;
font-size: 28rpx; font-size: 24rpx;
color: #242424; color: #242424;
} }
.item-loading {
min-height: 100rpx;
align-items: center;
align-self: center;
justify-content: center;
margin-top: 70rpx;
}

View 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: {
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,7 @@
<view class="container">
<view class="loading" wx:if="{{loadingVisible}}">
</view>
<block wx:if="{{!loadingVisible}}">
<slot></slot>
</block>
</view>

View 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;
}
}

View File

@ -72,12 +72,12 @@
</view> </view>
</scroll-view> </scroll-view>
<view class="desc-title">企业介绍</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> <rich-text nodes="{{bean.content}}"></rich-text>
</view> </view>
<view class="desc-title">联系方式</view> <view class="desc-title">联系方式</view>
<view class="mt-20">地址:{{bean.lianXi.name}}</view> <view class="mt-20 address">地址:{{bean.lianXi.name}}</view>
<view class="mt-10">电话:{{bean.lianXi.phone}}</view> <view class="mt-10 address">电话:{{bean.lianXi.phone}}</view>
<view class="full-btn mt-20" bind:tap="callPhone"> <view class="full-btn mt-20" bind:tap="callPhone">
<image class="icon" src="/imgs/ic_phone_white_icon.png"></image> <image class="icon" src="/imgs/ic_phone_white_icon.png"></image>
<text class="txt">联系我们</text> <text class="txt">联系我们</text>

View File

@ -21,7 +21,11 @@ Page({
domainInfo: {}, //产业基础 domainInfo: {}, //产业基础
isAreaExpand: false, isAreaExpand: false,
industryAreaList: [], //产业园区 industryAreaList: [], //产业园区
platesList: [], //产业图谱 platesList: [], //产业图谱,
domainCategoryLoading: true, //特色产业
platesLoading: true, //产业图谱
keyEnterpriseLoading: true, //重点企业
industryLoading: true, //开发园区
}, },
/** /**
@ -49,7 +53,7 @@ Page({
_self.setData({ _self.setData({
showPageLoading: false showPageLoading: false
}) })
}, 2000); }, 500);
}, },
countWidth() { countWidth() {
var _self = this var _self = this
@ -89,8 +93,14 @@ Page({
//特色产业 //特色产业
getDomainCategory() { getDomainCategory() {
var _self = this var _self = this
_self.setData({
domainCategoryLoading: true
})
DomainService.doGetDomainCategory() DomainService.doGetDomainCategory()
.then(res => { .then(res => {
_self.setData({
domainCategoryLoading: false
})
if (res) { if (res) {
_self.setData({ _self.setData({
domainCategoryList: res domainCategoryList: res
@ -112,8 +122,14 @@ Page({
//产业图谱 //产业图谱
getPlates() { getPlates() {
var _self = this var _self = this
_self.setData({
platesLoading: true
})
DomainService.doGetPlates() DomainService.doGetPlates()
.then(res => { .then(res => {
_self.setData({
platesLoading: false
})
if (res) { if (res) {
_self.setData({ _self.setData({
platesList: res.rows platesList: res.rows
@ -136,8 +152,14 @@ Page({
//重点企业 //重点企业
getKeyEnterprise() { getKeyEnterprise() {
var _self = this var _self = this
_self.setData({
keyEnterpriseLoading: true
})
DomainService.doGetKeyEnterprise() DomainService.doGetKeyEnterprise()
.then(res => { .then(res => {
_self.setData({
keyEnterpriseLoading: false
})
if (res) { if (res) {
_self.setData({ _self.setData({
keyEnterpriseList: res keyEnterpriseList: res
@ -153,11 +175,19 @@ Page({
//产业园区 //产业园区
getIndustryArea() { getIndustryArea() {
var _self = this var _self = this
_self.setData({
industryLoading: true
})
DomainService.doGetIndustryArea() DomainService.doGetIndustryArea()
.then(res => { .then(res => {
_self.setData({ _self.setData({
industryAreaList: res.rows industryLoading: false
}) })
if (res && res.rows) {
_self.setData({
industryAreaList: res.rows
})
}
}, err => { }, err => {
wx.showToast({ wx.showToast({
icon: "none", icon: "none",
@ -210,7 +240,7 @@ Page({
_self.setData({ _self.setData({
showPageLoading: false showPageLoading: false
}) })
}, 2000); }, 500);
}, },
//园区详情 //园区详情
showGarden(e) { showGarden(e) {

View File

@ -4,7 +4,7 @@
<view class="func-container"> <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> <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="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> <rich-text nodes="{{domainInfo.newsContentContent}}"></rich-text>
</view> </view>
<view class="right-more-bg" bind:tap="areaShowAll"> <view class="right-more-bg" bind:tap="areaShowAll">
@ -20,16 +20,19 @@
<text class="name">特色产业</text> <text class="name">特色产业</text>
</view> </view>
</view> </view>
<view class="unique-items mb-20"> <container-loading loadingState="{{domainCategoryLoading}}">
<block wx:for="{{domainCategoryList}}" wx:key="index"> <view class="unique-items mb-20">
<view class="unique-item" bind:tap="goUniqueDetail" data-id="{{item.newsDirectoriesId}}"> <block wx:for="{{domainCategoryList}}" wx:key="index">
<image src="{{imgBasePath}}{{item.directoriesPhoto}}" /> <view class="unique-item" bind:tap="goUniqueDetail" data-id="{{item.newsDirectoriesId}}">
<text>{{item.directoriesName}}</text> <image src="{{imgBasePath}}{{item.directoriesPhoto}}" />
</view> <text>{{item.directoriesName}}</text>
</block> </view>
</view> </block>
</view>
</container-loading>
</view> </view>
<!-- 产业图谱 --> <!-- 产业图谱 -->
<view class="func-container mt-20"> <view class="func-container mt-20">
<view class="item-title-box"> <view class="item-title-box">
<view class="func-title-box"> <view class="func-title-box">
@ -37,19 +40,24 @@
<text class="name">产业图谱</text> <text class="name">产业图谱</text>
</view> </view>
</view> </view>
<scroll-view id="plates" scroll-x="true" bindscroll="scrollPlates"> <view style="width: 100%;">
<view class="plates-content"> <container-loading loadingState="{{platesLoading}}">
<block wx:for="{{platesList}}" wx:key="index"> <scroll-view id="plates" scroll-x="true" bindscroll="scrollPlates">
<view class="plates-item" bind:tap="goPlates" data-id="{{item.newsContentId}}"> <view class="plates-content">
<image class="icon" src="{{imgBasePath}}{{item.newsContentCoverList[0].contentCoverId}}"></image> <block wx:for="{{platesList}}" wx:key="index">
<text class="txt line-1">{{item.newsContentTitle}}</text> <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> </view>
</block> </scroll-view>
</view> <view class="slider-bar-box mt-20">
</scroll-view> <view class="slider-bar" style="width: {{sliderWidth}}px;"></view>
<view class="slider-bar-box mt-20"> </view>
<view class="slider-bar" style="width: {{sliderWidth}}px;"></view> </container-loading>
</view> </view>
</view> </view>
<!-- 重点企业 --> <!-- 重点企业 -->
<view class="func-container mt-20"> <view class="func-container mt-20">
@ -59,16 +67,20 @@
<text class="name">重点企业</text> <text class="name">重点企业</text>
</view> </view>
</view> </view>
<block wx:for="{{keyEnterpriseList}}" wx:key="index"> <container-loading loadingState="{{keyEnterpriseLoading}}">
<view class="enterprise-item" bind:tap="showCompany" data-id="{{item.id}}"> <view style="width: 100%;">
<image class="icon" src="{{imgBasePath}}{{item.photo}}" /> <block wx:for="{{keyEnterpriseList}}" wx:key="index">
<view class="enterprise-content"> <view class="enterprise-item" bind:tap="showCompany" data-id="{{item.id}}">
<text class="enterprise-name">{{item.name}}</text> <image class="icon" src="{{imgBasePath}}{{item.photo}}" />
<text class="enterprise-code">社会信用代码:{{item.number}}</text> <view class="enterprise-content">
</view> <text class="enterprise-name">{{item.name}}</text>
<text class="enterprise-code">社会信用代码:{{item.number}}</text>
</view>
</view>
<view class="divider-w"></view>
</block>
</view> </view>
<view class="divider-w"></view> </container-loading>
</block>
</view> </view>
<!-- 开发园区 --> <!-- 开发园区 -->
<view class="func-container mt-20"> <view class="func-container mt-20">
@ -78,14 +90,16 @@
<text class="name">开发园区</text> <text class="name">开发园区</text>
</view> </view>
</view> </view>
<view class="area-box mt-20"> <container-loading loadingState="{{industryLoading}}">
<block wx:for="{{industryAreaList}}" wx:key="index"> <view class="area-box mt-20">
<view class="area-item" bind:tap="showGarden" data-id="{{item.newsContentId}}"> <block wx:for="{{industryAreaList}}" wx:key="index">
<image src="{{imgBasePath}}{{item.newsContentCoverList[0].contentCoverId}}" mode="aspectFill"></image> <view class="area-item" bind:tap="showGarden" data-id="{{item.newsContentId}}">
<text>{{item.newsContentTitle}}</text> <image src="{{imgBasePath}}{{item.newsContentCoverList[0].contentCoverId}}" mode="aspectFill"></image>
</view> <text>{{item.newsContentTitle}}</text>
</block> </view>
</view> </block>
</view>
</container-loading>
</view> </view>
</view> </view>
<page-loading wx:if="{{showPageLoading}}"></page-loading> <page-loading wx:if="{{showPageLoading}}"></page-loading>

View File

@ -42,6 +42,9 @@ Page({
imgBasePath: app.globalData.imgPath, imgBasePath: app.globalData.imgPath,
superiorityList: [], //投资优势, superiorityList: [], //投资优势,
investAreaList: [], //投资环境List investAreaList: [], //投资环境List
investLoading: true,
isLoading: true,
showInvestLoading: true
}, },
onLoad(e) { onLoad(e) {
var _self = this var _self = this
@ -61,16 +64,6 @@ Page({
this.setData({ this.setData({
screenWidth: screenWidth - 34 screenWidth: screenWidth - 34
}) })
// setTimeout(() => {
// var temp = []
// for (let i = 0; i < 10; i++) {
// temp.push(i)
// }
// _self.setData({
// testList: temp
// })
// _self.countWidth()
// }, 2000);
setTimeout(() => { setTimeout(() => {
_self.setData({ _self.setData({
showPageLoading: false showPageLoading: false
@ -89,6 +82,15 @@ Page({
//投资环境 //投资环境
this.getSuperiority() this.getSuperiority()
}, },
onReady() {
this.videoContext = wx.createVideoContext('descVideo', this); // 创建videoContext实例
console.log(this.videoContext)
},
onShow() {
if (this.videoContext) {
this.videoContext.pause()
}
},
//视频介绍 //视频介绍
getDescVideo() { getDescVideo() {
var _self = this var _self = this
@ -154,8 +156,14 @@ Page({
//投资机会 //投资机会
getInvest() { getInvest() {
var _self = this var _self = this
_self.setData({
showInvestLoading: true
})
IndexService.doGetInvest() IndexService.doGetInvest()
.then(res => { .then(res => {
_self.setData({
showInvestLoading: false
})
if (res) { if (res) {
_self.setData({ _self.setData({
investList: res investList: res
@ -177,10 +185,16 @@ Page({
//投资环境详情 //投资环境详情
getInvestArea(id) { getInvestArea(id) {
var _self = this var _self = this
_self.setData({
investLoading: true
})
IndexService.doGetInvestArea({ IndexService.doGetInvestArea({
newsDirectoriesId: id newsDirectoriesId: id
}) })
.then(res => { .then(res => {
_self.setData({
investLoading: false
})
if (res) { if (res) {
_self.setData({ _self.setData({
investAreaBean: res.rows[0] investAreaBean: res.rows[0]

View File

@ -2,12 +2,12 @@
<view class="body"> <view class="body">
<!-- 视频简介 --> <!-- 视频简介 -->
<view class="func-container"> <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="desc-title mb-10">达拉特旗</view>
<view class="text-expansion mt-20"> <view class="text-expansion mt-20">
<view class="text-expansion__text {{ isExpand ? 'text-expansion__text--expand' : '' }}"> <view class="text-expansion__text {{ isExpand ? 'text-expansion__text--expand' : '' }}">
<view class="text-expansion__button" bindtap="expandClick">{{ isExpand ? collapseText : expandText }}</view> <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> </view>
<view class="desc-tag-box"> <view class="desc-tag-box">
@ -65,15 +65,19 @@
</block> </block>
</view> </view>
</scroll-view> </scroll-view>
<view class="invest-content"> <container-loading loadingState="{{investLoading}}">
<view class="line-noappoint mt-20" style="{{isAreaExpand?'-webkit-line-clamp: 0;':'-webkit-line-clamp: 4;'}}"> <view class="invest-box">
<rich-text nodes="{{investAreaBean.newsContentContent}}"></rich-text> <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> </container-loading>
<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="func-container mt-20"> <view class="func-container mt-20">
@ -107,38 +111,42 @@
<image class="icon" src="/imgs/ic_arrow_right_black.png"></image> <image class="icon" src="/imgs/ic_arrow_right_black.png"></image>
</view> --> </view> -->
</view> </view>
<block wx:for="{{investList}}" wx:key="index"> <container-loading loadingState="{{showInvestLoading}}">
<view class="chance-item-box" data-id="{{item.id}}" bind:tap="goInvestDetail"> <view style="width: 100%;">
<view class="chance-item-title"> <block wx:for="{{investList}}" wx:key="index">
<view class="title">{{item.title}}</view> <view class="chance-item-box" data-id="{{item.id}}" bind:tap="goInvestDetail">
<view class="more">查看详情 ></view> <view class="chance-item-title">
</view> <view class="title">{{item.title}}</view>
<view class="chance-item-content line-3"> <view class="more">查看详情 ></view>
<rich-text nodes="{{item.content}}"></rich-text> </view>
</view> <view class="chance-item-content line-3">
<view class="chance-item-attrs"> <rich-text nodes="{{item.content}}"></rich-text>
<view class="chance-attr"> </view>
<text class="title">预计总投资</text> <view class="chance-item-attrs">
<text class="content">{{item.money}}{{item.moneyUnit}}</text> <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>
<view class="divide-line"></view> </block>
<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>
</block> </container-loading>
</view> </view>
</view> </view>

View File

@ -8,7 +8,7 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
line-height: 1.5; line-height: 1.5;
font-size: 24rpx; font-size: 20rpx;
color: #6F6F6F; color: #6F6F6F;
text-align: justify; text-align: justify;
max-height: calc(3em * 1.5); max-height: calc(3em * 1.5);
@ -192,6 +192,13 @@
line-height: 40rpx; line-height: 40rpx;
text-indent: 2em; text-indent: 2em;
} }
.invest-box{
display: flex;
flex-direction: column;
flex: content;
justify-content: center;
align-items: flex-start;
}
.slider-bar-box { .slider-bar-box {
width: 40px; width: 40px;

View File

@ -1,8 +1,7 @@
<view class="body"> <view class="body">
<view class="news-title">{{bean.title}}</view> <view class="news-title">{{bean.title}}</view>
<view class="news-attr-box"> <view class="news-attr-box">
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view> <view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
</view> </view>
<view class="news-content"> <view class="news-content">

View File

@ -1,8 +1,7 @@
<view class="body"> <view class="body">
<view class="news-title">{{bean.title}}</view> <view class="news-title">{{bean.title}}</view>
<view class="news-attr-box"> <view class="news-attr-box">
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view> <view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
</view> </view>
<view class="news-content"> <view class="news-content">
<rich-text nodes="{{bean.newsContentContent}}"></rich-text> <rich-text nodes="{{bean.newsContentContent}}"></rich-text>

View File

@ -1,8 +1,7 @@
<view class="body"> <view class="body">
<view class="news-title">{{bean.title}}</view> <view class="news-title">{{bean.title}}</view>
<view class="news-attr-box"> <view class="news-attr-box">
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view> <view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
</view> </view>
<view class="news-content"> <view class="news-content">
<rich-text nodes="{{bean.newsContentContent}}"></rich-text> <rich-text nodes="{{bean.newsContentContent}}"></rich-text>

View File

@ -1,8 +1,7 @@
<view class="body"> <view class="body">
<view class="news-title">{{bean.title}}</view> <view class="news-title">{{bean.title}}</view>
<view class="news-attr-box"> <view class="news-attr-box">
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view> <view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
</view> </view>
<view class="news-content"> <view class="news-content">
<rich-text nodes="{{bean.newsContentContent}}"></rich-text> <rich-text nodes="{{bean.newsContentContent}}"></rich-text>

View File

@ -1,8 +1,7 @@
<view class="body"> <view class="body">
<view class="news-title">{{bean.title}}</view> <view class="news-title">{{bean.title}}</view>
<view class="news-attr-box"> <view class="news-attr-box">
<view class="news-attr">发布:{{bean.newsContentAuthor}}</view> <view class="news-attr">{{bean.newsContentPublishTime}} {{bean.newsContentAuthor}}</view>
<view class="news-attr">发布时间:{{bean.newsContentPublishTime}}</view>
</view> </view>
<view class="news-content"> <view class="news-content">
<image wx:if="{{bean.newsContentCoverList.length>0}}" src="{{imgBasePath}}{{bean.newsContentCoverList[0].contentCoverId}}" style="align-self: center;width: 100%;"></image> <image wx:if="{{bean.newsContentCoverList.length>0}}" src="{{imgBasePath}}{{bean.newsContentCoverList[0].contentCoverId}}" style="align-self: center;width: 100%;"></image>

View File

@ -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;"'); newContent = newContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"');
return newContent; 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 = { module.exports = {
formatTime: formatTime, formatTime: formatTime,
formatDate: formatDate, formatDate: formatDate,
@ -97,5 +113,6 @@ module.exports = {
randomRgba: randomRgbaColor, randomRgba: randomRgbaColor,
randomDark: randomDarkColor, randomDark: randomDarkColor,
randomLight: randomLightColor, randomLight: randomLightColor,
formatHtml: formatRichText formatHtml: formatRichText,
removeImgStyle: removeImgStyleFromRichText
} }