no message

This commit is contained in:
A1300399510
2025-10-31 01:28:16 +08:00
parent d4244fc783
commit 91dab6d446
16 changed files with 639 additions and 218 deletions

View File

@@ -0,0 +1,21 @@
// my-component.js
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入Vue 已挂载到 window
const { defineComponent, ref } = Vue;
// 定义组件(直接使用模板)
export const hotTag = defineComponent({
name: "hot-tag",
props: {
itemdata: {
type: Object,
default: () => {},
},
},
setup(props) {
return {};
},
components: {},
template: `<div class="hot-tag"> <div class="hot-tag-title"> <img class="icon" src="./img/triangle-orange.svg" /> 热门标签 </div> <div class="list flexflex"> <div class="item">热门标签</div> </div></div>`,
});

View File

@@ -0,0 +1,10 @@
<div class="hot-tag">
<div class="hot-tag-title">
<img class="icon" src="./img/triangle-orange.svg" />
热门标签
</div>
<div class="list flexflex">
<div class="item">热门标签</div>
</div>
</div>

View File

@@ -52,6 +52,7 @@ export const itemBottom = defineComponent({
return;
}
let data = res.data;
creationAlertBox("success", res.message);
item.value["is_like"] = data.status;
item.value["likes"] = data.likes;
@@ -59,11 +60,10 @@ export const itemBottom = defineComponent({
if (data.status) {
isLikeGif.value = true;
setTimeout(() => (isLikeGif.value = false), 2000);
} else {
creationAlertBox("success", res.message);
// this.triggerEvent("unlike", item.token);
}
if (data.status == 0) cancelOperate("like", token);
// wx.hideLoading();
})
.catch(() => {});
@@ -91,8 +91,7 @@ export const itemBottom = defineComponent({
item.value["collections"] = data.collections;
creationAlertBox("success", res.message);
// 调用父组件的方法
cancelOperate(token);
// this.triggerEvent("uncollect", item.token);
if (data.status == 0) cancelOperate("collection", token);
})
.catch((err) => {
if (err?.code == 401) goLogin();
@@ -106,5 +105,5 @@ export const itemBottom = defineComponent({
like,
},
template: `<div class="comment flexacenter" v-if="item?.commentreviews && !Array.isArray(item?.commentreviews)"> <img class="icon" :src="item?.commentreviews?.avatar" /> <div class="text one-line-display">{{ item?.commentreviews?.content }}</div></div><div class="bottom flexacenter"> <div class="bottom-item like flexacenter" @click="likeClick()" v-if="item?.type != 'tenement'"> <img v-if="item.is_like" class="icon" src="./img/like-red-icon.png" /> <img v-else class="icon" src="./img/like-icon.png" /> <div class="text">{{ item.likes || "赞" }}</div> </div> <div class="bottom-item flexacenter" @click="collectClick()"> <img v-if="item.is_collect" class="icon" src="./img/collect-golden.svg" /> <img v-else class="icon" src="./img/collect-gray.png" /> <div class="text">{{ item.collections || "收藏" }}</div> </div> <div class="bottom-item flexacenter" v-if="item?.type != 'tenement'"> <img class="icon" src="./img/discuss-icon.png" /> <div class="text">{{ item.comments || "讨论" }}</div> </div> <div class="bottom-item flexacenter" v-if="item?.type != 'tenement'"> <img class="icon" src="./img/bi-copper-icon.png" /> <div class="text">{{ item.coins || "投币" }}</div> </div> <div class="bottom-item flexacenter"> <img class="icon" src="./img/share-gray.png" /> <div class="text">转发</div> </div></div><like v-if="isLikeGif"></like>`,
template: `<div class="comment flexacenter" v-if="item?.commentreviews && !Array.isArray(item?.commentreviews)"> <img class="icon" :src="item?.commentreviews?.avatar" /> <div class="text one-line-display">{{ item?.commentreviews?.content || "[图]" }}</div></div> <template v-if="item.comment_list?.length != 0"> <div class="comment flexacenter" style="margin-bottom: 15px;" v-for="(item, index) in item.comment_list" :key="index"> <img class="icon" :src="item.avatar" /> <div class="text one-line-display">{{ item.content || "[图]" }}</div> </div></template><div class="bottom flexacenter"> <div class="bottom-item like flexacenter" @click="likeClick()" v-if="item?.type != 'tenement'"> <img v-if="item.is_like" class="icon" src="./img/like-red-icon.png" /> <img v-else class="icon" src="./img/like-icon.png" /> <div class="text">{{ item.likes || "赞" }}</div> </div> <div class="bottom-item flexacenter" @click="collectClick()"> <img v-if="item.is_collect" class="icon" src="./img/collect-golden.svg" /> <img v-else class="icon" src="./img/collect-gray.png" /> <div class="text">{{ item.collections || "收藏" }}</div> </div> <div class="bottom-item flexacenter" v-if="item?.type != 'tenement'"> <img class="icon" src="./img/discuss-icon.png" /> <div class="text">{{ item.comments || "讨论" }}</div> </div> <div class="bottom-item flexacenter" v-if="item?.type != 'tenement'"> <img class="icon" src="./img/bi-copper-icon.png" /> <div class="text">{{ item.coins || "投币" }}</div> </div> <div class="bottom-item flexacenter"> <img class="icon" src="./img/share-gray.png" /> <div class="text">转发</div> </div></div><like v-if="isLikeGif"></like>`,
});

View File

@@ -1,7 +1,13 @@
<div class="comment flexacenter" v-if="item?.commentreviews && !Array.isArray(item?.commentreviews)">
<img class="icon" :src="item?.commentreviews?.avatar" />
<div class="text one-line-display">{{ item?.commentreviews?.content }}</div>
</div>
<div class="text one-line-display">{{ item?.commentreviews?.content || "[图]" }}</div>
</div>
<template v-if="item.comment_list?.length != 0">
<div class="comment flexacenter" style="margin-bottom: 15px;" v-for="(item, index) in item.comment_list" :key="index">
<img class="icon" :src="item.avatar" />
<div class="text one-line-display">{{ item.content || "[图]" }}</div>
</div>
</template>
<div class="bottom flexacenter">
<div class="bottom-item like flexacenter" @click="likeClick()" v-if="item?.type != 'tenement'">
<img v-if="item.is_like" class="icon" src="./img/like-red-icon.png" />
@@ -20,7 +26,7 @@
<div class="text">{{ item.comments || "讨论" }}</div>
</div>
<div class="bottom-item flexacenter" v-if="item?.type != 'tenement'">
<div class="bottom-item flexacenter" v-if="item?.type != 'tenement'">
<img class="icon" src="./img/bi-copper-icon.png" />
<div class="text">{{ item.coins || "投币" }}</div>
</div>
@@ -31,4 +37,4 @@
</div>
</div>
<like v-if="isLikeGif"></like>
<like v-if="isLikeGif"></like>

View File

@@ -16,7 +16,6 @@ export const itemForum = defineComponent({
setup(props) {
let res = props.itemdata || {};
console.log("res", res);
res.content = res?.content?.replace(/\[.*?\]/g, "");
res.content = res?.content?.replace(/\<.*?\>/g, "");
res.content = res?.content?.replace(/\[.*?\../g, "");

View File

@@ -1394,3 +1394,36 @@ body {
.head-top .post-list .post-item:not(:last-child) {
margin-right: 10px;
}
.hot-tag {
background-color: #ffffff;
border: 1px solid #e9eef2;
border-radius: 10px;
padding: 21px;
}
.hot-tag .hot-tag-title {
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 16px;
color: #000000;
position: relative;
}
.hot-tag .hot-tag-title .icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: -21px;
width: 10px;
height: 18px;
}
.hot-tag .list .item {
line-height: 36px;
color: #333333;
font-size: 14px;
height: 32px;
line-height: 32px;
padding: 0 14px;
background-color: #f6f6f6;
border: #f2f2f2;
border-radius: 16px;
}

View File

@@ -1654,3 +1654,42 @@ body {
}
}
}
.hot-tag {
background-color: rgba(255, 255, 255, 1);
border: 1px solid rgba(233, 238, 242, 1);
border-radius: 10px;
padding: 21px;
.hot-tag-title {
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 16px;
color: #000000;
position: relative;
.icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: -21px;
width: 10px;
height: 18px;
}
}
.list {
.item {
line-height: 36px;
color: #333333;
font-size: 14px;
height: 32px;
line-height: 32px;
padding: 0 14px;
background-color: rgba(246, 246, 246, 1);
border: rgba(242, 242, 242, 1);
border-radius: 16px;
}
}
}

View File

@@ -2,3 +2,61 @@
width: 1200px;
margin: 0 auto;
}
#search .label-title {
margin-bottom: 24px;
}
#search .label-title .icon {
width: 25px;
height: 20px;
margin-right: 12px;
}
#search .label-title .text {
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 28px;
color: #000000;
}
#search .classify {
margin-bottom: 16px;
}
#search .classify .item {
width: 50px;
height: 32px;
line-height: 32px;
text-align: center;
background-color: #ffffff;
border: 1px solid #f2f2f2;
border-radius: 12px;
color: #333333;
cursor: pointer;
font-size: 15px;
}
#search .classify .item.pitch {
background-color: #d35110;
color: #ffffff;
}
#search .classify .item:not(:last-child) {
margin-right: 10px;
}
#search .quantity {
font-size: 14px;
line-height: 26px;
color: #555;
margin-bottom: 14px;
}
#search .quantity .line {
width: 1px;
height: 14px;
background-color: #aaaaaa;
margin: 0 10px;
}
#search .quantity .num {
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
color: #000000;
margin: 0 10px;
}
#search .matter .sidebar-box {
width: 219px;
}

View File

@@ -1,4 +1,77 @@
#search {
width: 1200px;
margin: 0 auto;
.label-title {
margin-bottom: 24px;
.icon {
width: 25px;
height: 20px;
margin-right: 12px;
}
.text {
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
font-style: normal;
font-size: 28px;
color: #000000;
}
}
.classify {
margin-bottom: 16px;
.item {
width: 50px;
height: 32px;
line-height: 32px;
text-align: center;
background-color: rgba(255, 255, 255, 1);
border: 1px solid rgba(242, 242, 242, 1);
border-radius: 12px;
color: #333333;
cursor: pointer;
font-size: 15px;
&.pitch {
background-color: rgba(211, 81, 16, 1);
color: #ffffff;
}
&:not(:last-child) {
margin-right: 10px;
}
}
}
.quantity {
font-size: 14px;
line-height: 26px;
color: #555;
margin-bottom: 14px;
.line {
width: 1px;
height: 14px;
background-color: #aaaaaa;
margin: 0 10px;
}
.num {
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
font-weight: 650;
color: #000000;
margin: 0 10px;
}
}
.matter {
.matter-content {
}
.sidebar-box {
width: 219px;
}
}
}

View File

@@ -1,174 +1,193 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>个人主页</title>
<link rel="stylesheet" href="./css/public.css" />
<link rel="stylesheet" href="./css/homepage-me.css" />
<script src="./js/vue.global.js"></script>
<style>
[v-cloak] {
display: none;
}
</style>
</head>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="./css/public.css" />
<link rel="stylesheet" href="./css/homepage-me.css" />
<script src="./js/vue.global.js"></script>
<style>
[v-cloak] {
display: none;
}
</style>
</head>
<body>
<div class="container" id="homepage-me" v-cloak>
<head-top></head-top>
<body>
<div class="container" id="homepage-me" v-cloak>
<head-top></head-top>
<div class="head-navigation flexacenter">
<img class="icon" src="./img/index-icon.png" />
<a class="text" href="./" target="_blank">首页</a>
<img class="arrows" src="./img/arrows-gray.svg" />
<div class="text">我的主页</div>
</div>
<div class="head-navigation flexacenter">
<img class="icon" src="./img/index-icon.png" />
<a class="text" href="./" target="_blank">首页</a>
<img class="arrows" src="./img/arrows-gray.svg" />
<div class="text">我的主页</div>
</div>
<div class="matter flexflex">
<div class="card-user flexcenter">
<div class="name-area">
<img class="avatar" :src="info.avatar" alt="用户头像" />
<div class="matter flexflex">
<div class="card-user flexcenter">
<div class="name-area">
<img class="avatar" :src="info.avatar" alt="用户头像" />
<h3 class="username flexcenter">{{ info.nickname }}</h3>
<p class="uid flexcenter">
UID: {{ info.uin }}
<img class="icon" @click="copy(info.uin)" src="./img/copy-icon.png" />
</p>
</div>
<div class="bi-box flexacenter">
<img class="bi-masking" src="./img/bi-masking.svg" alt="">
<img class="bi-icon" src="./img/bi-icon.svg" alt="">
<div class="bi-content flex1">
<div class="bi-sum">{{ gtercoin }}</div>
<div class="bi-text">寄托币</div>
<h3 class="username flexcenter">{{ info.nickname }}</h3>
<p class="uid flexcenter">
UID: {{ info.uin }}
<img class="icon" @click="copy(info.uin)" src="./img/copy-icon.png" />
</p>
</div>
<a class="bi-btn flexcenter" target="_blank" :href="introduction">
关于寄托币
<img class="bi-question" src="./img/question-mark.svg" alt="">
</a>
</div>
<div class="medal-area" v-if="medallist.length != 0">
<p class="title">勋章 {{ medallist.length }}</p>
<div class="list flexflex">
<img v-for="item in medallist" :src="item.image" :alt="item.name" class="item" />
<div class="bi-box flexacenter">
<img class="bi-masking" src="./img/bi-masking.svg" alt="" />
<img class="bi-icon" src="./img/bi-icon.svg" alt="" />
<div class="bi-content flex1">
<div class="bi-sum">{{ gtercoin }}</div>
<div class="bi-text">寄托币</div>
</div>
<a class="bi-btn flexcenter" target="_blank" :href="introduction">
关于寄托币
<img class="bi-question" src="./img/question-mark.svg" alt="" />
</a>
</div>
<div class="medal-area" v-if="medallist.length != 0">
<p class="title">勋章 {{ medallist.length }}</p>
<div class="list flexflex">
<img v-for="item in medallist" :src="item.image" :alt="item.name" class="item" />
</div>
</div>
</div>
<div class="matter-content flex1">
<div class="message-box" v-if="true">
<!-- 头部区域 -->
<div class="header">
<img :src="info.avatar" alt="用户头像" class="avatar" />
<span class="username">{{ info.nickname }}</span>
<img v-if="info?.group?.image" class="icon" :src="info?.group?.image" />
</div>
<!-- 信息列表区域 -->
<div class="info-list flexflex">
<div class="item flexacenter">
<span class="label">注册时间</span>
<span class="value">2019-7-26 16:38</span>
</div>
<div class="item flexacenter">
<span class="label">最后登录</span>
<span class="value">2025-10-16 10:32</span>
</div>
<div class="item flexacenter">
<span class="label">在线时长</span>
<span class="value">1304 小时</span>
</div>
<div class="item flexacenter">
<span class="label">上次访问 IP</span>
<span class="value">116.237.182.149 -- 上海长宁区</span>
</div>
<div class="item flexacenter">
<span class="label">Email</span>
<span class="value">skysuper007@qq.com</span>
<span class="status flexacenter">未认证</span>
</div>
<div class="item flexacenter">
<span class="label">手机号</span>
<span class="value">15934271290</span>
<span class="status blue flexacenter">已认证</span>
</div>
<div class="item flexacenter">
<span class="label">累计签到</span>
<span class="value">1341 天</span>
</div>
<div class="item flexacenter">
<span class="label">本月签到</span>
<span class="value">6 天</span>
</div>
<div class="item flexacenter">
<span class="label">寄托币</span>
<span class="value">{{ gtercoin }}</span>
</div>
</div>
<!-- 统计标签区域 -->
<div class="stats flexacenter" v-if="creationType.length != 0">
<template v-for="(item, index) in creationType" :key="index">
<span class="item flexacenter">
<div class="text">{{ item.text }} ×</div>
<div class="num">{{ item.number }}</div>
</span>
<div class="line" v-if="index != creationType.length - 1">|</div>
</template>
</div>
<!-- Offer标签区域 -->
<div class="tags flexflex" v-if="schoolTags.length != 0">
<div class="item flexacenter" v-for="item in schoolTags" :key="item">
<img v-if="item.type == 'offer'" class="icon" src="./img/offer-icon.png" mode="heightFix" />
<img v-else class="icon" src="./img/mj-icon.png" mode="heightFix" />
{{ item.school }}
</div>
</div>
</div>
<div class="list-area">
<div class="operation-box flexacenter">
<div class="operation-item" :class="{ 'pitch': item.type == typeValue }" v-for="item in typeList" :key="item.type" @click="typeChange(item.type)">{{ item.text }}</div>
</div>
<div class="classify flexacenter">
<div class="item" :class="{'pitch': item.type == classify}" v-for="item in classifyList" :key="item.type" @click="classifyChange(item.type)">{{ item.text }}</div>
</div>
<div v-if="typeValue == 'collection'" class="issue-data flexacenter">
<div class="num">{{ total }}</div>
个收藏
</div>
<div v-else-if="typeValue == 'creation'" class="issue-data flexacenter">
<div class="num">{{ total }}</div>
个创作,获得
<div class="num">{{ 000 }}</div>
个赞
</div>
<div v-else-if="typeValue == 'comment'" class="issue-data flexacenter">
<div class="num">{{ total }}</div>
个评论,获得
<div class="num">{{ 000 }}</div>
个赞
</div>
<div v-else-if="typeValue == 'like'" class="issue-data flexacenter">
<div class="num">{{ total }}</div>
个点赞
</div>
<div v-else-if="typeValue == 'footprint'" class="issue-data flexacenter">系统会为你保留最近7天的浏览记录</div>
<div class="list-box" v-if="list.length != 0">
<template v-for="(item,index) in list" :key="item.uniqid">
<item-offer v-if=" item.type == 'offer'" :itemdata="item"></item-offer>
<item-summary v-else-if="item.type == 'offer_summary'" :itemdata="item"></item-summary>
<item-vote v-else-if="item.type == 'vote'" :itemdata="item"></item-vote>
<item-mj v-else-if="item.type == 'interviewexperience'" :itemdata="item"></item-mj>
<item-tenement v-else-if="item.type == 'tenement'" :itemdata="item"></item-tenement>
<item-forum v-else :itemdata="item"></item-forum>
</template>
</div>
<div v-if="list.length == 0 && page == 0" class="empty flexcenter">
<img class="empty-icon" src="./img/empty-icon.png" />
<div class="empty-text">- 暂无内容 -</div>
</div>
<div v-if="list.length != 0 && page != 0" class="load-more flexcenter">加载更多…</div>
</div>
</div>
</div>
<div class="matter-content flex1">
<div class="message-box" v-if="true">
<!-- 头部区域 -->
<div class="header">
<img :src="info.avatar" alt="用户头像" class="avatar" />
<span class="username">{{ info.nickname }}</span>
<img v-if="info?.group?.image" class="icon" :src="info?.group?.image">
</div>
<!-- 信息列表区域 -->
<div class="info-list flexflex">
<div class="item flexacenter">
<span class="label">注册时间</span>
<span class="value">2019-7-26 16:38</span>
</div>
<div class="item flexacenter">
<span class="label">最后登录</span>
<span class="value">2025-10-16 10:32</span>
</div>
<div class="item flexacenter">
<span class="label">在线时长</span>
<span class="value">1304 小时</span>
</div>
<div class="item flexacenter">
<span class="label">上次访问 IP</span>
<span class="value">116.237.182.149 -- 上海长宁区</span>
</div>
<div class="item flexacenter">
<span class="label">Email</span>
<span class="value">skysuper007@qq.com</span>
<span class="status flexacenter">未认证</span>
</div>
<div class="item flexacenter">
<span class="label">手机号</span>
<span class="value">15934271290</span>
<span class="status blue flexacenter">已认证</span>
</div>
<div class="item flexacenter">
<span class="label">累计签到</span>
<span class="value">1341 天</span>
</div>
<div class="item flexacenter">
<span class="label">本月签到</span>
<span class="value">6 天</span>
</div>
<div class="item flexacenter">
<span class="label">寄托币</span>
<span class="value">{{ gtercoin }}</span>
</div>
</div>
<!-- 统计标签区域 -->
<div class="stats flexacenter" v-if="creationType.length != 0">
<template v-for="(item, index) in creationType" :key="index">
<span class="item flexacenter">
<div class="text">{{ item.text }} ×</div>
<div class="num">{{ item.number }}</div>
</span>
<div class="line" v-if="index != creationType.length - 1">|</div>
</template>
</div>
<!-- Offer标签区域 -->
<div class="tags flexflex" v-if="schoolTags.length != 0">
<div class="item flexacenter" v-for="item in schoolTags" :key="item">
<img v-if="item.type == 'offer'" class="icon" src="./img/offer-icon.png" mode="heightFix" />
<img v-else class="icon" src="./img/mj-icon.png" mode="heightFix" />
{{ item.school }}
</div>
</div>
</div>
<div class="list-area">
<div class="operation-box flexacenter">
<div class="operation-item" :class="{ 'pitch': item.type == typeValue }" v-for="item in typeList" :key="item.type">{{ item.text }}</div>
</div>
<div class="classify flexacenter">
<div class="item " :class="{'pitch': item.type == classify}" v-for="item in classifyList" :key="item.type">{{ item.text }}</div>
</div>
<div class="issue-data flexacenter">
<div class="num">{{ total }}</div> 个创作
</div>
<!-- 系统会为你保留最近7天的浏览记录 -->
<div class="list-box" v-if="list.length != 0">
<template v-for="(item,index) in list" :key="index">
<item-offer v-if=" item.type == 'offer'" :itemdata="item"></item-offer>
<item-summary v-else-if="item.type == 'offer_summary'" :itemdata="item"></item-summary>
<item-vote v-else-if="item.type == 'vote'" :itemdata="item"></item-vote>
<item-mj v-else-if="item.type == 'interviewexperience'" :itemdata="item"></item-mj>
<item-tenement v-else-if="item.type == 'tenement'" :itemdata="item"></item-tenement>
<item-forum v-else :itemdata="item"></item-forum>
</template>
</div>
<div v-if="list.length == 0" class="empty flexcenter">
<img class="empty-icon" src="./img/empty-icon.png" />
<div class="empty-text">- 暂无内容 -</div>
</div>
<div class="load-more flexcenter">加载更多…</div>
</div>
</div>
</div>
</div>
<script src="./js/axios.min.js"></script>
<script src="./js/public.js"></script>
<script type="module" src="./js/homepage-me.js"></script>
</body>
</html>
<script src="./js/axios.min.js"></script>
<script src="./js/public.js"></script>
<script type="module" src="./js/homepage-me.js"></script>
</body>
</html>

6
img/triangle-orange.svg Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="18px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -1270 -343 )">
<path d="M 9.67013888888889 8.208984375 C 9.8900462962963 8.431640625 10 8.6953125 10 9 C 10 9.3046875 9.8900462962963 9.568359375 9.67013888888889 9.791015625 L 1.89236111111111 17.666015625 C 1.6724537037037 17.888671875 1.41203703703704 18 1.11111111111111 18 C 0.810185185185185 18 0.549768518518518 17.888671875 0.329861111111111 17.666015625 C 0.109953703703704 17.443359375 0 17.1796875 0 16.875 L 0 1.125 C 0 0.820312499999997 0.109953703703704 0.556640624999997 0.329861111111111 0.333984375 C 0.549768518518518 0.111328124999999 0.810185185185185 0 1.11111111111111 0 C 1.41203703703704 0 1.6724537037037 0.111328124999999 1.89236111111111 0.333984375 L 9.67013888888889 8.208984375 Z " fill-rule="nonzero" fill="#f3974b" stroke="none" transform="matrix(1 0 0 1 1270 343 )" />
</g>
</svg>

6
img/well-number.svg Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="25px" height="20px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -360 -178 )">
<path d="M 10.1996527777778 11.6666666666667 L 13.8744212962963 11.6666666666667 L 14.8003472222222 8.33333333333333 L 11.1255787037037 8.33333333333333 L 10.1996527777778 11.6666666666667 Z M 24.8987268518519 4.73958333333333 C 24.9855324074074 4.84375 25.0144675925926 4.96527777777778 24.9855324074074 5.10416666666667 L 24.1753472222222 8.02083333333333 C 24.1078317901235 8.22916666666667 23.9583333333333 8.33333333333333 23.7268518518519 8.33333333333333 L 18.9959490740741 8.33333333333333 L 18.0700231481481 11.6666666666667 L 22.5694444444444 11.6666666666667 C 22.7141203703704 11.6666666666667 22.8346836419753 11.71875 22.9311342592593 11.8229166666667 C 23.0275848765432 11.9444444444444 23.0565200617284 12.0659722222222 23.0179398148148 12.1875 L 22.2077546296296 15.1041666666667 C 22.1595293209877 15.3125 22.0100308641975 15.4166666666667 21.7592592592593 15.4166666666667 L 17.0283564814815 15.4166666666667 L 15.8564814814815 19.6875 C 15.7889660493827 19.8958333333333 15.6394675925926 20 15.4079861111111 20 L 12.1672453703704 20 C 12.0129243827161 20 11.8875385802469 19.9479166666667 11.791087962963 19.84375 C 11.7042824074074 19.7395833333333 11.6753472222222 19.6180555555556 11.7042824074074 19.4791666666667 L 12.8327546296296 15.4166666666667 L 9.15798611111111 15.4166666666667 L 7.98611111111111 19.6875 C 7.91859567901235 19.8958333333333 7.76909722222222 20 7.53761574074074 20 L 4.28240740740741 20 C 4.13773148148148 20 4.01716820987654 19.9479166666667 3.92071759259259 19.84375 C 3.83391203703704 19.7395833333333 3.80497685185185 19.6180555555556 3.83391203703704 19.4791666666667 L 4.96238425925926 15.4166666666667 L 0.462962962962963 15.4166666666667 C 0.318287037037037 15.4166666666667 0.197723765432099 15.3645833333333 0.101273148148148 15.2604166666667 C 0.0144675925925926 15.15625 -0.0144675925925925 15.0347222222222 0.0144675925925926 14.8958333333333 L 0.824652777777778 11.9791666666667 C 0.892168209876543 11.7708333333333 1.04166666666667 11.6666666666667 1.27314814814815 11.6666666666667 L 6.00405092592593 11.6666666666667 L 6.92997685185185 8.33333333333333 L 2.43055555555556 8.33333333333333 C 2.28587962962963 8.33333333333333 2.16531635802469 8.28125 2.06886574074074 8.17708333333333 C 1.97241512345679 8.05555555555556 1.94347993827161 7.93402777777778 1.98206018518519 7.8125 L 2.79224537037037 4.89583333333333 C 2.84047067901235 4.6875 2.98996913580247 4.58333333333333 3.24074074074074 4.58333333333333 L 7.97164351851852 4.58333333333333 L 9.14351851851852 0.3125 C 9.21103395061728 0.104166666666667 9.36535493827161 0 9.60648148148148 0 L 12.8472222222222 0 C 12.9918981481481 0 13.1124614197531 0.0520833333333326 13.208912037037 0.15625 C 13.2957175925926 0.260416666666667 13.3246527777778 0.381944444444444 13.2957175925926 0.520833333333333 L 12.1672453703704 4.58333333333333 L 15.8420138888889 4.58333333333333 L 17.0138888888889 0.3125 C 17.0814043209877 0.104166666666667 17.235725308642 0 17.4768518518519 0 L 20.7175925925926 0 C 20.8622685185185 0 20.9828317901235 0.0520833333333326 21.0792824074074 0.15625 C 21.166087962963 0.260416666666667 21.1950231481481 0.381944444444444 21.166087962963 0.520833333333333 L 20.0376157407407 4.58333333333333 L 24.537037037037 4.58333333333333 C 24.681712962963 4.58333333333333 24.8022762345679 4.63541666666667 24.8987268518519 4.73958333333333 Z " fill-rule="nonzero" fill="#000000" stroke="none" transform="matrix(1 0 0 1 360 178 )" />
</g>
</svg>

View File

@@ -10,11 +10,51 @@ import { headTop } from "../component/head-top/head-top.js";
const appSectionIndex = createApp({
setup() {
onMounted(() => {
getUserInfoWin();
init();
window.addEventListener("scroll", handleScroll);
});
const handleScroll = () => {
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
const scrollHeight = document.documentElement.scrollHeight;
const clientHeight = document.documentElement.clientHeight;
// 列表下 滑动到底部 获取新数据
if (scrollTop + clientHeight >= scrollHeight - 40) getList();
};
let isLogin = ref(true);
let realname = ref(1); // 是否已经实名
let userInfoWin = ref({
authority: ["comment.edit", "comment.delete", "offercollege.hide", "offersummary.hide", "mj.hide", "topic:manager", "topic:hide"],
avatar: "https://nas.gter.net:9008/avatar/97K4EWIMLrsbGTWXslC2WFVSEKWOikN42jDKLNjtax7HL4xtfMOJSdU9oWFhY2E~/middle?random=1761733169",
groupid: 3,
nickname: "肖荣豪",
realname: 1,
token: "01346a38444d71aaadb3adad52b52c39",
uid: 500144,
uin: 4238049,
});
let permissions = ref([]);
const getUserInfoWin = () => {
const checkUser = () => {
const user = window.userInfoWin;
if (!user) return;
document.removeEventListener("getUser", checkUser);
realname.value = user.realname;
userInfoWin.value = user;
if (user?.uin > 0 || user?.uid > 0) isLogin.value = true;
permissions.value = user?.authority || [];
};
document.addEventListener("getUser", checkUser);
};
const openAttest = () => {
const handleAttestClose = () => {
document.removeEventListener("closeAttest", handleAttestClose);
@@ -35,6 +75,7 @@ const appSectionIndex = createApp({
};
provide("isLogin", isLogin);
provide("userInfoWin", userInfoWin);
provide("realname", realname);
provide("openAttest", openAttest);
provide("goLogin", goLogin);
@@ -45,6 +86,7 @@ const appSectionIndex = createApp({
let medallist = ref([]);
let introduction = ref("");
let avatar = "";
const init = () => {
ajax(`/v2/api/forum/postUserDetail`)
.then((res) => {
@@ -63,12 +105,12 @@ const appSectionIndex = createApp({
info.value = data.info || {};
medallist.value = data.medal || [];
introduction.value = data?.urls?.introduction;
avatar = data?.info?.avatar || "";
getCount();
getList();
})
.catch(() => {});
getCollectList();
};
let createCount = ref(0);
@@ -189,30 +231,68 @@ const appSectionIndex = createApp({
let page = ref(1);
let total = ref(0);
const getCollectList = () => {
const limit = 10;
ajax("/v2/api/forum/postUserCollect", {
let loading = ref(false);
const getList = () => {
if (page.value == 0 || loading.value) return;
loading.value = true;
let url = `/v2/api/forum/postUserCollect`;
if (typeValue.value == "comment") url = `/v2/api/forum/postUserComment`;
if (typeValue.value == "like") url = `/v2/api/forum/postUserLike`;
if (typeValue.value == "footprint") url = `/v2/api/forum/postUserFootprint`;
ajax(url, {
page: page.value,
type: classify.value,
}).then((res) => {
if (res.code != 200) return;
const data = res.data || [];
console.log("data", data);
total.value = data.count;
list.value = [...list.value, ...data.data];
page.value = data.count > data.page * limit ? page.value + 1 : 0;
});
})
.then((res) => {
if (res.code != 200) return;
const data = res.data || [];
let targetList = data.data || [];
targetList.forEach((element) => element.comment_list?.forEach((ele) => (ele["avatar"] = avatar)));
total.value = data.count;
list.value = [...list.value, ...targetList];
page.value = list.value.length >= data.count ? 0 : page.value + 1;
})
.finally(() => (loading.value = false));
};
const cancelOperate = (token) => {
console.log("token", token);
// 取消操作后的删除
const cancelOperate = (type, token) => {
if (typeValue.value != type) return;
const index = list.value.findIndex((item) => item.token == token);
if (index == -1) return;
list.value.splice(index, 1);
total.value--;
};
provide("cancelOperate", cancelOperate);
const classifyChange = (type) => {
if (classify.value == type) return;
page.value = 1;
list.value = [];
total.value = 0;
classify.value = type;
getList();
};
const typeChange = (type) => {
if (typeValue.value == type) return;
typeValue.value = type;
page.value = 1;
list.value = [];
total.value = 0;
classify.value = "";
getList();
};
const copy = (text) => copyUid(text);
return { total, list, classifyList, classify, typeValue, typeList, creationType, gtercoin, info, medallist, schoolTags, introduction, copy };
return { typeChange, page, loading, classifyChange, total, list, classifyList, classify, typeValue, typeList, creationType, gtercoin, info, medallist, schoolTags, introduction, copy };
},
});

View File

@@ -25,6 +25,8 @@ const watchList = {
"../component/slideshow-box/slideshow-box.txt": "../component/slideshow-box/slideshow-box.js",
// 监听 head-top.txt同步到 head-top.js
"../component/head-top/head-top.txt": "../component/head-top/head-top.js",
// 监听 hot-tag.txt同步到 hot-tag.js
"../component/hot-tag/hot-tag.txt": "../component/hot-tag/hot-tag.js",
// 可添加更多文件(格式:'txt路径': 'js路径'
// './component/other/other.txt': './component/other/other.js',

View File

@@ -1,23 +1,71 @@
const { createApp, ref, onMounted, nextTick, onUnmounted, computed, watch, provide } = Vue;
import { itemForum } from "../component/item-forum/item-forum.js";
import { headTop } from "../component/head-top/head-top.js";
import { hotTag } from "../component/hot-tag/hot-tag.js";
const appSearch = createApp({
setup() {
onMounted(() => {
const params = getUrlParams();
const id = params.section || "";
if (id) {
section.value = id;
init();
}
section.value = id;
// init();
});
return {};
const classifyList = ref([
{
text: "全部",
type: "",
},
{
text: "帖子",
type: "thread",
},
{
text: "Offer",
type: "offer",
},
{
text: "总结",
type: "offer_summary",
},
{
text: "面经",
type: "interviewexperience",
},
{
text: "投票",
type: "vote",
},
{
text: "租房",
type: "tenement",
},
]);
let classify = ref("");
const classifyChange = (type) => {
if (classify.value == type) return;
classify.value = type;
};
let tabList = ref({
all: "全部",
thread: "论坛",
offer: "Offer",
offer_summary: "总结",
interviewexperience: "面经",
vote: "投票",
});
let tabValue = ref("all");
return { tabValue, tabList, classifyChange, classifyList, classify };
},
});
appSearch.component("item-forum", itemForum);
appSearch.mount("#sectionIndex");
appSearch.component("head-top", headTop);
appSearch.component("hot-tag", hotTag);
appSearch.mount("#search");

View File

@@ -1,27 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>搜索</title>
<link rel="stylesheet" href="./css/public.css" />
<link rel="stylesheet" href="./css/search.css" />
<script src="./js/vue.global.js"></script>
<style scoped>
[v-cloak] {
display: none;
}
</style>
</head>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>搜索</title>
<link rel="stylesheet" href="./css/public.css" />
<link rel="stylesheet" href="./css/search.css" />
<script src="./js/vue.global.js"></script>
<style scoped>
[v-cloak] {
display: none;
}
</style>
</head>
<body>
<div class="container" id="search" v-cloak>
<head-top></head-top>
<div class="label-title flexacenter">
<img class="icon" src="./img/well-number.svg" />
<div class="text">香港</div>
</div>
<body>
<div class="container" id="search" v-cloak>
<div class="classify flexacenter">
<div class="item" :class="{'pitch': item.type == classify}" v-for="item in classifyList" :key="item.type" @click="classifyChange(item.type)">{{ item.text }}</div>
</div>
</div>
<script src="./js/axios.min.js"></script>
<script src="./js/public.js"></script>
<script type="module" src="./js/search.js"></script>
</body>
<div class="quantity flexacenter">
{{ tabList[tabValue] }}
<div class="line"></div>
<div class="num">{{ count }}</div>
</div>
</html>
<div class="matter flexflex">
<div class="matter-content flex1"></div>
<div class="sidebar-box">
<hot-tag></hot-tag>
</div>
</div>
</div>
<script src="./js/axios.min.js"></script>
<script src="./js/public.js"></script>
<script type="module" src="./js/search.js"></script>
</body>
</html>