feat: 微信群加入判断

This commit is contained in:
hackrobot
2024-03-25 02:53:22 +08:00
parent 58f5b5f41a
commit 6bc38e01b0
2 changed files with 19 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ import {
AtAccordion,
AtList,
AtListItem,
AtMessage
AtMessage,
} from "taro-ui";
import "./index.scss";
import beijing from "@/images/city/beijing.jpg";
@@ -32,12 +32,27 @@ import { useEffect, useState } from "react";
const JoinWechat = () => {
const [open, setopen] = useState(false);
const [isOpened, setisOpened] = useState(false);
// 用户基本信息
const [localuserInfo, setlocaluserInfo] = useState(
Taro.getStorageSync("userInfo")
);
return (
<View
className="JoinWechat"
onClick={() => {
setisOpened(true);
// 判断群组内是否包含wxid
// pass
// 判断目前是否辨识wxid
if (localuserInfo?.wxid) {
// 跳转答题页面=入群
Taro.navigateTo({
url: "/pages/index/componments/KeywordJoin/index",
});
} else {
// 显示二维码-个人名片
setisOpened(true);
}
}}
>
<View className="CustomHeader">🥂加入微信群-meetup</View>

View File

@@ -71,7 +71,7 @@ export default function Index() {
// const [wxid, openId] = params;
// debug
// params.wxid = "wxid_4413224132412";
params.wxid = "wxid_4413224132412";
if (params?.wxid) {
setuserInfo({
wxid: params?.wxid, //个人号wxid