diff --git a/src/api/detail.ts b/src/api/detail.ts
index 5ec65ed..71b61cc 100644
--- a/src/api/detail.ts
+++ b/src/api/detail.ts
@@ -1,4 +1,4 @@
-import request from "@/utils";
+import request from "@/utils/index";
/**
* 获取文章详情
@@ -33,10 +33,11 @@ export const fetchArticleFavorate = (data: any) => {
// 热门行业
export const getListByTagIndustry = (data: any) => {
- return request.get(`/news/list/industry?name=${data.name}`);
+ console.log("🚀 ~ getListByTagIndustry ~ data:", data)
+ return request.get("/news/list/industry", { name: data.name });
};
// 概念标签
export const getListByTag = (data: any) => {
- return request.get(`/news/list/tag?name=${data.name}`);
+ return request.get("/news/list/tag", { name: data.name });
};
\ No newline at end of file
diff --git a/src/components/RankListMini.vue b/src/components/RankListMini.vue
index d9a7ef6..7b45acd 100644
--- a/src/components/RankListMini.vue
+++ b/src/components/RankListMini.vue
@@ -4,7 +4,16 @@
- {{ index + 1 }}
+
+
+
+
+
+
+
+
+
+ {{ index + 1 }}
@@ -18,9 +27,9 @@
dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss")
}}
-
+
@@ -33,8 +42,8 @@
-
+
@@ -159,7 +168,7 @@ const handlePopupErrorCallback = () => {
text-align: left;
font-style: normal;
- img {
+ image {
width: 33rpx;
height: 41rpx;
margin-top: -10rpx;
@@ -167,11 +176,30 @@ const handlePopupErrorCallback = () => {
}
.rank-text {
- font-family: PingFangSC, PingFang SC;
- font-weight: bold;
- font-size: 28rpx;
- color: #e98254;
+ // font-family: PingFangSC, PingFang SC;
+ // font-weight: bold;
+ // font-size: 28rpx;
+ // color: #e98254;
+ width: 32rpx;
+ height: 30rpx;
+
margin-top: -20rpx;
+
+ background: #f5f5f5;
+ border-radius: 8rpx;
+
+ font-family: AvantiBold;
+ font-size: 24rpx;
+ color: #5A5A5A;
+ line-height: 26rpx;
+ text-align: left;
+ font-style: normal;
+
+ display: flex;
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+
}
.news-content {
diff --git a/src/components/article/indexNewsInfo.vue b/src/components/article/indexNewsInfo.vue
index 37481e5..1b68820 100644
--- a/src/components/article/indexNewsInfo.vue
+++ b/src/components/article/indexNewsInfo.vue
@@ -43,9 +43,14 @@
-
-
+ -->
+
+
+
@@ -92,6 +93,8 @@ 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 PageHeaderView from "@/components/PageHeaderView.vue";
+
const stores = useShareStore();
const curPages = getCurrentPages();
diff --git a/src/components/mini/Tabbar.vue b/src/components/mini/Tabbar.vue
index 129e1db..64d517e 100644
--- a/src/components/mini/Tabbar.vue
+++ b/src/components/mini/Tabbar.vue
@@ -2,21 +2,22 @@
- 首页
+ 海外资讯
- 全部
+ src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png"
+ class="tabbar_img" />
+ 全部
@@ -38,12 +39,15 @@ onMounted(async () => { });
+
diff --git a/src/config/index.ts b/src/config/index.ts
index 1dce34a..1520d10 100644
--- a/src/config/index.ts
+++ b/src/config/index.ts
@@ -1,4 +1,5 @@
// const baseURL = "http://192.168.31.25:8060/api";
+// export const baseUrl = "http://192.168.3.38:8040/apih5";
export const baseUrl = "https://cankao.cs.com.cn/apih5";
export const baseUrlDataV = "https://cankao.cs.com.cn/zzck_datav";
diff --git a/src/pages.json b/src/pages.json
index a97dd9b..e155aeb 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -7,7 +7,11 @@
"pages": [
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
- "path": "pages/minihome/index"
+ "path": "pages/minihome/index",
+ "style": {
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": true
+ }
},
{
"path": "pages/realtimeInfo/index"
@@ -18,6 +22,9 @@
{
"path": "pages/login/index"
},
+ {
+ "path": "pages/realtimeInfo/rankDetail"
+ },
{
"path": "pages/home/index",
"style": {
@@ -52,9 +59,6 @@
{
"path": "pages/worldlyAffairs/index"
},
- {
- "path": "pages/realtimeInfo/rankDetail"
- },
{
"path": "pages/realtimeInfo/home"
},
diff --git a/src/pages/detail/indexNewsInfo.vue b/src/pages/detail/indexNewsInfo.vue
index 65d0c49..eca0a69 100644
--- a/src/pages/detail/indexNewsInfo.vue
+++ b/src/pages/detail/indexNewsInfo.vue
@@ -1,5 +1,7 @@
+
+
@@ -47,6 +49,9 @@ import Column from "@/components/column/index.vue";
import Comment from "@/components/comment/index.vue";
import { useShareStore } from "@/stores/shareStore";
import { Session } from "@/utils/storage";
+import { getNavHeight } from "@/utils/util"
+
+
const stores = useShareStore();
const curPages = getCurrentPages();
diff --git a/src/pages/minihome/index.vue b/src/pages/minihome/index.vue
index 342804c..a1b978e 100644
--- a/src/pages/minihome/index.vue
+++ b/src/pages/minihome/index.vue
@@ -1,11 +1,46 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索资讯
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
@@ -18,32 +53,106 @@ 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 { onShow } from "@dcloudio/uni-app";
+import { getNavHeight } from "@/utils/util"
+
+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',
+]);
const newsList = ref([]);
// 概念标签贴标
async function getNewsList() {
newsList.value = await getTopNews({});
+ uni.stopPullDownRefresh()
}
const tabIndex = ref(0);
function tabChange(index) {
+
tabIndex.value = index;
switch (index) {
case 0:
getNewsList()
break;
+ case 1:
+
+ break;
+
}
}
+onShow(() => {
+ tabChange(0)
+})
+
onMounted(async () => {
getNewsList()
});
-
+
diff --git a/src/pages/realtimeInfo/rankDetail.vue b/src/pages/realtimeInfo/rankDetail.vue
index 66cf184..840350c 100644
--- a/src/pages/realtimeInfo/rankDetail.vue
+++ b/src/pages/realtimeInfo/rankDetail.vue
@@ -1,19 +1,17 @@
-
+
+
+
+
+
+
-
+
{{ item.content }}
@@ -22,12 +20,7 @@
-
+
{{ item.title }}
{{ item.summary }}
@@ -58,17 +51,19 @@ import {
import { getListByTag, getListByTagIndustry } from "@/api/detail";
import dayjs from "dayjs/esm/index";
+import { onLoad } from "@dcloudio/uni-app";
+import { getNavHeight } from "@/utils/util"
-const props = defineProps({
- type: {
- type: String,
- default: () => 0,
- },
- index: {
- type: String,
- default: () => 0,
- },
-});
+// const props = defineProps({
+// type: {
+// type: String,
+// default: () => 0,
+// },
+// index: {
+// type: String,
+// default: () => 0,
+// },
+// });
const clickTagIndex = ref(0);
@@ -109,6 +104,7 @@ async function getTopConcept_dFn() {
topConceptList.value = await getTopConcept_d({});
}
+
const list = ref([]);
async function getListByTagFn() {
let id = 0;
@@ -118,6 +114,8 @@ async function getListByTagFn() {
} else {
id = topConceptList.value[clickTagIndex.value].content;
}
+ console.log("🚀 ~ getListByTagFn ~ id:", id)
+
uni.showLoading();
if (props.type == 1) {
// id = 1125;
@@ -145,8 +143,14 @@ function goDetail(item) {
}
const tagClickedClass = ref("");
-onMounted(async () => {
- if (props.type && props.type == 0) {
+
+const props = reactive({
+
+})
+
+onLoad(async (e) => {
+ props.type = e.type
+ if (e.type && e.type == 0) {
// 热门行业池
tagClickedClass.value = "tag_item_act_blue";
// 热门行业top10
@@ -160,11 +164,15 @@ onMounted(async () => {
tagList.value = topConceptList.value;
}
- if (props.index) {
+ if (e.index) {
clickTagIndex.value = props.index;
}
getListByTagFn();
+})
+
+onMounted(async () => {
+
});
@@ -254,11 +262,16 @@ onMounted(async () => {
text-align: left;
font-style: normal;
- display: -webkit-box; /* 设置为WebKit内核的弹性盒子模型 */
- -webkit-box-orient: vertical; /* 垂直排列 */
- -webkit-line-clamp: 2; /* 限制显示三行 */
- overflow: hidden; /* 隐藏超出范围的内容 */
- text-overflow: ellipsis; /* 使用省略号 */
+ display: -webkit-box;
+ /* 设置为WebKit内核的弹性盒子模型 */
+ -webkit-box-orient: vertical;
+ /* 垂直排列 */
+ -webkit-line-clamp: 2;
+ /* 限制显示三行 */
+ overflow: hidden;
+ /* 隐藏超出范围的内容 */
+ text-overflow: ellipsis;
+ /* 使用省略号 */
}
.news-meta {
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 6272323..e54a949 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -10,10 +10,13 @@ Request.interceptors.request((request: any) => {
request.header["content-type"] = request.header.contentType;
delete request.header.contentType;
}
- if (request.method === "GET") {
- request.data = qs.stringify(request.data);
- request.url = request.url + "?" + request.data;
- }
+ // if (request.method === "GET") {
+ // request.data = qs.stringify(request.data);
+ console.log("🚀 ~ request.data:", request.data)
+ // request.url = request.url + "?" + request.data;
+ // }
+
+
return request;
});
diff --git a/src/utils/requestClass.ts b/src/utils/requestClass.ts
index 4314615..0a5abf7 100644
--- a/src/utils/requestClass.ts
+++ b/src/utils/requestClass.ts
@@ -21,6 +21,7 @@ class requestClass {
// 拦截器
interceptors = {
request: (func: Fn) => {
+ console.log("🚀 ~ requestClass ~ func:", func)
if (func) {
requestClass[requestBefore] = func;
} else {
@@ -55,7 +56,14 @@ class requestClass {
options.url = requestClass[isCompleteURL](options.url)
? options.url
: options.baseURL + options.url;
- options.data = options.data;
+
+ // 新增:如果是GET请求且data为空对象,则删除data
+ if (options.method === 'GET' && options.data && Object.keys(options.data).length === 0) {
+ delete options.data;
+ } else {
+ options.data = options.data;
+ }
+
options.header = { ...options.header, ...this[config].header };
options.method = options.method || this[config].method;
@@ -69,17 +77,6 @@ class requestClass {
reject(requestClass[requestAfter](err));
};
uni.request(options);
- // 中断请求实现方法
- // let obj: any = {}
- // obj[request.url] = uni.request(options)
- // abortRequest() {
- // for (const key in obj) {
- // if (Object.prototype.hasOwnProperty.call(obj, key)) {
- // const element = obj[key];
- // element.abort()
- // }
- // }
- // }
});
}
diff --git a/src/utils/util.ts b/src/utils/util.ts
index 4bf1696..95b68fa 100644
--- a/src/utils/util.ts
+++ b/src/utils/util.ts
@@ -82,3 +82,14 @@ export const jumpUrl = (url) => {
};
+export function getNavHeight() {
+ const systemInfo = uni.getSystemInfoSync();
+ console.log(systemInfo);
+ const statusBarHeight = systemInfo.statusBarHeight; // 状态栏高度
+ const navigationBarHeight = systemInfo.platform === 'android' ? statusBarHeight + 48 : statusBarHeight + 44; // 通常安卓底部有48px的导航栏,iOS是44px
+ console.log('状态栏高度:', statusBarHeight);
+ console.log('导航栏高度:', navigationBarHeight);
+
+ return statusBarHeight
+
+}
\ No newline at end of file