管灌系统农户端微信小程序(嘉峪关应用)
zuoxiao
2024-05-27 dc01187c6ca2cf46fef268e84a7ac7fc171f2ebb
开泵相关

开泵相关界面
通信相关
数据持久化相关
17个文件已修改
42个文件已添加
1个文件已删除
2182 ■■■■■ 已修改文件
app.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.json 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/balance.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/pipeline.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/question.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/record.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/record_blue.png 补丁 | 查看 | 原始文档 | blame | 历史
images/record_grey.png 补丁 | 查看 | 原始文档 | blame | 历史
images/valva.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/wallet.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/water_intake_blue.png 补丁 | 查看 | 原始文档 | blame | 历史
images/water_intake_grey.png 补丁 | 查看 | 原始文档 | blame | 历史
images/wifi_no.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
images/wifi_off.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/feedback/feedback.js 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/feedback/feedback.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/feedback/feedback.wxml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/feedback/feedback.wxss 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.js 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxss 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.js 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.wxml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.wxss 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/my/my.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/my/my.wxml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/my/my.wxss 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/openCard/openCard.js 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/openCard/openCard.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/openCard/openCard.wxml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/openCard/openCard.wxss 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personCharge/personcharge.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personCharge/personcharge.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personCharge/personcharge.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personCharge/personcharge.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/recharge/recharge.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/recharge/recharge.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/recharge/recharge.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.js 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.wxml 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.wxss 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wallet/wallet.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wallet/wallet.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/waterIntake/waterIntake.js 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/waterIntake/waterIntake.json 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/waterIntake/waterIntake.wxml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/waterIntake/waterIntake.wxss 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxbind/wxbind.js 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxbind/wxbind.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxbind/wxbind.wxml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxbind/wxbind.wxss 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxlogin/wxlogin.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxlogin/wxlogin.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxlogin/wxlogin.wxml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wxlogin/wxlogin.wxss 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
project.config.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/storage.js 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.js
@@ -14,6 +14,9 @@
    })
  },
  globalData: {
    userInfo: null
    userInfo: null,
    userId:"",
    userCode:"",
    token:""
  }
})
app.json
@@ -1,45 +1,27 @@
{
  "pages": [
    "pages/home/home",
    "pages/wxlogin/wxlogin",
    "pages/login/login",
    "pages/wxbind/wxbind",
    "pages/rechargeList/rechargeList",
    "pages/wallet/wallet",
    "pages/home/home",
    "pages/login/login",
    "pages/index/index",
    "pages/logs/logs",
    "pages/my/my",
    "pages/recharge/recharge"
    "pages/recharge/recharge",
    "pages/waterIntake/waterIntake",
    "pages/personCharge/personcharge",
    "pages/feedback/feedback",
    "pages/openCard/openCard",
    "pages/rechargeMoney/rechargMoney"
  ],
  "window": {
    "navigationBarTextStyle": "black",
    "navigationBarTitleText": "电子钱包",
    "navigationBarTextStyle": "white",
    "navigationBarTitleText": "大禹节水",
    "navigationBarBackgroundColor": "#1890FF"
  },
  "componentFramework": "glass-easel",
  "sitemapLocation": "sitemap.json",
  "lazyCodeLoading": "requiredComponents",
  "tabBar": {
    "color": "#000000",
    "selectedColor": "#2D8BF7",
    "list": [
      {
        "pagePath": "pages/home/home",
        "text": "首页",
        "iconPath": "/images/home_grey.png",
        "selectedIconPath": "/images/home_blue.png"
      },
      {
        "pagePath": "pages/wallet/wallet",
        "text": "电子钱包",
        "iconPath": "/images/wallet_grey.png",
        "selectedIconPath": "/images/wallet_blue.png"
      },
      {
        "pagePath": "pages/my/my",
        "text": "个人中心",
        "iconPath": "/images/my_grey.png",
        "selectedIconPath": "/images/my_blue.png"
      }
    ]
  }
  "lazyCodeLoading": "requiredComponents"
}
images/balance.svg
New file
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="29" height="29" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19 16L24 22L29 16" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 13.9999C9 13.9999 16.5 2.49984 29.5 6.99986C42.5 11.4999 42 24.4999 42 24.4999" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M39 34C39 34 33 45 19.5 41.5C6 38 6 24 6 24" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 8V24" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 24L6 40" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M18 28H30" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M18 22H30" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 22V34" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
images/pipeline.svg
New file
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#1890FF"><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M12,8c-2.21,0-4,1.79-4,4c0,2.21,1.79,4,4,4c2.21,0,4-1.79,4-4C16,9.79,14.21,8,12,8z M12,14c-1.1,0-2-0.9-2-2 c0-1.1,0.9-2,2-2s2,0.9,2,2C14,13.1,13.1,14,12,14z"/><path d="M22,7.47V5.35C20.05,4.77,16.56,4,12,4C9.85,4,7.89,4.86,6.46,6.24C6.59,5.39,6.86,3.84,7.47,2H5.35 C4.77,3.95,4,7.44,4,12c0,2.15,0.86,4.11,2.24,5.54c-0.85-0.14-2.4-0.4-4.24-1.01v2.12C3.95,19.23,7.44,20,12,20 c2.15,0,4.11-0.86,5.54-2.24c-0.14,0.85-0.4,2.4-1.01,4.24h2.12C19.23,20.05,20,16.56,20,12c0-2.15-0.86-4.11-2.24-5.54 C18.61,6.59,20.16,6.86,22,7.47z M12,18c-3.31,0-6-2.69-6-6s2.69-6,6-6s6,2.69,6,6S15.31,18,12,18z"/></g></g></svg>
images/question.svg
New file
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="70.80000305175781" height="75.00926971435547" viewBox="0 0 70.80000305175781 75.00926971435547"><g><path d="M32.3,0.00927001C34.05,0.00927001,35.4,1.40927,35.4,3.10927C35.4,4.80927,34,6.20927,32.3,6.20927L12.15,6.20927C8.85,6.40927,6.25,9.15927,6.25,12.4593L6.25,62.8093C6.45,66.1093,9.2,68.7093,12.5,68.7093L58.7,68.7093C62,68.5093,64.6,65.7593,64.6,62.4593L64.6,28.1093C64.6,26.3593,66,25.0093,67.7,25.0093C69.45,25.0093,70.8,26.4093,70.8,28.1093L70.8,62.5093C70.8,69.4093,65.2,75.0093,58.3,75.0093L12.5,75.0093C5.6,75.0093,0,69.4093,0,62.5093L0,12.5093C0,5.60927,5.6,0.00927001,12.5,0.00927001L32.3,0.00927001ZM42.7,52.1093C44.45,52.1093,45.8,53.5093,45.8,55.2093C45.8,56.9593,44.4,58.3093,42.7,58.3093L19.8,58.3093C18.05,58.3093,16.7,56.9093,16.7,55.2093C16.7,53.4593,18.1,52.1093,19.8,52.1093L42.7,52.1093ZM30.2,37.5093C31.95,37.5093,33.3,38.9093,33.3,40.6093C33.3,42.3093,31.9,43.7093,30.2,43.7093L19.8,43.7093C18.05,43.7093,16.7,42.3093,16.7,40.6093C16.7,38.9093,18.1,37.5093,19.8,37.5093L30.2,37.5093ZM51.45,6.30927L61.75,12.1593L49.9,32.4593L43.2,35.2593C42.2,35.7093,41.05,35.2093,40.6,34.2093C40.55,34.0593,40.5,33.8593,40.45,33.6593L39.6,26.5593L51.45,6.30927ZM61.6,0.809269C64.4,2.35927,65.4,5.90927,63.85,8.70927C63.85,8.75927,63.8,8.75927,63.8,8.80927L62.8,10.5093L52.5,4.65927L53.5,2.95927C55.1,0.109269,58.75,-0.840731,61.6,0.809269Z" fill="#4090FF" fill-opacity="1"/></g></svg>
images/record.svg
New file
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="93.75" height="93.75" viewBox="0 0 93.75 93.75"><g><path d="M46.875,93.75C21.25,93.75,0,72.5,0,46.875C0,21.25,21.25,0,46.875,0C72.5,0,93.75,21.25,93.75,46.875C93.75,72.5,72.5,93.75,46.875,93.75ZM15.7684,20.6928C9.82413,27.7548,6.25,36.8835,6.25,46.875C6.25,57.5031,10.2942,67.1551,16.9333,74.3817L23.1658,67.2327Q22.7143,66.7069,22.2866,66.1617Q21.859,65.6164,21.4559,65.0527Q21.0528,64.4891,20.6751,63.9081Q20.2973,63.3271,19.9458,62.7299Q19.5942,62.1328,19.2694,61.5206Q18.9446,60.9084,18.6473,60.2825Q18.35,59.6565,18.0807,59.018Q17.8115,58.3795,17.5708,57.7297Q17.3301,57.0799,17.1184,56.42Q16.9067,55.7602,16.7245,55.0916Q16.5423,54.423,16.3899,53.747Q16.2376,53.0709,16.1153,52.3889Q15.993,51.7067,15.9011,51.0199Q15.8092,50.333,15.7478,49.6428Q15.6864,48.9526,15.6557,48.2603Q15.625,47.568,15.625,46.875Q15.625,45.5497,15.7372,44.2292Q15.8494,42.9086,16.073,41.6024Q16.2966,40.2961,16.63,39.0134Q16.9634,37.7307,17.4042,36.4809Q17.8451,35.2311,18.3901,34.023Q18.9351,32.815,19.5805,31.6575Q20.2259,30.4999,20.9669,29.4012Q21.708,28.3025,22.5394,27.2704L15.7684,20.6928ZM20.0612,16.3112L26.7326,22.9826Q27.7792,22.1003,28.899,21.3128Q30.0188,20.5254,31.2031,19.8388Q32.3874,19.1523,33.6273,18.572Q34.8671,17.9917,36.1529,17.522Q37.4388,17.0523,38.7607,16.6968Q40.0827,16.3414,41.4307,16.1029Q42.7787,15.8644,44.1424,15.7447Q45.5061,15.625,46.875,15.625Q48.112,15.625,49.3452,15.7228Q50.5784,15.8206,51.7999,16.0155Q53.0215,16.2105,54.2239,16.5014Q55.4262,16.7923,56.6018,17.1773Q57.7774,17.5624,58.9189,18.0391Q60.0603,18.5159,61.1605,19.0814Q62.2608,19.6469,63.3128,20.2976Q64.3649,20.9483,65.3622,21.6801L71.5618,14.5688C64.7277,9.34659,56.1751,6.25,46.875,6.25C36.583,6.25,27.2064,10.0424,20.0612,16.3112ZM76.4469,18.9711L70.144,26.0155Q70.6205,26.5471,71.0722,27.0998Q71.5239,27.6526,71.9499,28.2253Q72.376,28.7981,72.7754,29.3898Q73.1748,29.9814,73.5468,30.5907Q73.9188,31.1999,74.2625,31.8256Q74.6063,32.4512,74.9212,33.0918Q75.236,33.7325,75.5213,34.3869Q75.8065,35.0412,76.0616,35.7079Q76.3167,36.3746,76.5411,37.0523Q76.7655,37.73,76.9587,38.4172Q77.1519,39.1044,77.3135,39.7997Q77.4751,40.495,77.6048,41.197Q77.7345,41.8989,77.832,42.6061Q77.9296,43.3132,77.9947,44.0241Q78.0598,44.735,78.0924,45.4481Q78.125,46.1612,78.125,46.875Q78.125,48.2161,78.0101,49.5523Q77.8952,50.8885,77.6662,52.21Q77.4373,53.5314,77.0959,54.8284Q76.7546,56.1254,76.3034,57.3883Q75.8522,58.6513,75.2945,59.871Q74.7367,61.0906,74.0766,62.258Q73.4164,63.4254,72.6586,64.532Q71.9008,65.6385,71.051,66.676L77.7292,73.3542C83.8245,66.2521,87.5,57.0071,87.5,46.875C87.5,36.0509,83.3054,26.2393,76.4469,18.9711ZM73.3542,77.7292L66.676,71.051Q65.6385,71.9008,64.532,72.6586Q63.4254,73.4164,62.258,74.0766Q61.0906,74.7367,59.871,75.2945Q58.6513,75.8522,57.3884,76.3034Q56.1254,76.7546,54.8284,77.0959Q53.5314,77.4373,52.21,77.6662Q50.8885,77.8952,49.5523,78.0101Q48.2161,78.125,46.875,78.125Q45.6084,78.125,44.3459,78.0225Q43.0835,77.92,41.8334,77.7156Q40.5834,77.5113,39.354,77.2065Q38.1247,76.9016,36.924,76.4983Q35.7233,76.095,34.5592,75.5958Q33.3951,75.0966,32.2752,74.5048Q31.1553,73.9131,30.087,73.2327Q29.0187,72.5522,28.0089,71.7875L21.8149,78.8925C28.7097,84.2891,37.4048,87.5,46.875,87.5C57.0071,87.5,66.2521,83.8245,73.3542,77.7292Z" fill-rule="evenodd" fill="#2D8DFE" fill-opacity="1"/></g></svg>
images/record_blue.png
images/record_grey.png
images/valva.svg
New file
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="100" height="100" viewBox="0 0 100 100"><g><path d="M50,0C77.6146,0,100,22.3854,100,50C100,77.6146,77.6146,100,50,100C22.3854,100,0,77.6146,0,50C0,22.3854,22.3854,0,50,0ZM50,1.93542C23.3979,1.93542,1.83333,23.5,1.83333,50.1021C1.83333,76.7042,23.3979,98.2687,50,98.2687C76.6021,98.2687,98.1667,76.7042,98.1667,50.1021C98.1667,23.5,76.6021,1.93542,50,1.93542ZM55.5062,91.8521L52.5646,97.4938L51.4208,97.5729L54.3646,91.9312L55.5062,91.8521ZM47.8771,92.0854L49.0208,92.1646L45.3208,97.3417L44.1771,97.2604L47.8771,92.0854ZM61.8187,90.5187L59.7937,96.5521L58.6792,96.8083L60.7042,90.7771L61.8187,90.5187ZM41.4875,91.2687L42.6042,91.5271L38.1396,96.0604L37.0229,95.8021L41.4875,91.2687ZM67.8542,88.2417L66.7979,94.5167L65.7354,94.9458L66.7917,88.6708L67.8542,88.2417ZM35.2958,89.4896L36.3583,89.9187L31.2396,93.6979L30.1771,93.2688L35.2958,89.4896ZM73.4687,85.0708L73.4062,91.4333L72.4271,92.0229L72.4896,85.6604L73.4687,85.0708ZM50.1667,8.33333C73.1771,8.33333,91.8333,26.9875,91.8333,50C91.8333,73.0125,73.1771,91.6667,50.1667,91.6667C27.1542,91.6667,8.5,73.0125,8.5,50C8.5,26.9875,27.1542,8.33333,50.1667,8.33333ZM29.4479,86.7854L30.4292,87.375L24.7833,90.3083L23.8,89.7188L29.4458,86.7854L29.4479,86.7854ZM50.2604,10C28.1688,10,10.2604,27.9083,10.2604,50C10.2604,72.0917,28.1688,90,50.2604,90C72.35,90,90.2604,72.0917,90.2604,50C90.2604,27.9083,72.35,10,50.2604,10ZM50.0521,11.6667C71.225,11.6667,88.3854,28.8292,88.3854,50C88.3854,71.1708,71.225,88.3333,50.0521,88.3333C28.8833,88.3333,11.7188,71.1708,11.7188,50C11.7188,28.8292,28.8833,11.6667,50.0521,11.6667ZM78.5354,81.0833L79.4687,87.375L78.5917,88.1125L77.6583,81.8187L78.5333,81.0812L78.5354,81.0833ZM24.0771,83.2229L24.9562,83.9583L18.9208,85.9708L18.0437,85.2354L24.0792,83.2229L24.0771,83.2229ZM82.9937,76.3583L84.7937,82.4625L84.0271,83.3125L82.2271,77.2083L82.9917,76.3583L82.9937,76.3583ZM19.2958,78.8333L20.0625,79.6854L13.8042,80.8375L13.0396,79.9875L19.2958,78.8333ZM86.6146,71.0208L89.3479,76.7688L88.7229,77.7271L85.9917,71.9833L86.6167,71.0229L86.6146,71.0208ZM15.2583,73.8167L15.8833,74.7771L9.52292,74.9375L8.89792,73.9792L15.2583,73.8167ZM58.6208,38.4917L39.0208,38.4917C38.4417,38.4917,37.675,38.8583,37.3083,39.3083L32.5167,45.2521C32.0769,45.7385,31.4631,46.0319,30.8083,46.0688L29.7458,46.0688C29.1644,46.0699,28.6937,46.5415,28.6937,47.1229L28.6937,52.1354C28.6926,52.716,28.2222,53.1864,27.6417,53.1875L25.55,53.1875C24.9694,53.1864,24.4991,52.716,24.4979,52.1354L24.4979,46.3542C24.4979,45.772,24.0259,45.3,23.4437,45.3L21.0521,45.3C20.4707,45.3011,20,45.7728,20,46.3542L20,65.6042C20,66.1833,20.4729,66.6562,21.0521,66.6562L23.4437,66.6562C24.0251,66.6562,24.4968,66.1855,24.4979,65.6042L24.4979,59.825C24.4979,59.2437,24.9708,58.7708,25.55,58.7708L27.6417,58.7708C28.2208,58.7708,28.6937,59.2437,28.6937,59.825L28.6937,64.8229C28.6937,65.4104,29.1667,65.8833,29.7458,65.8833L32.7896,65.8833C33.3708,65.8833,34.1646,66.2187,34.5667,66.65L39.8292,72.2562C40.2312,72.6854,41.0187,73.0292,41.5917,73.0292L62.375,73.0292C62.9542,73.0292,63.7417,72.6729,64.1292,72.2417L69.9375,65.7833C70.3229,65.3521,71.1104,64.9958,71.6917,64.9958L74.0042,64.9958C74.5854,64.9958,75.0583,65.375,75.0583,65.825C75.0583,66.2917,75.5292,66.6562,76.1104,66.6562L78.5021,66.6562C79.0826,66.6551,79.553,66.1847,79.5542,65.6042L79.5542,46.3542C79.5542,45.7728,79.0835,45.3011,78.5021,45.3L76.1104,45.3C75.529,45.3011,75.0583,45.7728,75.0583,46.3542L75.0583,47.3854C75.0572,47.9668,74.5855,48.4375,74.0042,48.4375L71.6917,48.4375C71.1111,48.4363,70.6407,47.966,70.6396,47.3854L70.6396,44.9937C70.6396,44.4115,70.1676,43.9396,69.5854,43.9396L65.5104,43.9396C64.9312,43.9396,64.1562,43.5812,63.7708,43.1521L60.375,39.2771C59.9073,38.8074,59.2826,38.527,58.6208,38.4896L58.6208,38.4917ZM89.3854,65.2L92.9833,70.4479L92.5187,71.4938L88.9187,66.2458L89.3854,65.2ZM5.725,67.4021L12.0312,68.2396L12.4979,69.2854L6.18958,68.45L5.725,67.4021ZM49.9708,45.7875Q56.5958,56.2792,56.5958,59.6229C56.5958,62.9688,53.6312,65.6833,49.9771,65.6833C46.3187,65.6833,43.3604,62.9688,43.3604,59.6229Q43.3604,56.2792,49.9708,45.7896L49.9708,45.7875ZM91.2333,59.0208L95.6083,63.6396L95.3125,64.7458L90.9375,60.1271L91.2333,59.0208ZM3.59167,60.4229L9.69167,62.2354L9.9875,63.3417L3.88959,61.5292L3.59167,60.425L3.59167,60.4229ZM92.1625,52.5917L97.1375,56.5583L96.9979,57.6937L92.0229,53.7292L92.1625,52.5917ZM2.51875,53.2521L8.30625,55.8979L8.44583,57.0333L2.65833,54.3875L2.51875,53.2521ZM2.58958,45.9521L7.89167,49.4688L7.85,50.6146L2.54792,47.0958L2.58958,45.95L2.58958,45.9521ZM92.0563,46.1396L97.5896,49.2792L97.6312,50.425L92.0958,47.2854L92.0542,46.1396L92.0563,46.1396ZM3.77083,38.75L8.45833,43.0542L8.23958,44.1792L3.55208,39.875L3.77083,38.75ZM90.9646,39.7854L96.9229,42.0187L97.1417,43.1437L91.1833,40.9083L90.9646,39.7833L90.9646,39.7854ZM6.04375,31.8125L10.0021,36.7958L9.60833,37.8708L5.65208,32.8875L6.04375,31.8125ZM88.9229,33.6667L95.1562,34.9417L95.5479,36.0167L89.3146,34.7417L88.9229,33.6667ZM58.7792,26.6667L39.5146,26.6667C38.934,26.6678,38.4636,27.1382,38.4625,27.7188L38.4625,30.1104C38.4625,30.6917,38.9354,31.1646,39.5146,31.1646L45.3021,31.1646C45.8813,31.1646,46.3542,31.6375,46.3542,32.2167L46.3542,34.0146C46.3542,34.5938,46.8271,35.0667,47.4063,35.0667L50.9021,35.0667C51.4827,35.0655,51.953,34.5952,51.9542,34.0146L51.9542,32.2167C51.9542,31.6375,52.4271,31.1646,53.0062,31.1646L58.7792,31.1646C59.3605,31.1634,59.8312,30.6918,59.8312,30.1104L59.8312,27.7188C59.8301,27.1382,59.3597,26.6678,58.7792,26.6667ZM9.35,25.3063L12.475,30.8479L11.9208,31.8479L8.79375,26.3063L9.35,25.3063ZM85.9708,27.9333L92.3271,28.2188L92.8833,29.2188L86.5271,28.9354L85.9708,27.9354L85.9708,27.9333ZM13.5479,19.3958L15.875,25.3187L15.1875,26.2333L12.8604,20.3104L13.5479,19.3958ZM88.5188,22.0542L89.2062,22.9708L82.8729,23.575L82.1854,22.6583L88.5188,22.0542ZM18.6604,14.1833L20.0333,20.3979L19.2083,21.1938L17.8375,14.9792L18.6604,14.1833ZM83.7958,16.4958L84.6208,17.2937L78.4583,18.8792L77.6354,18.0854L83.7958,16.4979L83.7958,16.4958ZM24.5104,9.81875L24.8917,16.1708L23.9542,16.8271L23.5708,10.475L24.5083,9.81875L24.5104,9.81875ZM78.2812,11.7292L79.2187,12.3854L73.3812,14.9167L72.4437,14.2604L78.2812,11.7292ZM30.9562,6.39583L30.3396,12.7292L29.3104,13.2312L29.9271,6.89792L30.9562,6.39792L30.9562,6.39583ZM72.1,7.85625L73.1292,8.35833L67.7604,11.7729L66.7292,11.2708L72.1,7.85625ZM37.7917,3.975L36.3,10.1625L35.2104,10.5167L36.7021,4.32917L37.7917,3.975ZM65.4375,5.00417L66.5271,5.35833L61.6854,9.48542L60.5958,9.13125L65.4375,5.00625L65.4375,5.00417ZM44.9729,2.65417L42.5312,8.52917L41.4,8.70833L43.8417,2.83333L44.9729,2.65417ZM58.3792,3.175L59.5104,3.35417L55.3729,8.1875L54.2417,8.00833L58.3792,3.175ZM52.2687,2.44583L48.9396,7.86667L47.7937,7.86667L51.1229,2.44583L52.2687,2.44583Z" fill="#3F8BFD" fill-opacity="1"/></g></svg>
images/wallet.svg
New file
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="87.44611358642578" height="87.44610595703125" viewBox="0 0 87.44611358642578 87.44610595703125"><g><path d="M43.7231,0C19.5754,0,0,19.5754,0,43.7231C0,67.8707,19.5754,87.4461,43.7231,87.4461C67.8707,87.4461,87.4461,67.8706,87.4461,43.7231C87.4461,19.5755,67.8707,0,43.7231,0ZM64.1109,64.58C62.8001,65.915,60.5913,66.5583,57.4844,66.5098L51.8532,66.5098C47.5166,66.5098,45.3483,64.0825,45.3483,59.2279L45.3483,45.9752L39.887,46.218C39.0777,57.351,33.8592,64.5031,24.2314,67.6748C22.2569,64.9885,20.6229,62.901,19.3283,61.4125C27.678,59.0987,32.2897,54.1551,33.1635,46.5821C29.8626,46.7926,27.3383,47.0111,25.5906,47.2376L23.0662,41.4607C26.6744,39.3247,30.4609,35.9752,34.4257,31.4119L20.1052,31.4119L20.1052,25.0039L39.8628,25.0039L38.1152,20.9749L45.2028,19.4213L47.4842,25.0039L66.5138,25.0039L66.5138,31.4119L43.2366,31.4119C40.3561,34.5674,37.1602,37.6904,33.6491,40.7809C38.196,40.7165,44.329,40.5545,52.0476,40.2957L46.8532,35.1984L51.6104,31.509C56.5942,35.8135,61.368,40.1986,65.9312,44.6647L60.9311,49.3735L57.2903,45.5871L52.1445,45.757L52.1445,58.063C52.1445,59.7462,53.002,60.5874,54.7173,60.5874L56.6105,60.5874C58.0343,60.5874,58.973,60.1384,59.4261,59.2403C59.879,58.3423,60.2999,55.9435,60.6884,52.0435C62.5004,52.8852,64.7661,53.7753,67.4846,54.7135C66.5461,59.9562,65.4215,63.2451,64.1109,64.58Z" fill="#4090FF" fill-opacity="1"/></g></svg>
images/water_intake_blue.png
images/water_intake_grey.png
images/wifi_no.svg
New file
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#00FF00"><path d="M0 0h24v24H0z" fill="none"/><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z"/></svg>
images/wifi_off.svg
New file
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FF4500"><path d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z" fill="none"/><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0z"/></svg>
pages/feedback/feedback.js
New file
@@ -0,0 +1,97 @@
Page({
  data: {
    recordingSrc: '',
    isRecording: false,
  },
  onLoad() {
    this.recorderManager = wx.getRecorderManager();
    this.recorderManager.onStart(() => {
      console.log('recorder start');
      this.setData({ isRecording: true });
      this.startWaveformDrawing();
    });
    this.recorderManager.onStop((res) => {
      console.log('recorder stop', res);
      const { tempFilePath } = res;
      this.setData({
        recordingSrc: tempFilePath,
        isRecording: false
      });
      this.stopWaveformDrawing();
    });
    this.recorderManager.onError((res) => {
      console.error(res);
      this.setData({ isRecording: false });
      this.stopWaveformDrawing();
    });
  },
  startRecording() {
    if (this.data.isRecording) return;
    wx.authorize({
      scope: 'scope.record',
      success: () => {
        const options = {
          duration: 60000,
          sampleRate: 44100,
          numberOfChannels: 1,
          encodeBitRate: 192000,
          format: 'aac',
          frameSize: 50
        };
        this.recorderManager.start(options);
      },
      fail: () => {
        wx.showModal({
          title: '授权失败',
          content: '请授权录音功能',
          showCancel: false
        });
      }
    });
  },
  stopRecording() {
    if (!this.data.isRecording) return;
    this.recorderManager.stop();
  },
  startWaveformDrawing() {
    if (this.waveformInterval) return;
    const canvasContext = wx.createCanvasContext('waveform');
    const drawWaveform = () => {
      if (!this.data.isRecording) return;
      // 生成模拟的音量数据
      const data = new Array(100).fill(0).map(() => Math.random() * 100);
      canvasContext.clearRect(0, 0, 300, 100);
      canvasContext.beginPath();
      canvasContext.moveTo(0, 50);
      for (let i = 0; i < data.length; i++) {
        const x = (i / data.length) * 300;
        const y = 50 - data[i] / 2;
        canvasContext.lineTo(x, y);
      }
      canvasContext.lineTo(300, 50);
      canvasContext.stroke();
      canvasContext.draw();
      this.waveformInterval = setTimeout(drawWaveform, 100);
    };
    drawWaveform();
  },
  stopWaveformDrawing() {
    clearTimeout(this.waveformInterval);
    this.waveformInterval = null;
  }
});
pages/feedback/feedback.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "问题反馈",
  "navigationBarTextStyle": "white"
}
pages/feedback/feedback.wxml
New file
@@ -0,0 +1,9 @@
<view class="container">
  <button class="btn" bindtouchstart="startRecording" bindtouchend="stopRecording">
    按住录音
  </button>
  <view wx:if="{{isRecording}}" class="recording-overlay">
    <canvas canvas-id="waveform" style="width: 300px; height: 100px;"></canvas>
  </view>
  <audio src="{{recordingSrc}}" controls></audio>
</view>
pages/feedback/feedback.wxss
New file
@@ -0,0 +1,37 @@
/* app.wxss 或单独页面的 .wxss 文件 */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 20px;
}
.btn {
  margin: 10px;
  padding: 10px 20px;
  background-color: #1cbbb4;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
}
audio {
  margin-top: 20px;
  width: 100%;
}
.recording-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
}
pages/home/home.js
@@ -1,14 +1,19 @@
// pages/home/home.js
const storage = require('../../utils/storage.js');
const {
  get,
  post
} = require('../../api/request.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    sessionId: "",
    image: "/images/ic_head_bg.jpg",
    userCode: "张三",
    userName: "1005535",
    userBalance: "100.5元",
    userPhone: "158****0723",
    userName: "张三",
    scrollViewHeight: 0,
    listData: [{
        name: '取水口 1',
@@ -27,15 +32,25 @@
        code: '1055201'
      },
      {
        name: '取水口 3',
        name: '取水口 4',
        code: '1055201'
      },
      {
        name: '取水口 5',
        code: '1055201'
      },
      {
        name: '取水口 6',
        code: '1055201'
      }
    ]
    ],
    isRefreshing: false,
    isWXRefreshing: false
  },
  rechageTap:function (e) {
  openValve: function (e) {
   wx.navigateTo({
     url: '/pages/recharge/recharge',
      url: '/pages/waterIntake/waterIntake',
   })
  },
  calculateScrollViewHeight: function () {
@@ -46,6 +61,35 @@
      });
    }).exec();
  },
  startPullDownRefresh() {
    if (!this.data.isWXRefreshing) {
      var self = this;
      console.log(this.data.isRefreshing);
      this.setData({
        isRefreshing: true
      });
      setTimeout(function () {
        self.setData({
          isRefreshing: false, // 将triggered属性设置为false,表示下拉刷新已完成
        })
        console.log('下拉刷新已完成');
      }, 3000);
    }
  },
  //获取用户数据
  getUserData() {
    get('/items')
      .then((data) => {
        this.setData({
          items: data
        });
      })
      .catch((error) => {
        console.error('Failed to fetch data:', error);
      });
  },
  /**
@@ -56,13 +100,28 @@
   wx.nextTick(() => {
    this.calculateScrollViewHeight();
  });
    console.log("onLoad:" + options.param);
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
    //判断本地是否保存sessionId
    if (storage.isHasKeySync("sessionId")) {
      storage.getItem('sessionId').then((data) => {
        this.setData({
          sessionId: data
        });
        if (sessionId !== "") {
        }
      }).catch((err) => {
        console.error('Failed to load parameter:', err);
      });
    } else {
      console.log('Failed to load parameter:false');
    }
  },
  /**
@@ -90,7 +149,21 @@
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
    // 下拉刷新触发的逻辑,可以是请求数据等操作
    // 例如,请求数据后更新页面内容
    console.log(this.data.isRefreshing);
    this.setData({
      isWXRefreshing: true
    });
    console.log(this.data.isRefreshing);
    // 数据请求完成后,停止下拉刷新的动画
    var self = this;
    setTimeout(function () {
      self.setData({
        isWXRefreshing: false, // 将triggered属性设置为false,表示下拉刷新已完成
      })
      console.log('下拉刷新已完成');
    }, 3000);
  },
  /**
pages/home/home.json
@@ -4,7 +4,7 @@
    "t-avatar": "tdesign-miniprogram/avatar/avatar",
    "t-switch": "tdesign-miniprogram/switch/switch"
  },
  "navigationBarTitleText": "首页",
  "navigationBarTextStyle": "white"
  "navigationBarTitleText": "大禹节水",
  "navigationBarTextStyle": "white",
  "enablePullDownRefresh": true
}
pages/home/home.wxml
@@ -5,45 +5,55 @@
      <t-avatar class="avatar-example" image="{{image}}" size="120rpx" />
      <view class="head-text-wrapper">
        <text>{{userName}}</text>
        <text>{{userCode}}</text>
        <text class="head-bottom">{{userPhone}}</text>
      </view>
      <view class="head-button-wrapper">
        <text class="unbind">解绑</text>
        <text class="head-bottom">联系客服</text>
      </view>
    </view>
    <text class="balance-label">{{userBalance}}</text>
  </view>
  <view class="center-wrapper">
    <view class="center-view">
      <t-avatar image="{{image}}" size="80rpx" />
      <text>取水口</text>
      <image src="/images/wallet.svg" />
      <text>充值</text>
    </view>
    <view class="center-view" bind:tap="rechageTap">
      <t-avatar image="{{image}}" size="80rpx" />
      <text>充值缴费</text>
    <view class="center-view" bind:tap="openValve">
      <image src="/images/valva.svg" />
      <text>开阀</text>
    </view>
    <view class="center-view">
      <t-avatar image="{{image}}" size="80rpx" />
      <text>用水记录</text>
      <image src="/images/record.svg" />
      <text>开关阀记录</text>
    </view>
    <view class="center-view">
      <t-avatar image="{{image}}" size="80rpx" />
      <image src="/images/question.svg" />
      <text>问题反馈</text>
    </view>
  </view>
  <view class="bottom-title">
    <text>常用的取水口</text>
    <text class="bottom-title-text">快速关阀</text>
    <text class="refresh-button" bind:tap="startPullDownRefresh">刷新</text>
  </view>
  <scroll-view class="scroll-view" scroll-y="true">
  <!-- refresher-enabled="true" refresher-threshold="50" -->
  <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">
    <view class="list-item" wx:for="{{listData}}" wx:for-item="item" wx:for-index="index">
        <view class="item-left">
          <!-- <image class="item-img" src="/images/pipeline.svg" /> -->
      <text>{{item.name}}</text>
      <view class="list-item-piping">
        <image src="/images/piping.png"></image>
        <text>{{item.code}}</text>
          <image class="item-img" src="/images/wifi_no.svg" />
      </view>
      <view>
        <t-switch bindchange="handleChange" value="{{defaultVal}}" label="{{['开', '关']}}" slot="note" />
          <t-switch class="switch" bindchange="handleChange" value="{{true}}" label="{{['开', '关']}}" slot="note" />
      </view>
    </view>
  </view>
pages/home/home.wxss
@@ -11,19 +11,20 @@
.head-wrapper {
  background-color: #1890FF;
  height: 30vh;
  height: 25vh;
  width: 100%;
  padding-left: 40rpx;
  display: grid;
  flex-direction: column;
  align-items: center;
  border-bottom-left-radius: 5rpx;
  border-bottom-right-radius: 5rpx;
  z-index: 1;
  border-top: 1px solid #0484fc;
}
.head-top {
  margin-top: 40rpx;
  display: flex;
  align-items: center;
  /* 在纵向方向上居中对齐 */
@@ -31,13 +32,49 @@
.head-text-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: 30rpx;
  align-items: left;
  justify-content: center;
  margin-left: 15rpx;
}
.head-button-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 15rpx;
}
.head-bottom {
  margin-top: 20rpx;
  color: #fff;
  font-size: 35rpx;
}
.unbind {
  font-size: 30rpx;
  /* 按钮文字的字体大小 */
  color: #1890FF;
  /* 按钮文字颜色 */
  background-color: #fff;
  /* 按钮背景颜色 */
  border: none;
  /* 去掉按钮边框 */
  border-radius: 20px;
  /* 按钮圆角 */
  padding-left: 20rpx;
  padding-right: 20rpx;
  padding-top: 5rpx;
  padding-bottom: 5rpx;
  margin-bottom: 10rpx;
}
.head-text-wrapper text {
  margin-bottom: 10rpx;
  color: #fff;
}
@@ -64,6 +101,8 @@
}
.center-view {
  flex: 1;
  /* 每个元素平分宽度 */
  display: flex;
  flex-direction: column;
  /* 在纵向上排列子元素 */
@@ -73,9 +112,20 @@
  /* 在横向和纵向上都居中显示子元素 */
}
.center-view image,
.center-view t-avatar {
  width: 90rpx;
  /* 根据需要调整图标大小 */
  height: 90rpx;
  /* 根据需要调整图标大小 */
  margin-bottom: 10rpx;
  /* 图标和文本之间的间距 */
}
.center-view text {
  margin-top: 15rpx;
  font-size: 30rpx;
  color: #1890FF;
}
.bottom-wrapper {
@@ -98,7 +148,7 @@
.list-item {
  background-color: #fff;
  margin-top: 10rpx;
  margin-top: 2rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
@@ -106,17 +156,15 @@
  padding-right: 30rpx;
  padding-top: 20rpx;
  padding-bottom: 20rpx;
  margin-left: 20rpx;
  margin-right: 20rpx;
}
.list-item text {
  font-size: 30rpx;
}
.list-item image {
  width: 80rpx;
  height: 80rpx;
}
.list-item-piping {
  display: flex;
@@ -127,7 +175,99 @@
.bottom-title {
  border-radius: 5px 5px 0 0;
  background-color: #fff;
  padding-left: 30rpx;
  padding-top: 30rpx;
  padding-bottom: 30rpx;
  display: flex;
  align-items: center;
  /* 垂直方向居中 */
  justify-content: space-between;
  /* 子元素在主轴上的对齐方式 */
  padding: 10px;
  /* 容器的内边距 */
  margin-left: 20rpx;
  margin-right: 20rpx;
  margin-top: 20rpx;
}
.bottom-title-text {
  position: absolute;
  /* 绝对定位 */
  left: 50%;
  /* 移动到容器的中间 */
  transform: translateX(-50%);
  /* 通过平移自身宽度的一半来实现真正的居中 */
  font-size: 16px;
  /* 字体大小 */
  color: #333;
  /* 字体颜色 */
}
.refresh-button {
  margin-left: auto;
  /* 将按钮推到容器的最右侧 */
  font-size: 30rpx;
  /* 按钮文字的字体大小 */
  color: #fff;
  /* 按钮文字颜色 */
  background-color: #1890FF;
  /* 按钮背景颜色 */
  border: none;
  /* 去掉按钮边框 */
  border-radius: 5px;
  /* 按钮圆角 */
  padding-left: 20rpx;
  padding-right: 20rpx;
  padding-top: 5rpx;
  padding-bottom: 5rpx;
}
.refresh-view {
  text-align: center;
  padding: 30rpx;
  display: flex;
  justify-content: center;
  align-items: center;
}
.dot {
  width: 20rpx;
  height: 20rpx;
  background-color: #333;
  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;
  }
}
.switch{
  --td-switch-checked-color: #1890FF;
}
.item-left {
  display: flex;
  align-items: center;
}
.item-left text{
  font-size: 40rpx;
}
.item-img {
  width: 40rpx;
  /* 根据需要调整图标大小 */
  height: 40rpx;
  /* 根据需要调整图标大小 */
  margin-left: 20rpx;
}
pages/login/login.js
@@ -1,12 +1,78 @@
// pages/login/login.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    mobile: '',
    code: '',
    codeSent: false,
    countdown: 60,
  },
  bindMobileInput: function (e) {
    this.setData({
      mobile: e.detail.value,
    });
  },
  sendCode: function () {
    if (!this.data.mobile) {
      wx.showToast({
        title: '请输入手机号',
        icon: 'none',
        duration: 2000,
      });
      return;
    }
    // 在这里处理发送验证码的逻辑,可以调用后台接口实现
    // 以下是一个简单的示例,仅作参考
    wx.showToast({
      title: '验证码已发送',
      icon: 'success',
      duration: 2000,
    });
    this.setData({
      codeSent: true,
    });
    // 启动倒计时
    this.startCountdown();
  },
  //倒计时
  startCountdown: function () {
    let that = this;
    let timer = setInterval(function () {
      let countdown = that.data.countdown - 1;
      that.setData({
        countdown: countdown,
      });
      if (countdown <= 0) {
        clearInterval(timer);
        that.setData({
          codeSent: false,
          countdown: 60,
        });
      }
    }, 1000);
  },
  /**
   * 登录
   */
  login: function (e) {
    console.log("login")
    let userName = "张三"
    wx.navigateTo({
      url: '/pages/wxbind/wxbind'
    })
  },
  /**
   * 生命周期函数--监听页面加载
@@ -63,13 +129,7 @@
  onShareAppMessage() {
  },
  /**
   * 登录
   */
   login:function(e) {
     console.log("login")
    wx.reLaunch({
      url: 'pages/home/home',
    })
  }
})
pages/login/login.json
@@ -1,10 +1,4 @@
{
  "window": {
    "navigationBarBackgroundColor": "#ffffff",
    "navigationBarTextStyle": "black",
    "navigationBarTitleText": "登录",
    "backgroundColor": "#eeeeee",
    "backgroundTextStyle": "light",
    "enablePullDownRefresh": true
  }
  "navigationBarTextStyle": "white"
}
pages/login/login.wxml
@@ -4,16 +4,12 @@
    <image src="/images/login_bg.jpeg"></image>
  </view>
  <view class="input-wrapper">
    <view class="label-container">
      <text class="input-label">手机号:</text>
    </view>
    <input class="input" placeholder="请输入11位手机号" maxlength="11" />
    <input class="input" placeholder="请输入11位手机号" maxlength="11" bindinput="bindMobileInput" />
  </view>
  <view class="input-wrapper">
    <view class="label-container">
      <text class="input-label"> 密码:</text>
    </view>
    <input class="input" type="password" placeholder="请输入密码" bindinput="bindPasswordInput" />
    <input class="input" type="number" placeholder="请输入验证码"  />
    <button class="code-button" wx:if="{{!codeSent}}" bindtap="sendCode">获取验证码</button>
    <button class="code-button" wx:if="{{codeSent}}" disabled>重新获取({{countdown}}s)</button>
  </view>
  <view>
    <button class="login-button" bindtap="login">登录</button>
pages/login/login.wxss
@@ -5,10 +5,9 @@
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 80vh;
  width: 100%;
}
@@ -29,25 +28,30 @@
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #fff;
  font-size: 35rpx;
  padding-left: 15rpx;
}
.input-wrapper {
  width: 70%;
  display: flex;
  /* 使用 Flex 布局使 text 和 input 在同一行 */
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  margin-bottom: 40rpx;
  margin-left: 40rpx;
  margin-right: 40rpx;
  
}
.input-label {
  flex: 1; /* 让值占据剩余空间 */
  flex: 1;
  /* 让值占据剩余空间 */
  align-items: left;
  width: 150px;
  margin-right: 10px;
  font-size: 16px;
  width: 150rpx;
  margin-right: 10rpx;
  font-size: 31rpx;
  color: #fff;
  font-weight: bold;
  text-align: justify;
@@ -59,6 +63,19 @@
  display: flex;
  align-items: center;
}
.login-button{
  margin-top: 50rpx;
  margin-left: 40rpx;
  margin-right: 40rpx;
  height: 90rpx;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */
  display: flex;
}
.code-button {
  width: 50%;
  font-size: 30rpx;
  margin-left: 15rpx;
}
pages/my/my.js
@@ -5,7 +5,9 @@
   * 页面的初始数据
   */
  data: {
    image: "/images/ic_head_bg.jpg",
    userCode: "张三",
    userName: "1005535"
  },
  /**
pages/my/my.wxml
@@ -1,2 +1,27 @@
<!--pages/my/my.wxml-->
<text>pages/my/my.wxml</text>
<view class="base-wrapper">
  <view class="head-wrapper">
  <view class="center-wrapper">
    <view class="head-top">
      <t-avatar class="avatar-example" image="{{image}}" size="120rpx" />
      <view class="head-text-wrapper">
        <text>{{userName}}</text>
        <text>{{userCode}}</text>
      </view>
    </view>
  </view>
  </view>
  <view class="bottom-title">
    <text>片区负责人</text>
  </view>
  <view class="item">
    <text>问题反馈</text>
  </view>
  <view class="item">
    <text>解除绑定</text>
  </view>
  <view class="item">
    <text>退出登录</text>
  </view>
</view>
pages/my/my.wxss
@@ -1 +1,143 @@
/* pages/my/my.wxss */
/* pages/home/home.wxss */
.base-wrapper {
  background-color: #f5f5f5;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  /* 防止底部区域滚动 */
  display: flex;
  flex-direction: column;
}
.head-wrapper {
  background-color: #1890FF;
  height: 30vh;
  display: grid;
  flex-direction: column;
  align-items: center;
  border-bottom-left-radius: 5rpx;
  border-bottom-right-radius: 5rpx;
  z-index: 1;
}
.head-top {
  margin-top: 40rpx;
  display: flex;
  align-items: center;
  /* 在纵向方向上居中对齐 */
}
.head-text-wrapper {
  display: flex;
  flex-direction: column;
  margin-left: 30rpx;
}
.head-text-wrapper text {
  margin-bottom: 10rpx;
  color: #fff;
}
.balance-label {
  margin-bottom: 40rpx;
  color: #fff;
  font-size: 35rpx;
}
.center-wrapper {
  margin-top: 30rpx;
  margin-right: 20rpx;
  margin-left: 20rpx;
  background-color: #fff;
  border-radius: 5px;
  display: flex;
  justify-content: space-around;
  z-index: 1;
  height: 30vh;
  /* 使 center-wrapper 在头部之上 */
}
.center-view {
  display: flex;
  flex-direction: column;
  /* 在纵向上排列子元素 */
  align-items: center;
  /* 在纵向上居中显示子元素 */
  justify-content: center;
  /* 在横向和纵向上都居中显示子元素 */
}
.center-view text {
  margin-top: 15rpx;
  font-size: 30rpx;
}
.bottom-wrapper {
  margin-right: 20rpx;
  margin-left: 20rpx;
  display: flex;
  flex-direction: column;
  margin-top: 48vh;
}
.scroll-view {
  flex: 1;
  overflow-y: auto;
  /* 允许垂直滚动 */
  z-index: 0;
  /* 确保 scroll-view 在头部和 center-wrapper 之下 */
}
.list-item {
  background-color: #fff;
  margin-top: 10rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 30rpx;
  padding-right: 30rpx;
  padding-top: 20rpx;
  padding-bottom: 20rpx;
}
.list-item text {
  font-size: 30rpx;
}
.list-item image {
  width: 80rpx;
  height: 80rpx;
}
.list-item-piping {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bottom-title {
  background-color: #fff;
  padding-left: 30rpx;
  padding-top: 30rpx;
  padding-bottom: 30rpx;
  margin-top: 60rpx;
}
.item {
  background-color: #fff;
  padding-left: 30rpx;
  padding-top: 30rpx;
  padding-bottom: 30rpx;
  margin-top: 10rpx;
}
text{
  color: #000;
  font-size: 38rpx;
}
pages/openCard/openCard.js
New file
@@ -0,0 +1,117 @@
// pages/openCard/openCard.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    allCardPoints: [{
        id: 511111111,
        balance: '30',
        state: 1
      },
      {
        id: 411111111,
        balance: '30',
        state: 0
      },
      {
        id: 31111111111,
        balance: '30',
        state: 1
      },
      {
        id: 2,
        balance: '30',
        state: 1
      },
      {
        id: 1,
        balance: '30',
        state: 1
      },
      {
        id: 0,
        balance: '30',
        state: 1
      },
    ] // 常用取水口数据
  },
  openValva(event) {
    const {
      item
    } = event.currentTarget.dataset; // 获取当前点击的 item
    if (item.state === 1) {
      // 在页面加载时显示加载动画
      wx.showLoading({
        title: '正在开泵请稍后...', // 加载提示文字
        mask: true // 是否显示透明蒙层,防止触摸穿透,默认为 false
      });
      // 模拟加载数据
      setTimeout(() => {
        // 加载完成后隐藏加载动画
        wx.hideLoading();
        //完成后回到首页
        wx.reLaunch({
          url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写
        });
      }, 2000); // 延时 2 秒模拟加载数据
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/openCard/openCard.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "选择虚拟卡",
  "navigationBarTextStyle": "white"
}
pages/openCard/openCard.wxml
New file
@@ -0,0 +1,23 @@
<!--pages/openCard/openCard.wxml 开卡时的虚拟卡-->
<view>
  <scroll-view class="list-container" scroll-y="true" scroll-x="false">
    <block wx:for="{{allCardPoints}}" wx:key="index">
      <view class="{{item.state===1?'item':'item-gray'}}">
        <view class="item-card">
          <text>卡编号:</text>
          <text>{{item.id}}</text>
        </view>
        <view class="item-bottom">
          <image class="item-balance-img" src="/images/balance.svg" />
          <view class="item-balance">
            <text class="item-balance-text">{{item.balance}}</text>
            <text class="item-balance-text-yuan">元</text>
          </view>
          <text class="{{item.state===1?'item-button':'item-button-gray'}}"  bind:tap="openValva" data-item="{{item}}">{{item.state === 1 ? '选择' : '正在使用'}}</text>
        </view>
      </view>
    </block>
  </scroll-view>
</view>
pages/openCard/openCard.wxss
New file
@@ -0,0 +1,94 @@
/* pages/openCard/openCard.wxss */
.item {
  background-color: #1890FF;
  margin-top: 20rpx;
  margin-left: 20rpx;
  margin-right: 20rpx;
  padding: 30rpx;
  border-radius: 30rpx;
}
.item-gray {
  background-color: #D3D3D3;
  margin-top: 20rpx;
  margin-left: 20rpx;
  margin-right: 20rpx;
  padding: 30rpx;
  border-radius: 30rpx;
}
.item-balance-img {
  width: 60rpx;
  height: 50rpx;
}
.item-bottom {
  display: flex;
  margin-top: 10rpx;
  align-items: center;
  /* 垂直居中 */
}
.item-card {
  margin-left: 10rpx;
}
.item-card text {
  font-size: 35rpx;
  color: #fff;
}
.item-balance-text {
  color: #fff;
  font-size: 50rpx;
  margin-left: 10rpx;
}
.item-button {
  margin-left: auto;
  /* 将按钮固定在右边 */
  display: flex;
  align-items: center;
  justify-content: center;
  /* 使按钮内部水平和垂直居中 */
  background-color: #32CD32;
  color: white;
  padding-left: 40rpx;
  padding-right: 40rpx;
  padding-bottom: 8rpx;
  padding-top: 8rpx;
  border-radius: 30rpx;
  font-size: 40rpx;
  border: none;
}
.item-button-gray {
  margin-left: auto;
  /* 将按钮固定在右边 */
  display: flex;
  align-items: center;
  justify-content: center;
  /* 使按钮内部水平和垂直居中 */
  background-color: #8B8989;
  color: #FF6A6A;
  padding-left: 40rpx;
  padding-right: 40rpx;
  padding-bottom: 8rpx;
  padding-top: 8rpx;
  border-radius: 30rpx;
  font-size: 40rpx;
  border: none;
}
.item-balance-text-yuan {
  color: white;
  margin-left: 10rpx;
  margin-bottom: 2rpx;
}
.item-balance {
  display: flex;
  align-items: flex-end;
  /* 底部对齐 */
}
pages/personCharge/personcharge.js
New file
@@ -0,0 +1,66 @@
// pages/personCharge/personcharge.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/personCharge/personcharge.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/personCharge/personcharge.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/personCharge/personcharge.wxml-->
<text>pages/personCharge/personcharge.wxml</text>
pages/personCharge/personcharge.wxss
New file
@@ -0,0 +1 @@
/* pages/personCharge/personcharge.wxss */
pages/recharge/recharge.js
@@ -5,30 +5,8 @@
   * 页面的初始数据
   */
  data: {
    userName: "张三",
    userPhone: "15802220723",
    userCode: "15584236",
    balance: "1025元",
    activeIndex: -1,
  },
  handleMoneyWrapperTap: function (e) {
    const index = e.currentTarget.dataset.index;
    console.log(index)
    if (index !== undefined) {
      this.setData({
        activeIndex: parseInt(index),
      });
    }
  },
  moveToRechargeList:function(e){
    wx.navigateTo({
      url: '/pages/rechargeList/rechargeList'
    })
  },
  /**
   * 生命周期函数--监听页面加载
pages/recharge/recharge.json
File was deleted
pages/recharge/recharge.wxml
New file
@@ -0,0 +1,2 @@
<!--pages/recharge/recharge.wxml-->
<text>pages/recharge/recharge.wxml</text>
pages/rechargeMoney/rechargMoney.js
New file
@@ -0,0 +1,70 @@
// pages/rechargeMoney/rechargMoney.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    userName: "张三",
    userPhone: "15802220723",
    userCode: "15584236",
    balance: "1025元",
    activeIndex: -1,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/rechargeMoney/rechargMoney.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/rechargeMoney/rechargMoney.wxml
New file
@@ -0,0 +1,71 @@
<!--pages/recharge/recharge.wxml-->
<view class="base-wrapper">
  <view class="user-wrapper">
    <view>
      <text>{{userName}}</text>
      <text>{{userPhone}}</text>
    </view>
    <view>
      <text>用户编号:</text>
      <text>{{userCode}}</text>
    </view>
    <view>
      <text>余额:</text>
      <text>{{balance}}</text>
    </view>
  </view>
  <view class="money-base-wrapper">
    <view class="row">
      <view class="item{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="0">
      <view class="money-wrapper">
        <text class="money-number">30</text>
        <text class="money-label">元</text>
      </view>
      </view>
      <view class="item{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="1">
        <view class="money-wrapper">
        <text class="money-number">50</text>
        <text class="money-label">元</text>
      </view>
      </view>
      <view class="item{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="2">
        <view class="money-wrapper">
        <text class="money-number">100</text>
        <text class="money-label">元</text>
        </view>
      </view>
    </view>
    <view class="row">
      <view class="item{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="3">
        <view class="money-wrapper">
        <text class="money-number">200</text>
        <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 4 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="4">
        <view class="money-wrapper">
        <text class="money-number">300</text>
        <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 5 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="5">
        <view class="money-wrapper">
        <text class="money-number">500</text>
        <text class="money-label">元</text>
        </view>
      </view>
    </view>
  </view>
<view class="rechage-view">
  <view class="rechage{{activeIndex === -1 ? 'active' : ''}}">
  <text >充值</text>
  </view>
  <view class="rechageList-view">
  <text class="rechageList" bind:tap="moveToRechargeList">充值记录</text>
  </view>
</view>
</view>
pages/rechargeMoney/rechargMoney.wxss
New file
@@ -0,0 +1,153 @@
/* pages/recharge/recharge.wxss */
.base-wrapper {
  background-color: #f5f5f5;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.user-wrapper {
  background-color: #1890FF;
  height: 20vh;
  padding-left: 10rpx;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding-top: 20rpx;
  padding-bottom: 30rpx;
}
.user-wrapper text {
  color: #fff;
  margin-left: 30rpx;
}
.money-base-wrapper {
  flex-direction: column;
  height: 20vh;
  display: flex;
  justify-content: space-around;
  margin-top: 20rpx;
}
.row {
  display: flex;
  justify-content: space-around;
}
.item {
  background-color: #fff;
  border-radius: 5px;
  width: 100%;
  height: 10vh;
  margin-left: 20rpx;
  margin-top: 30rpx;
  margin-right: 20rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item text {
  color: #2D8BF7;
}
.money-number {
  font-size: 40rpx;
}
.money-label {
  font-size: 30rpx;
  margin-left: 5rpx;
}
.itemactive {
  background-color: #2D8BF7;
  border-radius: 5px;
  width: 100%;
  height: 10vh;
  margin-top: 30rpx;
  margin-left: 20rpx;
  margin-right: 20rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}
.itemactive text {
  color: #fff;
}
.money-wrapper {
  display: flex;
  align-items: flex-end;
  /* 底部对齐 */
  justify-content: center;
  /* 水平居中 */
}
.rechage-view {
  flex-grow: 1;
  /* 占据剩余的全部高度 */
  flex-direction: column;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.rechageList-view {
  width: 50%;
  background-color: #fff;
  display: flex;
  margin-left: 20rpx;
  margin-right: 20rpx;
  align-items: center;
  justify-content: center;
  margin-top: 30rpx;
  border-radius: 90px;
  border: 2px solid #2D8BF7;
  /* 添加蓝色的边框 */
  padding-top: 15rpx;
  padding-bottom: 15rpx;
}
.rechage {
  display: flex;
  width: 50%;
  background-color: #2D8BF7;
  align-items: center;
  justify-content: center;
  padding-top: 15rpx;
  padding-bottom: 15rpx;
  border-radius: 90px;
  margin-top: 45rpx;
}
.rechageactive {
  display: flex;
  margin-top: 45rpx;
  align-items: center;
  justify-content: center;
  width: 50%;
  background-color: #bababa;
  padding-top: 15rpx;
  padding-bottom: 15rpx;
  border-radius: 90px;
}
.rechage-view text {
  font-size: 30rpx;
  padding-top: 10rpx;
  padding-bottom: 10rpx;
}
.rechageactive text {
  color: #fff;
}
.rechage text {
  color: #fff;
}
pages/wallet/wallet.js
@@ -45,6 +45,13 @@
      }
    ]
  },
  rechageTap:function (e) {
    wx.navigateTo({
      url: '/pages/recharge/recharge',
    })
   },
  /**
   * 生命周期函数--监听页面加载
pages/wallet/wallet.wxml
@@ -11,7 +11,7 @@
        </view>
        <view class="top-wrapper-button">
          <text class="button-refund">退款</text>
          <text class="button-recharge">充值</text>
          <text class="button-recharge" bind:tap="rechageTap">充值</text>
        </view>
      </view>
      <view class="top-wallet-bg">
pages/waterIntake/waterIntake.js
New file
@@ -0,0 +1,100 @@
// pages/waterIntake/waterIntake.js
Page({
  data: {
    currentTab: 0, // 当前显示的表格,默认为第一个表格
    commonWaterPoints: [ "常用取水口2", "常用取水口3"], // 常用取水口数据
    allWaterPoints: ["所有取水口1", "所有取水口2", "所有取水口3"], // 所有取水口数据
  },
  // 切换 Tabs
  switchTab: function (e) {
    const tab = parseInt(e.currentTarget.dataset.tab);
    this.setData({
      currentTab: tab
    });
  },
  onSearch: function() {
    const query = this.data.searchQuery;
    if (query) {
      wx.showToast({
        title: '搜索: ' + query,
        icon: 'success'
      });
      // 在这里进行搜索操作,更新 allWaterPoints 数据
    } else {
      wx.showToast({
        title: '请输入搜索内容',
        icon: 'none'
      });
    }
  },
  /**
   * 选择虚拟卡
   * @param {} event
   */
  choseCard(event){
    wx.navigateTo({
      url: '/pages/openCard/openCard',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
pages/waterIntake/waterIntake.json
New file
@@ -0,0 +1,11 @@
{
  "component": true,
  "usingComponents": {
    "t-avatar": "tdesign-miniprogram/avatar/avatar",
    "t-switch": "tdesign-miniprogram/switch/switch",
    "t-button": "tdesign-miniprogram/button/button"
  },
  "navigationBarTitleText": "取水口",
  "navigationBarTextStyle": "white"
}
pages/waterIntake/waterIntake.wxml
New file
@@ -0,0 +1,51 @@
<!--pages/waterIntake/waterIntake.wxml取水口列表-->
<view class="container">
  <!-- 顶部 Tabs -->
  <view class="tabs">
    <view class="tab" bindtap="switchTab" data-tab="0" id="tab0">
      常用取水口
      <view class="indicator" wx:if="{{currentTab === 0}}"></view>
    </view>
    <view class="tab" bindtap="switchTab" data-tab="1" id="tab1">
      所有取水口
      <view class="indicator" wx:if="{{currentTab === 1}}"></view>
    </view>
  </view>
  <!-- 常用取水口 -->
  <scroll-view class="list-container" wx:if="{{currentTab === 0}}" scroll-y="true" scroll-x="false">
    <block wx:for="{{commonWaterPoints}}" wx:key="index">
      <view class="item">
        <view class="item-left">
          <!-- <image class="item-img" src="/images/pipeline.svg" /> -->
          <text>{{item}}</text>
          <image class="item-img" src="/images/wifi_no.svg" />
        </view>
        <text class="item-button" bind:tap="choseCard"  data-item="{{item}}">选择</text>
      </view>
    </block>
  </scroll-view>
  <!-- 所有取水口 -->
  <view class="all-waterIntake" wx:else>
    <view class="search-container">
      <input class="search-input" placeholder="请输入取水口编码后点击搜索" bindinput="onInput" />
      <!-- <text class="search-button" >搜索</text> -->
      <t-button  class="search-button" theme="primary" size="large" icon="search" shape="square" aria-label="搜索" bindtap="onSearch" style="background-color: #1890FF; border: none;  height: 80rpx;"></t-button>
    </view>
    <view>
      <scroll-view class="list-container" scroll-y="true" scroll-x="false">
        <block wx:for="{{allWaterPoints}}" wx:key="index">
          <view class="item">
            <view class="item-left">
              <!-- <image class="item-img" src="/images/pipeline.svg" /> -->
              <text>{{item}}</text>
              <image class="item-img" src="/images/wifi_no.svg" />
            </view>
            <text class="item-button" bind:tap="choseCard"  data-item="{{item}}">选择</text>
          </view>
        </block>
      </scroll-view>
    </view>
  </view>
</view>
pages/waterIntake/waterIntake.wxss
New file
@@ -0,0 +1,146 @@
/* pages/waterIntake/waterIntake.wxss */
/* index.wxss */
.container {
  padding-left: 20rpx;
  padding-right: 20rpx;
  padding-top: 5rpx;
  background-color: #fff;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  /* 防止底部区域滚动 */
  display: flex;
  flex-direction: column;
}
.tabs {
  display: flex;
  justify-content: space-around;
  position: relative;
  width: 100%;
  border-bottom: 1px solid #eee;
  /* Tabs 占满整个横向屏幕 */
}
.tab {
  font-size: 16px;
  padding: 10px;
  cursor: pointer;
  position: relative;
  width: 50%;
  /* Tabs 平分整个横向屏幕 */
  text-align: center;
  /* 文字居中 */
}
.indicator {
  width: 100%;
  height: 3px;
  background-color: #1890FF;
  position: absolute;
  bottom: 0;
  left: 0;
  transform: translateX(0);
  /* 初始化位置 */
}
.list {
  margin-top: 20px;
}
.item {
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.search-container {
  display: flex;
  align-items: center;
  padding: 10rpx;
  border-bottom: 1px solid #eee;
}
/* 搜索框 */
.search-input {
  flex: 1;
  height: 80rpx;
  padding: 0 20rpx;
  border: 1px solid #ccc;
  border-radius: 20rpx;
  font-size: 30rpx;
}
/* 搜索按钮 */
.search-button {
  display: flex;
  margin-left: 10rpx;
  height: 60rpx;
  background-color: #1890FF;
  color: white;
  border: none;
  border-radius: 20rpx;
  font-size: 30rpx;
  text-align: center;
  align-items: center;
}
.list-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* 确保内容居上 */
  height: 100%;
}
.all-waterIntake {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* 确保内容居上 */
  height: 100%;
  width: 100%;
}
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  /* 适当调整间距 */
}
.item-left {
  display: flex;
  align-items: center;
}
.item-right {
  display: flex;
  align-items: center;
}
.item-img {
  width: 40rpx;
  /* 根据需要调整图标大小 */
  height: 40rpx;
  /* 根据需要调整图标大小 */
  margin-left: 20rpx;
}
.item-button {
  display: flex;
  height: 60rpx;
  padding: 0 60rpx;
  background-color: #1890FF;
  color: white;
  border: none;
  border-radius: 20rpx;
  font-size: 30rpx;
  align-items: center;
  justify-content: center;
}
.item-left text{
  font-size: 40rpx;
}
pages/wxbind/wxbind.js
New file
@@ -0,0 +1,102 @@
// pages/wxbind/wxbind.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    mobile: '',
    code: '',
    codeSent: false,
    countdown: 60,
    isButtonEnabled: false
  },
  bindMobileInput(e) {
    this.setData({
      mobile: e.detail.value
    }, this.checkButtonState);
  },
  bindCodeInput(e) {
    this.setData({
      code: e.detail.value
    }, this.checkButtonState);
  },
  checkButtonState() {
    const {
      mobile,
      code
    } = this.data;
    const isButtonEnabled = mobile.length === 11 && code.length == 6;
    this.setData({
      isButtonEnabled
    });
    console.log(isButtonEnabled);
  },
  sendCode: function () {
    if (!this.data.mobile) {
      wx.showToast({
        title: '请输入手机号',
        icon: 'none',
        duration: 2000,
      });
      return;
    }
    // 在这里处理发送验证码的逻辑,可以调用后台接口实现
    // 以下是一个简单的示例,仅作参考
    wx.showToast({
      title: '验证码已发送',
      icon: 'success',
      duration: 2000,
    });
    this.setData({
      codeSent: true,
    });
    // 启动倒计时
    this.startCountdown();
  },
  //倒计时
  startCountdown: function () {
    let that = this;
    let timer = setInterval(function () {
      let countdown = that.data.countdown - 1;
      that.setData({
        countdown: countdown,
      });
      if (countdown <= 0) {
        clearInterval(timer);
        that.setData({
          codeSent: false,
          countdown: 60,
        });
      }
    }, 1000);
  },
  bind: function () {
    if (!this.data.isButtonEnabled) return;
    wx.showToast({
      title: '绑定成功',
      icon: 'success'
    });
    // 跳转到 TabBar 页面
    wx.switchTab({
      url: '/pages/home/home' // 这里填写你想要跳转的 TabBar 页面路径
    });
  },
  postCode: function () {
    post('/items', { name: 'New Item' })
      .then((data) => {
        this.setData({
          items: [...this.data.items, data]
        });
      })
      .catch((error) => {
        console.error('Failed to add item:', error);
      });
  }
})
pages/wxbind/wxbind.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "农户绑定",
  "navigationBarTextStyle": "white"
}
pages/wxbind/wxbind.wxml
New file
@@ -0,0 +1,14 @@
<!--pages/wxbind/wxbind.wxml-->
<view class="base-wrapper">
  <view class="container">
    <view class="input-wrapper">
      <input class="input" placeholder="请输入11位手机号" maxlength="11" bindinput="bindMobileInput" />
    </view>
    <view class="input-wrapper">
      <input class="input" type="number" maxlength="6" placeholder="请输入验证码" bindinput="bindCodeInput" />
      <button class="code-button" wx:if="{{!codeSent}}" bindtap="sendCode">获取验证码</button>
      <button class="code-button" wx:if="{{codeSent}}" disabled>重新获取({{countdown}}s)</button>
    </view>
  </view>
  <button class="button {{isButtonEnabled ? 'button-active' : 'button-disabled'}}" bindtap="bind">绑定微信</button>
</view>
pages/wxbind/wxbind.wxss
New file
@@ -0,0 +1,133 @@
/* pages/wxbind/wxbind.wxss */
.base-wrapper {
  background-color: #f5f5f5;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  /* 防止底部区域滚动 */
  display: flex;
  flex-direction: column;
}
.container {
  margin-top: 80rpx;
  margin-right: 30rpx;
  margin-left: 30rpx;
  margin-bottom: 10rpx;
  height: 30vh;
  background-color: #fff;
  border-radius: 5px;
  display: flex;
  padding-top: 20rpx;
  padding-bottom: 20rpx;
  justify-content: space-around;
  align-items: flex-start;
  padding-left: 30rpx;
  z-index: 1;
}
.button {
  margin-top: 170rpx;
  height: 90rpx;
  display: flex;
  margin-left: 40rpx;
  margin-right: 40rpx;
  justify-content: center;
  /* 水平居中 */
  align-items: center;
  /* 垂直居中 */
  color: #fff;
}
.button-active {
  background-color: #2D8BF7;
}
.button-disabled {
  background-color: #ccc;
}
/* pages/login/login.wxss */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 80vh;
  width: 100%;
}
image {
  position: fixed;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: -999;
}
.input {
  flex: 1;
  height: 30rpx;
  padding: 10rpx;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #fff;
  font-size: 35rpx;
  padding-left: 15rpx;
  width: 100%;
}
.input-wrapper {
  display: flex;
  /* 使用 Flex 布局使 text 和 input 在同一行 */
  align-items: center;
  justify-content: center;
  width: 95%;
  height: 20%;
}
.input-label {
  flex: 1;
  /* 让值占据剩余空间 */
  align-items: left;
  width: 150rpx;
  margin-right: 10rpx;
  font-size: 31rpx;
  color: #fff;
  font-weight: bold;
  text-align: justify;
  text-align-last: justify;
}
.label-container {
  width: 140rpx;
  display: flex;
  align-items: center;
}
.login-button {
  margin-top: 50rpx;
  margin-left: 40rpx;
  margin-right: 40rpx;
  height: 90rpx;
  justify-content: center;
  /* 水平居中 */
  align-items: center;
  /* 垂直居中 */
  display: flex;
}
.code-button {
  width: 38%;
  font-size: 28rpx;
  margin-left: 15rpx;
}
pages/wxlogin/wxlogin.js
New file
@@ -0,0 +1,26 @@
// pages/wxlogin/wxlogin.js
Page({
  data: {
    userInfo: null
  },
 /**
   * 获取微信code
   */
  getCode: function (e) {
    wx.login({
      success: function (res) {
        if (res.code) {
          var code = res.code;
          console.log(code);
          wx.navigateTo({
            url: '/pages/wxbind/wxbind'
          })
          // 将code发送到服务器获取openid
        } else {
          console.log('登录失败!' + res.errMsg);
        }
      }
    });
  }
})
pages/wxlogin/wxlogin.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/wxlogin/wxlogin.wxml
New file
@@ -0,0 +1,7 @@
<view class="container">
  <view>
    <image src="/images/login_bg.jpeg"></image>
  </view>
  <view class="title">大禹节水管灌系统</view>
  <button class="login-btn" bindtap="getCode">微信登录</button>
</view>
pages/wxlogin/wxlogin.wxss
New file
@@ -0,0 +1,59 @@
image {
  position: fixed;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: -999;
}
.container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 80vh;
  width: 100%;
}
.title {
  font-size: 24px;
  margin-bottom: 300rpx;
  color: #1890FF;
}
.login-btn {
  width: 200px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #4CAF50;
  color: white;
  border-radius: 20px;
}
.user-info {
  margin-top: 20px;
  display: flex;
  align-items: center;
}
.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 10px;
}
.nickName {
  font-size: 16px;
}
.login-btn-clicked  {
  background-color: #45a049; /* 点击时的背景色 */
}
.login-btn:hover {
  background-color: #45a049; /* 鼠标悬停时的背景色 */
}
project.config.json
@@ -24,5 +24,5 @@
    "tabIndent": "auto",
    "tabSize": 2
  },
  "appid": "wx022cdcb93e578771"
  "appid": "wxbc2b6a00dd904ead"
}
utils/storage.js
New file
@@ -0,0 +1,61 @@
const setItem = (key, data) => {
  return new Promise((resolve, reject) => {
    wx.setStorage({
      key: key,
      data: data,
      success: resolve,
      fail: reject
    });
  });
};
const getItem = (key) => {
  return new Promise((resolve, reject) => {
    wx.getStorage({
      key: key,
      success: (res) => resolve(res.data),
      fail: reject
    });
  });
};
const removeItem = (key) => {
  return new Promise((resolve, reject) => {
    wx.removeStorage({
      key: key,
      success: resolve,
      fail: reject
    });
  });
};
const clear = () => {
  return new Promise((resolve, reject) => {
    wx.clearStorage({
      success: resolve,
      fail: reject
    });
  });
};
/**
 * 判断本地是否保存了某个key
 * @param {} key
 */
const isHasKeySync= (key) => {
  try {
    const res = wx.getStorageInfoSync();
    return res.keys.includes(key);
  } catch (e) {
    console.error('Failed to get storage info:', e);
    return false;
  }
};
module.exports = {
  setItem,
  getItem,
  removeItem,
  clear,
  isHasKeySync
};