debug: 删除wxid=toast调试代码

This commit is contained in:
hackrobot
2024-03-21 08:47:24 +08:00
parent c1e414bdd8
commit ed11d780dd

View File

@@ -1,7 +1,14 @@
import { View, Text, Image } from "@tarojs/components";
import { useLoad } from "@tarojs/taro";
import Taro from "@tarojs/taro";
import { AtAvatar, AtTag, AtIcon, AtTabBar, AtButton } from "taro-ui";
import {
AtAvatar,
AtTag,
AtIcon,
AtTabBar,
AtButton,
AtMessage,
} from "taro-ui";
import "./index.scss";
import beijing from "@/images/city/beijing.jpg";
import guangzhou from "@/images/city/guangzhou.jpg";
@@ -40,17 +47,16 @@ export default function Index() {
const params = Taro.getCurrentInstance().router.params;
console.log("params", params);
// const [wxid, openId] = params;
setuserInfo({
wxid: params?.wxid, //个人号wxid
// openId: params?.openId, //小程序openid
});
if (wxid) {
if (params.wxid) {
setuserInfo({
wxid: params?.wxid, //个人号wxid
// openId: params?.openId, //小程序openid
});
// 本地存储
try {
Taro.setStorage({
wxid: wxid,
openId: openId,
});
Taro.setStorageSync("wxid", params?.wxid ?? "");
} catch (e) {}
}
}, []);
@@ -197,7 +203,15 @@ export default function Index() {
return ["北京", "上海", "广东", "浙江", "湖北"].map((item, index) => {
return (
<View>
<AtTag type="primary" circle>
<AtTag
onClick={() => {
Taro.redirectTo({
url: "/pages/index/index?wxid=1111111",
});
}}
type="primary"
circle
>
{item}
</AtTag>
</View>
@@ -232,6 +246,7 @@ export default function Index() {
<TabbarCom active={0} />
<QrCode isOpened={isOpened} setisOpened={setisOpened} />
<AtMessage />
</View>
);
}