feat: 前端网页优化
This commit is contained in:
@@ -23,12 +23,15 @@ import {
|
|||||||
import { AtToast } from "taro-ui";
|
import { AtToast } from "taro-ui";
|
||||||
import { AtIcon } from "taro-ui";
|
import { AtIcon } from "taro-ui";
|
||||||
import { VIEW } from "@tarojs/runtime";
|
import { VIEW } from "@tarojs/runtime";
|
||||||
import 'animate.css'
|
import "animate.css";
|
||||||
|
import touxiang from "../../images/touxiang.png";
|
||||||
|
|
||||||
// export default class Index extends Component {
|
// export default class Index extends Component {
|
||||||
const Index = () => {
|
const Index = () => {
|
||||||
const [current, setcurrent] = useState(0);
|
const [current, setcurrent] = useState(0);
|
||||||
const [openId, setopenId] = useState(null);
|
const [openId, setopenId] = useState(null);
|
||||||
|
const [wxid, setwxid] = useState(null);
|
||||||
|
|
||||||
const [open, setopen] = useState(false);
|
const [open, setopen] = useState(false);
|
||||||
const [referer, setreferer] = useState(window.document.referrer);
|
const [referer, setreferer] = useState(window.document.referrer);
|
||||||
|
|
||||||
@@ -58,6 +61,7 @@ const Index = () => {
|
|||||||
(!!newOpenid && newOpenid != "undefined" && newOpenid != "null") ||
|
(!!newOpenid && newOpenid != "undefined" && newOpenid != "null") ||
|
||||||
(!!hashopenid && hashopenid != "undefined" && hashopenid != "null")
|
(!!hashopenid && hashopenid != "undefined" && hashopenid != "null")
|
||||||
) {
|
) {
|
||||||
|
// 获取到openid
|
||||||
window.localStorage.setItem("openid", hashopenid);
|
window.localStorage.setItem("openid", hashopenid);
|
||||||
setopenId(hashopenid);
|
setopenId(hashopenid);
|
||||||
} else {
|
} 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(() => {
|
useEffect(() => {
|
||||||
|
// 获取openId
|
||||||
getOpenid();
|
getOpenid();
|
||||||
|
// window.alert(window.location.href)
|
||||||
|
// o7LFAwR32hWGq9XOpd7ZxK1wZxq8
|
||||||
|
// window.alert(window.localStorage.getItem('openid'))
|
||||||
|
// 获取wxid参数
|
||||||
|
getWxidFromUrl()
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
@@ -81,21 +102,24 @@ const Index = () => {
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<View className="index">
|
<View className="index">
|
||||||
|
|
||||||
{/* 公众号 */}
|
{/* 公众号 */}
|
||||||
<View className="index-title" onClick={()=>{
|
<View
|
||||||
// window.location.href=""
|
className="index-title"
|
||||||
}}>
|
onClick={() => {
|
||||||
|
// window.location.href=""
|
||||||
|
}}
|
||||||
|
>
|
||||||
<AtAvatar
|
<AtAvatar
|
||||||
size="small"
|
size="small"
|
||||||
circle
|
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>
|
></AtAvatar>
|
||||||
<View>公众号:异度世界</View>
|
<View className="yidooplanet">异度世界</View>
|
||||||
</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 className="index-AtTag" type="primary" AtNavBar={true} circle>
|
||||||
独立开发者
|
独立开发者
|
||||||
</AtTag>
|
</AtTag>
|
||||||
@@ -107,6 +131,24 @@ const Index = () => {
|
|||||||
</AtTag>
|
</AtTag>
|
||||||
</View>
|
</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">
|
{/* <View className="payBtn">
|
||||||
<AtButton type="primary">立即购买 -- 29.8元</AtButton>
|
<AtButton type="primary">立即购买 -- 29.8元</AtButton>
|
||||||
</View> */}
|
</View> */}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.index {
|
.index {
|
||||||
// background-color: #002329;
|
// background-color: #002329;
|
||||||
width: 100vw;
|
// width: 100vw;
|
||||||
height: 100vh;
|
// height: 100vh;
|
||||||
padding: 40px;
|
padding: 40px;
|
||||||
|
|
||||||
.index-title {
|
.index-title {
|
||||||
@@ -9,6 +9,9 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
.yidooplanet {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.index-tags {
|
.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 {
|
.payBtn {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user