feat: 更新编辑精选功能并优化资讯展示

- 修改编辑精选接口路径
- 启用编辑精选菜单项
- 优化资讯列表和详情页的标签展示逻辑
- 添加关键词高亮功能
- 更新开发环境API地址
This commit is contained in:
34701892@qq.com 2025-11-06 19:15:30 +08:00
parent 258444e317
commit c0a6629310
5 changed files with 37 additions and 26 deletions

View File

@ -3,9 +3,9 @@ ENV = development
# 本地环境接口地址 # 本地环境接口地址
# VITE_API_URL = http://123.60.153.169:8040/apih5 # VITE_API_URL = http://123.60.153.169:8040/apih5
# VITE_API_URL = https://4155gf93ll13.vicp.fun/apih5 VITE_API_URL = http://4155gf93ll13.vicp.fun/apih5
# VITE_API_URL = http://123.60.79.143:8041/apih5 # VITE_API_URL = http://123.60.79.143:8041/apih5
# VITE_API_URL =http://localhost:8040/apih5 # VITE_API_URL =http://localhost:8040/apih5
VITE_API_URL = https://cankao.cs.com.cn/apih5 # VITE_API_URL = https://cankao.cs.com.cn/apih5
VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav

View File

@ -57,7 +57,6 @@ export const getUnlockList = (data: any) => {
// 全文搜索 // 全文搜索
//
export const searchNews = (data: any) => { export const searchNews = (data: any) => {
return Request.post("/news/search", data); return Request.post("/news/search", data);
}; };
@ -70,5 +69,5 @@ export const getReleaseList = (data: any) => {
// 编辑精选接口 // 编辑精选接口
export const editTopNews = (data: any) => { export const editTopNews = (data: any) => {
return Request.post("/news/top_news_release_h5_d", data); return Request.post("/news/list/published", data);
}; };

View File

@ -17,10 +17,10 @@
<view class="line" v-if="tabIndex == 3"></view> <view class="line" v-if="tabIndex == 3"></view>
</view> </view>
<!-- <view class="r_menu_item" @click="tabChange(4)"> <view class="r_menu_item" @click="tabChange(4)">
<text class="menu_item">编辑精选</text> <text class="menu_item">编辑精选</text>
<view class="line" v-if="tabIndex == 4"></view> <view class="line" v-if="tabIndex == 4"></view>
</view> --> </view>
</view> </view>
<view @click="logout" v-if="Session.get('token')"> <view @click="logout" v-if="Session.get('token')">

View File

@ -19,25 +19,27 @@
<text class="time"> {{ infoData?.publishTime }}</text> <text class="time"> {{ infoData?.publishTime }}</text>
</view> </view>
<view class="abstract"> <view class="abstract" v-if="infoData?.summary">
{{ infoData?.summary }} {{ infoData?.summary }}
</view> </view>
<!-- 两个标签 start --> <!-- 两个标签 start -->
<view class="r_tag_two"> <view class="r_tag_two">
<view style="display: flex" v-if="infoData?.conceptLabels && infoData?.conceptLabels.length > 0"> <view style="display: flex" v-if="infoData?.industryLabels && infoData?.industryLabels.length > 0">
<text class="tag_title">行业分类</text> <text class="tag_title">行业分类</text>
<view class="r_tags"> <view class="r_tags">
<view class="tag" style="background-color: #fff9ec; color: #ffb100" v-for="(item, index) in infoData?.industryLabels" :key="index">{{ <view class="tag" style="background-color: #fff9ec; color: #ffb100"
v-for="(item, index) in infoData?.industryLabels" :key="index">{{
item item
}}</view> }}</view>
</view> </view>
</view> </view>
<view style="display: flex" v-if="infoData?.industryLabels && infoData?.industryLabels.length > 0"> <view style="display: flex" v-if="infoData?.conceptLabels && infoData?.conceptLabels.length > 0">
<text class="tag_title">概念标签</text> <text class="tag_title">概念标签</text>
<view class="r_tags"> <view class="r_tags">
<view class="tag" style="background-color: #f5f8fe; color: #007aff" v-for="(item, index) in infoData?.conceptLabels" :key="index">{{ <view class="tag" style="background-color: #f5f8fe; color: #007aff"
v-for="(item, index) in infoData?.conceptLabels" :key="index">{{
item item
}}</view> }}</view>
</view> </view>
@ -51,12 +53,8 @@
</view> --> </view> -->
</view> </view>
<LoginPopup <LoginPopup :show="LoginShow" mode="center" @handlePopupClose="handlePopupClose"
:show="LoginShow" @handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
mode="center"
@handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback"
@handlePopupErrorCallback="handlePopupErrorCallback" />
</view> </view>
</template> </template>

View File

@ -7,7 +7,7 @@
<text class="pageTitle" v-if="pageType != 4">资讯头条榜</text> <text class="pageTitle" v-if="pageType != 4">资讯头条榜</text>
<text class="pageTitle" v-if="pageType == 4">编辑精选</text> <text class="pageTitle" v-if="pageType == 4">编辑精选</text>
<image src="@/assets/zixun/top20_icon.png" class="title_icon" v-if="pageType != 4"></image> <image src="@/assets/zixun/top20_icon.png" class="title_icon" v-if="pageType != 4"></image>
<u-input v-if="pageType == 4" placeholder="请输入搜索内容" v-model="form.keyWord" prefixIcon="search" <u-input v-if="pageType == 4" placeholder="请输入搜索内容" v-model="form.keyword" prefixIcon="search"
prefixIconStyle="font-size: 22px;color: #909399" prefixIconStyle="font-size: 22px;color: #909399"
style="margin-left: 40rpx;margin-top: 5rpx;border-radius: 20rpx;"> style="margin-left: 40rpx;margin-top: 5rpx;border-radius: 20rpx;">
@ -30,12 +30,17 @@
<view class="list_item_content"> <view class="list_item_content">
<text class="item_title" @click="goDetail(item)">{{ item.title }}</text> <text class="item_title" @click="goDetail(item)">{{ item.title }}</text>
<text class="item_summary">{{ item.summary }}</text> <text class="item_summary" v-if="pageType != 4">{{ item.summary }}</text>
<text class="item_summary" v-if="pageType == 4" v-html="item.summary"></text>
<view class="item_bottom"> <view class="item_bottom">
<view> <view>
<text class="time">{{ item.source }}</text> <text class="time">{{ item.source }}</text>
<text class="time" style="margin-left: 30rpx">{{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") <text class="time" style="margin-left: 30rpx" v-if="pageType != 4">{{
dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss")
}}</text>
<text class="time" style="margin-left: 30rpx" v-if="pageType == 4">{{
item.time
}}</text> }}</text>
</view> </view>
@ -70,7 +75,7 @@ import { useRoute, useRouter } from "vue-router";
const pageSizes = ref([10, 20, 30, 40]); const pageSizes = ref([10, 20, 30, 40]);
const form = reactive({ const form = reactive({
keyWord: "", keyword: "",
page: 1, page: 1,
size: 10, size: 10,
total: 10 total: 10
@ -94,6 +99,9 @@ async function getNewsList() {
if (code == 200) { if (code == 200) {
newsList.value = data.list; newsList.value = data.list;
form.total = data.total; form.total = data.total;
data.list.forEach((item) => {
item.summary = item.summary.replace(form.keyword, "<span style='color: red'>" + form.keyword + '</span>');
});
} }
} else { } else {
// //
@ -102,8 +110,14 @@ async function getNewsList() {
} }
function goDetail(item) { function goDetail(item) {
let id = null
if (pageType.value != 4) {
id = item.news_id
} else {
id = item.id
}
uni.navigateTo({ uni.navigateTo({
url: "/pages/realtimeInfo/pc/indexPC?id=" + item.news_id + "&type=1", url: "/pages/realtimeInfo/pc/indexPC?id=" + id + "&type=" + pageType.value,
}); });
} }