Browse Source

页面问题修复

QAQ 陈 4 months ago
parent
commit
1931baceee

+ 3 - 4
app.js

@@ -1,12 +1,12 @@
 // app.js
 const utils = require('/utils/util.js')
-const baseIp= "http://localhost:9747"
-// const baseIp = "http://192.168.0.215:9000/zhsw"  // 根据实际情况调整端口号
+// const baseIp= "http://localhost:9747"
+// const baseIp= "http://61.177.40.178:8000/zhsw"
+const baseIp = "http://192.168.0.215:9000/zhsw"  // 根据实际情况调整端口号
 // 图片预览地址
 
 App({
   onLaunch(options) {
-    // 展示本地存储能力
     const logs = wx.getStorageSync('logs') || []
     logs.unshift(Date.now())
     wx.setStorageSync('logs', logs)
@@ -29,7 +29,6 @@ App({
               dsKey: options.query.deskey
             },
             success(res) {
-              debugger
               wx.hideLoading()
               if (!res.data.code || res.data.code!= "200") {
                 utils.simleInfoWithBack('登录失败,请稍后再试')

+ 1 - 1
pages/baoxiuList/baoxiuList.wxml

@@ -22,7 +22,7 @@
           <text class="preview-text">预览图</text>
         </view>
         <!-- 已回复标识 -->
-        <image wx:if="{{item.isReplied}}" class="replied-stamp" src="/static_file/spSuccess.png"></image>
+        <image wx:if="{{item.isReplied}}" class="replied-stamp" src="/static_file/chuli.png"></image>
       </view>
     </block>
   </scroll-view>

+ 1 - 1
pages/baoxiuList/baoxiuList.wxss

@@ -220,7 +220,7 @@ vertical-align: top;
 
 .close-button {
   position: absolute;
-  top: -80rpx;
+  top: -50rpx;
   right: 0;
   width: 60rpx;
   height: 60rpx;

+ 1 - 1
pages/baoxiuSuccess/baoxiuSuccess.wxml

@@ -1,4 +1,4 @@
-<view class="container">
+<view class="bxcontainer">
   
 
   <!-- 返回按钮 -->

+ 7 - 6
pages/baoxiuSuccess/baoxiuSuccess.wxss

@@ -1,4 +1,4 @@
-.container {
+.bxcontainer {
   padding: 20rpx;
   background-color: #f5f5f5;
   min-height: 100vh;
@@ -38,8 +38,9 @@
   flex-direction: column;
   align-items: center;
   justify-content: center;
-  margin-top: 100px;
+  margin-top: 60px;
   padding: 0 30px;
+  position: relative;
 }
 
 .success-icon {
@@ -63,14 +64,14 @@
 }
 
 .bottom-buttons {
-  position: fixed;
-  bottom: 300px;
-  left: 0;
-  right: 0;
+  position: relative;
+  margin-top: 80px;
   display: flex;
   flex-direction: column;
   padding: 0 30px;
   align-items: center;
+  width: 100%;
+  box-sizing: border-box;
 }
 
 .continue-btn {

+ 113 - 67
pages/baoxiudj/baoxiudj.js

@@ -1,4 +1,4 @@
-const app=getApp();
+const app = getApp();
 Page({
   data: {
     address: app.globalData.currentAccountInfo.address,
@@ -16,11 +16,12 @@ Page({
     id: '',
     mode: '',
     isReplied: false,
+    formSubmitted: false,
   },
 
-  onLoad: function(options) {
+  onLoad: function (options) {
     const isReplied = options.isReplied === 'true';
-    
+
     if (options.mode === 'preview') {
       this.setData({
         isPreviewMode: true,
@@ -40,9 +41,9 @@ Page({
     }
   },
 
-  startCountDown: function() {
+  startCountDown: function () {
     let that = this;
-    let timer = setInterval(function() {
+    let timer = setInterval(function () {
       if (that.data.countDown > 0) {
         that.setData({
           countDown: that.data.countDown - 1
@@ -53,7 +54,7 @@ Page({
     }, 1000);
   },
 
-  closeNotification: function() {
+  closeNotification: function () {
     if (this.data.countDown <= 0) {
       this.setData({
         showNotification: false
@@ -61,18 +62,18 @@ Page({
     }
   },
 
-  goBack: function() {
+  goBack: function () {
     wx.navigateBack();
   },
 
-  inputContact: function(e) {
+  inputContact: function (e) {
     this.setData({
       contact: e.detail.value
     });
     this.checkFormValidity();
   },
 
-  inputPhone: function(e) {
+  inputPhone: function (e) {
     const value = e.detail.value;
     const phoneNumber = value.replace(/\D/g, '');
     this.setData({
@@ -81,16 +82,16 @@ Page({
     this.checkFormValidity();
   },
 
-  validatePhone: function(phone) {
+  validatePhone: function (phone) {
     const phoneReg = /^1[3-9]\d{9}$/;
     return phoneReg.test(phone);
   },
 
-  showRepairTypeSelector: function() {
+  showRepairTypeSelector: function () {
     let that = this;
     wx.showActionSheet({
       itemList: ['水管漏水', '水表故障', '水龙头故障', '其他问题'],
-      success: function(res) {
+      success: function (res) {
         const types = ['水管漏水', '水表故障', '水龙头故障', '其他问题'];
         that.setData({
           repairType: types[res.tapIndex]
@@ -100,14 +101,14 @@ Page({
     });
   },
 
-  inputDescription: function(e) {
+  inputDescription: function (e) {
     this.setData({
       description: e.detail.value
     });
     this.checkFormValidity();
   },
 
-  chooseImage: function() {
+  chooseImage: function () {
     let that = this;
     if (that.data.imageList.length >= 10) {
       wx.showToast({
@@ -116,28 +117,27 @@ Page({
       });
       return;
     }
-    
+
     wx.chooseMedia({
-      count: 3 - that.data.imageList.length,
+      count: 10 - that.data.imageList.length,
       mediaType: ['image'],
       sourceType: ['album', 'camera'],
       sizeType: ['compressed'],
-      success: function(res) {
+      success: function (res) {
         let tempFiles = res.tempFiles;
         let validFiles = [];
-        debugger;
         for (let i = 0; i < tempFiles.length; i++) {
           const file = tempFiles[i];
-          if (file.size <= 5 * 1024 * 1024) {
+          if (file.size <= 10 * 1024 * 1024) {
             validFiles.push(file);
           } else {
             wx.showToast({
-              title: '图片大小不能超过5M',
+              title: '图片大小不能超过10M',
               icon: 'none'
             });
           }
         }
-        
+
         if (validFiles.length > 0) {
           let newImageList = that.data.imageList.concat(validFiles);
           that.setData({
@@ -148,7 +148,7 @@ Page({
     });
   },
 
-  previewImage: function(e) {
+  previewImage: function (e) {
     let index = e.currentTarget.dataset.index;
     wx.previewImage({
       current: this.data.imageList[index],
@@ -156,7 +156,7 @@ Page({
     });
   },
 
-  deleteImage: function(e) {
+  deleteImage: function (e) {
     let index = e.currentTarget.dataset.index;
     let imageList = this.data.imageList;
     imageList.splice(index, 1);
@@ -165,33 +165,43 @@ Page({
     });
   },
 
-  checkFormValidity: function() {
-    const { contact, phone, address, repairType, description } = this.data;
+  checkFormValidity: function () {
+    const {
+      contact,
+      phone,
+      address,
+      repairType,
+      description
+    } = this.data;
     const isValid = contact && phone && address && repairType && description;
-    
+
     this.setData({
       isFormValid: isValid
     });
-    
+
     return isValid;
   },
 
-  onInputChange: function(e) {
-    const { field } = e.currentTarget.dataset;
-    const { value } = e.detail;
-    
+  onInputChange: function (e) {
+    const {
+      field
+    } = e.currentTarget.dataset;
+    const {
+      value
+    } = e.detail;
+
     this.setData({
       [field]: value
     });
-    
+
     this.checkFormValidity();
   },
 
-  bindPickerChange: function(e) {
+  bindPickerChange: function (e) {
     this.checkFormValidity();
   },
 
-  submitRepair: function() {
+  submitRepair: function () {
     if (!this.checkFormValidity()) {
       wx.showToast({
         title: '请填写完整信息',
@@ -199,7 +209,7 @@ Page({
       });
       return;
     }
-    
+
     if (!this.validatePhone(this.data.phone)) {
       wx.showToast({
         title: '请输入正确的手机号',
@@ -207,7 +217,7 @@ Page({
       });
       return;
     }
-    
+
     const submitData = {
       address: this.data.address,
       contact: this.data.contact,
@@ -216,19 +226,19 @@ Page({
       description: this.data.description,
       images: this.data.imageList
     };
-    
+
     console.log('提交的数据:', submitData);
-    
+
     wx.showLoading({
       title: '提交中...',
     });
-    
+
     setTimeout(() => {
       wx.hideLoading();
       wx.showToast({
         icon: 'success',
         duration: 2000,
-        success: function() {
+        success: function () {
           setTimeout(() => {
             wx.navigateTo({
               url: '/pages/baoxiuSuccess/baoxiuSuccess',
@@ -239,43 +249,51 @@ Page({
     }, 1500);
   },
 
-  loadPreviewData: function(id) {
+  loadPreviewData: function (id) {
     wx.showLoading({
       title: '加载中...',
     });
-    
+
     // 从上一个页面获取数据
     const pages = getCurrentPages();
     const prevPage = pages[pages.length - 2]; // 获取上一个页面
-    
+
     if (prevPage && prevPage.data && prevPage.data.noticeList) {
       // 根据id查找对应的报修项
       const item = prevPage.data.noticeList.find(item => item.id == id);
-      
+      debugger
       if (item) {
+        // 格式化时间
+        const formatTime = (timeString) => {
+          if (!timeString) return ''; // 如果时间为空,返回空字符串
+          const date = new Date(timeString);
+          const year = date.getFullYear();
+          const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份补零
+          const day = String(date.getDate()).padStart(2, '0'); // 日期补零
+          return `${year}-${month}-${day}`;
+        };
+
         this.setData({
-          address: item.address || '', 
+          address: item.address || '',
           contact: item.contact || '',
           phone: item.contactnumber || '',
           repairType: item.repairtype || '',
           description: item.faultdescription || '',
-          imageList: item.hasAttachment ? item.attachments.map(data=>{
-            return { tempFilePath:data};
-          }) : [],
-          replyTime: item.isReplied ? item.recoverydate : '',
-          replyContent: item.isReplied ? item.replycontent : ''
+          imageList: item.attachments || [],
+          replyTime: item.isReplied ? formatTime(item.repairtime) : '',
+          replyContent: item.isReplied ? item.remark : ''
         });
       }
     }
-    
+
     wx.hideLoading();
   },
 
-  submitForm: function() {
+  submitForm: function () {
     if (this.data.isPreviewMode) {
       return;
     }
-    
+
     if (!this.checkFormValidity()) {
       wx.showToast({
         title: '请填写完整信息',
@@ -283,7 +301,7 @@ Page({
       });
       return;
     }
-    
+
     if (!this.validatePhone(this.data.phone)) {
       wx.showToast({
         title: '请输入正确的手机号',
@@ -292,12 +310,12 @@ Page({
       return;
     }
     const fileManager = wx.getFileSystemManager();
-    this.data.imageList.map(imgInfo=>{
+    this.data.imageList.map(imgInfo => {
       const base64 = fileManager.readFileSync(imgInfo.tempFilePath, 'base64');
-      imgInfo.base64=base64;
+      imgInfo.base64 = base64;
       return imgInfo;
     })
-  
+
     const submitData = {
       address: this.data.address,
       contact: this.data.contact,
@@ -306,9 +324,9 @@ Page({
       description: this.data.description,
       images: this.data.imageList
     };
-    
+
     console.log('提交的数据:', submitData);
-    
+
     wx.showLoading({
       title: '提交中...',
     });
@@ -321,14 +339,14 @@ Page({
         'source': "wc",
         '!SAAS_LOGIN_TOKEN_!': app.globalData.currentAccountInfo.dsKey
       },
-      data:submitData,
+      data: submitData,
       success(res) {
         wx.hideLoading();
-        if(res.data.code=='200'){
-          debugger 
-            wx.navigateTo({
-              url: '/pages/baoxiuSuccess/baoxiuSuccess',
-            });
+        if (res.data.code == '200') {
+          debugger
+          wx.navigateTo({
+            url: '/pages/baoxiuSuccess/baoxiuSuccess',
+          });
         }
       },
       fail(error) {
@@ -336,11 +354,39 @@ Page({
         utils.simleInfo('登记失败,请稍后再试')
       }
     })
+
+    // 在提交成功后设置标记
+    this.setData({
+      formSubmitted: true
+    });
   },
 
-  inputAddress: function(e) {
+  inputAddress: function (e) {
     this.setData({
       address: e.detail.value
     });
   },
-}); 
+
+  onShow: function () {
+    // 检查是否是从成功页面返回
+    if (this.data.formSubmitted) {
+      // 重置表单数据
+      this.resetForm();
+      // 重置提交状态标记
+      this.setData({
+        formSubmitted: false
+      });
+    }
+  },
+
+  // 添加重置表单的方法
+  resetForm: function () {
+    this.setData({
+      contact: '',
+      phone: '',
+      repairType: '',
+      description: '',
+      imageList: []
+    });
+  },
+});

+ 5 - 4
pages/baoxiudj/baoxiudj.wxml

@@ -10,7 +10,7 @@
   <!-- 第一个卡片:地址、联系人、联系电话 -->
   <view class="bill-card first-card">
     <view class="bill-row">
-      <text style="flex: 0 1 30%">地址</text>
+      <text style="flex: 0 1 30%">地址<text class="required" wx:if="{{!isPreviewMode}}">*</text></text>
       <textarea auto-height='true' class="bill-row-address" value="{{address}}" 
                bindinput="inputAddress" data-field="address" disabled="{{isPreviewMode}}">
       </textarea>
@@ -54,24 +54,25 @@
       <view class="image-preview" wx:if="{{imageList.length > 0}}">
         <block wx:for="{{imageList}}" wx:key="index">
           <view class="image-item">
-            <image src="{{item.tempFilePath}}" mode="aspectFill" bindtap="previewImage" data-index="{{index}}"></image>
+            <image src="{{item.tempFilePath || item}}" mode="aspectFill" bindtap="previewImage" data-index="{{index}}"></image>
             <view class="delete-icon" catchtap="deleteImage" data-index="{{index}}" wx:if="{{!isPreviewMode}}">×</view>
           </view>
         </block>
       </view>
     </view>
     <view class="upload-tip" wx:if="{{imageList.length < 10 && !isPreviewMode}}">
+      最多可上传10张图片,单张不超过10M
     </view>
   </view>
 
   <!-- 回复信息卡片,仅在预览模式下显示且有回复内容时 -->
   <view class="bill-card" wx:if="{{isPreviewMode && isReplied}}">
     <view class="bill-rownew">
-      <text>回复时间</text>
+      <text>处理时间</text>
       <view class="reply-timenew">{{replyTime}}</view>
     </view>
     <view class="solid-divider"></view>
-    <view class="card-title">回复说明</view>
+    <view class="card-title">处理说明</view>
     <view class="solid-divider"></view>
     <view class="reply-content">{{replyContent}}</view>
   </view>

+ 75 - 26
pages/huhaobangding/huhaobangding.js

@@ -27,14 +27,17 @@ Page({
     phoneQueryList: [
     ],
     // 户号预览图地址
-    ylt:''
+    ylt: '',
+    isBinding: false  // 添加一个标记,表示是否正在绑定中
   },
 
-  selectTag(e) {
+  selectTag: function(e) {
     const tag = e.currentTarget.dataset.tag;
     this.setData({
       selectedTag: tag,
-      showCustomInput: tag === '自定义'
+      showCustomInput: tag === '自定义',
+      customTag: tag === '自定义' ? '' : tag,
+      tagLength: 0  // 重置计数器
     });
   },
 
@@ -113,7 +116,6 @@ Page({
 
   // 确认水站公司选择
   confirmWaterCompany: function(e) {
-    
     const index = this.data.waterCompanyIndex[0];
     this.setData({
       waterCompanyIndex: this.data.waterCompanyIndex,
@@ -123,7 +125,7 @@ Page({
         return  {
           id: index+1,
           name:  index+1+'、'+data.address,
-          phone: data.cphone,
+          phone: data.contactphone,
           time: data.worktime
         }
       }),
@@ -134,26 +136,42 @@ Page({
 
   // 户号输入
   onHuHaoInput: function(e) {
+    // 使用正则表达式去除非数字字符
+    const value = e.detail.value.replace(/[^\d]/g, '');
+    // 更新输入框的值
     this.setData({
-      huHao: e.detail.value
+      huHao: value
     });
   },
 
   // 户名输入
   onHuMingInput: function(e) {
+    // 使用正则表达式去除所有空格
+    const value = e.detail.value.replace(/\s/g, '');
     this.setData({
-      huMing: e.detail.value
+      huMing: value
     });
   },
 
   // 确认绑定
   confirmBinding: function() {
+    // 如果已经在处理绑定请求,则直接返回
+    if (this.data.isBinding) {
+      return;
+    }
+
+    // 设置绑定状态为true,防止重复点击
+    this.setData({
+      isBinding: true
+    });
+
     // 验证必填字段
     if (!this.data.waterCompany) {
       wx.showToast({
         title: '请选择水站公司',
         icon: 'none'
       });
+      this.setData({ isBinding: false }); // 重置状态
       return;
     }
 
@@ -162,6 +180,7 @@ Page({
         title: '请输入户号',
         icon: 'none'
       });
+      this.setData({ isBinding: false }); // 重置状态
       return;
     }
 
@@ -170,32 +189,49 @@ Page({
         title: '请输入户名',
         icon: 'none'
       });
+      this.setData({ isBinding: false }); // 重置状态
       return;
     }
 
-    // 处理分组信息
-    let groupInfo = this.data.selectedTag;
-    if (this.data.selectedTag === '自定义' && this.data.customTag) {
-      groupInfo = this.data.customTag;
-    }
+    // 获取最终的标签值
+    let finalTag = this.data.selectedTag;
+    // debugger
 
+    if (this.data.selectedTag === '自定义') {
+      finalTag = this.data.customTag || ''; // 使用用户输入的自定义标签
+    }
+    
+    // 如果选择了自定义但没有输入内容,提示用户
+    if (this.data.selectedTag === '自定义' && !this.data.customTag) {
+      wx.showToast({
+        title: '请输入自定义标签名称',
+        icon: 'none'
+      });
+      this.setData({ isBinding: false }); // 重置状态
+      return;
+    }
+    
+    // 构建保存的数据对象
+    const bindingData = {
+      bindWaterCompany: this.data.waterCompanyList[this.data.waterCompanyIndex[0]].id,
+      accountNum: this.data.huHao,
+      accountName: this.data.huMing,
+      groupType: finalTag,  // 使用处理后的标签值
+      openId: app.globalData.userWxInfo.openid,
+      otherDsKey: (app.globalData.bindAccountInfo||[]).map(data=>data.dsKey)
+    };
+    // debugger
     // 提交数据
     wx.showLoading({
       title: '绑定中...',
     });
+
+    const that = this; // 保存this引用
     // 调用绑定接口
     wx.request({
       url: app.globalData.interfaceUrls.accountBind,
       method: 'POST',
-      data: {
-        bindWaterCompany: this.data.waterCompanyList[this.data.waterCompanyIndex[0]].id,
-        accountNum: this.data.huHao,
-        accountName: this.data.huMing,
-        groupType: groupInfo,
-        openId: app.globalData.userWxInfo.openId,
-        defaultAccount: 0,
-        otherDsKey: (app.globalData.bindAccountInfo||[]).map(data=>data.dsKey)
-      },
+      data: bindingData,
       header: {
         'content-type': 'application/json', // 默认值
         'token':app.globalData.userWxInfo.token,
@@ -222,10 +258,13 @@ Page({
             duration: 2000
           })
           wx.hideLoading();
+          that.setData({ isBinding: false }); // 重置绑定状态
         }
-      },fail(error) {
+      },
+      fail(error) {
         wx.hideLoading()
         utils.simleInfo('登录失败,请稍后再试')
+        that.setData({ isBinding: false }); // 重置绑定状态
       }
     })
   },
@@ -261,14 +300,24 @@ Page({
     }
   },
 
-  // 添加返回方法
-  navigateBack: function() {
+  /**
+   * 返回上一页
+   */
+  goBack: function () {
     wx.navigateBack();
   },
 
-  onTagInput(e) {
+  onTagInput: function(e) {
+    let value = e.detail.value;
+    
+    // 如果超过4个字符,截取前4个字符
+    if (value.length > 4) {
+      value = value.slice(0, 4);
+    }
+    
     this.setData({
-      tagLength: e.detail.value.length
+      tagLength: value.length,
+      customTag: value
     });
   },
 

+ 1 - 3
pages/huhaobangding/huhaobangding.json

@@ -1,7 +1,5 @@
 {
   "navigationBarTitleText": "户号绑定",
-  "navigationBarBackgroundColor": "#0066FF",
-  "navigationBarTextStyle": "white",
-  "backgroundColor": "#F8F8F8",
+  "navigationStyle": "custom",
   "usingComponents": {}
 }

+ 9 - 5
pages/huhaobangding/huhaobangding.wxml

@@ -1,11 +1,15 @@
 <view class="container2">
-  <view class="custom-nav">
+  <!-- <view class="custom-nav">
     <view class="nav-back" bindtap="navigateBack">
       <view class="back-arrow"></view>
     </view>
+    <view class="nav-title">户号绑定</view> -->
+  <!-- </view>   -->
+  <view class="custom-nav">
+    <view class="fixed-back" bindtap="goBack">←</view>
     <view class="nav-title">户号绑定</view>
   </view>
-  
+
   <view class="form-group1">
     <view class="form-item">
       <text class="label">水站公司<text class="required">*</text></text>
@@ -28,7 +32,7 @@
   <view class="form-group2">
     <view class="form-item">
       <text class="label">户号<text class="required">*</text></text>
-      <input type="text" placeholder="请绑定缴费户号" placeholder-class="placeholder" bindinput="onHuHaoInput" value="{{huHao}}" />
+      <input type="number" maxlength="9" placeholder="请绑定缴费户号" placeholder-class="placeholder" bindinput="onHuHaoInput" value="{{huHao}}" />
       <view class="check-auth-btn" bindtap="showDrawer">
         查看获取方式
       </view>
@@ -36,7 +40,7 @@
 
     <view class="form-item">
       <text class="label">户名<text class="required">*</text></text>
-      <input type="text" placeholder="请输入户名" placeholder-class="placeholder" bindinput="onHuMingInput" value="{{huMing}}" />
+      <input type="text" maxlength="30" placeholder="请输入户名" placeholder-class="placeholder" bindinput="onHuMingInput" value="{{huMing}}" />
     </view>
   </view>
 
@@ -55,7 +59,7 @@
     <block wx:if="{{showCustomInput}}">
       <view class="custom-group">
         <view class="custom-input">
-          <input type="text" placeholder="请输入标签名称" maxlength="4" bindinput="onTagInput" />
+          <input type="text" placeholder="请输入标签名称" bindinput="onTagInput" value="{{customTag}}" />
           <view class="char-limit {{tagLength > 4 ? 'error' : ''}}">{{tagLength}}/4</view>
         </view>
       </view>

+ 23 - 31
pages/huhaobangding/huhaobangding.wxss

@@ -1,6 +1,6 @@
 .container2 {
   padding: 30rpx;
-  background-color: #F5F5F5;
+  background-color: rgba(242, 246, 250, 1);
   min-height: 100vh;
   display: flex;
   flex-direction: column;
@@ -8,39 +8,31 @@
   padding-top: 230rpx;
 }
 .custom-nav {
+  background-color: rgba(46, 130, 255, 1);
+  display: flex;
+  align-items: center;
+  height: 90rpx;
+  margin-bottom: 20rpx;
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
-  height: 88rpx; 
-  background-color: rgba(46, 130, 255, 1);
-  display: flex;
-  align-items: center;
-  padding-top: 110rpx; 
   z-index: 1000;
+  padding: 0 20rpx;
+  padding-top: 88rpx; /* 适配iPhone状态栏,44px转换为88rpx */
 }
 
-.nav-back {
-  width: 88rpx; 
-  height: 88rpx; 
-  display: flex;
-  align-items: center;
-  justify-content: center;
-}
-
-.back-arrow {
-  width: 24rpx;
-  height: 24rpx; 
-  border-left: 4rpx solid #fff; 
-  border-bottom: 4rpx solid #fff; 
-  transform: rotate(45deg);
+.fixed-back {
+  font-size: 40rpx;
+  text-align: center;
+  color: #fff;
 }
 
 .nav-title {
   flex: 1;
   text-align: center;
+  font-size: 34rpx;
   color: #fff;
-  font-size: 34rpx; 
 }
 
 
@@ -48,6 +40,7 @@
   background-color: #FFFFFF;
   border-radius: 18rpx;
   padding: 0 40rpx;
+  margin-top: -35rpx;
   margin-bottom: 20rpx;
   box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
 }
@@ -72,8 +65,8 @@
 
 .label {
   width: 120rpx;
-  color: #333333;
-  font-size: 30rpx;
+  color: #2e3038;
+  font-size: 32rpx;
   text-align: left;
   margin-right: 20rpx;
   display: flex;
@@ -83,7 +76,7 @@
 
 input {
   flex: 1;
-  font-size: 30rpx;
+  font-size: 32rpx;
   color: #333333;
   padding: 0 20rpx;
   text-align: right;
@@ -109,17 +102,16 @@ input {
 
 .group-select {
   background-color: #FFFFFF;
-  border-radius: 8rpx;
+  border-radius: 18rpx;
   padding: 0 40rpx;
   padding-top: 20rpx;
   margin-bottom: 30rpx;
   position: relative;
-  width: calc(100% - 80rpx);
   overflow: visible;
 }
 
 .section-title {
-  font-size: 30rpx;
+  font-size: 32rpx;
   color: #333333;
   padding: 34rpx 0;
   display: flex;
@@ -151,7 +143,7 @@ input {
   padding: 12rpx 24rpx;
   background-color: #F5F5F5;
   border-radius: 8rpx;
-  font-size: 27rpx;
+  font-size: 26rpx;
   color: rgba(0, 0, 0, 1);
   display: inline-block;
 }
@@ -197,7 +189,7 @@ input {
 .submit-btn button {
   background-color: #0066FF;
   color: #FFFFFF;
-  font-size: 32rpx;
+  font-size: 36rpx;
   border-radius: 44rpx;
   width: 100%;
   height: 88rpx;
@@ -211,7 +203,7 @@ input {
 
 .tips text {
   display: block;
-  font-size: 26rpx;
+  font-size: 28rpx;
   color: #999999;
   line-height: 1.8;
   margin-bottom: 10rpx;
@@ -223,7 +215,7 @@ input {
   border-radius: 4rpx; 
   padding: 10rpx 20rpx;
   color: rgba(31, 103, 212, 1);
-  font-size: 28rpx;
+  font-size: 26rpx;
   
 }
 

+ 104 - 79
pages/huhaoguanli/huhaoguanli.js

@@ -15,60 +15,7 @@ Page({
     this.getAccountList();
   },
 
-  // 过滤户号列表,只显示deleted=0的数据,并按默认户号排序
-  getAccountList: function () {
-    const _this = this;
-    wx.showLoading({
-      title: '获取中...',
-      mask: true,
-    });
-    wx.request({
-      url: app.globalData.interfaceUrls.accountList,
-      method: 'GET',
-      header: {
-        'content-type': 'application/json',
-        'token': app.globalData.userWxInfo.token,
-        'source': "wc",
-        '!SAAS_LOGIN_TOKEN_!': app.globalData.currentAccountInfo.dsKey
-      },
-      success(res) {
-        wx.hideLoading();
-        let apiReturnData = res.data;
-        // 从全局获取当前账户的信息currentAccountInfo
-        const currentUsernumber = app.globalData.currentAccountInfo.usernumber;
-        
-        // 对返回的数据进行排序,将默认户号(defaultAccount='0')排在前面
-        const sortedData = apiReturnData.data.sort((a, b) => {
-          // 先按defaultAccount排序('0'排在前面)
-          if (a.defaultAccount !== b.defaultAccount) {
-            return a.defaultAccount === '0' ? -1 : 1;
-          }
-          // 如果defaultAccount相同,则按是否是当前户号排序
-          if (a.usernumber === currentUsernumber) return -1;
-          if (b.usernumber === currentUsernumber) return 1;
-          return 0;
-        });
-        
-        _this.setData({
-          huHaoList: sortedData.map(item => {
-            const isCurrent = item.usernumber === currentUsernumber;
-            return {
-              ...item,
-              isCurrentUser: isCurrent
-            };
-          })
-        });
-      },
-      fail(error) {
-        wx.hideLoading();
-        console.error('获取列表失败:', error);
-        wx.showToast({
-          title: '获取数据失败,请稍后再试',
-          icon: 'none'
-        });
-      }
-    });
-  },
+
 
   // 点击解除绑定按钮
   unbindHuHao: function (e) {
@@ -94,13 +41,12 @@ Page({
     this.accountUnbind(id);
   },
   // 解绑方法
-  accountUnbind:function (id) {
-    debugger;
+  accountUnbind: function (id) {
     const unbindInfo = this.data.huHaoList.filter(item => {
       return item.id === id;
     })[0];
-    const otherInfo=this.data.huHaoList.filter(item => {
-      return item.id!= id;
+    const otherInfo = this.data.huHaoList.filter(item => {
+      return item.id != id;
     });
     const _this = this;
     wx.showLoading({
@@ -123,7 +69,7 @@ Page({
       success(res) {
         wx.hideLoading();
         let apiReturnData = res.data;
-        if(apiReturnData.code=='200'){
+        if (apiReturnData.code == '200') {
           wx.showToast({
             title: '解绑成功',
             icon: 'success',
@@ -134,17 +80,36 @@ Page({
             showUnbindModal: false,
             currentHuHao: null
           });
-          if(otherInfo.length==0){
-            app.globalData.currentAccountInfo=[];
-            app.globalData.userWxInfo.currentDsKey="";
+          
+          // 检查是否解绑的是当前正在使用的户号
+          const isCurrentAccount = unbindInfo.usernumber === app.globalData.currentAccountInfo.usernumber;
+          
+          if (otherInfo.length == 0) {
+            app.globalData.currentAccountInfo = [];
+            app.globalData.userWxInfo.currentDsKey = "";
             wx.redirectTo({
               url: '/pages/FirstBangDing/FirstBangDing',
             })
-          }else{
-            app.globalData.currentAccountInfo=otherInfo[0];
-            app.globalData.userWxInfo.currentDsKey=otherInfo[0].deKey;
+          } else {
+            // 添加刷新列表数据
+            _this.getAccountList();
+            
+            // 如果解绑的是当前户号,需要切换到另一个户号
+            if (isCurrentAccount) {
+              app.globalData.currentAccountInfo = otherInfo[0];
+              app.globalData.userWxInfo.currentDsKey = otherInfo[0].dsKey;
+              app.globalData.userWxInfo.username = otherInfo[0].username;
+              app.globalData.userWxInfo.usernumber = otherInfo[0].usernumber;
+              app.globalData.userWxInfo.address = otherInfo[0].address;
+              app.globalData.userWxInfo.groupName = otherInfo[0].groupName;
+              
+              // 将新选择的户号信息保存到本地存储
+              wx.setStorageSync('currentHuHao', otherInfo[0]);
+              // 设置一个标记表示需要刷新首页
+              wx.setStorageSync('needRefreshHomepage', true);
+            }
           }
-        }else{
+        } else {
           wx.showToast({
             title: apiReturnData.msg,
             icon: 'error',
@@ -174,7 +139,6 @@ Page({
   },
 
   switchHuHao(e) {
-    debugger;
     const huHaoInfo = e.currentTarget.dataset.item;
 
     // 更新全局数据
@@ -184,9 +148,9 @@ Page({
       usernumber: huHaoInfo.usernumber,
       address: huHaoInfo.address,
       groupName: huHaoInfo.groupName,
-      currentDsKey: huHaoInfo.dsKey  // 更新 currentDsKey
+      currentDsKey: huHaoInfo.dsKey // 更新 currentDsKey
     };
-    
+
     // 更新当前账户信息
     app.globalData.currentAccountInfo = huHaoInfo;
     // 将新选择的户号信息保存到本地存储
@@ -198,7 +162,7 @@ Page({
     });
     // 设置一个标记表示需要刷新首页
     wx.setStorageSync('needRefreshHomepage', true);
-    
+
     // 延迟跳转到首页
     setTimeout(() => {
       wx.switchTab({
@@ -208,33 +172,33 @@ Page({
   },
 
   // 设置默认户号
-  setDefaultHuHao: function(e) {
+  setDefaultHuHao: function (e) {
     const id = e.currentTarget.dataset.id;
     this.setData({
       showDefaultModal: true,
       defaultId: id
     });
   },
-  
+
   // 取消设置默认户号
-  cancelDefault: function() {
+  cancelDefault: function () {
     this.setData({
       showDefaultModal: false,
       defaultId: null
     });
   },
-  
+
   // 确认设置默认户号
-  confirmDefault: function() {
+  confirmDefault: function () {
     const id = this.data.defaultId;
     this.setDefaultAccount(id);
     this.setData({
       showDefaultModal: false
     });
   },
-  
+
   // 调用设置默认户号接口
-  setDefaultAccount: function(id) {
+  setDefaultAccount: function (id) {
     wx.showLoading({
       title: '设置中...',
     });
@@ -283,8 +247,69 @@ Page({
     });
   },
 
+  // 过滤户号列表,只显示deleted=0的数据,并按默认户号排序
+  getAccountList: function () {
+    const _this = this;
+    wx.showLoading({
+      title: '获取中...',
+      mask: true,
+    });
+    wx.request({
+      url: app.globalData.interfaceUrls.accountList,
+      method: 'GET',
+      header: {
+        'content-type': 'application/json',
+        'token': app.globalData.userWxInfo.token,
+        'source': "wc",
+        '!SAAS_LOGIN_TOKEN_!': app.globalData.currentAccountInfo.dsKey
+      },
+      success(res) {
+
+        wx.hideLoading();
+        let apiReturnData = res.data;
+        // 从全局获取当前账户的信息currentAccountInfo
+        const currentUsernumber = app.globalData.currentAccountInfo.usernumber;
+        debugger
+        // 对返回的数据进行排序,将默认户号(defaultAccount='0')排在前面
+        const sortedData = apiReturnData.data.sort((a, b) => {
+          // 先按defaultAccount排序('0'排在前面)
+          if (a.defaultAccount !== b.defaultAccount) {
+            return a.defaultAccount === '0' ? -1 : 1;
+          }
+          // 如果defaultAccount相同,则按是否是当前户号排序
+          if (a.usernumber === currentUsernumber) return -1;
+          if (b.usernumber === currentUsernumber) return 1;
+          return 0;
+        });
+
+        _this.setData({
+          huHaoList: sortedData.map(item => {
+            const isCurrent = item.usernumber === currentUsernumber;
+            return {
+              ...item,
+              isCurrentUser: isCurrent
+            };
+          })
+        });
+        // 在获取列表后也检查是否为空
+        if (_this.data.huHaoList.length === 0) {
+          wx.navigateTo({
+            url: '/pages/FirstBangDing/FirstBangDing'
+          });
+        }
+      },
+      fail(error) {
+        wx.hideLoading();
+        console.error('获取列表失败:', error);
+        wx.showToast({
+          title: '获取数据失败,请稍后再试',
+          icon: 'none'
+        });
+      }
+    });
+  },
   // 阻止事件冒泡
-  stopPropagation: function(e) {
+  stopPropagation: function (e) {
     // 空函数,仅用于阻止事件冒泡
   },
-}) 
+})

+ 16 - 1
pages/jiaofeiList/jiaofeiList.js

@@ -22,7 +22,21 @@ Page({
     selectedYear: '',
     originalBillList: [], // 存储原始账单数据
   },
-
+  onShow: function() {
+    this.updateUserInfo();
+  },
+  
+  // 更新用户信息的方法
+  updateUserInfo: function() {
+    this.setData({
+      userInfo: {
+        name: app.globalData.currentAccountInfo.username,
+        id: app.globalData.currentAccountInfo.usernumber,
+        address: app.globalData.currentAccountInfo.address
+      }
+    });
+  },
+  
   onLoad: function(options) {
     // 确保图片资源正确加载
     this.setData({
@@ -41,6 +55,7 @@ Page({
         originalBillList: data
       });
     });
+    this.updateUserInfo();
   },
 
   // 添加日期格式化函数

+ 45 - 11
pages/tousujianyi/tousujianyi.js

@@ -1,10 +1,8 @@
 const  app= getApp();
 Page({
   data: {
-    address: '安平镇安坪村安平小区12栋305室',
     contact: '',
     phone: '',
-    repairType: '',
     description: '',
     imageList: [],
     showNotification: true,
@@ -16,7 +14,7 @@ Page({
     content: '',
     replyTime: '',
     replyContent: '',
-    showReplyInfo: false
+    formSubmitted: false
   },
 
   onLoad: function(options) {
@@ -37,6 +35,18 @@ Page({
     }
   },
 
+  onShow: function() {
+    // 检查是否是从成功页面返回
+    if (this.data.formSubmitted) {
+      // 重置表单数据
+      this.resetForm();
+      // 重置提交状态标记
+      this.setData({
+        formSubmitted: false
+      });
+    }
+  },
+
   startCountDown: function() {
     let that = this;
     let timer = setInterval(function() {
@@ -214,6 +224,7 @@ Page({
     wx.showLoading({
       title: '提交中...',
     });
+    debugger
     wx.request({
       url: app.globalData.interfaceUrls.feedback,
       method: 'POST',
@@ -237,6 +248,11 @@ Page({
         utils.simleInfo('登记失败,请稍后再试')
       }
     })
+
+    // 在提交成功后设置标记
+    this.setData({
+      formSubmitted: true
+    });
   },
 
   submitRepair: function() {
@@ -252,19 +268,37 @@ Page({
 
     if (prevPage && prevPage.data.noticeList) {
       const item = prevPage.data.noticeList.find(item => item.id == id);
-
+      debugger
       if (item) {
+        const formatTime = (timeString) => {
+          if (!timeString) return ''; // 如果时间为空,返回空字符串
+          const date = new Date(timeString);
+          const year = date.getFullYear();
+          const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份补零
+          const day = String(date.getDate()).padStart(2, '0'); // 日期补零
+          return `${year}-${month}-${day}`;
+        };
         this.setData({
-          category: item.title.includes('投诉') ? '投诉' : '建议',
-          description: item.content,
-          content: item.content,
-          contact: item.contact,
-          phone: item.phone,
+          category: item.category || '投诉',
+          description: item.description || '',
+          contact: item.feedbackperson || '',
+          description: item.replynote || '',
+          phone: item.contactnumber || '',
           imageList: item.attachments || [],
-          replyTime: item.replyTime,
-          replyContent: item.replyContent
+          replyTime: formatTime(item.replytime) || '',
+          replyContent: item.replycontent || ''
         });
       }
     }
+  },
+
+  // 添加重置表单的方法
+  resetForm: function() {
+    this.setData({
+      contact: '', 
+      phone: '', 
+      description: '', 
+      imageList: []
+    });
   }
 });

+ 5 - 12
pages/tousujianyi/tousujianyi.wxml

@@ -38,13 +38,13 @@
 
   <!-- 第三个卡片:内容说明 -->
   <view class="bill-card">
-    <view class="card-title">内容说明<text class="required" wx:if="{{!isPreviewMode}}">*</text></view>
+    <view class="card-title">意见说明<text class="required" wx:if="{{!isPreviewMode}}">*</text></view>
     <view class="solid-divider"></view>
     <view class="fault-description">
-      <textarea class="input-text" placeholder="请输入描述说明..." placeholder-class="placeholder-style" bindinput="inputDescription" value="{{description || content}}" data-field="description" disabled="{{isPreviewMode}}"></textarea>
+      <textarea class="input-text" placeholder="请输入描述说明..." placeholder-class="placeholder-style" bindinput="inputDescription" value="{{description}}" data-field="description" disabled="{{isPreviewMode}}"></textarea>
     </view>
     <view class="upload-section">
-      <view class="upload-btn-container solid-border" wx:if="{{!isPreviewMode && imageList.length < 10}}">
+      <view class="upload-btn-container solid-border" wx:if="{{!isPreviewMode}}">
         <view class="upload-btn" bindtap="chooseImage">
           <view class="plus-icon">+</view>
         </view>
@@ -52,13 +52,13 @@
       <view class="image-preview" wx:if="{{imageList.length > 0}}">
         <block wx:for="{{imageList}}" wx:key="index">
           <view class="image-item">
-            <image src="{{item.tempFilePath}}" mode="aspectFill" bindtap="previewImage" data-index="{{index}}"></image>
+            <image src="{{item.tempFilePath || item}}" mode="aspectFill" bindtap="previewImage" data-index="{{index}}"></image>
             <view class="delete-icon" catchtap="deleteImage" data-index="{{index}}" wx:if="{{!isPreviewMode}}">×</view>
           </view>
         </block>
       </view>
     </view>
-    <view class="upload-tip" wx:if="{{imageList.length < 10 && !isPreviewMode}}">
+    <view class="upload-tip" wx:if="{{!isPreviewMode}}">
       最多可上传10张图片,单张不超过10M
     </view>
   </view>
@@ -75,13 +75,6 @@
     <view class="reply-content">{{replyContent}}</view>
   </view>
 
-  <!-- 回复信息区域,根据showReplyInfo控制显示 -->
-  <view class="reply-section" wx:if="{{showReplyInfo}}">
-    <view class="reply-title">回复信息</view>
-    <view class="reply-time">回复时间:{{replyTime}}</view>
-    <view class="reply-content">{{replyContent}}</view>
-  </view>
-
   <!-- 提交按钮,仅在非预览模式下显示 -->
   <button class="submit-btn" bindtap="submitForm" wx:if="{{!isPreviewMode}}">提交</button>
 

+ 1 - 0
pages/tousujianyiList/tousujianyiList.js

@@ -192,6 +192,7 @@ Page({
     }
     const item = this.data.noticeList.find(item => item.id === id);
     if (item) {
+      debugger
       this.setData({
         description: item.description,
         content: item.content,

+ 1 - 1
pages/tousujianyiList/tousujianyiList.wxss

@@ -209,7 +209,7 @@
 
 .close-button {
   position: absolute;
-  top: -80rpx;
+  top: -50rpx;
   right: 0;
   width: 60rpx;
   height: 60rpx;

+ 1 - 1
pages/tousujianyiSuccess/tousujianyiSuccess.wxml

@@ -1,4 +1,4 @@
-<view class="container">
+<view class="tscontainer">
 
 
   <!-- 返回按钮 -->

+ 7 - 6
pages/tousujianyiSuccess/tousujianyiSuccess.wxss

@@ -1,4 +1,4 @@
-.container {
+.tscontainer {
   padding: 20rpx;
   background-color: #f5f5f5;
   min-height: 100vh;
@@ -38,8 +38,9 @@
   flex-direction: column;
   align-items: center;
   justify-content: center;
-  margin-top: 100px;
+  margin-top: 60px;
   padding: 0 30px;
+  position: relative;
 }
 
 .success-icon {
@@ -63,14 +64,14 @@
 }
 
 .bottom-buttons {
-  position: fixed;
-  bottom: 300px;
-  left: 0;
-  right: 0;
+  position: relative;
+  margin-top: 80px;
   display: flex;
   flex-direction: column;
   padding: 0 30px;
   align-items: center;
+  width: 100%;
+  box-sizing: border-box;
 }
 
 .continue-btn {

+ 1 - 1
pages/tzxq/tzxq.wxml

@@ -1,5 +1,5 @@
 <!-- 通知详情页面 -->
-<view class="container">
+<view class="tzxqcontainer">
   <view class="header">
     <image class="background" src="/static_file/background.png" mode="widthFix" />
   </view>

+ 1 - 1
pages/tzxq/tzxq.wxss

@@ -1,4 +1,4 @@
-.container {
+.tzxqcontainer {
   position: relative;
   width: 100%;
   min-height: 100vh;

+ 17 - 0
pages/zhangdanlist/zhangdanlist.js

@@ -25,6 +25,21 @@ Page({
     originalBillList: [], // 存储原始账单数据
   },
 
+  onShow: function() {
+    this.updateUserInfo();
+  },
+  
+  // 更新用户信息的方法
+  updateUserInfo: function() {
+    this.setData({
+      userInfo: {
+        name: app.globalData.currentAccountInfo.username,
+        id: app.globalData.currentAccountInfo.usernumber,
+        address: app.globalData.currentAccountInfo.address
+      }
+    });
+  },
+  
   onLoad: function(options) {
     // 确保图片资源正确加载
     this.setData({
@@ -43,6 +58,7 @@ Page({
         originalBillList: data
       });
     });
+    this.updateUserInfo();
   },
 
   getBillList: function() {
@@ -66,6 +82,7 @@ Page({
           '!SAAS_LOGIN_TOKEN_!': app.globalData.currentAccountInfo.dsKey
         },
         success(res) {
+          debugger
           wx.hideLoading();
           let apiReturnData = res.data;
           _this.setData({