3.12提交
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
<swiper-item
|
||||
v-for="(banner, index) in bannerList"
|
||||
:key="banner.id"
|
||||
@click="playBannerVideo(banner)"
|
||||
@click="goToNewsDetail(banner)"
|
||||
>
|
||||
<view class="banner-item">
|
||||
<image
|
||||
@@ -112,7 +112,7 @@
|
||||
<uni-icons type="eye" size="14" color="#999"></uni-icons>
|
||||
<text>{{ news.readnum || 0 }}</text>
|
||||
<uni-icons type="hand-up" size="14" color="#999" style="margin-left: 20rpx;"></uni-icons>
|
||||
<text>{{ news.likenum || 0 }}</text>
|
||||
<text>{{ news.agreenum || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -138,13 +138,25 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, reactive } from 'vue';
|
||||
import { onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { onShow, onPullDownRefresh, onReachBottom,onLoad,onBackPress} 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";
|
||||
const from=ref('');
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
});
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true
|
||||
}
|
||||
});
|
||||
// Banner相关数据
|
||||
const bannerList = ref([]);
|
||||
const currentBannerIndex = ref(0);
|
||||
@@ -222,7 +234,11 @@
|
||||
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
};
|
||||
|
||||
const goToSearch = () => {
|
||||
@@ -493,10 +509,13 @@
|
||||
const goToNewsDetail = (item) => {
|
||||
console.log('Go to news detail:', item);
|
||||
// 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}`
|
||||
});
|
||||
//const encoded = encodeURIComponent(docUrl+item.path);
|
||||
// navTo({
|
||||
// url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${item.title}`
|
||||
// });
|
||||
navTo({
|
||||
url: `/pages_app/webview/webviewClass?url=${encodeURIComponent(docUrl+item.path+'?fromtype=doctor')}&title=新闻详情&uuid=${item.uuid}&sharetitle=${item.title}&summary=${item.summary}&type=huanjiao_news&imgPath=${encodeURIComponent(item.headImg)}`
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url: `/pages_app/newsDetail/newsDetail?id=${item.uuid || item.id}`
|
||||
// });
|
||||
|
||||
Reference in New Issue
Block a user