分享 首页播报
This commit is contained in:
@@ -143,6 +143,23 @@
|
||||
<text>书名检索</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 新闻播报 -->
|
||||
<view class="fourBox " v-if="newsList.length > 0">
|
||||
<view class="newsBox flexbox">
|
||||
<view class="icon">
|
||||
<u-icon name="volume-fill" color="#ff5500" size="26"></u-icon>
|
||||
</view>
|
||||
<view class="newscoll">
|
||||
<swiper class="swiper" interval='5000' circular autoplay vertical indicator-dots="false">
|
||||
<swiper-item class="item" v-for="(item, index) in newsList" :key="index"
|
||||
@click="newsClick(item)">
|
||||
<view class="swiper-item uni-bg-red">{{item.title}}</view>
|
||||
</swiper-item>
|
||||
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 营销标签 -->
|
||||
<scroll-view class=" yxTagBox" scroll-x="true">
|
||||
<view class="ProTabs flexbox">
|
||||
@@ -394,6 +411,7 @@
|
||||
userMsg: {}, // 用户信息
|
||||
yxCurIndex: 0, // 当前营销标签序号
|
||||
SystemInfoSync: {}, // 屏幕尺寸
|
||||
newsList: [], // 播报新闻列表
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -438,11 +456,12 @@
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.tjProList = []
|
||||
this.getUserInfo()
|
||||
// this.tjProList = []
|
||||
// this.getUserInfo()
|
||||
// this.getData()
|
||||
this.getTags()
|
||||
this.getYXTgs()
|
||||
// this.getTags()
|
||||
// this.getYXTgs()
|
||||
this.requestAll()
|
||||
// this.requestIapOrder()
|
||||
uni.stopPullDownRefresh()
|
||||
|
||||
@@ -489,6 +508,45 @@
|
||||
// this.getData();
|
||||
this.getTags()
|
||||
this.getYXTgs()
|
||||
this.getNewsList()
|
||||
},
|
||||
newsClick(item) {
|
||||
if (item.type == 1) { // url跳转
|
||||
if (item.url != '') {
|
||||
this.openURL(item.url)
|
||||
} else {
|
||||
console.log('跳转链接为空')
|
||||
}
|
||||
} else { // 内部跳转
|
||||
uni.navigateTo({
|
||||
url: '/pages/news/news?newsid=' + item.id
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取播报新闻列表
|
||||
getNewsList() {
|
||||
$http.request({
|
||||
url: "common/message/listByPage",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"isBook": 1, //是否是疯子读书0否1是
|
||||
"isMedical": 0, //是否是吴门医述0否1是
|
||||
"isSociology": 0 //是否是众妙之门0否1是
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.messages.length > 0) {
|
||||
this.newsList = res.messages
|
||||
} else {
|
||||
this.newsList = []
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
// 获取营销标签列表
|
||||
getYXTgs() {
|
||||
@@ -905,6 +963,41 @@
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.newsBox {
|
||||
justify-content: space-between;
|
||||
background-color: #fff;
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx;
|
||||
overflow: hidden; margin-bottom: 10px;
|
||||
.content{
|
||||
image{
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
.icon {
|
||||
width: 44rpx;
|
||||
}
|
||||
|
||||
.newscoll {
|
||||
overflow: hidden;
|
||||
width: calc(100% - 60rpx);
|
||||
height: 40rpx;
|
||||
border: #11a669;
|
||||
line-height: 50rpx;
|
||||
|
||||
.item {
|
||||
|
||||
|
||||
.swiper-item {
|
||||
font-size: 28rpx;
|
||||
@include toe();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.yxTagBox {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user