Procházet zdrojové kódy

新增用户须知

QAQ 陈 před 2 měsíci
rodič
revize
de8042ea22
3 změnil soubory, kde provedl 60 přidání a 14 odebrání
  1. 4 5
      app.js
  2. 21 8
      pages/homepage/homepage.js
  3. 35 1
      pages/lijijiaofei/lijijiaofei.js

+ 4 - 5
app.js

@@ -2,18 +2,17 @@
 const utils = require('/utils/util.js')
 // 图片预览地址
 const ipConfig = {
-  develop: "http://127.0.0.1:", //开发地址
+  develop: "http://192.168.0.215:", //开发地址
   trial: "http://61.177.40.178:", // 体验地址
   release: "https://www.izilaishui.com:", //上线地址
 }
 const hostConfig = {
-  develop: "9747", //开发地址
-  trial: "8000/zhsw", // 体验地址
-  release: "9000/zhsw", //上线地址
+  develop: "9000/wechat", //开发地址
+  trial: "9000/wechat", // 体验地址
+  release: "9000/wechat", //上线地址
 }
 App({
   onLaunch(options) {
-    debugger;
     const ACCOUNT_INFO = wx.getAccountInfoSync();
     const ENV_VERSION = ACCOUNT_INFO.miniProgram.envVersion;
     const baseIp = ipConfig[ENV_VERSION || develop];

+ 21 - 8
pages/homepage/homepage.js

@@ -36,11 +36,11 @@ Page({
         text: '缴费记录',
         url: '/pages/jiaofeiList/jiaofeiList'
       },
-      {
-        icon: '/static_file/yhbx.png',
-        text: '用户报修',
-        url: '/pages/baoxiudj/baoxiudj'
-      },
+      // {
+      //   icon: '/static_file/yhbx.png',
+      //   text: '用户报修',
+      //   url: '/pages/baoxiudj/baoxiudj'
+      // },
       {
         icon: '/static_file/tzgg.png',
         text: '消息通知',
@@ -51,10 +51,15 @@ Page({
         text: '户号绑定',
         url: '/pages/huhaoguanli/huhaoguanli'
       },
+      // {
+      //   icon: '/static_file/yjfk.png',
+      //   text: '投诉建议',
+      //   url: '/pages/tousujianyi/tousujianyi'
+      // },
       {
         icon: '/static_file/yjfk.png',
-        text: '投诉建议',
-        url: '/pages/tousujianyi/tousujianyi'
+        text: '用户须知',
+        url: '/pages/usernotice/usernotice'
       }
     ],
     currentIndex: 0,
@@ -176,7 +181,8 @@ Page({
               accountNumber: apiReturnData.data.usernumber,
               address: apiReturnData.data.address
             },
-            enterPriseAddress:apiReturnData.data.enterPriseAddress
+            enterPriseAddress:apiReturnData.data.enterPriseAddress,
+            userNotices:apiReturnData.data.userNotice
           });
         },
         fail(error) {
@@ -361,6 +367,13 @@ Page({
     const item = this.data.functionList[index]
 
     if (item && item.url) {
+      if (item.url === '/pages/usernotice/usernotice') {
+        // 如果是跳转到用户须知页面,将用户须知信息存储到全局数据中
+        app.globalData.currentAccountInfo = {
+          ...app.globalData.currentAccountInfo,
+          userNotices: this.data.userNotices
+        };
+      }
       wx.navigateTo({
         url: item.url,
         fail: function (err) {

+ 35 - 1
pages/lijijiaofei/lijijiaofei.js

@@ -87,6 +87,38 @@ Page({
   onShow() {
     // 每次页面显示时更新用户信息
     this.updateUserInfo();
+    
+    // 获取最新余额数据
+    const _this = this;
+    wx.request({
+      url: app.globalData.interfaceUrls.pendingBill + app.globalData.currentAccountInfo.usernumber,
+      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;
+        _this.setData({
+          actualAmount: apiReturnData.data.yj, // 设置应缴金额
+          balance: apiReturnData.data.ye,   //余额
+          zdId: apiReturnData.data.zdId  // 对应的账单记录
+        });
+        // 重新计算默认实缴金额
+        _this.calculateDefaultAmount();
+      },
+      fail(error) {
+        wx.hideLoading();
+        wx.showToast({
+          title: '数据加载失败,请稍后再试',
+          icon: 'none',
+          duration: 2000
+        });
+      }
+    });
   },
 
   // 更新用户信息的方法
@@ -224,6 +256,8 @@ Page({
 
   // 返回上一页
   goBack: function() {
+    // 设置刷新标记
+    wx.setStorageSync('needRefreshHomepage', true);
     wx.navigateBack();
   },
 
@@ -458,4 +492,4 @@ Page({
     //   balance: 200.50
     // });
   },
-}) 
+})