import { Button, Card, Col, Divider, Grid, GridItem, Row, Tag, Toast, } from "@antmjs/vantui"; import { Input, View } from "@tarojs/components"; import React, { useCallback, useEffect } from "react"; import { Swiper, SwiperItem, Image } from "@antmjs/vantui"; import react from "react"; import { NoticeBar } from "@antmjs/vantui"; import Taro from "@tarojs/taro"; import { Tabbar, TabbarItem } from "@antmjs/vantui"; import TabbarCom from "../components/TabbarCom"; import { getTable, getTableid } from "../../utils/index"; import { Icon } from "@antmjs/vantui"; import "./index.scss"; import { Search } from "@antmjs/vantui"; import ActiveCard from "../components/ActiveCard"; import { Dialog } from "@antmjs/vantui"; const Home = () => { // const { images } = COMMON const [initPage1, setInitPage1] = react.useState(0); const [active, setActive] = react.useState(0); const [show, setShow] = react.useState(false); const [value, setValue] = react.useState(""); const onChange = (e) => {}; const images = [ "cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/download.jpg", "cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images.jpg", ]; useEffect(() => { // 设置标题 definePageConfig({ navigationBarTitleText: "首页", }); // 设置允许分享 Taro.showShareMenu({ withShareTicket: true, }); // 其他分享 Taro.updateShareMenu({ withShareTicket: true, success() {}, }); // let objParams = { // tableName: "test", // id: "80516fb66370bcf300b8f43c5f4dd52b", // okFun: (res) => { // console.log("res", res); // }, // }; // getTableid(objParams); }, []); return ( setShow(false)} > {[ { city: "深圳", color: "" }, { city: "北京", color: "#8c8c8c" }, { city: "上海", color: "#8c8c8c" }, { city: "广州", color: "#8c8c8c" }, { city: "武汉", color: "#8c8c8c" }, { city: "杭州", color: "#8c8c8c" }, { city: "成都", color: "#8c8c8c" }, // { city: "武汉" }, ].map((item: any) => { return ( {item?.city} ); })} {/* 通知条 */} {/* 顶部 */} {/* 深圳 */} {/* 深圳 */} setShow(true)}> 深圳 {/* 轮播图 */} {images.map((item, index) => ( ))} {/* 模块 */} { // 相机拍照 Taro.chooseImage({ count: 1, // 默认9 // , 'compressed' sizeType: ["original"], // 可以指定是原图还是压缩图,默认二者都有 // 'album', sourceType: ["camera"], // 可以指定来源是相册还是相机,默认二者都有,在H5浏览器端支持使用 `user` 和 `environment`分别指定为前后摄像头 success: function (res: any) { // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 let tempFilePaths = res.tempFilePaths; console.log("tempFilePaths===", tempFilePaths); // 云开发存储文件 [/自动创建文件路径] Taro.cloud.uploadFile({ cloudPath: `images/dev/${new Date()?.getTime()}.png`, filePath: tempFilePaths?.[0], // 文件路径 success: (res: any) => { // get resource ID console.log("res", res.fileID); // 跳转到目的页面,打开新页面 Taro.navigateTo({ url: `/pages/home/components/CheckIn/index?fileID=${res?.fileID}`, }); // Toast.success({ // message: "打卡成功", // selector: "#vanToast-demo2", // }); }, fail: (err: any) => { // handle error console.log("err", err); }, }); }, }); }} /> { // 跳转到目的页面,打开新页面 Taro.navigateTo({ url: "/pages/mountainPeak/index", }); }} /> { // 跳转到目的页面,打开新页面 Taro.navigateTo({ url: "/pages/activityList/index", }); }} /> { // 跳转到目的页面,打开新页面 Taro.navigateTo({ url: "/pages/formSubmit/index", }); }} /> {/* 分割线 */} {/* */} {/* 截取数组2个活动 */} {[1, 2, 3, 4].splice(0, 2).map((item: any) => { return ( { console.log("Card"); Taro.navigateTo({ url: "/pages/activityList/components/details/index", }); }} > {/* 活动卡片 */} {/* */} ); })} {/* 首页 活动 我的 */} ); }; export default Home;