18个文件已修改
14个文件已删除
5个文件已添加
| | |
| | | BASEURL = '' |
| | | break |
| | | case 'test': |
| | | BASEURL = '' |
| | | BASEURL = 'https://44978f7456.imdo.co/remote/' |
| | | break |
| | | default: |
| | | BASEURL = '' |
| | |
| | | // env.js 环境配置 |
| | | module.exports = { |
| | | ENV: 'production', |
| | | // ENV: 'test' |
| | | // ENV: 'production', |
| | | ENV: 'test' |
| | | } |
| | |
| | | // 引入状态码statusCode |
| | | const statusCode = require('./statusCode') |
| | | // 定义请求路径, BASEURL: 普通请求API; CBASEURL: 中台API,不使用中台可不引入CBASEURL |
| | | const { BASEURL } = require('./config') |
| | | const { |
| | | BASEURL |
| | | } = require('./config') |
| | | // 定义默认参数 |
| | | const defaultOptions = { |
| | | data: {}, |
| | |
| | | * ignoreToken: <Boolean> 是否忽略token验证 |
| | | * form: <Boolean> 是否使用formData请求 |
| | | */ |
| | | function request (options) { |
| | | let _options = Object.assign(defaultOptions, options) |
| | | let { method, url, data, ignoreToken, form } = _options |
| | | function request(options) { |
| | | // let _options = Object.assign(defaultOptions, options) |
| | | let _options = { |
| | | ...defaultOptions, |
| | | ...options |
| | | } |
| | | let { |
| | | method, |
| | | url, |
| | | data, |
| | | ignoreToken, |
| | | form, |
| | | isShowLoding |
| | | } = _options |
| | | const app = getApp() |
| | | // 设置请求头 |
| | | let header = {} |
| | |
| | | header.Authorization = `Bearer ${token}` |
| | | } |
| | | return new Promise((resolve, reject) => { |
| | | console.log("url:" + BASEURL + url); |
| | | if (isShowLoding) { |
| | | wx.showLoading({ |
| | | title: '通信中...', // 加载动画标题 |
| | | mask: true, // 是否显示透明蒙层,防止触摸穿透 |
| | | }); |
| | | } |
| | | let myUrl; |
| | | if (url.startsWith('http')) { |
| | | myUrl = url; |
| | | } else { |
| | | myUrl = BASEURL + url; |
| | | } |
| | | wx.request({ |
| | | url: BASEURL + url, |
| | | url: myUrl, |
| | | data, |
| | | header, |
| | | method, |
| | | success: (res) => { |
| | | let { statusCode: code } = res |
| | | let { |
| | | statusCode: code |
| | | } = res |
| | | console.log("success statusCode:" + code); |
| | | if (isShowLoding) { |
| | | wx.hideLoading(); // 隐藏加载动画 |
| | | } |
| | | if (code === statusCode.SUCCESS) { |
| | | if (res.data.code !== 0) { |
| | | if (res.data.code !== "0001") { |
| | | // 统一处理请求错误 |
| | | showToast(res.data.errorMsg) |
| | | reject(res.data) |
| | |
| | | showToast(`登录过期, 请重新刷新页面`) |
| | | reject(res.data) |
| | | } else { |
| | | showToast(`请求错误${url}, CODE: ${code}`) |
| | | // showToast(`请求错误${url}, CODE: ${code}`) |
| | | console.log("success 请求错误:" + code); |
| | | reject(res.data) |
| | | } |
| | | console.log("success statusCode:1111111111"); |
| | | }, |
| | | fail: (err) => { |
| | | console.log('%c err', 'color: red;font-weight: bold', err) |
| | | console.log("Error " + err); |
| | | if (isShowLoding) { |
| | | wx.hideLoading(); // 隐藏加载动画 |
| | | } |
| | | |
| | | showToast(err.errMsg) |
| | | reject(err) |
| | | } |
| | |
| | | } |
| | | |
| | | // 封装toast函数 |
| | | function showToast (title, icon='none', duration=2500, mask=false) { |
| | | function showToast(title, icon = 'none', duration = 2500, mask = false) { |
| | | wx.showToast({ |
| | | title: title || '', |
| | | icon, |
| | |
| | | }); |
| | | } |
| | | |
| | | function get (options) { |
| | | function get(options) { |
| | | return request({ |
| | | method: 'GET', |
| | | ...options |
| | | }) |
| | | } |
| | | |
| | | function post (options) { |
| | | function post(options) { |
| | | // url, data = {}, ignoreToken, form |
| | | return request({ |
| | | method: 'POST', |
| | |
| | | } |
| | | |
| | | module.exports = { |
| | | request, get, post |
| | | } |
| | | request, |
| | | get, |
| | | post |
| | | } |
| | |
| | | }) |
| | | }, |
| | | globalData: { |
| | | sessionId:'2023111514251400001', |
| | | userInfo: null, |
| | | userId:"", |
| | | userCode:"", |
| | |
| | | "pages/index/index", |
| | | "pages/logs/logs", |
| | | "pages/my/my", |
| | | "pages/recharge/recharge", |
| | | "pages/waterIntake/waterIntake", |
| | | "pages/personCharge/personcharge", |
| | | "pages/feedback/feedback", |
| | | "pages/openCard/openCard", |
| | | "pages/rechargeMoney/rechargMoney" |
| | | "pages/rechargeMoney/rechargMoney", |
| | | "pages/rechargeCard/rechargeCard" |
| | | ], |
| | | "window": { |
| | | "navigationBarTextStyle": "white", |
| | |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | padding: 200rpx 0; |
| | | box-sizing: border-box; |
| | | } |
| | | .noMore-View { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; |
| | | text-align: center; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .noMore-img{ |
| | | width: 300rpx; |
| | | height: 300rpx; |
| | | } |
| | | |
| | | .noMore-text{ |
| | | color:#969494; |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="300px" height="300px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g><path style="opacity:0.245" fill="#bfcadf" d="M 180.5,43.5 C 181.552,43.3505 182.552,43.5172 183.5,44C 186.713,48.2579 190.047,52.4246 193.5,56.5C 190.136,60.6986 186.302,64.3653 182,67.5C 177.833,64.6667 174.333,61.1667 171.5,57C 174.628,52.5742 177.628,48.0742 180.5,43.5 Z"/></g> |
| | | <g><path style="opacity:0.991" fill="#c1d1e2" d="M 57.5,51.5 C 61.5586,53.7205 64.8919,56.8872 67.5,61C 64.5,63.5 61.5,66 58.5,68.5C 55.6314,66.4659 53.2981,63.9659 51.5,61C 53.3134,57.6926 55.3134,54.526 57.5,51.5 Z"/></g> |
| | | <g><path style="opacity:0.991" fill="#c1d1e2" d="M 101.5,78.5 C 105.559,80.7205 108.892,83.8872 111.5,88C 108.5,90.5 105.5,93 102.5,95.5C 99.6314,93.4659 97.2981,90.9659 95.5,88C 97.3134,84.6926 99.3134,81.526 101.5,78.5 Z"/></g> |
| | | <g><path style="opacity:0.355" fill="#c0cddf" d="M 210.5,81.5 C 211.496,81.4142 212.329,81.7476 213,82.5C 214.515,84.6772 216.015,86.8439 217.5,89C 216.037,91.6312 214.037,93.7979 211.5,95.5C 208.963,93.7979 206.963,91.6312 205.5,89C 207.295,86.5742 208.962,84.0742 210.5,81.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#d9e2ee" d="M 195.5,94.5 C 192.443,96.3951 190.277,99.0618 189,102.5C 188.212,108.582 188.379,114.582 189.5,120.5C 189.5,141.833 189.5,163.167 189.5,184.5C 212.696,188.344 235.029,195.01 256.5,204.5C 256.649,205.552 256.483,206.552 256,207.5C 251.328,207.304 246.995,206.97 243,206.5C 242,207.167 241,207.833 240,208.5C 226.713,207.509 213.213,207.509 199.5,208.5C 198.006,208.291 196.839,207.624 196,206.5C 195.374,208.991 194.541,208.991 193.5,206.5C 188.433,207.479 183.599,207.479 179,206.5C 178,207.167 177,207.833 176,208.5C 174.333,208.5 172.667,208.5 171,208.5C 169.933,207.809 168.766,207.309 167.5,207C 168.5,206.167 169.5,205.333 170.5,204.5C 170.376,203.893 170.043,203.56 169.5,203.5C 166.558,199.277 164.391,194.61 163,189.5C 162.393,185.463 162.56,181.463 163.5,177.5C 139.994,177.831 116.661,177.498 93.5,176.5C 95.8333,176.5 98.1667,176.5 100.5,176.5C 100.333,154.497 100.5,132.497 101,110.5C 101.927,102.239 106.427,97.0718 114.5,95C 141.498,94.5 168.498,94.3334 195.5,94.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#ccd9ed" d="M 195.5,94.5 C 200.048,94.1994 203.215,96.1994 205,100.5C 207.128,106.991 207.961,113.658 207.5,120.5C 201.5,120.5 195.5,120.5 189.5,120.5C 188.379,114.582 188.212,108.582 189,102.5C 190.277,99.0618 192.443,96.3951 195.5,94.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#fbfcfd" d="M 121.5,116.5 C 126.989,116.504 128.822,119.171 127,124.5C 122.791,127.596 119.958,126.596 118.5,121.5C 119.092,119.577 120.092,117.911 121.5,116.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#fefefe" d="M 140.5,117.5 C 150.172,117.334 159.839,117.5 169.5,118C 172.167,120.333 172.167,122.667 169.5,125C 159.833,125.667 150.167,125.667 140.5,125C 137.88,122.441 137.88,119.941 140.5,117.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#fcfdfd" d="M 120.5,134.5 C 127.486,134.331 129.153,137.164 125.5,143C 121.229,144.513 118.895,143.013 118.5,138.5C 118.752,136.927 119.418,135.594 120.5,134.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#fcfdfe" d="M 140.5,134.5 C 150.172,134.334 159.839,134.5 169.5,135C 172.167,137.667 172.167,140.333 169.5,143C 159.833,143.667 150.167,143.667 140.5,143C 137.899,140.17 137.899,137.337 140.5,134.5 Z"/></g> |
| | | <g><path style="opacity:0.245" fill="#bfcadf" d="M 46.5,145.5 C 47.552,145.351 48.552,145.517 49.5,146C 52.7132,150.258 56.0465,154.425 59.5,158.5C 56.1356,162.699 52.3023,166.365 48,169.5C 43.8333,166.667 40.3333,163.167 37.5,159C 40.6283,154.574 43.6283,150.074 46.5,145.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#fcfdfe" d="M 120.5,152.5 C 127.486,152.331 129.153,155.164 125.5,161C 118.946,160.957 117.279,158.123 120.5,152.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#fefefe" d="M 140.5,152.5 C 150.172,152.334 159.839,152.5 169.5,153C 171.648,155.075 171.982,157.408 170.5,160C 160.167,160.667 149.833,160.667 139.5,160C 138.083,157.257 138.416,154.757 140.5,152.5 Z"/></g> |
| | | <g><path style="opacity:0.248" fill="#bfcadf" d="M 238.5,157.5 C 240.39,157.297 241.89,157.963 243,159.5C 246.233,163.063 249.067,166.896 251.5,171C 248.223,175.064 244.39,178.564 240,181.5C 235.833,178.667 232.333,175.167 229.5,171C 232.733,166.611 235.733,162.111 238.5,157.5 Z"/></g> |
| | | <g><path style="opacity:1" fill="#ccd9ed" d="M 93.5,176.5 C 116.661,177.498 139.994,177.831 163.5,177.5C 162.56,181.463 162.393,185.463 163,189.5C 164.391,194.61 166.558,199.277 169.5,203.5C 159.833,203.5 150.167,203.5 140.5,203.5C 136.167,203.5 131.833,203.5 127.5,203.5C 118.143,203.832 108.81,203.498 99.5,202.5C 96.2675,198.112 93.6009,193.446 91.5,188.5C 90.9106,184.029 91.5772,180.029 93.5,176.5 Z"/></g> |
| | | <g><path style="opacity:0.31" fill="#d9e2ec" d="M 91.5,188.5 C 93.6009,193.446 96.2675,198.112 99.5,202.5C 108.81,203.498 118.143,203.832 127.5,203.5C 122.102,205.74 116.435,207.407 110.5,208.5C 97.4696,207.361 84.4696,207.361 71.5,208.5C 70.0055,208.291 68.8388,207.624 68,206.5C 67.3741,208.991 66.5407,208.991 65.5,206.5C 62.5395,206.865 59.3728,207.532 56,208.5C 51.6667,207.167 47.3333,207.167 43,208.5C 41.6976,207.915 40.531,207.249 39.5,206.5C 56.1876,198.715 73.5209,192.715 91.5,188.5 Z"/></g> |
| | | <g><path style="opacity:0.282" fill="#e5ebf2" d="M 39.5,206.5 C 40.531,207.249 41.6976,207.915 43,208.5C 47.3333,207.167 51.6667,207.167 56,208.5C 59.3728,207.532 62.5395,206.865 65.5,206.5C 66.5407,208.991 67.3741,208.991 68,206.5C 68.8388,207.624 70.0055,208.291 71.5,208.5C 84.4696,207.361 97.4696,207.361 110.5,208.5C 103.939,210.424 97.2724,212.424 90.5,214.5C 88.6555,213.062 87.4888,213.396 87,215.5C 86,212.833 85,212.833 84,215.5C 83.6667,214.833 83.3333,214.167 83,213.5C 82.082,215.632 80.7487,216.299 79,215.5C 76.6667,216.167 74.3333,216.833 72,217.5C 71.2588,216.359 70.4255,216.359 69.5,217.5C 68.4593,215.009 67.6259,215.009 67,217.5C 66.3333,216.167 65.3333,215.167 64,214.5C 61.2683,217.807 58.6016,218.141 56,215.5C 55.3741,217.991 54.5407,217.991 53.5,215.5C 49.4792,216.826 45.1458,216.826 40.5,215.5C 38.6803,215.649 37.1803,216.316 36,217.5C 35.3741,215.009 34.5407,215.009 33.5,217.5C 32.4593,215.009 31.6259,215.009 31,217.5C 29.0088,216.008 26.8422,215.008 24.5,214.5C 29.3065,211.595 34.3065,208.928 39.5,206.5 Z"/></g> |
| | | <g><path style="opacity:0.272" fill="#e7edf3" d="M 140.5,203.5 C 150.167,203.5 159.833,203.5 169.5,203.5C 170.043,203.56 170.376,203.893 170.5,204.5C 169.5,205.333 168.5,206.167 167.5,207C 168.766,207.309 169.933,207.809 171,208.5C 172.667,208.5 174.333,208.5 176,208.5C 177,207.833 178,207.167 179,206.5C 183.599,207.479 188.433,207.479 193.5,206.5C 194.541,208.991 195.374,208.991 196,206.5C 196.839,207.624 198.006,208.291 199.5,208.5C 213.213,207.509 226.713,207.509 240,208.5C 241,207.833 242,207.167 243,206.5C 246.995,206.97 251.328,207.304 256,207.5C 256.483,206.552 256.649,205.552 256.5,204.5C 266.186,209.007 275.519,214.007 284.5,219.5C 282.085,219.556 279.751,219.889 277.5,220.5C 276.459,218.009 275.626,218.009 275,220.5C 274,217.833 273,217.833 272,220.5C 271.667,219.833 271.333,219.167 271,218.5C 270.333,219.833 269.333,220.833 268,221.5C 267.259,220.359 266.425,220.359 265.5,221.5C 264.402,217.639 263.569,217.639 263,221.5C 262.751,220.376 262.251,219.376 261.5,218.5C 258.833,219.833 256.167,219.833 253.5,218.5C 252.459,220.991 251.626,220.991 251,218.5C 250.333,219.833 249.333,220.833 248,221.5C 243.667,220.167 239.333,220.167 235,221.5C 232.266,220.638 232.099,219.805 234.5,219C 233.5,218.833 232.5,218.667 231.5,218.5C 229.796,219.068 228.296,219.068 227,218.5C 226,219.167 225,219.833 224,220.5C 220.57,220.306 217.07,220.306 213.5,220.5C 212.459,218.009 211.626,218.009 211,220.5C 210,217.833 209,217.833 208,220.5C 207.667,219.833 207.333,219.167 207,218.5C 206.333,219.833 205.333,220.833 204,221.5C 203.259,220.359 202.425,220.359 201.5,221.5C 200.402,217.639 199.569,217.639 199,221.5C 198.751,220.376 198.251,219.376 197.5,218.5C 194.833,219.833 192.167,219.833 189.5,218.5C 188.459,220.991 187.626,220.991 187,218.5C 186.333,219.833 185.333,220.833 184,221.5C 179.667,220.167 175.333,220.167 171,221.5C 168.266,220.638 168.099,219.805 170.5,219C 167.805,218.746 165.305,218.579 163,218.5C 162,219.167 161,219.833 160,220.5C 155.667,219.167 151.333,219.167 147,220.5C 146.833,220.167 146.667,219.833 146.5,219.5C 148.672,218.795 150.672,217.795 152.5,216.5C 150.432,214.055 148.265,211.722 146,209.5C 145.333,210.833 144.667,210.833 144,209.5C 143.667,210.167 143.333,210.833 143,211.5C 142.505,209.01 141.005,207.51 138.5,207C 139.973,206.29 140.64,205.124 140.5,203.5 Z"/></g> |
| | | <g><path style="opacity:0.253" fill="#f1f4f8" d="M 127.5,203.5 C 131.833,203.5 136.167,203.5 140.5,203.5C 140.64,205.124 139.973,206.29 138.5,207C 141.005,207.51 142.505,209.01 143,211.5C 143.333,210.833 143.667,210.167 144,209.5C 144.667,210.833 145.333,210.833 146,209.5C 148.265,211.722 150.432,214.055 152.5,216.5C 150.672,217.795 148.672,218.795 146.5,219.5C 146.667,219.833 146.833,220.167 147,220.5C 151.333,219.167 155.667,219.167 160,220.5C 161,219.833 162,219.167 163,218.5C 165.305,218.579 167.805,218.746 170.5,219C 168.099,219.805 168.266,220.638 171,221.5C 175.333,220.167 179.667,220.167 184,221.5C 185.333,220.833 186.333,219.833 187,218.5C 187.626,220.991 188.459,220.991 189.5,218.5C 192.167,219.833 194.833,219.833 197.5,218.5C 198.251,219.376 198.751,220.376 199,221.5C 199.569,217.639 200.402,217.639 201.5,221.5C 202.425,220.359 203.259,220.359 204,221.5C 205.333,220.833 206.333,219.833 207,218.5C 207.333,219.167 207.667,219.833 208,220.5C 209,217.833 210,217.833 211,220.5C 211.626,218.009 212.459,218.009 213.5,220.5C 217.07,220.306 220.57,220.306 224,220.5C 225,219.833 226,219.167 227,218.5C 228.296,219.068 229.796,219.068 231.5,218.5C 232.5,218.667 233.5,218.833 234.5,219C 232.099,219.805 232.266,220.638 235,221.5C 239.333,220.167 243.667,220.167 248,221.5C 249.333,220.833 250.333,219.833 251,218.5C 251.626,220.991 252.459,220.991 253.5,218.5C 256.167,219.833 258.833,219.833 261.5,218.5C 262.251,219.376 262.751,220.376 263,221.5C 263.569,217.639 264.402,217.639 265.5,221.5C 266.425,220.359 267.259,220.359 268,221.5C 269.333,220.833 270.333,219.833 271,218.5C 271.333,219.167 271.667,219.833 272,220.5C 273,217.833 274,217.833 275,220.5C 275.626,218.009 276.459,218.009 277.5,220.5C 279.751,219.889 282.085,219.556 284.5,219.5C 288.3,221.234 291.966,223.234 295.5,225.5C 295.585,226.995 294.919,227.995 293.5,228.5C 291.576,228.894 289.743,228.227 288,226.5C 287.259,227.641 286.425,227.641 285.5,226.5C 284.459,228.991 283.626,228.991 283,226.5C 280.975,228.725 278.642,229.059 276,227.5C 275.667,225.833 275.333,224.167 275,222.5C 274.871,225.003 273.871,227.003 272,228.5C 271.259,227.359 270.425,227.359 269.5,228.5C 268.459,226.009 267.626,226.009 267,228.5C 265.475,227.28 263.641,226.613 261.5,226.5C 258.989,226.288 256.822,226.955 255,228.5C 250.572,228.019 246.572,228.019 243,228.5C 241.676,227.12 240.343,226.786 239,227.5C 237.667,226.833 236.667,225.833 236,224.5C 235.374,226.991 234.541,226.991 233.5,224.5C 232.459,226.991 231.626,226.991 231,224.5C 229.177,228.121 226.843,228.787 224,226.5C 223.259,227.641 222.425,227.641 221.5,226.5C 220.459,228.991 219.626,228.991 219,226.5C 216.975,228.725 214.642,229.059 212,227.5C 211.667,225.833 211.333,224.167 211,222.5C 210.871,225.003 209.871,227.003 208,228.5C 207.259,227.359 206.425,227.359 205.5,228.5C 204.459,226.009 203.626,226.009 203,228.5C 201.475,227.28 199.641,226.613 197.5,226.5C 194.989,226.288 192.822,226.955 191,228.5C 186.572,228.019 182.572,228.019 179,228.5C 177.676,227.12 176.343,226.786 175,227.5C 173.667,226.833 172.667,225.833 172,224.5C 171.374,226.991 170.541,226.991 169.5,224.5C 168.459,226.991 167.626,226.991 167,224.5C 165.177,228.121 162.843,228.787 160,226.5C 159.259,227.641 158.425,227.641 157.5,226.5C 156.459,228.991 155.626,228.991 155,226.5C 152.975,228.725 150.642,229.059 148,227.5C 147.472,220.927 146.638,220.927 145.5,227.5C 144.167,227.833 142.833,228.167 141.5,228.5C 140.459,226.009 139.626,226.009 139,228.5C 138.228,227.151 137.061,226.318 135.5,226C 135.833,225.667 136.167,225.333 136.5,225C 135.167,224.667 133.833,224.333 132.5,224C 132.833,223.667 133.167,223.333 133.5,223C 132.216,222.316 131.049,222.483 130,223.5C 129,222.833 128,222.167 127,221.5C 125.902,222.967 124.402,223.801 122.5,224C 123.337,225.011 123.67,226.178 123.5,227.5C 120.495,227.22 117.661,227.554 115,228.5C 113.676,227.12 112.343,226.786 111,227.5C 109.667,226.833 108.667,225.833 108,224.5C 107.374,226.991 106.541,226.991 105.5,224.5C 104.459,226.991 103.626,226.991 103,224.5C 101.177,228.121 98.8432,228.787 96,226.5C 95.2588,227.641 94.4255,227.641 93.5,226.5C 92.4593,228.991 91.6259,228.991 91,226.5C 88.975,228.725 86.6417,229.059 84,227.5C 83.6667,225.833 83.3333,224.167 83,222.5C 82.8706,225.003 81.8706,227.003 80,228.5C 79.2588,227.359 78.4255,227.359 77.5,228.5C 76.4593,226.009 75.6259,226.009 75,228.5C 73.4747,227.28 71.6413,226.613 69.5,226.5C 66.9886,226.288 64.8219,226.955 63,228.5C 58.5718,228.019 54.5718,228.019 51,228.5C 49.6764,227.12 48.3431,226.786 47,227.5C 45.6667,226.833 44.6667,225.833 44,224.5C 43.3741,226.991 42.5407,226.991 41.5,224.5C 40.4593,226.991 39.6259,226.991 39,224.5C 37.1766,228.121 34.8432,228.787 32,226.5C 31.2588,227.641 30.4255,227.641 29.5,226.5C 28.4593,228.991 27.6259,228.991 27,226.5C 24.975,228.725 22.6417,229.059 20,227.5C 19.6667,225.833 19.3333,224.167 19,222.5C 18.8706,225.003 17.8706,227.003 16,228.5C 15.2588,227.359 14.4255,227.359 13.5,228.5C 12.4593,226.009 11.6259,226.009 11,228.5C 9.17386,226.835 7.00719,225.835 4.5,225.5C 10.8377,221.329 17.5044,217.663 24.5,214.5C 26.8422,215.008 29.0088,216.008 31,217.5C 31.6259,215.009 32.4593,215.009 33.5,217.5C 34.5407,215.009 35.3741,215.009 36,217.5C 37.1803,216.316 38.6803,215.649 40.5,215.5C 45.1458,216.826 49.4792,216.826 53.5,215.5C 54.5407,217.991 55.3741,217.991 56,215.5C 58.6016,218.141 61.2683,217.807 64,214.5C 65.3333,215.167 66.3333,216.167 67,217.5C 67.6259,215.009 68.4593,215.009 69.5,217.5C 70.4255,216.359 71.2588,216.359 72,217.5C 74.3333,216.833 76.6667,216.167 79,215.5C 80.7487,216.299 82.082,215.632 83,213.5C 83.3333,214.167 83.6667,214.833 84,215.5C 85,212.833 86,212.833 87,215.5C 87.4888,213.396 88.6555,213.062 90.5,214.5C 97.2724,212.424 103.939,210.424 110.5,208.5C 116.435,207.407 122.102,205.74 127.5,203.5 Z"/></g> |
| | | <g><path style="opacity:0.219" fill="#fafbfd" d="M 295.5,225.5 C 296.833,226.167 298.167,226.833 299.5,227.5C 299.5,228.5 299.5,229.5 299.5,230.5C 199.5,230.5 99.5,230.5 -0.5,230.5C -0.5,229.833 -0.5,229.167 -0.5,228.5C 1.00087,227.248 2.66754,226.248 4.5,225.5C 7.00719,225.835 9.17386,226.835 11,228.5C 11.6259,226.009 12.4593,226.009 13.5,228.5C 14.4255,227.359 15.2588,227.359 16,228.5C 17.8706,227.003 18.8706,225.003 19,222.5C 19.3333,224.167 19.6667,225.833 20,227.5C 22.6417,229.059 24.975,228.725 27,226.5C 27.6259,228.991 28.4593,228.991 29.5,226.5C 30.4255,227.641 31.2588,227.641 32,226.5C 34.8432,228.787 37.1766,228.121 39,224.5C 39.6259,226.991 40.4593,226.991 41.5,224.5C 42.5407,226.991 43.3741,226.991 44,224.5C 44.6667,225.833 45.6667,226.833 47,227.5C 48.3431,226.786 49.6764,227.12 51,228.5C 54.5718,228.019 58.5718,228.019 63,228.5C 64.8219,226.955 66.9886,226.288 69.5,226.5C 71.6413,226.613 73.4747,227.28 75,228.5C 75.6259,226.009 76.4593,226.009 77.5,228.5C 78.4255,227.359 79.2588,227.359 80,228.5C 81.8706,227.003 82.8706,225.003 83,222.5C 83.3333,224.167 83.6667,225.833 84,227.5C 86.6417,229.059 88.975,228.725 91,226.5C 91.6259,228.991 92.4593,228.991 93.5,226.5C 94.4255,227.641 95.2588,227.641 96,226.5C 98.8432,228.787 101.177,228.121 103,224.5C 103.626,226.991 104.459,226.991 105.5,224.5C 106.541,226.991 107.374,226.991 108,224.5C 108.667,225.833 109.667,226.833 111,227.5C 112.343,226.786 113.676,227.12 115,228.5C 117.661,227.554 120.495,227.22 123.5,227.5C 123.67,226.178 123.337,225.011 122.5,224C 124.402,223.801 125.902,222.967 127,221.5C 128,222.167 129,222.833 130,223.5C 131.049,222.483 132.216,222.316 133.5,223C 133.167,223.333 132.833,223.667 132.5,224C 133.833,224.333 135.167,224.667 136.5,225C 136.167,225.333 135.833,225.667 135.5,226C 137.061,226.318 138.228,227.151 139,228.5C 139.626,226.009 140.459,226.009 141.5,228.5C 142.833,228.167 144.167,227.833 145.5,227.5C 146.638,220.927 147.472,220.927 148,227.5C 150.642,229.059 152.975,228.725 155,226.5C 155.626,228.991 156.459,228.991 157.5,226.5C 158.425,227.641 159.259,227.641 160,226.5C 162.843,228.787 165.177,228.121 167,224.5C 167.626,226.991 168.459,226.991 169.5,224.5C 170.541,226.991 171.374,226.991 172,224.5C 172.667,225.833 173.667,226.833 175,227.5C 176.343,226.786 177.676,227.12 179,228.5C 182.572,228.019 186.572,228.019 191,228.5C 192.822,226.955 194.989,226.288 197.5,226.5C 199.641,226.613 201.475,227.28 203,228.5C 203.626,226.009 204.459,226.009 205.5,228.5C 206.425,227.359 207.259,227.359 208,228.5C 209.871,227.003 210.871,225.003 211,222.5C 211.333,224.167 211.667,225.833 212,227.5C 214.642,229.059 216.975,228.725 219,226.5C 219.626,228.991 220.459,228.991 221.5,226.5C 222.425,227.641 223.259,227.641 224,226.5C 226.843,228.787 229.177,228.121 231,224.5C 231.626,226.991 232.459,226.991 233.5,224.5C 234.541,226.991 235.374,226.991 236,224.5C 236.667,225.833 237.667,226.833 239,227.5C 240.343,226.786 241.676,227.12 243,228.5C 246.572,228.019 250.572,228.019 255,228.5C 256.822,226.955 258.989,226.288 261.5,226.5C 263.641,226.613 265.475,227.28 267,228.5C 267.626,226.009 268.459,226.009 269.5,228.5C 270.425,227.359 271.259,227.359 272,228.5C 273.871,227.003 274.871,225.003 275,222.5C 275.333,224.167 275.667,225.833 276,227.5C 278.642,229.059 280.975,228.725 283,226.5C 283.626,228.991 284.459,228.991 285.5,226.5C 286.425,227.641 287.259,227.641 288,226.5C 289.743,228.227 291.576,228.894 293.5,228.5C 294.919,227.995 295.585,226.995 295.5,225.5 Z"/></g> |
| | | </svg> |
| | |
| | | */ |
| | | data: { |
| | | sessionId: "", |
| | | showConfirm: false, |
| | | myItem:{}, |
| | | waterIntakeName: "", |
| | | image: "/images/ic_head_bg.jpg", |
| | | userPhone: "158****0723", |
| | | userName: "张三", |
| | | scrollViewHeight: 0, |
| | | listData: [{ |
| | | name: '取水口 1', |
| | | code: '1055201' |
| | | }, |
| | | { |
| | | name: '取水口 2', |
| | | code: '1055201' |
| | | }, |
| | | { |
| | | name: '取水口 3', |
| | | code: '1055201' |
| | | }, |
| | | { |
| | | name: '取水口 3', |
| | | code: '1055201' |
| | | }, |
| | | { |
| | | name: '取水口 4', |
| | | code: '1055201' |
| | | }, |
| | | { |
| | | name: '取水口 5', |
| | | code: '1055201' |
| | | }, |
| | | { |
| | | name: '取水口 6', |
| | | code: '1055201' |
| | | } |
| | | ], |
| | | listData: [], |
| | | isRefreshing: false, |
| | | isWXRefreshing: false |
| | | }, |
| | |
| | | this.setData({ |
| | | isRefreshing: true |
| | | }); |
| | | setTimeout(function () { |
| | | self.setData({ |
| | | isRefreshing: false, // 将triggered属性设置为false,表示下拉刷新已完成 |
| | | }) |
| | | console.log('下拉刷新已完成'); |
| | | }, 3000); |
| | | this.getOpenList(); |
| | | |
| | | } |
| | | |
| | | }, |
| | |
| | | wx.nextTick(() => { |
| | | this.calculateScrollViewHeight(); |
| | | }); |
| | | //当开阀成功后调用刷新 |
| | | console.log("onLoad:" + options.param); |
| | | if(options.param){ |
| | | getOpenList() ; |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.setData({ |
| | | sessionId: data |
| | | }); |
| | | if (sessionId !== "") { |
| | | |
| | | } |
| | | if (sessionId !== "") {} |
| | | }).catch((err) => { |
| | | console.error('Failed to load parameter:', err); |
| | | }); |
| | | } else { |
| | | console.log('Failed to load parameter:false'); |
| | | } |
| | | this.getOpenList(); |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | recharge() { |
| | | wx.navigateTo({ |
| | | url: '/pages/rechargeCard/rechargeCard', |
| | | }) |
| | | }, |
| | | openValveList() { |
| | | wx.showToast({ |
| | | title: '正在开发中', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | feedBack() { |
| | | wx.showToast({ |
| | | title: '正在开发中', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | handleChange(e) { |
| | | const item = e.currentTarget.dataset.item; |
| | | console.log(item); |
| | | this.setData({ |
| | | showConfirm: true, |
| | | waterIntakeName: item.intakeNum, |
| | | myItem:item |
| | | }); |
| | | }, |
| | | closeDialog() { |
| | | this.setData({ |
| | | showConfirm: false |
| | | }); |
| | | }, |
| | | /** |
| | | * 关闭阀门 |
| | | * @param {*} orderNo 订单号 |
| | | * @param {*} rtuAddr 阀控器地址 |
| | | * @param {*} vcNum 虚拟卡编号 |
| | | */ |
| | | postCloseValaue(orderNo, rtuAddr, vcNum) { |
| | | const app = getApp(); |
| | | const data = { |
| | | rtuAddr: rtuAddr, |
| | | vcNum: vcNum, //虚拟卡ID |
| | | orderNo:orderNo, |
| | | userType: 2, //用户类型1-平台,2-App |
| | | operator: app.globalData.sessionId //操作员 |
| | | }; |
| | | console.log("postCloseValaue"+data); |
| | | post({ |
| | | url: "valve/close", |
| | | data: data, |
| | | isShowLoding:true |
| | | }).then(response => { |
| | | // 处理成功响应 |
| | | console.log('请求成功:', response); |
| | | // 加载完成后隐藏加载动画 |
| | | wx.hideLoading(); |
| | | //完成后回到首页 |
| | | wx.reLaunch({ |
| | | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 |
| | | }); |
| | | }).catch(error => { |
| | | // 处理错误响应 |
| | | console.error('请求失败:', error); |
| | | }); |
| | | }, |
| | | /** |
| | | * 获取为关阀记录 |
| | | */ |
| | | getOpenList() { |
| | | const app = getApp(); |
| | | const params = { |
| | | url: 'valve/get', |
| | | data: { |
| | | operator: app.globalData.sessionId |
| | | } |
| | | }; |
| | | get(params).then(data => { |
| | | this.setData({ |
| | | listData: data.content, |
| | | isRefreshing: false, // 将triggered属性设置为false,表示下拉刷新已完成 |
| | | }) |
| | | }).catch(err => { |
| | | // 错误回调 |
| | | console.error('Error:', err); |
| | | this.setData({ |
| | | isRefreshing: false, // 将triggered属性设置为false,表示下拉刷新已完成 |
| | | }) |
| | | }); |
| | | }, |
| | | /** |
| | | * 确认关闭回调 |
| | | * @param {} item |
| | | */ |
| | | confirmDialog(){ |
| | | this.setData({ |
| | | showConfirm: false |
| | | }); |
| | | this.postCloseValaue(this.data.myItem.orderNo,this.data.myItem.rtuAddr,this.data.myItem.vcNum); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }) |
| | |
| | | "component": true, |
| | | "usingComponents": { |
| | | "t-avatar": "tdesign-miniprogram/avatar/avatar", |
| | | "t-switch": "tdesign-miniprogram/switch/switch" |
| | | "t-switch": "tdesign-miniprogram/switch/switch", |
| | | "t-dialog": "tdesign-miniprogram/dialog/dialog" |
| | | }, |
| | | "navigationBarTitleText": "大禹节水", |
| | | "navigationBarTextStyle": "white", |
| | | "enablePullDownRefresh": true |
| | | "navigationBarTextStyle": "white" |
| | | |
| | | } |
| | |
| | | </view> |
| | | |
| | | <view class="center-wrapper"> |
| | | <view class="center-view"> |
| | | <view class="center-view" bind:tap="recharge"> |
| | | <image src="/images/wallet.svg" /> |
| | | <text>充值</text> |
| | | </view> |
| | |
| | | <image src="/images/valva.svg" /> |
| | | <text>开阀</text> |
| | | </view> |
| | | <view class="center-view"> |
| | | <view class="center-view" bind:tap="openValveList"> |
| | | <image src="/images/record.svg" /> |
| | | <text>开关阀记录</text> |
| | | </view> |
| | | <view class="center-view"> |
| | | <view class="center-view" bind:tap="feedBack"> |
| | | <image src="/images/question.svg" /> |
| | | <text>问题反馈</text> |
| | | </view> |
| | |
| | | <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> |
| | | <image class="item-img" src="/images/wifi_no.svg" /> |
| | | <text>{{item.intakeNum}}</text> |
| | | <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" /> |
| | | </view> |
| | | <view> |
| | | <t-switch class="switch" bindchange="handleChange" value="{{true}}" label="{{['开', '关']}}" slot="note" /> |
| | | <t-switch wx:if="{{item.isOnLine }}" class="switch" data-item="{{item}}" bindchange="handleChange" value="{{true}}" label="{{['开', '关']}}" slot="note" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <t-dialog class="t-dialog" visible="{{showConfirm}}" content="确认关闭{{waterIntakeName}}吗?" confirm-btn="{{ { content: '确认', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="取消" bind:confirm="confirmDialog" bind:cancel="closeDialog" /> |
| | | |
| | | </view> |
| | |
| | | /* 根据需要调整图标大小 */ |
| | | margin-left: 20rpx; |
| | | } |
| | | .t-dialog{ |
| | | --td-dialog-content-font-size:40rpx; |
| | | --td-dialog-content-line-height:50rpx |
| | | } |
| | |
| | | // pages/openCard/openCard.js |
| | | // 开卡选择虚拟卡 |
| | | const { |
| | | get, |
| | | post |
| | | } = require('../../api/request.js'); |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | intakeId: 0, |
| | | |
| | | allCardPoints: [{ |
| | | id: 511111111, |
| | | balance: '30', |
| | |
| | | title: '正在开泵请稍后...', // 加载提示文字 |
| | | mask: true // 是否显示透明蒙层,防止触摸穿透,默认为 false |
| | | }); |
| | | // 模拟加载数据 |
| | | setTimeout(() => { |
| | | // 加载完成后隐藏加载动画 |
| | | wx.hideLoading(); |
| | | //完成后回到首页 |
| | | wx.reLaunch({ |
| | | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 |
| | | }); |
| | | }, 2000); // 延时 2 秒模拟加载数据 |
| | | this.postOpenValva(); |
| | | } |
| | | |
| | | }, |
| | | //开泵通信 |
| | | postOpenValva() { |
| | | const app = getApp(); |
| | | const data = { |
| | | intakeId: this.data.intakeId, //取水口ID |
| | | vcId: '2023122618460900006', //虚拟卡ID |
| | | userType: 2, //用户类型1-平台,2-App |
| | | operator: app.globalData.sessionId //操作员 |
| | | }; |
| | | post({ |
| | | url: "comRes/receive", |
| | | data: data |
| | | }).then(response => { |
| | | |
| | | // 处理成功响应 |
| | | console.log('请求成功:', response); |
| | | // 加载完成后隐藏加载动画 |
| | | wx.hideLoading(); |
| | | //完成后回到首页 |
| | | wx.reLaunch({ |
| | | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 |
| | | }); |
| | | |
| | | }).catch(error => { |
| | | // 加载完成后隐藏加载动画 |
| | | wx.hideLoading(); |
| | | // 处理错误响应 |
| | | console.error('请求失败:', error); |
| | | }); |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | const { |
| | | intakeId |
| | | } = options; |
| | | this.setData({ |
| | | intakeId |
| | | }) |
| | | console.log('intakeId:' + this.data.intakeId); |
| | | }, |
| | | |
| | | /** |
| | |
| | | <!--pages/openCard/openCard.wxml 开卡时的虚拟卡--> |
| | | <view> |
| | | <view class="container"> |
| | | |
| | | <scroll-view class="list-container" scroll-y="true" scroll-x="false"> |
| | | <block wx:for="{{allCardPoints}}" wx:key="index"> |
| | |
| | | <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> |
| | | <text class="{{item.state===1?'item-button':'item-button-gray'}}" bind:tap="openValva" data-item="{{item}}">{{item.state === 1 ? '选择' : '使用中'}}</text> |
| | | </view> |
| | | |
| | | </view> |
| | | </block> |
| | | <view wx:if="{{allCardPoints.length === 0}}" class="noMore-View"> |
| | | <image class="noMore-img" src="/images/no_more.svg" /> |
| | | <text class="noMore-text">没有数据</text> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | |
| | | display: flex; |
| | | align-items: flex-end; |
| | | /* 底部对齐 */ |
| | | } |
| | | |
| | | .list-container{ |
| | | display: flex; |
| | | padding-bottom: 30rpx; |
| | | } |
New file |
| | |
| | | // pages/rechargeCard/rechargeCard.js |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | currentTab: 0, // 当前显示的表格,默认为第一个表格 |
| | | allCardPoints: [{ |
| | | id: 511111111, |
| | | balance: '30000', |
| | | state: 1 |
| | | },{ |
| | | id: 411111111, |
| | | balance: '30', |
| | | state: 0 |
| | | },{ |
| | | id: 411111111, |
| | | balance: '30', |
| | | state: 0 |
| | | },{ |
| | | id: 411111111, |
| | | balance: '30', |
| | | state: 0 |
| | | }, |
| | | { |
| | | 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 |
| | | }, |
| | | ] |
| | | }, |
| | | // 切换 Tabs |
| | | switchTab: function (e) { |
| | | const tab = parseInt(e.currentTarget.dataset.tab); |
| | | this.setData({ |
| | | currentTab: tab |
| | | }); |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | } |
| | | |
| | | |
| | | }) |
New file |
| | |
| | | { |
| | | "usingComponents": {} |
| | | } |
New file |
| | |
| | | <!--pages/rechargeCard/rechargeCard.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" style="width: 713rpx; height: 465rpx; display: block; box-sizing: border-box"> |
| | | <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> |
| | | <text wx:if="{{item.state==0}}" class="item-card-state">使用中</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> |
| | | <view class="button-view"> |
| | | <text wx:if="{{item.state==1}}" class="ruinCard" >销卡</text> |
| | | <text wx:if="{{item.state==1}}" class="recharge">充值</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </block> |
| | | </scroll-view> |
| | | |
| | | <!-- 水卡 --> |
| | | <view class="all-waterIntake" wx:else> |
| | | <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> |
New file |
| | |
| | | /* pages/rechargeCard/rechargeCard.wxss */ |
| | | .container { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100vh; |
| | | width: 100%; |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | padding-top: 5rpx; |
| | | padding-bottom: 5rpx; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .item { |
| | | background-color: #1890FF; |
| | | margin-top: 20rpx; |
| | | margin-left: 20rpx; |
| | | margin-right: 20rpx; |
| | | padding: 30rpx; |
| | | border-radius: 30rpx; |
| | | } |
| | | |
| | | .item-card { |
| | | display: flex; |
| | | margin-left: 10rpx; |
| | | } |
| | | |
| | | .item-card text { |
| | | font-size: 35rpx; |
| | | color: #fff; |
| | | } |
| | | |
| | | |
| | | .tab { |
| | | font-size: 16px; |
| | | padding: 10px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | width: 50%; |
| | | /* Tabs 平分整个横向屏幕 */ |
| | | text-align: center; |
| | | /* 文字居中 */ |
| | | } |
| | | |
| | | .tabs { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | position: relative; |
| | | width: 100%; |
| | | border-bottom: 1px solid #eee; |
| | | /* Tabs 占满整个横向屏幕 */ |
| | | } |
| | | |
| | | .indicator { |
| | | width: 100%; |
| | | height: 3px; |
| | | background-color: #1890FF; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | transform: translateX(0); |
| | | /* 初始化位置 */ |
| | | } |
| | | |
| | | .item-bottom { |
| | | display: flex; |
| | | margin-top: 20rpx; |
| | | align-items: center; |
| | | |
| | | /* 垂直居中 */ |
| | | } |
| | | |
| | | .item-balance-img { |
| | | width: 60rpx; |
| | | height: 50rpx; |
| | | } |
| | | |
| | | .item-balance { |
| | | display: flex; |
| | | align-items: flex-end; |
| | | /* 底部对齐 */ |
| | | } |
| | | |
| | | .item-balance-text { |
| | | color: #fff; |
| | | font-size: 50rpx; |
| | | margin-left: 10rpx; |
| | | } |
| | | |
| | | .item-balance-text-yuan { |
| | | color: white; |
| | | margin-left: 10rpx; |
| | | margin-bottom: 2rpx; |
| | | } |
| | | |
| | | .item-gray { |
| | | background-color: #D3D3D3; |
| | | margin-top: 20rpx; |
| | | margin-left: 20rpx; |
| | | margin-right: 20rpx; |
| | | padding: 30rpx; |
| | | border-radius: 30rpx; |
| | | } |
| | | |
| | | .item-card-state { |
| | | margin-left: auto; |
| | | /* 将按钮固定在右边 */ |
| | | display: flex; |
| | | } |
| | | |
| | | .list-container { |
| | | flex: 1; |
| | | overflow-y: auto; |
| | | z-index: 0; |
| | | } |
| | | |
| | | .button-view { |
| | | display: flex; |
| | | width: 50%; |
| | | margin-left: auto; /* 将按钮组推到右边 */ |
| | | justify-content: space-around; |
| | | align-items: flex-end; |
| | | /* 让按钮在容器中水平平分空间 */ |
| | | } |
| | | |
| | | .ruinCard { |
| | | flex: 1; |
| | | margin-left: 20rpx; |
| | | text-align: center; |
| | | /* 可选: 使文本居中 */ |
| | | background-color: #948f8f; |
| | | color: white; |
| | | margin-left: 40rpx; |
| | | margin-top: 10rpx; |
| | | padding-bottom: 10rpx; |
| | | padding-top: 10rpx; |
| | | border-radius: 30rpx; |
| | | font-size: 30rpx; |
| | | border: none; |
| | | } |
| | | |
| | | .recharge { |
| | | flex: 1; |
| | | text-align: center; |
| | | /* 可选: 使文本居中 */ |
| | | background-color: #32CD32; |
| | | color: white; |
| | | margin-left: 30rpx; |
| | | padding-bottom: 10rpx; |
| | | padding-top: 10rpx; |
| | | border-radius: 30rpx; |
| | | font-size: 30rpx; |
| | | border: none; |
| | | |
| | | } |
| | |
| | | <!--pages/recharge/recharge.wxml--> |
| | | <view class="base-wrapper"> |
| | | <view class="user-wrapper"> |
| | | <!-- <view class="user-wrapper"> |
| | | <view> |
| | | <text>{{userName}}</text> |
| | | <text>{{userPhone}}</text> |
| | | </view> |
| | | <view> |
| | | <text>用户编号:</text> |
| | | <text>虚拟卡编号:</text> |
| | | <text>{{userCode}}</text> |
| | | </view> |
| | | <view> |
| | | <text>余额:</text> |
| | | <text>{{balance}}</text> |
| | | </view> |
| | | </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-number">100</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-number">200</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-number">300</text> |
| | | <text class="money-label">元</text> |
| | | </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-number">400</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-number">500</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-number">600</text> |
| | | <text class="money-label">元</text> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="rechage{{activeIndex === -1 ? 'active' : ''}}"> |
| | | <text >充值</text> |
| | | </view> |
| | | <view class="rechageList-view"> |
| | | <text class="rechageList" bind:tap="moveToRechargeList">充值记录</text> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <view class="rechageList-view"> |
| | | </view> |
| | | |
| | | </view> |
| | |
| | | } |
| | | |
| | | .rechage-view { |
| | | flex-grow: 1; |
| | | margin-top: 40rpx; |
| | | /* 占据剩余的全部高度 */ |
| | | flex-direction: column; |
| | | display: flex; |
| | |
| | | align-items: center; |
| | | width: 100%; |
| | | } |
| | | .rechage-view text { |
| | | font-size: 30rpx; |
| | | padding-top: 10rpx; |
| | | padding-bottom: 10rpx; |
| | | } |
| | | |
| | | .rechageList-view { |
| | | margin-top: 40rpx; |
| | | width: 50%; |
| | | background-color: #fff; |
| | | display: flex; |
| | |
| | | border-radius: 90px; |
| | | } |
| | | |
| | | .rechage-view text { |
| | | font-size: 30rpx; |
| | | padding-top: 10rpx; |
| | | padding-bottom: 10rpx; |
| | | } |
| | | |
| | | |
| | | .rechageactive text { |
| | | color: #fff; |
| | |
| | | // pages/waterIntake/waterIntake.js |
| | | const { |
| | | get, |
| | | post |
| | | } = require('../../api/request.js'); |
| | | Page({ |
| | | |
| | | |
| | | data: { |
| | | currentTab: 0, // 当前显示的表格,默认为第一个表格 |
| | | commonWaterPoints: [ "常用取水口2", "常用取水口3"], // 常用取水口数据 |
| | | allWaterPoints: ["所有取水口1", "所有取水口2", "所有取水口3"], // 所有取水口数据 |
| | | searchQuery:"", |
| | | commonWaterPoints: [], // 常用取水口数据 |
| | | allWaterPoints: [], // 所有取水口数据 |
| | | }, |
| | | |
| | | // 切换 Tabs |
| | |
| | | currentTab: tab |
| | | }); |
| | | }, |
| | | onSearch: function() { |
| | | onInput(e){ |
| | | this.setData({ |
| | | searchQuery: e.detail.value // 将输入框的值存储到 inputValue |
| | | }); |
| | | }, |
| | | onSearch: function () { |
| | | const query = this.data.searchQuery; |
| | | if (query) { |
| | | wx.showToast({ |
| | | title: '搜索: ' + query, |
| | | icon: 'success' |
| | | }); |
| | | this.getallWaterPoints(query) |
| | | // 在这里进行搜索操作,更新 allWaterPoints 数据 |
| | | } else { |
| | | wx.showToast({ |
| | | title: '请输入搜索内容', |
| | | icon: 'none' |
| | | }); |
| | | this.getallWaterPoints(query) |
| | | } |
| | | }, |
| | | |
| | |
| | | * 选择虚拟卡 |
| | | * @param {} event |
| | | */ |
| | | choseCard(event){ |
| | | choseCard(event) { |
| | | const intakeId= event.currentTarget.dataset.item.intakeId; |
| | | console.log(intakeId); |
| | | wx.navigateTo({ |
| | | url: '/pages/openCard/openCard', |
| | | url: '/pages/openCard/openCard?intakeId='+intakeId, |
| | | }) |
| | | }, |
| | | |
| | |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | this.getallWaterPoints(); |
| | | this.getcommonWaterPoints(); |
| | | }, |
| | | |
| | | /** |
| | |
| | | onShareAppMessage() { |
| | | |
| | | } |
| | | , |
| | | /** |
| | | * 获取所有取水口 |
| | | */ |
| | | getallWaterPoints: function (intakeNum) { |
| | | let params = { url: 'rtu/get_online_intakes' }; |
| | | if (intakeNum) { |
| | | params.data = { intakeNum: intakeNum }; |
| | | } |
| | | |
| | | get(params) |
| | | .then((data) => { |
| | | if(data.success&&data.code==="0001"){ |
| | | this.setData({ |
| | | allWaterPoints: data.content.obj |
| | | }); |
| | | }else{ |
| | | wx.showToast({ |
| | | title: data.msg, |
| | | }) |
| | | } |
| | | console.log('Failed to add item:'); |
| | | }) |
| | | .catch((error) => { |
| | | console.error('Failed to add item:', error); |
| | | }); |
| | | }, |
| | | getcommonWaterPoints(){ |
| | | |
| | | get({url:'rtu/used_intakes', data: { |
| | | operator: getApp().globalData.sessionId |
| | | }}) |
| | | .then((data) => { |
| | | if(data.success&&data.code==="0001"){ |
| | | this.setData({ |
| | | commonWaterPoints: data.content |
| | | }); |
| | | }else{ |
| | | wx.showToast({ |
| | | title: data.msg, |
| | | }) |
| | | } |
| | | console.log('Failed to add item:'); |
| | | }) |
| | | .catch((error) => { |
| | | console.error('Failed to add item:', error); |
| | | }); |
| | | } |
| | | }) |
| | |
| | | |
| | | <!-- 常用取水口 --> |
| | | <scroll-view class="list-container" wx:if="{{currentTab === 0}}" scroll-y="true" scroll-x="false"> |
| | | <block wx:for="{{commonWaterPoints}}" wx:key="index"> |
| | | <block wx:if="{{commonWaterPoints.length > 0}}" 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" /> |
| | | <text>{{item.intakeNum}}</text> |
| | | <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" /> |
| | | </view> |
| | | <text class="item-button" bind:tap="choseCard" data-item="{{item}}">选择</text> |
| | | <text wx:if="{{item.isOnLine}}" class="item-button" bind:tap="choseCard" data-item="{{item}}">选择</text> |
| | | </view> |
| | | </block> |
| | | <view wx:if="{{commonWaterPoints.length === 0}}" class="noMore-View"> |
| | | <image class="noMore-img" src="/images/no_more.svg" /> |
| | | <text class="noMore-text">没有数据</text> |
| | | </view> |
| | | </scroll-view> |
| | | |
| | | <!-- 所有取水口 --> |
| | |
| | | <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> |
| | | <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"> |
| | | <block wx:if="{{allWaterPoints.length > 0}}" 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" /> |
| | | <text>{{item.intakeNum}}</text> |
| | | <image class="item-img" src="{{item.isOnLine ? '/images/wifi_no.svg' : '/images/wifi_off.svg'}}" /> |
| | | </view> |
| | | <text class="item-button" bind:tap="choseCard" data-item="{{item}}">选择</text> |
| | | <text wx:if="{{item.isOnLine}}" class="item-button" bind:tap="choseCard" data-item="{{item}}">选择</text> |
| | | </view> |
| | | </block> |
| | | <view wx:if="{{allWaterPoints.length === 0}}" class="noMore-View"> |
| | | <image class="noMore-img" src="/images/no_more.svg" /> |
| | | <text class="noMore-text">没有数据</text> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | padding-top: 5rpx; |
| | | padding-bottom: 5rpx; |
| | | background-color: #fff; |
| | | width: 100%; |
| | | height: 100vh; |
| | |
| | | /* 文字居中 */ |
| | | } |
| | | |
| | | .indicator { |
| | | width: 100%; |
| | | height: 3px; |
| | | background-color: #1890FF; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | transform: translateX(0); |
| | | /* 初始化位置 */ |
| | | } |
| | | list-container |
| | | |
| | | .list { |
| | | margin-top: 20px; |
| | |
| | | } |
| | | .item-left text{ |
| | | font-size: 40rpx; |
| | | } |
| | | .indicator { |
| | | width: 100%; |
| | | height: 3px; |
| | | background-color: #1890FF; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | transform: translateX(0); |
| | | /* 初始化位置 */ |
| | | } |
| | | |
| | | .noMore-View { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; |
| | | text-align: center; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .noMore-img{ |
| | | width: 300rpx; |
| | | height: 300rpx; |
| | | } |
| | | |
| | | .noMore-text{ |
| | | color:#969494; |
| | | } |