diff --git a/.gitignore b/.gitignore
index 331e8f6f4da6e0d6041b0ec13271575de5186fca..8f75378402858711f422de4a4619bb40c934412d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@ deploy_versions/
.rn_temp/
node_modules/
.DS_Store
-.swc
\ No newline at end of file
+.swc
+.cursorrules
\ No newline at end of file
diff --git a/package.json b/package.json
index d8e1cf7a040846a7cb2aff80f03c7c589488b5c8..1e847d882a85c3c1d9b7e8bbb7478b3c63fb3aaf 100644
--- a/package.json
+++ b/package.json
@@ -52,7 +52,9 @@
"@tarojs/runtime": "4.0.3",
"@tarojs/shared": "4.0.3",
"@tarojs/taro": "4.0.3",
+ "ahooks": "^3.8.1",
"babel-plugin-import": "^1.13.8",
+ "dayjs": "^1.11.13",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"zustand": "^4.5.4"
diff --git a/src/app.config.ts b/src/app.config.ts
index 2a69e6c058fcaae9163544a08db12e08a84a877e..64317d927b553ada8ed38a2d98c9cba022c0b6e2 100644
--- a/src/app.config.ts
+++ b/src/app.config.ts
@@ -7,6 +7,11 @@ export default defineAppConfig({
"pages/Apply/index",
"pages/ApplyDesc/index",
"pages/Success/index",
+ 'pages/kitchenWaste/index',
+ 'pages/kitchenWaste/pages/record/index',
+ 'pages/kitchenWaste/pages/addCollection/index',
+ 'pages/kitchenWaste/pages/contracted/index',
+ 'pages/kitchenWaste/pages/addMerchants/index',
],
window: {
backgroundTextStyle: "light",
@@ -14,4 +19,13 @@ export default defineAppConfig({
navigationBarTitleText: "WeChat",
navigationBarTextStyle: "black",
},
+ lazyCodeLoading: 'requiredComponents',
+ requiredPrivateInfos: [
+ "getLocation",
+ ],
+ permission: {
+ "scope.userLocation": {
+ "desc": "您的位置信息将用于定位服务"
+ },
+ }
});
diff --git a/src/app.less b/src/app.less
index ed798e8d24bf7eed0089b250e0cd9612bb7ed778..f94da1da1e8318ecfe64f48d932ca9989b62c0fd 100644
--- a/src/app.less
+++ b/src/app.less
@@ -3,3 +3,15 @@ page {
height: 100%;
position: relative;
}
+
+/* 下面样式代码餐厨垃圾页面需要请勿删除 */
+View,
+Button,
+Image {
+ box-sizing: border-box;
+}
+
+.placeholder {
+ font-size: 31px;
+ color: #999999;
+}
diff --git a/src/assets/images/kitchenWaste/add.png b/src/assets/images/kitchenWaste/add.png
new file mode 100644
index 0000000000000000000000000000000000000000..d25c98c6a41460bfe383bc27fe271cca065ce3d4
Binary files /dev/null and b/src/assets/images/kitchenWaste/add.png differ
diff --git a/src/assets/images/kitchenWaste/back.svg b/src/assets/images/kitchenWaste/back.svg
new file mode 100644
index 0000000000000000000000000000000000000000..72c4a35225c223bedfcd90888aeebd93be9300c4
--- /dev/null
+++ b/src/assets/images/kitchenWaste/back.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/images/kitchenWaste/btn_bg2.png b/src/assets/images/kitchenWaste/btn_bg2.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce6798c9d9888fdd598362338705badccbc72bdc
Binary files /dev/null and b/src/assets/images/kitchenWaste/btn_bg2.png differ
diff --git a/src/assets/images/kitchenWaste/camera.png b/src/assets/images/kitchenWaste/camera.png
new file mode 100644
index 0000000000000000000000000000000000000000..23f18c27fe9b0f045728729b021759660bbf1d91
Binary files /dev/null and b/src/assets/images/kitchenWaste/camera.png differ
diff --git a/src/assets/images/kitchenWaste/clear.png b/src/assets/images/kitchenWaste/clear.png
new file mode 100644
index 0000000000000000000000000000000000000000..58b042626b0c7cf31ea8c1d22022a1473766ec8f
Binary files /dev/null and b/src/assets/images/kitchenWaste/clear.png differ
diff --git a/src/assets/images/kitchenWaste/def_dp.png b/src/assets/images/kitchenWaste/def_dp.png
new file mode 100644
index 0000000000000000000000000000000000000000..2021cf874a20b04c428007122adbc49af2184c49
Binary files /dev/null and b/src/assets/images/kitchenWaste/def_dp.png differ
diff --git a/src/assets/images/kitchenWaste/empty.png b/src/assets/images/kitchenWaste/empty.png
new file mode 100644
index 0000000000000000000000000000000000000000..16b0541e03c30293dbba8e42602efdb5d75a6f38
Binary files /dev/null and b/src/assets/images/kitchenWaste/empty.png differ
diff --git a/src/assets/images/kitchenWaste/join.svg b/src/assets/images/kitchenWaste/join.svg
new file mode 100644
index 0000000000000000000000000000000000000000..96a52e9d7e76e1d0e0d55f174139c39a35f0abbf
--- /dev/null
+++ b/src/assets/images/kitchenWaste/join.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/images/kitchenWaste/small.png b/src/assets/images/kitchenWaste/small.png
new file mode 100644
index 0000000000000000000000000000000000000000..dcc56c3767e4b13d4a022f15d33275e7eb7f57f4
Binary files /dev/null and b/src/assets/images/kitchenWaste/small.png differ
diff --git a/src/components/Container/index.less b/src/components/Container/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..da3c3c5c7a186f6afe9b80ce7ced822b79e7e676
--- /dev/null
+++ b/src/components/Container/index.less
@@ -0,0 +1,16 @@
+.wrap {
+ background-image: url("https://xct.cdhncy.cn/file/xindu/2024/9/4/nav_bg.png");
+ background-color: #b4e7b2;
+ background-repeat: no-repeat;
+ background-position: 0 0;
+ min-height: 100vh;
+ background-size: contain;
+}
+
+.content {
+ flex: auto;
+ height: calc(100vh - var(--h));
+ margin-top: 46px;
+ overflow-y: auto;
+ -webkit-overflow-scrolling: touch;
+}
diff --git a/src/components/Container/index.tsx b/src/components/Container/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..4ac5afd4b5299b81db4547b1a4fd2c32ac3bde6a
--- /dev/null
+++ b/src/components/Container/index.tsx
@@ -0,0 +1,31 @@
+import { CSSProperties, FC, PropsWithChildren } from "react";
+import "./index.less";
+import NavigationBar from "@/components/NavigationBar";
+import { View } from "@tarojs/components";
+import Taro from "@tarojs/taro";
+
+interface ContainerProps {
+ style?: CSSProperties;
+ className?: string;
+ title?: string; //导航栏名称
+}
+/**
+ * @description 页面通用容器,带滚动和固定自定义导航栏
+ * 注意:在自己的页面配置config中设置disableScroll为true
+ */
+const Container: FC> = (props) => {
+ const { children, style, className, title } = props;
+ const cachet = Taro.getMenuButtonBoundingClientRect();
+ return (
+
+
+
+ {children}
+
+
+ );
+};
+export default Container;
diff --git a/src/components/Empty/index.less b/src/components/Empty/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..3a33357323d5b9ba70f000ba802ec9c4555b1699
--- /dev/null
+++ b/src/components/Empty/index.less
@@ -0,0 +1,14 @@
+.empty {
+ margin-top: 40px;
+ font-size: 30px;
+ color: #777777;
+ text-align: center;
+ > Image {
+ width: 150px;
+ height: 150px;
+ }
+}
+
+.em-text {
+ margin-top: 20px;
+}
diff --git a/src/components/Empty/index.tsx b/src/components/Empty/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..012994b20c26d0a430b13720a64f5cd4065b4baf
--- /dev/null
+++ b/src/components/Empty/index.tsx
@@ -0,0 +1,22 @@
+import { Image, View, Text } from "@tarojs/components";
+import "./index.less";
+import empty from "@/assets/images/kitchenWaste/empty.png";
+import { CSSProperties } from "react";
+
+interface Props {
+ style?: CSSProperties;
+}
+/**
+ * @description 空数据组件
+ */
+export default (props: Props) => {
+ const { style } = props;
+ return (
+
+
+
+ 暂无数据...
+
+
+ );
+};
diff --git a/src/components/NavigationBar/index.less b/src/components/NavigationBar/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..67e44701df82fc643c8218e035ac8c7b9c04726e
--- /dev/null
+++ b/src/components/NavigationBar/index.less
@@ -0,0 +1,24 @@
+.nav-bar {
+ font-weight: 800;
+ font-size: 33px;
+ color: #333333;
+ display: flex;
+ align-items: center;
+ position: relative;
+ justify-content: center;
+ margin-bottom: 10px;
+}
+
+.back {
+ position: absolute;
+ left: 37px;
+
+ &:active {
+ opacity: 0.8;
+ }
+
+ > Image {
+ width: 40px;
+ height: 40px;
+ }
+}
diff --git a/src/components/NavigationBar/index.tsx b/src/components/NavigationBar/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..834e761955ff17bc6dc9200d19035b761bc8a48c
--- /dev/null
+++ b/src/components/NavigationBar/index.tsx
@@ -0,0 +1,30 @@
+import "./index.less";
+import Taro, { getMenuButtonBoundingClientRect } from "@tarojs/taro";
+import back from "@/assets/images/kitchenWaste/back.svg";
+import { View, Image } from "@tarojs/components";
+
+interface Props {
+ title: string;
+}
+
+/**
+ * @description 导航自定义头部
+ */
+export default (props: Props) => {
+ const { title } = props;
+ const cachet = getMenuButtonBoundingClientRect();
+
+ return (
+
+ {
+ Taro.navigateBack();
+ }}
+ className="back"
+ >
+
+
+ {title}
+
+ );
+};
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index 1048f511119a378d987f33fb40acf79862437649..0f5f43704af6f76d5f75b2040b10b1be6c4d4789 100644
--- a/src/pages/index/index.tsx
+++ b/src/pages/index/index.tsx
@@ -121,6 +121,15 @@ export default function Index() {
})}
行政许可备案
+
+ Taro.navigateTo({
+ url: "/pages/kitchenWaste/index",
+ })
+ }
+ >
+ 餐厨垃圾
+
{projectList?.map((item) => {
return (
diff --git a/src/pages/kitchenWaste/index.config.ts b/src/pages/kitchenWaste/index.config.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0b47a18d0be884612e640ec3d12d2b3921d03966
--- /dev/null
+++ b/src/pages/kitchenWaste/index.config.ts
@@ -0,0 +1,6 @@
+export default definePageConfig({
+ navigationBarTitleText: '',
+ navigationBarBackgroundColor: '#FAFFF4',
+ backgroundColor: '#8BD986',
+ navigationStyle: 'custom', // 使用自定义导航栏
+})
diff --git a/src/pages/kitchenWaste/index.less b/src/pages/kitchenWaste/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..23b76a049af9992e71de2bc399ff37dc42bbf819
--- /dev/null
+++ b/src/pages/kitchenWaste/index.less
@@ -0,0 +1,164 @@
+.wrap {
+ min-height: 100vh;
+ background-image: url("https://xct.cdhncy.cn/file/xindu/2024/9/4/bg.png");
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+ padding: 468px 20px 22px;
+ display: flex;
+ flex-flow: column;
+}
+
+.name {
+ width: fit-content;
+ flex: 0 0 auto;
+ height: 72px;
+ line-height: 72px;
+ font-weight: 800;
+ font-size: 40px;
+ color: #ffffff;
+ padding: 0 92px;
+ background-image: url("https://xct.cdhncy.cn/file/xindu/2024/9/4/title_bg.png");
+ background-size: 100%;
+ background-repeat: no-repeat;
+ margin: auto;
+}
+
+.main {
+ flex: auto;
+ margin-top: 71px;
+ background-image: url("https://xct.cdhncy.cn/file/xindu/2024/9/4/h_box.png");
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+ padding: 38px 34px;
+}
+
+.card {
+ height: 347px;
+ background: #edf8ec;
+ box-shadow: 0px 4px 13px 0px rgba(178, 227, 190, 0.5);
+ border-radius: 33px;
+ padding: 49px 44px;
+ display: flex;
+ justify-content: space-between;
+}
+
+.item {
+ text-align: center;
+ line-height: normal;
+
+ &:active {
+ opacity: 0.8;
+ }
+ > Image {
+ width: 120px;
+ height: 120px;
+ }
+}
+
+.shName {
+ font-weight: 500;
+ font-size: 27px;
+ color: #66c46c;
+ margin-top: 20px;
+}
+
+.num {
+ margin-top: 10px;
+ font-weight: 800;
+ font-size: 47px;
+ color: #3cb25c;
+}
+
+.unit {
+ font-size: 33px;
+ margin-left: 10px;
+ font-weight: 500;
+}
+
+.btn-icon {
+ width: 53px;
+ height: 53px;
+}
+
+.btn-text {
+ font-size: 32px;
+ color: #66c164;
+ margin-left: 22px;
+}
+
+.def-btn {
+ position: relative;
+ margin-top: 31px;
+ height: 133px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-image: url("https://xct.cdhncy.cn/file/xindu/2024/9/4/btn_bg.png");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ border: none !important;
+ outline: none !important;
+
+ &:active {
+ opacity: 0.8;
+ }
+}
+
+.tjText {
+ font-weight: 800;
+ font-size: 35px;
+ color: #3db35d;
+ text-align: center;
+ margin: 33px 0;
+}
+
+.btn-pt {
+ width: 66px;
+ height: 66px;
+ border-radius: 50%;
+}
+
+.btn-text2 {
+ font-weight: 500;
+ font-size: 31px;
+ color: #010101;
+ margin-left: 12px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ width: 300px;
+}
+
+.btn-tag {
+ margin-left: 11px;
+ width: 100px;
+ height: 30px;
+ line-height: 30px;
+ font-size: 19rpx;
+ color: #ffffff;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+}
+
+.btn-next {
+ position: absolute;
+ right: 40px;
+ top: calc(50% - 26.5px);
+ width: 53px;
+ height: 53px;
+ background-image: url("https://xct.cdhncy.cn/file/xindu/2024/9/4/next.png");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+}
+
+.l-box {
+ display: flex;
+ justify-content: start;
+ align-items: center;
+ position: absolute;
+ left: 30px;
+}
+
+.mar-t-0 {
+ margin-top: 0;
+}
diff --git a/src/pages/kitchenWaste/index.tsx b/src/pages/kitchenWaste/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..818f400b5149aab10495ddaee025196e942ea7cb
--- /dev/null
+++ b/src/pages/kitchenWaste/index.tsx
@@ -0,0 +1,167 @@
+import { FC, useState } from "react";
+import { View, Text, Image, Button } from "@tarojs/components";
+import "./index.less";
+import Taro, { useDidShow } from "@tarojs/taro";
+import api from "@/services";
+import globalStore from "@/store/index";
+import def_dp from "@/assets/images/kitchenWaste/def_dp.png";
+
+interface ImgNumProps {
+ title: string;
+ number?: number | string;
+ unit: string;
+ color?: string;
+ img: string;
+ path: string;
+}
+
+const ImgNum = (props: ImgNumProps) => {
+ const { title, number, unit, color, img, path } = props;
+
+ const handleJumpToPage = () => {
+ Taro.navigateTo({
+ url: path,
+ });
+ };
+
+ return (
+
+
+
+
+ {number ?? 0}
+ {unit}
+
+
+
+ {title}
+
+
+ );
+};
+
+const Index: FC = () => {
+ const [qData, setQData] = useState();
+ const [recommendData, setRecommendData] = useState();
+ const { upCollectionInfo, collectionInfo } = globalStore();
+
+ useDidShow(() => {
+ api.kitchenWaste.queryStatisticsForWeChat().then((res) => {
+ if (res.code === 200) {
+ setQData(res.data);
+ }
+ });
+
+ api.kitchenWaste.getEntitieInfo().then((res) => {
+ if (res.code === 200) {
+ upCollectionInfo(res.data);
+ }
+ });
+
+ Taro.getLocation({
+ type: "wgs84",
+ success: function (res) {
+ const latitude = res.latitude;
+ const longitude = res.longitude;
+ api.kitchenWaste
+ .queryRecommendForWeChat(latitude, longitude)
+ .then((res) => {
+ if (res.code === 200) {
+ setRecommendData(res.data);
+ }
+ });
+ },
+ });
+ });
+
+ return (
+
+
+ {collectionInfo?.name ?? ""}
+
+
+
+
+
+
+
+
+
+
+
+ 推荐产生单位
+
+ {recommendData?.map((v) => (
+
+ ))}
+
+
+ );
+};
+
+export default Index;
diff --git a/src/pages/kitchenWaste/pages/addCollection/index.config.ts b/src/pages/kitchenWaste/pages/addCollection/index.config.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ee65b831d22fc7c33ddb3e4118c282f8b73d4dfd
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/addCollection/index.config.ts
@@ -0,0 +1,7 @@
+export default definePageConfig({
+ navigationBarTitleText: '电子五联单',
+ navigationBarBackgroundColor: '#DBF1D7',
+ backgroundColor: '#B4E7B2',
+ navigationStyle: 'custom', // 使用自定义导航栏
+ disableScroll: true
+})
diff --git a/src/pages/kitchenWaste/pages/addCollection/index.less b/src/pages/kitchenWaste/pages/addCollection/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..8142aedf3adf80ad5384e130e34288541d27ab2f
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/addCollection/index.less
@@ -0,0 +1,61 @@
+.main {
+ padding: 0 30px 136px;
+}
+
+.form-item {
+ font-weight: 500;
+ font-size: 31px;
+ line-height: normal;
+ color: #010101;
+ margin-bottom: 28px;
+}
+
+.form-input {
+ position: relative;
+ font-size: 31px;
+ color: #010101;
+ padding-left: 35px;
+ background: #ffffff;
+ border-radius: 20px;
+ height: 100px;
+ line-height: 100px;
+ &::placeholder {
+ font-size: 31px;
+ color: #999999;
+ }
+}
+
+.sub-btn {
+ height: 110px;
+ line-height: 110px;
+ width: 100%;
+ margin-top: 74px;
+ background-image: url("@/assets/images/kitchenWaste/btn_bg2.png");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ border: none !important;
+ outline: none !important;
+ > Text {
+ font-weight: 500;
+ font-size: 32px;
+ color: #ffffff;
+ }
+ &:active {
+ opacity: 0.8;
+ }
+}
+
+.select-text {
+ position: absolute;
+ display: flex;
+ align-items: center;
+ top: 0;
+ right: 38px;
+ font-size: 31px;
+ color: #75c274;
+ > Image {
+ margin-left: 15px;
+ width: 40px;
+ height: 40px;
+ }
+}
diff --git a/src/pages/kitchenWaste/pages/addCollection/index.tsx b/src/pages/kitchenWaste/pages/addCollection/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..fe70b19b002ad62cdd87794e750a364860d16340
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/addCollection/index.tsx
@@ -0,0 +1,240 @@
+import { CSSProperties, FC, PropsWithChildren, useState } from "react";
+import "./index.less";
+import {
+ View,
+ Form,
+ Input,
+ Text,
+ Button,
+ Picker,
+ Image,
+} from "@tarojs/components";
+import Container from "@/components/Container";
+import joinIcon from "@/assets/images/kitchenWaste/join.svg";
+import Taro, { useDidShow } from "@tarojs/taro";
+import globalStore from "@/store";
+import api from "@/services";
+import { useSetState } from "ahooks";
+import dayjs from "dayjs";
+
+interface FormItemProps {
+ style?: CSSProperties;
+ label: string;
+}
+export const FormItem: FC> = ({
+ children,
+ style,
+ label,
+}) => {
+ return (
+
+
+ {label}
+
+ {children}
+
+ );
+};
+/**
+ * @description 收运记录
+ */
+const Record: FC = () => {
+ const { businessId } = Taro.getCurrentInstance().router?.params || {};
+ const [selectedIds, setSelectedIds] = useSetState<{
+ k1?: any;
+ k2?: any;
+ }>({});
+ const [selectedDate, setSelectedDate] = useSetState<{
+ date: string;
+ time: string;
+ }>({
+ date: "",
+ time: "",
+ });
+ const [vehicles, setVehicles] = useState([]);
+ const [signEntities, setSignEntities] = useState([]);
+ const { collectionInfo } = globalStore();
+
+ useDidShow(() => {
+ api.kitchenWaste.queryCarList().then((res) => {
+ if (res.code === 200) {
+ setVehicles(res.data);
+ }
+ });
+
+ api.kitchenWaste.getSignEntities().then((res) => {
+ if (res.code === 200) {
+ setSignEntities(res.data);
+ let index = res.data?.findIndex((v) => v.value === businessId);
+ setSelectedIds({
+ k1: index !== -1 ? index.toString() : undefined,
+ });
+ }
+ });
+ });
+
+ //提交表单
+ const formSubmit = (e) => {
+ let { value } = e.target;
+ for (let i in value) {
+ if (!value[i]) {
+ Taro.showToast({
+ title: "请填写完整数据后再提交!",
+ icon: "error",
+ duration: 2000,
+ });
+ return;
+ }
+ }
+ const { collectionDate, ...reset } = value;
+ let params = {
+ ...reset,
+ carNum: vehicles[value.carNum].label,
+ businessName: signEntities[value.businessName].name,
+ businessId: signEntities[value.businessName].value,
+ collectionId: collectionInfo?.id,
+ collectionTime: value.collectionDate + ` ${value.collectionTime}:00`,
+ };
+ api.kitchenWaste.submitForWl(params).then((res) => {
+ if (res.code === 200) {
+ Taro.showToast({
+ title: "提交成功",
+ icon: "success",
+ duration: 2000,
+ mask: true,
+ success: () => {
+ setTimeout(() => {
+ Taro.navigateBack();
+ }, 800);
+ },
+ });
+ } else {
+ Taro.showToast({
+ title: res.msg ?? "",
+ icon: "error",
+ duration: 2000,
+ });
+ }
+ });
+ };
+
+ return (
+
+
+
+
+
+ );
+};
+export default Record;
diff --git a/src/pages/kitchenWaste/pages/addMerchants/index.config.ts b/src/pages/kitchenWaste/pages/addMerchants/index.config.ts
new file mode 100644
index 0000000000000000000000000000000000000000..30bf7b60d40275ddb8a24eb1238885b5b6d03c00
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/addMerchants/index.config.ts
@@ -0,0 +1,7 @@
+export default definePageConfig({
+ navigationBarTitleText: '添加商户',
+ navigationBarBackgroundColor: '#DBF1D7',
+ backgroundColor: '#B4E7B2',
+ navigationStyle: 'custom', // 使用自定义导航栏
+ disableScroll: true
+})
diff --git a/src/pages/kitchenWaste/pages/addMerchants/index.less b/src/pages/kitchenWaste/pages/addMerchants/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..c62b64a7dd80e94483542c7886084d201f8a2049
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/addMerchants/index.less
@@ -0,0 +1,118 @@
+.main {
+ padding: 0 30px 136px;
+}
+
+.form-item {
+ font-weight: 500;
+ font-size: 31px;
+ line-height: normal;
+ color: #010101;
+ margin-bottom: 28px;
+}
+
+.form-input {
+ position: relative;
+ font-size: 31px;
+ color: #010101;
+ padding-left: 35px;
+ background: #ffffff;
+ border-radius: 20px;
+ height: 100px;
+ line-height: 100px;
+ &::placeholder {
+ font-size: 31px;
+ color: #999999;
+ }
+}
+
+.sub-btn {
+ height: 110px;
+ line-height: 110px;
+ width: 100%;
+ margin-top: 74px;
+ background-image: url("@/assets/images/kitchenWaste/btn_bg2.png");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ border: none !important;
+ outline: none !important;
+ > Text {
+ font-weight: 500;
+ font-size: 32px;
+ color: #ffffff;
+ }
+ &:active {
+ opacity: 0.8;
+ }
+}
+
+.select-text {
+ position: absolute;
+ top: 0;
+ right: 38px;
+ display: flex;
+ align-items: center;
+ font-size: 31px;
+ color: #75c274;
+ > Image {
+ margin-left: 15px;
+ width: 40px;
+ height: 40px;
+ }
+}
+
+.pt-box {
+ display: flex;
+ gap: 26px;
+ justify-content: start;
+ flex-flow: wrap;
+}
+
+.cm-pt {
+ position: relative;
+ width: 213rpx;
+ height: 213rpx;
+ border-radius: 20px;
+ position: relative;
+ background: #ffffff;
+ > Image {
+ width: 213rpx;
+ height: 213rpx;
+ }
+}
+
+.clear-item {
+ position: absolute;
+ right: -16.5px;
+ top: -16.5px;
+ z-index: 10;
+ > Image {
+ width: 33px;
+ height: 33px;
+ }
+}
+
+.pictures-box {
+ width: 213px;
+ height: 213px;
+ background: #ffffff;
+ border-radius: 20px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-flow: column;
+
+ &:active {
+ opacity: 0.8;
+ }
+
+ > Image {
+ width: 56px;
+ height: 50px;
+ }
+
+ .cam-text {
+ font-size: 28px;
+ color: #999999;
+ margin-top: 30px;
+ }
+}
diff --git a/src/pages/kitchenWaste/pages/addMerchants/index.tsx b/src/pages/kitchenWaste/pages/addMerchants/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..d8466fb6ab3fb5c2dd935815c7c1094d10758202
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/addMerchants/index.tsx
@@ -0,0 +1,309 @@
+import { CSSProperties, FC, PropsWithChildren, useState } from "react";
+import "./index.less";
+import { View, Form, Image, Text, Button, Picker } from "@tarojs/components";
+import Container from "@/components/Container";
+import joinIcon from "@/assets/images/kitchenWaste/join.svg";
+import { useSetState } from "ahooks";
+import cameraPng from "@/assets/images/kitchenWaste/camera.png";
+import Taro, { useDidShow, useReady } from "@tarojs/taro";
+import api from "@/services";
+import clearIcon from "@/assets/images/kitchenWaste/clear.png";
+import dayjs from "dayjs";
+
+interface FormItemProps {
+ style?: CSSProperties;
+ label: string;
+}
+export const FormItem: FC> = ({
+ children,
+ style,
+ label,
+}) => {
+ return (
+
+
+ {label}
+
+ {children}
+
+ );
+};
+/**
+ * @description 添加商户
+ */
+const Record: FC = () => {
+ const [selectedVehicle, setSelectedVehicle] = useState(0);
+ const [selectedDate, setSelectedDate] = useSetState>({
+ signTime: "",
+ startTime: "",
+ endTime: "",
+ });
+ const [contractImage, setContractImage] = useState[]>([]);
+ const [vehicles, setVehicles] = useState([]);
+
+ useReady(() => {
+ api.kitchenWaste.getNotSignEntities().then((res) => {
+ if (res.code === 200) {
+ setVehicles(res.data);
+ }
+ });
+ });
+
+ //提交表单
+ const formSubmit = (e) => {
+ let { value } = e.target;
+
+ for (let i in value) {
+ if (!value[i]) {
+ Taro.showToast({
+ title: "请填写完整数据后再提交!",
+ icon: "error",
+ duration: 2000,
+ });
+ return;
+ }
+ if (["signTime", "startTime", "endTime"].includes(i)) {
+ value[i] = value[i] + " 00:00:00";
+ }
+ }
+
+ let params = {
+ ...value,
+ businessId: vehicles[value.businessName].value,
+ businessName: vehicles[value.businessName].name,
+ picture: contractImage.map((v) => v.url).join(","),
+ };
+ api.kitchenWaste.addWasteCollectionContract(params).then((res) => {
+ if (res.code === 200) {
+ Taro.showToast({
+ title: "提交成功",
+ icon: "success",
+ duration: 2000,
+ mask: true,
+ success: () => {
+ setTimeout(() => {
+ Taro.navigateBack();
+ }, 800);
+ },
+ });
+ } else {
+ Taro.showToast({
+ title: res.msg ?? "",
+ icon: "error",
+ duration: 2000,
+ });
+ }
+ });
+ };
+
+ const handleTakePhoto = () => {
+ Taro.getSetting({
+ success: (res) => {
+ if (res.authSetting["scope.camera"]) {
+ // 已经授权,直接调用相机
+ takePhoto();
+ } else {
+ // 未授权,重新申请
+ Taro.authorize({
+ scope: "scope.camera",
+ success: () => {
+ takePhoto();
+ },
+ fail: () => {
+ Taro.showModal({
+ title: "提示",
+ content: "需要您授权相机权限才能拍照,是否去设置?",
+ success: (modalRes) => {
+ if (modalRes.confirm) {
+ Taro.openSetting();
+ }
+ },
+ });
+ },
+ });
+ }
+ },
+ });
+ };
+
+ const takePhoto = () => {
+ Taro.chooseImage({
+ count: 1,
+ sourceType: ["camera"],
+ success: (res) => {
+ // 压缩图片
+ Taro.compressImage({
+ src: res.tempFilePaths[0],
+ quality: 80,
+ success: (compressRes) => {
+ setContractImage([
+ ...contractImage,
+ {
+ url: compressRes.tempFilePath,
+ id: dayjs().valueOf(),
+ },
+ ]);
+ Taro.showToast({
+ title: "拍照成功",
+ icon: "success",
+ duration: 2000,
+ });
+ },
+ fail: () => {
+ Taro.showToast({
+ title: "图片压缩失败",
+ icon: "error",
+ duration: 2000,
+ });
+ },
+ });
+ },
+ fail: () => {
+ Taro.showToast({
+ title: "拍照失败",
+ icon: "error",
+ duration: 2000,
+ });
+ },
+ });
+ };
+
+ const handlePreviewImage = (path: Record) => {
+ if (contractImage) {
+ Taro.previewImage({
+ current: path.url,
+ urls: contractImage.map((v) => v.url),
+ });
+ }
+ };
+
+ return (
+
+
+
+
+
+ );
+};
+export default Record;
diff --git a/src/pages/kitchenWaste/pages/contracted/index.config.ts b/src/pages/kitchenWaste/pages/contracted/index.config.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b2a829828aceedac9e4e3a0d68fa5f37b5d20f56
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/contracted/index.config.ts
@@ -0,0 +1,8 @@
+export default definePageConfig({
+ navigationBarTitleText: '签约商户',
+ navigationBarBackgroundColor: '#DBF1D7',
+ navigationBarTextStyle: 'black',
+ backgroundColor: '#B4E7B2',
+ navigationStyle: 'custom', // 使用自定义导航栏
+ disableScroll: true
+})
diff --git a/src/pages/kitchenWaste/pages/contracted/index.less b/src/pages/kitchenWaste/pages/contracted/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..caecba77320ecaadbbc562d55424b1822e50c11e
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/contracted/index.less
@@ -0,0 +1,82 @@
+.main {
+ padding: 0 20px 30px;
+}
+
+.card-wrap {
+ width: 100%;
+ height: 160px;
+ padding: 43px;
+ background: rgba(237, 248, 236, 0.8);
+ border-radius: 27px;
+ box-shadow: 0 0 10px 7px inset rgba(255, 255, 255, 0.4);
+}
+
+.card-wrap + .card-wrap {
+ margin-top: 20px;
+}
+
+.titleBox {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.l-info {
+ width: calc(100% - 170px);
+ line-height: normal;
+ display: flex;
+ align-items: center;
+}
+
+.pt {
+ width: 66px;
+ height: 66px;
+}
+
+.title {
+ font-size: 31px;
+ color: #010101;
+ margin-left: 12px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ width: calc(100% - 78px);
+}
+
+.time {
+ min-width: 170px;
+ font-size: 23px;
+ color: #777777;
+ text-align: right;
+}
+
+.add-btn {
+ position: fixed;
+ left: calc(50% - 178.5px);
+ bottom: 36px;
+ padding: 0 43px 0 50px;
+ height: 110px;
+ display: flex;
+ align-items: center;
+ background-image: url("@/assets/images/kitchenWaste/small.png");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ border: none !important;
+ outline: none !important;
+
+ &:active {
+ opacity: 0.8;
+ }
+
+ > Image {
+ width: 53px;
+ height: 53px;
+ }
+
+ > Text {
+ margin-left: 21px;
+ font-weight: 500;
+ font-size: 32rpx;
+ color: #ffffff;
+ }
+}
diff --git a/src/pages/kitchenWaste/pages/contracted/index.tsx b/src/pages/kitchenWaste/pages/contracted/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..10b64b3ec3fcbdcaff16fcb0a7e5bf73115d2334
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/contracted/index.tsx
@@ -0,0 +1,81 @@
+import { FC, useState } from "react";
+import "./index.less";
+import { View, Text, Image, Button } from "@tarojs/components";
+import Container from "@/components/Container";
+import addIcon from "@/assets/images/kitchenWaste/add.png";
+import Taro, { useDidShow } from "@tarojs/taro";
+import api from "@/services";
+import Empty from "@/components/Empty";
+import dayjs from "dayjs";
+import def_dp from "@/assets/images/kitchenWaste/def_dp.png";
+
+interface CardProps {
+ title: string;
+ img: string;
+ time: string;
+}
+const Card = (props: CardProps) => {
+ const { title, img, time } = props;
+ return (
+
+
+
+
+
+ {title}
+
+
+ {time}签约
+
+
+ );
+};
+
+/**
+ * @description 签约商户
+ */
+const Contracted: FC = () => {
+ const [qData, setQData] = useState([]);
+
+ useDidShow(() => {
+ api.kitchenWaste.getSignListForWeChat().then((res) => {
+ if (res.code === 200) {
+ if (res.code === 200) {
+ setQData(res.data);
+ }
+ }
+ });
+ });
+ return (
+
+
+ {qData.length > 0 ? (
+ qData?.map((v) => (
+
+ ))
+ ) : (
+
+ )}
+
+
+
+
+ );
+};
+export default Contracted;
diff --git a/src/pages/kitchenWaste/pages/record/index.config.ts b/src/pages/kitchenWaste/pages/record/index.config.ts
new file mode 100644
index 0000000000000000000000000000000000000000..241abdcb9a831fe1e46806bd3884e975a6800549
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/record/index.config.ts
@@ -0,0 +1,8 @@
+export default definePageConfig({
+ navigationBarTitleText: '收运记录',
+ navigationBarBackgroundColor: '#DBF1D7',
+ navigationBarTextStyle: 'black',
+ backgroundColor: '#B4E7B2',
+ navigationStyle: 'custom', // 使用自定义导航栏
+ disableScroll: true
+})
diff --git a/src/pages/kitchenWaste/pages/record/index.less b/src/pages/kitchenWaste/pages/record/index.less
new file mode 100644
index 0000000000000000000000000000000000000000..286e2ebcfb1f2cafa375239edc60e7aba4b826c6
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/record/index.less
@@ -0,0 +1,91 @@
+.main {
+ padding: 0 20px 30px;
+}
+
+.card-wrap {
+ width: 100%;
+ height: 233px;
+ padding: 43px;
+ background-image: url("https://xct.cdhncy.cn/file/xindu/2024/9/4/card_bg.png");
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+}
+
+.card-wrap + .card-wrap {
+ margin-top: 20px;
+}
+
+.titleBox {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.l-info {
+ line-height: normal;
+ display: flex;
+ align-items: center;
+ flex: 1;
+ overflow: hidden;
+}
+
+.pt {
+ flex: 0 0 auto;
+ width: 66px;
+ height: 66px;
+}
+
+.title {
+ flex: 0 0 auto;
+ padding-right: 20px;
+ font-size: 31px;
+ color: #010101;
+ margin-left: 12px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ width: calc(100% - 78px);
+}
+
+.time {
+ font-size: 23px;
+ color: #777777;
+ width: 130px;
+ text-align: right;
+ flex: 0 0 auto;
+}
+
+.tagBox {
+ display: flex;
+ align-items: center;
+ margin-top: 20px;
+}
+
+.num {
+ font-weight: 800;
+ font-size: 47px;
+ color: #3cb25c;
+}
+
+.unit {
+ margin-left: 12px;
+ font-size: 33px;
+ color: #3cb25c;
+}
+
+.car-num,
+.user-name {
+ padding: 0 19px 0 12px;
+ font-size: 25px;
+ height: 40px;
+ line-height: 40px;
+ color: #ffffff;
+ background: #3cc1e2;
+ border-radius: 19rpx 18rpx 22rpx 1rpx;
+ margin-left: 29px;
+}
+
+.user-name {
+ margin-left: 16px;
+ background: #f5bf56;
+}
diff --git a/src/pages/kitchenWaste/pages/record/index.tsx b/src/pages/kitchenWaste/pages/record/index.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..54dece9d27c5a1dacf64b077dc47594a96d2fb0d
--- /dev/null
+++ b/src/pages/kitchenWaste/pages/record/index.tsx
@@ -0,0 +1,81 @@
+import { FC, useState } from "react";
+import "./index.less";
+import { View, Text, Image } from "@tarojs/components";
+import Container from "@/components/Container";
+import def_dp from "@/assets/images/kitchenWaste/def_dp.png";
+import api from "@/services";
+import { useDidShow } from "@tarojs/taro";
+import dayjs from "dayjs";
+import Empty from "@/components/Empty";
+
+interface CardProps {
+ title: string;
+ img: string;
+ time: string;
+ value: string | number;
+ carNumber: string;
+ name: string;
+}
+const Card = (props: CardProps) => {
+ const { title, img, time, value, carNumber, name } = props;
+ return (
+
+
+
+
+
+ {title}
+
+
+ {time}收运
+
+
+ {value}
+ kg
+
+ {carNumber}
+
+
+ {name}
+
+
+
+ );
+};
+
+/**
+ * @description 收运记录
+ */
+const Record: FC = () => {
+ const [qData, setQData] = useState([]);
+
+ useDidShow(() => {
+ api.kitchenWaste.getCollectionListForWeChat().then((res) => {
+ if (res.code === 200) {
+ setQData(res.data);
+ }
+ });
+ });
+ return (
+
+
+ {qData?.length > 0 ? (
+ qData.map((v) => (
+
+ ))
+ ) : (
+
+ )}
+
+
+ );
+};
+export default Record;
diff --git a/src/services/core/api.ts b/src/services/core/api.ts
index 93008df6cf1a480ba3a83481f2230cf0356309b8..1eb29b7e5f20eb9589d8bafc3d76c87816797e9d 100644
--- a/src/services/core/api.ts
+++ b/src/services/core/api.ts
@@ -4,4 +4,5 @@ export default {
loginDev: "http://192.168.2.21:21601",
authenticationUrl: "http://192.168.2.21:21601/violating-subject/",
assetsUrl: "https://xct.cdhncy.cn/file",
+ kitchenWasteUrl: 'http://172.23.0.125:21626'
};
diff --git a/src/services/core/apiCore.d.ts b/src/services/core/apiCore.d.ts
index 27ae6c0fb76dabe0fba0014bb288cc1890e0556c..8b61e4dc7eae9607a733c76337d3838f144545d5 100644
--- a/src/services/core/apiCore.d.ts
+++ b/src/services/core/apiCore.d.ts
@@ -1,5 +1,6 @@
declare interface Resp {
code: number;
+ msg?: string;
data: T;
}
declare namespace API {
@@ -21,10 +22,10 @@ declare namespace API {
interface TypeOfLegalPerson {
id: string;
name: string;
-
+
}
- interface PropsWithPagination = Record {
+ interface PropsWithPagination = Record> {
nextPage: number;
pageNum: number;
pageSize: number;
@@ -36,4 +37,49 @@ declare namespace API {
list: T[]
hasNextPage: boolean;
}
+
+ interface StatisticsDto {
+ collectionTotal: string
+ signTotal: string
+ weightSum: string
+ }
+
+ interface RecommendDto {
+ businessId: string;
+ businessName: string;
+ type: string;
+ }
+
+ interface CarListDot {
+ label: string;
+ value: string;
+ }
+
+ interface MerchantsListDot {
+ name: string;
+ value: string;
+ }
+
+ interface SignListDto {
+ businessId: string;
+ businessName: string;
+ signTime: string;
+ }
+
+ interface CollectionListDto {
+ businessId: string
+ businessName: string
+ carNum: string
+ collectionId: string
+ collectionName: string
+ collectionTime: string
+ createdBy: string
+ createdTime: string
+ id: string
+ isDeleted: string
+ personnelName: string
+ updatedTime: string
+ updayedBy: string
+ weight: string
+ }
}
diff --git a/src/services/core/request.ts b/src/services/core/request.ts
index c31be098ec199a1817cd2286c489565f902dfbae..c15432e398c3f467c50ef40b5cec8b839b74aeda 100644
--- a/src/services/core/request.ts
+++ b/src/services/core/request.ts
@@ -36,10 +36,10 @@ function urlRegExp(value: string) {
}
/** 请求拦截器 */
-const HttpRequestInterceptor = () => {};
+const HttpRequestInterceptor = () => { };
/** 响应拦截器 */
-const HttpResponseInterceptor = () => {};
+const HttpResponseInterceptor = () => { };
/** 简单封装 */
export default function request(
@@ -50,12 +50,17 @@ export default function request(
url = urlRegExp(url) ? url : apiConfig.dev + url;
-
+
if (params) {
url = url + "?" + objectToQuery(params);
}
return new Promise((resolve, reject) => {
+ Taro.showLoading({
+ title: "数据加载中",
+ mask: true
+ });
+
Taro.request({
method: "POST",
...option,
@@ -73,6 +78,11 @@ export default function request(
fail: (err) => {
reject(err);
},
+ complete(err) {
+ setTimeout(function () {
+ Taro.hideLoading();
+ }, 500);
+ },
});
});
}
diff --git a/src/services/index.ts b/src/services/index.ts
index 726f750846b1af95341b9182b71d2159f5587370..344764e1ba9dbab01234f835b404bb6ceaed3c52 100644
--- a/src/services/index.ts
+++ b/src/services/index.ts
@@ -1,7 +1,9 @@
import * as loginController from "./loginController";
import * as approveController from "./approveController";
+import * as kitchenWaste from "./kitchenWaste";
export default {
login: loginController,
approve: approveController,
+ kitchenWaste: kitchenWaste
};
diff --git a/src/services/kitchenWaste.ts b/src/services/kitchenWaste.ts
new file mode 100644
index 0000000000000000000000000000000000000000..82a75d2676d509f46ec98b755e84168cc67a585d
--- /dev/null
+++ b/src/services/kitchenWaste.ts
@@ -0,0 +1,95 @@
+import api from "./core/api";
+import request from "./core/request";
+
+/**
+ * @description: 首页-商户、签约、收运统计
+ */
+export async function queryStatisticsForWeChat(): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionContract/statisticsForWeChat', { method: 'GET' });
+}
+
+/**
+ * @description: 首页-推荐产生单位
+ */
+export async function queryRecommendForWeChat(lat: number, lon: number): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionRecord/recommendForWeChat', {
+ method: 'GET',
+ data: {
+ lat,
+ lon
+ }
+ });
+}
+
+/**
+ * @description: 首页-获取收运公司信息
+ */
+export async function getEntitieInfo(): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionContract/getEntitieInfo', { method: 'GET' });
+}
+
+/**
+ * @description: 电子五连-获取车辆
+ */
+export async function queryCarList(): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionRecord/getCar', {
+ method: 'GET'
+ });
+}
+
+/**
+ * @description: 电子五连-提交
+ */
+export async function submitForWl(data: any): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionRecord/addWasteCollectionRecord', {
+ method: 'POST',
+ data
+ });
+}
+
+
+/**
+ * @description: 以签约商户列表
+ */
+export async function getSignListForWeChat(): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionContract/getSignListForWeChat', {
+ method: 'GET'
+ });
+}
+
+/**
+ * @description: 未签约商户下拉
+ */
+export async function getNotSignEntities(): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionContract/getNotSignEntitiesForWeChat', {
+ method: 'GET'
+ });
+}
+
+/**
+ * @description: 已经签约商户下拉
+ */
+export async function getSignEntities(): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionContract/getSignEntitiesForWeChat', {
+ method: 'GET'
+ });
+}
+
+/**
+ * @description: 添加商户-提交
+ */
+export async function addWasteCollectionContract(data: any): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionContract/addWasteCollectionContract', {
+ method: 'POST',
+ data
+ });
+}
+
+/**
+ * @description: 收运记录
+ */
+export async function getCollectionListForWeChat(): Promise> {
+ return request(api.kitchenWasteUrl + '/wasteCollectionRecord/getCollectionListForWeChat', {
+ method: 'GET',
+ });
+}
\ No newline at end of file
diff --git a/src/store/index.ts b/src/store/index.ts
index 727b831cb7377847cb48c623242c3cd7d016e943..c4350f26d84880bc20ea30a9b32cbc1652c45bf2 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -14,9 +14,11 @@ interface GlobalStoreType {
isAuth: boolean;
/** 主体信息 */
mainBodyInfo?: any[];
+ collectionInfo?: Record;//收运公司信息
queryMainBodyInfo(mobile?: string): void;
/** 查询认证信息 */
queryAuthenticationInfo(): void;
+ upCollectionInfo(data: any): void;
}
const useGlobalStore = create((set) => ({
userInfo: undefined,
@@ -24,6 +26,7 @@ const useGlobalStore = create((set) => ({
projectFlowConfig: undefined,
isAuth: false,
mainBodyInfo: undefined,
+ collectionInfo: undefined,
/** 更新用户信息 */
updateUserInfo: () => {
@@ -54,7 +57,6 @@ const useGlobalStore = create((set) => ({
queryMainBodyInfo(mobile?: string) {
if (mobile && mobile.length > 0) {
services.login.getMainBodyInfo(mobile ?? "").then((res) => {
- console.log(res);
if (res.code === 200) {
set({ mainBodyInfo: res.data });
}
@@ -76,6 +78,11 @@ const useGlobalStore = create((set) => ({
}
});
},
+
+ upCollectionInfo(data: any) {
+ set({ collectionInfo: data });
+ }
+
}));
export default useGlobalStore;
diff --git a/yarn.lock b/yarn.lock
index bd4f32227975d2f5710c5e579dbb89306c1f1657..012e5228198f394b30958ad428ca0731d4217e04 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1054,6 +1054,13 @@
core-js-pure "^3.30.2"
regenerator-runtime "^0.14.0"
+"@babel/runtime@^7.21.0":
+ version "7.25.6"
+ resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2"
+ integrity sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==
+ dependencies:
+ regenerator-runtime "^0.14.0"
+
"@babel/runtime@^7.24.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7":
version "7.25.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.0.tgz#3af9a91c1b739c569d5d80cc917280919c544ecb"
@@ -2468,6 +2475,21 @@ adm-zip@^0.5.12:
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.5.14.tgz#2c557c0bf12af4311cf6d32970f4060cf8133b2a"
integrity sha512-DnyqqifT4Jrcvb8USYjp6FHtBpEIz1mnXu6pTRHZ0RL69LbQYiO+0lDFg5+OKA7U29oWSs3a/i8fhn8ZcceIWg==
+ahooks@^3.8.1:
+ version "3.8.1"
+ resolved "https://registry.npmmirror.com/ahooks/-/ahooks-3.8.1.tgz#3a19d0e4085618a7a38a22a34b568c8d3fd974c0"
+ integrity sha512-JoP9+/RWO7MnI/uSKdvQ8WB10Y3oo1PjLv+4Sv4Vpm19Z86VUMdXh+RhWvMGxZZs06sq2p0xVtFk8Oh5ZObsoA==
+ dependencies:
+ "@babel/runtime" "^7.21.0"
+ dayjs "^1.9.1"
+ intersection-observer "^0.12.0"
+ js-cookie "^3.0.5"
+ lodash "^4.17.21"
+ react-fast-compare "^3.2.2"
+ resize-observer-polyfill "^1.5.1"
+ screenfull "^5.0.0"
+ tslib "^2.4.1"
+
ajv@^6.10.0, ajv@^6.12.4:
version "6.12.6"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
@@ -3318,6 +3340,11 @@ data-view-byte-offset@^1.0.0:
es-errors "^1.3.0"
is-data-view "^1.0.1"
+dayjs@^1.11.13, dayjs@^1.9.1:
+ version "1.11.13"
+ resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c"
+ integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==
+
debug@^3.2.7:
version "3.2.7"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
@@ -4770,6 +4797,11 @@ internal-slot@^1.0.7:
hasown "^2.0.0"
side-channel "^1.0.4"
+intersection-observer@^0.12.0:
+ version "0.12.2"
+ resolved "https://registry.npmmirror.com/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375"
+ integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==
+
into-stream@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6"
@@ -5086,6 +5118,11 @@ joi@^17.12.3:
"@sideway/formula" "^3.0.1"
"@sideway/pinpoint" "^2.0.0"
+js-cookie@^3.0.5:
+ version "3.0.5"
+ resolved "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.5.tgz#0b7e2fd0c01552c58ba86e0841f94dc2557dcdbc"
+ integrity sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==
+
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -6179,6 +6216,11 @@ react-dom@^18.0.0:
loose-envify "^1.1.0"
scheduler "^0.23.2"
+react-fast-compare@^3.2.2:
+ version "3.2.2"
+ resolved "https://registry.npmmirror.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49"
+ integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==
+
react-is@^16.13.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
@@ -6360,6 +6402,11 @@ require-from-string@^2.0.2:
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
+resize-observer-polyfill@^1.5.1:
+ version "1.5.1"
+ resolved "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
+ integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==
+
resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
@@ -6511,6 +6558,11 @@ scheduler@^0.23.0, scheduler@^0.23.2:
dependencies:
loose-envify "^1.1.0"
+screenfull@^5.0.0:
+ version "5.2.0"
+ resolved "https://registry.npmmirror.com/screenfull/-/screenfull-5.2.0.tgz#6533d524d30621fc1283b9692146f3f13a93d1ba"
+ integrity sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA==
+
scss-bundle@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/scss-bundle/-/scss-bundle-3.1.2.tgz#8919dd7603d01a84822e8aab5210e5b0b50c548b"
@@ -7078,6 +7130,11 @@ tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.6.2:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
+tslib@^2.4.1:
+ version "2.7.0"
+ resolved "https://registry.npmmirror.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01"
+ integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==
+
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"