|
@@ -11,22 +11,24 @@
|
|
<span>321</span>
|
|
<span>321</span>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="article-con" v-html="detail.content">
|
|
|
|
|
|
+ <view class="article-con" v-html="detail.content" :style="{fontSize:myFontSize+'px'}">
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
+ <u-image class="newsList-img" :src="detail.images" mode="widthFix" border-radius="10"></u-image>
|
|
|
|
+
|
|
<view class="article-foot">
|
|
<view class="article-foot">
|
|
<view class="u-flex">
|
|
<view class="u-flex">
|
|
- <view class="article-btn">
|
|
|
|
|
|
+ <view class="article-btn" @click="fontSizeUp1()">
|
|
<u-icon custom-prefix="custom-icon" name="zoom-in-line"></u-icon>
|
|
<u-icon custom-prefix="custom-icon" name="zoom-in-line"></u-icon>
|
|
<span>放大</span>
|
|
<span>放大</span>
|
|
</view>
|
|
</view>
|
|
- <view class="article-btn">
|
|
|
|
|
|
+ <view class="article-btn" @click="fontSizeDown2()">
|
|
<u-icon custom-prefix="custom-icon" name="zoom-out-line"></u-icon>
|
|
<u-icon custom-prefix="custom-icon" name="zoom-out-line"></u-icon>
|
|
<span>缩小</span>
|
|
<span>缩小</span>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="article-btn">
|
|
|
|
|
|
+ <view class="article-btn" @click="scrollTop()">
|
|
<u-icon custom-prefix="custom-icon" name="align-top"></u-icon>
|
|
<u-icon custom-prefix="custom-icon" name="align-top"></u-icon>
|
|
<span>回顶</span>
|
|
<span>回顶</span>
|
|
</view>
|
|
</view>
|
|
@@ -41,7 +43,7 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
|
|
+ myFontSize:14,
|
|
pageTitle: '文章详情',
|
|
pageTitle: '文章详情',
|
|
isLoading: false,
|
|
isLoading: false,
|
|
id: '',
|
|
id: '',
|
|
@@ -53,8 +55,42 @@
|
|
|
|
|
|
this.id =op.id;
|
|
this.id =op.id;
|
|
this.getDetail();
|
|
this.getDetail();
|
|
|
|
+ var myFontSize=this.carhelp.get("news-info-fontsize")
|
|
|
|
+ if(myFontSize){
|
|
|
|
+ this.myFontSize=myFontSize
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ fontSizeUp1(){
|
|
|
|
+ if(this.myFontSize>=28){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "当前已为最大字体"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.myFontSize=this.myFontSize+2
|
|
|
|
+ this.carhelp.set("news-info-fontsize",this.myFontSize)
|
|
|
|
+ },
|
|
|
|
+ fontSizeDown2(){
|
|
|
|
+ if(this.myFontSize<=12){
|
|
|
|
+ uni.showToast({
|
|
|
|
+
|
|
|
|
+ title: "当前已为最小字体"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.myFontSize=this.myFontSize-2
|
|
|
|
+ this.carhelp.set("news-info-fontsize",this.myFontSize)
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ scrollTop(){
|
|
|
|
+ uni.pageScrollTo({
|
|
|
|
+ scrollTop: 0,
|
|
|
|
+ duration: 300
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
getDetail() {
|
|
getDetail() {
|
|
API.newsdetail({id:this.id}).then(response => {
|
|
API.newsdetail({id:this.id}).then(response => {
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|