diff --git a/src/api/index.ts b/src/api/index.ts
index 95188c7..09e250a 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -106,3 +106,22 @@ export const getMacroList = (data: any) => {
return Request.get("/news/globalMacroList", { params: data });
};
+// 我关注的行业
+export const getMyIndustries = (data: any) => {
+ return Request.get("/user/industries", { params: data });
+};
+
+// 我关注的风口
+export const getMyTags = () => {
+ return Request.get("/user/tags");
+};
+
+// 配置我关注的行业
+export const updateMyIndustries = (data: any) => {
+ return Request.post("/user/industries", data);
+};
+
+// 配置我关注的风口
+export const updateMyTags = (data: any) => {
+ return Request.post("/user/tags", data);
+};
\ No newline at end of file
diff --git a/src/pages/concept/components/CustomView.vue b/src/pages/concept/components/CustomView.vue
index e808649..ec2692f 100644
--- a/src/pages/concept/components/CustomView.vue
+++ b/src/pages/concept/components/CustomView.vue
@@ -1,5 +1,5 @@
-
+
@@ -22,97 +22,198 @@
borderRadius: '36rpx',
background: '#F3F5F8',
}"
+ clearable
+ @confirm="handleSearchTag"
/>
-
+
我的风口
已选
- 4
+ {{ myTagList.length }}
/10
-
-
- 非银金融-证券
-
-
-
- 电子-半导体
-
-
-
- 计算机-软件开发
-
-
-
- 汽车-乘用车
-
-
-
- 非银金融-证券
-
-
-
- 非银金融-证券
-
+
+
+ {{ item.name }}
+
- 暂无自选,请从下方添加
+ 暂无自选,请从下方添加
- 预期风口
-
+ 推荐行业
+
换一换
-
-
- 非银金融-证券
-
-
- 非银金融-证券
-
-
- 非银金融-证券
-
-
- 非银金融-证券
+
+
+ {{ item.content }}
+
-
diff --git a/src/pages/concept/index.vue b/src/pages/concept/index.vue
index 2955c12..72892b4 100644
--- a/src/pages/concept/index.vue
+++ b/src/pages/concept/index.vue
@@ -1,64 +1,20 @@
-
+
-
+
-
-
-
-
-
- 风口概念
- 管理
-
-
-
-
-
-
-
-
-
-
-
-
- 非银金融-证券
- 热门行业近一个月排名第5
-
-
-
-
-
-
- {{ item.title }}
-
-
-
- {{ item.summary }}
-
-
- {{ item.tag }}
- {{ item.time }}
-
-
-
-
+
{
- uni.navigateBack({
- delta: 1,
+const isShowCustom = ref(false);
+
+const handleChangeTag = async (item: any) => {
+ const params = item.map((tag: any) => {
+ const _tag = tag.name.split("-");
+ return {
+ primaryName: _tag[0],
+ secondaryName: _tag[1],
+ };
});
+ const result = await updateMyTags(params);
+ if (result.code === 200) {
+ getTagList();
+ handleHideCustom();
+ }
+};
+
+const handleShowCustom = () => {
+ isShowCustom.value = true;
+};
+const handleHideCustom = () => {
+ isShowCustom.value = false;
+};
+
+const tagList = ref([]);
+
+const getTagList = async () => {
+ const result = await getMyTags();
+ if (result.code === 200) {
+ tagList.value = result.data.map((item: any) => {
+ return {
+ name: item.primaryName + "-" + item.secondaryName,
+ };
+ });
+ } else {
+ tagList.value = [];
+ }
+
+ if (tagList.value.length === 0) {
+ handleShowCustom();
+ }
};
const userStore = useUserStore();
-// 未登录|试用,显示蒙层
-const isMask = computed(() => {
- return !userStore.isUserType;
-});
-
const LoginShow = ref(false);
// 显示弹框
const handleShowLogin = () => {
@@ -111,206 +92,26 @@ const handleLoginCancel = () => {
// 登录成功之后的回调
const handleLoginSuccess = () => {
LoginShow.value = false;
+ getTagList();
};
// 登录失败之后的回调
const handleLoginError = () => {
console.log("登录失败");
};
-// 跳转详情
-function goDetail(item: any) {
- if (!userStore.isLogin) {
- handleShowLogin();
- return;
- }
-
- // 试用账号
- if (!userStore.isUserType) {
- return;
- }
-
- uni.navigateTo({
- url: `/pages/detail/indexNewsInfo?id=${item.id}`,
- });
-}
-
-const data = ref([]);
-const getList = async () => {
- const name = "电子-半导体";
- const result = await getListByTagIndustry({ name });
- if (result.code === 200) {
- data.value = result.data;
- } else {
- data.value = [];
- }
-};
onMounted(async () => {
if (!userStore.isLogin) {
handleShowLogin();
+ return;
}
- getList();
+ getTagList();
});
diff --git a/src/pages/industry/components/List.vue b/src/pages/industry/components/List.vue
index 097858f..db1918f 100644
--- a/src/pages/industry/components/List.vue
+++ b/src/pages/industry/components/List.vue
@@ -36,8 +36,8 @@
- 非银金融-证券
- 热门行业近一个月排名第5
+ {{tagList[current]?.name}}
+ 热门行业近一个月排名Top5
diff --git a/src/pages/industry/index.vue b/src/pages/industry/index.vue
index f91b83e..5851c94 100644
--- a/src/pages/industry/index.vue
+++ b/src/pages/industry/index.vue
@@ -31,15 +31,25 @@
import { useUserStore } from "@/stores/user";
import { computed, onMounted, ref } from "vue";
import LoginDialog from "@/components/loginPopup/index.vue";
-import { getListByTagIndustry } from "@/api/detail";
import CustomView from "./components/CustomView.vue";
import List from "./components/List.vue";
+import { getMyIndustries, updateMyIndustries } from "@/api";
const isShowCustom = ref(false);
-const handleChangeTag = (item: any) => {
- console.log("output >>>>> item", item);
- handleHideCustom();
+const handleChangeTag = async (item: any) => {
+ const params = item.map((tag: any) => {
+ const _tag = tag.name.split("-");
+ return {
+ primaryName: _tag[0],
+ secondaryName: _tag[1],
+ };
+ });
+ const result = await updateMyIndustries(params);
+ if (result.code === 200) {
+ getTagList();
+ handleHideCustom();
+ }
};
const handleShowCustom = () => {
@@ -52,23 +62,20 @@ const handleHideCustom = () => {
const tagList = ref([]);
const getTagList = async () => {
- new Promise((resolve) => {
- setTimeout(() => {
- resolve(true);
- }, 1000);
- }).then(() => {
- tagList.value = [
- // { name: "电子-半导体" },
- // { name: "计算机-软件开发" },
- // { name: "汽车-乘用车" },
- // { name: "汽车-汽车零部件" },
- ];
+ const result = await getMyIndustries({});
+ if (result.code === 200) {
+ tagList.value = result.data.map((item: any) => {
+ return {
+ name: item.primaryName + "-" + item.secondaryName,
+ };
+ });
+ } else {
+ tagList.value = [];
+ }
- if(tagList.value.length === 0) {
- handleShowCustom()
-
- }
- });
+ if (tagList.value.length === 0) {
+ handleShowCustom();
+ }
};
const userStore = useUserStore();
diff --git a/src/pages/macroscopic/index.vue b/src/pages/macroscopic/index.vue
index 3354223..292772a 100644
--- a/src/pages/macroscopic/index.vue
+++ b/src/pages/macroscopic/index.vue
@@ -36,7 +36,7 @@
{{ news.source }}
- {{ news.timeStr }}
+ {{ `${item.day} ${news.timeStr}` }}
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 0e96638..eb32eb6 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -23,7 +23,7 @@ service.interceptors.request.use(
// 在发送请求之前做些什么 token
if (Session.get("token")) {
config.headers!["auth-token"] = `${Session.get("token")}`;
- config.headers!["phone"] = `${Session.get("userPhone")}`;
+ config.headers!["phone"] = `${Session.get("userInfos").phone}`;
}
return config;
},