;init'
This commit is contained in:
45
src/pages/book/book.md
Normal file
45
src/pages/book/book.md
Normal file
@@ -0,0 +1,45 @@
|
||||
## Youtube运营笔记
|
||||
|
||||
> 媒体是普通人的最好的杠杆
|
||||
|
||||
从佛系到认真的运营youtube(油管),也快有1年的时间了
|
||||
|
||||
在这里分享一些心得,以及踩过的坑
|
||||
|
||||
---
|
||||
|
||||
## 为什么youtube值得做?
|
||||
|
||||
> 成本低
|
||||
|
||||
自媒体是普通人最好的杠杆,只需要1部手机,就可以拍摄vlog,也可以剪辑影片
|
||||
现在的剪辑软件,不仅在手机端可以方便操作,还结合的ai功能,比如
|
||||
|
||||
- 语音翻译/克隆
|
||||
|
||||
- 自动生成双语字幕
|
||||
|
||||
- 特效/音效
|
||||
|
||||
|
||||
随时随地都可以剪辑+上传
|
||||
|
||||
> 赚美金,回报高
|
||||
|
||||
同样的视频,在不同的平台上传后,收益汇率不一样
|
||||
|
||||
油管结算是美金,换成人民,就有7倍左右的购买力
|
||||
|
||||
而如果你居住下三四线城市,或者县城,那么由于生活成本低
|
||||
|
||||
每月即使1000$的收益,都可以过的不错了
|
||||
|
||||
> 商业模式健康
|
||||
|
||||
youtube给创作者的收益,长视频是`55%`,短视频shorts是`45%`
|
||||
|
||||
可以说是世界上很慷慨的公司了
|
||||
|
||||
仅仅是平台广告,就能够带来巨大的收益
|
||||
|
||||
不用去接`业配/商单`,以及自己带货,纯粹的视频不会让人厌恶
|
||||
3
src/pages/book/index.config.js
Normal file
3
src/pages/book/index.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '一人公司方法论'
|
||||
}
|
||||
45
src/pages/book/index.scss
Normal file
45
src/pages/book/index.scss
Normal file
@@ -0,0 +1,45 @@
|
||||
// 在 src/index.scss 中引入 GitHub Markdown 主题
|
||||
@import "github-markdown-css/github-markdown.css";
|
||||
|
||||
.Book {
|
||||
padding: 40px;
|
||||
.markdown-body {
|
||||
font-size: 30px;
|
||||
// color: #72d572;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto; /* 保持图像的纵横比 */
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1536px) {
|
||||
.Book {
|
||||
width: 100%;
|
||||
// height: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
// background-color: yellow;
|
||||
.book_left {
|
||||
width: 400px;
|
||||
height:100%;
|
||||
background-color: red;
|
||||
}
|
||||
.markdown-body {
|
||||
width: 100%;
|
||||
max-width: 1400px;
|
||||
font-size: 22px;
|
||||
// color: red;
|
||||
// background-color: #72d572;
|
||||
}
|
||||
.book_right {
|
||||
width: 400px;
|
||||
height: 100%;
|
||||
background-color: greenyellow;
|
||||
}
|
||||
}
|
||||
}
|
||||
129
src/pages/book/index.tsx
Normal file
129
src/pages/book/index.tsx
Normal file
@@ -0,0 +1,129 @@
|
||||
// @ts-nocheck
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtButton, AtInput, AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtAvatar } from "taro-ui";
|
||||
import { AtTag } from "taro-ui";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import { AtForm, AtMessage } from "taro-ui";
|
||||
import { marked } from "marked";
|
||||
import infoText from "./info.md";
|
||||
import bookText from "./book.md";
|
||||
|
||||
marked.setOptions({
|
||||
breaks: true, // 是否回车换行
|
||||
gfm: true, //使用经批准的 GitHub Flavored Markdown (GFM) 规范
|
||||
// pedantic: true, //严格模式
|
||||
// highlight(code:any, lang:any) {
|
||||
// // 语法高亮
|
||||
// let val = code;
|
||||
// if (lang) {
|
||||
// val = hljs.highlight(lang, code).value;
|
||||
// } else {
|
||||
// val = hljs.highlightAuto(code).value;
|
||||
// }
|
||||
// return val;
|
||||
// },
|
||||
});
|
||||
|
||||
// const renderer = new marked.Renderer();
|
||||
// // 使用拓展
|
||||
// marked.use({ renderer });
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Book = () => {
|
||||
const [markText, setmarkText] = useState();
|
||||
const [isWeChat, setisWeChat] = useState(false);
|
||||
|
||||
const [book, setbook] = useState(window.localStorage.getItem("book"));
|
||||
|
||||
useEffect(() => {
|
||||
isWeChatFun();
|
||||
}, []);
|
||||
|
||||
// const handleClick = (value) => {
|
||||
// // 跳转到目的页面,在当前页面打开
|
||||
// Taro.navigateTo({
|
||||
// url: "/pages/index/index",
|
||||
// });
|
||||
// };
|
||||
|
||||
// 是否在微信客户端
|
||||
const isWeChatFun = () => {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf("micromessenger") != -1) {
|
||||
setisWeChat(true);
|
||||
return true;
|
||||
} else {
|
||||
setisWeChat(false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const payh5 = (type, total_fee = 1000) => {
|
||||
// console.log("111");
|
||||
Taro.request({
|
||||
method: "POST",
|
||||
url: `${process.env.TARO_API_API}/payh5`, //仅为示例,并非真实的接口地址
|
||||
// url: "https://pay.hackrobot.cn${process.env.TARO_API_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="Book">
|
||||
{/* <View className="book_left">1 </View> */}
|
||||
<View
|
||||
className="markdown-body" // 添加 GitHub Markdown 主题类
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: marked(book == 1 ? bookText : infoText),
|
||||
}}
|
||||
></View>
|
||||
{/* <View className="book_right"> 22</View> */}
|
||||
|
||||
{/* <View className="bottomDiv"></View> */}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Book;
|
||||
80
src/pages/book/info.md
Normal file
80
src/pages/book/info.md
Normal file
@@ -0,0 +1,80 @@
|
||||
## 前言
|
||||
|
||||
> 本文是在线电子书,不定时更新
|
||||
|
||||
你看到的`电子书`,一个在线的网页
|
||||
|
||||
内容会根据作者的经历和心得,不定时更新
|
||||
|
||||
当然,如果你也可以关注公众号: Eric的云游日记, 加群交流
|
||||
|
||||
一个人走得开,一群人走的远
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/ytGpt.png?imageSlim" title="" alt="ytGpt.png" width="235">
|
||||
|
||||
> 声明:
|
||||
|
||||
本人不会针对Youtube内容进行收费
|
||||
|
||||
也不进行账号买卖
|
||||
|
||||
文中内容仅供参考
|
||||
|
||||
---
|
||||
|
||||
> nomadyt.com
|
||||
|
||||
[nomadyt.com](nomadyt.com) 是`nomad`+`yt`的缩写组合,意思是以油管为收益的数字游民
|
||||
|
||||
油管适合做为`副业`尝试
|
||||
|
||||
申请ypp通过后,就可以设置视频播放广告,产生美金收益
|
||||
|
||||
|
||||
|
||||
|
||||
## Youtube运营笔记
|
||||
|
||||
> 媒体是普通人的最好的杠杆
|
||||
|
||||
从佛系到认真的运营youtube(油管),也快有1年的时间了
|
||||
|
||||
在这里分享一些心得,以及踩过的坑
|
||||
|
||||
---
|
||||
|
||||
## 为什么youtube值得做?
|
||||
|
||||
> 成本低
|
||||
|
||||
自媒体是普通人最好的杠杆,只需要1部手机,就可以拍摄vlog,也可以剪辑影片
|
||||
现在的剪辑软件,不仅在手机端可以方便操作,还结合的ai功能,比如
|
||||
|
||||
- 语音翻译/克隆
|
||||
|
||||
- 自动生成双语字幕
|
||||
|
||||
- 特效/音效
|
||||
|
||||
|
||||
随时随地都可以剪辑+上传
|
||||
|
||||
> 赚美金,回报高
|
||||
|
||||
同样的视频,在不同的平台上传后,收益汇率不一样
|
||||
|
||||
油管结算是美金,换成人民,就有7倍左右的购买力
|
||||
|
||||
而如果你居住下三四线城市,或者县城,那么由于生活成本低
|
||||
|
||||
每月即使1000$的收益,都可以过的不错了
|
||||
|
||||
> 商业模式健康
|
||||
|
||||
youtube给创作者的收益,长视频是`55%`,短视频shorts是`45%`
|
||||
|
||||
可以说是世界上很慷慨的公司了
|
||||
|
||||
仅仅是平台广告,就能够带来巨大的收益
|
||||
|
||||
不用去接`业配/商单`,以及自己带货,纯粹的视频不会让人厌恶
|
||||
3
src/pages/group/index.config.js
Normal file
3
src/pages/group/index.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '加入微信群'
|
||||
}
|
||||
13
src/pages/group/index.scss
Normal file
13
src/pages/group/index.scss
Normal file
@@ -0,0 +1,13 @@
|
||||
.group{
|
||||
padding: 40px;
|
||||
|
||||
.formCode{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.codeBtn{
|
||||
background-color: aquamarine;
|
||||
// height: 80px;
|
||||
// color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
130
src/pages/group/index.tsx
Normal file
130
src/pages/group/index.tsx
Normal file
@@ -0,0 +1,130 @@
|
||||
// @ts-nocheck
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtButton, AtInput, AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtAvatar } from "taro-ui";
|
||||
import { AtTag } from "taro-ui";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import { AtForm, AtMessage } from "taro-ui";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Group = () => {
|
||||
const [current, setcurrent] = useState(2);
|
||||
const [wxid, setwxid] = useState(null);
|
||||
const [phoneNum, setphoneNum] = useState(null);
|
||||
const [vCode, setvCode] = useState(null);
|
||||
const [waitTime, setWaitTime] = useState(0); // 等待秒数
|
||||
const [isButtonDisabled, setIsButtonDisabled] = useState(false); // 按钮是否禁用
|
||||
|
||||
useEffect(() => {}, []);
|
||||
|
||||
const handleClick = (value) => {
|
||||
// 跳转到目的页面,在当前页面打开
|
||||
Taro.navigateTo({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
};
|
||||
|
||||
const startTimer = () => {
|
||||
setIsButtonDisabled(true);
|
||||
let localWaitTime = 60; // 使用局部变量
|
||||
|
||||
// 更新状态的函数
|
||||
const updateTime = () => {
|
||||
if (localWaitTime <= 0) {
|
||||
clearInterval(timer);
|
||||
setIsButtonDisabled(false);
|
||||
setWaitTime(0);
|
||||
} else {
|
||||
setWaitTime(localWaitTime);
|
||||
localWaitTime -= 1;
|
||||
}
|
||||
};
|
||||
|
||||
// 设定计时器
|
||||
const timer = setInterval(updateTime, 1000);
|
||||
// 初始调用
|
||||
updateTime();
|
||||
};
|
||||
|
||||
const validatePhoneNumber=(phoneNum) =>{
|
||||
// 检查是否为11位数字
|
||||
const phoneRegex = /^[0-9]{11}$/;
|
||||
return phoneRegex.test(phoneNum);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<View className="group">
|
||||
<AtForm
|
||||
onSubmit={(event) => {
|
||||
console.log("onSubmit-event--", event[0]?.detail?.value);
|
||||
}}
|
||||
onReset={(event) => {
|
||||
// 重置数据
|
||||
}}
|
||||
>
|
||||
<AtInput
|
||||
name="phoneNum"
|
||||
border={false}
|
||||
title="手机号"
|
||||
type="phone"
|
||||
placeholder="请输入"
|
||||
value={phoneNum}
|
||||
disabled={isButtonDisabled}
|
||||
onChange={(value) => {
|
||||
console.log("value", value);
|
||||
setphoneNum(value);
|
||||
}}
|
||||
/>
|
||||
<View className="formCode">
|
||||
<AtInput
|
||||
name="vCode"
|
||||
title="验证码"
|
||||
type="number"
|
||||
placeholder="请输入4位数字"
|
||||
|
||||
value={vCode}
|
||||
onChange={(value) => {
|
||||
setvCode(value);
|
||||
}}
|
||||
/>
|
||||
<AtButton
|
||||
className="codeBtn"
|
||||
onClick={() => {
|
||||
if (!!phoneNum & !!validatePhoneNumber(phoneNum)) {
|
||||
// 提交手机数据
|
||||
setIsButtonDisabled(true);
|
||||
startTimer(); // 开始防抖计时
|
||||
} else {
|
||||
Taro.atMessage({
|
||||
message: "请检查手机号",
|
||||
type: `warning`,
|
||||
});
|
||||
}
|
||||
}}
|
||||
// type="primary"
|
||||
disabled={isButtonDisabled}
|
||||
>
|
||||
{isButtonDisabled ? `${waitTime} 秒` : "获取"}
|
||||
</AtButton>
|
||||
</View>
|
||||
|
||||
<AtButton formType="submit" type="primary">
|
||||
{"提交"}
|
||||
</AtButton>
|
||||
</AtForm>
|
||||
|
||||
<AtMessage />
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Group;
|
||||
3
src/pages/index/index.config.js
Normal file
3
src/pages/index/index.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: 'Youtube运营笔记'
|
||||
}
|
||||
423
src/pages/index/index.jsx
Normal file
423
src/pages/index/index.jsx
Normal file
@@ -0,0 +1,423 @@
|
||||
import { Component } from "react";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { View, Text, Image, Button } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import { AtButton } from "taro-ui";
|
||||
import { AtSearchBar } from "taro-ui";
|
||||
import { Picker } from "@tarojs/components";
|
||||
import { AtList, AtListItem, AtNavBar, AtTag, AtMessage } from "taro-ui";
|
||||
import {
|
||||
AtModal,
|
||||
AtModalHeader,
|
||||
AtModalContent,
|
||||
AtModalAction,
|
||||
AtAvatar,
|
||||
AtAccordion,
|
||||
} from "taro-ui";
|
||||
import { AtToast } from "taro-ui";
|
||||
import { AtIcon } from "taro-ui";
|
||||
import { VIEW } from "@tarojs/runtime";
|
||||
import "animate.css";
|
||||
import touxiang from "../../images/touxiang.png";
|
||||
import cat from "../../images/cat.jpg";
|
||||
import girl from "../../images/girl.jpg";
|
||||
|
||||
import emoji from "../../images/emoji.png";
|
||||
import phone from "../../images/phone.png";
|
||||
import robot from "../../images/robot.png";
|
||||
import nomad from "../../images/nomad.png";
|
||||
import book from "../../images/book.png";
|
||||
import qrcode from "../../images/qrcode.png";
|
||||
|
||||
import meetup from "../../images/meetup.jpg";
|
||||
import bookqr from "../../images/bookqr.jpg";
|
||||
import loft from "../../images/loft.png";
|
||||
import AIGC from "../../images/AIGC.png";
|
||||
import robot192 from "../../images/robot192.png";
|
||||
import youtube from "../../images/youtube.svg";
|
||||
import youtube2 from "../../images/yt2.svg";
|
||||
import youtube3 from "../../images/yt3.svg";
|
||||
import youtube4 from "../../images/yt4.svg";
|
||||
import ytGpt from "../../images/ytGpt.png";
|
||||
|
||||
import demo from "../../images/demo.svg";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Index = () => {
|
||||
const [current, setcurrent] = useState(0);
|
||||
const [openId, setopenId] = useState(null);
|
||||
const [wxid, setwxid] = useState(null);
|
||||
const [userInfo, setuserInfo] = useState({});
|
||||
|
||||
const [open, setopen] = useState(false);
|
||||
const [referer, setreferer] = useState(window.document.referrer);
|
||||
|
||||
const [isOpened, setisOpened] = useState(false);
|
||||
const [meetupQR, setmeetupQR] = useState(false);
|
||||
|
||||
const [bookToast, setbookToast] = useState(false);
|
||||
const [meetupToast, setmeetupToast] = useState(false);
|
||||
|
||||
const [joinMeetup, setjoinMeetup] = useState(false);
|
||||
const [bookpay, setbookpay] = useState(0);
|
||||
|
||||
const [isWeChat, setisWeChat] = useState(false);
|
||||
|
||||
const getOpenidFromUrl = (url) => {
|
||||
const pattern = /[?&]openid=([^&#]+)/;
|
||||
const match = url.match(pattern);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
// 是否在微信客户端
|
||||
const isWeChatFun = () => {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf("micromessenger") != -1) {
|
||||
setisWeChat(true);
|
||||
return true;
|
||||
} else {
|
||||
setisWeChat(false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// 获取openid
|
||||
const getOpenid = () => {
|
||||
// let newparams = Taro.getCurrentInstance().router.params;
|
||||
// let urlopenid = newparams.openid;
|
||||
|
||||
// hash模式
|
||||
// http://192.168.31.245:10086/?openid=o7LFAwR32hWGq9XOpd7ZxK1wZxq8#/pages/index/index
|
||||
let hashopenid = null;
|
||||
if (window.location.href.includes("openid")) {
|
||||
hashopenid = getOpenidFromUrl(window.location.href);
|
||||
} else {
|
||||
// hashopenid = window.localStorage.getItem("openid");
|
||||
}
|
||||
if (!!hashopenid && hashopenid != "undefined" && hashopenid != "null") {
|
||||
// 获取到openid
|
||||
window.localStorage.setItem("openid", hashopenid);
|
||||
setopenId(hashopenid);
|
||||
|
||||
// window.alert(hashopenid);
|
||||
// 查询数据库是否存在openid
|
||||
Taro.request({
|
||||
method: "GET",
|
||||
url: `${process.env.TARO_API_API}/user/${hashopenid}`, //仅为示例,并非真实的接口地址
|
||||
// url: `${process.env.TARO_API_API}/user/${window.localStorage.getItem("openid")}`, //仅为示例,并非真实的接口地址
|
||||
success: function (res) {
|
||||
if (res?.data?.userInfo) {
|
||||
// 有完整的用户信息userInfo
|
||||
setuserInfo(res?.data?.userInfo);
|
||||
window.localStorage.setItem("userInfo", userInfo);
|
||||
}
|
||||
},
|
||||
complete: function (finy) {
|
||||
// 获取wxid参数
|
||||
getWxidFromUrl();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
let nowUrl = window.location.href;
|
||||
window.localStorage.removeItem("openid");
|
||||
let payUrl = `https://payjs.cn/api/openid?mchid=1561724891&callback_url=${nowUrl}`;
|
||||
window.location.href = payUrl;
|
||||
}
|
||||
};
|
||||
|
||||
// 获取更新用户信息
|
||||
const getUserinfo = (wxid) => {
|
||||
Taro.request({
|
||||
method: "GET",
|
||||
url: `${process.env.TARO_API_API}/user/${wxid}`, //仅为示例,并非真实的接口地址
|
||||
// url: `${process.env.TARO_API_API}/user/${window.localStorage.getItem("openid")}`, //仅为示例,并非真实的接口地址
|
||||
success: function (res) {
|
||||
if (res?.data?.userInfo) {
|
||||
//判断wxid是否存在
|
||||
if (res?.data?.userInfo?.openid) {
|
||||
// 有完整的用户信息userInfo
|
||||
setuserInfo(res?.data?.userInfo);
|
||||
window.localStorage.setItem("userInfo", userInfo);
|
||||
}
|
||||
}
|
||||
},
|
||||
complete: function (finy) {},
|
||||
});
|
||||
};
|
||||
|
||||
// 获取url中的wxid
|
||||
const getWxidFromUrl = () => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const urlwxid = urlParams.get("wxid");
|
||||
if (!!urlwxid) {
|
||||
setwxid(urlwxid);
|
||||
window.localStorage.setItem("wxid", wxid);
|
||||
// 优先查询openid是否存在数据库
|
||||
Taro.request({
|
||||
method: "GET",
|
||||
url: `${process.env.TARO_API_API}/user/${urlwxid}`, //仅为示例,并非真实的接口地址
|
||||
// url: `${process.env.TARO_API_API}/user/${window.localStorage.getItem("openid")}`, //仅为示例,并非真实的接口地址
|
||||
success: function (res) {
|
||||
if (res?.data?.userInfo) {
|
||||
//判断wxid是否存在
|
||||
if (res?.data?.userInfo?.openid) {
|
||||
// window.alert(res?.data?.userInfo?.openid);
|
||||
// window.alert(window.localStorage.getItem("openid"));
|
||||
|
||||
if (
|
||||
res?.data?.userInfo?.openid !==
|
||||
window.localStorage.getItem("openid")
|
||||
) {
|
||||
// 删除其他用户的wxid
|
||||
window.localStorage.removeItem("userInfo");
|
||||
window.localStorage.removeItem("openid");
|
||||
window.localStorage.removeItem("wxid");
|
||||
window.location.href = "http://nomad.hackrobot.cn";
|
||||
} else {
|
||||
// 有完整的用户信息userInfo
|
||||
setuserInfo(res?.data?.userInfo);
|
||||
window.localStorage.setItem("userInfo", userInfo);
|
||||
}
|
||||
} else {
|
||||
// 绑定wxid与openid到数据库
|
||||
wxidTapopenid(urlwxid);
|
||||
}
|
||||
} else {
|
||||
// 新增wxid用户
|
||||
}
|
||||
},
|
||||
complete: function (finy) {
|
||||
// tg消息通知
|
||||
tgMessage();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// tg消息通知
|
||||
tgMessage();
|
||||
}
|
||||
return wxid;
|
||||
};
|
||||
|
||||
// 绑定wxid与openid
|
||||
const wxidTapopenid = (newWxid) => {
|
||||
const userUpdateData = {
|
||||
openid: window.localStorage.getItem("openid"), // 只更新 openid 字段
|
||||
};
|
||||
Taro.request({
|
||||
method: "PUT",
|
||||
// url: `${process.env.TARO_API_API}/user/${urlwxid}`, //仅为示例,并非真实的接口地址
|
||||
url: `${process.env.TARO_API_API}/user/${newWxid}`, //仅为示例,并非真实的接口地址
|
||||
data: userUpdateData,
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
success: function (res) {},
|
||||
fail: function (err) {},
|
||||
complete: function (finy) {},
|
||||
});
|
||||
};
|
||||
|
||||
// 新增openid用户
|
||||
const addopenidUser = () => {
|
||||
const userUpdateData = {
|
||||
openid: window.localStorage.getItem("openid"), // 只更新 openid 字段
|
||||
};
|
||||
Taro.request({
|
||||
method: "GET",
|
||||
// url: `${process.env.TARO_API_API}/user/${urlwxid}`, //仅为示例,并非真实的接口地址
|
||||
url: `${process.env.TARO_API_API}/user/${window.localStorage.getItem(
|
||||
"openid"
|
||||
)}`, //仅为示例,并非真实的接口地址
|
||||
data: userUpdateData,
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
success: function (res) {},
|
||||
fail: function (err) {},
|
||||
complete: function (finy) {},
|
||||
});
|
||||
};
|
||||
|
||||
// 网页查看通知
|
||||
const tgMessage = () => {
|
||||
Taro.request({
|
||||
method: "GET",
|
||||
url: `${
|
||||
process.env.TARO_API_API
|
||||
}/tgMessage?openid=${window.localStorage.getItem("openid")}`, //仅为示例,并非真实的接口地址
|
||||
// url: "https://pay.hackrobot.cn${process.env.TARO_API_API}/payh5", //仅为示例,并非真实的接口地址
|
||||
success: function (res) {
|
||||
console.log("访问提醒发送成功");
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 入群申请
|
||||
|
||||
useEffect(() => {
|
||||
let inwechat = isWeChatFun();
|
||||
if (inwechat) {
|
||||
// 获取openId
|
||||
getOpenid();
|
||||
} else {
|
||||
// window.alert('不在微信')
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// alert(window.localStorage.getItem("bookpay"))
|
||||
setbookpay(window.localStorage.getItem("bookpay"));
|
||||
}, []);
|
||||
|
||||
const goBack = () => {
|
||||
Taro.navigateBack({});
|
||||
};
|
||||
|
||||
const handleClick = (value) => {
|
||||
// window.alert(value)
|
||||
setopen(value);
|
||||
};
|
||||
|
||||
const payh5 = (type, total_fee = 1000) => {
|
||||
// console.log("111");
|
||||
Taro.request({
|
||||
method: "POST",
|
||||
url: `${process.env.TARO_API_API}/payh5`,
|
||||
// url: "${process.env.TARO_API_API}/payh5",
|
||||
|
||||
// url: "https://pay.hackrobot.cn${process.env.TARO_API_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");
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const goRead = () => {
|
||||
Taro.navigateTo({
|
||||
url: "/pages/book/index",
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<View className="index">
|
||||
{/* 在线图书 */}
|
||||
|
||||
{/* 参考资料https://readmake.com/ */}
|
||||
<View className="index-book animate__animated animate__pulse">
|
||||
<View className="index_book_left">
|
||||
<View className="left_title">《Youtube运营笔记》</View>
|
||||
<View className="left_text">数字游民-手册1</View>
|
||||
<View className="left_mobile">
|
||||
<Text>🚀 油管踩坑笔记</Text>
|
||||
<Text>1️⃣ YPP: 如何加入合作伙伴计划</Text>
|
||||
<Text>2️⃣ 基础:系统环境与静态住宅ip</Text>
|
||||
<Text>3️⃣ 收款:PIN码验证与外汇结算</Text>
|
||||
<Text>4️⃣ AI:辅助剪辑/生成视频</Text>
|
||||
{/* <Text>5️⃣ -----------------</Text> */}
|
||||
|
||||
<Text>🔥 一起实践,交流</Text>
|
||||
</View>
|
||||
|
||||
<View className="left_btn ">
|
||||
<AtButton
|
||||
onClick={() => {
|
||||
goRead();
|
||||
}}
|
||||
className="startRead"
|
||||
type="primary"
|
||||
size="small"
|
||||
circle
|
||||
>
|
||||
开始阅读
|
||||
</AtButton>
|
||||
</View>
|
||||
</View>
|
||||
<View className="index_book_img">
|
||||
<Image
|
||||
// style="width: 40%px;height:100%;background: #fff;"
|
||||
src={ytGpt}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View className="svgItems">
|
||||
<View className="svgItem">
|
||||
{" "}
|
||||
<View className="bookImg">
|
||||
<Image
|
||||
// style="width: 40%px;height:100%;background: #fff;"
|
||||
// src={book}
|
||||
src={youtube2}
|
||||
/>
|
||||
<View className="bookImg_text">YPP(合作伙伴计划)</View>
|
||||
</View>
|
||||
<View className="bookImg">
|
||||
<Image
|
||||
// style="width: 40%px;height:100%;background: #fff;"
|
||||
// src={book}
|
||||
src={youtube3}
|
||||
/>
|
||||
<View className="bookImg_text">💰赚美金</View>
|
||||
</View>
|
||||
<View className="bookImg">
|
||||
<Image
|
||||
// style="width: 40%px;height:100%;background: #fff;"
|
||||
// src={book}
|
||||
src={youtube4}
|
||||
/>
|
||||
<View className="bookImg_text">📷自媒体</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
{/* <View className="footer_div"></View> */}
|
||||
<View className="footer">
|
||||
{/* <View>《Youtube运营笔记》</View> */}
|
||||
<View>Copyright © 2025 </View>
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Index;
|
||||
188
src/pages/index/index.scss
Normal file
188
src/pages/index/index.scss
Normal file
@@ -0,0 +1,188 @@
|
||||
.index {
|
||||
// background-color: #002329;
|
||||
// width: 100vw;
|
||||
// height: 100vh;
|
||||
// padding-left: 100px;
|
||||
// padding-right: 100px;
|
||||
|
||||
.index-book {
|
||||
margin-top: 80px;
|
||||
// width: 100%;
|
||||
min-height: 300px;
|
||||
// padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
// background-color: #f0f0f0;
|
||||
// background-color: #f0f5ff;
|
||||
// background-color: yellow;
|
||||
.index_book_left {
|
||||
width: 600px;
|
||||
min-height: 300px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
// background-color: rgb(208, 255, 0);
|
||||
.left_title {
|
||||
font-size: 50px;
|
||||
font-weight: 700;
|
||||
color: #69b1ff;
|
||||
}
|
||||
.left_text {
|
||||
font-size: 30px;
|
||||
}
|
||||
.left_mobile {
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
font-size: 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// align-items: center;
|
||||
// justify-content: space-around;
|
||||
// background-color: yellow;
|
||||
|
||||
}
|
||||
.left_btn {
|
||||
margin-top: 40px;
|
||||
// background-color: aqua;
|
||||
// display: none;
|
||||
.startRead {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.index_book_img {
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.svgItems {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
// background-color: yellow;
|
||||
margin-top: 20px;
|
||||
// padding: 20px;
|
||||
.bookImg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.index_btn {
|
||||
// background-color: yellow;
|
||||
.startRead {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1536px) {
|
||||
.index {
|
||||
padding: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// background-color: aqua;
|
||||
|
||||
.index-book {
|
||||
width: 100%;
|
||||
max-width: 1400px;
|
||||
|
||||
// max-width: 2000px;
|
||||
// padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
// justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #f0f5ff;
|
||||
border-radius: 20px;
|
||||
|
||||
.index_book_left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
// background-color: yellow;
|
||||
// background-color: #69b1ff;
|
||||
.left_mobile {
|
||||
display: none;
|
||||
}
|
||||
.left_btn {
|
||||
display: flex;
|
||||
|
||||
.startRead {
|
||||
// display: flex;
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.index_book_img {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// background-color: yellow;
|
||||
}
|
||||
}
|
||||
|
||||
.svgItems {
|
||||
// width: 1400px;
|
||||
width: 100%;
|
||||
max-width: 1400px;
|
||||
margin-top: 80px;
|
||||
// padding: 0px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// background-color: #69b1ff;
|
||||
// background-color: yellow;
|
||||
// background-color: brown;
|
||||
.svgItem {
|
||||
// min-width: 1400px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
// background-color: #69b1ff;
|
||||
.bookImg {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// background-color: yellow;
|
||||
.bookImg_text {
|
||||
margin-top: 20px;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.index_btn {
|
||||
.startRead {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
// margin-bottom: 20px;
|
||||
font-size: 14px;
|
||||
// background-color: yellow;
|
||||
}
|
||||
177
src/pages/meetup/Detail/index.jsx
Normal file
177
src/pages/meetup/Detail/index.jsx
Normal file
@@ -0,0 +1,177 @@
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtAvatar } from "taro-ui";
|
||||
import { AtButton } from "taro-ui";
|
||||
// import Taro from "@tarojs/taro";
|
||||
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Detail = () => {
|
||||
const [current, setcurrent] = useState(2);
|
||||
const [id, setid] = useState(null);
|
||||
const [openid, setopenid] = useState(null);
|
||||
const [joinMeetup, setjoinMeetup] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
let newparams = Taro.getCurrentInstance().router.params;
|
||||
let newId = newparams.id;
|
||||
if (newId) {
|
||||
setid(newId);
|
||||
}
|
||||
let newjoinMeetup=window.localStorage.getItem('joinMeetup')
|
||||
setjoinMeetup(newjoinMeetup)
|
||||
}, []);
|
||||
|
||||
// const handleClick = (value) => {
|
||||
// console.log("value", value);
|
||||
// setcurrent(value);
|
||||
// if (value == 2) {
|
||||
// // 跳转到目的页面,在当前页面打开
|
||||
// Taro.navigateTo({
|
||||
// url: "/pages/my/index",
|
||||
// });
|
||||
// } else if (value == 0) {
|
||||
// Taro.navigateTo({
|
||||
// url: "/pages/index/index",
|
||||
// });
|
||||
// } else {
|
||||
// Taro.navigateTo({
|
||||
// url: "/pages/meetup/index",
|
||||
// });
|
||||
// }
|
||||
// };
|
||||
|
||||
const onBridgeReady = () => {
|
||||
WeixinJSBridge.call("hideOptionMenu");
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
let $instance = Taro.getCurrentInstance();
|
||||
// console.log("11");
|
||||
console.log($instance.router.params);
|
||||
// if (typeof WeixinJSBridge == "undefined") {
|
||||
// if (document.addEventListener) {
|
||||
// document.addEventListener("WeixinJSBridgeReady", onBridgeReady, false);
|
||||
// } else if (document.attachEvent) {
|
||||
// document.attachEvent("WeixinJSBridgeReady", onBridgeReady);
|
||||
// document.attachEvent("onWeixinJSBridgeReady", onBridgeReady);
|
||||
// }
|
||||
// }
|
||||
}, []);
|
||||
|
||||
const joinmeet = () => {
|
||||
// console.log("111");
|
||||
Taro.request({
|
||||
method:'POST',
|
||||
url: `${process.env.TARO_API_API}/payh5`, //仅为示例,并非真实的接口地址
|
||||
// url: "https://pay.hackrobot.cn${process.env.TARO_API_API}/payh5", //仅为示例,并非真实的接口地址
|
||||
|
||||
data: {
|
||||
callback_url:window.location.href,
|
||||
openid:window.localStorage.getItem('openid')
|
||||
},
|
||||
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") {
|
||||
setjoinMeetup(true)
|
||||
window.localStorage.setItem('joinMeetup',true)
|
||||
WeixinJSBridge.call("closeWindow");
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<View className="Detail">
|
||||
{/* <Text>Hello world!</Text> */}
|
||||
{/* <AtAvatar image='https://cdn.huodongxing.com/logo/202312/8732019012100/promoteMini.png'></AtAvatar> */}
|
||||
<View>
|
||||
<Image
|
||||
style="width:100%;height: 200px;background: #fff;"
|
||||
src={
|
||||
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
<AtList>
|
||||
<AtListItem title="[副业交流] 沙龙茶话会" onClick={() => {}} />
|
||||
<AtListItem title="日期" extraText="2023/12/06" arrow="" />
|
||||
<AtListItem title="报名人数" extraText="4/10" arrow="" />
|
||||
<AtListItem
|
||||
title="地点"
|
||||
note="广东省深圳市福田区石厦地铁站C口"
|
||||
extraText=""
|
||||
/>
|
||||
{/* <AtListItem title='禁用状态' disabled extraText='详细信息' /> */}
|
||||
</AtList>
|
||||
|
||||
{/* <AtList>
|
||||
<AtListItem
|
||||
title="联系我们"
|
||||
note=""
|
||||
arrow="right"
|
||||
iconInfo={{ size: 25, color: "#78A4FA", value: "calendar" }}
|
||||
/>
|
||||
<AtListItem
|
||||
title="版本日志"
|
||||
note=""
|
||||
extraText=""
|
||||
arrow="right"
|
||||
iconInfo={{ size: 25, color: "#FF4949", value: "bookmark" }}
|
||||
/>
|
||||
</AtList> */}
|
||||
|
||||
<View>
|
||||
<AtButton
|
||||
className="bottomBtn"
|
||||
type="primary"
|
||||
onClick={() => joinmeet()}
|
||||
disabled={joinMeetup}
|
||||
>
|
||||
{!!joinMeetup?'已报名':'立即报名'}
|
||||
</AtButton>
|
||||
</View>
|
||||
|
||||
{/* <View className="indexTablebar">
|
||||
<AtTabBar
|
||||
tabList={[
|
||||
{ title: "首页", text: "" },
|
||||
{ title: "活动" },
|
||||
{ title: "我的" },
|
||||
]}
|
||||
onClick={(value) => handleClick(value)}
|
||||
current={current}
|
||||
/>
|
||||
</View> */}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Detail;
|
||||
11
src/pages/meetup/Detail/index.scss
Normal file
11
src/pages/meetup/Detail/index.scss
Normal file
@@ -0,0 +1,11 @@
|
||||
.Detail{
|
||||
|
||||
|
||||
|
||||
.bottomBtn{
|
||||
display: flex;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
155
src/pages/meetup/index.jsx
Normal file
155
src/pages/meetup/index.jsx
Normal file
@@ -0,0 +1,155 @@
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtButton } from "taro-ui";
|
||||
|
||||
import { Picker } from "@tarojs/components";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import { AtNavBar } from "taro-ui";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Meetup = () => {
|
||||
const [current, setcurrent] = useState(1);
|
||||
const [joinMeetup, setjoinMeetup] = useState(false);
|
||||
|
||||
const [pickData, setpickData] = useState({
|
||||
selector: ["美国", "中国", "巴西", "日本"],
|
||||
selectorChecked: "美国",
|
||||
timeSel: "12:01",
|
||||
dateSel: "2018-04-22",
|
||||
});
|
||||
const handleClick = (value) => {
|
||||
console.log("value", value);
|
||||
setcurrent(value);
|
||||
if (value == 2) {
|
||||
// 跳转到目的页面,在当前页面打开
|
||||
Taro.navigateTo({
|
||||
url: "/pages/my/index",
|
||||
});
|
||||
} else if (value == 0) {
|
||||
Taro.navigateTo({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
} else {
|
||||
Taro.navigateTo({
|
||||
url: "/pages/meetup/index",
|
||||
});
|
||||
}
|
||||
};
|
||||
const goBack = () => {
|
||||
// window.history.back();
|
||||
Taro.navigateBack({
|
||||
// delta: 2
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
let newjoinMeetup = window.localStorage.getItem("joinMeetup");
|
||||
setjoinMeetup(newjoinMeetup);
|
||||
|
||||
// window.localStorage.removeItem("joinMeetup");
|
||||
// setjoinMeetup(false)
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<View className="my">
|
||||
{/* <AtNavBar
|
||||
// onClickRgIconSt={handleClick}
|
||||
// onClickRgIconNd={handleClick}
|
||||
// onClickLeftIcon={goBack}
|
||||
// leftIconType="chevron-left"
|
||||
color="#000"
|
||||
title="活动列表"
|
||||
// leftText='返回'
|
||||
// rightFirstIconType='bullet-list'
|
||||
// rightSecondIconType='user'
|
||||
/> */}
|
||||
{/* <Text>Hello world!</Text> */}
|
||||
|
||||
{/* <View className="page-section">
|
||||
<View>
|
||||
<Picker mode="selector" range={pickData.selector} onChange={() => {}}>
|
||||
<AtList>
|
||||
<AtListItem
|
||||
title="国家地区"
|
||||
extraText={pickData.selectorChecked}
|
||||
/>
|
||||
</AtList>
|
||||
</Picker>
|
||||
</View>
|
||||
<View>
|
||||
<Picker mode="selector" range={pickData.selector} onChange={() => {}}>
|
||||
<AtList>
|
||||
<AtListItem
|
||||
title="国家地区"
|
||||
extraText={pickData.selectorChecked}
|
||||
/>
|
||||
</AtList>
|
||||
</Picker>
|
||||
</View>
|
||||
</View> */}
|
||||
|
||||
<AtCard
|
||||
note=""
|
||||
extra=""
|
||||
title="[副业交流] 沙龙茶话会"
|
||||
thumb="http://www.logoquan.com/upload/list/20180421/logoquan15259400209.PNG"
|
||||
>
|
||||
<View className="meetupCard">
|
||||
{" "}
|
||||
<View className="left">
|
||||
{" "}
|
||||
<Image
|
||||
style="width: 150px;height: 100px;background: #fff;"
|
||||
src={
|
||||
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
<View className="right">
|
||||
<View className="up">
|
||||
<span style={{ color: "green" }}>[已报名]</span> 4/10
|
||||
</View>
|
||||
<View className="middle">2023/12/06 星期三</View>
|
||||
<View className="down">
|
||||
<AtButton
|
||||
type="primary"
|
||||
size="small"
|
||||
className="submitBtn"
|
||||
disabled={joinMeetup}
|
||||
onClick={() => {
|
||||
Taro.navigateTo({
|
||||
url: "/pages/meetup/Detail/index",
|
||||
});
|
||||
}}
|
||||
>
|
||||
{!!joinMeetup ? "已报名" : "立即报名"}
|
||||
</AtButton>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</AtCard>
|
||||
|
||||
<View className="indexTablebar">
|
||||
<AtTabBar
|
||||
tabList={[
|
||||
{ title: "首页", text: "" },
|
||||
{ title: "活动" },
|
||||
{ title: "我的" },
|
||||
]}
|
||||
onClick={(value) => handleClick(value)}
|
||||
current={current}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Meetup;
|
||||
42
src/pages/meetup/index.scss
Normal file
42
src/pages/meetup/index.scss
Normal file
@@ -0,0 +1,42 @@
|
||||
.my{
|
||||
margin-top: 20px;
|
||||
|
||||
.page-section{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.meetupCard {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.right {
|
||||
// background-color: yellow;
|
||||
width: 100%;
|
||||
margin-left: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.down {
|
||||
width: 200px;
|
||||
// background-color: aqua;
|
||||
position: relative;
|
||||
bottom: 10px;
|
||||
right: -120px;
|
||||
// display: flex;
|
||||
// flex-direction: column-reverse;
|
||||
// justify-content:flex-end
|
||||
// position: relative;
|
||||
.submitBtn {
|
||||
// width: 200px;
|
||||
// position: absolute;
|
||||
// right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.indexTablebar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
3
src/pages/model/index.config.js
Normal file
3
src/pages/model/index.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '模版页面'
|
||||
}
|
||||
4
src/pages/model/index.scss
Normal file
4
src/pages/model/index.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
.Model{
|
||||
padding: 40px;
|
||||
|
||||
}
|
||||
31
src/pages/model/index.tsx
Normal file
31
src/pages/model/index.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
// @ts-nocheck
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtButton, AtInput, AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtAvatar } from "taro-ui";
|
||||
import { AtTag } from "taro-ui";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import { AtForm, AtMessage } from "taro-ui";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Model = () => {
|
||||
useEffect(() => {}, []);
|
||||
|
||||
const handleClick = (value) => {
|
||||
// 跳转到目的页面,在当前页面打开
|
||||
Taro.navigateTo({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
};
|
||||
|
||||
return <View className="Model">模版</View>;
|
||||
};
|
||||
|
||||
export default Model;
|
||||
92
src/pages/my/index.jsx
Normal file
92
src/pages/my/index.jsx
Normal file
@@ -0,0 +1,92 @@
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtAvatar } from "taro-ui";
|
||||
import { AtTag } from "taro-ui";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import avatar from "../../images/avatar.jpg";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const My = () => {
|
||||
const [current, setcurrent] = useState(2);
|
||||
const [wxid, setwxid] = useState(null);
|
||||
|
||||
useEffect(()=>{
|
||||
getWxid()
|
||||
},[])
|
||||
|
||||
const getWxid = () => {
|
||||
let newWxid = window.localStorage.getItem("wxid");
|
||||
if (!!newWxid) {
|
||||
setwxid(newWxid);
|
||||
}
|
||||
};
|
||||
|
||||
const handleClick = (value) => {
|
||||
console.log("value", value);
|
||||
setcurrent(value);
|
||||
if (value == 2) {
|
||||
// 跳转到目的页面,在当前页面打开
|
||||
Taro.navigateTo({
|
||||
url: "/pages/my/index",
|
||||
});
|
||||
} else if (value == 0) {
|
||||
Taro.navigateTo({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
} else {
|
||||
Taro.navigateTo({
|
||||
url: "/pages/meetup/index",
|
||||
});
|
||||
}
|
||||
};
|
||||
return (
|
||||
<View className="my">
|
||||
{/* <Text>Hello world!</Text> */}
|
||||
|
||||
<View className="myAtAvatar">
|
||||
<AtAvatar className="AtAvatar" image={avatar}></AtAvatar>
|
||||
<AtTag type="primary" circle>
|
||||
新注册用户
|
||||
</AtTag>
|
||||
</View>
|
||||
|
||||
<AtList>
|
||||
<AtListItem
|
||||
title="联系我们"
|
||||
note=""
|
||||
arrow="right"
|
||||
iconInfo={{ size: 25, color: "#78A4FA", value: "calendar" }}
|
||||
/>
|
||||
<AtListItem
|
||||
title="版本日志"
|
||||
note=""
|
||||
extraText=""
|
||||
arrow="right"
|
||||
iconInfo={{ size: 25, color: "#FF4949", value: "bookmark" }}
|
||||
/>
|
||||
</AtList>
|
||||
|
||||
<View className="indexTablebar">
|
||||
<AtTabBar
|
||||
tabList={[
|
||||
{ title: "首页", text: "" },
|
||||
{ title: "活动" },
|
||||
{ title: "我的" },
|
||||
]}
|
||||
onClick={(value) => handleClick(value)}
|
||||
current={current}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default My;
|
||||
23
src/pages/my/index.scss
Normal file
23
src/pages/my/index.scss
Normal file
@@ -0,0 +1,23 @@
|
||||
.my{
|
||||
|
||||
.myAtAvatar{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
// background-color: #f4ffb8;
|
||||
// padding-left: 20px;
|
||||
// padding-right: 20px;
|
||||
.AtAvatar{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.indexTablebar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
3
src/pages/planet/index.config.js
Normal file
3
src/pages/planet/index.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '副业沙龙'
|
||||
}
|
||||
23
src/pages/planet/index.scss
Normal file
23
src/pages/planet/index.scss
Normal file
@@ -0,0 +1,23 @@
|
||||
.Model {
|
||||
padding: 20px;
|
||||
|
||||
.bottomDiv {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
// background-color: yellow;
|
||||
}
|
||||
|
||||
.joinSalon {
|
||||
// position: relative;
|
||||
bottom: 20px;
|
||||
position: fixed;
|
||||
width: 700px;
|
||||
}
|
||||
|
||||
.model-emoji {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
217
src/pages/planet/index.tsx
Normal file
217
src/pages/planet/index.tsx
Normal file
@@ -0,0 +1,217 @@
|
||||
// @ts-nocheck
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image, Button } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtButton, AtInput, AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtTag } from "taro-ui";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import { AtForm, AtMessage } from "taro-ui";
|
||||
import loft from "../../images/loft.png";
|
||||
import nomadvloglife from "../../images/nomadvloglife.png";
|
||||
|
||||
import {
|
||||
AtModal,
|
||||
AtModalHeader,
|
||||
AtModalContent,
|
||||
AtModalAction,
|
||||
AtAvatar,
|
||||
AtAccordion,
|
||||
} from "taro-ui";
|
||||
|
||||
import qrcode from "../../images/qrcode.png";
|
||||
import joinGroup from "../../images/joinGroup.png";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Salon = () => {
|
||||
const [meetupQR, setmeetupQR] = useState(false);
|
||||
const [isWeChat, setisWeChat] = useState(false);
|
||||
const [meetup, setmeetup] = useState(window.localStorage.getItem("meetup"));
|
||||
|
||||
useEffect(() => {
|
||||
isWeChatFun();
|
||||
}, []);
|
||||
|
||||
// const handleClick = (value) => {
|
||||
// // 跳转到目的页面,在当前页面打开
|
||||
// Taro.navigateTo({
|
||||
// url: "/pages/index/index",
|
||||
// });
|
||||
// };
|
||||
|
||||
// 是否在微信客户端
|
||||
const isWeChatFun = () => {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf("micromessenger") != -1) {
|
||||
setisWeChat(true);
|
||||
return true;
|
||||
} else {
|
||||
setisWeChat(false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const payh5 = (type, total_fee = 1000) => {
|
||||
// console.log("111");
|
||||
Taro.request({
|
||||
method: "POST",
|
||||
url: `${process.env.TARO_API_API}/payh5`, //仅为示例,并非真实的接口地址
|
||||
// url: "https://pay.hackrobot.cn${process.env.TARO_API_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="Model">
|
||||
<View className="meetup-left">
|
||||
<Image style="width: 100%;height: 100px;background: #fff;" src={loft} />
|
||||
</View>
|
||||
|
||||
<View className="at-article">
|
||||
<View className="at-article__h1">技术交流群</View>
|
||||
<View className="at-article__info">
|
||||
{/* 2017-05-07 */}
|
||||
异度星球
|
||||
</View>
|
||||
<View className="at-article__content">
|
||||
<View className="at-article__section">
|
||||
<View className="at-article__h2">群简介</View>
|
||||
<View className="at-article__h3">| 📣技术爱好者</View>
|
||||
<View className="at-article__p">
|
||||
微信群是一个交流技术的平台,不限软件/硬件
|
||||
</View>
|
||||
<br />
|
||||
<View className="at-article__h3">| 📋入群须知</View>
|
||||
<View className="at-article__p">
|
||||
微信群只是一个沟通平台,与其他伙伴搭桥
|
||||
<br />
|
||||
可以讨论但不限于:
|
||||
<br />
|
||||
1️⃣云手机
|
||||
<br />
|
||||
2️⃣机器人
|
||||
<br />
|
||||
3️⃣AIGC /边缘计算
|
||||
</View>
|
||||
<br />
|
||||
<View className="at-article__h3">| ❌禁止以下行为</View>
|
||||
<View className="at-article__p">
|
||||
🚫营销推广
|
||||
<br />
|
||||
🚫恶意捣乱
|
||||
<br />
|
||||
<br />
|
||||
❗群主没有解答义务,勿随意@
|
||||
{/* <br />
|
||||
💰价格29元/人 (场地成本) */}
|
||||
</View>
|
||||
<br />
|
||||
{meetup == 1 ? (
|
||||
<View className="at-article__h3">| ☕入群口令:3399</View>
|
||||
) : null}
|
||||
{meetup == 1 ? (
|
||||
<View className="at-article__p">
|
||||
{`ID:${window.localStorage.getItem("openid")}`}
|
||||
</View>
|
||||
) : null}
|
||||
{/* 已报名 */}
|
||||
{meetup == 1 ? (
|
||||
<View className="model-emoji">
|
||||
<Image
|
||||
style="width: 240px;height: 240px;background: #fff;"
|
||||
// src={qrcode}
|
||||
src={joinGroup}
|
||||
/>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View className="bottomDiv"></View>
|
||||
{/* 判断有没有wxid,是否女性 */}
|
||||
<AtButton
|
||||
type="primary"
|
||||
size="normal"
|
||||
className="joinSalon"
|
||||
onClick={() => {
|
||||
if (meetup == 1) {
|
||||
return false;
|
||||
} else {
|
||||
if (!!isWeChat) {
|
||||
payh5("meetup", 2900);
|
||||
} else {
|
||||
setmeetupQR(true);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
{meetup == 1 ? "入群口令: 3399" : `立即加入`}
|
||||
</AtButton>
|
||||
|
||||
<View className="meetupQR">
|
||||
{/* 软件下载模态窗 */}
|
||||
<AtModal isOpened={meetupQR}>
|
||||
<AtModalHeader>咨询沙龙</AtModalHeader>
|
||||
<AtModalContent>
|
||||
<View className="model-emoji">
|
||||
<Image
|
||||
// style="width: 100%;height: 240px;background: #fff;"
|
||||
src={qrcode}
|
||||
/>
|
||||
</View>
|
||||
</AtModalContent>
|
||||
<AtModalAction>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setmeetupQR(false);
|
||||
}}
|
||||
>
|
||||
知道了
|
||||
</Button>
|
||||
</AtModalAction>
|
||||
</AtModal>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Salon;
|
||||
3
src/pages/salon/index.config.js
Normal file
3
src/pages/salon/index.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '异度星球'
|
||||
}
|
||||
35
src/pages/salon/index.scss
Normal file
35
src/pages/salon/index.scss
Normal file
@@ -0,0 +1,35 @@
|
||||
.Model {
|
||||
padding: 20px;
|
||||
|
||||
.bottomDiv {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
// background-color: yellow;
|
||||
}
|
||||
|
||||
.joinSalon {
|
||||
// position: relative;
|
||||
bottom: 20px;
|
||||
position: fixed;
|
||||
width: 700px;
|
||||
font-weight: 600;
|
||||
background-color:#72D572 ;
|
||||
border-color: #72D572 ;;
|
||||
}
|
||||
|
||||
.model-emoji {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.no-border {
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
248
src/pages/salon/index.tsx
Normal file
248
src/pages/salon/index.tsx
Normal file
@@ -0,0 +1,248 @@
|
||||
// @ts-nocheck
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image, Button } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtButton, AtInput, AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtTag } from "taro-ui";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import { AtForm, AtMessage } from "taro-ui";
|
||||
import loft from "../../images/loft.png";
|
||||
import nomadvloglife from "../../images/nomadvloglife.png";
|
||||
|
||||
import {
|
||||
AtModal,
|
||||
AtModalHeader,
|
||||
AtModalContent,
|
||||
AtModalAction,
|
||||
AtAvatar,
|
||||
AtAccordion,
|
||||
} from "taro-ui";
|
||||
|
||||
import qrcode from "../../images/qrcode.png";
|
||||
import joinGroup from "../../images/joinGroup.png";
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Salon = () => {
|
||||
const [meetupQR, setmeetupQR] = useState(false);
|
||||
const [isWeChat, setisWeChat] = useState(false);
|
||||
const [meetup, setmeetup] = useState(window.localStorage.getItem("meetup"));
|
||||
|
||||
useEffect(() => {
|
||||
isWeChatFun();
|
||||
}, []);
|
||||
|
||||
// const handleClick = (value) => {
|
||||
// // 跳转到目的页面,在当前页面打开
|
||||
// Taro.navigateTo({
|
||||
// url: "/pages/index/index",
|
||||
// });
|
||||
// };
|
||||
|
||||
// 是否在微信客户端
|
||||
const isWeChatFun = () => {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf("micromessenger") != -1) {
|
||||
setisWeChat(true);
|
||||
return true;
|
||||
} else {
|
||||
setisWeChat(false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const payh5 = (type, total_fee = 1000) => {
|
||||
// console.log("111");
|
||||
Taro.request({
|
||||
method: "POST",
|
||||
url: `${process.env.TARO_API_API}/payh5`, //仅为示例,并非真实的接口地址
|
||||
// url: "https://pay.hackrobot.cn${process.env.TARO_API_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="Model">
|
||||
<View className="meetup-left">
|
||||
<Image style="width: 100%;height: 100px;background: #fff;" src={loft} />
|
||||
</View>
|
||||
|
||||
{meetup != 1 ? (
|
||||
<View className="at-article">
|
||||
<View className="at-article__h1">异度星球</View>
|
||||
<View className="at-article__info">
|
||||
{/* 2017-05-07 */}
|
||||
异度星球
|
||||
</View>
|
||||
<View className="at-article__content">
|
||||
<View className="at-article__section">
|
||||
<View className="at-article__h2">群简介</View>
|
||||
<View className="at-article__h3">| 📣技术爱好者</View>
|
||||
<View className="at-article__p">
|
||||
{/* 微信群是一个交流技术的平台,不限软件/硬件 */}
|
||||
交流灌水
|
||||
<br />
|
||||
践行『长期价值』和『杠杆主义』
|
||||
<br />
|
||||
折腾开源软件和开源硬件
|
||||
{/* <br />
|
||||
长期更新 */}
|
||||
</View>
|
||||
<br />
|
||||
<View className="at-article__h3">| 📋核心主题</View>
|
||||
<View className="at-article__p">
|
||||
{/* 微信群只是一个沟通平台,与其他伙伴搭桥
|
||||
<br /> */}
|
||||
包括但不限于:
|
||||
<br />
|
||||
1️⃣云手机
|
||||
<br />
|
||||
2️⃣微信机器人
|
||||
<br />
|
||||
3️⃣AIGC /边缘计算
|
||||
</View>
|
||||
<br />
|
||||
<View className="at-article__h3">| 🟩微信群</View>
|
||||
<View className="at-article__p">
|
||||
{/* 『微信群』是一个沟通平台,
|
||||
<br />
|
||||
加入后,会显示『入群口令』
|
||||
<br /> */}
|
||||
机器人会自动邀请加群
|
||||
</View>
|
||||
<br />
|
||||
<View className="at-article__h3">| 🔊声明</View>
|
||||
<View className="at-article__p">
|
||||
🚫禁止营销推广
|
||||
<br />
|
||||
{/* 🚫恶意捣乱
|
||||
<br />
|
||||
<br /> */}
|
||||
❗请勿随意@群主
|
||||
</View>
|
||||
|
||||
<br />
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
) : (
|
||||
<View>
|
||||
<View>
|
||||
<View className="at-article__h3">| ☕微信自动入群口令:<span style={{color:"red"}}>3399</span></View>
|
||||
<View className="at-article__p">
|
||||
{`ID:${window.localStorage.getItem("openid")}`}
|
||||
</View>
|
||||
|
||||
<View className="model-emoji">
|
||||
<Image
|
||||
// style="width: 100%;height: 240px;background: #fff;"
|
||||
src={qrcode}
|
||||
/>
|
||||
</View>
|
||||
<View className="model-emoji">
|
||||
<Image
|
||||
style="width: 240px;height: 240px;background: #fff;"
|
||||
// src={qrcode}
|
||||
src={joinGroup}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
{/* webview=社区 */}
|
||||
{/* <iframe
|
||||
className="no-border"
|
||||
src="https://memos.nomadcna.com/"
|
||||
></iframe> */}
|
||||
</View>
|
||||
)}
|
||||
|
||||
<View className="bottomDiv"></View>
|
||||
{/* 判断有没有wxid,是否女性 */}
|
||||
{meetup != 1 ? (
|
||||
<AtButton
|
||||
type="primary"
|
||||
size="normal"
|
||||
className="joinSalon"
|
||||
onClick={() => {
|
||||
if (meetup == 1) {
|
||||
return false;
|
||||
} else {
|
||||
if (!!isWeChat) {
|
||||
// 1元
|
||||
payh5("meetup", 100);
|
||||
} else {
|
||||
setmeetupQR(true);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
{/* {meetup == 1 ? "已加入" : `立即加入`} */}
|
||||
{`立即加入 ¥1`}
|
||||
</AtButton>
|
||||
) : null}
|
||||
|
||||
<View className="meetupQR">
|
||||
{/* 软件下载模态窗 */}
|
||||
<AtModal isOpened={meetupQR}>
|
||||
<AtModalHeader>添加好友</AtModalHeader>
|
||||
<AtModalContent>
|
||||
<View className="model-emoji">
|
||||
<Image
|
||||
// style="width: 100%;height: 240px;background: #fff;"
|
||||
src={qrcode}
|
||||
/>
|
||||
</View>
|
||||
</AtModalContent>
|
||||
<AtModalAction>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setmeetupQR(false);
|
||||
}}
|
||||
>
|
||||
知道了
|
||||
</Button>
|
||||
</AtModalAction>
|
||||
</AtModal>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Salon;
|
||||
3
src/pages/sphone/index.config.js
Normal file
3
src/pages/sphone/index.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '云手机'
|
||||
}
|
||||
37
src/pages/sphone/index.scss
Normal file
37
src/pages/sphone/index.scss
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
// 在 src/index.scss 中引入 GitHub Markdown 主题
|
||||
@import 'github-markdown-css/github-markdown.css';
|
||||
|
||||
.Sphone {
|
||||
padding: 40px;
|
||||
// font-size: 30px !important;
|
||||
// color: #666;
|
||||
|
||||
.markdown-body{
|
||||
font-size: 30px !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto; /* 保持图像的纵横比 */
|
||||
}
|
||||
.formCode {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.codeBtn {
|
||||
background-color: aquamarine;
|
||||
// height: 80px;
|
||||
// color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.joinSalon {
|
||||
// position: relative;
|
||||
// bottom: 20px;
|
||||
// position: fixed;
|
||||
width: 700px;
|
||||
font-weight: 600;
|
||||
background-color:#72D572 ;
|
||||
border-color: #72D572 ;;
|
||||
}
|
||||
|
||||
}
|
||||
151
src/pages/sphone/index.tsx
Normal file
151
src/pages/sphone/index.tsx
Normal file
@@ -0,0 +1,151 @@
|
||||
// @ts-nocheck
|
||||
import { Component } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
import { AtButton, AtInput, AtTabBar } from "taro-ui";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { AtGrid } from "taro-ui";
|
||||
import { Swiper, SwiperItem } from "@tarojs/components";
|
||||
import { AtCard } from "taro-ui";
|
||||
import { AtImagePicker } from "taro-ui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { AtAvatar } from "taro-ui";
|
||||
import { AtTag } from "taro-ui";
|
||||
import { AtList, AtListItem } from "taro-ui";
|
||||
import { AtForm, AtMessage } from "taro-ui";
|
||||
import { marked } from "marked";
|
||||
import infoText from "./info.md";
|
||||
import payText from "./pay.md";
|
||||
|
||||
marked.setOptions({
|
||||
breaks: true, // 是否回车换行
|
||||
gfm: true, //使用经批准的 GitHub Flavored Markdown (GFM) 规范
|
||||
// pedantic: true, //严格模式
|
||||
// highlight(code:any, lang:any) {
|
||||
// // 语法高亮
|
||||
// let val = code;
|
||||
// if (lang) {
|
||||
// val = hljs.highlight(lang, code).value;
|
||||
// } else {
|
||||
// val = hljs.highlightAuto(code).value;
|
||||
// }
|
||||
// return val;
|
||||
// },
|
||||
});
|
||||
|
||||
// const renderer = new marked.Renderer();
|
||||
// // 使用拓展
|
||||
// marked.use({ renderer });
|
||||
|
||||
// export default class Index extends Component {
|
||||
const Sphone = () => {
|
||||
const [markText, setmarkText] = useState();
|
||||
const [isWeChat, setisWeChat] = useState(false);
|
||||
|
||||
const [sphone, setsphone] = useState(window.localStorage.getItem("sphone"));
|
||||
|
||||
useEffect(() => {
|
||||
isWeChatFun();
|
||||
}, []);
|
||||
|
||||
// const handleClick = (value) => {
|
||||
// // 跳转到目的页面,在当前页面打开
|
||||
// Taro.navigateTo({
|
||||
// url: "/pages/index/index",
|
||||
// });
|
||||
// };
|
||||
|
||||
// 是否在微信客户端
|
||||
const isWeChatFun = () => {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf("micromessenger") != -1) {
|
||||
setisWeChat(true);
|
||||
return true;
|
||||
} else {
|
||||
setisWeChat(false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const payh5 = (type, total_fee = 1000) => {
|
||||
// console.log("111");
|
||||
Taro.request({
|
||||
method: "POST",
|
||||
url: `${process.env.TARO_API_API}/payh5`, //仅为示例,并非真实的接口地址
|
||||
// url: "https://pay.hackrobot.cn${process.env.TARO_API_API}/payh5", //仅为示例,并非真实的接口地址
|
||||
|
||||
data: {
|
||||
callback_url: window.location.href,
|
||||
openid: window.localStorage.getItem("openid"),
|
||||
total_fee: total_fee, // 金额,单位:分
|
||||
type: type, //订单类型 sphone/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); //订单类型 sphone/meetup/video/vip
|
||||
WeixinJSBridge.call("closeWindow");
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<View className="Sphone">
|
||||
<View
|
||||
className="markdown-body" // 添加 GitHub Markdown 主题类
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: marked(sphone == 1 ? payText : infoText),
|
||||
}}
|
||||
></View>
|
||||
|
||||
<View className="bottomDiv"></View>
|
||||
{/* 判断有没有wxid,是否女性 */}
|
||||
{sphone != 1 ? (
|
||||
<AtButton
|
||||
type="primary"
|
||||
size="normal"
|
||||
className="joinSalon"
|
||||
onClick={() => {
|
||||
if (sphone == 1) {
|
||||
return false;
|
||||
} else {
|
||||
if (!!isWeChat) {
|
||||
// 180元
|
||||
payh5("sphone", 18000);
|
||||
} else {
|
||||
// setmeetupQR(true);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
{/* {meetup == 1 ? "已加入" : `立即加入`} */}
|
||||
{`阅读更多 80`}
|
||||
</AtButton>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sphone;
|
||||
51
src/pages/sphone/info.md
Normal file
51
src/pages/sphone/info.md
Normal file
@@ -0,0 +1,51 @@
|
||||
## 云手机教程
|
||||
|
||||
> docker部署
|
||||
|
||||

|
||||
|
||||
> 原生安卓AOSP
|
||||
|
||||
.png?imageSlim)
|
||||
|
||||
***
|
||||
|
||||
## 目录
|
||||
|
||||
- 云手机设备指北
|
||||
|
||||
- 硬件选型
|
||||
|
||||
- 方案1:docker容器化安卓
|
||||
|
||||
- 虚拟化的优缺点/设置
|
||||
|
||||
- 方案2:主板+原生AOSP
|
||||
|
||||
- root权限与magisk配置
|
||||
|
||||
- OTG外设配件
|
||||
|
||||
- 内网穿透
|
||||
|
||||
- 远程控制:云控
|
||||
|
||||
- 魔法:多开/群控/应用变量/gps/ip属地
|
||||
|
||||
- 应用场景:无人直播/机器人bot/RPA自动化+数据爬虫
|
||||
|
||||
- 杂谈~~
|
||||
|
||||
***
|
||||
|
||||
## 简述
|
||||
|
||||
教程属于`操作类,不是原理`
|
||||
|
||||
比如不涉及:内核编译,ROM定制,虚拟化
|
||||
|
||||
图文+视频录制
|
||||
|
||||
长期更新
|
||||
|
||||
|
||||
79
src/pages/sphone/pay.md
Normal file
79
src/pages/sphone/pay.md
Normal file
@@ -0,0 +1,79 @@
|
||||
## 云手机教程
|
||||
|
||||
> docker部署
|
||||
|
||||

|
||||
|
||||
> 原生安卓AOSP
|
||||
|
||||
.png?imageSlim)
|
||||
|
||||
***
|
||||
|
||||
## 目录
|
||||
|
||||
- 云手机设备指北
|
||||
|
||||
- 硬件选型
|
||||
|
||||
- 方案1:docker容器化安卓
|
||||
|
||||
- 虚拟化的优缺点/设置
|
||||
|
||||
- 方案2:主板+原生AOSP
|
||||
|
||||
- root权限与magisk配置
|
||||
|
||||
- OTG外设配件
|
||||
|
||||
- 内网穿透
|
||||
|
||||
- 远程控制:云控
|
||||
|
||||
- 魔法:多开/群控/应用变量/gps/ip属地
|
||||
|
||||
- 应用场景:无人直播/机器人bot/RPA自动化+数据爬虫
|
||||
|
||||
- 杂谈~~
|
||||
|
||||
***
|
||||
|
||||
## 简述
|
||||
|
||||
教程属于`操作类,不是原理`
|
||||
|
||||
比如不涉及:内核编译,ROM定制,虚拟化
|
||||
|
||||
图文+视频录制
|
||||
|
||||
长期更新
|
||||
|
||||
***
|
||||
|
||||
## 云手机设备指北
|
||||
|
||||
这里说的云手机,默认指的
|
||||
|
||||
1. 开源硬件:ARM主板,
|
||||
|
||||
2. 设置安卓系统
|
||||
|
||||
3. 远程控制
|
||||
|
||||
***
|
||||
|
||||
## 硬件选型
|
||||
|
||||
建议购买RK3588芯片的开发板
|
||||
|
||||
- 香橙派5plus
|
||||
|
||||
- nvme ssd硬盘
|
||||
|
||||
- TF卡:用于测试系统
|
||||
|
||||
- 2个支持`uvc协议+带麦克风`的摄像头
|
||||
|
||||
|
||||
|
||||
教程正在更新中,视频录制操作过程,请等待
|
||||
Reference in New Issue
Block a user