feat: 更新编辑精选功能并优化资讯展示
- 修改编辑精选接口路径 - 启用编辑精选菜单项 - 优化资讯列表和详情页的标签展示逻辑 - 添加关键词高亮功能 - 更新开发环境API地址
This commit is contained in:
parent
258444e317
commit
c0a6629310
|
|
@ -3,9 +3,9 @@ ENV = development
|
|||
|
||||
# 本地环境接口地址
|
||||
# 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://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
|
||||
|
|
@ -57,7 +57,6 @@ export const getUnlockList = (data: any) => {
|
|||
|
||||
|
||||
// 全文搜索
|
||||
//
|
||||
export const searchNews = (data: any) => {
|
||||
return Request.post("/news/search", data);
|
||||
};
|
||||
|
|
@ -70,5 +69,5 @@ export const getReleaseList = (data: any) => {
|
|||
|
||||
// 编辑精选接口
|
||||
export const editTopNews = (data: any) => {
|
||||
return Request.post("/news/top_news_release_h5_d", data);
|
||||
return Request.post("/news/list/published", data);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@
|
|||
<view class="line" v-if="tabIndex == 3"></view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="r_menu_item" @click="tabChange(4)">
|
||||
<view class="r_menu_item" @click="tabChange(4)">
|
||||
<text class="menu_item">编辑精选</text>
|
||||
<view class="line" v-if="tabIndex == 4"></view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view @click="logout" v-if="Session.get('token')">
|
||||
|
|
|
|||
|
|
@ -19,27 +19,29 @@
|
|||
<text class="time"> {{ infoData?.publishTime }}</text>
|
||||
</view>
|
||||
|
||||
<view class="abstract">
|
||||
<view class="abstract" v-if="infoData?.summary">
|
||||
{{ infoData?.summary }}
|
||||
</view>
|
||||
|
||||
<!-- 两个标签 start -->
|
||||
<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>
|
||||
<view class="r_tags">
|
||||
<view class="tag" style="background-color: #fff9ec; color: #ffb100" v-for="(item, index) in infoData?.industryLabels" :key="index">{{
|
||||
item
|
||||
}}</view>
|
||||
<view class="tag" style="background-color: #fff9ec; color: #ffb100"
|
||||
v-for="(item, index) in infoData?.industryLabels" :key="index">{{
|
||||
item
|
||||
}}</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>
|
||||
<view class="r_tags">
|
||||
<view class="tag" style="background-color: #f5f8fe; color: #007aff" v-for="(item, index) in infoData?.conceptLabels" :key="index">{{
|
||||
item
|
||||
}}</view>
|
||||
<view class="tag" style="background-color: #f5f8fe; color: #007aff"
|
||||
v-for="(item, index) in infoData?.conceptLabels" :key="index">{{
|
||||
item
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -51,12 +53,8 @@
|
|||
</view> -->
|
||||
</view>
|
||||
|
||||
<LoginPopup
|
||||
:show="LoginShow"
|
||||
mode="center"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
<LoginPopup :show="LoginShow" mode="center" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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>
|
||||
<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"
|
||||
style="margin-left: 40rpx;margin-top: 5rpx;border-radius: 20rpx;">
|
||||
|
||||
|
|
@ -30,12 +30,17 @@
|
|||
|
||||
<view class="list_item_content">
|
||||
<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>
|
||||
<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>
|
||||
</view>
|
||||
|
||||
|
|
@ -70,7 +75,7 @@ import { useRoute, useRouter } from "vue-router";
|
|||
|
||||
const pageSizes = ref([10, 20, 30, 40]);
|
||||
const form = reactive({
|
||||
keyWord: "",
|
||||
keyword: "",
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 10
|
||||
|
|
@ -94,6 +99,9 @@ async function getNewsList() {
|
|||
if (code == 200) {
|
||||
newsList.value = data.list;
|
||||
form.total = data.total;
|
||||
data.list.forEach((item) => {
|
||||
item.summary = item.summary.replace(form.keyword, "<span style='color: red'>" + form.keyword + '</span>');
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 概念标签贴标
|
||||
|
|
@ -102,8 +110,14 @@ async function getNewsList() {
|
|||
}
|
||||
|
||||
function goDetail(item) {
|
||||
let id = null
|
||||
if (pageType.value != 4) {
|
||||
id = item.news_id
|
||||
} else {
|
||||
id = item.id
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pages/realtimeInfo/pc/indexPC?id=" + item.news_id + "&type=1",
|
||||
url: "/pages/realtimeInfo/pc/indexPC?id=" + id + "&type=" + pageType.value,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue