2.6提交
This commit is contained in:
@@ -1,16 +1,27 @@
|
||||
<template>
|
||||
<view class="news-list-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="肝胆新闻"
|
||||
@clickLeft="goBack"
|
||||
fixed
|
||||
color="#8B2316"
|
||||
height="180rpx"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
></uni-nav-bar>
|
||||
<!-- <navBar title="肝胆新闻" /> -->
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
:title="'肝胆新闻'"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
>
|
||||
<template v-slot:right>
|
||||
<view class="nav-right" >
|
||||
<view class="collect-img" @click="goSearch" >
|
||||
<image class="img-icon" :src="searchImg" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 导航标签 -->
|
||||
<view class="nav-tabs">
|
||||
@@ -130,7 +141,10 @@
|
||||
import { onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
|
||||
import api from '@/api/api.js';
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import navTo from "@/utils/navTo.js";
|
||||
import navBar from '@/components/navBar/navBar.vue';
|
||||
import dayjs from 'dayjs';
|
||||
import searchImg from "@/static/search.png";
|
||||
// Banner相关数据
|
||||
const bannerList = ref([]);
|
||||
const currentBannerIndex = ref(0);
|
||||
@@ -167,10 +181,10 @@
|
||||
currentBannerIndex.value = e.detail.current;
|
||||
};
|
||||
const playBannerVideo = (banner) => {
|
||||
let url=encodeURIComponent(docUrl+banner.path)
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/webview/webview?url=${url}&title=${banner.title}`
|
||||
});
|
||||
const encoded = encodeURIComponent(docUrl+banner.path);
|
||||
navTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${banner.title}`
|
||||
});
|
||||
};
|
||||
// scroll-view 下拉刷新
|
||||
const onRefresh = async () => {
|
||||
@@ -477,10 +491,19 @@
|
||||
};
|
||||
|
||||
const goToNewsDetail = (item) => {
|
||||
// Implement navigation to news detail page
|
||||
console.log('Go to news detail:', item);
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/newsDetail/newsDetail?id=${item.uuid || item.id}`
|
||||
// Implement navigation to news detail page
|
||||
const encoded = encodeURIComponent(docUrl+item.path);
|
||||
navTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${item.title}`
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url: `/pages_app/newsDetail/newsDetail?id=${item.uuid || item.id}`
|
||||
// });
|
||||
};
|
||||
const goSearch = () => {
|
||||
uni.sendNativeEvent('goHomeSearch',{
|
||||
msg: 'news'
|
||||
});
|
||||
};
|
||||
|
||||
@@ -499,6 +522,16 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.img-icon {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
}
|
||||
.nav-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
.news-list-page {
|
||||
background-color: #f8f8f8;
|
||||
height: 100vh;
|
||||
@@ -544,7 +577,7 @@
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: #ff4757;
|
||||
color: #8B2316;
|
||||
font-weight: bold;
|
||||
|
||||
&::after {
|
||||
@@ -610,7 +643,7 @@
|
||||
bottom:0;
|
||||
width:100%;
|
||||
top:240rpx;
|
||||
height: calc(100vh - 240rpx); // 减去导航栏、标签栏和banner的高度
|
||||
height: calc(100vh - var(--status-bar-height) - 44px - 100rpx); // 减去导航栏、标签栏和banner的高度
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user