瀏覽代碼

feature 代码提交

xiahan 4 月之前
父節點
當前提交
bff8fc5889

+ 7 - 1
app.js

@@ -103,8 +103,14 @@ App({
       accountUnbind: baseIp+ '/wechat/account/unbind', // 户号解绑方法
       repairRegistration: baseIp+  '/wechat/registration/repair',//报修登记
       feedback: baseIp+  '/wechat/registration/feedback',//投诉建议
+      mineRepair: baseIp+  '/wechat/mine/repair',//报修登记
+      mineFeedback: baseIp+  '/wechat/mine/feedback',//投诉建议
     },
-    imgPreviewUrl: "http://192.168.0.215:9000/common/sys/sysfile/preview?fileId=",
+    // 微信静态文件预览方式 使用二开服务的使用次方法
+    weChatImgPreviewUrl: "http://192.168.0.215:8020/wechat/",
+    // 平台
+    imgPreviewUrl:" http://192.168.0.215:9000/common/sys/sysfile/preview/",
+   
     // 统一管理图片路径
     images: {
       logo: '/static_file/logo.png',

+ 53 - 80
pages/baoxiuList/baoxiuList.js

@@ -1,58 +1,12 @@
+const app=getApp();
+const utils = require("../../utils/util.js")
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    noticeList: [
-      {
-        id: 1,
-        address: '安平镇安坪村安平小区12栋304室',
-        content: '水表漏水 11111',
-        contact: '张三',
-        phone: '13800138000',
-        date: '2024-03-15',
-        type: '水表漏水',
-        hasAttachment: true,
-        attachments: [
-          '/static_file/background.png',
-          '/static_file/card.png'
-        ],
-        isReplied: true,
-        replyTime: '2025-3-12 12:10',
-        replyContent: '建议增加线上开票功能,线下开票太麻烦了'
-      },
-      {
-        id: 2,
-        address: '安平镇安坪村安平小区12栋305室',
-        content: '水管漏水 2222',
-        contact: '李四',
-        phone: '13900139000',
-        date: '2024-03-14',
-        type: '水表漏水',
-        hasAttachment: false,
-        attachments: [],
-        isReplied: false,
-        replyTime: '',
-        replyContent: ''
-      },
-      {
-        id: 3,
-        address: '安平镇安坪村安平小区12栋306室',
-        content: '3333',
-        contact: '王五',
-        phone: '13700137000',
-        date: '2024-03-13',
-        type: '水表漏水',
-        hasAttachment: true,
-        attachments: [
-          '/static_file/add.png'
-        ],
-        isReplied: true,
-        replyTime: '2025-3-10 09:30',
-        replyContent: '已经对相关人员进行培训,感谢您的反馈'
-      }
-    ],
+    noticeList: [],
     imageList: [], // 存储图片路径的数组
     showCustomPreview: false, // 是否显示自定义预览
     currentPreviewImages: [], // 当前预览的图片数组
@@ -77,7 +31,6 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-
   },
 
   /**
@@ -117,21 +70,56 @@ Page({
 
   // 获取列表数据
   getNoticeList() {
-    // wx.request({
-    //   url: 'YOUR_API_URL',
-    //   success: (res) => {
-    //     this.setData({
-    //       noticeList: res.data
-    //     })
-    //   }
-    // })
+    const _this = this;
+    wx.showLoading({
+      title: '获取中...',
+      mask: true,
+    });
+    // debugger;
+    wx.request({
+      url: app.globalData.interfaceUrls.mineRepair,
+      method: 'POST',
+      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;
+        let listData=apiReturnData.data;
+        listData.forEach(data=>{
+          data.createdate =data.createdate.slice(0,10);
+          let imgs=data.images.split(',').map(img=>{
+            return app.globalData.weChatImgPreviewUrl+'REPAIR/'+img;
+          });
+          data.hasAttachment=imgs.length>0;
+          data.attachments=imgs;
+          data.isReplied=data.iscompleted=='1';
+          if((data.recoverydate||"")!=''){
+            data.recoverydate=data.recoverydate.slice(0,10);
+          }
+         
+        })
+        app.globalData.mineRepairList=listData;
+        _this.setData({
+          noticeList: listData,
+        })
+      },
+      fail(error) {
+        wx.hideLoading()
+        utils.simleInfo('获取报修记录,请稍后再试')
+      }
+    });
   },
 
-  previewImage: function(e) {
+  previewImage: function (e) {
     // 获取当前点击项的id
     const id = e.currentTarget.dataset.id;
     // 根据id找到对应的投诉建议项
     const item = this.data.noticeList.find(item => item.id === id);
+    debugger;
     // 确保有附件
     if (item && item.hasAttachment && item.attachments.length > 0) {
       this.setData({
@@ -145,30 +133,30 @@ Page({
   },
 
   // 关闭预览
-  closePreview: function() {
+  closePreview: function () {
     this.setData({
       showCustomPreview: false
     });
   },
 
   // 切换预览图片
-  changePreviewImage: function(e) {
+  changePreviewImage: function (e) {
     const direction = e.currentTarget.dataset.direction;
     let newIndex = this.data.currentPreviewIndex;
-    
+
     if (direction === 'prev') {
       newIndex = newIndex > 0 ? newIndex - 1 : this.data.currentPreviewImages.length - 1;
     } else {
       newIndex = newIndex < this.data.currentPreviewImages.length - 1 ? newIndex + 1 : 0;
     }
-    
+
     this.setData({
       currentPreviewIndex: newIndex
     });
   },
 
   // 防止点击图片内容时关闭预览
-  preventBubble: function() {
+  preventBubble: function () {
     return;
   },
 
@@ -176,7 +164,7 @@ Page({
   goToDetail(e) {
     const id = e.currentTarget.dataset.id;
     const item = this.data.noticeList.find(item => item.id === id);
-    
+
     // 统一使用预览模式,传递isReplied参数
     wx.navigateTo({
       url: `/pages/baoxiudj/baoxiudj?id=${id}&mode=preview&isReplied=${item.isReplied ? 'true' : 'false'}`
@@ -194,19 +182,4 @@ Page({
   goBack() {
     wx.navigateBack()
   },
-
-  // 假设您从服务器获取数据的函数
-  getDataFromServer: function() {
-    // 示例:从服务器获取数据
-    wx.request({
-      url: 'your_api_url',
-      success: (res) => {
-        // 假设返回的数据中包含图片数组
-        const images = res.data.images || [];
-        this.setData({
-          imageList: images
-        });
-      }
-    });
-  }
 })

+ 3 - 3
pages/baoxiuList/baoxiuList.wxml

@@ -9,10 +9,10 @@
     <block wx:for="{{noticeList}}" wx:key="id">
       <view class="notice-item" bindtap="goToDetail" data-id="{{item.id}}">
         <view class="notice-content">
-          <view class="notice-title">{{item.content}}</view>
+          <view class="notice-title">{{item.faultdescription}}</view>
           <view class="notice-info">
-            <text>{{item.contact}}/{{item.phone}}</text>
-            <text>{{item.date}}</text>
+            <text>{{item.contact}}/{{item.contactnumber}}</text>
+            <text>{{item.createdate}}</text>
           </view>
         </view>
         <!-- 预览图按钮,仅当有附件时显示 -->

+ 8 - 6
pages/baoxiudj/baoxiudj.js

@@ -256,12 +256,14 @@ Page({
         this.setData({
           address: item.address || '', 
           contact: item.contact || '',
-          phone: item.phone || '',
-          repairType: item.type || '',
-          description: item.content || '',
-          imageList: item.hasAttachment ? item.attachments : [],
-          replyTime: item.isReplied ? item.replyTime : '',
-          replyContent: item.isReplied ? item.replyContent : ''
+          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 : ''
         });
       }
     }

+ 5 - 0
pages/homepage/homepage.js

@@ -90,7 +90,12 @@ Page({
         success (res) {
           wx.hideLoading();
           let apiReturnData=res.data;
+          apiReturnData.data.swNotificationAnnouncementDos.forEach(data=>{
+            data.publishtime=data.publishtime.slice(0,10);
+          })
+          // 所有的通知公告
           app.globalData.notices= apiReturnData.data.swNotificationAnnouncementDos;
+          // 需要轮播的公告
           let data= apiReturnData.data.swNotificationAnnouncementDos.filter(data=>{
             return data.homepageslider=='1';
           });

+ 4 - 2
pages/huhaobangding/huhaobangding.js

@@ -127,7 +127,7 @@ Page({
           time: data.worktime
         }
       }),
-      ylt:app.globalData.imgPreviewUrl+this.data.waterCompanyList[index].swCompanyInfo.overduenoticeimage.split("-;-")[1]
+      ylt:app.globalData.imgPreviewUrl+"pagePart/"+this.data.waterCompanyList[index].swCompanyInfo.overduenoticeimage.split("-;-")[0]
       
     });
   },
@@ -254,7 +254,9 @@ Page({
             time: data.worktime
           }
         }),
-        ylt:app.globalData.imgPreviewUrl+app.globalData.waterCompanys.filter(data=>data.id==app.globalData.launchPara)[0].swCompanyInfo.overduenoticeimage.split("-;-")[1]
+        ylt:app.globalData.imgPreviewUrl+
+        app.globalData.currentAccountInfo.dsId+"?fileId="
+        +app.globalData.waterCompanys.filter(data=>data.id==app.globalData.launchPara)[0].swCompanyInfo.overduenoticeimage.split("-;-")[1]
       });
     }
   },

+ 2 - 0
pages/huhaoguanli/huhaoguanli.js

@@ -173,7 +173,9 @@ Page({
   },
 
   switchHuHao(e) {
+    debugger;
     const huHaoInfo = e.currentTarget.dataset.item;
+
     // 更新全局数据
     app.globalData.userWxInfo = {
       ...app.globalData.userWxInfo,

+ 47 - 56
pages/tousujianyiList/tousujianyiList.js

@@ -1,55 +1,11 @@
+const app= getApp();
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    noticeList: [
-      {
-        id: 1,
-        title: '关于小区健身器材维修的建议关于小区健身器材维修的建议关于小区健身器材维修的建议',
-        content: '建议对小区内的健身器材进行定期维护和检修',
-        contact: '张三',
-        phone: '13800138000',
-        date: '2024-03-15',
-        hasAttachment: true,
-        attachments: [
-          '/static_file/background.png',
-          '/static_file/card.png'
-        ],
-        isReplied: true,
-        replyTime: '2025-3-12 12:10',
-        replyContent: '建议增加线上开票功能,线下开票太麻烦了'
-      },
-      {
-        id: 2,
-        title: '关于增设充电桩的投诉',
-        content: '小区电动车充电设施不足,希望能够增加充电桩',
-        contact: '李四',
-        phone: '13900139000',
-        date: '2024-03-14',
-        hasAttachment: false,
-        attachments: [],
-        isReplied: false,
-        replyTime: '',
-        replyContent: ''
-      },
-      {
-        id: 3,
-        title: '物业服务态度问题反馈',
-        content: '反映部分物业人员服务态度需要改进',
-        contact: '王五',
-        phone: '13700137000',
-        date: '2024-03-13',
-        hasAttachment: true,
-        attachments: [
-          '/static_file/add.png'
-        ],
-        isReplied: true,
-        replyTime: '2025-3-10 09:30',
-        replyContent: '已经对相关人员进行培训,感谢您的反馈'
-      }
-    ],
+    noticeList: [ ],
     imageList: [], // 存储图片路径的数组
     showCustomPreview: false, // 是否显示自定义预览
     currentPreviewImages: [], // 当前预览的图片数组
@@ -60,14 +16,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.getNoticeList()
+
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    this.getNoticeList()
   },
 
   /**
@@ -114,14 +70,48 @@ Page({
 
   // 获取列表数据
   getNoticeList() {
-    // wx.request({
-    //   url: 'YOUR_API_URL',
-    //   success: (res) => {
-    //     this.setData({
-    //       noticeList: res.data
-    //     })
-    //   }
-    // })
+    const _this = this;
+    wx.showLoading({
+      title: '获取中...',
+      mask: true,
+    });
+    // debugger;
+    wx.request({
+      url: app.globalData.interfaceUrls.mineFeedback,
+      method: 'POST',
+      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;
+        let listData=apiReturnData.data;
+        listData.forEach(data=>{
+          data.createdate =data.createdate.slice(0,10);
+          let imgs=data.file.split(',').map(img=>{
+            return app.globalData.weChatImgPreviewUrl+'FEEDBACK/'+img;
+          });
+          data.hasAttachment=imgs.length>0;
+          data.attachments=imgs;
+          data.isReplied=data.iscompleted=='1';
+          if((data.recoverydate||"")!=''){
+            data.recoverydate=data.recoverydate.slice(0,10);
+          }
+         
+        })
+        app.globalData.mineRepairList=listData;
+        _this.setData({
+          noticeList: listData,
+        })
+      },
+      fail(error) {
+        wx.hideLoading()
+        utils.simleInfo('获取报修记录,请稍后再试')
+      }
+    });
   },
 
   previewImage: function(e) {
@@ -171,6 +161,7 @@ Page({
 
   // 跳转到详情页
   goToDetail(e) {
+    debugger;
     const id = e.currentTarget.dataset.id
     const item = this.data.noticeList.find(item => item.id === id);
     

+ 3 - 3
pages/tousujianyiList/tousujianyiList.wxml

@@ -9,10 +9,10 @@
     <block wx:for="{{noticeList}}" wx:key="id">
       <view class="notice-item" bindtap="goToDetail" data-id="{{item.id}}">
         <view class="notice-content">
-          <view class="notice-title">{{item.title}}</view>
+          <view class="notice-title">{{item.replynote}}</view>
           <view class="notice-info">
-            <text>{{item.contact}}/{{item.phone}}</text>
-            <text>{{item.date}}</text>
+            <text>{{item.feedbackperson}}/{{item.contactnumber}}</text>
+            <text>{{item.createdate}}</text>
           </view>
         </view>
         <!-- 预览图按钮,仅当有附件时显示 -->

+ 1 - 1
pages/zhangdanlist/zhangdanlist.js

@@ -63,7 +63,7 @@ Page({
         },
         fail(error) {
           wx.hideLoading()
-          utils.simleInfo('登录失败,请稍后再试')
+          utils.simleInfo('获取账单失败,请稍后再试')
         }
       });
   },

+ 0 - 1
utils/util.js

@@ -12,7 +12,6 @@ const formatDate = date => {
   const year = date.getFullYear()
   const month = date.getMonth() + 1
   const day = date.getDate()
-
   return `${[year, month, day].map(formatNumber).join('-')} `
 }