From 25ebc714977470b5ed02b0ec7f30ea0615ebd89f Mon Sep 17 00:00:00 2001 From: zuoxiao <zuoxiao> Date: 星期五, 14 三月 2025 16:48:09 +0800 Subject: [PATCH] 更新应用配置,添加AppID并修改页面路由;优化取水口界面,增加定时开阀功能和相关参数设置;修复首页反馈图标及提示信息。 --- pages/irrigation/irrigation.js | 237 +++++ pages/groupDetail/groupDetail.js | 86 ++ pages/home/home.js | 9 images/published-icon.svg | 14 pages/irrigation/irrigation.json | 4 pages/createIrrigation/createIrrigation.json | 6 pages/createIrrigation/createIrrigation.wxml | 77 + pages/createIrrigation/createIrrigation.wxss | 237 +++++ app.js | 3 images/unchecked.svg | 3 images/arrow-right.svg | 3 pages/groupDetail/groupDetail.wxml | 48 + images/arrow-down.svg | 3 pages/groupDetail/groupDetail.wxss | 167 +++ pages/createIrrigation/createIrrigation.js | 538 ++++++++++++ pages/waterIntake/waterIntake.wxss | 18 images/progress.svg | 17 pages/waterIntake/waterIntake.js | 259 +++++ pages/waterIntake/waterIntake.wxml | 119 ++ pages/home/home.wxml | 2 images/valve.svg | 1 README.md | 147 +++ app.json | 6 images/checked.svg | 4 api/config.js | 3 api/request.js | 1 pages/irrigation/irrigation.wxml | 86 ++ pages/irrigation/irrigation.wxss | 396 +++++++++ pages/groupDetail/groupDetail.json | 4 29 files changed, 2,474 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md new file mode 100644 index 0000000..f0e4329 --- /dev/null +++ b/README.md @@ -0,0 +1,147 @@ +# 澶х鑺傛按鐏屾簤绯荤粺 + +## 椤圭洰姒傝堪 + +澶х鑺傛按鐏屾簤绯荤粺鏄竴涓井淇″皬绋嬪簭椤圭洰锛岀敤浜庣鐞嗗拰鎺у埗鍐滀笟鐏屾簤绯荤粺銆傝绯荤粺鍏佽鐢ㄦ埛鏌ョ湅褰撳墠鐏屾簤璁″垝銆佸垱寤烘柊鐨勭亴婧夎鍒掋�佺鐞嗚疆鐏岀粍浠ュ強鐩戞帶鐏屾簤鐘舵�佺瓑鍔熻兘銆� + +## 椤圭洰缁撴瀯 + +``` +irrigate_user/ +鈹溾攢鈹� api/ # API鎺ュ彛鐩稿叧鏂囦欢 +鈹溾攢鈹� images/ # 鍥剧墖璧勬簮鏂囦欢 +鈹溾攢鈹� miniprogram_npm/ # 灏忕▼搴廚PM鏋勫缓鐩綍 +鈹� 鈹斺攢鈹� tdesign-miniprogram/ # TDesign UI缁勪欢搴� +鈹溾攢鈹� node_modules/ # 椤圭洰渚濊禆 +鈹� 鈹溾攢鈹� dayjs/ # 鏃ユ湡澶勭悊搴� +鈹� 鈹斺攢鈹� tdesign-miniprogram/ # TDesign UI缁勪欢搴撴簮鐮� +鈹溾攢鈹� pages/ # 椤甸潰鏂囦欢 +鈹� 鈹溾攢鈹� createIrrigation/ # 鏂板缓鐏屾簤璁″垝椤甸潰 +鈹� 鈹溾攢鈹� feedback/ # 鍙嶉椤甸潰 +鈹� 鈹溾攢鈹� home/ # 棣栭〉 +鈹� 鈹溾攢鈹� index/ # 寮曞椤� +鈹� 鈹溾攢鈹� irrigation/ # 鐏屾簤璁″垝绠$悊椤甸潰 +鈹� 鈹溾攢鈹� login/ # 鐧诲綍椤甸潰 +鈹� 鈹溾攢鈹� my/ # 涓汉涓績椤甸潰 +鈹� 鈹溾攢鈹� openCard/ # 寮�鍗¢〉闈� +鈹� 鈹溾攢鈹� personCharge/ # 涓汉鍏呭�奸〉闈� +鈹� 鈹溾攢鈹� rechargeCard/ # 鍏呭�煎崱椤甸潰 +鈹� 鈹溾攢鈹� rechargeList/ # 鍏呭�艰褰曢〉闈� +鈹� 鈹溾攢鈹� rechargeMoney/ # 鍏呭�奸噾棰濋〉闈� +鈹� 鈹溾攢鈹� valveList/ # 闃�闂ㄥ垪琛ㄩ〉闈� +鈹� 鈹溾攢鈹� wallet/ # 閽卞寘椤甸潰 +鈹� 鈹溾攢鈹� waterIntake/ # 鍙栨按椤甸潰 +鈹� 鈹溾攢鈹� wxbind/ # 寰俊缁戝畾椤甸潰 +鈹� 鈹斺攢鈹� wxlogin/ # 寰俊鐧诲綍椤甸潰 +鈹溾攢鈹� utils/ # 宸ュ叿鍑芥暟 +鈹溾攢鈹� .cloudbase/ # 浜戝紑鍙戦厤缃� +鈹溾攢鈹� .eslintrc.js # ESLint閰嶇疆 +鈹溾攢鈹� .gitignore # Git蹇界暐鏂囦欢 +鈹溾攢鈹� app.js # 灏忕▼搴忓叆鍙f枃浠� +鈹溾攢鈹� app.json # 灏忕▼搴忓叏灞�閰嶇疆 +鈹溾攢鈹� app.wxss # 灏忕▼搴忓叏灞�鏍峰紡 +鈹溾攢鈹� package.json # 椤圭洰渚濊禆閰嶇疆 +鈹溾攢鈹� package-lock.json # 渚濊禆鐗堟湰閿佸畾鏂囦欢 +鈹溾攢鈹� project.config.json # 椤圭洰閰嶇疆鏂囦欢 +鈹斺攢鈹� sitemap.json # 灏忕▼搴弒itemap閰嶇疆 +``` + +## 浣跨敤鐨勬鏋跺拰搴� + +1. **寰俊灏忕▼搴忓師鐢熸鏋�**锛氶」鐩熀浜庡井淇″皬绋嬪簭鍘熺敓妗嗘灦寮�鍙戯紝浣跨敤WXML銆乄XSS銆丣S鍜孞SON鏂囦欢缁勭粐浠g爜銆� + +2. **TDesign 灏忕▼搴忕粍浠跺簱**锛氫娇鐢ㄨ吘璁疶Design UI缁勪欢搴擄紙鐗堟湰1.2.8锛夛紝鎻愪緵浜嗕赴瀵岀殑UI缁勪欢锛屽鏃ユ湡鏃堕棿閫夋嫨鍣�(t-date-time-picker)绛夈�� + - 鏂囨。鍦板潃锛歨ttps://tdesign.tencent.com/miniprogram/overview + - 缁勪欢浣跨敤鏂瑰紡锛氬湪椤甸潰JSON鏂囦欢涓紩鍏ユ墍闇�缁勪欢锛屽锛� + ```json + { + "usingComponents": { + "t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker", + "t-avatar": "tdesign-miniprogram/avatar/avatar", + "t-switch": "tdesign-miniprogram/switch/switch", + "t-button": "tdesign-miniprogram/button/button", + "t-dialog": "tdesign-miniprogram/dialog/dialog" + } + } + ``` + +3. **Day.js**锛氳交閲忕骇鐨凧avaScript鏃ユ湡澶勭悊搴擄紝鐢ㄤ簬鏃ユ湡鏍煎紡鍖栧拰鎿嶄綔銆� + - 涓昏鐢ㄤ簬TDesign鏃ユ湡鏃堕棿閫夋嫨鍣ㄧ粍浠跺唴閮ㄣ�� + - 鏂囨。鍦板潃锛歨ttps://day.js.org/ + +4. **浜戝紑鍙�**锛氶」鐩彲鑳戒娇鐢ㄤ簡寰俊灏忕▼搴忎簯寮�鍙戝姛鑳斤紝鐢ㄤ簬鏁版嵁瀛樺偍鍜屼簯鍑芥暟銆� + +## 浠g爜椋庢牸鍜岃鑼� + +1. **鏂囦欢鍛藉悕**锛� + - 椤甸潰鐩綍浣跨敤椹煎嘲鍛藉悕娉曪紝濡俙createIrrigation` + - 椤甸潰鏂囦欢涓庣洰褰曞悓鍚嶏紝濡俙createIrrigation.js` + +2. **鏍峰紡瑙勮寖**锛� + - 浣跨敤WXSS缂栧啓鏍峰紡 + - 绫诲悕浣跨敤杩炲瓧绗﹀懡鍚嶆硶锛屽`create-irrigation-container` + - 缁勪欢鏍峰紡閲囩敤BEM鍛藉悕鏂瑰紡鐨勫彉浣� + +3. **JavaScript瑙勮寖**锛� + - 浣跨敤ES6璇硶 + - 鍑芥暟閲囩敤椹煎嘲鍛藉悕娉曪紝濡俙onPlanCodeInput` + - 椤甸潰閫昏緫浣跨敤寰俊灏忕▼搴廝age鏋勯�犲櫒缁勭粐 + +4. **缁勪欢浣跨敤**锛� + - 绗笁鏂圭粍浠朵娇鐢ㄥ墠缂�鍖哄垎锛屽TDesign缁勪欢浣跨敤`t-`鍓嶇紑 + - 鑷畾涔夌粍浠舵斁鍦ㄥ搴旈〉闈㈢洰褰曚笅 + +## 椤甸潰浜や簰妯″紡 + +1. **琛ㄥ崟浜や簰**锛� + - 杈撳叆妗嗙洿鎺ヨ緭鍏� + - 鏃堕棿閫夋嫨浣跨敤寮瑰嚭寮忛�夋嫨鍣� + - 琛ㄥ崟鎻愪氦鍓嶈繘琛屾暟鎹獙璇� + +2. **鍒楄〃浜や簰**锛� + - 浣跨敤鍙姌鍙犵殑宓屽鍒楄〃 + - 鏀寔椤圭洰灞曞紑/鎶樺彔 + - 鏀寔閫夋嫨/鍙栨秷閫夋嫨椤圭洰 + +3. **瀵艰埅浜や簰**锛� + - 浣跨敤寰俊灏忕▼搴忓師鐢熷鑸� + - 椤甸潰闂撮�氳繃`wx.navigateTo`杩涜璺宠浆 + +4. **UI椋庢牸**锛� + - 涓昏壊璋冿細钃濊壊(#1890FF) + - 鑳屾櫙鑹诧細娴呯伆鑹�(#f5f5f5) + - 鏂囧瓧棰滆壊锛氭繁鑹�(#333)銆佷腑绛�(#666)銆佹祬鑹�(#999) + - 鍦嗚椋庢牸锛氭寜閽娇鐢ㄥぇ鍦嗚(44rpx)锛屽崱鐗囦娇鐢ㄥ皬鍦嗚(8rpx) + +## 寮�鍙戞敞鎰忎簨椤� + +1. 鏂板椤甸潰鏃讹紝闇�瑕佸湪`app.json`鐨刞pages`鏁扮粍涓坊鍔犻〉闈㈣矾寰勩�� + +2. 浣跨敤TDesign缁勪欢鏃讹紝闇�瑕佸湪椤甸潰鐨凧SON鏂囦欢涓紩鍏ュ搴旂粍浠躲�� + +3. 鍥炬爣浣跨敤SVG鏍煎紡锛屽瓨鏀惧湪`images`鐩綍涓嬨�� + +4. 缃戠粶璇锋眰搴旂粺涓�绠$悊锛屽缓璁斁鍦╜api`鐩綍涓嬨�� + +5. 淇濇寔涓庣幇鏈変唬鐮侀鏍间竴鑷达紝鐗瑰埆鏄懡鍚嶈鑼冨拰鏂囦欢缁勭粐鏂瑰紡銆� + +6. 椤圭洰浣跨敤npm绠$悊渚濊禆锛屾坊鍔犳柊渚濊禆鏃朵娇鐢細 + ``` + npm install 鍖呭悕 --save + ``` + 鐒跺悗鍦ㄥ井淇″紑鍙戣�呭伐鍏蜂腑鏋勫缓npm銆� + +## 濡備綍杩愯椤圭洰 + +1. 瀹夎渚濊禆锛� + ``` + npm install + ``` + +2. 浣跨敤寰俊寮�鍙戣�呭伐鍏锋墦寮�椤圭洰鐩綍銆� + +3. 鍦ㄥ伐鍏蜂腑鐐瑰嚮"鏋勫缓npm"锛屽皢npm鍖呮瀯寤哄埌miniprogram_npm鐩綍銆� + +4. 鍦ㄥ伐鍏蜂腑鐐瑰嚮"缂栬瘧"鎸夐挳锛屾垨浣跨敤蹇嵎閿瓹trl+B(Windows)/Cmd+B(Mac)杩涜缂栬瘧銆� + +5. 鍦ㄦā鎷熷櫒涓瑙堟晥鏋滐紝鎴栦娇鐢ㄧ湡鏈鸿皟璇曞姛鑳藉湪鎵嬫満涓婇瑙堛�� \ No newline at end of file diff --git a/api/config.js b/api/config.js index 3757d03..07885fe 100644 --- a/api/config.js +++ b/api/config.js @@ -3,7 +3,8 @@ const PROJECT_URLS = { JYG: 'https://irrigate.dayuyanjiuyuan.top/', // 鍢夊唱鍏抽」鐩� - MQ: 'https://minqin.dayuyanjiuyuan.top/' // 姘戝嫟椤圭洰 + // MQ: 'https://shifanqu1.dayuyanjiuyuan.top/' // 姘戝嫟椤圭洰 + MQ: 'https://no253541tf71.vicp.fun/' // 姘戝嫟椤圭洰 } // 灏濊瘯浠庢湰鍦板瓨鍌ㄨ幏鍙栧凡閫夋嫨鐨勯」鐩� diff --git a/api/request.js b/api/request.js index dba9986..1f7bc0a 100644 --- a/api/request.js +++ b/api/request.js @@ -54,6 +54,7 @@ header.Authorization = `Bearer ${token}` } header.tag = app.globalData.tag; + header.appId = app.globalData.AppID; return new Promise((resolve, reject) => { // 鑾峰彇鏈�鏂扮殑 BASEURL let currentBaseUrl = app.globalData.baseUrl || config.BASEURL; diff --git a/app.js b/app.js index 6633f57..ed3fbd2 100644 --- a/app.js +++ b/app.js @@ -22,6 +22,7 @@ userCode:"", token:"", isLoggedIn:false, - operator:"2025030416200600006" + operator:"2025030416200600006", + AppID:"wxbc2b6a00dd904ead" } }) diff --git a/app.json b/app.json index e405d06..c133742 100644 --- a/app.json +++ b/app.json @@ -1,6 +1,8 @@ { "pages": [ - + "pages/irrigation/irrigation", + "pages/createIrrigation/createIrrigation", + "pages/groupDetail/groupDetail", "pages/home/home", "pages/valveList/valveList", "pages/feedback/feedback", @@ -25,6 +27,4 @@ "componentFramework": "glass-easel", "sitemapLocation": "sitemap.json", "lazyCodeLoading": "requiredComponents" - - } \ No newline at end of file diff --git a/images/arrow-down.svg b/images/arrow-down.svg new file mode 100644 index 0000000..4eb85b2 --- /dev/null +++ b/images/arrow-down.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="#666666"/> +</svg> \ No newline at end of file diff --git a/images/arrow-right.svg b/images/arrow-right.svg new file mode 100644 index 0000000..f185613 --- /dev/null +++ b/images/arrow-right.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M9.29 6.71a.996.996 0 0 0 0 1.41L13.17 12l-3.88 3.88a.996.996 0 1 0 1.41 1.41l4.59-4.59a.996.996 0 0 0 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01z" fill="#CCCCCC"/> +</svg> \ No newline at end of file diff --git a/images/checked.svg b/images/checked.svg new file mode 100644 index 0000000..b9779ce --- /dev/null +++ b/images/checked.svg @@ -0,0 +1,4 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <rect width="18" height="18" x="3" y="3" rx="2" fill="#1890FF"/> + <path d="M9.86 14.54l-3.36-3.36-1.06 1.06L9.86 16.66l8.48-8.48-1.06-1.06-7.42 7.42z" fill="white"/> +</svg> \ No newline at end of file diff --git a/images/progress.svg b/images/progress.svg new file mode 100644 index 0000000..7ae9221 --- /dev/null +++ b/images/progress.svg @@ -0,0 +1,17 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="34" height="34" viewBox="0 0 34 34" fill="none"> +<g clip-path="url(#clip-path-66_13)"> +<path d="M6.73498 30.7182C6.36243 30.7182 6.26083 30.7012 6.03222 30.5996C5.87982 30.5234 5.68508 30.3795 5.54961 30.244C5.3972 30.0916 4.71985 29.0502 2.88252 26.1376C1.48548 23.9192 0.359378 22.1412 0.266241 21.9803C-0.165572 21.2606 -0.0639686 20.4309 0.511783 19.872C0.706522 19.6858 9.7492 13.9537 13.6355 11.4898C25.3622 4.07276 26.4629 3.37847 26.5984 3.31073L26.6068 3.31073C26.6407 3.30227 26.7339 3.27686 26.827 3.25146C26.9709 3.20913 27.1233 3.1922 27.2757 3.1922C27.7414 3.1922 28.1902 3.37847 28.4696 3.68328C28.622 3.85262 33.7698 11.9978 33.9137 12.3111C34.0155 12.5312 34.0238 12.6159 34.0069 12.963C33.9815 13.4372 33.8631 13.7081 33.5581 14.0045C33.3465 14.2077 7.97115 30.3202 7.4462 30.5912C7.20912 30.7012 7.13292 30.7182 6.73498 30.7182ZM1.23994 20.8627C1.12987 21.0151 1.18067 21.1759 1.24841 21.286C1.41774 21.5739 6.26929 29.2534 6.3963 29.4227C6.48943 29.5413 6.63337 29.6259 6.74344 29.6259C6.76884 29.6259 6.78578 29.6259 6.80271 29.6175C7.03132 29.482 12.882 25.7989 19.8164 21.4046C32.2289 13.5472 32.7115 13.234 32.8046 13.0646C32.8724 12.9207 32.8724 12.8784 32.8554 12.8191C32.7454 12.5566 27.733 4.72471 27.5382 4.5215C27.5128 4.4961 27.4874 4.46223 27.4789 4.43683C27.4705 4.42837 27.462 4.41143 27.462 4.40297L27.4535 4.40297C27.1741 4.40297 25.4892 5.4698 17.4202 10.5838L14.2451 12.5989C7.28533 17.0018 1.51088 20.6764 1.23994 20.8627ZM2.26444 17.9331C2.2475 17.9331 2.23057 17.9246 2.21363 17.9246C2.20517 17.9162 2.1967 17.9162 2.18823 17.9077C2.1713 17.8908 2.13743 17.8484 2.1459 16.6631C2.1459 15.647 2.16283 15.4184 2.25597 14.7665C2.41684 13.7166 2.56078 13.1154 2.84019 12.2857C3.28047 10.9564 3.78849 9.91493 4.59284 8.6957C5.321 7.58653 6.00682 6.78217 6.86198 6.00321C9.48673 3.63248 12.3062 2.37937 15.7438 2.05763C15.9301 2.04069 16.2603 2.03223 16.6667 2.03223C17.3948 2.03223 18.3685 2.06609 18.8003 2.12536C20.2567 2.3201 21.586 2.67571 22.856 3.22606C23.0761 3.3192 23.4148 3.48007 23.7281 3.64094C24.2869 3.92035 24.2869 3.93728 24.2869 3.99655C24.2869 4.03889 24.2869 4.07276 23.762 4.3945L23.2793 4.69931C23.2624 4.70778 23.2455 4.71624 23.237 4.71624C23.2201 4.71624 23.2116 4.71624 23.1947 4.70778L22.9491 4.58077C21.967 4.08969 20.4429 3.59861 19.2406 3.38693C18.5379 3.2684 17.598 3.1922 16.7259 3.1922C16.328 3.1922 15.9639 3.20913 15.676 3.23453C13.3053 3.4716 11.341 4.17436 9.32586 5.51213C7.22606 6.90071 5.73588 8.58563 4.63518 10.8124C3.74615 12.6243 3.33127 14.3939 3.3228 16.3837L3.3228 17.2812C3.3228 17.3066 3.30587 17.3404 3.28047 17.3489L2.79785 17.6452C2.73858 17.6876 2.35757 17.9331 2.26444 17.9331Z" fill="#D43030" > +</path> +<path d="M16.963 31.8101C16.3195 31.8101 15.7269 31.7847 15.3289 31.7339C14.0927 31.5899 12.8566 31.2936 11.7559 30.8702C11.4849 30.7686 10.9346 30.5231 10.5451 30.3368C9.67301 29.9304 9.67301 29.905 9.66454 29.8542C9.65607 29.8288 9.67301 29.7949 9.68994 29.778L9.69841 29.7695C9.69841 29.7695 9.91855 29.6256 10.198 29.4478L10.6806 29.143C10.6975 29.1345 10.706 29.126 10.7229 29.126C10.7314 29.126 10.7483 29.126 10.7568 29.1345L11.2648 29.3631C12.501 29.9219 13.7456 30.286 15.0664 30.4892C15.7269 30.5823 16.3957 30.6332 17.0477 30.6332C20.1381 30.6332 23.0931 29.5748 25.5993 27.5681C26.1835 27.094 27.1741 26.1033 27.6398 25.5191C29.5025 23.1907 30.5778 20.295 30.671 17.3655L30.6964 16.5273C30.6964 16.5019 30.7133 16.4765 30.7302 16.4595L31.179 16.1547L31.6362 15.8499C31.6531 15.8414 31.6701 15.833 31.687 15.833C31.6955 15.833 31.7124 15.833 31.7209 15.8414C31.7463 15.8499 31.7632 15.8753 31.7717 15.9092L31.8055 16.1716C31.8479 16.4934 31.814 17.9328 31.7547 18.4746C31.4076 21.4211 30.3238 24.0713 28.5119 26.3404C27.7499 27.2972 26.5391 28.4148 25.5062 29.1091C23.3386 30.5908 21.1542 31.4206 18.631 31.7169C18.2331 31.7762 17.6234 31.8101 16.963 31.8101ZM8.35217 14.0126C8.33523 14.0126 8.30983 14.0041 8.30136 13.9956C8.27596 13.9702 8.25903 13.9364 8.27596 13.9025L8.35217 13.6993C8.64851 12.9542 9.08879 12.1668 9.58834 11.4725C9.96088 10.9476 10.7822 10.0924 11.2733 9.71138C12.7296 8.57681 14.3722 7.90793 16.1756 7.73012C16.2857 7.72166 16.5736 7.71319 16.9376 7.71319C17.2848 7.71319 17.6997 7.72166 17.8351 7.73859L18.0722 7.76399C18.1061 7.77246 18.1399 7.79786 18.1484 7.83173C18.1569 7.86559 18.1399 7.89946 18.1145 7.92486L16.5651 8.89009C16.5566 8.89856 16.5397 8.89856 16.5312 8.90702L16.0232 8.96629C13.5763 9.28804 11.3241 10.7189 10.1472 12.6917C9.97782 12.9796 9.93548 13.0135 9.26659 13.4368L8.91098 13.6654C8.69084 13.8094 8.52997 13.911 8.48764 13.9364L8.3945 13.9956C8.38603 14.0041 8.3691 14.0126 8.35217 14.0126ZM7.91189 13.276C7.89495 13.276 7.87802 13.2675 7.86109 13.259L7.46314 12.9457L7.09906 12.6494L6.65878 12.7764L6.43864 12.8441C6.2439 12.9034 6.1423 12.9288 6.10843 12.9373C6.09997 12.9373 6.08303 12.9457 6.07456 12.9457C6.0407 12.9457 6.00683 12.9288 5.98989 12.9034C5.94756 12.8441 5.94756 12.7425 6.13383 12.1329L6.25237 11.7773L5.98143 11.3878C5.66815 10.9476 5.66815 10.9306 5.66815 10.9052C5.66815 10.8121 5.76129 10.8121 5.85442 10.8121C5.94756 10.8121 6.09997 10.8205 6.2947 10.8205L6.78579 10.846L7.06519 10.4565C7.41234 9.99926 7.41234 9.99926 7.46314 9.99926C7.53088 9.99926 7.55628 9.99926 7.72561 10.5665L7.86109 11.0407L8.32677 11.21C8.40297 11.2354 8.75858 11.3709 8.85172 11.4217C8.86018 11.4217 8.86865 11.4302 8.87712 11.4386C8.89405 11.4556 8.90252 11.4725 8.90252 11.4894C8.91098 11.5487 8.91098 11.5487 8.4453 11.8874L8.04736 12.1753L8.00502 13.1913C8.00502 13.2252 7.98809 13.2506 7.95422 13.2675C7.93729 13.2675 7.92035 13.276 7.91189 13.276ZM10.9684 9.16103C10.9176 9.16103 10.8838 9.16103 10.6636 8.62762L10.4774 8.18734L10.2149 8.12807L10.054 8.0942C9.91855 8.0688 9.78308 8.03493 9.69841 8.018L9.47827 7.97566C9.4444 7.9672 9.419 7.9418 9.41053 7.9164C9.40207 7.88253 9.41053 7.84866 9.43593 7.83173L9.73228 7.56925C9.73228 7.56925 10.1048 7.24751 10.1387 7.22211C10.2064 7.16284 10.2064 7.16284 10.1895 6.84956C10.181 6.75643 10.1726 6.65482 10.1641 6.56169C10.1556 6.45162 10.1472 6.35848 10.1387 6.29921L10.1133 6.10447C10.1133 6.07061 10.1218 6.03674 10.1556 6.0198C10.1726 6.01134 10.181 6.00287 10.198 6.00287C10.2149 6.00287 10.2318 6.01134 10.2403 6.0198L10.6975 6.31615L11.1293 6.58709L11.5781 6.37541C11.722 6.30768 12.0691 6.14681 12.1115 6.14681C12.1284 6.14681 12.1453 6.15527 12.1623 6.16374C12.2216 6.20608 12.2216 6.20608 12.0861 6.78183L11.9675 7.25597L12.2385 7.58618C12.5094 7.89946 12.5602 7.95026 12.5602 7.95026C12.6026 7.97566 12.6364 8.02646 12.6364 8.07727C12.6364 8.1958 12.5518 8.20427 11.7897 8.27201L11.5103 8.29741L11.2902 8.69535C11.0446 9.16103 11.0192 9.16103 10.9684 9.16103ZM15.8031 7.17977C15.7523 7.17977 15.7099 7.13744 15.7099 7.08664C15.7099 7.0443 15.7438 6.79876 15.7861 6.53629L15.8539 6.10447L15.7184 5.98594C15.6337 5.90127 15.4474 5.7404 15.3035 5.62186L15.058 5.41019C15.0326 5.38478 15.0241 5.35938 15.0326 5.32552C15.041 5.29165 15.0664 5.26625 15.1003 5.26625L16.0571 5.08844L16.2687 4.64816C16.5143 4.14861 16.5312 4.14015 16.5566 4.12321C16.5651 4.11475 16.582 4.11475 16.5905 4.11475C16.6413 4.11475 16.6667 4.11475 16.9292 4.59736C17.0985 4.90217 17.1747 4.97837 17.1916 4.99531C17.3271 5.00377 18.123 5.05457 18.1907 5.11384C18.25 5.17311 18.2754 5.19851 17.869 5.63879L17.5557 5.98594L17.6573 6.46008C17.7674 7.01043 17.7674 7.01043 17.7674 7.02737C17.7674 7.07817 17.7251 7.11204 17.6827 7.11204C17.6065 7.11204 17.1578 6.8919 17.1578 6.8919C17.107 6.8665 17.0562 6.8411 17.0138 6.82416C16.8614 6.74796 16.7768 6.70562 16.709 6.70562C16.6328 6.70562 16.5397 6.76489 16.3449 6.8919C16.2941 6.92577 16.2433 6.95963 16.1841 6.9935C15.9893 7.1205 15.8623 7.17977 15.8031 7.17977Z" fill="#D43030" > +</path> +<path d="M17.4118 29.8715C17.3017 29.8715 17.2509 29.7699 17.0985 29.4905L16.8445 29.0164L16.4804 28.991L16.3534 28.9825C15.9893 28.9656 15.8708 28.9571 15.8284 28.8555C15.7946 28.7539 15.8793 28.6777 16.074 28.4745L16.1587 28.3898L16.5058 28.0342L16.4127 27.5601C16.3026 27.0351 16.3026 27.0182 16.3026 27.0097C16.3026 26.9589 16.3449 26.925 16.3873 26.925C16.4296 26.925 16.7683 27.0859 16.9037 27.1536C17.1408 27.2637 17.3186 27.3484 17.3864 27.3653C17.4372 27.3399 17.5896 27.2637 17.8182 27.1282C17.8944 27.0859 17.9706 27.0436 18.0299 27.0097C18.1315 26.9504 18.2331 26.8996 18.25 26.8827C18.2669 26.8658 18.2839 26.8573 18.3093 26.8573C18.3177 26.8573 18.3347 26.8573 18.3431 26.8658C18.377 26.8827 18.4024 26.9166 18.3939 26.9589C18.3939 26.9589 18.3601 27.1621 18.3177 27.4076L18.3008 27.5093C18.2161 28.0173 18.2161 28.0173 18.504 28.2713L18.5633 28.3221L18.9189 28.6354C18.9443 28.6608 18.9527 28.6946 18.9443 28.72C18.9358 28.7454 18.9104 28.7708 18.8765 28.7793L18.6818 28.8132C18.6225 28.8216 18.5379 28.8386 18.4447 28.847C18.3601 28.864 18.2754 28.8724 18.2077 28.8894L17.979 28.9232L17.7504 29.3889L17.6912 29.5074C17.5726 29.7615 17.5134 29.8715 17.4118 29.8715ZM23.8043 27.9919C23.7535 27.9919 23.6858 27.9665 23.4402 27.8141C23.2539 27.704 23.0423 27.5601 22.9745 27.5093L22.9068 27.4584L22.4496 27.6532C21.967 27.8479 21.9246 27.8564 21.9077 27.8564C21.8992 27.8564 21.8908 27.8564 21.8823 27.8479C21.7976 27.8225 21.7892 27.8141 21.9416 27.2214L22.0601 26.7557L21.7299 26.3831L21.3743 25.9767C21.3573 25.9513 21.3489 25.9175 21.3573 25.8921C21.3658 25.8667 21.3997 25.8413 21.4251 25.8413L21.7976 25.7989C21.967 25.782 22.1786 25.7566 22.2802 25.7481L22.458 25.7312L22.7205 25.3078C22.8729 25.0708 22.983 24.8845 22.9999 24.8591C23.0084 24.8252 23.0423 24.8083 23.0761 24.8083C23.1439 24.8083 23.1439 24.8083 23.364 25.3417C23.4656 25.6042 23.5672 25.782 23.6011 25.8243C23.6519 25.8413 23.8297 25.8836 24.1176 25.9513C24.507 26.0275 24.5917 26.0445 24.6087 26.1291C24.6256 26.1969 24.5663 26.2392 24.5409 26.2646L24.4986 26.3069C24.4224 26.3747 24.27 26.5017 24.1176 26.6287L23.8043 26.8996L23.8297 27.3399C23.8466 27.6109 23.872 27.8479 23.8805 27.8818C23.889 27.9326 23.872 27.958 23.8636 27.9749C23.872 27.9834 23.8382 27.9919 23.8043 27.9919ZM16.8275 26.1207C16.6328 26.1207 16.2772 26.1207 16.1163 26.0953L15.9216 26.0699C15.8877 26.0614 15.8623 26.036 15.8539 26.0021C15.8454 25.9683 15.8623 25.9344 15.8877 25.909L16.6582 25.4179C17.3948 24.9438 17.4541 24.9099 17.7589 24.876C18.9104 24.7575 20.2397 24.3088 21.2303 23.6907C22.2125 23.0726 23.0846 22.2174 23.762 21.2099L24.0075 20.8373L24.0329 20.8119L24.7695 20.3378C25.4215 19.9059 25.5231 19.8467 25.5993 19.8467C25.6501 19.8467 25.6924 19.889 25.7009 19.9398C25.7009 20.0414 25.286 20.8966 25.159 21.1337C24.3716 22.6238 23.2201 23.8685 21.823 24.7236C20.6885 25.4264 19.3338 25.9005 18.0045 26.0614C17.7843 26.1037 17.3017 26.1207 16.8275 26.1207ZM27.9277 24.2156C27.9108 24.2156 27.86 24.2156 27.4366 23.987C27.2165 23.8685 27.0471 23.7838 26.9879 23.7669C26.9371 23.7838 26.7593 23.86 26.5137 23.9785C26.4714 24.0039 26.0904 24.1902 26.0142 24.1902C25.9634 24.1902 25.9295 24.1479 25.9295 24.1055C25.9295 24.0886 25.9295 24.0801 25.9549 23.987C25.9634 23.9362 25.9803 23.8685 25.9888 23.7923C26.0226 23.6399 26.0565 23.4028 26.0734 23.2843L26.0988 23.081L25.7686 22.717L25.4045 22.3275C25.3791 22.3021 25.3791 22.2682 25.3876 22.2428C25.3961 22.2174 25.4215 22.192 25.4553 22.1835L25.6331 22.1582C25.7263 22.1412 25.9718 22.1073 26.175 22.0819L26.4883 22.0311L26.7169 21.5909L26.954 21.1083C26.9709 21.0829 26.9963 21.0575 27.0302 21.0575C27.0641 21.0575 27.0895 21.0744 27.1064 21.1083L27.3604 21.6163C27.4959 21.8872 27.5975 22.0565 27.6398 22.0989C27.7837 22.1243 28.4611 22.2344 28.5796 22.2852L28.5881 22.2936C28.605 22.3106 28.6135 22.3275 28.6135 22.3444C28.6135 22.3783 28.622 22.4206 28.224 22.7932L27.8769 23.1318L27.9446 23.5975C28.0293 24.1733 28.0293 24.1733 27.9616 24.2071C27.9616 24.2071 27.9446 24.2156 27.9277 24.2156Z" fill="#D43030" > +</path> +<path d="M9.02954 19.8804L9.60529 19.5078L9.05494 18.6442L9.68149 18.2378L10.2318 19.1014L10.6891 18.8051L11.0955 19.4401L10.6383 19.7364L11.1039 20.4561L11.4595 20.092L11.6628 20.4307L11.7136 19.8296L12.1708 19.838C12.0522 19.5756 11.8998 19.3046 11.7305 19.0252L11.2563 19.33L10.8499 18.695L11.3325 18.3817C11.1717 18.1277 10.9854 17.8398 10.7822 17.5181L11.4257 17.1032C11.595 17.3742 11.7813 17.662 11.976 17.9668L13.0937 17.2556C13.6694 18.17 14.1436 18.8982 14.4992 19.4232C14.8548 19.9481 15.058 20.2275 15.0919 20.2529C15.1257 20.2783 15.1596 20.2868 15.1935 20.2698C15.2443 20.2444 15.2443 20.1682 15.185 20.0412C15.1342 19.9142 15.0157 19.6856 14.8294 19.3554C15.0919 19.3639 15.3289 19.347 15.5237 19.3216C15.8031 19.855 15.9555 20.2529 15.9809 20.5239C16.0063 20.7948 15.9301 20.9895 15.7523 21.1081C15.5575 21.2351 15.3205 21.2435 15.0326 21.1335C14.7532 21.0234 14.3891 20.6424 13.9404 19.9904L13.9319 20.6932L13.2884 20.6593C13.4662 21.3621 13.4831 22.0479 13.3561 22.7168C13.0598 22.6406 12.7635 22.5813 12.4671 22.5305C12.6534 21.9294 12.6449 21.2943 12.4502 20.6085C12.2046 20.6001 11.9676 20.5916 11.7474 20.5831C11.7813 20.6424 11.8152 20.6932 11.849 20.7525L11.5188 21.0996L12.3486 22.3866C12.4502 22.5474 12.501 22.7253 12.501 22.9031C12.501 23.0809 12.247 23.3433 11.739 23.6651C11.5696 23.4873 11.3749 23.301 11.1463 23.1063C11.2563 23.047 11.3495 22.9877 11.4341 22.9369C11.5442 22.8607 11.612 22.8015 11.6204 22.7507C11.6374 22.6999 11.612 22.6237 11.5527 22.5305L10.9939 21.65L10.5536 22.1241L10.0371 21.4637C10.2149 21.3028 10.3842 21.1419 10.5621 20.9726L10.0117 20.1174L9.43595 20.49L9.02954 19.8804ZM13.8896 19.9312C13.5424 19.4316 13.1953 18.8982 12.8397 18.3309L12.374 18.6273C12.6449 19.0506 12.8651 19.474 13.0344 19.8888C13.3307 19.8973 13.6186 19.9142 13.8896 19.9312ZM14.66 15.0288C14.9564 15.0373 15.2443 15.0542 15.5152 15.0712C15.4305 15.6892 15.2443 16.4005 14.9733 17.2133C14.7362 17.1117 14.4653 17.0101 14.169 16.9169C14.4399 16.1549 14.6092 15.5199 14.66 15.0288ZM15.5491 16.2481L16.3534 16.2481C16.345 16.5529 16.3196 16.8577 16.2772 17.1625L17.8944 19.6856L17.2171 20.1174L16.0656 18.3225C16.0063 18.5595 15.947 18.8051 15.8708 19.0506C15.693 18.9067 15.4559 18.7458 15.1681 18.5426C15.3967 17.7975 15.5237 17.027 15.5491 16.2481ZM15.7523 14.8087L18.2839 13.183L18.6903 13.818L16.1587 15.4437L15.7523 14.8087ZM16.4889 16.3073L19.4015 14.4446L19.8079 15.0796L19.0459 15.5707L20.0535 17.1371C20.2228 17.3996 20.2905 17.6366 20.2567 17.8483C20.2228 18.06 20.1043 18.2463 19.8926 18.4071C19.6809 18.568 19.3592 18.7881 18.9274 19.0675C18.7411 18.8813 18.5379 18.695 18.3093 18.5003C18.6649 18.3055 18.9358 18.1446 19.1306 18.0261C19.3677 17.8737 19.41 17.6705 19.2491 17.425L18.3516 16.0279L16.9122 16.9508L16.4889 16.3073ZM20.4768 11.3034L21.2134 10.8292L21.7638 11.6929L23.5842 10.5244L25.3368 13.2592L24.6171 13.7249L24.4055 13.3862L23.3132 14.089L24.3208 15.6554L23.5842 16.1295L22.5597 14.5631L21.4675 15.2659L21.6961 15.613L20.9764 16.0787L19.2152 13.327L21.0356 12.1585L20.4768 11.3034ZM21.0356 14.597L22.1279 13.8943L21.4505 12.8444L20.3583 13.5471L21.0356 14.597ZM23.2963 11.6674L22.2041 12.3702L22.8814 13.4201L23.9737 12.7173L23.2963 11.6674Z" fill="#D43030" > +</path> +</g> +<defs> +<clipPath id="clip-path-66_13"> +<path d="M0 34L34 34L34 0L0 0L0 34Z" fill="white"/> +</clipPath> +</defs> +</svg> diff --git a/images/published-icon.svg b/images/published-icon.svg new file mode 100644 index 0000000..ad0fac8 --- /dev/null +++ b/images/published-icon.svg @@ -0,0 +1,14 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="34" height="34" viewBox="0 0 34 34" fill="none"> +<path d="M33.7304 12.1626L28.5696 4.02431C28.1167 3.31514 27.1769 3.10582 26.4634 3.5501L0.707134 19.8438C-0.00202843 20.2966 -0.21136 21.2365 0.232935 21.9457L5.39787 30.0839C5.85071 30.7931 6.79055 31.0024 7.49972 30.5539L33.2559 14.2602C33.9653 13.8116 34.1787 12.8718 33.7304 12.1626ZM32.7007 13.3887L6.94436 29.6824C6.71792 29.8276 6.4189 29.7593 6.27364 29.5328L1.11298 21.3946C0.967731 21.1681 1.03608 20.8691 1.2625 20.7238L27.0188 4.43016C27.2452 4.28918 27.5443 4.35324 27.6852 4.58394L32.8459 12.7222C32.9912 12.9401 32.9271 13.2392 32.7007 13.3887ZM10.4987 8.22376L10.9259 9.24905L11.4813 8.28783L12.5878 8.19812L11.8402 7.37363L12.0922 6.29277L11.084 6.7499L10.1313 6.17316L10.2509 7.27963L9.40934 7.99733L10.4987 8.22376ZM17.0563 5.16921L16.5223 4.19091L16.0738 5.21193L14.9801 5.42129L15.8046 6.16034L15.6637 7.26255L16.6291 6.70718L17.6331 7.18566L17.4024 6.09627L18.1628 5.28885L17.0563 5.16921ZM27.053 21.5312L26.1729 20.8563L26.1687 21.967L25.2502 22.5907L26.3097 22.941L26.6215 24.0048L27.2794 23.1076L28.3901 23.1375L27.7365 22.2362L28.1124 21.1938L27.053 21.5312ZM23.4602 25.9529L23.0415 24.9233L22.4776 25.8802L21.3711 25.9614L22.1102 26.7902L21.8453 27.8667L22.8621 27.4224L23.8105 28.012L23.6994 26.9055L24.541 26.1878L23.4602 25.9528L23.4602 25.9529ZM16.8769 28.9604L17.4024 29.943L17.8638 28.9305L18.9574 28.734L18.1372 27.9821L18.2867 26.8799L17.3169 27.4267L16.3173 26.944L16.5394 28.0291L15.7704 28.8365L16.8769 28.9604ZM7.01698 12.5215L7.89276 13.2093L7.90558 12.0985L8.82833 11.4791L7.77315 11.1245L7.46982 10.0565L6.80337 10.9451L5.69264 10.9066L6.33771 11.8123L5.95324 12.8547L7.01698 12.5215ZM3.10804 17.3147C2.99269 12.6154 5.27826 7.96743 9.53751 5.27603C13.7968 2.58462 18.9745 2.50773 23.1825 4.61814L24.1992 3.97733C22.9561 3.28097 21.6146 2.77259 20.2049 2.45646C18.3209 2.03352 16.4027 1.97799 14.5059 2.28985C12.5408 2.61453 10.6824 3.32369 8.98641 4.40026C7.29041 5.47684 5.85497 6.84817 4.7186 8.48437C3.62069 10.0608 2.84744 11.8209 2.42451 13.7005C2.10837 15.1103 1.9973 16.5372 2.09556 17.9598L3.10804 17.3147ZM30.7654 16.597C30.885 21.2963 28.5995 25.9443 24.3445 28.6357C20.0852 31.3314 14.9075 31.4083 10.7038 29.2979L9.68703 29.943C10.9302 30.635 12.2716 31.1477 13.6814 31.4638C15.5654 31.8867 17.4836 31.9423 19.3804 31.6304C21.3455 31.3058 23.2039 30.5966 24.8956 29.5243C26.5916 28.4477 28.027 27.0764 29.1634 25.4402C30.257 23.8595 31.0303 22.1037 31.4532 20.224C31.7693 18.8142 31.8804 17.3873 31.7822 15.9648L30.7654 16.597ZM12.6048 10.1248C13.7968 9.37296 15.1083 8.97137 16.4283 8.89022L18.0005 7.8948C15.9243 7.65132 13.8437 8.11697 12.0495 9.24905C10.2595 10.3812 8.94795 12.0643 8.28153 14.0423L9.85362 13.0469C10.4902 11.8892 11.4129 10.8767 12.6048 10.1248ZM21.2686 23.7912C20.0767 24.5473 18.7652 24.9489 17.4494 25.0258L15.8772 26.0212C17.9535 26.2647 20.034 25.7991 21.8282 24.6627C23.6182 23.5306 24.9298 21.8474 25.5962 19.8694L24.0241 20.8648C23.3875 22.0225 22.4605 23.035 21.2686 23.7912Z" fill="#00AD45" > +</path> +<path d="M3.92828 21.1509L8.58483 18.1947L8.61473 17.6777L9.41791 17.7461L9.25984 18.1348C10.0074 19.3139 10.5115 20.0872 10.7721 20.446L10.4047 20.9288L10.1228 20.4845L6.07286 23.0563L7.70053 25.6238C7.87995 25.9528 8.15337 25.9869 8.52502 25.7221L12.3528 23.2912C12.7501 23.0691 12.874 22.7957 12.7288 22.4753C12.5835 22.1549 12.3485 21.7106 12.0196 21.1467L12.1777 21.0441C12.8142 22.0481 13.3055 22.4667 13.6473 22.3044C13.6814 22.7786 13.408 23.1716 12.8313 23.4835L8.39688 26.2988C7.96113 26.6021 7.59371 26.491 7.29042 25.9656C6.0045 23.9406 5.25263 22.7743 5.03049 22.4753L5.9319 22.2745L5.808 22.6419L5.95751 22.8769L10.0074 20.3051L8.75146 18.3271L5.08174 20.6554C4.80406 20.8305 4.5691 21.0228 4.3726 21.2278L3.92828 21.1509Z" fill="#00AD45" > +</path> +<path d="M7.95259 26.6792C7.62792 26.6792 7.34594 26.4784 7.11528 26.0768C5.84218 24.0732 5.08601 22.9027 4.86387 22.5994L4.67164 22.3345L6.26085 21.9799L6.06861 22.5567L9.72122 20.2369L8.69593 18.6221L5.20566 20.835C4.94506 21.0016 4.71862 21.181 4.53494 21.3776L4.45376 21.463L3.34729 21.2622L8.37979 18.0752L8.41825 17.4515L9.72977 17.5626L9.50763 18.118C10.2211 19.2415 10.7081 19.9849 10.9516 20.3266L11.0456 20.4548L10.3962 21.3049L10.0673 20.7837L6.37193 23.1249L7.89278 25.5257C7.98249 25.6881 8.05938 25.6881 8.08928 25.6881C8.14482 25.6881 8.24309 25.6625 8.40116 25.5514L8.40969 25.5471L12.246 23.112C12.6689 22.8728 12.575 22.6677 12.5322 22.5652C12.3913 22.2533 12.1563 21.809 11.8316 21.2537L11.7291 21.0742L12.2417 20.7496L12.3571 20.929C13.0406 22.0098 13.3824 22.1252 13.4935 22.1252C13.5148 22.1252 13.5362 22.1209 13.5533 22.1124L13.8352 21.9799L13.8566 22.2918C13.895 22.8557 13.5874 23.3171 12.9338 23.6717L8.50795 26.4784C8.32854 26.6109 8.1363 26.6792 7.95259 26.6792ZM5.39363 22.6165C5.73965 23.1334 6.44027 24.2185 7.47841 25.8547L7.48267 25.8632C7.63218 26.1238 7.79025 26.2563 7.95259 26.2563C8.05085 26.2563 8.15765 26.2135 8.28155 26.1281L8.29008 26.1238L8.43107 26.0341C8.31145 26.0897 8.20037 26.1153 8.09358 26.1153C7.92695 26.1153 7.69625 26.0512 7.52539 25.7351L5.78667 22.9924L5.58587 22.672L5.62004 22.5652L5.39363 22.6165ZM12.8655 22.2533C12.8868 22.3003 12.9082 22.3473 12.9295 22.39C13.0278 22.6037 13.1047 22.9881 12.6861 23.3342L12.7373 23.3C13.1389 23.0864 13.3653 22.8386 13.4251 22.5524C13.2499 22.5268 13.0663 22.4285 12.8655 22.2533ZM10.3108 20.3736L10.4261 20.553L10.5116 20.442C10.2339 20.0404 9.76394 19.3227 9.0847 18.2504L9.02489 18.1564L9.1146 17.9343L8.81554 17.9086L8.80702 18.0453L8.82836 18.0325L10.3108 20.3736ZM14.6854 16.1016C14.5487 15.747 14.3991 15.3796 14.2325 15.0036C14.0659 14.6277 13.8993 14.2817 13.737 13.9741L14.5743 13.816L14.4803 14.1663C14.8306 15.0464 15.0485 15.6017 15.1297 15.8239L18.3209 13.7989L18.5046 13.1026L19.4872 13.3076L15.2108 16.0204C15.386 16.4348 15.5312 16.8535 15.6466 17.2721L18.3893 15.5291L18.4063 15.0634L19.2308 15.1617L19.0728 15.5505C19.1027 16.4433 19.0343 17.2977 18.8677 18.1223C19.9058 18.2077 21.0507 17.9898 22.3025 17.4729L22.358 17.5626C22.0761 17.8232 21.9607 18.0881 22.0162 18.3615C20.803 18.6605 19.7307 18.7331 18.7994 18.5836C18.3807 19.7585 17.616 20.8777 16.501 21.9458L16.4113 21.8774C17.4665 20.6257 18.103 19.4936 18.3209 18.4726C17.4921 18.1992 16.7189 17.8061 16.0054 17.2935L15.7192 17.4772C15.8986 18.276 15.9627 19.0963 15.9157 19.9379C15.8687 20.7795 15.638 21.6254 15.2194 22.4712L15.0998 22.4242C15.2664 21.9329 15.3817 21.3776 15.4501 20.7538C15.5184 20.1301 15.5099 19.4808 15.4202 18.8058C15.3347 18.1308 15.1126 17.2977 14.7537 16.3109L13.2884 17.2422L13.203 17.6694L12.528 17.5199L12.6903 17.2123C12.5878 16.3921 12.4639 15.7982 12.3144 15.4223L13.1602 15.3411L13.0192 15.6786C13.1175 16.3066 13.1859 16.7595 13.2158 17.0457L14.6854 16.1016ZM15.4586 13.0898C16.2233 12.936 16.753 12.8676 17.035 12.8975C17.3212 12.9231 17.5049 13.0043 17.5946 13.141C17.6331 13.2008 17.663 13.3076 17.6844 13.4572C17.7057 13.6109 17.6972 13.6964 17.6544 13.7263C17.5904 13.7647 17.4494 13.7305 17.2315 13.6238C16.8513 13.4486 16.2618 13.3162 15.4543 13.2222L15.4586 13.0898ZM16.1763 17.1866C16.9154 17.6011 17.663 17.883 18.4192 18.0411C18.5473 17.3533 18.5772 16.5758 18.5046 15.7085L16.1763 17.1866Z" fill="#00AD45" > +</path> +<path d="M15.3347 22.7359L14.8434 22.5394L14.9075 22.3472C15.0656 21.873 15.1809 21.3261 15.245 20.7195C15.3091 20.1171 15.3005 19.4763 15.2193 18.8227C15.1425 18.2203 14.9502 17.4813 14.6555 16.6226L13.4892 17.3616L13.3781 17.9128L12.2161 17.6564L12.4767 17.1609C12.3784 16.3962 12.2588 15.8366 12.1221 15.4905L12.0153 15.2256L13.4977 15.0847L13.2414 15.6956C13.3055 16.0886 13.3525 16.4175 13.3867 16.6739L14.4205 16.016C14.3051 15.7169 14.1727 15.4094 14.036 15.089C13.8737 14.7173 13.7071 14.3755 13.5447 14.0765L13.408 13.8201L14.8648 13.5425L14.7024 14.1491C14.946 14.7642 15.1254 15.2128 15.2322 15.4991L17.6972 13.9355C17.5647 13.9825 17.3938 13.9483 17.129 13.8159C16.7744 13.6535 16.1976 13.5253 15.4201 13.4314L15.2193 13.4057L15.2493 12.9102L15.4116 12.876C16.2105 12.7137 16.7402 12.6496 17.0521 12.6795C17.4066 12.7137 17.6459 12.829 17.7698 13.0213C17.8253 13.1067 17.8638 13.2349 17.8894 13.4228C17.9022 13.5211 17.9321 13.7347 17.8125 13.8586L18.1329 13.6535L18.3465 12.8418L20.0383 13.1964L15.4714 16.0971C15.5825 16.3748 15.6807 16.6525 15.7662 16.9345L18.1756 15.4051L18.2055 14.8241L19.5341 14.9821L19.2906 15.5888C19.312 16.3919 19.2607 17.1737 19.1283 17.9213C19.1924 17.9256 19.2565 17.9256 19.3205 17.9256C20.2049 17.9256 21.1832 17.7077 22.2256 17.2719L22.3922 17.2036L22.6399 17.5923L22.5118 17.712C22.2854 17.9213 22.1957 18.1178 22.2341 18.3143L22.2725 18.5151L22.076 18.5621C21.26 18.7629 20.4954 18.8654 19.799 18.8654C19.5042 18.8654 19.218 18.8483 18.9446 18.8099C18.5046 19.9505 17.7356 21.0527 16.6548 22.0909L16.5224 22.219L16.1122 21.9029L16.2575 21.732C17.223 20.5914 17.8339 19.5404 18.0774 18.6048C17.3426 18.3442 16.6505 17.9897 16.0097 17.5411L15.967 17.5667C16.125 18.3357 16.1806 19.1346 16.1378 19.9377C16.0909 20.805 15.8473 21.685 15.4201 22.5522L15.3347 22.7359ZM14.8776 15.9775L14.9673 16.2296C15.3304 17.225 15.5568 18.0794 15.6466 18.7714C15.6936 19.1388 15.7192 19.5063 15.7192 19.8608C15.7576 19.0918 15.6978 18.3314 15.5398 17.5966L15.5227 17.6094L15.4458 17.3317C15.3347 16.9302 15.1937 16.5329 15.0314 16.1399L15.0228 16.1441L14.946 15.9348L14.9331 15.8964C14.852 15.6742 14.6341 15.1189 14.2838 14.2431L14.2581 14.179L14.2795 14.0893L14.0574 14.132C14.1812 14.3755 14.3051 14.6404 14.429 14.9181C14.5914 15.2855 14.7366 15.6443 14.869 15.9818L14.8776 15.9775ZM18.3166 18.2332C18.3465 18.2417 18.3721 18.2502 18.4021 18.2631L18.5857 18.3229L18.5473 18.5108C18.5131 18.6689 18.4704 18.827 18.4191 18.9936C18.4918 18.8312 18.5558 18.6732 18.6114 18.5108L18.6712 18.3442L18.8463 18.3741C19.1497 18.4254 19.4701 18.451 19.8033 18.451C20.4142 18.451 21.0849 18.3656 21.8026 18.199C21.8069 18.0879 21.8325 17.9811 21.8795 17.8743C20.7987 18.2588 19.7862 18.4169 18.8634 18.34L18.6242 18.3186L18.6712 18.0836C18.8335 17.2805 18.8976 16.4346 18.872 15.5631L18.872 15.5161L18.9403 15.3453L18.6242 15.3068L18.6199 15.388L18.6968 15.341L18.7267 15.6913C18.7994 16.5713 18.7695 17.3745 18.637 18.0794L18.5986 18.293L18.3849 18.2502C18.355 18.2417 18.338 18.2375 18.3166 18.2332ZM16.6035 17.1694C17.146 17.4428 17.6972 17.6479 18.2483 17.7803C18.3251 17.2634 18.3508 16.6952 18.3209 16.0801L16.6035 17.1694ZM12.8526 17.3616L13.0449 17.4044L13.0449 17.3958L13.0406 17.4001L13.0021 17.0584C12.9722 16.7807 12.9082 16.3235 12.8099 15.7041L12.8014 15.6443L12.827 15.5802L12.6091 15.6016C12.7245 15.9861 12.8227 16.503 12.9082 17.178L12.9167 17.242L12.8526 17.3616ZM17.5818 13.5296L17.5818 13.7432L17.5818 13.5296ZM18.6626 13.3502L18.59 13.6236L18.9318 13.41L18.6626 13.3502ZM16.3771 13.1451C16.7658 13.2221 17.0777 13.316 17.3169 13.4271L17.3255 13.4314C17.3896 13.4613 17.4366 13.4826 17.475 13.4997L17.475 13.4869C17.4494 13.3075 17.4195 13.2605 17.4152 13.2562C17.3682 13.1793 17.2272 13.1281 17.0179 13.111C16.8769 13.0939 16.659 13.1067 16.3771 13.1451Z" fill="#00AD45" > +</path> +<path d="M24.8785 11.0817C24.6308 10.6887 24.3915 10.3426 24.1736 10.0393L25.0964 9.86842L24.9725 10.2358L25.3271 10.7954L26.8266 9.84278L26.8949 9.38568L27.681 9.42411L27.5059 9.78297L29.0054 12.1454C29.1634 12.4872 29.0652 12.8503 28.7149 13.2391C28.5781 13.0212 28.1808 12.987 27.5229 13.1237L27.4461 13.0041C27.8647 12.8204 28.1552 12.6794 28.3175 12.5769C28.4756 12.4744 28.5055 12.3462 28.4073 12.1882L27.0017 9.97521L25.4382 10.9663L26.9548 13.3544C27.241 13.8073 27.5144 14.2131 27.775 14.572L27.3948 15.1017C26.9548 14.3584 26.5403 13.6834 26.1516 13.0767L24.9896 11.2483L23.52 12.1796L25.357 15.0718L24.9896 15.5545C24.6094 14.9137 23.9856 13.9012 23.1099 12.5256C22.9518 13.5936 22.6357 14.6232 22.1615 15.6101L22.0419 15.5631C22.4605 14.2473 22.6784 13.1707 22.6998 12.3334C22.7168 11.4918 22.7126 10.9065 22.6741 10.569L20.6962 11.825L20.4484 12.0642L20.0425 11.9916L22.6271 10.3512C22.5545 9.6249 22.4349 9.03963 22.2726 8.59106L23.3192 8.54834L23.0928 8.89864L23.1398 10.0265L26.1388 8.12114L26.3353 7.37354L27.399 7.57003L23.1868 10.2529C23.2167 10.8125 23.2167 11.3807 23.1911 11.9489L23.379 12.0343L24.8785 11.0817Z" fill="#00AD45" > +</path> +<path d="M24.9725 15.9478L24.8102 15.6744C24.4727 15.1019 23.9429 14.2432 23.2295 13.1154C23.0501 14.0083 22.7553 14.8798 22.358 15.7128L22.2726 15.8923L21.7813 15.6957L21.8411 15.5078C22.2512 14.2219 22.4691 13.1539 22.4862 12.3379C22.499 11.7526 22.499 11.287 22.4862 10.9495L20.8329 12.0004L20.521 12.3037L19.4701 12.1115L22.4007 10.2489C22.3281 9.60375 22.217 9.07403 22.0718 8.67247L21.9692 8.39905L23.7208 8.32642L23.3107 8.96724L23.3406 9.6593L25.9551 7.99746L26.1815 7.14307L27.9758 7.472L24.3018 9.80455L25.4168 9.59949L25.2075 10.2147L25.3954 10.5095L26.6301 9.7234L26.7112 9.17229L28.0142 9.23636L27.7494 9.77894L29.1933 12.0517L29.1976 12.0645C29.3941 12.4917 29.283 12.936 28.8729 13.3931L28.685 13.6024L28.5354 13.3632C28.497 13.3034 28.3645 13.2649 28.1808 13.2649C28.0185 13.2649 27.8134 13.2906 27.5699 13.3418L27.4247 13.3717L27.1385 12.9189L27.3649 12.8206C27.775 12.6412 28.057 12.5045 28.2065 12.4063C28.2406 12.3849 28.2492 12.3721 28.2535 12.3678C28.2535 12.3635 28.2492 12.3465 28.2278 12.3165L26.9377 10.283L25.7372 11.0477L27.1385 13.2564C27.4247 13.705 27.6981 14.1108 27.9501 14.4654L28.0399 14.5893L27.3777 15.5078L27.2111 15.2258C26.7668 14.4782 26.3481 13.7989 25.9722 13.2051L24.9255 11.5561L23.8191 12.2567L25.6176 15.0934L24.9725 15.9478ZM23.127 12.1542L23.2979 12.4191C24.0498 13.6067 24.6265 14.5337 25.0195 15.1831L25.1049 15.072L23.3021 12.2311L23.127 12.1542ZM25.058 10.9666L26.3353 12.9744C26.6642 13.4956 27.0274 14.0852 27.4119 14.726L27.5144 14.585C27.2837 14.2561 27.0359 13.8844 26.7796 13.4828L25.1477 10.911L24.7375 10.2659L24.7803 10.1463L24.5453 10.1891C24.7076 10.4283 24.8828 10.6889 25.058 10.9666ZM28.3047 12.8377C28.4543 12.8505 28.5824 12.8847 28.685 12.936C28.9413 12.5729 28.8558 12.3422 28.8131 12.2482L27.2623 9.80455L27.3478 9.62939L27.0786 9.61657L27.0658 9.69349L27.0701 9.69349L28.591 12.0858C28.7533 12.3422 28.6935 12.6028 28.4372 12.7694C28.3944 12.7865 28.3517 12.8121 28.3047 12.8377ZM22.8536 10.2104L22.8877 10.5522C22.9219 10.8982 22.9305 11.4835 22.9134 12.3422C22.9134 12.3764 22.9134 12.4105 22.9091 12.4447L22.9689 12.0388L22.9732 11.9363C22.9988 11.4194 22.9988 10.8982 22.9774 10.3856L22.939 10.4112L22.8749 8.84333L22.9134 8.78352L22.5631 8.80061C22.6784 9.19364 22.7681 9.67212 22.8279 10.2275L22.8536 10.2104ZM23.4089 10.3642C23.4303 10.8256 23.4303 11.2955 23.4132 11.7611L24.5837 11.0178C24.383 10.706 24.1864 10.4197 24.0028 10.1677L23.913 10.0481L23.4089 10.3642ZM26.4934 7.63007L26.4079 7.95474L26.8266 7.68987L26.4934 7.63007Z" fill="#00AD45" > +</path> +</svg> diff --git a/images/unchecked.svg b/images/unchecked.svg new file mode 100644 index 0000000..41c0582 --- /dev/null +++ b/images/unchecked.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <rect width="18" height="18" x="3" y="3" rx="2" stroke="#CCCCCC" stroke-width="2" fill="white"/> +</svg> \ No newline at end of file diff --git a/images/valve.svg b/images/valve.svg new file mode 100644 index 0000000..37b8fd5 --- /dev/null +++ b/images/valve.svg @@ -0,0 +1 @@ +<svg height="1006" width="1024" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" viewBox="0 0 60 59"><desc>Created with Sketch.</desc><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"><g sketch:type="MSLayerGroup" transform="translate(1.000000, 1.000000)" stroke="#1890FF" stroke-width="2" stroke-linecap="round"><path fill="#ffffffff" d="M49,35 L55,35 L55,57 L49,57 L49,35 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M9,54 L49,54 L49,38 L9,38" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M55,54 L58,54 L58,38 L55,38 L55,54 Z" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M3,35 L9,35 L9,57 L3,57 L3,35 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M0,54 L3,54 L3,38 L0,38 L0,54 Z" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M14,32 L44,32 L44,38 L14,38 L14,32 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M17,29 L41,29 L41,32 L17,32 L17,29 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M24,21 L34,21 L34,29 L24,29 L24,21 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M27,12 L31,12 L31,21 L27,21 L27,12 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M32.586,2.414 L32.414,2.586 C31.509,3.491 30.281,4 29,4 C27.719,4 26.491,3.491 25.586,2.586 L25.414,2.414 C24.509,1.509 23.281,1 22,1 L16.746,1 C14.125,1 12,3.125 12,5.746 L12,10.254 C12,12.875 14.125,15 16.746,15 L24,15 L24,12 L34,12 L34,15 L41.254,15 C43.875,15 46,12.875 46,10.254 L46,5.746 C46,3.125 43.875,1 41.254,1 L36,1 C34.719,1 33.491,1.509 32.586,2.414 L32.586,2.414 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path><path fill="#ffffffff" d="M29,4 C29.699,4 30.376,3.836 31,3.551 L31,0 L27,0 L27,3.551 C27.624,3.836 28.301,4 29,4 L29,4 Z" stroke-linejoin="round" sketch:type="MSShapeGroup"></path></g></g></svg> \ No newline at end of file diff --git a/pages/createIrrigation/createIrrigation.js b/pages/createIrrigation/createIrrigation.js new file mode 100644 index 0000000..c7e8053 --- /dev/null +++ b/pages/createIrrigation/createIrrigation.js @@ -0,0 +1,538 @@ +const app = getApp(); + +Page({ + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + // 琛ㄥ崟鏁版嵁 + planCode: '', // 璁″垝缂栧彿 + startTime: '', // 鐏屾簤寮�濮嬫椂闂� + pickerValue: '', // 鏃堕棿閫夋嫨鍣ㄧ殑鍊� + timePickerVisible: false, // 鏃堕棿閫夋嫨鍣ㄦ槸鍚﹀彲瑙� + + // 椤圭洰鍜岃疆鐏岀粍鏁版嵁 + projectList: [ + { + id: '1', + name: '椤圭洰涓�', + expanded: false, // 鏄惁灞曞紑 + totalDuration: 0, // 鎬绘椂闀� + groups: [ + { id: '1-1', name: '杞亴缁�1', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 } + ] + }, + { + id: '2', + name: '椤圭洰浜�', + expanded: false, + totalDuration: 0, + groups: [ + { id: '2-1', name: '杞亴缁凙', selected: false, duration: 0 }, + { id: '2-2', name: '杞亴缁凚', selected: false, duration: 0 } + ] + }, + { + id: '4', + name: '椤圭洰涓�', + expanded: false, // 鏄惁灞曞紑 + totalDuration: 0, // 鎬绘椂闀� + groups: [ + { id: '1-1', name: '杞亴缁�1', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 } + ] + }, + { + id: '5', + name: '椤圭洰涓�', + expanded: false, // 鏄惁灞曞紑 + totalDuration: 0, // 鎬绘椂闀� + groups: [ + { id: '1-1', name: '杞亴缁�1', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 } + ] + }, + { + id: '6', + name: '椤圭洰涓�', + expanded: false, // 鏄惁灞曞紑 + totalDuration: 0, // 鎬绘椂闀� + groups: [ + { id: '1-1', name: '杞亴缁�1', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 } + ] + }, + { + id: '7', + name: '椤圭洰涓�', + expanded: false, // 鏄惁灞曞紑 + totalDuration: 0, // 鎬绘椂闀� + groups: [ + { id: '1-1', name: '杞亴缁�1', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 } + ] + }, + { + id: '8', + name: '椤圭洰8', + expanded: false, // 鏄惁灞曞紑 + totalDuration: 0, // 鎬绘椂闀� + groups: [ + { id: '1-1', name: '杞亴缁�1', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 }, + { id: '1-2', name: '杞亴缁�2', selected: false, duration: 0 }, + { id: '1-3', name: '杞亴缁�3', selected: false, duration: 0 } + ] + }, + { + id: '3', + name: '椤圭洰3', + expanded: false, + totalDuration: 0, + groups: [ + { id: '3-1', name: '杞亴缁刋', selected: false, duration: 0 }, + { id: '3-2', name: '杞亴缁刌', selected: false, duration: 0 }, + { id: '3-3', name: '杞亴缁刏', selected: false, duration: 0 } + ] + }, + { + id: '9', + name: '椤圭洰9', + expanded: false, + totalDuration: 0, + groups: [ + { id: '3-1', name: '杞亴缁刋', selected: false, duration: 0 }, + { id: '3-2', name: '杞亴缁刌', selected: false, duration: 0 }, + { id: '3-3', name: '杞亴缁刏', selected: false, duration: 0 } + ] + } + , + { + id: '10', + name: '椤圭洰10', + expanded: false, + totalDuration: 0, + groups: [ + { id: '3-1', name: '杞亴缁刋', selected: false, duration: 0 }, + { id: '3-2', name: '杞亴缁刌', selected: false, duration: 0 }, + { id: '3-3', name: '杞亴缁刏', selected: false, duration: 0 } + ] + } + , + { + id: '11', + name: '椤圭洰11', + expanded: false, + totalDuration: 0, + groups: [ + { id: '3-1', name: '杞亴缁刋', selected: false, duration: 0 }, + { id: '3-2', name: '杞亴缁刌', selected: false, duration: 0 }, + { id: '3-3', name: '杞亴缁刏', selected: false, duration: 0 } + ] + } + ] + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad: function (options) { + // 椤甸潰鍔犺浇鏃跺彲浠ヤ粠API鑾峰彇椤圭洰鍜岃疆鐏岀粍鏁版嵁 + // this.fetchProjectsAndGroups(); + }, + + /** + * 鑾峰彇椤圭洰鍜岃疆鐏岀粍鏁版嵁 + */ + fetchProjectsAndGroups: function () { + // 杩欓噷鍙互娣诲姞API璇锋眰閫昏緫锛岃幏鍙栫湡瀹炴暟鎹� + // wx.request({ + // url: 'your-api-url', + // success: (res) => { + // this.setData({ + // projectList: res.data + // }); + // } + // }); + }, + + /** + * 澶勭悊璁″垝缂栧彿杈撳叆 + */ + onPlanCodeInput: function (e) { + this.setData({ + planCode: e.detail.value + }); + }, + + /** + * 鏄剧ず鏃堕棿閫夋嫨鍣� + */ + showTimePicker: function () { + this.setData({ + timePickerVisible: true + }); + }, + + /** + * 鏃堕棿閫夋嫨鍣ㄧ‘璁ゅ洖璋� + */ + onTimePickerConfirm: function (e) { + this.setData({ + startTime: e.detail.formatValue, + pickerValue: e.detail.value, + timePickerVisible: false + }); + }, + + /** + * 鏃堕棿閫夋嫨鍣ㄥ彇娑堝洖璋� + */ + onTimePickerCancel: function () { + this.setData({ + timePickerVisible: false + }); + }, + + /** + * 鍒囨崲椤圭洰灞曞紑/鎶樺彔鐘舵�� + */ + toggleProject: function (e) { + const index = e.currentTarget.dataset.index; + const currentValue = this.data.projectList[index].expanded; + + // 鍒涘缓鏂扮殑椤圭洰鍒楄〃锛屽厛灏嗘墍鏈夐」鐩涓烘姌鍙犵姸鎬� + const newProjectList = this.data.projectList.map((item, idx) => { + return { + ...item, + expanded: false + }; + }); + + // 濡傛灉褰撳墠鐐瑰嚮鐨勯」鐩凡缁忔槸灞曞紑鐘舵�侊紝鍒欎繚鎸佹墍鏈夐」鐩姌鍙� + // 鍚﹀垯锛屽皢褰撳墠鐐瑰嚮鐨勯」鐩涓哄睍寮�鐘舵�� + if (!currentValue) { + newProjectList[index].expanded = true; + } + + this.setData({ + projectList: newProjectList + }); + }, + + /** + * 鍒囨崲杞亴缁勯�変腑鐘舵�� + */ + toggleGroupSelection: function (e) { + const projectIndex = e.currentTarget.dataset.projectIndex; + const groupIndex = e.currentTarget.dataset.groupIndex; + const key = `projectList[${projectIndex}].groups[${groupIndex}].selected`; + const currentValue = this.data.projectList[projectIndex].groups[groupIndex].selected; + + this.setData({ + [key]: !currentValue + }); + + // 鏇存柊椤圭洰鎬绘椂闀� + this.updateProjectTotalDuration(projectIndex); + }, + + /** + * 澶勭悊鏃堕暱杈撳叆 + */ + onDurationInput: function (e) { + const projectIndex = e.currentTarget.dataset.projectIndex; + const groupIndex = e.currentTarget.dataset.groupIndex; + const value = parseInt(e.detail.value) || 0; + + // 鏇存柊杞亴缁勬椂闀� + const durationKey = `projectList[${projectIndex}].groups[${groupIndex}].duration`; + this.setData({ + [durationKey]: value + }); + + // 鑷姩閫変腑璇ヨ疆鐏岀粍 + const selectedKey = `projectList[${projectIndex}].groups[${groupIndex}].selected`; + if (value > 0 && !this.data.projectList[projectIndex].groups[groupIndex].selected) { + this.setData({ + [selectedKey]: true + }); + } + + // 璁$畻骞舵洿鏂伴」鐩�绘椂闀� + this.updateProjectTotalDuration(projectIndex); + }, + + /** + * 璁$畻骞舵洿鏂伴」鐩�绘椂闀� + */ + updateProjectTotalDuration: function (projectIndex) { + const project = this.data.projectList[projectIndex]; + let totalDuration = 0; + + // 璁$畻鎵�鏈夐�変腑鐨勮疆鐏岀粍鐨勬椂闀挎�诲拰 + project.groups.forEach(group => { + if (group.selected) { + totalDuration += parseInt(group.duration) || 0; + } + }); + + // 鏇存柊椤圭洰鎬绘椂闀� + const totalDurationKey = `projectList[${projectIndex}].totalDuration`; + this.setData({ + [totalDurationKey]: totalDuration + }); + }, + + /** + * 闃绘浜嬩欢鍐掓场 + */ + stopPropagation: function (e) { + // 闃绘浜嬩欢鍐掓场锛岄槻姝㈢偣鍑昏緭鍏ユ鏃惰Е鍙戠埗鍏冪礌鐨勭偣鍑讳簨浠� + }, + + /** + * 璺宠浆鍒拌疆鐏岀粍璇︽儏椤� + */ + navigateToGroupDetail: function (e) { + const projectIndex = e.currentTarget.dataset.projectIndex; + const groupIndex = e.currentTarget.dataset.groupIndex; + const project = this.data.projectList[projectIndex]; + const group = project.groups[groupIndex]; + + wx.navigateTo({ + url: `/pages/groupDetail/groupDetail?projectId=${project.id}&projectName=${project.name}&groupId=${group.id}&groupName=${group.name}` + }); + }, + + /** + * 纭鎸夐挳鐐瑰嚮浜嬩欢 + */ + onConfirm: function () { + // 楠岃瘉琛ㄥ崟 + if (!this.validateForm()) { + return; + } + + // 鏀堕泦閫変腑鐨勮疆鐏岀粍 + const selectedGroups = this.getSelectedGroups(); + + // 鏋勫缓鎻愪氦鏁版嵁 + const formData = { + planCode: this.data.planCode, + startTime: this.data.startTime, + groups: selectedGroups + }; + + // 鎻愪氦鏁版嵁 + this.submitForm(formData); + }, + + /** + * 楠岃瘉琛ㄥ崟 + */ + validateForm: function () { + if (!this.data.planCode) { + wx.showToast({ + title: '璇疯緭鍏ヨ鍒掔紪鍙�', + icon: 'none' + }); + return false; + } + + if (!this.data.startTime) { + wx.showToast({ + title: '璇烽�夋嫨鐏屾簤寮�濮嬫椂闂�', + icon: 'none' + }); + return false; + } + + const selectedGroups = this.getSelectedGroups(); + if (selectedGroups.length === 0) { + wx.showToast({ + title: '璇疯嚦灏戦�夋嫨涓�涓疆鐏岀粍', + icon: 'none' + }); + return false; + } + + // 妫�鏌ラ�変腑鐨勮疆鐏岀粍鏄惁閮借缃簡鏃堕暱 + const invalidGroups = selectedGroups.filter(group => !group.duration); + if (invalidGroups.length > 0) { + wx.showToast({ + title: '璇蜂负鎵�鏈夐�変腑鐨勮疆鐏岀粍璁剧疆鏃堕暱', + icon: 'none' + }); + return false; + } + + return true; + }, + + /** + * 鑾峰彇閫変腑鐨勮疆鐏岀粍 + */ + getSelectedGroups: function () { + const selectedGroups = []; + + this.data.projectList.forEach(project => { + project.groups.forEach(group => { + if (group.selected) { + selectedGroups.push({ + projectId: project.id, + projectName: project.name, + groupId: group.id, + groupName: group.name, + duration: group.duration + }); + } + }); + }); + + return selectedGroups; + }, + + /** + * 鎻愪氦琛ㄥ崟鏁版嵁 + */ + submitForm: function (formData) { + // 杩欓噷鍙互娣诲姞API璇锋眰閫昏緫锛屾彁浜よ〃鍗曟暟鎹� + console.log('鎻愪氦鐨勮〃鍗曟暟鎹�:', formData); + + // 妯℃嫙API璇锋眰 + wx.showLoading({ + title: '鎻愪氦涓�...', + }); + + setTimeout(() => { + wx.hideLoading(); + + wx.showToast({ + title: '鍒涘缓鎴愬姛', + icon: 'success', + duration: 2000, + success: () => { + // 寤惰繜杩斿洖涓婁竴椤� + setTimeout(() => { + wx.navigateBack(); + }, 2000); + } + }); + }, 1500); + + // 瀹為檯API璇锋眰绀轰緥 + // wx.request({ + // url: 'your-api-url', + // method: 'POST', + // data: formData, + // success: (res) => { + // wx.showToast({ + // title: '鍒涘缓鎴愬姛', + // icon: 'success', + // duration: 2000, + // success: () => { + // setTimeout(() => { + // wx.navigateBack(); + // }, 2000); + // } + // }); + // }, + // fail: (err) => { + // wx.showToast({ + // title: '鍒涘缓澶辫触锛岃閲嶈瘯', + // icon: 'none' + // }); + // } + // }); + } +}); \ No newline at end of file diff --git a/pages/createIrrigation/createIrrigation.json b/pages/createIrrigation/createIrrigation.json new file mode 100644 index 0000000..5e0bed4 --- /dev/null +++ b/pages/createIrrigation/createIrrigation.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "鏂板缓鐏屾簤璁″垝", + "usingComponents": { + "t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker" + } +} \ No newline at end of file diff --git a/pages/createIrrigation/createIrrigation.wxml b/pages/createIrrigation/createIrrigation.wxml new file mode 100644 index 0000000..e1a77ca --- /dev/null +++ b/pages/createIrrigation/createIrrigation.wxml @@ -0,0 +1,77 @@ +<view class="create-irrigation-container"> + <!-- 璁″垝缂栧彿 --> + <view class="form-item"> + <view class="form-label">璁″垝缂栧彿</view> + <view class="form-input"> + <input type="text" placeholder="璇疯緭鍏ヨ鍒掔紪鍙�" value="{{planCode}}" bindinput="onPlanCodeInput" /> + </view> + </view> + + <!-- 鐏屾簤寮�濮嬫椂闂� --> + <view class="form-item" bindtap="showTimePicker"> + <view class="form-label">鐏屾簤寮�濮嬫椂闂�</view> + <view class="form-input time-input"> + <view class="time-text {{startTime ? '' : 'placeholder'}}">{{startTime || '璇烽�夋嫨鐏屾簤寮�濮嬫椂闂�'}}</view> + <image class="arrow-icon" src="/images/arrow-right.svg" mode="aspectFit"></image> + </view> + </view> + + <!-- 椤圭洰鍜岃疆鐏岀粍宓屽鍒楄〃 --> + <view class="list-container"> + <!-- 椤圭洰鍒楄〃 --> + <scroll-view scroll-y="true" class="project-list"> + <block wx:for="{{projectList}}" wx:key="id"> + <view class="project-item"> + <!-- 椤圭洰鍚嶇О --> + <view class="project-header" bindtap="toggleProject" data-index="{{index}}"> + <view class="project-title"> + <image class="toggle-icon {{item.expanded ? 'expanded' : ''}}" src="/images/arrow-down.svg" mode="aspectFit"></image> + <view class="project-name">{{item.name}}</view> + </view> + <view class="project-duration">鎬绘椂闀�: {{item.totalDuration || 0}}鍒嗛挓</view> + </view> + + <!-- 杞亴缁勫垪琛� --> + <view class="group-list {{item.expanded ? 'expanded' : ''}}"> + <block wx:for="{{item.groups}}" wx:for-item="group" wx:for-index="groupIndex" wx:key="id"> + <view class="group-item {{group.selected ? 'selected' : ''}}"> + <view class="group-info" bindtap="navigateToGroupDetail" data-project-index="{{index}}" data-group-index="{{groupIndex}}"> + <view class="group-name">{{group.name}}</view> + </view> + <view class="group-duration"> + <input + class="duration-input" + type="number" + value="{{group.duration}}" + bindinput="onDurationInput" + data-project-index="{{index}}" + data-group-index="{{groupIndex}}" + placeholder="0" + catchtap="stopPropagation" + /> + <text class="duration-unit">鍒嗛挓</text> + </view> + </view> + </block> + </view> + </view> + </block> + </scroll-view> + </view> + + <!-- 搴曢儴纭鎸夐挳 --> + <view class="bottom-button"> + <button class="confirm-button" hover-class="confirm-button-hover" bindtap="onConfirm">纭</button> + </view> + + <!-- 鏃堕棿閫夋嫨鍣ㄥ脊绐� --> + <t-date-time-picker + title="閫夋嫨鐏屾簤寮�濮嬫椂闂�" + visible="{{timePickerVisible}}" + mode="{{['date', 'minute']}}" + value="{{pickerValue}}" + format="YYYY-MM-DD HH:mm" + bindconfirm="onTimePickerConfirm" + bindcancel="onTimePickerCancel" + /> +</view> \ No newline at end of file diff --git a/pages/createIrrigation/createIrrigation.wxss b/pages/createIrrigation/createIrrigation.wxss new file mode 100644 index 0000000..93c27a6 --- /dev/null +++ b/pages/createIrrigation/createIrrigation.wxss @@ -0,0 +1,237 @@ +.create-irrigation-container { + display: flex; + flex-direction: column; + height: 100vh; + background-color: #f5f5f5; + position: relative; + padding-bottom: 130rpx; /* 涓哄簳閮ㄦ寜閽暀鍑虹┖闂� */ + box-sizing: border-box; +} + +/* 琛ㄥ崟椤规牱寮� */ +.form-item { + display: flex; + flex-direction: row; + align-items: center; + background-color: #fff; + padding: 30rpx; + margin-bottom: 2rpx; + width: 100%; + box-sizing: border-box; +} + +.form-label { + font-size: 28rpx; + color: #333; + font-weight: 500; + width: 200rpx; /* 鍥哄畾鏍囩瀹藉害 */ + flex-shrink: 0; /* 闃叉鏍囩瀹藉害琚帇缂� */ +} + +.form-input { + display: flex; + align-items: center; + justify-content: space-between; + height: 80rpx; + flex: 1; /* 杈撳叆妗嗗崰鎹墿浣欑┖闂� */ +} + +.form-input input { + flex: 1; + height: 100%; + font-size: 28rpx; + text-align: right; /* 鏂囨湰鍙冲榻� */ +} + +.time-input { + color: #333; + font-size: 28rpx; + text-align: right; /* 鏂囨湰鍙冲榻� */ + display: flex; + justify-content: flex-end; /* 鍐呭闈犲彸瀵归綈 */ + align-items: center; +} + +.time-text { + flex: 1; + text-align: right; + padding-right: 20rpx; +} + +.placeholder { + color: #999; +} + +.arrow-icon { + width: 32rpx; + height: 32rpx; +} + +/* 鍒楄〃瀹瑰櫒鏍峰紡 */ +.list-container { + background-color: #fff; + margin-top: 20rpx; + flex: 1; + box-sizing: border-box; + width: 100%; + display: flex; + flex-direction: column; + padding: 0; + height: calc(100vh - 300rpx); /* 璁剧疆鍥哄畾楂樺害锛屽噺鍘婚《閮ㄨ〃鍗曞拰搴曢儴鎸夐挳鐨勯珮搴� */ +} + +.list-title { + font-size: 28rpx; + color: #333; + margin-bottom: 30rpx; + font-weight: 500; +} + +/* 椤圭洰鍒楄〃鏍峰紡 */ +.project-list { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; /* 鍗犳弧瀹瑰櫒楂樺害 */ + padding: 30rpx; + box-sizing: border-box; +} + +.project-item { + margin-bottom: 30rpx; /* 澧炲姞椤圭洰涔嬮棿鐨勯棿璺� */ + border-radius: 8rpx; + overflow: visible; /* 鍏佽鍐呭婧㈠嚭锛屼互渚胯疆鐏岀粍鍒楄〃鍙互瀹屽叏灞曞紑 */ + border: 1rpx solid #eee; + width: 100%; + box-sizing: border-box; +} + +.project-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 30rpx; + background-color: #f9f9f9; + width: 100%; + box-sizing: border-box; +} + +.project-title { + display: flex; + align-items: center; +} + +.project-name { + font-size: 28rpx; + color: #333; + font-weight: 500; + margin-left: 10rpx; +} + +.project-duration { + font-size: 26rpx; + color: #666; +} + +.toggle-icon { + width: 32rpx; + height: 32rpx; + transition: transform 0.3s; +} + +.toggle-icon.expanded { + transform: rotate(180deg); +} + +/* 杞亴缁勫垪琛ㄦ牱寮� */ +.group-list { + display: none; + flex-direction: column; + background-color: #fff; + max-height: none; /* 绉婚櫎鏈�澶ч珮搴﹂檺鍒� */ + height: auto; /* 鑷�傚簲楂樺害 */ +} + +.group-list.expanded { + display: flex; +} + +.group-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 25rpx 30rpx; + border-top: 1rpx solid #eee; +} + +.group-item.selected { + background-color: #f0f9ff; +} + +.group-info { + flex: 1; + display: flex; + align-items: center; +} + +.group-name { + font-size: 26rpx; + color: #666; +} + +.group-duration { + display: flex; + align-items: center; +} + +.duration-input { + width: 100rpx; + height: 60rpx; + border: 1rpx solid #ddd; + border-radius: 6rpx; + text-align: center; + font-size: 26rpx; + margin-right: 10rpx; +} + +.duration-unit { + font-size: 24rpx; + color: #999; + margin-right: 20rpx; +} + +.group-check { + margin-left: 10rpx; +} + +.check-icon { + width: 36rpx; + height: 36rpx; +} + +/* 搴曢儴鎸夐挳鏍峰紡 */ +.bottom-button { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx 30rpx; + background-color: #fff; + box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05); + z-index: 100; /* 鎻愰珮z-index纭繚鎸夐挳鍦ㄦ渶涓婂眰 */ +} + +.confirm-button { + width: 100%; + height: 88rpx; + line-height: 88rpx; + text-align: center; + background-color: #1890FF; + color: #fff; + font-size: 30rpx; + border-radius: 44rpx; +} + +.confirm-button-hover { + opacity: 0.8; +} \ No newline at end of file diff --git a/pages/groupDetail/groupDetail.js b/pages/groupDetail/groupDetail.js new file mode 100644 index 0000000..ad8fb75 --- /dev/null +++ b/pages/groupDetail/groupDetail.js @@ -0,0 +1,86 @@ +const app = getApp(); + +Page({ + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + projectId: '', + projectName: '', + groupId: '', + groupName: '', + valveList: [ + // 妯℃嫙鏁版嵁锛屽疄闄呭簲浠嶢PI鑾峰彇 + { id: '1', name: '闃�鎺у櫒1', status: 'online', location: '浣嶇疆A' }, + { id: '2', name: '闃�鎺у櫒2', status: 'offline', location: '浣嶇疆B' }, + { id: '3', name: '闃�鎺у櫒3', status: 'online', location: '浣嶇疆C' }, + { id: '4', name: '闃�鎺у櫒4', status: 'online', location: '浣嶇疆D' }, + { id: '5', name: '闃�鎺у櫒5', status: 'offline', location: '浣嶇疆E' } + ], + loading: false + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad: function (options) { + if (options) { + this.setData({ + projectId: options.projectId || '', + projectName: options.projectName || '', + groupId: options.groupId || '', + groupName: options.groupName || '' + }); + + wx.setNavigationBarTitle({ + title: this.data.groupName || '杞亴缁勮鎯�' + }); + + // 鑾峰彇闃�鎺у櫒鍒楄〃 + this.fetchValveList(); + } + }, + + /** + * 鑾峰彇闃�鎺у櫒鍒楄〃 + */ + fetchValveList: function () { + this.setData({ loading: true }); + + // 杩欓噷搴旇鏄疄闄呯殑API璇锋眰 + // 妯℃嫙API璇锋眰寤惰繜 + setTimeout(() => { + this.setData({ loading: false }); + // 瀹為檯鏁版嵁宸插湪data涓垵濮嬪寲锛岃繖閲屽彧鏄ā鎷熻姹傚畬鎴� + }, 1000); + + // 瀹為檯API璇锋眰绀轰緥 + // wx.request({ + // url: 'your-api-url', + // data: { + // projectId: this.data.projectId, + // groupId: this.data.groupId + // }, + // success: (res) => { + // this.setData({ + // valveList: res.data, + // loading: false + // }); + // }, + // fail: () => { + // this.setData({ loading: false }); + // wx.showToast({ + // title: '鑾峰彇鏁版嵁澶辫触', + // icon: 'none' + // }); + // } + // }); + }, + + /** + * 杩斿洖涓婁竴椤� + */ + goBack: function () { + wx.navigateBack(); + } +}); \ No newline at end of file diff --git a/pages/groupDetail/groupDetail.json b/pages/groupDetail/groupDetail.json new file mode 100644 index 0000000..2f1858e --- /dev/null +++ b/pages/groupDetail/groupDetail.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "杞亴缁勮鎯�", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/groupDetail/groupDetail.wxml b/pages/groupDetail/groupDetail.wxml new file mode 100644 index 0000000..a024557 --- /dev/null +++ b/pages/groupDetail/groupDetail.wxml @@ -0,0 +1,48 @@ +<view class="group-detail-container"> + <!-- 椤甸潰鏍囬 --> + <view class="page-header"> + <view class="header-content"> + <view class="project-info"> + <view class="project-name">{{projectName}}</view> + <view class="group-name">{{groupName}}</view> + </view> + </view> + </view> + + <!-- 闃�鎺у櫒鍒楄〃 --> + <view class="valve-list-container"> + <view class="section-title">鍙栨按鍙i榾鎺у櫒鍒楄〃</view> + + <!-- 鍔犺浇涓� --> + <view class="loading-container" wx:if="{{loading}}"> + <view class="loading-icon"></view> + <view class="loading-text">鍔犺浇涓�...</view> + </view> + + <!-- 闃�鎺у櫒鍒楄〃 --> + <view class="valve-list" wx:else> + <block wx:for="{{valveList}}" wx:key="id"> + <view class="valve-item"> + <view class="valve-info"> + <view class="valve-name">{{item.name}}</view> + <view class="valve-location">{{item.location}}</view> + </view> + <view class="valve-status {{item.status === 'online' ? 'online' : 'offline'}}"> + {{item.status === 'online' ? '鍦ㄧ嚎' : '绂荤嚎'}} + </view> + </view> + </block> + </view> + + <!-- 绌虹姸鎬� --> + <view class="empty-state" wx:if="{{!loading && valveList.length === 0}}"> + <image class="empty-icon" src="/images/empty.svg" mode="aspectFit"></image> + <view class="empty-text">鏆傛棤闃�鎺у櫒鏁版嵁</view> + </view> + </view> + + <!-- 搴曢儴鎸夐挳 --> + <view class="bottom-button"> + <button class="back-button" hover-class="back-button-hover" bindtap="goBack">杩斿洖</button> + </view> +</view> \ No newline at end of file diff --git a/pages/groupDetail/groupDetail.wxss b/pages/groupDetail/groupDetail.wxss new file mode 100644 index 0000000..c27f91f --- /dev/null +++ b/pages/groupDetail/groupDetail.wxss @@ -0,0 +1,167 @@ +.group-detail-container { + display: flex; + flex-direction: column; + min-height: 100vh; + background-color: #f5f5f5; +} + +/* 椤甸潰鏍囬鏍峰紡 */ +.page-header { + background-color: #1890FF; + padding: 30rpx; + color: #fff; +} + +.header-content { + display: flex; + flex-direction: column; +} + +.project-info { + display: flex; + flex-direction: column; +} + +.project-name { + font-size: 24rpx; + opacity: 0.8; + margin-bottom: 10rpx; +} + +.group-name { + font-size: 32rpx; + font-weight: 500; +} + +/* 闃�鎺у櫒鍒楄〃瀹瑰櫒 */ +.valve-list-container { + flex: 1; + padding: 30rpx; +} + +.section-title { + font-size: 28rpx; + color: #333; + font-weight: 500; + margin-bottom: 20rpx; +} + +/* 鍔犺浇涓牱寮� */ +.loading-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 60rpx 0; +} + +.loading-icon { + width: 60rpx; + height: 60rpx; + border: 4rpx solid #f3f3f3; + border-top: 4rpx solid #1890FF; + border-radius: 50%; + animation: spin 1s linear infinite; + margin-bottom: 20rpx; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +.loading-text { + font-size: 26rpx; + color: #999; +} + +/* 闃�鎺у櫒鍒楄〃鏍峰紡 */ +.valve-list { + display: flex; + flex-direction: column; +} + +.valve-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 30rpx; + background-color: #fff; + margin-bottom: 20rpx; + border-radius: 8rpx; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); +} + +.valve-info { + display: flex; + flex-direction: column; +} + +.valve-name { + font-size: 28rpx; + color: #333; + margin-bottom: 10rpx; + font-weight: 500; +} + +.valve-location { + font-size: 24rpx; + color: #999; +} + +.valve-status { + padding: 8rpx 20rpx; + border-radius: 30rpx; + font-size: 24rpx; +} + +.valve-status.online { + background-color: #e6f7ff; + color: #1890FF; +} + +.valve-status.offline { + background-color: #fff1f0; + color: #f5222d; +} + +/* 绌虹姸鎬佹牱寮� */ +.empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 100rpx 0; +} + +.empty-icon { + width: 120rpx; + height: 120rpx; + margin-bottom: 20rpx; +} + +.empty-text { + font-size: 26rpx; + color: #999; +} + +/* 搴曢儴鎸夐挳鏍峰紡 */ +.bottom-button { + padding: 20rpx 30rpx 40rpx; +} + +.back-button { + width: 100%; + height: 88rpx; + line-height: 88rpx; + text-align: center; + background-color: #fff; + color: #1890FF; + font-size: 30rpx; + border-radius: 44rpx; + border: 1rpx solid #1890FF; +} + +.back-button-hover { + opacity: 0.8; +} \ No newline at end of file diff --git a/pages/home/home.js b/pages/home/home.js index 253cb13..d38e37d 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -568,7 +568,7 @@ console.error('淇濆瓨椤圭洰閫夋嫨澶辫触锛�', err); wx.showToast({ title: '淇濆瓨澶辫触锛岃閲嶈瘯', - icon: 'error', + icon: 'success', duration: 2000 }); }); @@ -634,6 +634,7 @@ that.codeLogin(code); } else { console.log('鐧诲綍澶辫触锛�' + res.errMsg); + } } }); @@ -674,7 +675,11 @@ this.initData(); } } else { - + wx.showToast({ + title: 'title', + icon: 'error', + duration: 2000 + }) } }).catch(error => { // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢� diff --git a/pages/home/home.wxml b/pages/home/home.wxml index 0984891..923d87d 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -35,7 +35,7 @@ </view> <view class="center-view" bind:tap="feedBack"> <image src="/images/question.svg" /> - <text>闂鍙嶉</text> + <text>杞亴</text> </view> </view> diff --git a/pages/irrigation/irrigation.js b/pages/irrigation/irrigation.js new file mode 100644 index 0000000..6ff0e20 --- /dev/null +++ b/pages/irrigation/irrigation.js @@ -0,0 +1,237 @@ +// pages/irrigation/irrigation.js +Page({ + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + currentTab: 0, // 褰撳墠閫変腑鐨勬爣绛鹃〉绱㈠紩 + activeList: [], // 杩涜涓殑杞亴鍒楄〃 + completedList: [], // 宸插畬鎴愮殑杞亴鍒楄〃 + currentList: [], // 褰撳墠鏄剧ず鐨勫垪琛� + isRefreshing: false, // 鏄惁姝e湪鍒锋柊 + isWXRefreshing: false // 寰俊鍘熺敓涓嬫媺鍒锋柊鐘舵�� + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad: function (options) { + this.loadIrrigationData(); + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow: function () { + this.loadIrrigationData(); + }, + + /** + * 鍔犺浇杞亴鏁版嵁 + */ + loadIrrigationData: function () { + // 杩欓噷搴旇璋冪敤API鑾峰彇鏁版嵁 + // 妯℃嫙鏁版嵁 + const mockData = { + activeList: [ + { + id: '1', + title: 'LG-2023-001', + status: '鏈彂甯�', + irrigationTime: '2023-05-20 08:00 - 17:00' + }, + { + id: '2', + title: 'LG-2023-002', + status: '宸插彂甯�', + irrigationTime: '2023-05-22 09:00 - 18:00' + }, + { + id: '2', + title: 'LG-2023-002', + status: '宸插彂甯�', + irrigationTime: '2023-05-22 09:00 - 18:00' + }, { + id: '2', + title: 'LG-2023-002', + status: '宸插彂甯�', + irrigationTime: '2023-05-22 09:00 - 18:00' + }, { + id: '2', + title: 'LG-2023-002', + status: '宸插彂甯�', + irrigationTime: '2023-05-22 09:00 - 18:00' + }, + { + id: '3', + title: 'LG-2023-003', + status: '鎵ц涓�', + irrigationTime: '2023-05-18 07:30 - 16:30', + irrigatedTime: '3灏忔椂25鍒嗛挓', + irrigatedGroups: '1缁勩��2缁勩��3缁�' + }, { + id: '2', + title: 'LG-2023-002', + status: '宸插彂甯�', + irrigationTime: '2023-05-22 09:00 - 18:00' + }, + { + id: '3', + title: 'LG-2023-003', + status: '鎵ц涓�', + irrigationTime: '2023-05-18 07:30 - 16:30', + irrigatedTime: '3灏忔椂25鍒嗛挓', + irrigatedGroups: '1缁勩��2缁勩��3缁�' + }, { + id: '2', + title: 'LG-2023-002', + status: '宸插彂甯�', + irrigationTime: '2023-05-22 09:00 - 18:00' + }, + { + id: '3', + title: 'LG-2023-003', + status: '鎵ц涓�', + irrigationTime: '2023-05-18 07:30 - 16:30', + irrigatedTime: '3灏忔椂25鍒嗛挓', + irrigatedGroups: '1缁勩��2缁勩��3缁�' + } + + ] + // completedList: [ + // { + // id: '4', + // title: 'LG-2023-004', + // status: '宸插畬鎴�', + // irrigationTime: '2023-05-10 10:00 - 19:00' + // } + // ] + }; + + // 妯℃嫙缃戠粶璇锋眰寤惰繜 + setTimeout(() => { + this.setData({ + activeList: mockData.activeList || [], + completedList: mockData.completedList || [], + currentList: this.data.currentTab === 0 ? mockData.activeList || [] : mockData.completedList || [], + isRefreshing: false, // 缁撴潫鍒锋柊鐘舵�� + isWXRefreshing: false // 缁撴潫寰俊鍘熺敓涓嬫媺鍒锋柊鐘舵�� + }); + }, 1000); + }, + + /** + * 鍒囨崲鏍囩椤� + */ + switchTab: function (e) { + const index = parseInt(e.currentTarget.dataset.index); + if (this.data.currentTab === index) { + return; + } + + const activeList = this.data.activeList || []; + const completedList = this.data.completedList || []; + + this.setData({ + currentTab: index, + currentList: index === 0 ? activeList : completedList + }); + }, + + /** + * 鐐瑰嚮鍙戝竷鎸夐挳 + */ + onPublish: function (e) { + const id = e.currentTarget.dataset.id; + wx.showModal({ + title: '纭鍙戝竷', + content: '纭畾瑕佸彂甯冭杞亴璁″垝鍚楋紵', + success: (res) => { + if (res.confirm) { + // 杩欓噷搴旇璋冪敤API鍙戝竷杞亴璁″垝 + wx.showToast({ + title: '鍙戝竷鎴愬姛', + icon: 'success' + }); + // 鍒锋柊鏁版嵁 + this.loadIrrigationData(); + } + } + }); + }, + + /** + * 鐐瑰嚮缁堟鎸夐挳 + */ + onStop: function (e) { + const id = e.currentTarget.dataset.id; + wx.showModal({ + title: '纭缁堟', + content: '纭畾瑕佺粓姝㈣杞亴璁″垝鍚楋紵', + success: (res) => { + if (res.confirm) { + // 杩欓噷搴旇璋冪敤API缁堟杞亴璁″垝 + wx.showToast({ + title: '宸茬粓姝�', + icon: 'success' + }); + // 鍒锋柊鏁版嵁 + this.loadIrrigationData(); + } + } + }); + }, + + /** + * 鐐瑰嚮绔嬪嵆鎵ц鎸夐挳 + */ + onExecute: function (e) { + const id = e.currentTarget.dataset.id; + wx.showModal({ + title: '纭鎵ц', + content: '纭畾瑕佺珛鍗虫墽琛岃杞亴璁″垝鍚楋紵', + success: (res) => { + if (res.confirm) { + // 杩欓噷搴旇璋冪敤API绔嬪嵆鎵ц杞亴璁″垝 + wx.showToast({ + title: '鎵ц鎴愬姛', + icon: 'success' + }); + // 鍒锋柊鏁版嵁 + this.loadIrrigationData(); + } + } + }); + }, + + /** + * 鐐瑰嚮鏂板缓杞亴鎸夐挳 + */ + onAddIrrigation: function () { + wx.navigateTo({ + url: '/pages/createIrrigation/createIrrigation' + }); + }, + + /** + * 寮�濮嬩笅鎷夊埛鏂� + */ + startPullDownRefresh: function() { + if (!this.data.isWXRefreshing) { + this.setData({ + isRefreshing: true + }); + this.loadIrrigationData(); + } + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh: function () { + this.setData({ + isWXRefreshing: true + }); + this.loadIrrigationData(); + } +}) \ No newline at end of file diff --git a/pages/irrigation/irrigation.json b/pages/irrigation/irrigation.json new file mode 100644 index 0000000..d515bda --- /dev/null +++ b/pages/irrigation/irrigation.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "杞亴璁″垝" +} \ No newline at end of file diff --git a/pages/irrigation/irrigation.wxml b/pages/irrigation/irrigation.wxml new file mode 100644 index 0000000..3b71e14 --- /dev/null +++ b/pages/irrigation/irrigation.wxml @@ -0,0 +1,86 @@ +<view class="irrigation-container"> + <!-- 椤堕儴涓や釜鏍囩椤� --> + <view class="tabs"> + <view class="tab {{currentTab === 0 ? 'active' : ''}}" hover-class="tab-hover" bindtap="switchTab" data-index="0"> + <text>褰撳墠鐏屾簤璁″垝</text> + </view> + <view class="tab {{currentTab === 1 ? 'active' : ''}}" hover-class="tab-hover" bindtap="switchTab" data-index="1"> + <text>鍘嗗彶璁″垝</text> + </view> + </view> + + <!-- 涓棿鍒楄〃 - 浣跨敤scroll-view瀹炵幇涓嬫媺鍒锋柊 --> + <scroll-view class="scroll-view" scroll-x="false" scroll-y="true" refresher-enabled="{{isRefreshing==false?true:false}}" refresher-threshold="50" bindrefresherrefresh="onPullDownRefresh" refresher-triggered="{{isWXRefreshing}}"> + <view wx:if="{{isRefreshing}}" class="refresh-view"> + <view class="dot"></view> + <view class="dot"></view> + <view class="dot"></view> + </view> + <view class="scroll-bg"> + <block wx:if="{{currentList.length > 0}}"> + <!-- 缁熶竴鏄剧ず鎵�鏈夊垪琛ㄩ」锛屼笉鍐嶆寜鐘舵�佸垎缁� --> + <view class="list-item" wx:for="{{currentList}}" wx:key="id"> + <view class="item-header"> + <view class="info-row title-row"> + <view class="info-label">缂栧彿锛�</view> + <view class="info-value">{{item.title}}</view> + </view> + <!-- 鏍规嵁鐘舵�佹樉绀轰笉鍚岀殑鍥炬爣 --> + <view class="item-status"> + <block wx:if="{{item.status === '宸插彂甯�'}}"> + <image class="status-icon" src="/images/published-icon.svg" mode="aspectFit"></image> + </block> + <block wx:elif="{{item.status === '鎵ц涓�'}}"> + <image class="status-icon" src="/images/progress.svg" mode="aspectFit"></image> + </block> + <block wx:elif="{{item.status === '鏈彂甯�'}}"> + <text>{{item.status}}</text> + </block> + </view> + </view> + <view class="item-info"> + <view class="info-row"> + <view class="info-label">鐏屾簤鏃堕棿锛�</view> + <view class="info-value">{{item.irrigationTime}}</view> + </view> + <!-- 浠呭湪鎵ц涓姸鎬佹樉绀洪澶栦俊鎭� --> + <block wx:if="{{item.status === '鎵ц涓�'}}"> + <view class="info-row irrigated-row"> + <view class="info-label">宸茬亴婧夋椂闂达細</view> + <view class="info-value-time">{{item.irrigatedTime}}</view> + </view> + <view class="info-row irrigated-row"> + <view class="info-label">宸茬亴婧夎疆缁勶細</view> + <view class="info-value-time">{{item.irrigatedGroups}}</view> + </view> + </block> + </view> + <view class="item-actions"> + <!-- 鏍规嵁鐘舵�佹樉绀轰笉鍚岀殑鎸夐挳 --> + <block wx:if="{{item.status === '鏈彂甯�'}}"> + <button class="action-button publish-button" hover-class="publish-button-hover" bindtap="onPublish" data-id="{{item.id}}">鍙戝竷</button> + </block> + <block wx:if="{{item.status === '鎵ц涓�' || item.status === '宸插彂甯�'}}"> + <button class="action-button stop-button" hover-class="stop-button-hover" bindtap="onStop" data-id="{{item.id}}">缁堟</button> + </block> + <block wx:if="{{item.status === '宸插彂甯�'}}"> + <button class="action-button execute-button" hover-class="execute-button-hover" bindtap="onExecute" data-id="{{item.id}}">绔嬪嵆鎵ц</button> + </block> + </view> + </view> + </block> + + <block wx:else> + <view class="empty-list"> + <image class="empty-icon" src="/images/no_more.svg" mode="aspectFit"></image> + <view class="empty-text">鏆傛棤杞亴璁板綍</view> + </view> + </block> + </view> + </scroll-view> + + <!-- 搴曢儴鏂板缓鎸夐挳 --> + <view class="bottom-button"> + <button class="add-button" hover-class="add-button-hover" bindtap="onAddIrrigation">鍒涘缓鐏屾簤璁″垝</button> + </view> +</view> \ No newline at end of file diff --git a/pages/irrigation/irrigation.wxss b/pages/irrigation/irrigation.wxss new file mode 100644 index 0000000..bf95b18 --- /dev/null +++ b/pages/irrigation/irrigation.wxss @@ -0,0 +1,396 @@ +.irrigation-container { + display: flex; + flex-direction: column; + height: 100vh; + background-color: #f5f5f5; + padding: 20rpx; + box-sizing: border-box; +} + +/* 椤堕儴鏍囩椤垫牱寮� */ +.tabs { + display: flex; + background-color: #fff; + border-radius: 12rpx; + margin-bottom: 20rpx; + overflow: hidden; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + position: relative; +} + +.tab { + flex: 1; + text-align: center; + padding: 30rpx 0; + font-size: 28rpx; + color: #666; + position: relative; + transition: all 0.2s ease; +} + +.tab-hover { + opacity: 0.8; + background-color: rgba(0, 0, 0, 0.03); +} + +.tab:active { + opacity: 0.8; + background-color: rgba(0, 0, 0, 0.03); +} + +.tab.active { + color: rgba(45, 139, 247, 1); + font-weight: bold; +} + +.tab.active::after { + content: ''; + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 50vw; + height: 6rpx; + background-color: rgba(45, 139, 247, 1); + border-radius: 3rpx; +} + +/* 鍒锋柊鎸夐挳鍜屽垎闅旂嚎 */ +.refresh-header { + display: flex; + justify-content: flex-end; + padding: 10rpx 20rpx; +} + +.refresh-button { + font-size: 28rpx; + color: #fff; + background-color: rgba(45, 139, 247, 1); + border: none; + border-radius: 5px; + padding: 10rpx 20rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.refresh-button:active { + background-color: #1a6fc7; +} + +.divider { + height: 1rpx; + background-color: #e0e0e0; + margin: 10rpx 0; +} + +/* 涓嬫媺鍒锋柊鍔ㄧ敾 */ +.refresh-view { + text-align: center; + padding: 30rpx; + display: flex; + justify-content: center; + align-items: center; +} + +.dot { + width: 20rpx; + height: 20rpx; + background-color: rgba(45, 139, 247, 1); + border-radius: 50%; + margin: 0 5px; + animation: blink 1.4s infinite both; +} + +.dot:nth-child(2) { + animation-delay: 0.2s; +} + +.dot:nth-child(3) { + animation-delay: 0.4s; +} + +@keyframes blink { + 0%, 80%, 100% { + opacity: 0; + } + 40% { + opacity: 1; + } +} + +/* scroll-view鏍峰紡 */ +.scroll-view { + flex: 1; + overflow-y: auto; + margin-bottom: 20rpx; + height: calc(100vh - 180rpx); /* 鍑忓幓椤堕儴鏍囩椤靛拰搴曢儴鎸夐挳鐨勯珮搴� */ +} + +.scroll-bg { + padding: 10rpx 0; + height: 100%; + display: flex; + flex-direction: column; +} + +/* 涓棿鍒楄〃鏍峰紡 */ +.irrigation-list { + flex: 1; + background-color: transparent; + margin-bottom: 20rpx; + overflow: hidden; + display: flex; + flex-direction: column; + padding: 0; +} + +.list-title { + font-size: 28rpx; + font-weight: bold; + color: #333; + padding: 20rpx; + background-color: #f8f8f8; + border-bottom: 1rpx solid #eee; +} + +.list-item { + padding: 30rpx; + padding-bottom: 90rpx; + position: relative; + background-color: #fff; + border-radius: 12rpx; + margin-bottom: 16rpx; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); +} + +.item-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10rpx; + margin-top: 10rpx; +} + +.item-title { + font-size: 28rpx; + font-weight: bold; + color: #333; +} + +.item-status { + font-size: 24rpx; + color: #999; + padding: 4rpx 12rpx; + border-radius: 20rpx; + + display: flex; + align-items: center; +} + +.status-icon { + width: 70rpx; + height: 70rpx; + +} + +.status-active { + color: #fff; + background-color: rgba(45, 139, 247, 1); +} + +.status-draft { + color: #fff; + background-color: #999; +} + +.status-published { + display: flex; + align-items: center; + justify-content: center; + color: #00AD45; + background-color: rgba(0, 173, 69, 0.1); +} + +.status-published-icon { + width: 34rpx; + height: 34rpx; + margin-right: 6rpx; +} + +.item-info { + font-size: 24rpx; + color: #666; + margin-right: 160rpx; +} + +.info-row { + display: flex; + margin-bottom: 8rpx; + align-items: flex-end; /* 娣诲姞搴曢儴瀵归綈 */ +} + +/* 缂栧彿琛屾牱寮� - 浣滀负鏍囬绐佸嚭鏄剧ず */ +.title-row { + margin-bottom: 10rpx; +} + +.title-row .info-label, +.title-row .info-value { + font-size: 26rpx; + font-weight: bold; + color: #333; +} + +.info-label { + color: #999; + width: 150rpx; + margin-right: 10rpx; /* 娣诲姞鍙充晶闂磋窛 */ +} + +/* 涓哄凡鐏屾簤鏃堕棿鍜岃疆缁勬坊鍔犵壒娈婃牱寮� */ +.info-row.irrigated-row { + margin-top: 12rpx; + margin-bottom: 12rpx; + align-items: center !important; /* 寮哄埗鍨傜洿灞呬腑瀵归綈 */ + display: flex; + justify-content: flex-start; /* 姘村钩鏂瑰悜璧风偣瀵归綈 */ + height: 50rpx; /* 鍥哄畾琛岄珮 */ +} + +.info-row.irrigated-row .info-label { + display: flex; + align-items: center; + height: 100%; /* 浣跨敤鐧惧垎姣旈珮搴� */ +} + +.info-value-time { + font-size: 30rpx; + font-weight: bold; + color: rgb(42, 130, 228); + display: flex; + align-items: center; + height: 100%; /* 浣跨敤涓巌nfo-label鐩稿悓鐨勯珮搴� */ +} + +/* 绌哄垪琛ㄥ鍣� */ +.empty-list { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: #fff; + border-radius: 12rpx; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + width: 100%; + height: calc(100vh - 250rpx); /* 鍑忓幓椤堕儴鏍囩椤点�佸簳閮ㄦ寜閽拰鍐呰竟璺濈殑楂樺害 */ + min-height: 500rpx; +} + +.empty-icon { + width: 200rpx; + height: 200rpx; + margin-bottom: 20rpx; +} + +.empty-text { + font-size: 28rpx; + color: #999; +} + +/* 搴曢儴鎸夐挳鏍峰紡 */ +.bottom-button { + padding: 20rpx 0; +} + +.add-button { + background-color: rgba(45, 139, 247, 1); + color: #fff; + font-size: 32rpx; + border-radius: 12rpx; + width: 100%; + transition: all 0.2s ease; +} + +.add-button-hover { + background-color: rgba(35, 110, 200, 1); + transform: scale(0.98); +} + +.add-button:active { + background-color: rgba(35, 110, 200, 1); + transform: scale(0.98); +} + +/* 鍒楄〃椤规搷浣滄寜閽� */ +.item-actions { + display: flex; + justify-content: flex-end; + align-items: center; + position: absolute; + bottom: 20rpx; + right: 30rpx; + z-index: 2; +} + +.action-button { + font-size: 24rpx; + padding: 6rpx 20rpx; + margin-left: 16rpx; + border-radius: 30rpx; + background-color: #fff; + line-height: 1.5; + min-height: auto; + box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1); + transition: all 0.2s ease; +} + +.action-button-hover { + transform: scale(0.95); + box-shadow: 0 1rpx 3rpx rgba(0, 0, 0, 0.1); +} + +.action-button:active { + transform: scale(0.95); + box-shadow: 0 1rpx 3rpx rgba(0, 0, 0, 0.1); +} + +.publish-button { + color: rgba(45, 139, 247, 1); + border: 1rpx solid rgba(45, 139, 247, 1); +} + +.publish-button-hover { + background-color: rgba(45, 139, 247, 0.1); +} + +.publish-button:active { + background-color: rgba(45, 139, 247, 0.1); +} + +.stop-button { + color: #f56c6c; + border: 1rpx solid #f56c6c; +} + +.stop-button-hover { + background-color: rgba(245, 108, 108, 0.1); +} + +.stop-button:active { + background-color: rgba(245, 108, 108, 0.1); +} + +.execute-button { + color: rgba(45, 139, 247, 1); + border: 1rpx solid rgba(45, 139, 247, 1); +} + +.execute-button-hover { + background-color: rgba(45, 139, 247, 0.1); +} + +.execute-button:active { + background-color: rgba(45, 139, 247, 0.1); +} \ No newline at end of file diff --git a/pages/waterIntake/waterIntake.js b/pages/waterIntake/waterIntake.js index 0be2824..7059ee3 100644 --- a/pages/waterIntake/waterIntake.js +++ b/pages/waterIntake/waterIntake.js @@ -26,7 +26,20 @@ }, showForceConfirm: false, forceIntakeId: "", //寮哄埗寮�闃�鐨勫彇姘村彛id - inputValue:"" + inputValue: "", + //浠ヤ笅涓哄紑闃�寮圭獥鐩稿叧 + isShowOpenTime: "false", + isOpenTiming: false, //鏄惁鏄鍒掑紑闃�鏃堕棿鏍峰紡鐨勫紑闃� + postMinutes: 0, //瀹氱亴婧夋椂闀跨殑鏃堕棿 + showForceConfirm: false, + showErrorDialog: false, //閿欒鎻愮ず + showDialog: false, + dialog_mode: false, + dialog_time: false, + dialog_water: false, + openTimeText: "", + openTime: "", + irrigateProfile: [], //鑾峰彇鎵�閫夌亴婧夋柟寮忕殑璇︾粏鏁版嵁 }, // 鍒囨崲 Tabs @@ -78,7 +91,7 @@ */ postOpenValva(intakeId, isforce) { this.setData({ - inputValue:"" + inputValue: "" }) console.log("intakeId:" + intakeId + " isforce:" + isforce) wx.showLoading({ @@ -200,12 +213,12 @@ title: '娌℃湁鎼滅储鍒板彇姘村彛', icon: 'error', }) - }else{ + } else { this.setData({ - allWaterPoints:[data.content] + allWaterPoints: [data.content] }); } - + } else { wx.showToast({ title: data.msg, @@ -294,10 +307,238 @@ confirmForceDialog() { this.postOpenValva(this.data.forceIntakeId, true); }, - closeSearch(){ + closeSearch() { this.setData({ - allWaterPoints:[], - inputValue:"" + allWaterPoints: [], + inputValue: "" }) - } + }, + + //浠ヤ笅涓哄畾鏃跺畾閲忕浉鍏充唬鐮� + //鍒濆鍖栨墍鏈夊紑娉电殑鍙傛暟 + initDialogData() { + this.setData({ + isShowOpenTime: "false", + isOpenTiming: false, //鏄惁鏄鍒掑紑闃�鏃堕棿鏍峰紡鐨勫紑闃� + postMinutes: 0, //瀹氱亴婧夋椂闀跨殑鏃堕棿 + showForceConfirm: false, + showErrorDialog: false, //閿欒鎻愮ず + showDialog: true, + dialog_mode: true, + dialog_time: false, + dialog_water: false, + openTimeText: "", + openTime: "" + }) + }, + handleClost() { + this.setData({ + showDialog: false + }) + }, + handleSetDuration() { + this.getIrrigateProfileData(1); + }, + //鑾峰彇甯哥敤鐢ㄦ按鏃堕暱鍙婄敤姘撮噺 + getIrrigateProfileData(type) { + get({ + url: 'wx/valve/irrigate_profile', + data: { + type: type + } + }) + .then((data) => { + if (data.success && data.code === "0001") { + const items = data.content.obj.map(item => { + return { + defaultValue: item.defaultValue, + unit: item.unit, + unitText: item.unit === "1" ? "灏忔椂" : item.unit === "2" ? "鍒嗛挓" : "绔嬫柟绫�" + }; + }); + this.setData({ + dialog_mode: false, + dialog_time: type === 1, + dialog_water: type === 2, + irrigateProfile: items + }); + } else { + wx.showToast({ + title: data.msg, + }) + } + console.log('Failed to add item:'); + }) + .catch((error) => { + console.error('Failed to add item:', error); + }); + }, + handleSetWaterVolume() { + this.getIrrigateProfileData(2); + }, + dialogBack() { + this.setData({ + dialog_time: false, + dialog_water: false, + dialog_mode: true, + group_time: false, + activeIndex: -1 + }) + }, + //閫夋嫨鏃堕棿鍚庣殑澶勭悊 + handleTimeWrapperTap(e) { + const index = e.currentTarget.dataset.index; + console.log(index) + if (index !== undefined) { + let minutes; + if (this.data.irrigateProfile[index].unit === "1") { + minutes = this.hourToMinutes(this.data.irrigateProfile[index].defaultValue) + } else { + minutes = this.data.irrigateProfile[index].defaultValue; + } + this.setData({ + activeIndex: parseInt(index), + postMinutes: minutes, + costiomTime: "", + group_time: false, + }); + } + }, + onTimeInputChange(data) { + console.log(data.detail.value) + if (data.detail.value !== "") { + this.setData({ + group_time: true, + activeIndex: -1, + postMinutes: parseInt(data.detail.value) + }) + } else { + this.setData({ + group_time: false, + postMinutes: 0, + }) + } + + }, + //瀹氱亴婧夋椂闀胯嚜瀹氫箟杈撳叆鏃堕棿鏃朵慨鏀规椂闂村崟浣�0锛氬垎閽燂紝1锛氬皬鏃� + onGroupOpenTimeTypeChange(event) { + let value = event.detail.value; + if (value === "1") { + this.setData({ + postMinutes: this.hourToMinutes(this.data.postMinutes) + }) + } else { + this.setData({ + postMinutes: this.minutesToHours(this.data.postMinutes) + }) + } + }, + onGroupOpenTimeChange(event) { + const { + value + } = event.detail; + console.log('onGroupOpenTimeChange:' + value); + if (value == 1) { + this.showPicker(); + this.setData({ + isOpenTiming: true, + radioValue: value, + dateStartTime: new Date().getTime() + }) + } else { + this.setData({ + isShowOpenTime: false, + isOpenTiming: false, + radioValue: value, + }) + } + }, + //瀹氭椂寮�娉垫寜閽� + btnOpenOnTime() { + if (this.data.postMinutes > 0) { + if (this.data.isOpenTiming) { + this.timeClosePlaned(); + } else { + this.timeClose(); + } + } else { + wx.showToast({ + icon: 'error', + title: '璇烽�夋嫨鎴栬緭鍏ョ亴婧夋椂闂达紒', + }) + } + }, + //瀹氭椂鍏抽榾寮忚鍒掑紑闃� + timeClosePlaned() { + const app = getApp(); + wx.showLoading({ + title: '姝e湪閫氫俊璇风◢鍊�...', // 鍔犺浇鎻愮ず鏂囧瓧 + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛岄槻姝㈣Е鎽哥┛閫忥紝榛樿涓� false + }); + const data = { + intakeId: this.data.intakeId, //鍙栨按鍙D + // vcId: this.data.vcId, //铏氭嫙鍗D + minutes: this.data.postMinutes, //鍒嗛挓 + operator: app.globalData.clientId, //鎿嶄綔鍛� + plannedOpenTime: this.data.openTime + }; + post({ + url: "wx/valve/planed_open_timed_close", + data: data + }).then(response => { + // 澶勭悊鎴愬姛鍝嶅簲 + console.log('璇锋眰鎴愬姛:', response); + // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢� + wx.hideLoading(); + //瀹屾垚鍚庡洖鍒伴椤� + wx.reLaunch({ + url: '/pages/home/home?param=2' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓 + }); + }).catch(error => { + // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢� + wx.hideLoading(); + // 澶勭悊閿欒鍝嶅簲 + console.error('璇锋眰澶辫触:', error); + this.setData({ + showErrorDialog: true, + errorData: error.msg + }) + }); + }, + //瀹氭椂鍏抽榾寮忓紑闃� + timeClose() { + const app = getApp(); + wx.showLoading({ + title: '姝e湪寮�闃�璇风◢鍊�...', // 鍔犺浇鎻愮ず鏂囧瓧 + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛岄槻姝㈣Е鎽哥┛閫忥紝榛樿涓� false + }); + const data = { + intakeId: this.data.intakeId, //鍙栨按鍙D + // vcId: this.data.vcId, //铏氭嫙鍗D + minutes: this.data.postMinutes, //鍒嗛挓 + operator: app.globalData.clientId //鎿嶄綔鍛� + }; + post({ + url: "wx/valve/timed_close", + data: data + }).then(response => { + // 澶勭悊鎴愬姛鍝嶅簲 + console.log('璇锋眰鎴愬姛:', response); + // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢� + wx.hideLoading(); + //瀹屾垚鍚庡洖鍒伴椤� + wx.reLaunch({ + url: '/pages/home/home?param=1' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓 + }); + }).catch(error => { + // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢� + wx.hideLoading(); + // 澶勭悊閿欒鍝嶅簲 + console.error('璇锋眰澶辫触:', error); + this.setData({ + showErrorDialog: true, + errorData: error.msg + }) + }); + }, }) \ No newline at end of file diff --git a/pages/waterIntake/waterIntake.wxml b/pages/waterIntake/waterIntake.wxml index bc6680e..65c35d8 100644 --- a/pages/waterIntake/waterIntake.wxml +++ b/pages/waterIntake/waterIntake.wxml @@ -1,9 +1,4 @@ <view class="container"> - - - - - <view class="all-waterIntake" wx:if="{{currentTab === 0}}"> <view class="search-container"> <input class="search-input" value="{{inputValue}}" placeholder="璇疯緭鍏ュ彇姘村彛缂栫爜鍚庣偣鍑绘悳绱�" bindinput="onInput" /> @@ -20,7 +15,8 @@ <block wx:for="{{commonWaterPoints}}" wx:key="index"> <view class="item"> <view class="item-left"> - <text>{{item.intakeNum}}</text> + <image class="item-img-left" src="/images/valve.svg" /> + <text class="water-intake-name">{{item.intakeNum}}</text> <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" /> </view> <text class="item-button" bindtap="choseCard" data-item="{{item}}">寮�闃�</text> @@ -38,6 +34,115 @@ <t-dialog class="error-dialog" title="寮�闃�閿欒" visible="{{showErrorDialog}}" content="{{errorData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="closeErrorDialog" /> <t-dialog visible="{{showForceConfirm}}" content="褰撳墠铏氭嫙鍗¤鍗犵敤锛屾槸鍚﹀己鍒跺紑闃�锛�" confirm-btn="{{ { content: '寮哄埗寮�闃�', variant: 'base', theme: 'danger' } }}" cancel-btn="鍙栨秷" bind:confirm="confirmForceDialog" bind:cancel="cancelDialog" /> - +<!-- 榛戣壊钂欏眰 --> +<view class="overlay" wx:if="{{showDialog}}" bindtap="closeDialog"></view> + <!-- 閫夋嫨鐏屾簤妯″紡 --> + <view class="dialog" wx:if="{{showDialog}}"> + <image class="close" src="/images/close.svg" bindtap="handleClost"></image> + <view class="dialog-content" wx:if="{{dialog_mode}}"> + <view class="dialog-title">璇烽�夋嫨寮�鍏抽榾鏂瑰紡</view> + <button bindtap="postOpenValva">鎵嬪姩寮�闃�鎵嬪姩鍏抽榾</button> + <button bindtap="handleSetDuration">寮�闃�鍚庡畾鏃堕暱鑷姩鍏抽榾</button> + <button bindtap="handleSetWaterVolume">寮�闃�鍚庡畾姘撮噺鑷姩鍏抽榾</button> + </view> + <view class="dialog-content" wx:if="{{dialog_time}}"> + <view class="dialog-title"> + <image class="dialog-title-img" bind:tap="dialogBack" src="/images/back.svg"></image> + <text class="dialog-title-text">寮�闃�鍚庡畾鏃堕暱鑷姩鍏抽榾</text> + </view> + <view> + <view class="row"> + <view class="choseitem{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="0"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[0].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[0].unitText}}</text> + </view> + </view> + <view class="choseitem{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="1"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[1].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[1].unitText}}</text> + </view> + </view> + </view> + <view class="row"> + <view class="choseitem{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="2"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[2].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[2].unitText}}</text> + </view> + </view> + <view class="choseitem{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleTimeWrapperTap" data-index="3"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[3].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[3].unitText}}</text> + </view> + </view> + </view> + <view> + <t-input label="" value="{{costiomTime}}" placeholder="鎴栧湪姝よ緭鍏ヨ嚜瀹氫箟鏃堕棿" type="number" bind:change="onTimeInputChange"> + </t-input> + <t-radio-group bind:change="onGroupOpenTimeTypeChange" wx:if="{{group_time}}" default-value="0" borderless t-class="box"> + <t-radio block="{{false}}" label="鍒嗛挓" value="0" /> + <t-radio block="{{false}}" label="灏忔椂" value="1" /> + </t-radio-group> + <t-radio-group bind:change="onGroupOpenTimeChange" value="{{radioValue}}" default-value="0" borderless t-class="box"> + <t-radio block="{{false}}" label="鐜板湪寮�闃�" value="0" /> + <t-radio block="{{false}}" label="璁″垝寮�闃�鏃堕棿" value="1" /> + </t-radio-group> + <text class="open-time" wx:if="{{isShowOpenTime}}">{{openTimeText}}</text> + <button bindtap="btnOpenOnTime">寮�闃�</button> + </view> + </view> + </view> + <view class="dialog-content" wx:if="{{dialog_water}}"> + <view class="dialog-title"> + <image class="dialog-title-img" bind:tap="dialogBack" src="/images/back.svg"/> + <text class="dialog-title-text">寮�闃�鍚庡畾姘撮噺鑷姩鍏抽榾</text> + </view> + <view> + <view class="row"> + <view class="choseitem{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="0"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[0].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[0].unitText}}</text> + </view> + </view> + <view class="choseitem{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="1"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[1].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[1].unitText}}</text> + </view> + </view> + </view> + <view class="row"> + <view class="choseitem{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="2"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[2].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[2].unitText}}</text> + </view> + </view> + <view class="choseitem{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleWaterWrapperTap" data-index="3"> + <view class="chose-wrapper"> + <text class="chose-number">{{irrigateProfile[3].defaultValue}}</text> + <text class="chose-label">{{irrigateProfile[3].unitText}}</text> + </view> + </view> + </view> + <view> + <t-input label="" value="{{costiomWater}}" suffix="绔嬫柟绫�" align="right" type="number" placeholder="鎴栧湪姝よ緭鍏ヨ嚜瀹氫箟姘撮噺" bind:change="onWaterInputChange"> + </t-input> + <t-radio-group bind:change="onGroupOpenTimeChange" value="{{radioValue}}" default-value="0" borderless t-class="box"> + <t-radio block="{{false}}" label="鐜板湪寮�闃�" value="0" /> + <t-radio block="{{false}}" label="璁″垝寮�闃�鏃堕棿" value="1" /> + </t-radio-group> + <text class="open-time" wx:if="{{isShowOpenTime}}">{{openTimeText}}</text> + <button bindtap="btnOpenOnWater">寮�闃�</button> + </view> + </view> + </view> + </view> + <!-- 骞存湀鏃ユ椂鍒� --> + <t-date-time-picker title="閫夋嫨鏃ユ湡鍜屾椂闂�" visible="{{datetimeVisible}}" mode="minute" value="{{datetime}}" format="YYYY-MM-DD HH:mm" bindchange="onConfirm" bindpick="onColumnChange" bindcancel="hidePicker" start="{{dateStartTime}}" end="{{dateEndTime}}"/> </view> diff --git a/pages/waterIntake/waterIntake.wxss b/pages/waterIntake/waterIntake.wxss index 56c304a..948121e 100644 --- a/pages/waterIntake/waterIntake.wxss +++ b/pages/waterIntake/waterIntake.wxss @@ -161,4 +161,22 @@ .result-item { padding: 20rpx; border-bottom: 1px solid #eaeaea; +} + +.item-img-left { + width: 40rpx; + /* 鏍规嵁闇�瑕佽皟鏁村浘鏍囧ぇ灏� */ + height: 40rpx; + /* 鏍规嵁闇�瑕佽皟鏁村浘鏍囧ぇ灏� */ + +} + +.item-img { + width: 40rpx; + height: 40rpx; + margin-left: 20rpx; +} +.water-intake-name { + font-size: 50rpx !important; + margin-left: 15rpx; } \ No newline at end of file -- Gitblit v1.8.0