Browse Source

页面问题处理

QAQ 陈 4 months ago
parent
commit
4a7256cfc8

+ 0 - 12
pages/homepage/homepage.js

@@ -339,20 +339,8 @@ Page({
 
   // 添加或修改立即缴费按钮点击事件
   goToPayment: function (e) {
-    // 获取当前账单信息
-    debugger
-    // const billInfo = {
-    //   amount: this.data.billInfo.totalAmount, // 应缴金额
-    //   amountDue:this.data.billInfo.totalAmount,  // 总计应缴
-    //   balance: this.data.billInfo.balance   // 账户余额
-    // };
-
-    // 编码账单信息并传递到缴费页面
-    // const billInfoStr = encodeURIComponent(JSON.stringify(billInfo));
-
     wx.navigateTo({
       url: `/pages/lijijiaofei/lijijiaofei`
-      // url: `/pages/lijijiaofei/lijijiaofei?billInfo=${billInfoStr}`
     });
   },
 

+ 1 - 1
pages/homepage/homepage.wxml

@@ -54,7 +54,7 @@
 
             <view class="detail-item">
               <text class="number blue">{{billInfo.balance}}</text>
-              <text class="label">账余额(元)</text>
+              <text class="label">账余额(元)</text>
             </view>
           </view>
         </view>

+ 1 - 1
pages/huhaobangding/huhaobangding.wxml

@@ -132,7 +132,7 @@
           <text>联系电话:{{item.phone}}</text>
           <view class="call-btn" data-phone="{{item.phone}}" bindtap="makePhoneCall">拨打电话</view>
         </view>
-        <view class="phone-query-time">客服在线时间:{{item.time}}</view>
+        <view class="phone-query-time">{{item.time}}</view>
       </view>
     </scroll-view>
   </view>

+ 2 - 0
pages/jiaofeiList/jiaofeiList.js

@@ -92,6 +92,7 @@ Page({
         },
         
         success(res) {
+          debugger
           wx.hideLoading();
           let apiReturnData = res.data;
           // 格式化日期
@@ -236,6 +237,7 @@ Page({
         '!SAAS_LOGIN_TOKEN_!': app.globalData.currentAccountInfo.dsKey
       },
       success: (res) => {
+        debugger
         wx.hideLoading();
         let apiReturnData = res.data;
         if (apiReturnData.data && Array.isArray(apiReturnData.data)) {

+ 72 - 31
pages/lijijiaofei/lijijiaofei.js

@@ -93,6 +93,15 @@ Page({
 
   // 立即缴费
   payNow: function() {
+    if (this.data.amount <= 0) {
+      wx.showToast({
+        title: '请输入缴费金额',
+        icon: 'none',
+        duration: 2000
+      });
+      return;
+    }
+
     wx.showLoading({
       title: '处理中',
     });
@@ -111,28 +120,40 @@ Page({
         dskey: app.globalData.currentAccountInfo.dsKey
       },
       success: res => {
-        wx.hideLoading();
-        console.log('预下单', res);
-        let orderNo=res.data.data.orderNo;
-        wx.requestPayment({
-          timeStamp: res.data.data.paymentSign.timeStamp,
-          nonceStr: res.data.data.paymentSign.nonceStr,
-          package: res.data.data.paymentSign.packageVal,
-          signType: 'RSA',
-          paySign: res.data.data.paymentSign.paySign,
-          success: res => {
-            console.log('支付结果', res);
-            this.createWeChatPayMentRecord(orderNo,this.data.amount);
-          },
-          fail (res) {
-            console.log("fail",res);
-          },
-          complete: () => {
+        debugger
+        if(res.data.code === '200'){
+          wx.hideLoading();
+          console.log('预下单', res);
+          let orderNo=res.data.data.orderNo;
+          wx.requestPayment({
+            timeStamp: res.data.data.paymentSign.timeStamp,
+            nonceStr: res.data.data.paymentSign.nonceStr,
+            package: res.data.data.paymentSign.packageVal,
+            signType: 'RSA',
+            paySign: res.data.data.paymentSign.paySign,
+            success: res => {
+              console.log('支付结果', res);
+              this.createWeChatPayMentRecord(orderNo,this.data.amount);
+            },
+            fail (res) {
+              console.log("fail",res);
+            },
+            complete: () => {
+            }
+          })
+        }else if(res.data.code === '500'){
+          // 支付失败处理
+          if (res.data.msg && res.data.msg.includes("系统维护中,请稍后缴费")) {
+            const parts = res.data.msg.split("|");
+            const errorMessage = parts[0]; // "不允许在线缴费" 
+            // const payStatus = parts[1];  
+            wx.showToast({
+              title: errorMessage,
+              icon: 'none',  // 不显示图标
+              duration: 2000  // 持续2秒
+          });
           }
-        })
-
-
-
+        }
       }
     })
     // 模拟支付
@@ -219,34 +240,45 @@ Page({
   // 输入数字
   inputNumber: function(e) {
     const number = e.currentTarget.dataset.number;
-    let amount = this.data.amount;
+    let customAmount = this.data.customAmount;
 
     // 处理小数点
-    if (number === '.' && amount.includes('.')) {
+    if (number === '.' && customAmount.includes('.')) {
       return;
     }
 
     // 限制小数点后两位
-    if (amount.includes('.') && amount.split('.')[1].length >= 2 && number !== '.') {
+    if (customAmount.includes('.') && customAmount.split('.')[1].length >= 2 && number !== '.') {
       return;
     }
 
+    // 处理首位为0的情况
+    if (customAmount === '0' && number !== '.') {
+      customAmount = number;
+    } else {
+      customAmount += number;
+    }
+
     // 更新金额
     this.setData({
-      amount: amount === '0' ? number : amount + number
+      customAmount: customAmount,
+      amount: parseFloat(customAmount) || 0
     });
   },
 
   // 删除数字
   deleteNumber: function() {
-    let amount = this.data.amount;
-    if (amount.length <= 1) {
+    let customAmount = this.data.customAmount;
+    if (customAmount.length <= 1) {
       this.setData({
-        amount: '0'
+        customAmount: '',
+        amount: 0
       });
     } else {
+      customAmount = customAmount.substring(0, customAmount.length - 1);
       this.setData({
-        amount: amount.substring(0, amount.length - 1)
+        customAmount: customAmount,
+        amount: parseFloat(customAmount) || 0
       });
     }
   },
@@ -254,7 +286,8 @@ Page({
   // 确认输入
   confirmInput: function() {
     this.setData({
-      showKeyboard: false
+      showKeyboard: false,
+      inputFocus: false
     });
   },
 
@@ -273,11 +306,19 @@ Page({
         value = parts[0] + '.' + parts.slice(1).join('');
       }
 
+      // 处理前导零
+      if (parts[0]) {
+        parts[0] = parts[0].replace(/^0+/, '') || '0';
+      }
+
       // 限制小数点后最多两位
       if (parts.length === 2 && parts[1].length > 2) {
-        value = parts[0] + '.' + parts[1].substring(0, 2);
+        parts[1] = parts[1].substring(0, 2);
       }
 
+      // 重新组合数字
+      value = parts.join('.');
+      
       // 限制总长度小于8位(包含小数点)
       if (value.length > 7) {
         value = value.substring(0, 7);

+ 1 - 1
pages/lijijiaofei/lijijiaofei.wxml

@@ -63,7 +63,7 @@
   </view>
 
   <!-- 缴费按钮 - 调整样式 -->
-  <view class="pay-btn" bindtap="payNow">立即缴费</view>
+  <view class="pay-btn {{amount > 0 ? 'active' : 'inactive'}}" bindtap="payNow">立即缴费</view>
 
   <!-- 数字键盘部分 -->
   <view class="keyboard" wx:if="{{showKeyboard}}">

+ 10 - 0
pages/lijijiaofei/lijijiaofei.wxss

@@ -166,6 +166,16 @@
   max-width: 800rpx;
 }
 
+.pay-btn.active {
+  background-color: rgba(46, 130, 255, 1);
+  opacity: 1;
+}
+
+.pay-btn.inactive {
+  background-color: rgba(46, 130, 255, 0.5);
+  opacity: 0.8;
+}
+
 .switch-meter {
   padding: 5px 10px;
   background-color: #f0f0f0;

+ 1 - 1
pages/tongzhiList/tongzhiList.wxss

@@ -8,7 +8,7 @@
 .custom-nav {
   display: flex;
   align-items: center;
-  height: 90rpx;
+  height: 120rpx;
   margin-bottom: 20rpx;
   background-color: #2E82FF;
   position: fixed;

+ 1 - 1
pages/tzxq/tzxq.wxml

@@ -21,7 +21,7 @@
         <view class="title-divider"></view>
         <!-- 通知内容 -->
         <view class="notice-content">
-          <rich-text nodes="{{noticeDetail.content}}"></rich-text>
+          <rich-text nodes="{{noticeDetail.content}}" class="rich-content"></rich-text>
         </view>
         
         <!-- 落款和日期放在右下角 -->

+ 29 - 0
pages/tzxq/tzxq.wxss

@@ -98,6 +98,35 @@
   line-height: 1.8;
   color: #333;
   margin-bottom: 40rpx;
+  overflow-x: hidden;
+}
+
+/* rich-text内容样式控制 */
+.notice-content rich-text {
+  width: 100%;
+  overflow-x: hidden;
+}
+
+.notice-content rich-text .rich-content {
+  width: 100%;
+  box-sizing: border-box;
+}
+
+/* 控制rich-text中的图片大小 */
+.notice-content rich-text image {
+  max-width: 100% !important;
+  height: auto !important;
+}
+
+/* 控制rich-text中的文本样式 */
+.notice-content rich-text p,
+.notice-content rich-text div,
+.notice-content rich-text span {
+  max-width: 100% !important;
+  box-sizing: border-box;
+  word-wrap: break-word;
+  margin: inherit;
+  padding: inherit;
 }
 
 /* 通知底部落款样式 */

+ 0 - 1
pages/zhangdanlist/zhangdanlist.js

@@ -82,7 +82,6 @@ Page({
           '!SAAS_LOGIN_TOKEN_!': app.globalData.currentAccountInfo.dsKey
         },
         success(res) {
-          debugger
           wx.hideLoading();
           let apiReturnData = res.data;
           _this.setData({