From 23ccccbb59551c48cb8b49ed459a32f8904c0b34 Mon Sep 17 00:00:00 2001 From: SuMing_ Date: Sat, 7 Sep 2024 10:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A4=90=E5=8E=A8=E5=9E=83?= =?UTF-8?q?=E5=9C=BE=E9=A1=B5=E9=9D=A2=E5=92=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- package.json | 2 + src/app.config.ts | 14 + src/app.less | 12 + src/assets/images/kitchenWaste/add.png | Bin 0 -> 720 bytes src/assets/images/kitchenWaste/back.svg | 1 + src/assets/images/kitchenWaste/btn_bg2.png | Bin 0 -> 3597 bytes src/assets/images/kitchenWaste/camera.png | Bin 0 -> 3699 bytes src/assets/images/kitchenWaste/clear.png | Bin 0 -> 532 bytes src/assets/images/kitchenWaste/def_dp.png | Bin 0 -> 1232 bytes src/assets/images/kitchenWaste/empty.png | Bin 0 -> 2165 bytes src/assets/images/kitchenWaste/join.svg | 1 + src/assets/images/kitchenWaste/small.png | Bin 0 -> 3220 bytes src/components/Container/index.less | 16 + src/components/Container/index.tsx | 31 ++ src/components/Empty/index.less | 14 + src/components/Empty/index.tsx | 22 ++ src/components/NavigationBar/index.less | 24 ++ src/components/NavigationBar/index.tsx | 30 ++ src/pages/index/index.tsx | 9 + src/pages/kitchenWaste/index.config.ts | 6 + src/pages/kitchenWaste/index.less | 164 ++++++++++ src/pages/kitchenWaste/index.tsx | 167 ++++++++++ .../pages/addCollection/index.config.ts | 7 + .../pages/addCollection/index.less | 61 ++++ .../pages/addCollection/index.tsx | 240 ++++++++++++++ .../pages/addMerchants/index.config.ts | 7 + .../pages/addMerchants/index.less | 118 +++++++ .../kitchenWaste/pages/addMerchants/index.tsx | 309 ++++++++++++++++++ .../pages/contracted/index.config.ts | 8 + .../kitchenWaste/pages/contracted/index.less | 82 +++++ .../kitchenWaste/pages/contracted/index.tsx | 81 +++++ .../kitchenWaste/pages/record/index.config.ts | 8 + .../kitchenWaste/pages/record/index.less | 91 ++++++ src/pages/kitchenWaste/pages/record/index.tsx | 81 +++++ src/services/core/api.ts | 1 + src/services/core/apiCore.d.ts | 50 ++- src/services/core/request.ts | 16 +- src/services/index.ts | 2 + src/services/kitchenWaste.ts | 95 ++++++ src/store/index.ts | 9 +- yarn.lock | 57 ++++ 42 files changed, 1832 insertions(+), 7 deletions(-) create mode 100644 src/assets/images/kitchenWaste/add.png create mode 100644 src/assets/images/kitchenWaste/back.svg create mode 100644 src/assets/images/kitchenWaste/btn_bg2.png create mode 100644 src/assets/images/kitchenWaste/camera.png create mode 100644 src/assets/images/kitchenWaste/clear.png create mode 100644 src/assets/images/kitchenWaste/def_dp.png create mode 100644 src/assets/images/kitchenWaste/empty.png create mode 100644 src/assets/images/kitchenWaste/join.svg create mode 100644 src/assets/images/kitchenWaste/small.png create mode 100644 src/components/Container/index.less create mode 100644 src/components/Container/index.tsx create mode 100644 src/components/Empty/index.less create mode 100644 src/components/Empty/index.tsx create mode 100644 src/components/NavigationBar/index.less create mode 100644 src/components/NavigationBar/index.tsx create mode 100644 src/pages/kitchenWaste/index.config.ts create mode 100644 src/pages/kitchenWaste/index.less create mode 100644 src/pages/kitchenWaste/index.tsx create mode 100644 src/pages/kitchenWaste/pages/addCollection/index.config.ts create mode 100644 src/pages/kitchenWaste/pages/addCollection/index.less create mode 100644 src/pages/kitchenWaste/pages/addCollection/index.tsx create mode 100644 src/pages/kitchenWaste/pages/addMerchants/index.config.ts create mode 100644 src/pages/kitchenWaste/pages/addMerchants/index.less create mode 100644 src/pages/kitchenWaste/pages/addMerchants/index.tsx create mode 100644 src/pages/kitchenWaste/pages/contracted/index.config.ts create mode 100644 src/pages/kitchenWaste/pages/contracted/index.less create mode 100644 src/pages/kitchenWaste/pages/contracted/index.tsx create mode 100644 src/pages/kitchenWaste/pages/record/index.config.ts create mode 100644 src/pages/kitchenWaste/pages/record/index.less create mode 100644 src/pages/kitchenWaste/pages/record/index.tsx create mode 100644 src/services/kitchenWaste.ts diff --git a/.gitignore b/.gitignore index 331e8f6..8f75378 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 d8e1cf7..1e847d8 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 2a69e6c..64317d9 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 ed798e8..f94da1d 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 GIT binary patch literal 720 zcmeAS@N?(olHy`uVBq!ia0y~yUKcskbk*u-5ccX-PgkvaxN6PQRjZzW1lK?mKV7xv$(l9K)_|3*1`DoU{dCouXCRfU zpMuz{pRHQ;3?#Dl1xOI2=Gm&%Pgbvfwrb6jm1~}@Tm=$ex%%m<|NsA=et+uFn}fgp z{ks44-kmRZ&V4v{?!(zNPgf@%{J5QgfkC?@$S;`TYxaA#*E`gHotrKtuvq!ojT4UM zocrfY^xM$g)>xWmW2pUT`RbaOumDA0x$8QK3=E80JzX3_A`ZWu(V5reAkem3L8Bu* zbj|mR)ebhl{+$m?npJYOG@<nmnF*tjPD=CUH6Q$N$1 zPF-3*{X^>#$Lzq0FY`ROFY11C?B%`WRxsOEjd{=O@Q+h_IJB;>YgaISq$Y@E2ERH;*ONJ7))phZn-eE z#n8zkh&OsNOY!u|Rr{UdpL(cn+gUK%YsH&OpRX_HF5~QXvPf_3oO;2%X5pXH*+-;K z%@%SlvviWr`Ej*boW0^_lX%1zVTSr87tX)<&@cbXBZAAl>g**uak(F9p6ln{PKi8r z@2SAOf<@6u6_@+uv=20&XRw|1^}=E0nmtGPAN=TGkWYG$ELJ1X(!c6MqLlykc!BSK xs}(9^yh~G}w(^! \ 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 GIT binary patch literal 3597 zcmeAS@N?(olHy`uVBq!ia0y~yU=d(oU|7b%%)r19lHRkEfq@|{z$e6&fq|joVp-LN z3S6lALPgcZa)@l@g^IL;DH(^;t1eVz9m&W$o|AJdtNd(f?ZxVXllk?RYKu=5R-P*_ zIbGavxxVORLGzWymTOH-R~p33%=H-<7z9d!{DK)o@A+R=TYPNOmkBMVuQELr8J_fG zVBmH0ba4!+xb^17*|JpzB5e;pC@)%IdpGK`47bVm`pLa2g~CbfTiL9C$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ZG3Sv^xw<(jSgfO4DsPYz5vr&YLmcHIm=EchncQ2LROv*!X{j6m@f)kOW(7YZLZ9N8Uefc7QSb$ zsy*6&{eqm(B9#o`1Yei_k9;c}=QMw-d9Z)Kg79a3F{N|zLM0v-R9e(BL?YN0CGK^< z7r=b>;K_;y=h^w@hwqCs6OMj8VS(obwFO)*UnKGyq%!zQY*ws2WAu4_*PdAEvU6@= zt8;;wwDgxA=wQVxlljk6Gp(WvU?t|`*woQ$?Ng$W~Io)bvynX7K^c&I>SWFae zY%_B)nX|TCYysN|#%-)K)t^1<3Nqom)v}j=tLh@f+7;&~OU-$0k!CX9g} z>^d?kJQ$N2q!idMhZmbi>M5<`OKvhd*d?>+fRO<23*jT1qnZt5uK2lpI&+7A8O!ZA z^-{AQX5YD8znKIq7>*uCJRE{EZb z$eZ5Jy^Xg#RT4k{Yrpi)@b{(%`#RpO=X|yI1NRLJ?YMmrvyOYjscEj0dKa;BR!3XG zoO7~yzh1J;KD1cn<|3cg4moXI@yMikE)(~jQGaR@yEe_qQD&5b fi;K(u`Su?*=6eb(Tb;qcz`)??>gTe~DWM4f!vZ~a literal 0 HcmV?d00001 diff --git a/src/assets/images/kitchenWaste/camera.png b/src/assets/images/kitchenWaste/camera.png new file mode 100644 index 0000000000000000000000000000000000000000..23f18c27fe9b0f045728729b021759660bbf1d91 GIT binary patch literal 3699 zcmeAS@N?(olHy`uVBq!ia0y~yV5nhWU?}2XV_;yID6;h&0|NtNage(c!@6@aFBus4 zbUj@hLn`9l##T-cxhna;)^@WFw?>!SVzz_KqFgR_-o3oupwao!EK5f<&b9AShO3F7 zR^Ven;l)88uNielO-tuX>XCB&cw&`~v8^#L+tCU~#Z;T7E{#J>)|cbI@fu%|vo*He zZESmY^WT4WYX8dazrSam`TJUSMVV$UMy^%cr={|~c6lzd>7@z7Vn>Nbjr#J&KUjla z)Lqn?R<&ULD=j9^3azP9xs(5zGu?N~bXMe1npQDxPy@10% zf^+T+pZLbpJ3NmZv5CJKa%hH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W#iN^gu41X=_xXJ6d^s86=*QynZ6FKw~F1c}?y&nD5HIyZDw}xb%P1=3K%?D;2f1tVbLSXVtUiS(< zeaYHI8;b6KczAgJJd46d*BYB znxwsMx3V!m>(gCE@3@csb9lF8-NmRT9<4)v_kP>6QBUQL^qktoOW7Y9ElOFE@59Zz zl9kDpL*A$MbQWWpK*~3Tm@?)M$*d0)7$ilcs|EBXzxi9WR$Rp4Z{G9iPQuFEYc=M} z7kp>fzgzm&cE60I=}!MY>^@kq##rpp6$1_(;aM5FYYHU!)edJJzPNxxL@VS8$NBJo zQ`gQ;32?BG5?~B^;j%ZhKC7Cc-e_*kq=S8$>v>=NPbkimy;;(*?)Cg!b(@KPGTsYX zn|V7AKF}9FZyNGA?PYeqh^%q$sog0z_v*{^HXm?Tj&keKjS>A0Y73Sm8A%_%enD7m z-;V0nYwbKMI!luF={SlyU1i`f_;+>V#>YQq8mFH!*l?%d%r2A5&ypBiXCE?U5NSTx z`rUfAwYq%Shs62i<<}+_M4q%iee+wxu{>Tjqtiblw#+HNxF_poQ)Fh)KQ0Hh5ADhp z9BW#did|M0-07a`yTttRGM~exQ=baT_()y5G~ME`y~b42;AsV%y)(`HSqoe%7C*bq zf2#iAj<_R7VxQ`ixb6^{^j`E^vOtQ`eHI4iQ=I(&=$Kh*p&uy8$#pnNjd3V<{EeV^i z=-cXZXu5AyK7Q_1@QpPmF0T!`ZK7{vy}vGZixdCSvsFm9DL~0o802L=-3f}*|NAEC zsQkNqY{BurHy8MS-g7wF%9Y(K*194l_PglayZo#z-7%s?jQ7=n$%UymE1IoN?Th_mS$&l4;cf@RrtUvwyERySJum!X;SIZRjP7Y8foqy6DfySi#sr&ZLvki~E`{tGNAEtXPo9;KPQ!ry-U|{fc^>bP0 Hl+XkKLLn2( literal 0 HcmV?d00001 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 GIT binary patch literal 1232 zcmeAS@N?(olHy`uVBq!ia0y~yV8{Sr4rT@h2CYM`lNlHoZU^{;xH2#>lSv!~l+i3fcXlqiurS5+RTRj#B|(0{4DU|;`MfMg?ZX|#S&tuzexEua zCB|GwN~Gw<{w`-@4I#EUn>N}VXmRBz`dmIGhJk^(%G1R$B;(%GTQ`H03`N)yb~mP_ zA7G7SVZHuywyPNHO~LKo>lYndCnD)qWHsT)!c*^)@}51~?p*Y%WK#2doziD1dT&>V zvNVNV*>}bwUGuGCqWY90Y$qoOUz;AZud_*DujXqH%krEbo8}f@RqX!XG$sDy1}`5C zhRntb>jIZ&iYd!ZwY#hO{KBDYYYwkXPGWttMBujGbB!ih*S>8XJ3E{m|2UbcXFGS! zoqF2R(<$(ii`w%WO-8S8*gx0e;B5-ucm8nEl*u*oUaBzpDm{5W#n)lB%d`l4Gm}k6 zUu*KM)jG6``7Fy-4Y9_wiDyN(F}&rHzHe{vpukx;=^(@F?8}qd1YhdcdN8=L{CgYW zWT2Art#OA#L_q8x`1-YHu!( zJ0kP{)8`jn)nE0UU0xec;IC4WQrcF}uyNMwm)DNUMO?Ve;-snng2yR$8nf42)vbyp zug%48#7DEMs6A`GpL48nhRsQou5A%6=?n}^I|M}(y z+kbPUyU*8K9Zr1yx&3_&Lqtj2`+NT<=7cq=m}cj-`=7X0^hGQ|N+C2daOsv^YcI0Q z=(&B*;49l%*TshKuH39RckAr4KP$te8z+6tmHhBZ&$oK-%F|cx-O+#NSa_qm|HDI} zCCzz1SI2CNY@37A;l zF_Ty8WKC4xmFt238csW=C`n#v4DfsRdB5(|%S-M4tD2iU3+~)yu+ZFO$EJ_EQlDr0 z-QVAvR+s$Y_jaqZ`S)hs@B8 zTsh}+`=>jxu9V!>fyY#03rh$C0|SGntDnm{ Hr-UW|i5_ZB literal 0 HcmV?d00001 diff --git a/src/assets/images/kitchenWaste/empty.png b/src/assets/images/kitchenWaste/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..16b0541e03c30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rUwc= z>|0#YBocfm)jQW~M}gMz7LU-`LV8Z8H5JcXThyYxyXaIwa>(^1R}N0gl}p`mHaSGs zE48V2S&G-ror&jjdxXyATX|*ve70Ul<>vgvV)dvUMPBM=<=fOJO*-**f!q4Pvg|2$ zrIwmaln&*#+bEOQ{XF22^yg;H-$y4?5HU4>ii;q`koeRgrGVW(9z7^eFXz~0^ z_uhAl_e4EwEv`G>XLy>^D@FR8gu?ApmmW+xduUI~kz;Ef`kfUyIGLgSXsJZ%a|xD% zQ{Qh`W-eW$W17_$c&=;dGx0Df0j7kkeZO>1{p(I`I~~AyIMVaZmkYsr``$aBIJt3B z!RKu=A_~8(ohtU@cTu+d*{;t~51T?ex4nD&A?oa^CqIvEp8VW@k;t1Xf*Y#*q+gm| z \ 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 GIT binary patch literal 3220 zcmeAS@N?(olHy`uVBq!ia0y~yV3J^9U|7b%%)r2~o|TP{fq|hhz$e6&fq|jwLIoUE zU#O@)S6zOw93*nFqWWSPhyhYiUJVfhv7zd#FM=2q7b?;YrlcQA%{-EkeKfP`LPhSe z?1Gc|WoJu^PZd_4E6+ck+kB<5;c|V|xr*8g)g`Bk>o3*TU94%j)>Lw;DB}(LQ3eJE z@sc3FV1`R~0v5M&Ngvk~`8d(k=kd;;uh-_qyZs3Lw~2v)d$p&FV@SoVH@7;=W*Z2! zCMG8HRK)MPr>Cc7diJ+{!sL|+D%>~My%sn#^S|J&_jd$6r>J-aU01zXVc&oKWrp=^ z$5(r9=2&}O|5#&xPU!07Pajjvo36}u+kMg^JpcBW*c_iJR|8)+{fhO7J@)@el>F*T zFFNk~UX|WD!=>WoOqY+pcOF`@^jvm}O}NeH1Kt-?7FuG+47V=;{%NEE)G(y|wFhWeVo^aGh?+ez^Qf;yNMk_Kh1mchBg3 zI!n)E?W6Ua^A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|Obtf0Nnj z7&~Q|u$%Y%&GV-JxfSG;xM0E+p}#*Ww=8YBDcpM7E5^I;{B$8M=7}y6zoLqgqFq&9 zuU5B>lKtz=>CMTsZQ76PlLGxC*wuN`{6!wQw%sh4o4U||!P6|}d8hbID}hY+S6=6_w_)F<|pF*(|^21*zErLdzo<3%ypUYA=ZLI;Y0^B+whLb8S83sx^ue{kRGfCvSp^4e?J9cVX$qc4DHt>7)6=&$hB&Ep; z*QIUXS^BX-bscwA!i{#7!>JtNp9C*Y>FYct;Wj#Amy_&zFCKdG^Zau8RJbtQ-dIQScU0S@7xgDA#j8)d{yp%)>4(cl zp3T9M>s6dHZ9I5&P8@x`vYRK}FhF;nq|RX*b+5(mcj~+`KBRZc#$ZR`W*$l2trt&E zx;*13t9bH{631qqY7-In^Ij{K?X-Bk$cg8{=T^aIQ#Btu7^Rr-NOL`Tr#ff#p?Taz zg&Sg?NVHy9v{K#ZhjoA?@8q^?w_94zu`?b<&eiCjx5fAtH}~VN50Z-F7e)TgmI{NRdb_}@t_Ei0WOt`r9aLrPU`x3_)}*ywSz?LmTEnbxyke@ldgnw&zGuqst?@5t>IRhniZozh&$ z!SA-HbV7mv$f*}1rgZFxI`H=^v3n%a~ExNn(P5w)3u3ZW{WXcW1 z*75Rlx;t8}nsR!}Iq#iaJ|Znlwt*K*C%-?)v2u@2*1DC~3cqHEr}kaZ_+i)h+wAM{ z+k#npGq=e84u0X8xTj(k`|6A>GtUOR-g7g@xGU`7pG?8_1(~z174B#B*w)-)zT#B{ Q0|Nttr>mdKI;Vst02kow{{R30 literal 0 HcmV?d00001 diff --git a/src/components/Container/index.less b/src/components/Container/index.less new file mode 100644 index 0000000..da3c3c5 --- /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 0000000..4ac5afd --- /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 0000000..3a33357 --- /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 0000000..012994b --- /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 0000000..67e4470 --- /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 0000000..834e761 --- /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 1048f51..0f5f437 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 0000000..0b47a18 --- /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 0000000..23b76a0 --- /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 0000000..818f400 --- /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 0000000..ee65b83 --- /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 0000000..8142aed --- /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 0000000..fe70b19 --- /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 ( + + +
+ + { + setSelectedIds({ k1: e.detail.value }); + }} + > + + {selectedIds.k1 !== undefined ? ( + signEntities[selectedIds.k1].name + ) : ( + 请选择单位 + )} + + 请选择 + + + + + + + + + + + + + + + { + setSelectedIds({ k2: e.detail.value }); + }} + > + + {selectedIds.k2 ? ( + vehicles[selectedIds.k2].label + ) : ( + 请选择车辆 + )} + + 请选择 + + + + + + { + setSelectedDate({ date: e.detail.value }); + }} + > + + {selectedDate.date || ( + 请选择收运日期 + )} + + 请选择 + + + + + + { + setSelectedDate({ time: e.detail.value }); + }} + > + + {selectedDate.time || ( + 请选择收运时间 + )} + + 请选择 + + + + + + +
+
+
+ ); +}; +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 0000000..30bf7b6 --- /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 0000000..c62b64a --- /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 0000000..d8466fb --- /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 ( + + +
+ + { + setSelectedVehicle(e.detail.value); + }} + > + + {selectedVehicle ? ( + vehicles[selectedVehicle].name + ) : ( + 请选择商户 + )} + + 请选择 + + + + + + { + setSelectedDate({ + signTime: e.detail.value, + }); + }} + > + + {selectedDate.signTime || ( + 请选择签约时间 + )} + + 请选择 + + + + + + + { + setSelectedDate({ startTime: e.detail.value }); + }} + > + + {selectedDate.startTime || ( + 请选择合同起始时间 + )} + + 请选择 + + + + + + + { + setSelectedDate({ endTime: e.detail.value }); + }} + > + + {selectedDate.endTime || ( + 请选择合同终止时间 + )} + + 请选择 + + + + + + + + {contractImage.map((v, index) => ( + + + { + e.stopPropagation(); + setContractImage((state) => + state.filter((i) => i.id !== v.id) + ); + }} + > + + + + ))} + + + + + 拍照上传 + + + + + + +
+
+
+ ); +}; +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 0000000..b2a8298 --- /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 0000000..caecba7 --- /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 0000000..10b64b3 --- /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 0000000..241abdc --- /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 0000000..286e2eb --- /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 0000000..54dece9 --- /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 93008df..1eb29b7 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 27ae6c0..8b61e4d 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 c31be09..c15432e 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 726f750..344764e 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 0000000..82a75d2 --- /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 727b831..c4350f2 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 bd4f322..012e522 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" -- GitLab