From ad9c163fefcfdd15463926f7713c4af81c01cd87 Mon Sep 17 00:00:00 2001
From: zuoxiao <zuoxiao>
Date: 星期四, 27 三月 2025 13:50:58 +0800
Subject: [PATCH] 更新创建灌溉计划页面,添加API通信模块,优化项目选择器和时间选择功能;增强用户体验,修复轮灌组显示逻辑,调整样式和配置文件。
---
pages/rechargeCard/rechargeCard.js | 107 +++++++++++++++++++++++++++++++----------------------
1 files changed, 63 insertions(+), 44 deletions(-)
diff --git a/pages/rechargeCard/rechargeCard.js b/pages/rechargeCard/rechargeCard.js
index d0f862a..f9eef61 100644
--- a/pages/rechargeCard/rechargeCard.js
+++ b/pages/rechargeCard/rechargeCard.js
@@ -1,54 +1,19 @@
// pages/rechargeCard/rechargeCard.js
+const {
+ get,
+ post
+} = require('../../api/request.js');
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
+ confirmBtn: { content: '纭', variant: 'base' },
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
- },
- ]
+ allCardPoints: [],
+ allWaterPoints:[],
+ showDialog:false
},
// 鍒囨崲 Tabs
switchTab: function (e) {
@@ -61,7 +26,8 @@
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad(options) {
-
+ this.getCardList();
+ this.getWaterCardList();
},
/**
@@ -111,6 +77,59 @@
*/
onShareAppMessage() {
+ },//鑾峰彇铏氭嫙鍗″垪琛�
+ getCardList(){
+ get({url:'https://d4x9787456.vicp.fun/sell/virtual_card/get', data: {
+ operator: getApp().globalData.operator
+ }})
+ .then((data) => {
+ if(data.success&&data.code==="0001"){
+ this.setData({
+ allCardPoints: data.content
+ });
+ }else{
+ wx.showToast({
+ title: data.msg,
+ })
+ }
+ console.log('Failed to add item:');
+ })
+ .catch((error) => {
+ console.error('Failed to add item:', error);
+ });
+ },
+ getWaterCardList(){
+ get({url:'https://d4x9787456.vicp.fun/sell/virtual_card/get', data: {
+ operator: getApp().globalData.operator
+ }})
+ .then((data) => {
+ if(data.success&&data.code==="0001"){
+ this.setData({
+ allWaterPoints: data.content
+ });
+ }else{
+ wx.showToast({
+ title: data.msg,
+ })
+ }
+ console.log('Failed to add item:');
+ })
+ .catch((error) => {
+ console.error('Failed to add item:', error);
+ });
+ },
+ rechargeCard(item){
+ wx.navigateTo({
+ url: '/pages/rechargeMoney/rechargMoney' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
+ });
+ },
+ ruinCard(){
+
+ },
+ closeDialog(){
+ this.setData({
+ showDialog:false
+ })
}
--
Gitblit v1.8.0