feat: 前端网页优化

This commit is contained in:
hackrobot
2024-07-16 19:19:01 +08:00
parent f6246b2fc9
commit d936c60623
2 changed files with 70 additions and 10 deletions

View File

@@ -23,12 +23,15 @@ import {
import { AtToast } from "taro-ui";
import { AtIcon } from "taro-ui";
import { VIEW } from "@tarojs/runtime";
import 'animate.css'
import "animate.css";
import touxiang from "../../images/touxiang.png";
// export default class Index extends Component {
const Index = () => {
const [current, setcurrent] = useState(0);
const [openId, setopenId] = useState(null);
const [wxid, setwxid] = useState(null);
const [open, setopen] = useState(false);
const [referer, setreferer] = useState(window.document.referrer);
@@ -58,6 +61,7 @@ const Index = () => {
(!!newOpenid && newOpenid != "undefined" && newOpenid != "null") ||
(!!hashopenid && hashopenid != "undefined" && hashopenid != "null")
) {
// 获取到openid
window.localStorage.setItem("openid", hashopenid);
setopenId(hashopenid);
} else {
@@ -67,8 +71,25 @@ const Index = () => {
}
};
const getWxidFromUrl=()=>{
const urlParams = new URLSearchParams(window.location.search);
const wxid = urlParams.get('wxid');
setwxid(wxid)
// window.alert(wxid)
return wxid;
}
// 网页查看通知
// 入群申请
useEffect(() => {
// 获取openId
getOpenid();
// window.alert(window.location.href)
// o7LFAwR32hWGq9XOpd7ZxK1wZxq8
// window.alert(window.localStorage.getItem('openid'))
// 获取wxid参数
getWxidFromUrl()
}, []);
const goBack = () => {
@@ -81,21 +102,24 @@ const Index = () => {
};
return (
<View className="index">
{/* 公众号 */}
<View className="index-title" onClick={()=>{
// window.location.href=""
}}>
<View
className="index-title"
onClick={() => {
// window.location.href=""
}}
>
<AtAvatar
size="small"
circle
image="https://www.hackrobot.cn/wp-content/uploads/2023/05/cropped-cropped-Screenshot-2023-05-22-at-17.26.38.png"
// image="https://www.hackrobot.cn/wp-content/uploads/2023/05/cropped-cropped-Screenshot-2023-05-22-at-17.26.38.png"
image={touxiang}
></AtAvatar>
<View>公众号:异度世界</View>
<View className="yidooplanet">异度世界</View>
</View>
{/* 标签 */}
<View className="index-tags animate__animated animate__pulse">
<View className="index-tags animate__animated animate__pulse">
<AtTag className="index-AtTag" type="primary" AtNavBar={true} circle>
独立开发者
</AtTag>
@@ -107,6 +131,24 @@ const Index = () => {
</AtTag>
</View>
<View className="index-article">
{/* className="at-article__p" */}
<View>
普通的独立开发者,平时喜欢折腾<span className="spanText">树莓派</span>
<br />
副业是做跨境电商
<br />
努力成为一个数字游民ing😎
</View>
</View>
<View className="index-card">
<View>独立博客</View>
<View>独立博客</View>
</View>
{/* <View className="payBtn">
<AtButton type="primary">立即购买 -- 29.8元</AtButton>
</View> */}

View File

@@ -1,7 +1,7 @@
.index {
// background-color: #002329;
width: 100vw;
height: 100vh;
// width: 100vw;
// height: 100vh;
padding: 40px;
.index-title {
@@ -9,6 +9,9 @@
flex-direction: row;
font-weight: 700;
align-items: center;
.yidooplanet {
margin-left: 20px;
}
}
.index-tags {
@@ -19,6 +22,21 @@
}
}
.index-article {
margin-top: 40px;
// background-color: yellow;
font-size: 25px;
.spanText {
font-weight: 700;
}
}
.index-card{
margin-top: 30px;
font-size: 24px;
}
.payBtn {
position: fixed;
bottom: 0;