Merge branch 'mini' of https://gitee.com/zzpaym/zhongzheng-sample-clear-h5 into mini
This commit is contained in:
commit
69da934f68
|
|
@ -11,7 +11,6 @@ onLaunch(() => {
|
|||
onShow(() => {});
|
||||
onHide(() => {
|
||||
console.log("App Hide");
|
||||
uni.setStorageSync('homeTabIndex', null)
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
|
|
|||
|
|
@ -72,3 +72,12 @@ export const doShare = (data: any) => {
|
|||
return Request.post("/user/share", data);
|
||||
};
|
||||
|
||||
// 国内资讯列表
|
||||
export const getDomestic = (data: any) => {
|
||||
return Request.get("/news/domestic", data);
|
||||
};
|
||||
|
||||
// 国内资讯详情
|
||||
export const getDomesticDetail = (data: any) => {
|
||||
return Request.get(`/news/domestic/${data.id}`);
|
||||
};
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 674 B |
Binary file not shown.
|
After Width: | Height: | Size: 555 B |
|
|
@ -1,18 +1,34 @@
|
|||
<template>
|
||||
<view class="news-rank-list">
|
||||
<u-skeleton rows="5" title loading style="margin-bottom: 30rpx" v-if="loading"></u-skeleton>
|
||||
<u-skeleton
|
||||
rows="5"
|
||||
title
|
||||
loading
|
||||
style="margin-bottom: 30rpx"
|
||||
v-if="loading"
|
||||
></u-skeleton>
|
||||
<view class="list" v-else>
|
||||
<view v-for="(item, index) in rankListLocal" :key="index" class="news-item" @click="goDetail(item, 0)">
|
||||
|
||||
<view
|
||||
v-for="(item, index) in rankListLocal"
|
||||
:key="index"
|
||||
class="news-item"
|
||||
@click="goDetail(item, 0)"
|
||||
>
|
||||
<view class="rank-tag">
|
||||
<view v-if="index == 0" class="rank-text-top3">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_top_1.png" />
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_top_1.png"
|
||||
/>
|
||||
</view>
|
||||
<view v-else-if="index == 1" class="rank-text-top3">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_top_2.png" />
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_top_2.png"
|
||||
/>
|
||||
</view>
|
||||
<view v-else-if="index == 2" class="rank-text-top3">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_top_3.png" />
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_top_3.png"
|
||||
/>
|
||||
</view>
|
||||
<text class="rank-text" v-else>{{ index + 1 }}</text>
|
||||
</view>
|
||||
|
|
@ -21,15 +37,19 @@
|
|||
<view class="news-content">
|
||||
<text style="">
|
||||
<text class="news-title">{{ item.title.slice(0, 3) }}</text>
|
||||
<text :class="['news-title', isLogin ? '' : 'mohu']">{{ item.title.slice(3, item.title.length
|
||||
- 1) }}</text>
|
||||
<text :class="['news-title', isLogin ? '' : 'mohu']">{{
|
||||
item.title.slice(3, item.title.length)
|
||||
}}</text>
|
||||
</text>
|
||||
<text :class="['news-desc', isLogin ? '' : 'mohu']">{{ item.summary }}</text>
|
||||
<text :class="['news-desc', isLogin ? '' : 'mohu']">{{
|
||||
item.summary
|
||||
}}</text>
|
||||
|
||||
<view :class="['news-meta', isLogin ? '' : 'mohu']">
|
||||
|
||||
<view style="display: flex;justify-content: space-between;width: 100%;">
|
||||
<view style="display: flex;">
|
||||
<view
|
||||
style="display: flex; justify-content: space-between; width: 100%"
|
||||
>
|
||||
<view style="display: flex">
|
||||
<text class="source">{{ item.source }}</text>
|
||||
<text class="time">{{
|
||||
dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss")
|
||||
|
|
@ -37,27 +57,36 @@
|
|||
</view>
|
||||
|
||||
<view class="r_option">
|
||||
<image class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/eye_icon%402x.png"></image>
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/eye_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.viewCount }}</text>
|
||||
|
||||
<image class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/like_icon%402x.png"></image>
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/like_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.likeCount }}</text>
|
||||
|
||||
<image class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_icon%402x.png"></image>
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.shareCount }}</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="lock_view" v-if="!isLogin">
|
||||
<image class="lock_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/lock_icon%402x.png">
|
||||
<image
|
||||
class="lock_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/lock_icon%402x.png"
|
||||
>
|
||||
</image>
|
||||
<text class="lock_text">海外独家资讯内容,<text style="color: #D13E3C">登录</text>后可查阅全文</text>
|
||||
<text class="lock_text"
|
||||
>海外独家资讯内容,<text style="color: #d13e3c">登录</text
|
||||
>后可查阅全文</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -74,7 +103,7 @@ import { Session } from "@/utils/storage";
|
|||
const isExp = ref(true);
|
||||
const rankListLocal = ref([]);
|
||||
const loading = ref(true);
|
||||
const isLogin = ref(uni.getStorageSync('token'))
|
||||
const isLogin = ref(uni.getStorageSync("token"));
|
||||
|
||||
watch(
|
||||
() => isExp.value,
|
||||
|
|
@ -110,16 +139,28 @@ watch(
|
|||
let viewCount = 0;
|
||||
let favCount = 0;
|
||||
if (item.likeCount) {
|
||||
likeCount = item.likeCount > 10000 ? Number(item.likeCount / 10000).toFixed(1) + '万' : item.likeCount;
|
||||
likeCount =
|
||||
item.likeCount > 10000
|
||||
? Number(item.likeCount / 10000).toFixed(1) + "万"
|
||||
: item.likeCount;
|
||||
}
|
||||
if (item.shareCount) {
|
||||
shareCount = item.shareCount > 10000 ? Number(item.shareCount / 10000).toFixed(1) + '万' : item.shareCount;
|
||||
shareCount =
|
||||
item.shareCount > 10000
|
||||
? Number(item.shareCount / 10000).toFixed(1) + "万"
|
||||
: item.shareCount;
|
||||
}
|
||||
if (item.viewCount) {
|
||||
viewCount = item.viewCount > 10000 ? Number(item.viewCount / 10000).toFixed(1) + '万' : item.viewCount;
|
||||
viewCount =
|
||||
item.viewCount > 10000
|
||||
? Number(item.viewCount / 10000).toFixed(1) + "万"
|
||||
: item.viewCount;
|
||||
}
|
||||
if (item.favCount) {
|
||||
favCount = item.favCount > 10000 ? Number(item.favCount / 10000).toFixed(1) + '万' : item.viewCount;
|
||||
favCount =
|
||||
item.favCount > 10000
|
||||
? Number(item.favCount / 10000).toFixed(1) + "万"
|
||||
: item.viewCount;
|
||||
}
|
||||
|
||||
rankListLocal.value.push({
|
||||
|
|
@ -145,14 +186,25 @@ const props = defineProps({
|
|||
|
||||
const clickItem = ref({});
|
||||
function goDetail(item) {
|
||||
if (uni.getStorageSync("token")) {
|
||||
clickItem.value = item;
|
||||
if (uni.getStorageSync("token")) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/detail/indexNewsInfo?id=${item.news_id}`,
|
||||
});
|
||||
} else {
|
||||
LoginShow.value = true;
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/indexMini",
|
||||
});
|
||||
}
|
||||
|
||||
// if (uni.getStorageSync("token")) {
|
||||
// clickItem.value = item;
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/detail/indexNewsInfo?id=${item.news_id}`,
|
||||
// });
|
||||
// } else {
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
const LoginShow = ref(false);
|
||||
|
|
@ -238,7 +290,7 @@ const handlePopupErrorCallback = () => {
|
|||
|
||||
font-family: AvantiBold;
|
||||
font-size: 24rpx;
|
||||
color: #5A5A5A;
|
||||
color: #5a5a5a;
|
||||
line-height: 26rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
|
@ -247,7 +299,6 @@ const handlePopupErrorCallback = () => {
|
|||
text-align: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.news-content {
|
||||
|
|
@ -289,7 +340,7 @@ const handlePopupErrorCallback = () => {
|
|||
justify-content: space-between;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.source,
|
||||
|
|
@ -336,9 +387,8 @@ const handlePopupErrorCallback = () => {
|
|||
filter: blur(7rpx);
|
||||
}
|
||||
|
||||
|
||||
.lock_view {
|
||||
background: linear-gradient(180deg, rgba(248, 244, 238, 0) 0%, #F8F4EE 100%);
|
||||
background: linear-gradient(180deg, rgba(248, 244, 238, 0) 0%, #f8f4ee 100%);
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
display: flex;
|
||||
|
|
@ -360,7 +410,7 @@ const handlePopupErrorCallback = () => {
|
|||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #7F6242;
|
||||
color: #7f6242;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<template>
|
||||
<view class="main">
|
||||
<text style="margin-left: 40rpx;margin-right: 40rpx;display: flex;">
|
||||
<text style="margin-left: 40rpx; margin-right: 40rpx; display: flex">
|
||||
<text class="title">{{ props.data.title?.slice(0, 3) }}</text>
|
||||
<text :class="['title', isLogin ? '' : 'mohu']">{{ props.data.title?.slice(3,
|
||||
props.data.title.length
|
||||
- 1) }}</text>
|
||||
<text :class="['title', isLogin ? '' : 'mohu']">{{
|
||||
props.data.title?.slice(3, props.data.title.length)
|
||||
}}</text>
|
||||
</text>
|
||||
|
||||
<view class="author">
|
||||
<view class="name">
|
||||
<view class="name" v-if="!isDomestic">
|
||||
<text class="text">来源:</text>
|
||||
<text class="text">{{ props.data.tag }}</text>
|
||||
</view>
|
||||
|
|
@ -22,25 +22,41 @@
|
|||
|
||||
<!-- 两个标签 start -->
|
||||
<view class="r_r_tags">
|
||||
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw">
|
||||
<view
|
||||
style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw"
|
||||
>
|
||||
<view class="r_tags">
|
||||
<view class="tag" style="background-color: #fff9ec; color: #ffb100"
|
||||
v-for="(item, index) in props.data.conceptLabels" :key="index">{{ item }}</view>
|
||||
<view
|
||||
class="tag"
|
||||
style="background-color: #fff9ec; color: #ffb100"
|
||||
v-for="(item, index) in props.data.conceptLabels"
|
||||
:key="index"
|
||||
>{{ item }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw">
|
||||
<view
|
||||
style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw"
|
||||
>
|
||||
<view class="r_tags">
|
||||
<view class="tag" style="background-color: #f5f8fe; color: #007aff"
|
||||
v-for="(item, index) in props.data.industryLabels" :key="index">{{ item }}</view>
|
||||
<view
|
||||
class="tag"
|
||||
style="background-color: #f5f8fe; color: #007aff"
|
||||
v-for="(item, index) in props.data.industryLabels"
|
||||
:key="index"
|
||||
>{{ item }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 两个标签 end -->
|
||||
|
||||
<!-- 摘要 -->
|
||||
<view :class="['desc', isLogin ? '' : 'mohu']" v-if="props.data.summary">
|
||||
|
||||
<view
|
||||
:class="['desc', isLogin ? '' : 'mohu']"
|
||||
v-if="props.data.summary && !isDomestic"
|
||||
>
|
||||
<!-- <view class="bill_icon"></view> -->
|
||||
{{ props.data.summary }}
|
||||
</view>
|
||||
|
|
@ -54,8 +70,11 @@
|
|||
v-html="props.data.content">
|
||||
</text> -->
|
||||
|
||||
<rich-text :class="['articleDes', isLogin ? '' : 'mohu']" style="white-space: pre-wrap"
|
||||
v-html="props.data.content"></rich-text>
|
||||
<rich-text
|
||||
:class="['articleDes', isLogin ? '' : 'mohu']"
|
||||
style="white-space: pre-wrap"
|
||||
v-html="props.data.content"
|
||||
></rich-text>
|
||||
</view>
|
||||
|
||||
<!-- <view
|
||||
|
|
@ -77,13 +96,17 @@ import {
|
|||
onShareTimeline,
|
||||
} from "@dcloudio/uni-app";
|
||||
// import articleMock from "@/mock/article.js";
|
||||
const isLogin = ref(uni.getStorageSync('token'))
|
||||
const isLogin = ref(uni.getStorageSync("token"));
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
isDomestic: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const tagList1 = ref([
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,23 +1,48 @@
|
|||
<template>
|
||||
<view class="list" v-if="data.length">
|
||||
<view class="listItem" v-for="item in props.data" :key="item.id" @click="handleClick(item)">
|
||||
<view
|
||||
class="listItem"
|
||||
v-for="item in props.data"
|
||||
:key="item.id"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<view class="listItemHeader">
|
||||
<view class="ListItemImg" v-if="item.picture">
|
||||
<image :src="item.picture" class="ListItemImage" mode="widthFix" style="width: 204rpx" />
|
||||
<image class="ListItemBg" :src="item.picture" style="width: 100%; height: 100%" />
|
||||
<image
|
||||
:src="item.picture"
|
||||
class="ListItemImage"
|
||||
mode="widthFix"
|
||||
style="width: 204rpx"
|
||||
/>
|
||||
<image
|
||||
class="ListItemBg"
|
||||
:src="item.picture"
|
||||
style="width: 100%; height: 100%"
|
||||
/>
|
||||
<view class="tag" v-if="item.newType !== 'search'">{{
|
||||
item.tag
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="listItemHeaderContent">
|
||||
<view :class="['listItemTitle', !item.summary && 'noAbstract']" v-html="item.title">
|
||||
<view v-if="!isLogin">
|
||||
<text :class="['listItemTitle']">{{ item.title.slice(0, 3) }}</text>
|
||||
<text :class="['listItemTitle', isLogin ? '' : 'mohu']">
|
||||
{{ item.title.slice(3, item.title.length) }}
|
||||
</text></view
|
||||
>
|
||||
<view v-else>
|
||||
<view :class="['listItemTitle1']" v-html="item.title"> </view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="listItemAbstract" v-if="item.newType !== 'search'">{{
|
||||
item.summary
|
||||
}}</view>
|
||||
<view class="listItemAbstract" v-else v-html="item.MarkInRedContent || item.abstract"></view>
|
||||
<view
|
||||
:class="['listItemAbstract', isLogin ? '' : 'mohu']"
|
||||
v-if="item.newType !== 'search'"
|
||||
v-html="item.summary"
|
||||
></view>
|
||||
<view
|
||||
:class="['listItemAbstract', isLogin ? '' : 'mohu']"
|
||||
v-else
|
||||
v-html="item.MarkInRedContent || item.abstract"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -25,25 +50,32 @@
|
|||
<view class="tag">{{ item.tag }}</view>
|
||||
</view> -->
|
||||
|
||||
<view class="listItemContent">
|
||||
<view style="display: flex;">
|
||||
<view :class="['listItemContent', isLogin ? '' : 'mohu']">
|
||||
<view style="display: flex">
|
||||
<view class="tag">{{ item.tag }}</view>
|
||||
<view class="listItemTime" style="margin-left: 10rpx;">{{ item.time }}</view>
|
||||
<view class="listItemTime" style="margin-left: 10rpx">{{
|
||||
item.time
|
||||
}}</view>
|
||||
</view>
|
||||
|
||||
<view class="r_option">
|
||||
<image class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/eye_icon%402x.png"></image>
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/eye_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.readNums }}</text>
|
||||
|
||||
<image class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/like_icon%402x.png"></image>
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/like_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.likeNums }}</text>
|
||||
|
||||
<image class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_icon%402x.png"></image>
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.shareNums }}</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -59,6 +91,7 @@ import { ref } from "vue";
|
|||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
|
||||
const emit = defineEmits(["handleListJump", "onClick"]);
|
||||
const isLogin = ref(uni.getStorageSync("token"));
|
||||
|
||||
const props = defineProps({
|
||||
// 列表内容
|
||||
|
|
@ -82,7 +115,7 @@ const handleClick = (item: any) => {
|
|||
.list {
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
padding: 0 21rpx 30rpx 21rpx;
|
||||
padding: 0 40rpx 30rpx 40rpx;
|
||||
border-radius: 10rpx;
|
||||
font-family: "SourceHanSansCN-Regular";
|
||||
|
||||
|
|
@ -133,12 +166,14 @@ const handleClick = (item: any) => {
|
|||
}
|
||||
|
||||
.listItemHeaderContent {
|
||||
width: 100%;
|
||||
// width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-left: 0rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.listItemTitle {
|
||||
// font-size: 32rpx;
|
||||
.listItemTitle1 {
|
||||
font-size: 32rpx;
|
||||
font-size: var(--h1-font-size);
|
||||
color: #333;
|
||||
display: -webkit-box;
|
||||
|
|
@ -147,8 +182,28 @@ const handleClick = (item: any) => {
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
// font-weight: bold;
|
||||
word-break: break-all;
|
||||
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #192236;
|
||||
line-height: 45rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
.listItemTitle {
|
||||
// font-size: 32rpx;
|
||||
// font-size: var(--h1-font-size);
|
||||
// color: #333;
|
||||
// display: -webkit-box;
|
||||
// -webkit-box-orient: vertical;
|
||||
// -webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
|
|
@ -210,7 +265,7 @@ const handleClick = (item: any) => {
|
|||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #2D3849;
|
||||
color: #2d3849;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
|
@ -272,7 +327,6 @@ const handleClick = (item: any) => {
|
|||
font-family: "SourceHanSansCN-Medium";
|
||||
}
|
||||
|
||||
|
||||
.r_option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -294,4 +348,8 @@ const handleClick = (item: any) => {
|
|||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.mohu {
|
||||
filter: blur(7rpx);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,335 @@
|
|||
<template>
|
||||
<view class="list" v-if="data.length">
|
||||
<view
|
||||
class="listItem"
|
||||
v-for="item in props.data"
|
||||
:key="item.id"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<view class="listItemHeader">
|
||||
<view class="ListItemImg" v-if="item.picture">
|
||||
<image
|
||||
:src="item.picture"
|
||||
class="ListItemImage"
|
||||
mode="widthFix"
|
||||
style="width: 204rpx"
|
||||
/>
|
||||
<image
|
||||
class="ListItemBg"
|
||||
:src="item.picture"
|
||||
style="width: 100%; height: 100%"
|
||||
/>
|
||||
<view class="tag" v-if="item.newType !== 'search'">{{
|
||||
item.tag
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="listItemHeaderContent">
|
||||
<view v-if="!isLogin">
|
||||
<text :class="['listItemTitle']">{{ item.title.slice(0, 3) }}</text>
|
||||
<text :class="['listItemTitle', isLogin ? '' : 'mohu']">
|
||||
{{ item.title.slice(3, item.title.length) }}
|
||||
</text></view
|
||||
>
|
||||
<view v-else>
|
||||
<view :class="['listItemTitle1']" v-html="item.title"> </view>
|
||||
</view>
|
||||
<view
|
||||
:class="['listItemAbstract', isLogin ? '' : 'mohu']"
|
||||
v-if="item.newType !== 'search'"
|
||||
v-html="item.summary"
|
||||
></view>
|
||||
<view
|
||||
:class="['listItemAbstract', isLogin ? '' : 'mohu']"
|
||||
v-else
|
||||
v-html="item.MarkInRedContent || item.abstract"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="tabContainer">
|
||||
<view class="tag">{{ item.tag }}</view>
|
||||
</view> -->
|
||||
|
||||
<view :class="['listItemContent', isLogin ? '' : 'mohu']">
|
||||
<view style="display: flex">
|
||||
<view class="tag">中国证券报</view>
|
||||
<view class="listItemTime" style="margin-left: 10rpx">{{
|
||||
item.publishTime
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="listItemFooter" v-if="item.needpay"></view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <u-empty mode="news" v-else> </u-empty> -->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
|
||||
const emit = defineEmits(["handleListJump", "onClick"]);
|
||||
const isLogin = ref(uni.getStorageSync("token"));
|
||||
|
||||
const props = defineProps({
|
||||
// 列表内容
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
console.log("props ===>", props.data);
|
||||
const handleListJump = (item) => {
|
||||
emit("handleListJump", item);
|
||||
};
|
||||
|
||||
// 点击新闻传给父组件
|
||||
const handleClick = (item: any) => {
|
||||
emit("onClick", item);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list {
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
padding: 0 40rpx 30rpx 40rpx;
|
||||
border-radius: 10rpx;
|
||||
font-family: "SourceHanSansCN-Regular";
|
||||
|
||||
.listItem {
|
||||
border-bottom: 2rpx solid rgba(51, 51, 51, 0.1);
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0;
|
||||
|
||||
.listItemHeader {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.ListItemImg {
|
||||
width: 204rpx;
|
||||
height: 204rpx;
|
||||
border-radius: 9rpx;
|
||||
overflow: hidden;
|
||||
background-color: #c4c4c4;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
margin-right: 12rpx;
|
||||
|
||||
.ListItemImage {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.ListItemBg {
|
||||
filter: blur(30rpx);
|
||||
}
|
||||
|
||||
.tag {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #e7303f;
|
||||
// font-size: 20rpx;
|
||||
font-size: var(--h6-font-size);
|
||||
color: #fff;
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
|
||||
.listItemHeaderContent {
|
||||
// width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-left: 0rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.listItemTitle1 {
|
||||
font-size: 32rpx;
|
||||
font-size: var(--h1-font-size);
|
||||
color: #333;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #192236;
|
||||
line-height: 45rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
.listItemTitle {
|
||||
// font-size: 32rpx;
|
||||
// font-size: var(--h1-font-size);
|
||||
// color: #333;
|
||||
// display: -webkit-box;
|
||||
// -webkit-box-orient: vertical;
|
||||
// -webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #192236;
|
||||
line-height: 45rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
// text-align: left;
|
||||
&.noAbstract {
|
||||
-webkit-line-clamp: 4;
|
||||
}
|
||||
|
||||
.isVip {
|
||||
display: inline-block;
|
||||
width: 50rpx;
|
||||
height: 29rpx;
|
||||
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/icon_vip.png);
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.listItemTitleContent {
|
||||
// font-size: 32rpx;
|
||||
font-size: var(--h1-font-size);
|
||||
// color: #333;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
// font-weight: bold;
|
||||
|
||||
.isVip {
|
||||
display: inline-block;
|
||||
width: 50rpx;
|
||||
height: 29rpx;
|
||||
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/icon_vip.png);
|
||||
background-size: cover;
|
||||
box-sizing: border-box;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.listItemAbstract {
|
||||
box-sizing: border-box;
|
||||
padding-top: 12rpx;
|
||||
// font-size: 26rpx;
|
||||
font-size: var(--h3-font-size);
|
||||
color: rgba(51, 51, 51, 0.6);
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #2d3849;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listItemContent {
|
||||
// font-size: 20rpx;
|
||||
font-size: var(--h6-font-size);
|
||||
color: #b9b9b9;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 21rpx 0 0 0;
|
||||
|
||||
.listItemData {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.dataItem {
|
||||
margin-right: 12rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabContainer {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
padding-top: 21rpx;
|
||||
|
||||
.tag {
|
||||
box-sizing: border-box;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 4rpx;
|
||||
background-color: #e7303f;
|
||||
// font-size: 20rpx;
|
||||
font-size: var(--h6-font-size);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.listItemFooter {
|
||||
height: 74rpx;
|
||||
margin-top: 15rpx;
|
||||
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/vip_sub_2.png);
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listItemTitleContentText {
|
||||
font-family: "SourceHanSansCN-Medium";
|
||||
}
|
||||
|
||||
.r_option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10rpx;
|
||||
|
||||
.option_icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.option_text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #192236;
|
||||
line-height: 33rpx;
|
||||
text-align: justify;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.mohu {
|
||||
filter: blur(7rpx);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -21,8 +21,16 @@
|
|||
</view>
|
||||
<view class="recommendedList" v-if="hotNewsList.length != 0">
|
||||
<u-scroll-list :indicator="false">
|
||||
<view class="recommendedList-item" v-for="(item, index) in hotNewsList" :key="item.id">
|
||||
<RecommendedItem :data="{ item }" @handleClick="doDetail" :noPayShow="true" />
|
||||
<view
|
||||
class="recommendedList-item"
|
||||
v-for="(item, index) in hotNewsList"
|
||||
:key="item.id"
|
||||
>
|
||||
<RecommendedItem
|
||||
:data="{ item }"
|
||||
@handleClick="doDetail"
|
||||
:noPayShow="true"
|
||||
/>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
</view>
|
||||
|
|
@ -44,8 +52,11 @@
|
|||
<!-- 订阅 支付 -->
|
||||
<Pay :show="payShow" @onClick="handleClose" @handleSub="handleClickPay" />
|
||||
<!-- 登录弹框 -->
|
||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" />
|
||||
<LoginPopup
|
||||
:show="LoginShow"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -95,7 +106,11 @@ watch(
|
|||
() => props.newsList,
|
||||
(newValue, oldValue) => {
|
||||
const token = Session.get("token");
|
||||
isPay.value = !token ? true : newValue[0]?.needpay ? newValue[0]?.needpay : false;
|
||||
isPay.value = !token
|
||||
? true
|
||||
: newValue[0]?.needpay
|
||||
? newValue[0]?.needpay
|
||||
: false;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -253,7 +268,8 @@ const handlePopupSuccessCallback = () => {
|
|||
display: block;
|
||||
width: 44rpx;
|
||||
height: 6rpx;
|
||||
background: url("https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/icon_dot.png") no-repeat center;
|
||||
background: url("https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/icon_dot.png")
|
||||
no-repeat center;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -434,7 +450,11 @@ const handlePopupSuccessCallback = () => {
|
|||
// margin-bottom: 24rpx;
|
||||
padding: 40rpx 0;
|
||||
border-radius: 8rpx;
|
||||
background: linear-gradient(90deg, rgba(255, 250, 240, 1) 0%, rgba(254, 238, 210, 1) 100%);
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(255, 250, 240, 1) 0%,
|
||||
rgba(254, 238, 210, 1) 100%
|
||||
);
|
||||
|
||||
.need-pay-text {
|
||||
font-size: 28rpx;
|
||||
|
|
@ -452,7 +472,11 @@ const handlePopupSuccessCallback = () => {
|
|||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
border-radius: 20rpx;
|
||||
background: linear-gradient(90deg, rgba(252, 92, 105, 1) 0%, rgba(231, 48, 63, 1) 100%);
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(252, 92, 105, 1) 0%,
|
||||
rgba(231, 48, 63, 1) 100%
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
<template>
|
||||
<view class="news-rank-list">
|
||||
<List :data="newsList" @onClick="doDetail" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import dayjs from "dayjs/esm/index";
|
||||
import LoginPopup from "@/components/loginPopup/index.vue";
|
||||
import { Session } from "@/utils/storage";
|
||||
import { getDomestic } from "@/api/index";
|
||||
import List from "@/components/articleList/indexDomestic.vue";
|
||||
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
|
||||
|
||||
const newsList = ref([]);
|
||||
|
||||
const form = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
function doDetail(item) {
|
||||
uni.setStorageSync("homeTabIndex", 2);
|
||||
uni.navigateTo({
|
||||
url: "/pages/detail/indexNewsInfo?id=" + item.id + "&type=guonei",
|
||||
});
|
||||
}
|
||||
|
||||
async function getDomesticFn() {
|
||||
uni.showLoading();
|
||||
let { code, data } = await getDomestic({
|
||||
...form,
|
||||
});
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (code == 200) {
|
||||
if (form.pageNum == 1) {
|
||||
newsList.value = data.records;
|
||||
} else {
|
||||
newsList.value = [...newsList.value, ...data.records];
|
||||
}
|
||||
console.log("🚀 ~ getDomesticFn ~ newsList.value:", newsList.value);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDomesticFn();
|
||||
});
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
form.pageNum = 1;
|
||||
getDomesticFn();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
form.pageNum++;
|
||||
getDomesticFn();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
<view class="mine">
|
||||
<!-- 用户信息 -->
|
||||
<view class="userContainer">
|
||||
<u-avatar src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png" size="60"></u-avatar>
|
||||
<u-avatar
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png"
|
||||
size="60"
|
||||
></u-avatar>
|
||||
<view class="userData">
|
||||
<text class="phone">{{
|
||||
!isLoginStatus
|
||||
|
|
@ -33,30 +36,53 @@
|
|||
<!-- 其他功能区 -->
|
||||
<view class="otherContainer" v-if="isLoginStatus">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell title="已订阅栏目" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/vip.png" isLink
|
||||
:iconStyle="{ width: '46rpx', height: '32rpx', marginRight: '14rpx' }" :titleStyle="{
|
||||
<u-cell
|
||||
title="已订阅栏目"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/vip.png"
|
||||
isLink
|
||||
:iconStyle="{ width: '46rpx', height: '32rpx', marginRight: '14rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(-1)">
|
||||
}"
|
||||
@click="handleClick(-1)"
|
||||
>
|
||||
</u-cell>
|
||||
<u-cell title="我的收藏" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png" isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
||||
<u-cell
|
||||
title="我的收藏"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png"
|
||||
isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(0)">
|
||||
}"
|
||||
@click="handleClick(0)"
|
||||
>
|
||||
</u-cell>
|
||||
<u-cell title="我喜欢的" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png" isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
||||
<u-cell
|
||||
title="我喜欢的"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png"
|
||||
isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(1)">
|
||||
}"
|
||||
@click="handleClick(1)"
|
||||
>
|
||||
</u-cell>
|
||||
<!-- title="浏览记录" :icon="time" :border="false" -->
|
||||
<u-cell icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png" isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
||||
<u-cell
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png"
|
||||
isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(2)">
|
||||
}"
|
||||
@click="handleClick(2)"
|
||||
>
|
||||
<template #title>
|
||||
<view class="recordText">
|
||||
<text style="font-size: 32rpx">浏览记录</text>
|
||||
|
|
@ -64,8 +90,6 @@
|
|||
</view>
|
||||
</template>
|
||||
</u-cell>
|
||||
|
||||
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
|
|
@ -83,8 +107,12 @@
|
|||
</view>
|
||||
|
||||
<!-- 登录弹框 -->
|
||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
<LoginPopup
|
||||
:show="LoginShow"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
@handlePopupErrorCallback="handlePopupErrorCallback"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -151,7 +179,6 @@ const loginOut = () => {
|
|||
uni.reLaunch({
|
||||
url: "/pages/login/index",
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const handleClick = (val: number) => {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@
|
|||
<Navbar title="中证参考" :hasBack="false"></Navbar>
|
||||
<!-- 用户信息 -->
|
||||
<view class="userContainer">
|
||||
<u-avatar src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png" size="60"></u-avatar>
|
||||
<u-avatar
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png"
|
||||
size="60"
|
||||
></u-avatar>
|
||||
<view class="userData">
|
||||
<text class="phone">{{
|
||||
!isLoginStatus ? "未登录用户" : maskPhoneNumber()
|
||||
|
|
@ -38,24 +41,41 @@
|
|||
color: '#333333',
|
||||
}" @click="handleClick(-1)">
|
||||
</u-cell> -->
|
||||
<u-cell title="我的收藏" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png" isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
||||
<u-cell
|
||||
title="我的收藏"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png"
|
||||
isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(0)">
|
||||
}"
|
||||
@click="handleClick(0)"
|
||||
>
|
||||
</u-cell>
|
||||
<u-cell title="我喜欢的" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png" isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
||||
<u-cell
|
||||
title="我喜欢的"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png"
|
||||
isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(1)">
|
||||
}"
|
||||
@click="handleClick(1)"
|
||||
>
|
||||
</u-cell>
|
||||
<!-- title="浏览记录" :icon="time" :border="false" -->
|
||||
<u-cell icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png" isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
||||
<u-cell
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png"
|
||||
isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(2)">
|
||||
}"
|
||||
@click="handleClick(2)"
|
||||
>
|
||||
<template #title>
|
||||
<view class="recordText">
|
||||
<text style="font-size: 32rpx">浏览记录</text>
|
||||
|
|
@ -63,13 +83,17 @@
|
|||
</view>
|
||||
</template>
|
||||
</u-cell>
|
||||
<u-cell title="隐私协议"
|
||||
<u-cell
|
||||
title="隐私协议"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/%E9%9A%90%E7%A7%81%E5%8D%8F%E8%AE%AE%E5%92%8C%E7%94%A8%E6%88%B7%E5%8D%8F%E8%AE%AEicon.png"
|
||||
isLink :iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{
|
||||
isLink
|
||||
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
|
||||
:titleStyle="{
|
||||
fontSize: '32rpx',
|
||||
color: '#333333',
|
||||
}" @click="handleClick(3)">
|
||||
|
||||
}"
|
||||
@click="handleClick(3)"
|
||||
>
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
|
@ -88,8 +112,12 @@
|
|||
</view>
|
||||
|
||||
<!-- 登录弹框 -->
|
||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
<LoginPopup
|
||||
:show="LoginShow"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
@handlePopupErrorCallback="handlePopupErrorCallback"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -99,9 +127,9 @@ import { onPullDownRefresh, onShow } from "@dcloudio/uni-app";
|
|||
import { Session } from "@/utils/storage";
|
||||
import LoginPopup from "@/components/loginPopup/index.vue";
|
||||
import { useShareStore } from "@/stores/shareStore";
|
||||
import Navbar from '@/components/mini/Navbar.vue'
|
||||
import Navbar from "@/components/mini/Navbar.vue";
|
||||
|
||||
const emit = defineEmits(['logout'])
|
||||
const emit = defineEmits(["logout"]);
|
||||
|
||||
const stores = useShareStore();
|
||||
const curPages = getCurrentPages();
|
||||
|
|
@ -161,11 +189,12 @@ const loginBtnStatus = () => {
|
|||
|
||||
// 退出登录,回到登录页面
|
||||
const loginOut = () => {
|
||||
uni.clearStorageSync()
|
||||
emit("logout")
|
||||
uni.clearStorageSync();
|
||||
emit("logout");
|
||||
};
|
||||
|
||||
const handleClick = (val: number) => {
|
||||
uni.setStorageSync("homeTabIndex", 1);
|
||||
if (val === -1) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/subscribed/index",
|
||||
|
|
@ -176,8 +205,7 @@ const handleClick = (val: number) => {
|
|||
fail: () => {}, // 打开失败
|
||||
complete: () => {},
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/bookmark/index?tabs=${val}`,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,28 +1,78 @@
|
|||
<template>
|
||||
<view class="tabbar">
|
||||
<view class="tabbar_item" @click="tabChange(0)">
|
||||
<image v-if="tabIndex == 1" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.png"
|
||||
class="tabbar_img" />
|
||||
<image v-if="tabIndex == 0" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
|
||||
class="tabbar_img" />
|
||||
<text class="tabbar_title" :style="{ color: tabIndex == 0 ? '#D13E3C' : '#757A80' }">海外资讯</text>
|
||||
<image
|
||||
v-if="tabIndex == 0"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
|
||||
class="tabbar_img"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.png"
|
||||
class="tabbar_img"
|
||||
/>
|
||||
<text
|
||||
class="tabbar_title"
|
||||
:style="{ color: tabIndex == 0 ? '#D13E3C' : '#757A80' }"
|
||||
>海外资讯</text
|
||||
>
|
||||
</view>
|
||||
|
||||
<view class="tabbar_item" @click="tabChange(2)">
|
||||
<image
|
||||
v-if="tabIndex == 2"
|
||||
src="../../assets/activeCaixun.png"
|
||||
class="tabbar_img"
|
||||
/>
|
||||
<image v-else src="../../assets/caixun.png" class="tabbar_img" />
|
||||
<text
|
||||
class="tabbar_title"
|
||||
:style="{ color: tabIndex == 2 ? '#D13E3C' : '#757A80' }"
|
||||
>国内资讯</text
|
||||
>
|
||||
</view>
|
||||
|
||||
<view class="tabbar_item" @click="tabChange(1)">
|
||||
<image v-if="tabIndex == 0" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_normal.png"
|
||||
class="tabbar_img" />
|
||||
<image v-if="tabIndex == 1" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png"
|
||||
class="tabbar_img" />
|
||||
<text class="tabbar_title" :style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }">全部</text>
|
||||
<image
|
||||
v-if="tabIndex == 1"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png"
|
||||
class="tabbar_img"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_normal.png"
|
||||
class="tabbar_img"
|
||||
/>
|
||||
<text
|
||||
class="tabbar_title"
|
||||
:style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }"
|
||||
>我的
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, reactive } from "vue";
|
||||
import { ref, onMounted, watch, reactive } from "vue";
|
||||
const emit = defineEmits(["tabChange"]);
|
||||
|
||||
const props = defineProps({
|
||||
tabIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.tabIndex,
|
||||
(newValue, oldValue) => {
|
||||
console.log("🚀 ~ newValue:", newValue);
|
||||
if (newValue) {
|
||||
tabIndex.value = newValue;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const tabIndex = ref(0);
|
||||
function tabChange(index) {
|
||||
tabIndex.value = index;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
// const baseURL = "http://192.168.31.25:8060/api";
|
||||
// const baseUrl = "http://192.168.31.25:8060/api";
|
||||
// export const baseUrl = "http://127.0.0.1:8040/apih5";
|
||||
// export const baseUrl = "http://192.168.3.38:8040/apih5";
|
||||
export const baseUrl = "http://123.60.79.143:8041/apih5";
|
||||
// export const baseUrl = "https://cankao.cs.com.cn/apih5";
|
||||
export const baseUrlDataV = "https://cankao.cs.com.cn/zzck_datav";
|
||||
export const baseUrl = "https://cankao.cs.com.cn/mini";
|
||||
|
||||
export const baseUrlDataV = "https://cankao.cs.com.cn/zzck_datav";
|
||||
// export const baseUrlDataV = "http://123.60.153.169:9995/zzck_datav";
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@
|
|||
"path": "pages/login/indexMini"
|
||||
},
|
||||
{
|
||||
"path": "pages/realtimeInfo/rankDetail"
|
||||
"path": "pages/realtimeInfo/rankDetail",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
},
|
||||
{
|
||||
"path": "pages/home/index",
|
||||
|
|
|
|||
|
|
@ -1,24 +1,43 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view :style="{ height: getNavHeight() + 'px', position: 'sticky', top: 0, background: '#fff', zIndex: '9999' }">
|
||||
<view
|
||||
:style="{
|
||||
height: getNavHeight() + 'px',
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
background: '#fff',
|
||||
zIndex: '9999',
|
||||
}"
|
||||
>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 导航栏 start -->
|
||||
<view class="custom-bav-bar"
|
||||
:style="{ position: 'sticky', top: getNavHeight() + 'px', background: '#fff', zIndex: '9999' }">
|
||||
|
||||
<view
|
||||
class="custom-bav-bar"
|
||||
:style="{
|
||||
position: 'sticky',
|
||||
top: getNavHeight() + 'px',
|
||||
background: '#fff',
|
||||
zIndex: '9999',
|
||||
}"
|
||||
>
|
||||
<view class="left">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/static/icon_left.png" class="back_icon"
|
||||
@click="handleBack" />
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/static/icon_left.png"
|
||||
class="back_icon"
|
||||
@click="handleBack"
|
||||
/>
|
||||
</view>
|
||||
<view class="center">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/detail_logo.png" class="logo_icon" />
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/detail_logo.png"
|
||||
class="logo_icon"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 文章正文 start -->
|
||||
<Article :data="data" />
|
||||
<Article :data="data" :isDomestic="isDomestic" />
|
||||
<!-- 分割 -->
|
||||
<view class="line"></view>
|
||||
<!-- 推荐栏目 -->
|
||||
|
|
@ -30,60 +49,82 @@
|
|||
/> -->
|
||||
|
||||
<!-- 底部栏 评论 / 收藏 -->
|
||||
<Comment v-if="isLogin" :data="data" @handleClickLike="handleClickLike" @handleClickStar="handleClickStar" />
|
||||
<Comment
|
||||
v-if="isLogin && !isDomestic"
|
||||
:data="data"
|
||||
@handleClickLike="handleClickLike"
|
||||
@handleClickStar="handleClickStar"
|
||||
/>
|
||||
|
||||
<view class="login_unlock" v-if="!isLogin">
|
||||
<view class="r_image">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/lock_banner%402x.png"></image>
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/lock_banner%402x.png"
|
||||
></image>
|
||||
|
||||
<view class="image_text">
|
||||
<text class="image_text_title">登录解锁</text>
|
||||
<text class="image_text_sub_title">海外独家资讯内容,登录后可查阅全文</text>
|
||||
<text class="image_text_sub_title"
|
||||
>海外独家资讯内容,登录后可查阅全文</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="login_unlock_btn">立即登录</view>
|
||||
<view class="login_unlock_btn" @click="goLogin">立即登录</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { onLoad, onShareAppMessage, onShow } from "@dcloudio/uni-app";
|
||||
import {
|
||||
onLoad,
|
||||
onShareAppMessage,
|
||||
onShareTimeline,
|
||||
onShow,
|
||||
} from "@dcloudio/uni-app";
|
||||
import { onReachBottom } from "@dcloudio/uni-app";
|
||||
import {
|
||||
fetchArticleDetail,
|
||||
fetchArticleLike,
|
||||
fetchArticleFavorate,
|
||||
} from "@/api/detail";
|
||||
import { getNewsList, doShare } from "@/api";
|
||||
import { getNewsList, doShare, getDomesticDetail } from "@/api";
|
||||
import Article from "@/components/article/indexNewsInfo.vue";
|
||||
import Column from "@/components/column/index.vue";
|
||||
import Comment from "@/components/comment/indexMini.vue";
|
||||
import { useShareStore } from "@/stores/shareStore";
|
||||
import { Session } from "@/utils/storage";
|
||||
import { getNavHeight } from "@/utils/util"
|
||||
|
||||
import { getNavHeight } from "@/utils/util";
|
||||
|
||||
const stores = useShareStore();
|
||||
const curPages = getCurrentPages();
|
||||
const isLogin = ref<boolean>(uni.getStorageSync("token") ? true : false);
|
||||
|
||||
|
||||
const data = ref<any>({});
|
||||
const newType = ref<any>("");
|
||||
const columnList = ref<any>([]);
|
||||
const columnName = ref("");
|
||||
|
||||
|
||||
onReachBottom(() => {
|
||||
console.log("🚀 ~ onReachBottom ~ onReachBottom:");
|
||||
});
|
||||
|
||||
const isDomestic = ref<boolean>(false);
|
||||
onLoad(async (option: any) => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
});
|
||||
if (option?.type == "guonei") {
|
||||
isDomestic.value = true;
|
||||
let res = await getDomesticDetail({ id: option.id });
|
||||
if (res.code === 200) {
|
||||
data.value = res.data;
|
||||
|
||||
data.value.content = res.data.content.replace(/\n{3,}/g, "\n");
|
||||
|
||||
columnName.value = data.columnName1;
|
||||
}
|
||||
} else {
|
||||
newType.value = option.type || 14;
|
||||
const res = await fetchArticleDetail({
|
||||
id: option.id,
|
||||
|
|
@ -93,12 +134,13 @@ onLoad(async (option: any) => {
|
|||
if (res.code === 200) {
|
||||
data.value = res.data;
|
||||
|
||||
res.data.content = res.data.content.replace(/\n{3,}/g, '\n');
|
||||
res.data.content = res.data.content.replace(/\n{3,}/g, "\n");
|
||||
|
||||
columnName.value = res.data.columnName1;
|
||||
newList(res.data.columnId1);
|
||||
wxShare();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const newList = async (columnId: number) => {
|
||||
|
|
@ -206,20 +248,36 @@ const jumpDetail = (item: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
onShareAppMessage(async (res) => {
|
||||
console.log("🚀 ~ res:", res)
|
||||
console.log("🚀 ~ data.value:", data.value)
|
||||
|
||||
function goLogin() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/indexMini",
|
||||
});
|
||||
}
|
||||
onShareTimeline(async (res) => {
|
||||
let { code } = await doShare({
|
||||
id: data.value.id
|
||||
})
|
||||
id: data.value.id,
|
||||
});
|
||||
return {
|
||||
title: data.value.title, //标题
|
||||
path: '/page/detail/indexNewsInfo?id=' + data.value.id,//可以指定动态路径
|
||||
imageUrl: 'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_pic_1%402x.png',//分享图
|
||||
}
|
||||
path: "/pages/detail/indexNewsInfo?id=" + data.value.id, //可以指定动态路径
|
||||
imageUrl:
|
||||
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_pic_1%402x.png", //分享图
|
||||
};
|
||||
});
|
||||
onShareAppMessage(async (res) => {
|
||||
console.log("🚀 ~ res:", res);
|
||||
console.log("🚀 ~ data.value:", data.value);
|
||||
|
||||
})
|
||||
let { code } = await doShare({
|
||||
id: data.value.id,
|
||||
});
|
||||
return {
|
||||
title: data.value.title, //标题
|
||||
path: "/pages/detail/indexNewsInfo?id=" + data.value.id, //可以指定动态路径
|
||||
imageUrl:
|
||||
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_pic_1%402x.png", //分享图
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
@ -333,7 +391,7 @@ onShareAppMessage(async (res) => {
|
|||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
line-height: 42rpx;
|
||||
text-shadow: 0px 2px 8px rgba(43, 51, 75, 0.35);
|
||||
text-align: left;
|
||||
|
|
@ -344,7 +402,7 @@ onShareAppMessage(async (res) => {
|
|||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #B5BED5;
|
||||
color: #b5bed5;
|
||||
line-height: 33rpx;
|
||||
text-shadow: 0px 2px 8px rgba(43, 51, 75, 0.35);
|
||||
text-align: left;
|
||||
|
|
@ -355,20 +413,19 @@ onShareAppMessage(async (res) => {
|
|||
width: 78vw;
|
||||
height: 128rpx;
|
||||
margin-bottom: 60rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.login_unlock_btn {
|
||||
width: 100%;
|
||||
width: 80%;
|
||||
height: 88rpx;
|
||||
background: #D13E3C;
|
||||
background: #d13e3c;
|
||||
border-radius: 44rpx;
|
||||
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
line-height: 45rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,23 @@
|
|||
<template>
|
||||
<view class="root" :style="{ backgroundColor: tabIndex == 4 ? '#f6f6f6' : '#ffffff' }">
|
||||
<view
|
||||
class="root"
|
||||
:style="{ backgroundColor: tabIndex == 4 ? '#f6f6f6' : '#ffffff' }"
|
||||
>
|
||||
<!-- 首页 start -->
|
||||
<Index v-if="menuStateConfig.home.active" :columnState="menuStateConfig.home" :colList="homeColList" @onChange="handleMenuChange"></Index>
|
||||
<Index
|
||||
v-if="menuStateConfig.home.active"
|
||||
:columnState="menuStateConfig.home"
|
||||
:colList="homeColList"
|
||||
@onChange="handleMenuChange"
|
||||
></Index>
|
||||
<!-- 首页 end -->
|
||||
<!-- vip start -->
|
||||
<vip v-if="menuStateConfig.vip.active" :columnState="menuStateConfig.vip" :colList="vipColList" @onChange="handleMenuChange"></vip>
|
||||
<vip
|
||||
v-if="menuStateConfig.vip.active"
|
||||
:columnState="menuStateConfig.vip"
|
||||
:colList="vipColList"
|
||||
@onChange="handleMenuChange"
|
||||
></vip>
|
||||
<!-- vip end -->
|
||||
<!-- 我的 start -->
|
||||
<mine v-if="menuStateConfig.mine.active"></mine>
|
||||
|
|
@ -19,14 +32,24 @@
|
|||
@change="handleMenuChange($event, 'tabbar')"
|
||||
z-index="600"
|
||||
>
|
||||
<u-tabbar-item :text="item.title" v-for="(item, index) in menuList" :key="index">
|
||||
<u-tabbar-item
|
||||
:text="item.title"
|
||||
v-for="(item, index) in menuList"
|
||||
:key="index"
|
||||
>
|
||||
<template #active-icon>
|
||||
<view v-if="index == 0" style="height: 40rpx"></view>
|
||||
<image :src="item.iconc" :class="[index == 0 ? 'vipcass_c' : 'menu_icon']"></image>
|
||||
<image
|
||||
:src="item.iconc"
|
||||
:class="[index == 0 ? 'vipcass_c' : 'menu_icon']"
|
||||
></image>
|
||||
</template>
|
||||
<template #inactive-icon>
|
||||
<view v-if="index == 0" style="height: 40rpx"></view>
|
||||
<image :src="item.icon" :class="[index == 0 ? 'vipcass' : 'menu_icon']"></image>
|
||||
<image
|
||||
:src="item.icon"
|
||||
:class="[index == 0 ? 'vipcass' : 'menu_icon']"
|
||||
></image>
|
||||
</template>
|
||||
</u-tabbar-item>
|
||||
</u-tabbar>
|
||||
|
|
@ -135,11 +158,17 @@ const setMenuStateConfig = (option: any) => {
|
|||
const __menuStateConfig = Session.get("menuStateConfig");
|
||||
|
||||
if (__menuStateConfig) {
|
||||
const activeObject: any = Object.values(__menuStateConfig).find((item: any) => item.active);
|
||||
const activeObject: any = Object.values(__menuStateConfig).find(
|
||||
(item: any) => item.active
|
||||
);
|
||||
const activeId = activeObject ? activeObject.id : 0;
|
||||
tabIndex.value = activeId;
|
||||
menuStateConfig.value = __menuStateConfig;
|
||||
} else if (option?.tabIndex || option?.columnIndex || option?.subColumnIndex) {
|
||||
} else if (
|
||||
option?.tabIndex ||
|
||||
option?.columnIndex ||
|
||||
option?.subColumnIndex
|
||||
) {
|
||||
const index = Number(option?.tabIndex) || 0;
|
||||
const columnIndex = Number(option?.columnIndex) || 0;
|
||||
const subColumnIndex = Number(option?.subColumnIndex) || 0;
|
||||
|
|
|
|||
|
|
@ -8,19 +8,29 @@
|
|||
<!-- <view class="bottom_btn" @click="goIndex"> 立即进入 </view> -->
|
||||
|
||||
<!-- 用户协议 -->
|
||||
<view class="tips">
|
||||
|
||||
<u-checkbox-group v-model="checked" placement="column" @change="checkboxChange">
|
||||
<view class="tips" @click="doChangeCheck">
|
||||
<u-checkbox-group
|
||||
v-model="checked"
|
||||
placement="column"
|
||||
activeColor="#e7303f"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox class="checkbox" shape="circle"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
|
||||
<text class="r_userAgreement">已阅读并同意<text class="userAgreement"
|
||||
@click="goUserAgreement">《江南农商银行隐私政策》《中证参考智能资讯小程序服务使用许可及服务协议》</text>,首次登录的手机号将自动注册。</text>
|
||||
<text class="r_userAgreement"
|
||||
>已阅读并同意<text class="userAgreement" @click="goUserAgreement"
|
||||
>《江南农商银行隐私政策》《中证参考智能资讯小程序服务使用许可及服务协议》</text
|
||||
>,首次登录的手机号将自动注册。</text
|
||||
>
|
||||
</view>
|
||||
|
||||
|
||||
<button v-if="checked && checked?.length > 0" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
|
||||
class="bottom_btn">
|
||||
<button
|
||||
v-if="checked && checked?.length > 0"
|
||||
open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhoneNumber"
|
||||
class="bottom_btn"
|
||||
>
|
||||
<view>
|
||||
<text>立即进入</text>
|
||||
</view>
|
||||
|
|
@ -49,14 +59,13 @@ import { doWxAuth } from "@/api/index";
|
|||
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { useShareStore } from "@/stores/shareStore";
|
||||
const stores = useShareStore();
|
||||
const checked = ref([])
|
||||
const checked = ref([]);
|
||||
|
||||
watch(checked, (newVal) => {
|
||||
console.log("🚀 ~ newVal:", newVal)
|
||||
console.log("🚀 ~ newVal:", newVal);
|
||||
if (newVal) {
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
let timer = ref();
|
||||
|
||||
|
|
@ -141,15 +150,22 @@ onLoad((option) => {
|
|||
// }, 2000)
|
||||
});
|
||||
|
||||
function doChangeCheck() {
|
||||
if (checked.value && checked.value.length > 0) {
|
||||
checked.value = [];
|
||||
} else {
|
||||
checked.value = [""];
|
||||
}
|
||||
}
|
||||
|
||||
// 点击用户协议
|
||||
function needCheck() {
|
||||
uni.showToast({
|
||||
title: "请先同意用户协议",
|
||||
icon: 'none'
|
||||
})
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function goUserAgreement() {
|
||||
wx.openPrivacyContract({
|
||||
success: () => {}, // 打开成功
|
||||
|
|
@ -165,7 +181,7 @@ onUnload(() => {
|
|||
|
||||
onShow(() => {
|
||||
stores.initWxConfig();
|
||||
uni.setStorageSync('homeTabIndex', null)
|
||||
uni.setStorageSync("homeTabIndex", null);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -232,7 +248,6 @@ onShow(() => {
|
|||
display: flex;
|
||||
align-items: start;
|
||||
|
||||
|
||||
:deep(.u-checkbox) {
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,37 +2,54 @@
|
|||
<!-- 顶部 banner 区域 -->
|
||||
<view class="all">
|
||||
<!-- <Navbar title="中证参考" :hasBack="false"></Navbar> -->
|
||||
<image class="top_bk" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"></image>
|
||||
<image
|
||||
class="top_bk"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"
|
||||
></image>
|
||||
|
||||
<view :style="{
|
||||
<view
|
||||
:style="{
|
||||
height: getNavHeight() + 'px',
|
||||
backgroundColor: isScroll ? '#fff' : 'transparent',
|
||||
position: 'sticky', top: 0,
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: '999999',
|
||||
}" v-if="tabIndex == 0"></view>
|
||||
<view :style="{
|
||||
}"
|
||||
v-if="tabIndex == 0 || tabIndex == 2"
|
||||
></view>
|
||||
<view
|
||||
:style="{
|
||||
height: getNavHeight() + 'px',
|
||||
backgroundColor: '#fff',
|
||||
position: 'sticky', top: 0,
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: '999999',
|
||||
|
||||
}" v-else></view>
|
||||
}"
|
||||
v-else
|
||||
></view>
|
||||
|
||||
<view class="content">
|
||||
|
||||
<view :style="{
|
||||
position: 'sticky', top: getNavHeight() + 'px',
|
||||
<view
|
||||
:style="{
|
||||
position: 'sticky',
|
||||
top: getNavHeight() + 'px',
|
||||
backgroundColor: isScroll ? '#fff' : 'transparent',
|
||||
zIndex: '9999'
|
||||
}" v-if="tabIndex == 0">
|
||||
zIndex: '9999',
|
||||
}"
|
||||
v-if="tabIndex == 0 || tabIndex == 2"
|
||||
>
|
||||
<view class="r_sreach">
|
||||
<image class="logo_text" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png">
|
||||
<image
|
||||
class="logo_text"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png"
|
||||
>
|
||||
</image>
|
||||
|
||||
<view class="sreach" @click="goSreach">
|
||||
|
||||
<view class="sreach" @click="goSreach" v-if="tabIndex == 0">
|
||||
<view class="sreach_icon">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_search_line.png"></image>
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_search_line.png"
|
||||
></image>
|
||||
</view>
|
||||
<view class="sreach_text">
|
||||
<text>搜索资讯</text>
|
||||
|
|
@ -40,102 +57,124 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view style="padding: 0 24rpx;margin-top: 30rpx;">
|
||||
<view style="padding: 0 24rpx; margin-top: 30rpx" v-if="tabIndex == 0">
|
||||
<u-swiper :list="list1" @change="change" @click="click"></u-swiper>
|
||||
</view>
|
||||
|
||||
<view style="padding-top: 30rpx;background-color: white;padding-bottom: 30rpx;">
|
||||
<view
|
||||
v-if="tabIndex == 0"
|
||||
style="
|
||||
padding-top: 30rpx;
|
||||
background-color: white;
|
||||
padding-bottom: 30rpx;
|
||||
"
|
||||
>
|
||||
<Tabs></Tabs>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="margin-top: 30rpx;" v-if="tabIndex == 0">
|
||||
<view style="margin-top: 30rpx" v-if="tabIndex == 0">
|
||||
<RankListMini :newsList="newsList"></RankListMini>
|
||||
</view>
|
||||
<!-- 列表区域 -->
|
||||
<view style="margin-top: 50rpx" v-if="tabIndex == 2">
|
||||
<Domestic />
|
||||
</view>
|
||||
|
||||
<MineMini v-if="tabIndex == 1" @logout="tabIndex = 0"></MineMini>
|
||||
</view>
|
||||
|
||||
<Tabbar @tabChange="tabChange"></Tabbar>
|
||||
<Tabbar :tabIndex="tabIndex" @tabChange="tabChange"></Tabbar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, defineAsyncComponent, reactive } from "vue";
|
||||
import Tabbar from "@/components/mini/Tabbar.vue";
|
||||
import Navbar from '@/components/mini/Navbar.vue'
|
||||
import Navbar from "@/components/mini/Navbar.vue";
|
||||
import RankListMini from "@/components/RankListMini.vue";
|
||||
// const Mine = defineAsyncComponent(() => import("@/components/mine.vue"));
|
||||
import MineMini from "@/components/mineMini.vue";
|
||||
import Tabs from "@/components/mini/Tabs.vue";
|
||||
import {
|
||||
getTopNews,
|
||||
} from "@/api/newsInfo";
|
||||
import { getTopNews } from "@/api/newsInfo";
|
||||
import { onPageNotFound, onPageScroll, onShow } from "@dcloudio/uni-app";
|
||||
import { getNavHeight } from "@/utils/util"
|
||||
import { getNavHeight } from "@/utils/util";
|
||||
import Domestic from "@/components/domesticMini.vue";
|
||||
|
||||
const list1 = reactive([
|
||||
'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png',
|
||||
'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png',
|
||||
'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png',
|
||||
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png",
|
||||
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png",
|
||||
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png",
|
||||
]);
|
||||
|
||||
const newsList = ref([]);
|
||||
// 概念标签贴标
|
||||
async function getNewsList() {
|
||||
newsList.value = await getTopNews({});
|
||||
uni.stopPullDownRefresh()
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
|
||||
const tabIndex = ref(0);
|
||||
function tabChange(index) {
|
||||
|
||||
tabIndex.value = index;
|
||||
uni.setStorageSync('homeTabIndex', index)
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
getNewsList()
|
||||
getNewsList();
|
||||
break;
|
||||
case 1:
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
uni.setStorageSync("homeTabIndex", 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function goSreach() {
|
||||
if (uni.getStorageSync("token")) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/sreachReq/index',
|
||||
})
|
||||
url: "/pages/sreachReq/index",
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/indexMini",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const isScroll = ref(false)
|
||||
const isScroll = ref(false);
|
||||
onPageScroll((val) => {
|
||||
if (tabIndex.value == 0 || tabIndex.value == 1) {
|
||||
if (val.scrollTop > 150) {
|
||||
isScroll.value = true
|
||||
isScroll.value = true;
|
||||
} else {
|
||||
isScroll.value = false
|
||||
isScroll.value = false;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
if (uni.getStorageSync('homeTabIndex') == 1) {
|
||||
tabChange(1)
|
||||
} else {
|
||||
tabChange(0)
|
||||
if (val.scrollTop > 80) {
|
||||
isScroll.value = true;
|
||||
} else {
|
||||
isScroll.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
uni.setStorageSync('homeTabIndex', null)
|
||||
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
getNewsList()
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
if (
|
||||
uni.getStorageSync("homeTabIndex") == 1 ||
|
||||
uni.getStorageSync("homeTabIndex") == 2
|
||||
) {
|
||||
tabChange(uni.getStorageSync("homeTabIndex"));
|
||||
} else {
|
||||
tabChange(0);
|
||||
}
|
||||
|
||||
uni.setStorageSync("homeTabIndex", null);
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
getNewsList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
|
|
@ -1,17 +1,74 @@
|
|||
<template>
|
||||
<view class="all">
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view :style="{ height: getNavHeight() + 'px' }"></view>
|
||||
<!-- <view :style="{ height: getNavHeight() + 'px' }"></view> -->
|
||||
<!-- #endif -->
|
||||
|
||||
<PageHeaderView :title="type == 0 ? '热门行业池Top10' : '风口概念池Top10'"></PageHeaderView>
|
||||
<!-- <PageHeaderView
|
||||
:title="type == 0 ? '热门行业池Top10' : '风口概念池Top10'"
|
||||
></PageHeaderView> -->
|
||||
|
||||
<image
|
||||
class="top_bk"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/top_bg.png"
|
||||
></image>
|
||||
|
||||
<view class="content">
|
||||
<view
|
||||
:style="{
|
||||
height: getNavHeight() + 'px',
|
||||
backgroundColor: isScroll ? '#fff' : 'transparent',
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: '999999',
|
||||
}"
|
||||
></view>
|
||||
|
||||
<view
|
||||
:style="{
|
||||
position: 'sticky',
|
||||
top: getNavHeight() + 'px',
|
||||
backgroundColor: isScroll ? '#fff' : 'transparent',
|
||||
zIndex: '9999',
|
||||
}"
|
||||
>
|
||||
<view class="r_sreach">
|
||||
<!-- <image
|
||||
class="logo_text"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/logo_text_icon.png"
|
||||
>
|
||||
</image> -->
|
||||
|
||||
<u-icon
|
||||
name="arrow-left"
|
||||
color="#333"
|
||||
size="22"
|
||||
@click="goBack"
|
||||
></u-icon>
|
||||
|
||||
<view class="sreach" @click="goSreach">
|
||||
<view class="sreach_icon">
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/icon_search_line.png"
|
||||
></image>
|
||||
</view>
|
||||
<view class="sreach_text">
|
||||
<text>搜索资讯</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 类目标签 start -->
|
||||
<view class="page_content">
|
||||
<view class="tag_list">
|
||||
<view :class="['tag_item', clickTagIndex == index ? tagClickedClass : '']" class="tag_item"
|
||||
v-for="(item, index) in tagList" :key="index" @click="clickTag(index)">
|
||||
<view
|
||||
:class="['tag_item', clickTagIndex == index ? tagClickedClass : '']"
|
||||
class="tag_item"
|
||||
v-for="(item, index) in tagList"
|
||||
:key="index"
|
||||
@click="clickTag(index)"
|
||||
>
|
||||
{{ item.content }}
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -20,21 +77,57 @@
|
|||
|
||||
<!-- 列表 start -->
|
||||
<view class="list">
|
||||
<view v-for="(item, index) in list" :key="index" class="news-item" @click="goDetail(item)">
|
||||
<view
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
class="news-item"
|
||||
@click="goDetail(item)"
|
||||
>
|
||||
<view class="news-content">
|
||||
<text style="">
|
||||
<text class="news-title">{{ item.title.slice(0, 3) }}</text>
|
||||
<text :class="['news-title', isLogin ? '' : 'mohu']">{{
|
||||
item.title.slice(3, item.title.length)
|
||||
}}</text>
|
||||
</text>
|
||||
|
||||
|
||||
<text class="news-title">{{ item.title }}</text>
|
||||
<text class="news-desc">{{ item.summary }}</text>
|
||||
<view class="news-meta">
|
||||
<!-- <text class="news-title">{{ item.title }}</text> -->
|
||||
<!-- <text class="news-desc">{{ item.summary }}</text> -->
|
||||
<text :class="['news-desc', isLogin ? '' : 'mohu']">{{
|
||||
item.summary
|
||||
}}</text>
|
||||
<view :class="['news-meta', isLogin ? '' : 'mohu']">
|
||||
<view>
|
||||
<text class="source">{{ item.tag }}</text>
|
||||
<text class="time">{{ item.time }}</text>
|
||||
</view>
|
||||
|
||||
<view class="r_option">
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/eye_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.readNums }}</text>
|
||||
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/like_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.likeNums }}</text>
|
||||
|
||||
<image
|
||||
class="option_icon"
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_icon%402x.png"
|
||||
></image>
|
||||
<text class="option_text">{{ item.shareNums }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表 end -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -54,8 +147,9 @@ import { getListByTag, getListByTagIndustry } from "@/api/detail";
|
|||
|
||||
import dayjs from "dayjs/esm/index";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { getNavHeight } from "@/utils/util"
|
||||
import { getNavHeight } from "@/utils/util";
|
||||
|
||||
const isLogin = ref(uni.getStorageSync("token"));
|
||||
// const props = defineProps({
|
||||
// type: {
|
||||
// type: String,
|
||||
|
|
@ -106,7 +200,6 @@ async function getTopConcept_dFn() {
|
|||
topConceptList.value = await getTopConcept_d({});
|
||||
}
|
||||
|
||||
|
||||
const list = ref([]);
|
||||
async function getListByTagFn() {
|
||||
let id = 0;
|
||||
|
|
@ -116,7 +209,7 @@ async function getListByTagFn() {
|
|||
} else {
|
||||
id = topConceptList.value[clickTagIndex.value].content;
|
||||
}
|
||||
console.log("🚀 ~ getListByTagFn ~ id:", id)
|
||||
console.log("🚀 ~ getListByTagFn ~ id:", id);
|
||||
|
||||
uni.showLoading();
|
||||
if (props.type == 1) {
|
||||
|
|
@ -139,19 +232,38 @@ async function getListByTagFn() {
|
|||
}
|
||||
|
||||
function goDetail(item) {
|
||||
if (uni.getStorageSync("token")) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/detail/indexNewsInfo?id=" + item.id,
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/indexMini",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function goSreach() {
|
||||
if (uni.getStorageSync("token")) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/sreachReq/index",
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/indexMini",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
const tagClickedClass = ref("");
|
||||
|
||||
const props = reactive({
|
||||
|
||||
})
|
||||
const props = reactive({});
|
||||
|
||||
onLoad(async (e) => {
|
||||
props.type = e.type
|
||||
props.type = e.type;
|
||||
if (e.type && e.type == 0) {
|
||||
// 热门行业池
|
||||
tagClickedClass.value = "tag_item_act_blue";
|
||||
|
|
@ -171,16 +283,17 @@ onLoad(async (e) => {
|
|||
}
|
||||
|
||||
getListByTagFn();
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
});
|
||||
|
||||
onMounted(async () => {});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.page_content {
|
||||
padding: 0 30rpx;
|
||||
background-color: white;
|
||||
padding-top: 10rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.tag_list {
|
||||
|
|
@ -212,8 +325,8 @@ onMounted(async () => {
|
|||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
color: #AF201E;
|
||||
background-color: #FAF3F2;
|
||||
color: #af201e;
|
||||
background-color: #faf3f2;
|
||||
}
|
||||
|
||||
.tag_item_act_yellow {
|
||||
|
|
@ -223,8 +336,8 @@ onMounted(async () => {
|
|||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
color: #AF201E;
|
||||
background-color: #FAF3F2;
|
||||
color: #af201e;
|
||||
background-color: #faf3f2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -300,4 +413,88 @@ onMounted(async () => {
|
|||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.mohu {
|
||||
filter: blur(7rpx);
|
||||
}
|
||||
|
||||
.r_option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10rpx;
|
||||
|
||||
.option_icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.option_text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #192236;
|
||||
line-height: 33rpx;
|
||||
text-align: justify;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.top_bk {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
z-index: 99999;
|
||||
padding-bottom: 300rpx;
|
||||
.r_sreach {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.logo_text {
|
||||
width: 88rpx;
|
||||
height: 45rpx;
|
||||
}
|
||||
|
||||
.sreach {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 100rpx;
|
||||
width: 47vw;
|
||||
height: 68rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.sreach_icon {
|
||||
margin-right: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.sreach_text {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 33rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,40 +1,78 @@
|
|||
<template>
|
||||
<view class="sreachcss">
|
||||
<view :style="{ height: getNavHeight() + 'px', position: 'sticky', top: 0, background: '#fff', zIndex: '9999' }">
|
||||
<view
|
||||
:style="{
|
||||
height: getNavHeight() + 'px',
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
background: '#fff',
|
||||
zIndex: '9999',
|
||||
}"
|
||||
>
|
||||
</view>
|
||||
|
||||
<!-- 导航栏 start -->
|
||||
<view class="custom-bav-bar"
|
||||
:style="{ position: 'sticky', top: getNavHeight() + 'px', left: 0, background: '#fff', zIndex: '9999' }">
|
||||
|
||||
<view
|
||||
class="custom-bav-bar"
|
||||
:style="{
|
||||
position: 'sticky',
|
||||
top: getNavHeight() + 'px',
|
||||
left: 0,
|
||||
background: '#fff',
|
||||
zIndex: '9999',
|
||||
}"
|
||||
>
|
||||
<view class="left">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/static/icon_left.png" class="back_icon"
|
||||
@click="handleBack" />
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/static/icon_left.png"
|
||||
class="back_icon"
|
||||
@click="handleBack"
|
||||
/>
|
||||
</view>
|
||||
<view class="center">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/detail_logo.png" class="logo_icon" />
|
||||
<image
|
||||
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/detail_logo.png"
|
||||
class="logo_icon"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 搜索 start -->
|
||||
<view class="sreach">
|
||||
<view style="width: 70vw; margin-left: 50rpx">
|
||||
<u-input v-model="keyWord" @change="handleChange" prefixIcon="search" style="flex: 1" placeholder="搜索快讯"
|
||||
class="sreach_input" :border="false" />
|
||||
<view style="width: 75vw; margin-left: 50rpx">
|
||||
<u-input
|
||||
v-model="keyWord"
|
||||
@change="handleChange"
|
||||
confirm-type="search"
|
||||
@confirm="getData()"
|
||||
prefixIcon="search"
|
||||
style="flex: 1"
|
||||
placeholder="搜索资讯"
|
||||
class="sreach_input"
|
||||
:border="false"
|
||||
/>
|
||||
</view>
|
||||
<text class="serach_btn" @click="getData()">搜索</text>
|
||||
</view>
|
||||
<!-- 搜索 end -->
|
||||
|
||||
<List :data="screenList" @onClick="handleSwiperJump" v-if="screenList.length !== 0" />
|
||||
<List
|
||||
:data="screenList"
|
||||
@onClick="handleSwiperJump"
|
||||
v-if="screenList.length !== 0"
|
||||
/>
|
||||
<!-- 列表 end -->
|
||||
<!-- 加载更多的按钮 -->
|
||||
<!-- <view class="onLoad-btn" @click="onload" v-if="finish === false && inputValue">加载更多</view> -->
|
||||
|
||||
<view style="margin-top: 20vh">
|
||||
<u-empty v-if="screenList.length === 0" text="无搜索结果" width="157" height="50"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/nosearch_icon%E5%A4%87%E4%BB%BD%402x.png"></u-empty>
|
||||
|
||||
<u-empty
|
||||
v-if="screenList.length === 0"
|
||||
text="无搜索结果"
|
||||
width="157"
|
||||
height="50"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/nosearch_icon%E5%A4%87%E4%BB%BD%402x.png"
|
||||
></u-empty>
|
||||
</view>
|
||||
|
||||
<!-- <view v-if="finish && screenList.length > 0" class="noMore">
|
||||
|
|
@ -47,8 +85,11 @@
|
|||
<Pay :show="payShow" @onClick="handleClose" @handleSub="handleSub" />
|
||||
|
||||
<!-- 登录弹框 -->
|
||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" />
|
||||
<LoginPopup
|
||||
:show="LoginShow"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -63,7 +104,6 @@ import LoginPopup from "@/components/loginPopup/index.vue";
|
|||
import Pay from "@/components/pay/index.vue";
|
||||
import { getNavHeight } from "@/utils/util";
|
||||
|
||||
|
||||
const articleList = ref([]);
|
||||
const finish = ref(false);
|
||||
const screenList = ref([]);
|
||||
|
|
@ -99,7 +139,6 @@ const handleSub = async () => {
|
|||
item.needpay = false;
|
||||
}
|
||||
|
||||
|
||||
return item;
|
||||
});
|
||||
articleList.value = articleResult;
|
||||
|
|
@ -141,14 +180,23 @@ const handleShowPay = (type) => {
|
|||
// 点击轮播图进入详情
|
||||
const handleSwiperJump = (item: any) => {
|
||||
console.log("item ===>", item);
|
||||
if (item.needpay) {
|
||||
// 需要先弹出订阅的弹框
|
||||
handleShowPay(item.type);
|
||||
} else {
|
||||
if (uni.getStorageSync("token")) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/detail/indexNewsInfo?id=${item.id}&type=${item.type}`,
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/indexMini",
|
||||
});
|
||||
}
|
||||
// if (item.needpay) {
|
||||
// // 需要先弹出订阅的弹框
|
||||
// handleShowPay(item.type);
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/detail/indexNewsInfo?id=${item.id}&type=${item.type}`,
|
||||
// });
|
||||
// }
|
||||
};
|
||||
|
||||
const handleChange = (val: string) => {
|
||||
|
|
@ -194,9 +242,11 @@ const getData = async () => {
|
|||
`<text style="color: #E7303F">$&</text>`
|
||||
);
|
||||
|
||||
item.title = item.title.replace(keyWord.value, '<span style="color: red;">' + keyWord.value + '</span>');
|
||||
console.log("🚀 ~ getData ~ item.title :", item.title)
|
||||
|
||||
item.title = item.title.replace(
|
||||
keyWord.value,
|
||||
'<span style="color: red;">' + keyWord.value + "</span>"
|
||||
);
|
||||
console.log("🚀 ~ getData ~ item.title :", item.title);
|
||||
|
||||
item.MarkInRedContent =
|
||||
item.contentText &&
|
||||
|
|
@ -229,7 +279,7 @@ onShow(() => {
|
|||
.sreachcss {
|
||||
min-height: 100vh;
|
||||
background-color: #ffffff;
|
||||
padding: 0 30rpx;
|
||||
// padding: 0 30rpx;
|
||||
|
||||
.sreach {
|
||||
display: flex;
|
||||
|
|
@ -296,7 +346,6 @@ onShow(() => {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.custom-bav-bar {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
|
|
@ -337,10 +386,9 @@ onShow(() => {
|
|||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #D13E3C;
|
||||
color: #d13e3c;
|
||||
line-height: 45rpx;
|
||||
text-align: right;
|
||||
font-style: normal;
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,12 @@
|
|||
<!-- 列表区域 -->
|
||||
<!-- @click="jump(item)" -->
|
||||
<view class="colListContainer">
|
||||
<view class="colListItem" v-for="item in data" :key="item.id" @click="jump(item)">
|
||||
<view
|
||||
class="colListItem"
|
||||
v-for="item in data"
|
||||
:key="item.id"
|
||||
@click="jump(item)"
|
||||
>
|
||||
<view class="ItemLeft">
|
||||
<view class="colName">{{ item.name }}</view>
|
||||
<view class="colDesc">{{ item.desc }}</view>
|
||||
|
|
@ -53,7 +58,9 @@ const formatData = (data: any) => {
|
|||
if (data.indexOf(item.type) !== -1) {
|
||||
return {
|
||||
...item,
|
||||
validTime: formatTime(new Date().getTime() + 1000 * 60 * 60 * 24 * 30),
|
||||
validTime: formatTime(
|
||||
new Date().getTime() + 1000 * 60 * 60 * 24 * 30
|
||||
),
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
@ -135,7 +142,8 @@ const colList = ref([
|
|||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.flashBack {}
|
||||
.flashBack {
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: var(--h1-font-size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue