调整排行榜,增加banner图链接,增加公告信息分享功能
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
</view>
|
||||
<!-- 分享 -->
|
||||
<uni-popup ref="popupShare" type="share" background-color="#fff">
|
||||
<uni-popup-share title="分享到" @select="select"></uni-popup-share>
|
||||
<uni-popup-share title="分享到" @select="select" :isDowImg="true"></uni-popup-share>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
<view class="text">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</view>
|
||||
<!-- 分享 -->
|
||||
<uni-popup ref="popupShare" type="share" background-color="#fff">
|
||||
<uni-popup-share title="分享到" @select="select"></uni-popup-share>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -16,12 +20,16 @@
|
||||
title : '',
|
||||
content : '',
|
||||
time : '',
|
||||
categorie : ''
|
||||
categorie : '',
|
||||
id : '',
|
||||
description : ''
|
||||
};
|
||||
},
|
||||
onLoad(e){
|
||||
info(e.id).then(res => {
|
||||
this.id = e.id
|
||||
this.title = res.title
|
||||
this.description= res.description
|
||||
this.time = res.created_at
|
||||
this.content = res.content.replace(/\<img/gi, '<img style="max-width:100%; height:auto; display:block;"');
|
||||
this.categorie = res.categories[0].title
|
||||
@@ -31,6 +39,48 @@
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
select(e){
|
||||
switch (e.item.name) {
|
||||
case 'wxchum':
|
||||
uni.share({
|
||||
provider: 'weixin',
|
||||
scene: 'WXSceneSession',
|
||||
type: 0,
|
||||
href: 'https://invite.gongli.vip/articles/' + this.id,
|
||||
title: '共力生态-' + this.title,
|
||||
summary: this.description,
|
||||
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
|
||||
fail(err) {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'wxcircle':
|
||||
uni.share({
|
||||
provider: 'weixin',
|
||||
scene: 'WXSceneTimeline',
|
||||
type: 0,
|
||||
href: 'https://invite.gongli.vip/articles/' + this.id,
|
||||
summary: '共力生态-' + this.title,
|
||||
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/11/3b7e6e330f465ecbf136d15def1039fd.jpg',
|
||||
fail(err) {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap() {
|
||||
this.$refs.popupShare.open();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<u-sticky bgColor="#34CE98">
|
||||
<u-tabs
|
||||
:list="tabs"
|
||||
:scrollable="false"
|
||||
lineColor="white"
|
||||
:activeStyle="{color: 'white', fontWeight: 'bold', fontSize: '14px'}"
|
||||
:inactiveStyle="{color: 'rgba(255,255,255,.6)', fontSize: '14px'}"
|
||||
@@ -112,7 +111,6 @@
|
||||
},
|
||||
methods: {
|
||||
onTabs(e){
|
||||
console.log(e)
|
||||
if(this.type == e.type){
|
||||
return
|
||||
}
|
||||
|
||||
@@ -111,9 +111,13 @@
|
||||
goBook(item){
|
||||
if(item.url){
|
||||
if(item.url.openType === 'navigateTo'){
|
||||
uni.navigateTo({
|
||||
url:item.url.path
|
||||
})
|
||||
let url = item.url.path
|
||||
if(item.url.params != ''){
|
||||
url = url + '?' + item.url.params
|
||||
}
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user