5 Commits

Author SHA1 Message Date
hackrobot
f14fcdc0af feat:微信群加入按钮/提示 2024-04-07 22:00:57 +08:00
hackrobot
d2c4fb676c 日志 2024-04-07 21:43:23 +08:00
hackrobot
8d677f376f feat: 新增图书详情页 2024-04-07 14:21:25 +08:00
hackrobot
b8e9e97199 feat: 半屏小程序 2024-04-07 13:34:11 +08:00
hackrobot
0efe0d2c3c feat:新增图书页面 2024-04-07 13:23:39 +08:00
9 changed files with 184 additions and 43 deletions

View File

@@ -9,6 +9,7 @@ const path = require('path'); //引入node的path模块
export default defineConfig(async (merge, { command, mode }) => {
const baseConfig = {
projectName: 'yidooplanet',
embeddedAppIdList: ["wx8a5d6f9fad07544e","wx7bb576902363f4ff","wxe2039b83454e49ed"], //半屏拉起小程序 当当wx7bb576902363f4ff/腾讯云wxe2039b83454e49ed/微信读书 wx8a5d6f9fad07544e
alias: {
'@': path.resolve(__dirname, '..', 'src')
},

View File

@@ -2,6 +2,8 @@ export default defineAppConfig({
pages: [
'pages/index/index',
'pages/index/componments/KeywordJoin/index',
'pages/index/componments/NomadbookPage/index',
'pages/my/index',
'pages/my/componments/Log/index',
'pages/my/componments/Quesion/index',

View File

@@ -13,6 +13,8 @@ import {
AtSteps,
AtForm,
AtInput,
AtToast,
AtMessage,
} from "taro-ui";
import "./index.scss";
import beijing from "@/images/city/beijing.jpg";
@@ -22,36 +24,37 @@ import shenzhen from "@/images/city/shenzhen.jpg";
import touxiang from "@/images/index/touxiang.jpg";
import TabbarCom from "@/componments/TabbarCom";
import { useEffect, useState } from "react";
import { set } from "lodash";
const KeywordJoin = () => {
const [current, setcurrent] = useState(0);
const [value, setvalue] = useState(null);
const [localuserInfo, setlocaluserInfo] = useState(Taro.getStorageSync("userInfo"));
const [disabled, setdisabled] = useState(false);
const [btntext, setbtntext] = useState('立即加入');
const [localuserInfo, setlocaluserInfo] = useState(
Taro.getStorageSync("userInfo")
);
// 获取用户标识符
useEffect(() => {
// 获取路由参数
const params = Taro.getCurrentInstance().router.params;
console.log("params", params);
// const [wxid, openId] = params;
// 获取用户标识符
useEffect(() => {
// 获取路由参数
const params = Taro.getCurrentInstance().router.params;
console.log("params", params);
// const [wxid, openId] = params;
if (params.wxid) {
setuserInfo({
wxid: params?.wxid, //个人号wxid
// openId: params?.openId, //小程序openid
});
// 本地存储
try {
Taro.setStorageSync("wxid", params?.wxid ?? "");
} catch (e) {}
}
}, []);
if (params.wxid) {
setuserInfo({
wxid: params?.wxid, //个人号wxid
// openId: params?.openId, //小程序openid
});
// 本地存储
try {
Taro.setStorageSync("wxid", params?.wxid ?? "");
} catch (e) {}
}
}, []);
// useEffect(() => {
// // 更新分享-minipro
@@ -68,6 +71,13 @@ const KeywordJoin = () => {
// }, []);
const handleClick = (text, type) => {
Taro.atMessage({
message: text,
type: type,
});
};
return (
<View className="KeywordJoin">
{/* 步骤栏 */}
@@ -128,22 +138,40 @@ const KeywordJoin = () => {
</View>
</View>
</View>
<View className="tabbbarDiv"></View>
<AtButton type="primary" className="jsonWechatBtn" onClick={()=>{
// 通过hook加入微信群邀请
//发起网络请求
Taro.request({
// url: "http://127.0.0.1:28369/joingroup",
url: "https://kunpeng.hackrobot.cn/joingroup",
data: {
wxid: localuserInfo?.wxid ?? null, //debug eric 的wxid
},
success: function (resUser) {
console.log('加入微信群成功');
},
});
}}>
点击加入
<AtMessage />
<AtButton
type="primary"
className="jsonWechatBtn"
disabled={disabled}
onClick={() => {
// 通过hook加入微信群邀请
//发起网络请求
Taro.request({
// url: "http://127.0.0.1:28369/joingroup",
url: "https://kunpeng.hackrobot.cn/joingroup",
data: {
wxid: localuserInfo?.wxid ?? null, //debug eric 的wxid
},
success: function (resUser) {
console.log("resUser--", resUser);
console.log("加入微信群成功");
if (resUser?.data?.success == "fail") {
//已经在群聊中
handleClick("已经在群聊中", "warning");
setbtntext("已经在群聊中")
} else if (resUser?.data?.success == "ok") {
// 发送群聊邀请
handleClick("已发送群聊邀请", "warning");
setbtntext("已发送群聊邀请")
}
setdisabled(true);
},
});
}}
>
{btntext}
</AtButton>
</View>
);

View File

@@ -25,7 +25,14 @@ const Nomadbook = () => {
const [open, setopen] = useState(false);
return (
<View className="Nomadbook">
<View
className="Nomadbook"
onClick={() => {
Taro.navigateTo({
url: "/pages/index/componments/NomadbookPage/index",
});
}}
>
<View className="book">
{[
{ imagePath: rework },

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '图书'
})

View File

@@ -0,0 +1,60 @@
import { View, Text, Image, Button, Icon } from "@tarojs/components";
import { useLoad } from "@tarojs/taro";
import Taro from "@tarojs/taro";
import {
AtAvatar,
AtTag,
AtIcon,
AtTabBar,
AtButton,
AtAccordion,
AtList,
AtListItem,
} from "taro-ui";
import "./index.scss";
import rework from "@/images/book/rework.jpg";
import dangan from "@/images/book/dangan.jpg";
import fuye from "@/images/book/fuye.jpg";
import poquan from "@/images/book/poquan.jpg";
import chuangye from "@/images/book/chuangye.jpg";
import hours from "@/images/book/hours.jpg";
import { useEffect, useState } from "react";
const NomadbookPage = () => {
const [open, setopen] = useState(false);
return (
<View className="NomadbookPage">
{/* <View>NomadbookPage</View> */}
<View className="book">
{[
{ imagePath: rework },
{ imagePath: dangan },
{ imagePath: fuye },
{ imagePath: poquan },
{ imagePath: chuangye },
{ imagePath: hours },
].map((item, index) => {
return (
<View className="bookItem">
{" "}
<Image
style={{
width: "100%",
height: "100%",
background: " #fff",
borderRadius: "10px",
}}
mode="scaleToFill"
src={item.imagePath}
/>
</View>
);
})}
</View>
</View>
);
};
export default NomadbookPage;

View File

@@ -0,0 +1,35 @@
.NomadbookPage {
padding: 10px;
font-size: 25px;
// width: 320px;
// height: 230px;
display: flex;
flex-direction: column;
align-items: center;
// justify-content: center;
// background-color: red;
border-radius: 20px;
// border: solid 1px #8c8c8c;
// background-color: yellow;
.book {
// width: 100%;
// height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
// background-color: aquamarine;
padding: 10px;
.bookItem {
width: 200px;
height: 200px;
// background-color: yellow;
margin-top: 20px;
// margin-right: 10px;
}
}
}

View File

@@ -28,6 +28,11 @@ const Log = () => {
<AtTimeline
pending
items={[
{
title: "2024年4月07日",
content: ["1.新增图书列表页", "2.半屏小程序申请"],
icon: "clock",
},
{
title: "2024年3月24日",
content: ["1.新增欢迎页", "2.默认用户头像显示"],

View File

@@ -53,11 +53,11 @@ const my = () => {
{/* 列表 */}
<View className="mylist">
<AtListItem
{/* <AtListItem
title="我参加的"
arrow="right"
thumb="https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png"
/>
/> */}
<AtListItem
title="更新日志"
// note="描述信息"
@@ -83,13 +83,13 @@ const my = () => {
});
}}
/>
<AtListItem
{/* <AtListItem
title="联系客服"
// note="描述信息"
// extraText="详细信息"
arrow="right"
thumb="http://img12.360buyimg.com/jdphoto/s72x72_jfs/t10660/330/203667368/1672/801735d7/59c85643N31e68303.png"
/>
/> */}
</View>
{/* 个人客服 */}