diff --git a/src/images/group.png b/src/images/group.png new file mode 100644 index 0000000..1688a06 Binary files /dev/null and b/src/images/group.png differ diff --git a/src/images/see.png b/src/images/see.png new file mode 100644 index 0000000..d3e1a47 Binary files /dev/null and b/src/images/see.png differ diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index 72966e1..52c7b92 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -16,26 +16,42 @@ 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 [wxiid, setwxid] = useState(null); const [isOpened, setisOpened] = useState(false); const [joinMeetup, setjoinMeetup] = useState(false); + const [id, setid] = useState(null); + + useEffect(() => { + let newparams = Taro.getCurrentInstance().router.params; + let newId = newparams.id; + if (newId) { + setid(newId); + } + let newjoinMeetup = window.localStorage.getItem("joinMeetup"); + setjoinMeetup(newjoinMeetup); + }, []); + const onBridgeReady = () => { + WeixinJSBridge.call("hideOptionMenu"); + }; + + useEffect(() => { + let $instance = Taro.getCurrentInstance(); + console.log($instance.router.params); + }, []); + // 获取openid const getWxid = () => { - // 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")) { - // window.alert(window.location.href); - hashopenid = window.location.href .split("#")[0] .split("?")[1] @@ -43,234 +59,162 @@ const Index = () => { } else { hashopenid = window.localStorage.getItem("openid"); } - - // window.alert(hashopenid) - let newOpenid = window.localStorage.getItem("openid"); - - // window.alert(newOpenid) - + // let newOpenid = window.localStorage.getItem("openid"); if ( - (!!newOpenid && newOpenid != "undefined" &&newOpenid != "null") || - (!!hashopenid && hashopenid != "undefined"&&hashopenid != "null") + // (!!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) + setopenId(hashopenid); } else { - // window.alert('不存在') let nowUrl = window.location.href; - - // window.alert(nowUrl) let payUrl = `https://payjs.cn/api/openid?mchid=1561724891&callback_url=${nowUrl}`; window.location.href = payUrl; } }; + const joinmeet = () => { + // alert(window.localStorage.getItem("openid")); + 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); + // 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") { + // 邀请加入微信群 + joinWechat(); + WeixinJSBridge.call("closeWindow"); + } + } + ); + }, + }); + }; + + 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); + alert(resUser?.data?.success); + console.log("加入微信群成功"); + if (resUser?.data?.success == "fail") { + //已经在群聊中 + handleClick("已经在群聊中", "warning"); + setbtntext("已经在群聊中"); + } else if (resUser?.data?.success == "ok") { + // 发送群聊邀请 + handleClick("已发送群聊邀请", "warning"); + setbtntext("已发送群聊邀请"); + } + setdisabled(true); + }, + }); + }; + 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 - }); - }; return ( - - {/* Hello world! */} - {/* */} + + 微信群加入规则,请知悉 + + 2024-04-10   hackrobot + + + + 免费入群 + {/* 请给公众号文章点击:"在看" */} - - {}} - onActionClick={() => {}} - /> - - - {" "} - - - - {" "} - + + 为了防止营销广告,以及给订阅号增加曝光度, - - - - {" "} - + + 1. 请点击下方蓝色文字,跳转到公众号文章 - - - - {" "} - + 2. 阅读到最底部,点击"在看" + 如图所示: + + + 点击跳转 + + + 云手机6:内网穿透-frp + - - - + + 稍等几分钟.机器人检测后,会自动发送群聊邀请 + + - { - 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); - } - }} - /> - - { - // Taro.navigateTo({ - // url: "/pages/meetup/Detail/index?id=20231206", - // }); - }} - note="" - extra="" - title="[副业交流] 沙龙茶话会" - thumb="http://www.logoquan.com/upload/list/20180421/logoquan15259400209.PNG" - > - - {" "} - - {" "} - - - - - [报名中] 4/10 - - 2023/12/06 星期三 - - + 如果不想点击"在看",也可以选择点击 + + + */} +
+ + + 声明: +
+ 本群是交流平台,请不要发送广告以及敏感内容 +
+ 仅聊天,不承诺其他服务和支持
-
- - - handleClick(value)} - current={current} - /> + {/* 立即加入 */}
); }; diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index b2421aa..d00c4f9 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -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%; - 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%; - } +.payBtn{ + // font-size: 30px; + margin-left: 20px; + top: 10px; +} + +.lastWord{ + font-size: 25px; +} } diff --git a/src/pages/meetup/Detail/index.jsx b/src/pages/meetup/Detail/index.jsx index 307e2aa..cdad2e0 100644 --- a/src/pages/meetup/Detail/index.jsx +++ b/src/pages/meetup/Detail/index.jsx @@ -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)