This commit is contained in:
hackrobot
2024-09-10 13:04:42 +08:00
parent 8134ccb2eb
commit fa1d8cddec

View File

@@ -34,6 +34,7 @@ import qrcode from "../../images/qrcode.png";
import meetup from "../../images/meetup.jpg";
import bookqr from "../../images/bookqr.jpg";
import loft from "../../images/loft.png";
// export default class Index extends Component {
const Index = () => {
@@ -52,6 +53,7 @@ const Index = () => {
const [meetupToast, setmeetupToast] = useState(false);
const [joinMeetup, setjoinMeetup] = useState(false);
const [bookpay, setbookpay] = useState(0);
const [isWeChat, setisWeChat] = useState(false);
@@ -255,6 +257,11 @@ const Index = () => {
}
}, []);
useEffect(() => {
// alert(window.localStorage.getItem("bookpay"))
setbookpay(window.localStorage.getItem("bookpay"));
}, []);
const goBack = () => {
Taro.navigateBack({});
};
@@ -263,6 +270,50 @@ const Index = () => {
// window.alert(value)
setopen(value);
};
const payh5 = (type, total_fee = 1000) => {
// console.log("111");
Taro.request({
method: "POST",
url: "/api/payh5", //仅为示例,并非真实的接口地址
// url: "https://pay.hackrobot.cn/api/payh5", //仅为示例,并非真实的接口地址
data: {
callback_url: window.location.href,
openid: window.localStorage.getItem("openid"),
total_fee: total_fee, // 金额,单位:分
type: type, //订单类型 book/meetup/video/vip
},
header: {
"content-type": "application/json", // 默认值
},
success: function (res) {
console.log(res.data);
// window.alert(res.data.jsapi);
WeixinJSBridge.invoke(
"getBrandWCPayRequest",
{
// 以下6个支付参数通过payjs的jsapi接口获取
// appId: "wxc5205a653b0259bf",
// timeStamp: "1701401644",
// nonceStr: "KhOYB0wFV6j9qyQK",
// package: "prepay_id=wx01113404850024729b35f4d69b73500000",
// signType: "MD5",
// paySign: "2A823C8D47CCF871C6C65A56DC228CF8",
...(res?.data?.jsapi ?? {}),
},
function (res) {
// 支付成功
if (res.err_msg == "get_brand_wcpay_request:ok") {
window.localStorage.setItem(type, 1); //订单类型 book/meetup/video/vip
WeixinJSBridge.call("closeWindow");
}
}
);
},
});
};
return (
<View className="index">
{/* <Button
@@ -326,7 +377,8 @@ const Index = () => {
thumb={phone}
onClick={() => {
window.location.href =
"https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4NTgyNDUxNw==&action=getalbum&album_id=3403853254399082501#wechat_redirect";
// "https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4NTgyNDUxNw==&action=getalbum&album_id=3403853254399082501#wechat_redirect";
"https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4NTgyNDUxNw==&action=getalbum&album_id=3555705062712901639#wechat_redirect"
}}
/>
<AtListItem
@@ -336,7 +388,8 @@ const Index = () => {
thumb={robot}
onClick={() => {
window.location.href =
"https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4NTgyNDUxNw==&action=getalbum&album_id=3545545030499270661#wechat_redirect";
// "https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4NTgyNDUxNw==&action=getalbum&album_id=3545545030499270661#wechat_redirect";
"https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4NTgyNDUxNw==&action=getalbum&album_id=3629790245010128902#wechat_redirect"
}}
/>
{/* <AtListItem
@@ -368,25 +421,27 @@ const Index = () => {
style="width: 30px;height:30px;background: #fff;"
src={nomad}
/>
<View className="bookNmae">数字游民手册</View>
<View className="bookNmae">一人公司方法论</View>
</View>
<View className="subtitle">多元自动化收入</View>
<View className="bookText">
{/* 两个核心主题: <br /> */}
1. 微信运营:云手机+机器人+AIGC
1. 云手机+微信机器人+AIGC
<br />
2. 自媒体:youtube获利+wordpress <br />
3. 跨境电商:amazon
2. youtube赚美金 <br />
3. 跨境电商
<br />
4. 软件saas:独立开发
4. 独立开发
<br />
5. 知识付费:如何出版一本书?
5. 旅行与远程办公
<br />
</View>
<View
className="bookPrice"
onClick={() => {
return false
// 19元解锁书籍
// payh5("bookpay", 10);
return false;
if (!!userInfo?.ebook) {
// 已预约
Taro.atMessage({
@@ -435,12 +490,13 @@ const Index = () => {
<View
className="join"
// style={{ backgroundColor: !!userInfo?.ebook ? "#1890ff" : null }}
style={{ backgroundColor: !!userInfo?.ebook ? "#1890ff" : "#1890ff" }}
style={{
backgroundColor: !!userInfo?.ebook ? "#1890ff" : "#1890ff",
}}
>
{/* {!!userInfo?.ebook ? "已预约" : "预约"} */}
{!!userInfo?.ebook ? "未完结" : "未完结"}
{/* {bookpay == 1 ? "查看" : "阅读"} */}
</View>
</View>
</View>
@@ -474,10 +530,11 @@ const Index = () => {
</View> */}
</View>
{/* 已付费的用户才展示活动 */}
<View className="index-meetup animate__animated animate__pulse">
<AtCard
// note="提示文字"
extra="2024/08/24"
extra="2024/09/13"
title="线下活动"
thumb="http://img12.360buyimg.com/jdphoto/s72x72_jfs/t10660/330/203667368/1672/801735d7/59c85643N31e68303.png"
>
@@ -486,13 +543,14 @@ const Index = () => {
<View className="meetup-left">
<Image
style="width: 100%;height: 100px;background: #fff;"
src={meetup}
// src={meetup}
src={loft}
/>
</View>
{/* 右边 */}
<View className="meetup-right">
<View className="title">数字游民 | 自由职业者沙龙</View>
<View className="title">自由职业 | 沙龙</View>
<View className="address">
<AtIcon value="map-pin" size="30" color="#F00"></AtIcon>
<span>深圳市龙华区</span>
@@ -507,12 +565,12 @@ const Index = () => {
style={{
backgroundColor: !!userInfo?.activity_status
? "#1890ff"
// : null,
: "#1890ff"
//
: // : null,
"#1890ff",
//
}}
onClick={() => {
return false
return false;
if (userInfo?.activity_status == "1") {
// 已预约
Taro.atMessage({
@@ -564,9 +622,9 @@ const Index = () => {
? "审核中"
: userInfo?.activity_status == "1"
? "已报名"
// : "立即报名"}
: "已满"}
: // : "立即报名"}
"已满"}
{/* {`报名`} */}
</View>
</View>
</View>
@@ -578,7 +636,7 @@ const Index = () => {
{/* <View>付费入群</View> */}
{/* 联系我 */}
{!wxid && !Object.keys(userInfo)?.length > 0 ? (
{/* {!wxid && !Object.keys(userInfo)?.length > 0 ? (
<View className="contack">
<View className="wechatNum">微信号: hackrobot</View>
<Image
@@ -586,7 +644,7 @@ const Index = () => {
src={qrcode}
/>
</View>
) : null}
) : null} */}
{/* <View className="payBtn">
<AtButton type="primary">立即购买 -- 29.8元</AtButton>