21 Commits

Author SHA1 Message Date
eric
6fd48e40fb sss 2024-04-11 03:13:21 +00:00
hackrobot
1514ffd4c6 qwfqwf 2024-04-11 11:09:44 +08:00
hackrobot
8c5f3eb5fd afawfw 2024-04-11 11:00:47 +08:00
hackrobot
219423ed9b fwqf 2024-04-11 10:55:17 +08:00
hackrobot
61e588affe wqqwfwq 2024-04-11 10:41:28 +08:00
hackrobot
b64a0a013e ewwewet 2024-04-11 10:36:58 +08:00
hackrobot
b782557de1 saas 2024-04-11 10:31:49 +08:00
hackrobot
621e7fe1f2 qwfqw 2024-04-11 09:52:26 +08:00
hackrobot
6af9642ceb dffe 2024-04-11 09:33:44 +08:00
hackrobot
7a493f8320 wdwf 2024-04-11 09:22:52 +08:00
hackrobot
8f5b6e59f3 fqqf 2024-04-11 09:03:08 +08:00
hackrobot
9425042bd8 www 2024-04-11 08:52:49 +08:00
hackrobot
8918e5a1ad ewgw 2024-04-11 08:51:35 +08:00
hackrobot
16a1dfc7f2 dd 2024-04-11 02:17:11 +08:00
hackrobot
cef574e3e6 www 2024-04-11 01:34:02 +08:00
hackrobot
0b80e81a97 ddd 2024-04-11 01:03:04 +08:00
hackrobot
6b4bf3fdc1 ddd 2024-04-11 00:52:44 +08:00
hackrobot
9ad06c5adb update 2024-04-11 00:33:01 +08:00
hackrobot
be018507c7 update 2024-04-10 21:23:42 +08:00
eric
636ccda1fb 增加sh脚本 2024-04-10 10:57:48 +00:00
hackrobot
41ec6ea5e9 h5裂变 2024-04-10 17:55:19 +08:00
7 changed files with 225 additions and 274 deletions

View File

@@ -45,8 +45,7 @@ const config = {
esnextModules: ["taro-ui"],
publicPath: "/",
staticDirectory: "static",
postcss: {
autoprefixer: {
postcss: { autoprefixer: {
enable: true,
config: {},
},
@@ -76,13 +75,15 @@ const config = {
devServer: {
proxy: {
'/api/': {
target: JSON.parse('"http://localhost:8055"'), //本地调试端口
// target: JSON.parse('"http://localhost:28369"'), //本地调试端口
target: JSON.parse('"https://kunpeng.hackrobot.cn"'),
pathRewrite: {
'^/api/': '/'
},
changeOrigin: true
}
}
},
allowedHosts: "all"
}
},
};

3
link.sh Normal file
View File

@@ -0,0 +1,3 @@
yarn build:h5
cd dist
http-server --port 10086

BIN
src/images/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
src/images/see.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@@ -16,260 +16,252 @@ import { AtNavBar } from "taro-ui";
import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
import { AtToast } from "taro-ui";
import { AtIcon } from "taro-ui";
import see from "../../images/see.png";
import group from "../../images/group.png";
// export default class Index extends Component {
const Index = () => {
const [current, setcurrent] = useState(0);
const [openId, setopenId] = useState(null);
const [h5openid, seth5openid] = useState(null);
const [wxid, setwxid] = useState(null);
const [isOpened, setisOpened] = useState(false);
const [joinMeetup, setjoinMeetup] = useState(false);
// 获取openid
const getWxid = () => {
// let newparams = Taro.getCurrentInstance().router.params;
// let urlopenid = newparams.openid;
const [id, setid] = useState(null);
const [userInfo, setuserInfo] = useState({
wxid: null,
openId: null,
h5openid: null,
bighead: null,
city: null,
country: null,
generator: null,
id: null,
labels: null,
nickname: null,
province: null,
remark: null,
sex: null, //男
smallhead: null,
source: null,
sourceStr: null,
usertype: null,
v1: null,
wxaccount: null,
});
// hash模式
// http://192.168.31.245:10086/?openid=o7LFAwR32hWGq9XOpd7ZxK1wZxq8#/pages/index/index
const onBridgeReady = () => {
WeixinJSBridge.call("hideOptionMenu");
};
useEffect(()=>{
// window.alert('1111')
getopenId()
},[])
const h5openidUser = () => {
try {
const params = Taro.getCurrentInstance().router.params;
let hashopenid = window.localStorage.getItem("h5openid");
let localwxid = window.localStorage.getItem("wxid");
//发起网络请求
Taro.request({
// url: "/api/addH5openid",
url: "https://kunpeng.hackrobot.cn/addH5openid",
data: {
h5openid: hashopenid ?? null,
wxid: localwxid ?? null, //debug eric 的wxid
},
success: function (resUser) {
console.log(resUser);
console.log(resUser.data);
setuserInfo({ ...resUser.data });
},
});
} catch (e) {
} finally {
}
};
useEffect(() => {
let $instance = Taro.getCurrentInstance();
console.log($instance.router.params);
}, []);
// 获取openid
const getopenId = () => {
let hashopenid = null;
if (window.location.href.includes("openid")) {
// window.alert(window.location.href);
hashopenid = window.location.href
.split("#")[0]
.split("?")[1]
.split("=")[1];
} else {
hashopenid = window.localStorage.getItem("openid");
hashopenid = window.localStorage.getItem("h5openid");
}
// window.alert(hashopenid)
let newOpenid = window.localStorage.getItem("openid");
// window.alert(newOpenid)
if (
(!!newOpenid && newOpenid != "undefined" &&newOpenid != "null") ||
(!!hashopenid && hashopenid != "undefined"&&hashopenid != "null")
) {
// window.alert('存在')
// window.alert(hashopenid);
// window.alert(newOpenid);
window.localStorage.setItem("openid", hashopenid);
setopenId(hashopenid)
if (!!hashopenid && hashopenid != "undefined" && hashopenid != "null") {
window.localStorage.setItem("h5openid", hashopenid);
let localwxid = window.localStorage.getItem("wxid");
seth5openid(hashopenid);
// 查询用户信息
h5openidUser();
} else {
// window.alert('不存在')
let nowUrl = window.location.href;
// 获取路由参数
const params = Taro.getCurrentInstance().router.params;
console.log("params", params);
// window.alert(nowUrl)
if (params?.wxid) {
// 本地存储
window.localStorage.setItem("wxid", params?.wxid ?? "");
setwxid(params?.wxid);
let nowUrl = window.location.href;
let payUrl = `https://payjs.cn/api/openid?mchid=1561724891&callback_url=${nowUrl}`;
window.location.href = payUrl;
}
};
useEffect(() => {
getWxid();
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 goBack = () => {
// window.history.back();
Taro.navigateBack({
// delta: 2
const joinmeet = () => {
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"),
},
header: {
"content-type": "application/json", // 默认值
},
success: function (res) {
console.log(res.data);
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") {
// 邀请加入微信群
joinWechat();
WeixinJSBridge.call("closeWindow");
}
}
);
},
});
};
// 通过wxid加群微信群
const joinWechat = () => {
Taro.request({
url: "/api/joinwechat",
// url: "https://kunpeng.hackrobot.cn/joingroup",
data: {
// wxid: "wxid_haqoszjheyuz22",
wxid: wxid ?? null, //debug eric 的wxid
},
method: "POST",
header: {
"content-type": "application/json", // 默认值
},
success: function (resUser) {
console.log("resUser--", resUser);
console.log("加入微信群成功");
if (resUser?.data?.success == "fail") {
//已经在群聊中
handleClick("已经在群聊中", "warning");
setbtntext("已经在群聊中");
} else if (resUser?.data?.success == "ok") {
// 发送群聊邀请
handleClick("已发送群聊邀请", "warning");
setbtntext("已发送群聊邀请");
}
setdisabled(true);
},
});
};
return (
<View className="index">
<AtToast isOpened={isOpened} text="活动暂未开始" icon="blocked"></AtToast>
{/* <Text>Hello world!</Text> */}
{/* <AtNavBar
// onClickRgIconSt={handleClick}
// onClickRgIconNd={handleClick}
// onClickLeftIcon={goBack}
// leftIconType="chevron-left"
color="#000"
title="异度星球"
// leftText='返回'
// rightFirstIconType='bullet-list'
// rightSecondIconType='user'
/> */}
<View className="at-article">
<View className="at-article__h1">微信群加入规则,请知悉</View>
<View className="at-article__info">
2024-04-10&nbsp;&nbsp;&nbsp;hackrobot
</View>
<View className="at-article__content">
<View className="at-article__section">
<View className="at-article__h2">免费入群</View>
{/* <View className="at-article__h3">请给公众号文章点击:"在看"</View> */}
<View>
<AtSearchBar
showActionButton
value={""}
onChange={() => {}}
onActionClick={() => {}}
/>
<View className="at-article__p">
为了防止营销广告,以及给订阅号增加曝光度,
</View>
<View className="indexSwiper">
{" "}
<Swiper
indicatorColor="#999"
indicatorActiveColor="#333"
// vertical
circular
indicatorDots
autoplay
>
<SwiperItem>
<View className="demo-text">
{" "}
<Image
// style="width: 300px;height: 100px;background: #fff;"
src={
"http://cdn.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30775083495267465.jpg"
}
/>
<View className="at-article__p">
1. 请点击下方蓝色文字,跳转到公众号文章
</View>
</SwiperItem>
<SwiperItem>
<View className="demo-text">
{" "}
<Image
// style="width: 300px;height: 100px;background: #fff;"
src={
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
}
/>
<View className="at-article__p">2. 阅读到最底部,点击"在看"</View>
<View className="at-article__p">如图所示:</View>
<Image className="at-article__img" src={see} mode="widthFix" />
<View className="at-article__p">
<span>点击跳转</span>
<AtIcon value="arrow-right" size="30" color="#F00"></AtIcon>
<a href="https://mp.weixin.qq.com/s/MttWjccHsMbLD0pMv1LfYQ">
云手机6:内网穿透-frp
</a>
</View>
</SwiperItem>
<SwiperItem>
<View className="demo-text">
{" "}
<Image
// style="width: 300px;height: 100px;background: #fff;"
src={
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
}
/>
</View>
</SwiperItem>
</Swiper>
<View className="at-article__p">
稍等几分钟.机器人检测后,会自动发送群聊邀请
</View>
<Image className="at-article__img" src={group} mode="widthFix" />
<AtGrid
data={[
{
image:
"https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png",
value: "签到",
},
{
image:
"https://img20.360buyimg.com/jdphoto/s72x72_jfs/t15151/308/1012305375/2300/536ee6ef/5a411466N040a074b.png",
value: "活动",
},
{
image:
"https://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png",
value: "视频",
},
]}
onClick={(item, index) => {
console.log("item", item);
console.log("index", index);
if (index == 0) {
setisOpened(true);
setTimeout(() => {
setisOpened(false);
}, 3500);
}
if (index == 1) {
Taro.navigateTo({
url: "/pages/meetup/index",
});
}
if (index == 2) {
setisOpened(true);
setTimeout(() => {
setisOpened(false);
}, 3500);
}
}}
/>
<AtCard
{/* <View className="at-article__p">
如果不想点击"在看",也可以选择点击
<AtIcon value="arrow-right" size="30" color="#F00"></AtIcon>
<Button
onClick={() => {
// Taro.navigateTo({
// url: "/pages/meetup/Detail/index?id=20231206",
// });
joinmeet();
}}
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
size="mini"
type="primary"
size="small"
className="submitBtn"
disabled={joinMeetup}
onClick={() => {
// window.alert(window.location.href)
// return false
Taro.navigateTo({
url: "/pages/meetup/Detail/index?id=20231206",
});
}}
className="payBtn"
>
{!!joinMeetup ? "已报名" : "立即报名"}
</AtButton>
</View>
</View>
</View>
</AtCard>
付费入群
</Button>
</View> */}
<br />
<View className="indexTablebar">
<AtTabBar
tabList={[
{ title: "首页", text: "" },
{ title: "活动" },
{ title: "我的" },
]}
onClick={(value) => handleClick(value)}
current={current}
/>
<View className="at-article__p lastWord">
声明:
<br />
本群是交流平台,请不要发送广告以及敏感内容
<br />
仅聊天,不承诺其他服务和支持
</View>
</View>
</View>
</View>
</View>
);

View File

@@ -1,59 +1,13 @@
.index {
display: flex;
flex-direction: column;
// align-items: center;
justify-content: center;
.indexSwiper {
// margin-top: 20px;
padding: 20px;
// font-size: 28px;
.demo-text {
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: center;
// background-color: yellow;
height: 300px;
width: 100%;
// padding: 20px;
// Image{
// width: 90%;
// }
}
}
.meetupCard {
display: flex;
flex-direction: row;
.right {
// background-color: yellow;
width: 100%;
.payBtn{
// font-size: 30px;
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;
}
}
}
top: 10px;
}
.indexTablebar {
position: fixed;
bottom: 0;
width: 100%;
.lastWord{
font-size: 25px;
}
}

View File

@@ -98,6 +98,7 @@ const Detail = () => {
...res?.data?.jsapi??{},
},
function (res) {
// 付款成功
if (res.err_msg == "get_brand_wcpay_request:ok") {
setjoinMeetup(true)
window.localStorage.setItem('joinMeetup',true)