From f66a9a2c565966e98720be5e20604c6f75030f82 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期一, 28 十月 2024 17:40:13 +0800
Subject: [PATCH] 1.首页添加使用说明。2.修改扫码开阀功能。3.问题反馈功能相关
---
pages/feedback/feedback.js | 47 ++++++
pages/home/home.js | 131 ++++++++++++------
pages/home/home.json | 3
app.wxss | 1
images/info.svg | 1
pages/valveList/valveList.wxml | 4
pages/rechargeMoney/rechargMoney.js | 23 +-
pages/feedback/feedback.wxml | 10
pages/feedback/feedback.wxss | 2
api/config.js | 3
pages/valveList/valveList.js | 46 +-----
pages/openCard/openCard.js | 24 ++-
pages/home/home.wxml | 48 ++++--
pages/home/home.wxss | 40 ++++-
pages/rechargeMoney/rechargMoney.wxss | 6
15 files changed, 246 insertions(+), 143 deletions(-)
diff --git a/api/config.js b/api/config.js
index a21494d..d4251f5 100644
--- a/api/config.js
+++ b/api/config.js
@@ -8,8 +8,9 @@
case 'test':
// BASEURL = 'https://irrigate.dayuyanjiuyuan.top/'
// BASEURL = 'https://d4x9787456.vicp.fun/'
- BASEURL = 'http://127.0.0.1:8087/'
+ // BASEURL = 'http://127.0.0.1:8087/'
// BASEURL = 'http://192.168.40.166:8087/'
+ BASEURL = 'http://192.168.10.52:8087/'
break
default:
BASEURL = ''
diff --git a/app.wxss b/app.wxss
index 8fd9af2..01c658d 100644
--- a/app.wxss
+++ b/app.wxss
@@ -37,6 +37,7 @@
overflow-y: auto;
z-index: 0;
margin-top: 10rpx;
+ margin-bottom: 20rpx;
}
diff --git a/images/info.svg b/images/info.svg
new file mode 100644
index 0000000..deb7a92
--- /dev/null
+++ b/images/info.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 44C29.5228 44 34.5228 41.7614 38.1421 38.1421C41.7614 34.5228 44 29.5228 44 24C44 18.4772 41.7614 13.4772 38.1421 9.85786C34.5228 6.23858 29.5228 4 24 4C18.4772 4 13.4772 6.23858 9.85786 9.85786C6.23858 13.4772 4 18.4772 4 24C4 29.5228 6.23858 34.5228 9.85786 38.1421C13.4772 41.7614 18.4772 44 24 44Z" fill="none" stroke="#2D8BF7" stroke-width="4" stroke-linejoin="round"/><path fill-rule="evenodd" clip-rule="evenodd" d="M24 11C25.3807 11 26.5 12.1193 26.5 13.5C26.5 14.8807 25.3807 16 24 16C22.6193 16 21.5 14.8807 21.5 13.5C21.5 12.1193 22.6193 11 24 11Z" fill="#2D8BF7"/><path d="M24.5 34V20H23.5H22.5" stroke="#2D8BF7" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 34H28" stroke="#2D8BF7" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
diff --git a/pages/feedback/feedback.js b/pages/feedback/feedback.js
index 8c95e94..cec1120 100644
--- a/pages/feedback/feedback.js
+++ b/pages/feedback/feedback.js
@@ -3,6 +3,7 @@
const {
BASEURL
} = require('../../api/config')
+const app = getApp()
Page({
data: {
isRefreshing: false,
@@ -29,6 +30,7 @@
contentValue: '', //鍙嶉璇︽儏
accSavePath: '', //涓婁紶鐨勯煶棰戞枃浠舵帴鍙h繑鍥炵殑鍦板潃
photoSavePath: [] //涓婁紶鐨勭収鐗囨枃浠惰繑鍥炵殑鍦板潃
+
},
onLoad() {
@@ -98,10 +100,18 @@
//涓婁紶褰曞埗鐨勯煶棰戝埌鏈嶅姟鍣�
wx.uploadFile({
url: BASEURL + "wx/webFile/upPhone", //鎺ュ彛鍦板潃
- name: 'file.acc', //涓婁紶鏂囦欢鍚�
+ name: 'file', //涓婁紶鏂囦欢鍚�
filePath: tempFilePath,
+ header: {
+ 'tag': app.globalData.tag,
+ 'appId': app.globalData.AppID,
+ },
success: function (res) { //鍚庡彴杩斿洖缁欏墠绔瘑鍒悗鐨勬枃瀛�
-
+ console.log('褰曢煶涓婁紶鎴愬姛', res);
+ },
+ fail: (err) => {
+ // 澶勭悊涓婁紶澶辫触鐨勯�昏緫
+ console.log('褰曢煶涓婁紶澶辫触', err);
}
})
},
@@ -124,7 +134,7 @@
this.setData({
originFiles,
});
-
+
},
handleClick(e) {
console.log("handleClick");
@@ -167,8 +177,12 @@
url: BASEURL + "wx/webFile/upPhone", // 浠呬负绀轰緥锛岄潪鐪熷疄鐨勬帴鍙e湴鍧�
filePath: imgPath,
name: 'file',
- success: () => {
-
+ header: {
+ 'tag': app.globalData.tag,
+ 'appId': app.globalData.AppID,
+ },
+ success: (res) => {
+ console.log('鍥剧墖涓婁紶鎴愬姛', res);
},
fail: (err) => {
// 澶勭悊涓婁紶澶辫触鐨勯�昏緫
@@ -381,6 +395,29 @@
isShowVoiceView: false,
voiceTime: 0,
})
+ },
+ submit() {
+ if (this.data.contentValue !== "" || this.data.photoSavePath.length>0 || this.data.accSavePath !== "") {
+ wx.showToast({
+ title: '鎻愪氦鎴愬姛',
+ icon: 'success',
+ duration: 2000,
+ success() {}
+ })
+ setTimeout(() => {
+ wx.navigateBack({
+ delta: 1
+ });
+ }, 2000);
+ } else {
+ wx.showToast({
+ title: '璇疯緭鍏ヤ竴椤瑰弽棣堝唴瀹�',
+ icon: 'error',
+ duration: 2000,
+ success() {}
+ })
+ }
+
}
});
\ No newline at end of file
diff --git a/pages/feedback/feedback.wxml b/pages/feedback/feedback.wxml
index 0f7ba0d..ea9581b 100644
--- a/pages/feedback/feedback.wxml
+++ b/pages/feedback/feedback.wxml
@@ -1,6 +1,6 @@
<view class="container">
<!-- 椤堕儴 Tabs -->
- <view class="tabs">
+ <!-- <view class="tabs">
<view class="tab" bindtap="switchTab" data-tab="0" id="tab0">
闂鍙嶉
<view class="indicator" wx:if="{{currentTab === 0}}"></view>
@@ -9,7 +9,7 @@
宸叉彁闂
<view class="indicator" wx:if="{{currentTab === 1}}"></view>
</view>
- </view>
+ </view> -->
<view class="container-feedBack" wx:if="{{currentTab === 0}}">
<view class="container-item">
<text class="fb-text">鍙嶉璇︽儏锛�</text>
@@ -39,10 +39,10 @@
</view>
<!-- 褰曢煶涓� -->
<view wx:if="{{isShowVoiceMask}}" class="voice_starting">褰曢煶涓瓄{contDownTime}}绉�</view>
- <button class="fb-submit">鎻愪氦</button>
+ <button class="fb-submit" bind:tap="submit">鎻愪氦</button>
</view>
- <scroll-view class="container-scroll" wx:if="{{currentTab === 1}}" scroll-y="true" refresher-enabled="true" refresher-threshold="50" bindrefresherrefresh="onPullDownRefresh" refresher-triggered="{{isRefreshing}}">
+ <!-- <scroll-view class="container-scroll" wx:if="{{currentTab === 1}}" scroll-y="true" refresher-enabled="true" refresher-threshold="50" bindrefresherrefresh="onPullDownRefresh" refresher-triggered="{{isRefreshing}}">
<block wx:for="{{feedBackList}}" wx:key="index">
<view class="item">
<view class="item-data">
@@ -59,7 +59,7 @@
<image class="noMore-img" src="/images/no_more.svg" />
<text class="noMore-text">娌℃湁鏁版嵁</text>
</view>
- </scroll-view>
+ </scroll-view> -->
</view>
\ No newline at end of file
diff --git a/pages/feedback/feedback.wxss b/pages/feedback/feedback.wxss
index 10e279e..9bc4a3e 100644
--- a/pages/feedback/feedback.wxss
+++ b/pages/feedback/feedback.wxss
@@ -27,7 +27,7 @@
background-color: #fff;
padding-left: 40rpx;
padding-right: 40rpx;
- padding-top: 1rpx;
+ padding-top: 40rpx;
padding-bottom: 1rpx;
}
diff --git a/pages/home/home.js b/pages/home/home.js
index cbba07e..ce099b8 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -31,6 +31,8 @@
showForceConfirm: false, //鏄惁寮哄埗寮�闃�
lastIntakeName: "",
isLogin: false, //鏄惁宸茬粡鐧诲綍
+ showInfoDialog: false,
+
},
openValve: function (e) {
@@ -44,7 +46,6 @@
icon: 'error'
})
}
-
},
calculateScrollViewHeight: function () {
wx.createSelectorQuery().selectAll('.list-item').boundingClientRect((rects) => {
@@ -55,7 +56,7 @@
}).exec();
},
startPullDownRefresh() {
- if(this.data.isLogin){
+ if (this.data.isLogin) {
if (!this.data.isWXRefreshing) {
var self = this;
console.log(this.data.isRefreshing);
@@ -64,14 +65,12 @@
});
this.getOpenList();
}
- }else{
+ } else {
wx.showToast({
title: '璇峰厛鐧诲綍',
icon: 'error'
})
}
-
-
},
//鑾峰彇鐢ㄦ埛鏁版嵁
getUserData() {
@@ -115,6 +114,9 @@
const app = getApp();
storage.getItem('sessionId').then((data) => {
app.globalData.sessionId = data;
+ this.setData({
+ isLogin: true
+ })
if (app.globalData.sessionId) {
this.getOpenList();
this.getUserDataBySession();
@@ -324,32 +326,44 @@
* 鑾峰彇涓哄叧闃�璁板綍
*/
getOpenList() {
- const app = getApp();
- const params = {
- url: 'wx/valve/get',
- data: {
- operator: app.globalData.sessionId
- }
- };
- get(params).then(data => {
- this.setData({
- listData: data.content,
- isRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
- isWXRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
- })
- this.updateDisplayText();
- }).catch(err => {
- // 閿欒鍥炶皟
- this.setData({
- isRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
- isWXRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
- })
+ if (this.data.isLogin) {
+ const app = getApp();
+ const params = {
+ url: 'wx/valve/get',
+ data: {
+ operator: app.globalData.sessionId
+ }
+ };
+ get(params).then(data => {
+ this.setData({
+ listData: data.content,
+ isRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
+ isWXRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
+ })
+ this.updateDisplayText();
+ }).catch(err => {
+ // 閿欒鍥炶皟
+ this.setData({
+ isRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
+ isWXRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
+ })
+ wx.showToast({
+ title: err.msg,
+ icon: 'error',
+ duration: 3000
+ })
+ });
+ } else {
wx.showToast({
- title: err.msg,
- icon: 'error',
- duration: 3000
+ title: '璇峰厛鐧诲綍',
+ icon: 'error'
})
- });
+ this.setData({
+ isRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
+ isWXRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
+ })
+ }
+
},
/**
* 纭鍏抽棴鍥炶皟
@@ -403,25 +417,36 @@
* 鎵爜寮�闃�
*/
scenCode() {
- const that = this;
- wx.scanCode({
- success(res) {
- console.log(res.result); // 褰撲笖浠呭綋鎵爜涓洪潪寰俊浜岀淮鐮佹椂锛屼細杩斿洖result
- if (res.result.startsWith("content://")) {
- let jsonStr = res.result.replace("content://", "")
- try {
- that.saveData(jsonStr)
- } catch (error) {
- console.error('Error parsing JSON:', error);
+ if (this.data.isLogin) {
+ const that = this;
+ wx.scanCode({
+ success(res) {
+ console.log(res.result); // 褰撲笖浠呭綋鎵爜涓洪潪寰俊浜岀淮鐮佹椂锛屼細杩斿洖result
+ if (res.result.startsWith("content://")) {
+ let jsonStr = res.result.replace("content://", "")
+ try {
+ that.saveData(jsonStr)
+ } catch (error) {
+ console.error('Error parsing JSON:', error);
+ }
+ } else {
+ wx.navigateTo({
+ url: '/pages/openCard/openCard?intakeName=' + res.result,
+ })
+ // that.postOppenValva()
}
- } else {
- that.postOppenValva(res.result)
+ },
+ fail(err) {
+ console.error(err);
}
- },
- fail(err) {
- console.error(err);
- }
- })
+ })
+ } else {
+ wx.showToast({
+ title: '璇峰厛鐧诲綍',
+ icon: 'error'
+ })
+ }
+
},
confirmForceDialog() {
console.log("confirmForceDialog");
@@ -594,7 +619,7 @@
userPhone: "璇风櫥褰�",
userName: "鏈櫥褰�",
listData: [],
- isLogin:false
+ isLogin: false
})
app.globalData.sessionId = "";
app.globalData.clientId = ""
@@ -611,5 +636,17 @@
// 澶勭悊閿欒鍝嶅簲
console.error('璇锋眰澶辫触:', error);
});
+ },
+ //鐐瑰嚮鎻愮ず鎸夐挳
+ infoShow() {
+ this.setData({
+ showInfoDialog: true
+ })
+ },
+ //鎻愮ず绐楃‘璁ゆ寜閽�
+ confirmBtnInfoDialog() {
+ this.setData({
+ showInfoDialog: false
+ })
}
})
\ No newline at end of file
diff --git a/pages/home/home.json b/pages/home/home.json
index 296a6dd..2b845e1 100644
--- a/pages/home/home.json
+++ b/pages/home/home.json
@@ -4,7 +4,8 @@
"t-avatar": "tdesign-miniprogram/avatar/avatar",
"t-switch": "tdesign-miniprogram/switch/switch",
"t-dialog": "tdesign-miniprogram/dialog/dialog",
- "t-swipe-cell": "tdesign-miniprogram/swipe-cell/swipe-cell"
+ "t-swipe-cell": "tdesign-miniprogram/swipe-cell/swipe-cell",
+ "t-button": "tdesign-miniprogram/button/button"
},
"navigationBarTitleText": "澶х鑺傛按",
"navigationBarTextStyle": "white",
diff --git a/pages/home/home.wxml b/pages/home/home.wxml
index b1ca00f..bc7edff 100644
--- a/pages/home/home.wxml
+++ b/pages/home/home.wxml
@@ -41,8 +41,12 @@
<view class="bottom-title">
- <text class="bottom-title-text">蹇�熷叧闃�</text>
- <text class="refresh-button" bind:tap="startPullDownRefresh">鍒锋柊</text>
+ <view class="title-center">
+ <text class="bottom-title-text">蹇�熷叧闃�</text>
+ <image class="info-img" bind:tap="infoShow" src="/images/info.svg"></image>
+ </view>
+
+ <text class="refresh-button" bind:tap="startPullDownRefresh">鍒锋柊</text>
</view>
<view class="divider"></view>
<!-- refresher-enabled="true" refresher-threshold="50" -->
@@ -56,23 +60,23 @@
<view class="scroll-bg">
<view wx:if="{{listData.length > 0}}" class="list-item" wx:for="{{listData}}" wx:key="index">
<t-swipe-cell style="width: 100%;" class="swipe-cell-base">
- <view class="swipe-cell" >
- <view class="item-left">
- <!-- <image class="item-img" src="/images/pipeline.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" data-item="{{item}}" bindchange="handleChange" value="{{true}}" label="{{['寮�', '鍏�']}}" slot="note" /> -->
- <text class="item-button" bind:tap="handleChange" data-item="{{item}}">鍏抽榾</text>
- </view>
- </view>
- <view slot="right" class="delete-btn" bind:tap="onDelete" data-item="{{item}}">{{item.displayText}}</view>
- </t-swipe-cell>
+ <view class="swipe-cell">
+ <view class="item-left">
+ <!-- <image class="item-img" src="/images/pipeline.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" data-item="{{item}}" bindchange="handleChange" value="{{true}}" label="{{['寮�', '鍏�']}}" slot="note" /> -->
+ <text class="item-button" bind:tap="handleChange" data-item="{{item}}">鍏抽榾</text>
+ </view>
+ </view>
+ <view slot="right" class="delete-btn" bind:tap="onDelete" data-item="{{item}}">{{item.displayText}}</view>
+ </t-swipe-cell>
</view>
</view>
-
+
<view wx:if="{{listData.length === 0}}" class="noMore-View-home">
<image class="noMore-img" src="/images/no_more.svg" />
<text class="noMore-text">娌℃湁寮�娉佃褰�</text>
@@ -82,5 +86,15 @@
<t-dialog class="dialog" visible="{{showConfirm}}" content="纭鍏抽棴{{waterIntakeName}}鍚楋紵" confirm-btn="{{ { content: '纭', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="鍙栨秷" bind:confirm="confirmDialog" bind:cancel="cancelDialog" />
<t-dialog class="error-dialog" title="{{errorDialogTitle}}" visible="{{showErrorDialog}}" content="{{errorData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="closeDialog" />
<t-dialog visible="{{showForceConfirm}}" content="褰撳墠铏氭嫙鍗¤鍗犵敤锛屾槸鍚﹀己鍒跺紑闃�锛�" confirm-btn="{{ { content: '寮哄埗寮�闃�', variant: 'base', theme: 'danger' } }}" cancel-btn="鍙栨秷" bind:confirm="confirmForceDialog" bind:cancel="cancelDialog" />
-
+ <t-dialog visible="{{showInfoDialog}}" title="鍙嬫儏鎻愮ず" confirm-btn="{{ confirmBtn }}" bind:confirm="confirmBtnInfoDialog">
+ <!-- 閫傞厤skyline锛屽鍔爐ype="list" -->
+ <scroll-view slot="content" type="list" scroll-y class="long-content">
+ <view class="content-container">
+ 1.缃戠粶绛変笉鍙姉鍔涘洜绱犲彲鑳藉鑷磋澶囩姸鎬佹樉绀哄欢杩熸垨閿欒銆�
+ 2.褰撴彁绀烘偍鎿嶄綔澶辫触鍚庢偍鍙◢鍚庡皾璇曢噸鏂版搷浣溿��
+ 3.鍦ㄥ畾鏃舵垨瀹氶噺寮�闃�鐨勯绾﹀紡寮�闃�杩囩▼涓紝绯荤粺浠呮樉绀哄彇娑堢姸鎬併�傚綋鐢ㄦ埛鐐瑰嚮鍙栨秷鏃讹紝绋嬪簭浼氬皾璇曟墽琛屽彇娑堟搷浣滐紝浣嗗彲鑳藉洜缃戠粶绛変笉鍙姉鍔涘洜绱犺�屽け璐ャ��
+ 4.鎴戜滑璇氭寶鍦伴個璇锋偍閫氳繃鎰忚鍙嶉娓犻亾鎻愬嚭瀹濊吹鐨勫缓璁垨鎰忚銆�
+ </view>
+ </scroll-view>
+ </t-dialog>
</view>
\ No newline at end of file
diff --git a/pages/home/home.wxss b/pages/home/home.wxss
index ee6fa2a..eb58081 100644
--- a/pages/home/home.wxss
+++ b/pages/home/home.wxss
@@ -199,16 +199,10 @@
}
.bottom-title-text {
- position: absolute;
- /* 缁濆瀹氫綅 */
- left: 50%;
- /* 绉诲姩鍒板鍣ㄧ殑涓棿 */
- transform: translateX(-50%);
- /* 閫氳繃骞崇Щ鑷韩瀹藉害鐨勪竴鍗婃潵瀹炵幇鐪熸鐨勫眳涓� */
- font-size: 16px;
- /* 瀛椾綋澶у皬 */
- color: #333;
- /* 瀛椾綋棰滆壊 */
+
+ margin-right: 10rpx; /* 缁欐枃鏈拰鍥炬爣涔嬮棿娣诲姞涓�浜涢棿璺� */
+ font-size: 16px; /* 瀛椾綋澶у皬 */
+ color: #333; /* 瀛椾綋棰滆壊 */
}
.refresh-button {
@@ -386,3 +380,29 @@
margin-bottom: 2rpx;
width: 100wh;
}
+.info-img{
+ width: 50rpx;
+ height: 50rpx;
+}
+.title-center{
+ position: absolute;
+ /* 缁濆瀹氫綅 */
+ left: 50%;
+ /* 绉诲姩鍒板鍣ㄧ殑涓棿 */
+ transform: translateX(-50%);
+ display: flex;
+ justify-content: space-between; /* 浣垮瓙鍏冪礌鍦ㄤ富杞翠笂鍧囧寑鍒嗗竷 */
+ align-items: center; /* 鍨傜洿灞呬腑瀵归綈 */
+}
+
+.content-container{
+ white-space: pre-line;
+ word-wrap: break-word; /* 闃叉闀垮崟璇嶆棤娉曟崲琛� */
+}
+
+.long-content {
+ height: 450rpx;
+ margin-top: 16rpx;
+ font-size: 32rpx;
+ color: #888;
+}
\ No newline at end of file
diff --git a/pages/openCard/openCard.js b/pages/openCard/openCard.js
index 101c497..7d989d7 100644
--- a/pages/openCard/openCard.js
+++ b/pages/openCard/openCard.js
@@ -38,7 +38,8 @@
costiomTime: "", //鑷畾涔夌亴婧夋椂闂�
waterAmount: 0, //瀹氶噺寮�闃�鐨勬按閲�
costiomWater: "", //杈撳叆鐨勮嚜瀹氫箟姘撮噺
- isWXRefreshing:false,
+ isWXRefreshing: false,
+ intakeName: "" //鎵爜寮�闃�浠庨椤典紶鏉ョ殑鍙栨按鍙e悕绉�
},
openValva(event) {
const {
@@ -47,14 +48,20 @@
if (item.isAlarmValue === true) {
//閲戦鎶ヨ
wx.navigateTo({
- url: '/pages/rechargeMoney/rechargMoney?vcId=' + item.vcId,
+ url: '/pages/rechargeMoney/rechargMoney?vcId=' + item.id,
})
} else if (item.inUse === false) {
- // 閫夋嫨铏氭嫙鍗″悗
- this.initDialogData();
this.setData({
vcId: item.id,
})
+ if (this.data.intakeName === "") {
+ // 閫夋嫨铏氭嫙鍗″悗
+ this.initDialogData();
+ } else {
+ //鎵爜寮�闃�閫昏緫
+ this.postOpenValva(false);
+ }
+
}
},
handleAutoIrrigation() {},
@@ -64,10 +71,12 @@
*/
onLoad(options) {
const {
- intakeId
+ intakeId,
+ intakeName
} = options;
this.setData({
- intakeId: intakeId
+ intakeId: intakeId,
+ intakeName: intakeName
})
console.log('intakeId:' + this.data.intakeId);
this.getCardList();
@@ -169,7 +178,7 @@
// 鏇存柊鍒楄〃鏁版嵁
this.setData({
allCardPoints: updatedList,
- isWXRefreshing:false
+ isWXRefreshing: false
});
},
handleClost() {
@@ -319,6 +328,7 @@
const data = {
intakeId: this.data.intakeId, //鍙栨按鍙D
vcId: this.data.vcId, //铏氭嫙鍗D
+ intakeName: this.data.intakeName, //鍙栨按鍙e悕绉�
operator: app.globalData.sessionId, //鎿嶄綔鍛�
forceOpen: !!isforce // 浣跨敤閫昏緫闈炴搷浣滅 !! 鏉ョ‘淇� isForce 鏄竷灏斿��
};
diff --git a/pages/rechargeMoney/rechargMoney.js b/pages/rechargeMoney/rechargMoney.js
index 88e106e..873f665 100644
--- a/pages/rechargeMoney/rechargMoney.js
+++ b/pages/rechargeMoney/rechargMoney.js
@@ -67,9 +67,9 @@
*/
onPullDownRefresh() {
this.setData({
- pageCurr: 1
+ pageCurr: 1,
})
- this.getRechargList()
+ this.getRechargList(true)
},
/**
@@ -136,7 +136,13 @@
signType: data.content.signType,
paySign: data.content.paySign,
success(res) {
+ wx.showToast({
+ title: "鍏呭�兼垚鍔�",
+ icon: 'success',
+ duration: 3000
+ })
console.log('鏀粯鎴愬姛', res);
+ this. getRechargList(true);
},
fail(err) {
console.log('鏀粯澶辫触', err);
@@ -151,7 +157,7 @@
});
},
//鑾峰彇鍏呭�艰褰�
- getRechargList() {
+ getRechargList(isRefresh) {
const params = {
url: 'wx/virtual_card/getVcRechargeRecords',
data: {
@@ -162,10 +168,10 @@
};
get(params).then(data => {
this.setData({
- allRechargeList:this.data.allRechargeList.concat( data.content.obj),
+ allRechargeList: isRefresh ? data.content.obj : this.data.allRechargeList.concat(data.content.obj),
isWXRefreshing: false, // 灏唗riggered灞炴�ц缃负false锛岃〃绀轰笅鎷夊埛鏂板凡瀹屾垚
loading: false,
- hasMore: !data.content.obj.pageTotal === this.data.pageCurr
+ hasMore: this.data.pageCurr < data.content.pageTotal
})
this.updateDisplayText();
}).catch(err => {
@@ -181,12 +187,7 @@
})
});
},
- // 鐢熸垚鏀粯绛惧悕鐨勫嚱鏁�
- generatePaySign(params) {
- const sortedKeys = Object.keys(params).sort();
- const stringToSign = sortedKeys.map(key => `${key}=${params[key]}`).join('&') + `&key=your-mch-key`;
- return md5(stringToSign).toUpperCase();
- },
+
//鍔犺浇鏇村
loadMore() {
if (this.data.hasMore && !this.data.loading) {
diff --git a/pages/rechargeMoney/rechargMoney.wxss b/pages/rechargeMoney/rechargMoney.wxss
index 8a6b7ca..652456a 100644
--- a/pages/rechargeMoney/rechargMoney.wxss
+++ b/pages/rechargeMoney/rechargMoney.wxss
@@ -128,6 +128,7 @@
width: 100%;
flex-direction: column;
margin-top: 10rpx;
+ overflow: hidden; /* 纭繚涓嶈秴鍑虹埗鍏冪礌 */
}
.rechage {
@@ -184,4 +185,9 @@
.loading {
text-align: center;
padding: 20px;
+}
+.list-container {
+ flex: 1;
+ overflow-y: auto;
+ z-index: 0;
}
\ No newline at end of file
diff --git a/pages/valveList/valveList.js b/pages/valveList/valveList.js
index 59ff542..a55db5b 100644
--- a/pages/valveList/valveList.js
+++ b/pages/valveList/valveList.js
@@ -10,33 +10,7 @@
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- listVirtualData: [{
- intakeNum: "1023356646612",
- watername: "娴嬭瘯",
- startTime: "2024.10.15 12:23",
- endTime: "2024.10.15 16:23"
-
- }, {
- intakeNum: "1023356646612",
- watername: "娴嬭瘯1",
- startTime: "2024.10.15 12:23",
- endTime: "2024.10.15 16:23"
- }, {
- intakeNum: "1023356646612",
- watername: "娴嬭瘯2",
- startTime: "2024.10.15 12:23",
- endTime: "2024.10.15 16:23"
- }, {
- intakeNum: "1023356646612",
- watername: "娴嬭瘯3",
- startTime: "2024.10.15 12:23",
- endTime: "2024.10.15 16:23"
- }, {
- intakeNum: "1023356646612",
- watername: "娴嬭瘯4",
- startTime: "2024.10.15 12:23",
- endTime: "2024.10.15 16:23"
- }],
+ listVirtualData: [],
listPhysicalData: [],
currentTab: 0,
isVirtualRefreshing: false, //铏氭嫙鍗″埛鏂颁腑
@@ -118,7 +92,7 @@
this.setData({
isVirtualRefreshing: true,
})
- this.getVirtualListData();
+ this.getVirtualListData(true);
},
//瀹炰綋鍗″埛鏂�
onPullPhysicalDownRefresh() {
@@ -128,7 +102,7 @@
this.getPhysicalListData();
},
//鑾峰彇瀹炰綋鍗″垪琛�
- getPhysicalListData() {
+ getPhysicalListData(isRefresh) {
get({
url: 'wx/intake/getCardOpenClose',
data: {
@@ -143,10 +117,10 @@
physicalIsLoding: false
});
if (data.success && data.code === "0001") {
+ const filteredData = data.content.obj.filter(item => item.openTime !== null && item.closeTime !== null);
this.setData({
- listPhysicalData: data.content.obj,
- physicalHasMore: !data.content.obj.pageTotal === this.data.physicalPageCurr,
-
+ listPhysicalData: isRefresh ? filteredData : this.data.listPhysicalData.concat(filteredData),
+ physicalHasMore: this.data.physicalPageCurr < data.content.pageTotal,
});
} else {
wx.showToast({
@@ -163,7 +137,7 @@
});
},
//鑾峰彇铏氭嫙鍗″紑鍏抽榾璁板綍
- getVirtualListData() {
+ getVirtualListData(isRefresh) {
get({
url: 'wx/intake/getVcCardOpenClose',
data: {
@@ -178,10 +152,10 @@
virtualIsLoding: false
});
if (data.success && data.code === "0001") {
+ const filteredData = data.content.obj.filter(item => item.openTime !== null && item.closeTime !== null);
this.setData({
- listPhysicalData: data.content.obj,
- physicalHasMore: !data.content.obj.pageTotal === this.data.virtualPageCurr,
-
+ listVirtualData: isRefresh ?filteredData : this.data.listVirtualData.concat(filteredData),
+ virtualhasMore: this.data.virtualPageCurr < data.content.pageTotal,
});
} else {
wx.showToast({
diff --git a/pages/valveList/valveList.wxml b/pages/valveList/valveList.wxml
index d8b95b8..bef7966 100644
--- a/pages/valveList/valveList.wxml
+++ b/pages/valveList/valveList.wxml
@@ -34,7 +34,7 @@
</view>
</block>
- <view wx:if="{{listData.length === 0}}" class="noMore-View">
+ <view wx:if="{{listVirtualData.length === 0}}" class="noMore-View">
<image class="noMore-img" src="/images/no_more.svg" />
<text class="noMore-text">娌℃湁鏁版嵁</text>
</view>
@@ -64,7 +64,7 @@
</view>
</block>
- <view wx:if="{{listData.length === 0}}" class="noMore-View">
+ <view wx:if="{{listPhysicalData.length === 0}}" class="noMore-View">
<image class="noMore-img" src="/images/no_more.svg" />
<text class="noMore-text">娌℃湁鏁版嵁</text>
</view>
--
Gitblit v1.8.0