This commit is contained in:
hackrobot
2024-04-10 15:42:04 +08:00
parent 61d28d6a07
commit 54a309de65
23 changed files with 14108 additions and 3 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
dist/
deploy_versions/
.temp/
.rn_temp/
node_modules/
.DS_Store
.swc

View File

@@ -1,4 +1,4 @@
# linkwechat
# cityh5
@@ -15,14 +15,14 @@ Already a pro? Just edit this README.md and make it your own. Want to make it ea
```
cd existing_repo
git remote add origin http://gitlab.yidooplanet.com/gitlab-instance-0a899031/linkwechat.git
git remote add origin http://gitlab.yidooplanet.com/gitlab-instance-0a899031/cityh5.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](http://gitlab.yidooplanet.com/gitlab-instance-0a899031/linkwechat/-/settings/integrations)
- [ ] [Set up project integrations](http://gitlab.yidooplanet.com/gitlab-instance-0a899031/cityh5/-/settings/integrations)
## Collaborate with your team

10
babel.config.js Normal file
View File

@@ -0,0 +1,10 @@
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = {
presets: [
['taro', {
framework: 'react',
ts: false
}]
]
}

9
config/dev.js Normal file
View File

@@ -0,0 +1,9 @@
module.exports = {
env: {
NODE_ENV: '"development"'
},
defineConstants: {
},
mini: {},
h5: {}
}

95
config/index.js Normal file
View File

@@ -0,0 +1,95 @@
const config = {
projectName: "cityh5",
date: "2023-12-2",
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2,
},
sourceRoot: "src",
outputRoot: "dist",
plugins: [],
defineConstants: {},
copy: {
patterns: [],
options: {},
},
framework: "react",
compiler: "webpack5",
cache: {
enable: false, // Webpack 持久化缓存配置建议开启。默认配置请参考https://docs.taro.zone/docs/config-detail#cache
},
mini: {
postcss: {
pxtransform: {
enable: true,
config: {},
},
url: {
enable: true,
config: {
limit: 1024, // 设定转换尺寸上限
},
},
cssModules: {
enable: false, // 默认为 false如需使用 css modules 功能,则设为 true
config: {
namingPattern: "module", // 转换模式,取值为 global/module
generateScopedName: "[name]__[local]___[hash:base64:5]",
},
},
},
},
h5: {
esnextModules: ["taro-ui"],
publicPath: "/",
staticDirectory: "static",
postcss: {
autoprefixer: {
enable: true,
config: {},
},
cssModules: {
enable: false, // 默认为 false如需使用 css modules 功能,则设为 true
config: {
namingPattern: "module", // 转换模式,取值为 global/module
generateScopedName: "[name]__[local]___[hash:base64:5]",
},
},
},
// customRoutes: {
// // "页面路径": "自定义路由"
// "/pages/index/index": "/index",
// // '/pages/detail/index': ['/detail'], // 可以通过数组为页面配置多个自定义路由
// "pages/my/index": "/my",
// "pages/meetup/index": "/meetup",
// "pages/meetup/Detail/index": "/detail",
// },
router: {
// basename: '/myapp',
mode: "hash", // 或者是 'browser'
},
// defineConstants: {
// HOST: '"/api"'
// },
devServer: {
proxy: {
'/api/': {
target: JSON.parse('"http://localhost:8055"'), //本地调试端口
pathRewrite: {
'^/api/': '/'
},
changeOrigin: true
}
}
}
},
};
module.exports = function (merge) {
if (process.env.NODE_ENV === "development") {
return merge({}, config, require("./dev"));
}
return merge({}, config, require("./prod"));
};

37
config/prod.js Normal file
View File

@@ -0,0 +1,37 @@
module.exports = {
env: {
NODE_ENV: '"production"'
},
defineConstants: {
},
mini: {},
h5: {
/**
* WebpackChain 插件配置
* @docs https://github.com/neutrinojs/webpack-chain
*/
// webpackChain (chain) {
// /**
// * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
// * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
// */
// chain.plugin('analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
// /**
// * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
// * @docs https://github.com/chrisvfritz/prerender-spa-plugin
// */
// const path = require('path')
// const Prerender = require('prerender-spa-plugin')
// const staticDir = path.join(__dirname, '..', 'dist')
// chain
// .plugin('prerender')
// .use(new Prerender({
// staticDir,
// routes: [ '/pages/index/index' ],
// postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
// }))
// }
}
}

74
package.json Normal file
View File

@@ -0,0 +1,74 @@
{
"name": "",
"version": "1.0.0",
"private": true,
"description": "city",
"templateInfo": {
"name": "h5-youshu",
"typescript": false,
"css": "sass"
},
"scripts": {
"build:h5": "taro build --type h5",
"build:weapp": "taro build --type weapp",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:qq": "taro build --type qq",
"dev:h5": "npm run build:h5 -- --watch",
"dev:weapp": "npm run build:weapp -- --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:qq": "npm run build:qq -- --watch"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8"
],
"author": "",
"dependencies": {
"@babel/runtime": "^7.7.7",
"@tarojs/components": "3.6.20",
"@tarojs/helper": "3.6.20",
"@tarojs/plugin-framework-react": "3.6.20",
"@tarojs/plugin-platform-alipay": "3.6.20",
"@tarojs/plugin-platform-h5": "3.6.20",
"@tarojs/plugin-platform-jd": "3.6.20",
"@tarojs/plugin-platform-qq": "3.6.20",
"@tarojs/plugin-platform-swan": "3.6.20",
"@tarojs/plugin-platform-tt": "3.6.20",
"@tarojs/plugin-platform-weapp": "3.6.20",
"@tarojs/react": "3.6.20",
"@tarojs/runtime": "3.6.20",
"@tarojs/shared": "3.6.20",
"@tarojs/taro": "3.6.20",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"sr-sdk-h5": "^1.3.1",
"taro-ui": "^3.2.0"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
"@tarojs/cli": "3.6.20",
"@tarojs/taro-loader": "3.6.20",
"@tarojs/webpack5-runner": "3.6.20",
"@types/node": "^18.15.11",
"@types/react": "^18.0.0",
"@types/webpack-env": "^1.13.6",
"babel-preset-taro": "3.6.20",
"eslint": "^8.12.0",
"eslint-config-taro": "3.6.20",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^1.6.1",
"postcss": "^8.4.18",
"react-refresh": "^0.11.0",
"stylelint": "9.3.0",
"ts-node": "^10.9.1",
"typescript": "^4.1.0",
"webpack": "^5.78.0"
}
}

15
project.config.json Normal file
View File

@@ -0,0 +1,15 @@
{
"miniprogramRoot": "./dist",
"projectname": "cityh5",
"description": "city",
"appid": "touristappid",
"setting": {
"urlCheck": true,
"es6": false,
"enhance": false,
"compileHotReLoad": false,
"postcss": false,
"minified": false
},
"compileType": "miniprogram"
}

15
src/app.config.js Normal file
View File

@@ -0,0 +1,15 @@
export default {
pages: [
'pages/index/index',
'pages/my/index',
'pages/meetup/index',
'pages/meetup/Detail/index',
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
}
}

74
src/app.js Normal file
View File

@@ -0,0 +1,74 @@
import { Component } from 'react'
import SDK from 'sr-sdk-h5'
import './app.scss'
import 'taro-ui/dist/style/index.scss' // 全局引入一次即可
/**
* 有数埋点SDK 默认配置
* 使用方法请参考文档 https://mp.zhls.qq.com/youshu-docs/develop/sdk/Taro.html
* 如对有数SDK埋点接入有任何疑问请联系微信sr_data_service
*/
window.srt = new SDK({
/**
* 有数 - ka接入测试用 分配的 app_id对应的业务
*/
token: 'bi72fccc7184ef45f9',
/**
* 传入自定义的后台上报接口若传入则token将无意义
*/
// serverUrl: 'aaa.baidu.com',
/**
* 开启打印调试信息, 默认 false
*/
debug: true,
/**
* 代理配置,自动代理页面浏览事件、页面离开事件、点击事件,默认 false。建议开启
*/
autoTrack: true,
/**
* 自动开始上报,默认 true。建议开启
*/
autoStart: true,
/**
* 上报返回的钩子函数,返回 false 则代表不通过SDK不会清除本地记录会继续重拾
*/
// onUploaded?: () => {},
/**
* 跳过初始化时对 token 的必要检查
* 满足场景服务商转发SDK上报数据在服务端回填appid解决大量小程序同时接入的问题默认false
*/
// skipTokenCheck: false,
/**
* 小程序appid
*/
appid: ''
});
// window.srt.setChan({chan_id: 'xxx'}) // 设置渠道渠道信息将会被设置在props.chan对象中
// window.srt.setUser({user_id: 'xxx'}) // 设置用户信息用户信息将会被设置在props.wx_user对象中
class App extends Component {
componentDidMount () {}
componentDidShow () {}
componentDidHide () {}
// this.props.children 是将要会渲染的页面
render () {
return this.props.children
}
}
export default App

0
src/app.scss Normal file
View File

BIN
src/images/avatar.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

17
src/index.html Normal file
View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no,address=no">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
<title>异度星球</title>
<script><%= htmlWebpackPlugin.options.script %></script>
</head>
<body>
<div id="app"></div>
</body>
</html>

View File

@@ -0,0 +1,3 @@
export default {
navigationBarTitleText: '异度星球'
}

278
src/pages/index/index.jsx Normal file
View File

@@ -0,0 +1,278 @@
import { Component } from "react";
import Taro from "@tarojs/taro";
import { View, Text, Image, Button } from "@tarojs/components";
import "./index.scss";
import { AtTabBar } from "taro-ui";
import React, { useCallback, useEffect, useState } from "react";
import { AtGrid } from "taro-ui";
import { Swiper, SwiperItem } from "@tarojs/components";
import { AtCard } from "taro-ui";
import { AtImagePicker } from "taro-ui";
import { AtButton } from "taro-ui";
import { AtSearchBar } from "taro-ui";
import { Picker } from "@tarojs/components";
import { AtList, AtListItem } from "taro-ui";
import { AtNavBar } from "taro-ui";
import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
import { AtToast } from "taro-ui";
import { AtIcon } from "taro-ui";
// export default class Index extends Component {
const Index = () => {
const [current, setcurrent] = useState(0);
const [openId, setopenId] = 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;
// 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]
.split("=")[1];
} else {
hashopenid = window.localStorage.getItem("openid");
}
// 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)
} 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;
}
};
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 (
<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>
<AtSearchBar
showActionButton
value={""}
onChange={() => {}}
onActionClick={() => {}}
/>
</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>
</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>
<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>
<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
onClick={() => {
// Taro.navigateTo({
// url: "/pages/meetup/Detail/index?id=20231206",
// });
}}
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
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",
});
}}
>
{!!joinMeetup ? "已报名" : "立即报名"}
</AtButton>
</View>
</View>
</View>
</AtCard>
<View className="indexTablebar">
<AtTabBar
tabList={[
{ title: "首页", text: "" },
{ title: "活动" },
{ title: "我的" },
]}
onClick={(value) => handleClick(value)}
current={current}
/>
</View>
</View>
);
};
export default Index;

View File

@@ -0,0 +1,59 @@
.index {
display: flex;
flex-direction: column;
// align-items: center;
justify-content: center;
.indexSwiper {
// margin-top: 20px;
padding: 20px;
.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%;
}
}

View File

@@ -0,0 +1,177 @@
import { Component } from "react";
import { View, Text, Image } from "@tarojs/components";
import "./index.scss";
import { AtTabBar } from "taro-ui";
import React, { useCallback, useEffect, useState } from "react";
import { AtGrid } from "taro-ui";
import { Swiper, SwiperItem } from "@tarojs/components";
import { AtCard } from "taro-ui";
import { AtImagePicker } from "taro-ui";
import Taro from "@tarojs/taro";
import { AtAvatar } from "taro-ui";
import { AtButton } from "taro-ui";
// import Taro from "@tarojs/taro";
import { AtList, AtListItem } from "taro-ui";
// export default class Index extends Component {
const Detail = () => {
const [current, setcurrent] = useState(2);
const [id, setid] = useState(null);
const [openid, setopenid] = useState(null);
const [joinMeetup, setjoinMeetup] = useState(false);
useEffect(() => {
let newparams = Taro.getCurrentInstance().router.params;
let newId = newparams.id;
if (newId) {
setid(newId);
}
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 onBridgeReady = () => {
WeixinJSBridge.call("hideOptionMenu");
};
useEffect(() => {
let $instance = Taro.getCurrentInstance();
// console.log("11");
console.log($instance.router.params);
// if (typeof WeixinJSBridge == "undefined") {
// if (document.addEventListener) {
// document.addEventListener("WeixinJSBridgeReady", onBridgeReady, false);
// } else if (document.attachEvent) {
// document.attachEvent("WeixinJSBridgeReady", onBridgeReady);
// document.attachEvent("onWeixinJSBridgeReady", onBridgeReady);
// }
// }
}, []);
const joinmeet = () => {
// console.log("111");
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") {
setjoinMeetup(true)
window.localStorage.setItem('joinMeetup',true)
WeixinJSBridge.call("closeWindow");
}
}
);
},
});
};
return (
<View className="Detail">
{/* <Text>Hello world!</Text> */}
{/* <AtAvatar image='https://cdn.huodongxing.com/logo/202312/8732019012100/promoteMini.png'></AtAvatar> */}
<View>
<Image
style="width:100%;height: 200px;background: #fff;"
src={
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
}
/>
</View>
<AtList>
<AtListItem title="[副业交流] 沙龙茶话会" onClick={() => {}} />
<AtListItem title="日期" extraText="2023/12/06" arrow="" />
<AtListItem title="报名人数" extraText="4/10" arrow="" />
<AtListItem
title="地点"
note="广东省深圳市福田区石厦地铁站C口"
extraText=""
/>
{/* <AtListItem title='禁用状态' disabled extraText='详细信息' /> */}
</AtList>
{/* <AtList>
<AtListItem
title="联系我们"
note=""
arrow="right"
iconInfo={{ size: 25, color: "#78A4FA", value: "calendar" }}
/>
<AtListItem
title="版本日志"
note=""
extraText=""
arrow="right"
iconInfo={{ size: 25, color: "#FF4949", value: "bookmark" }}
/>
</AtList> */}
<View>
<AtButton
className="bottomBtn"
type="primary"
onClick={() => joinmeet()}
disabled={joinMeetup}
>
{!!joinMeetup?'已报名':'立即报名'}
</AtButton>
</View>
{/* <View className="indexTablebar">
<AtTabBar
tabList={[
{ title: "首页", text: "" },
{ title: "活动" },
{ title: "我的" },
]}
onClick={(value) => handleClick(value)}
current={current}
/>
</View> */}
</View>
);
};
export default Detail;

View File

@@ -0,0 +1,11 @@
.Detail{
.bottomBtn{
display: flex;
position: fixed;
bottom: 0px;
width: 100%;
}
}

155
src/pages/meetup/index.jsx Normal file
View File

@@ -0,0 +1,155 @@
import { Component } from "react";
import { View, Text, Image } from "@tarojs/components";
import "./index.scss";
import { AtTabBar } from "taro-ui";
import React, { useCallback, useEffect, useState } from "react";
import { AtGrid } from "taro-ui";
import { Swiper, SwiperItem } from "@tarojs/components";
import { AtCard } from "taro-ui";
import { AtImagePicker } from "taro-ui";
import Taro from "@tarojs/taro";
import { AtButton } from "taro-ui";
import { Picker } from "@tarojs/components";
import { AtList, AtListItem } from "taro-ui";
import { AtNavBar } from "taro-ui";
// export default class Index extends Component {
const Meetup = () => {
const [current, setcurrent] = useState(1);
const [joinMeetup, setjoinMeetup] = useState(false);
const [pickData, setpickData] = useState({
selector: ["美国", "中国", "巴西", "日本"],
selectorChecked: "美国",
timeSel: "12:01",
dateSel: "2018-04-22",
});
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
});
};
useEffect(() => {
let newjoinMeetup = window.localStorage.getItem("joinMeetup");
setjoinMeetup(newjoinMeetup);
// window.localStorage.removeItem("joinMeetup");
// setjoinMeetup(false)
}, []);
return (
<View className="my">
{/* <AtNavBar
// onClickRgIconSt={handleClick}
// onClickRgIconNd={handleClick}
// onClickLeftIcon={goBack}
// leftIconType="chevron-left"
color="#000"
title="活动列表"
// leftText='返回'
// rightFirstIconType='bullet-list'
// rightSecondIconType='user'
/> */}
{/* <Text>Hello world!</Text> */}
{/* <View className="page-section">
<View>
<Picker mode="selector" range={pickData.selector} onChange={() => {}}>
<AtList>
<AtListItem
title="国家地区"
extraText={pickData.selectorChecked}
/>
</AtList>
</Picker>
</View>
<View>
<Picker mode="selector" range={pickData.selector} onChange={() => {}}>
<AtList>
<AtListItem
title="国家地区"
extraText={pickData.selectorChecked}
/>
</AtList>
</Picker>
</View>
</View> */}
<AtCard
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
type="primary"
size="small"
className="submitBtn"
disabled={joinMeetup}
onClick={() => {
Taro.navigateTo({
url: "/pages/meetup/Detail/index",
});
}}
>
{!!joinMeetup ? "已报名" : "立即报名"}
</AtButton>
</View>
</View>
</View>
</AtCard>
<View className="indexTablebar">
<AtTabBar
tabList={[
{ title: "首页", text: "" },
{ title: "活动" },
{ title: "我的" },
]}
onClick={(value) => handleClick(value)}
current={current}
/>
</View>
</View>
);
};
export default Meetup;

View File

@@ -0,0 +1,42 @@
.my{
margin-top: 20px;
.page-section{
display: flex;
flex-direction: row;
}
.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%;
}
}

92
src/pages/my/index.jsx Normal file
View File

@@ -0,0 +1,92 @@
import { Component } from "react";
import { View, Text, Image } from "@tarojs/components";
import "./index.scss";
import { AtTabBar } from "taro-ui";
import React, { useCallback, useEffect, useState } from "react";
import { AtGrid } from "taro-ui";
import { Swiper, SwiperItem } from "@tarojs/components";
import { AtCard } from "taro-ui";
import { AtImagePicker } from "taro-ui";
import Taro from "@tarojs/taro";
import { AtAvatar } from "taro-ui";
import { AtTag } from "taro-ui";
import { AtList, AtListItem } from "taro-ui";
import avatar from "../../images/avatar.jpg";
// export default class Index extends Component {
const My = () => {
const [current, setcurrent] = useState(2);
const [wxid, setwxid] = useState(null);
useEffect(()=>{
getWxid()
},[])
const getWxid = () => {
let newWxid = window.localStorage.getItem("wxid");
if (!!newWxid) {
setwxid(newWxid);
}
};
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",
});
}
};
return (
<View className="my">
{/* <Text>Hello world!</Text> */}
<View className="myAtAvatar">
<AtAvatar className="AtAvatar" image={avatar}></AtAvatar>
<AtTag type="primary" circle>
新注册用户
</AtTag>
</View>
<AtList>
<AtListItem
title="联系我们"
note=""
arrow="right"
iconInfo={{ size: 25, color: "#78A4FA", value: "calendar" }}
/>
<AtListItem
title="版本日志"
note=""
extraText=""
arrow="right"
iconInfo={{ size: 25, color: "#FF4949", value: "bookmark" }}
/>
</AtList>
<View className="indexTablebar">
<AtTabBar
tabList={[
{ title: "首页", text: "" },
{ title: "活动" },
{ title: "我的" },
]}
onClick={(value) => handleClick(value)}
current={current}
/>
</View>
</View>
);
};
export default My;

23
src/pages/my/index.scss Normal file
View File

@@ -0,0 +1,23 @@
.my{
.myAtAvatar{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 300px;
// background-color: #f4ffb8;
// padding-left: 20px;
// padding-right: 20px;
.AtAvatar{
margin-bottom: 10px;
}
}
.indexTablebar {
position: fixed;
bottom: 0;
width: 100%;
}
}

12912
yarn.lock Normal file

File diff suppressed because it is too large Load Diff