瀏覽代碼

缴费成功页面

QAQ 陈 4 月之前
父節點
當前提交
be168836c7

+ 2 - 2
app.js

@@ -1,8 +1,8 @@
 // app.js
 const utils = require('/utils/util.js')
-const baseIp= "http://localhost:9747"
+// const baseIp= "http://localhost:9747"
 // const baseIp= "http://61.177.40.178:8000/zhsw"
-// const baseIp = "http://192.168.0.215:9000/zhsw"  // 根据实际情况调整端口号
+const baseIp = "http://192.168.0.215:9000/zhsw"  // 根据实际情况调整端口号
 // 图片预览地址
 
 App({

+ 2 - 1
app.json

@@ -17,7 +17,8 @@
     "pages/tousujianyiList/tousujianyiList",
     "pages/baoxiuList/baoxiuList",
     "pages/jiaofeiList/jiaofeiList",
-    "pages/jiaofeixiangqing/jiaofeixiangqing"
+    "pages/jiaofeixiangqing/jiaofeixiangqing",
+    "pages/jiaofeiSuccess/jiaofeiSuccess"
   ],
   "tabBar": {
     "color": "rgba(182, 189, 205, 1)",

+ 26 - 8
pages/homepage/homepage.js

@@ -149,15 +149,15 @@ Page({
       this.loadPageData();
     }
     
-    // 从任何页面返回时都获取最新的未读消息数
-    this.getUnreadNoticeCount();
-    
     // 检查是否从户号管理页面返回
     const backFromHuHao = wx.getStorageSync('backFromHuHao');
     if (backFromHuHao) {
       wx.removeStorageSync('backFromHuHao');
       // 从户号管理页面返回时重新加载全部数据
       this.loadHomepageData();
+    } else {
+      // 即使不是从户号管理页面返回,也更新未读消息数
+      this.getUnreadNoticeCount();
     }
   },
 
@@ -433,11 +433,29 @@ Page({
 
   // 获取未读消息数量的方法
   getUnreadNoticeCount: function() {
-    if (app.globalData.userNoticesList) {
-      // 假设 userNoticesList 中有一个 isRead 属性表示消息是否已读
-      const unreadCount = app.globalData.userNoticesList.filter(notice => notice.readstate === '2').length;
-      this.setData({
-        unreadCount: unreadCount
+    const _this = this;
+    // 从服务器获取最新的消息通知数据
+    if (app.globalData.userWxInfo.token && app.globalData.currentAccountInfo) {
+      wx.request({
+        url: app.globalData.interfaceUrls.homePageInfo + app.globalData.currentAccountInfo.usernumber,
+        method: 'GET',
+        header: {
+          'content-type': 'application/json',
+          'token': app.globalData.userWxInfo.token,
+          'source': "wc",
+          '!SAAS_LOGIN_TOKEN_!': app.globalData.currentAccountInfo.dsKey
+        },
+        success(res) {
+          if (res.data && res.data.data) {
+            // 更新全局的用户通知列表
+            app.globalData.userNoticesList = res.data.data.sysNotifyAnnounceUserDos;
+            // 计算未读消息数量
+            const unreadCount = app.globalData.userNoticesList.filter(notice => notice.readstate === '2').length;
+            _this.setData({
+              unreadCount: unreadCount
+            });
+          }
+        }
       });
     } else {
       this.setData({

+ 29 - 0
pages/jiaofeiSuccess/jiaofeiSuccess.js

@@ -0,0 +1,29 @@
+Page({
+  data: {
+  },
+
+  onLoad: function (options) {
+    
+  },
+
+  // 返回上一页
+  goBack: function() {
+    wx.navigateBack({
+      delta: 1
+    })
+  },
+
+  // 继续报修按钮
+  continueBaoxiu: function() {
+    wx.navigateTo({
+      url: '/pages/baoxiudj/baoxiudj',
+    })
+  },
+
+  // 返回首页按钮
+  returnHome: function() {
+    wx.switchTab({
+      url: '/pages/homepage/homepage',
+    })
+  }
+}); 

+ 3 - 0
pages/jiaofeiSuccess/jiaofeiSuccess.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+} 

+ 22 - 0
pages/jiaofeiSuccess/jiaofeiSuccess.wxml

@@ -0,0 +1,22 @@
+<view class="bxcontainer">
+  
+
+  <!-- 返回按钮 -->
+  <view class="custom-nav">
+    <view bindtap="goBack">
+      <image src="/static_file/backcion.png" mode="aspectFit" class="back-icon"></image>
+    </view>    <view class="nav-title">缴费成功</view>
+  </view>
+
+  <!-- 成功提示内容 -->
+  <view class="success-content">
+    <image class="success-icon" src="/static_file/success.png"></image>
+    <view class="success-title">缴费成功</view>
+    <view class="success-desc">感谢使用智慧水务平台~</view>
+  </view>
+
+  <!-- 底部按钮 -->
+  <view class="bottom-buttons">
+    <view class="return-btn" bindtap="returnHome">返回首页</view>
+  </view>
+</view>

+ 102 - 0
pages/jiaofeiSuccess/jiaofeiSuccess.wxss

@@ -0,0 +1,102 @@
+.bxcontainer {
+  padding: 20rpx;
+  background-color: #f5f5f5;
+  min-height: 100vh;
+  padding-top: calc(90rpx + 44px + 20rpx); /* 增加了额外的顶部间距 */
+}
+
+.custom-nav {
+  display: flex;
+  align-items: center;
+  height: 90rpx;
+  margin-bottom: 20rpx;
+  background-color: #2E82FF;
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  z-index: 1000;
+  padding: 0 20rpx;
+  padding-top: 44px; /* 适配iPhone状态栏 */
+}
+
+.back-icon {
+  position: fixed;
+  top: 110rpx;
+  left: 30rpx;
+  z-index: 999;
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.nav-title {
+  flex: 1;
+  text-align: center;
+  font-size: 34rpx;
+  color: #fff;
+}
+
+.success-content {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  margin-top: 60px;
+  padding: 0 30px;
+  position: relative;
+}
+
+.success-icon {
+  width: 120px;
+  height: 120px;
+  margin-bottom: 20px;
+}
+
+.success-title {
+  font-size: 18px;
+  font-weight: 500;
+  margin-bottom: 15px;
+  color: rgba(28, 28, 47, 1);
+}
+
+.success-desc {
+  font-size: 14px;
+  color: rgba(134, 141, 155, 1);
+  text-align: center;
+  line-height: 1.5;
+}
+
+.bottom-buttons {
+  position: relative;
+  margin-top: 700rpx;
+  display: flex;
+  flex-direction: column;
+  padding: 0 60rpx;
+  align-items: center;
+  width: 100%;
+  box-sizing: border-box;
+}
+
+.continue-btn {
+  background-color: #0080ff;
+  color: white;
+  border-radius: 24px;
+  font-size: 18px;
+  height: 48px;
+  line-height: 48px;
+  margin-bottom: 15px;
+  width: 100%;
+  text-align: center;
+}
+
+.return-btn {
+  background-color: transparent;
+  color: rgba(46, 130, 255, 1);
+  border-radius: 24px;
+  font-size: 16px;
+  height: 48px;
+  line-height: 48px;
+  width: 100%;
+  text-align: center;
+  border: none;
+}

+ 7 - 3
pages/lijijiaofei/lijijiaofei.js

@@ -87,9 +87,13 @@ Page({
         duration: 2000,
         success: () => {
           // 支付成功后返回首页
-          setTimeout(() => {
-            wx.navigateBack();
-          }, 2000);
+          // setTimeout(() => {
+          //   url: '/pages/jiaofeiSuccess/jiaofeiSuccess'
+            
+          // }, 2000);
+          wx.navigateTo({
+            url: '/pages/jiaofeiSuccess/jiaofeiSuccess'
+          });
         }
       });
     }, 1500);

+ 2 - 2
pages/lijijiaofei/lijijiaofei.wxss

@@ -26,7 +26,7 @@
 
 .back-icon {
   position: fixed;
-  top: 100rpx;
+  top: 110rpx;
   left: 30rpx;
   z-index: 999;
   width: 40rpx;
@@ -44,7 +44,7 @@
   justify-content: space-between;
   align-items: flex-start;
   padding: 0rpx 24rpx;
-  top: -200rpx;
+  top: -190rpx;
   width: 100%;
   box-sizing: border-box;
 }