Browse Source

格子铺

yangwangwen 1 year ago
parent
commit
85760c29e5
55 changed files with 994 additions and 14 deletions
  1. 1 1
      erp2/utils/http.js
  2. 1 0
      fz/README.MD
  3. 19 0
      fz/app.js
  4. 37 0
      fz/app.json
  5. 10 0
      fz/app.wxss
  6. BIN
      fz/pages/.DS_Store
  7. 56 0
      fz/pages/bill/index.js
  8. 4 0
      fz/pages/bill/index.json
  9. 28 0
      fz/pages/bill/index.wxml
  10. 69 0
      fz/pages/bill/index.wxss
  11. 55 0
      fz/pages/index/index.js
  12. 4 0
      fz/pages/index/index.json
  13. 9 0
      fz/pages/index/index.wxml
  14. 29 0
      fz/pages/index/index.wxss
  15. 45 0
      fz/pages/list/index.js
  16. 4 0
      fz/pages/list/index.json
  17. 15 0
      fz/pages/list/index.wxml
  18. 50 0
      fz/pages/list/index.wxss
  19. 103 0
      fz/pages/recharge/index.js
  20. 4 0
      fz/pages/recharge/index.json
  21. 19 0
      fz/pages/recharge/index.wxml
  22. 56 0
      fz/pages/recharge/index.wxss
  23. 38 0
      fz/pages/record/index.js
  24. 4 0
      fz/pages/record/index.json
  25. 16 0
      fz/pages/record/index.wxml
  26. 69 0
      fz/pages/record/index.wxss
  27. 33 0
      fz/pages/submitPhone/index.js
  28. 4 0
      fz/pages/submitPhone/index.json
  29. 6 0
      fz/pages/submitPhone/index.wxml
  30. 31 0
      fz/pages/submitPhone/index.wxss
  31. 55 0
      fz/project.config.json
  32. 7 0
      fz/project.private.config.json
  33. 7 0
      fz/sitemap.json
  34. BIN
      fz/utils/.DS_Store
  35. 66 0
      fz/utils/http.js
  36. BIN
      fz/utils/images/.DS_Store
  37. BIN
      fz/utils/images/home-1.png
  38. BIN
      fz/utils/images/home-img1.jpeg
  39. BIN
      fz/utils/images/home-img2.jpeg
  40. BIN
      fz/utils/images/home.png
  41. BIN
      fz/utils/images/jiantou.png
  42. BIN
      fz/utils/images/list-1.png
  43. BIN
      fz/utils/images/list.png
  44. 26 0
      fz/utils/ui.js
  45. 1 1
      ks/pages/index/index.js
  46. 2 2
      ks/utils/http.js
  47. 1 1
      lt/pages/bill/index.js
  48. 1 1
      lt/pages/index/index.js
  49. 2 2
      lt/pages/index/index.wxml
  50. 1 1
      lt/pages/list/index.js
  51. 1 1
      lt/pages/recharge/index.js
  52. 1 1
      lt/pages/record/index.js
  53. 1 1
      lt/pages/submitPhone/index.js
  54. 1 1
      lt/project.private.config.json
  55. 2 1
      lt/utils/http.js

+ 1 - 1
erp2/utils/http.js

@@ -1,6 +1,6 @@
 const ui = require('./ui');
  const BASE_URL = 'https://www.dghdwy.cn/monitor/api/erp2/we'
-
+//  const BASE_URL = 'http://192.168.3.51:8089/monitor/api/erp2/we'
  
 function request(obj) {
     return new Promise(function(resolve, reject) {

+ 1 - 0
fz/README.MD

@@ -0,0 +1 @@
+README

+ 19 - 0
fz/app.js

@@ -0,0 +1,19 @@
+// app.js
+App({
+  onLaunch() {
+    // 展示本地存储能力
+    const logs = wx.getStorageSync('logs') || []
+    logs.unshift(Date.now())
+    wx.setStorageSync('logs', logs)
+
+    // 登录
+    wx.login({
+      success: res => {
+        // 发送 res.code 到后台换取 openId, sessionKey, unionId
+      }
+    })
+  },
+  globalData: {
+    userInfo: null
+  }
+})

+ 37 - 0
fz/app.json

@@ -0,0 +1,37 @@
+{
+  "pages":[
+    "pages/index/index",
+    "pages/submitPhone/index",
+    "pages/list/index",
+    "pages/record/index",
+    "pages/recharge/index",
+    "pages/bill/index"
+  ],
+  "tabBar": {
+    "color": "#2c2c2c",
+    "selectedColor": "#1296db",
+    "borderStyle": "black",
+    "list": [
+      {
+        "selectedIconPath": "./utils/images/home.png",
+        "iconPath": "./utils/images/home-1.png",
+        "pagePath": "pages/index/index",
+        "text": "首页"
+      },
+      {
+        "selectedIconPath": "./utils/images/list.png",
+        "iconPath": "./utils/images/list-1.png",
+        "pagePath": "pages/list/index",
+        "text": "列表"
+      }
+    ]
+  },
+  "window":{
+    "backgroundTextStyle":"light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "电费",
+    "navigationBarTextStyle":"black"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json"
+}

+ 10 - 0
fz/app.wxss

@@ -0,0 +1,10 @@
+/**app.wxss**/
+.container {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
+  padding: 200rpx 0;
+  box-sizing: border-box;
+} 

BIN
fz/pages/.DS_Store


+ 56 - 0
fz/pages/bill/index.js

@@ -0,0 +1,56 @@
+const app = getApp()
+const httpUtils = require('../../utils/http.js')
+const ui = require('../../utils/ui.js')
+Page({
+  data: {
+    list: [],
+    deviceid: '',
+    roomName: '',
+    deviceCode: ''
+  },
+  deviceid: '',
+  roomName: '',
+  deviceCode: '',
+  balance: '',
+  onLoad(options) {
+    this.deviceid = options.deviceid
+    this.roomName = options.roomName
+    this.deviceCode = options.deviceCode
+    this.balance = options.balance
+    this.setData({
+      deviceid: options.deviceid,
+      roomName: options.roomName,
+      deviceCode: options.deviceCode,
+      balance: options.balance
+    })
+    this.getList(options.deviceid)
+  },
+  historyUrl(){
+    console.log(this)
+    wx.navigateTo({
+      url: '/pages/record/index?deviceid=' + this.deviceid + '&roomName=' + this.roomName + '&deviceCode=' + this.deviceCode
+    })
+  },
+  toRecharge(){
+    wx.navigateTo({
+      url: '/pages/recharge/index?deviceid=' + this.deviceid + '&roomName=' + this.roomName + '&deviceCode=' + this.deviceCode + '&balance=' + this.balance
+    })
+  },
+  getList(id){
+    let obj = {
+      url: '/monthBill',
+      data: {
+        deviceId: id,
+        token: wx.getStorageSync('token'),
+      }
+    }
+    httpUtils.request(obj).then(res=>{
+      console.log(res)
+      this.setData({
+        list: res.data.data
+      })
+    }).catch(err=>{
+      console.log('ERROR')
+    });
+  }
+})

+ 4 - 0
fz/pages/bill/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "月账单"
+}

+ 28 - 0
fz/pages/bill/index.wxml

@@ -0,0 +1,28 @@
+<view class="container_bill">
+  <view class="bill_top">
+    <p class="top_style">房号:{{roomName}}</p>
+    <p class="top_style">表号:{{deviceCode}}</p>
+  </view>
+  <view class="bill_btn">
+    <button class="btn_style1" bindtap="historyUrl">历史充值</button>
+    <button class="btn_style2" bindtap="toRecharge">充值</button>
+  </view>
+  <view class="list" wx:for="{{list}}" wx:key="index">
+    <view class="list-inner">
+      <p class="days">{{index + 1}}.月份:<span class="normal">{{item.month}}</span></p>
+      <p class="days">期末余额:<span class="blod red">{{item.balance}}</span></p>
+    </view>
+    <view class="list-inner">
+      <p class="days">期初读数: <span class="normal">{{item.prevValue}}</span></p>
+      <p class="days">期末读数: <span class="normal">{{item.currentValue}}</span></p>
+    </view>
+    <view class="list-inner">
+      <p class="days">倍率:<span class="normal">{{item.rate}}</span></p>
+      <p class="days">电量: <span class="normal">{{item.currentUse}}</span></p>
+    </view>
+    <view class="list-inner">
+      <p class="days">电价: <span class="normal">{{item.price}}</span></p>
+      <p class="days">电费: <span class="normal">{{item.amount}}</span></p>
+    </view>
+  </view>
+</view>

+ 69 - 0
fz/pages/bill/index.wxss

@@ -0,0 +1,69 @@
+.container_bill{
+  background: #efefef;
+  padding: 5px 0;
+}
+.bill_top{
+  width: 96%;
+  margin: 0 auto;
+  font-size: 14px;
+  color: #222;
+  display: flex;
+}
+.bill_top .top_style{
+  width: 50%;
+  text-align: center;
+}
+.bill_btn{
+  display: flex;
+  margin: 10px 0;
+}
+.bill_btn .btn_style2{
+  width: 45%;
+  margin: 0 auto;
+  font-size: 14px;
+  background: #1296db;
+  color: #fff;
+}
+.bill_btn .btn_style1{
+  width: 45%;
+  margin: 0 auto;
+  font-size: 14px;
+  background: #7dc5eb;
+  color: #fff;
+}
+.container_bill .list{
+  width: 96%;
+  margin: 0 auto;
+  border-radius: 3px;
+  padding: 10px;
+  box-sizing: border-box;
+  background: #ffffff;
+  border-bottom:1px solid #e6e6e6;
+  margin-bottom: 10px;
+}
+.container_bill .list .list-inner{
+  display: flex;
+  margin-bottom: 10px;
+}
+.container_bill .list .list-inner .days{
+  width: 60%;
+  display: block;
+  color: #999;
+  font-size: 14px;
+}
+.container_bill .list .list-inner .days{
+  color: #999;
+}
+.container_bill .list .arrow{
+  width: 20px;
+  height: 15px;
+}
+.red{
+  color: red;
+}
+.blod{
+  font-weight: bold;
+}
+.normal{
+  color: #222;
+}

+ 55 - 0
fz/pages/index/index.js

@@ -0,0 +1,55 @@
+const app = getApp()
+const httpUtils = require('../../utils/http.js')
+const ui = require('../../utils/ui.js')
+Page({
+  data: {
+    tab: 1
+  },
+  onShow(){
+    if(wx.getStorageSync('token')){
+      this.setData({
+        tab: 2
+      })
+    }else{
+      this.setData({
+        tab: 1
+      })
+    }
+  },
+  toOut(){
+    wx.removeStorageSync('token')
+    wx.removeStorageSync('phone')
+    wx.removeStorageSync('openId')
+    wx.removeStorageSync('code')
+    this.setData({
+      tab: 1
+    })
+  },
+  toLogin(){
+    wx.login({
+      success (res) {
+        if (res.code) {
+          console.log("code",res)
+          let code = res.code
+          wx.setStorageSync('code', res.code)
+          // 调userinfo接口
+          let obj = {
+            url: '/userInfo',   
+            data: {
+              code: code
+            }
+          }
+          httpUtils.request(obj).then(res1=>{
+            console.log("userInfo",res1)
+            wx.setStorageSync('openId', res1.data.data)
+            wx.navigateTo({
+              url: '/pages/submitPhone/index',
+            })
+          }).catch(err=>{
+            console.log('ERROR',err)
+          });
+        }
+      }
+    })
+  }
+})

+ 4 - 0
fz/pages/index/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "首页"
+}

+ 9 - 0
fz/pages/index/index.wxml

@@ -0,0 +1,9 @@
+<view class="container">
+  <view class="title">格子铺-电费充值</view>
+
+  <image class="img-style" src="/utils/images/home-img2.jpeg"></image>
+  <button class="btn_box" wx-if="{{tab == 1}}" bindtap="toLogin">微信授权登陆</button>
+  <button class="btn_box" wx-if="{{tab == 2}}" bindtap="toOut">更换账号登陆</button>
+  <!-- <view  class="btn_box" wx-if="{{tab == 1}}" bindtap="toLogin">微信授权登陆</view> -->
+  <!-- <view class="btn_box" wx-if="{{tab == 2}}" bindtap="toOut">更换账号登陆</view> -->
+</view>

+ 29 - 0
fz/pages/index/index.wxss

@@ -0,0 +1,29 @@
+.container{
+  padding: 0;
+}
+.title{
+  text-align: center;
+  font-size: 18px;
+  font-weight: bold;
+  color: #222;
+  margin-top: 30px;
+}
+.img-style{
+  width: 100%;
+  height: 150px;
+  display: block;
+  margin-bottom: 10px;
+}
+.btn_box{
+  width: 300px !important;
+  margin: 0 auto;
+  background: #1296db;
+  color: #ffffff;
+  font-size: 14px;
+  text-align: center;
+  height: 35px;
+  border-radius: 3px;
+  line-height: 20px;
+  position: absolute;
+  bottom: 50px;
+}

+ 45 - 0
fz/pages/list/index.js

@@ -0,0 +1,45 @@
+const app = getApp()
+const httpUtils = require('../../utils/http.js')
+const ui = require('../../utils/ui.js')
+Page({
+  data: {
+   list: []
+  },
+  onShow(){
+    if(wx.getStorageSync('token')){
+      this.getList()
+    }else{
+      wx.switchTab({
+        url: '/pages/index/index',
+      })
+    }
+  },
+  toUrl(e){
+    console.log(e)
+    let deviceid = e.currentTarget.dataset.deviceid
+    let roomName = e.currentTarget.dataset.roomname
+    let deviceCode = e.currentTarget.dataset.devicecode
+    let balance = e.currentTarget.dataset.balance
+    wx.navigateTo({
+      url: '/pages/bill/index?deviceid=' + deviceid + '&roomName=' + roomName + '&deviceCode=' + deviceCode + '&balance=' + balance
+    })
+  },
+  getList(){
+    let obj = {
+      url: '/roomList',
+      data: {
+        phone: wx.getStorageSync('phone'),
+        token: wx.getStorageSync('token'),
+      }
+    }
+    httpUtils.request(obj).then(res=>{
+      console.log(res)
+      this.setData({
+        list: res.data.data
+      })
+    }).catch(err=>{
+      console.log('ERROR')
+    });
+  }
+  
+})

+ 4 - 0
fz/pages/list/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "我的电表"
+}

+ 15 - 0
fz/pages/list/index.wxml

@@ -0,0 +1,15 @@
+<view class="container_list">
+  <view class="list" bindtap="toUrl" wx:for="{{list}}" wx:key="index" data-deviceId="{{item.deviceId}}" data-roomName="{{item.roomName}}" data-deviceCode="{{item.deviceCode}}" data-balance = "{{item.balance}}">
+    <view class="list-left">
+      <view class="list-inner">
+        <p class="house">{{index + 1}}.{{item.roomName}}</p>
+        <p class="days">余额:<span class="blod red">{{item.balance}}</span></p>
+      </view>
+      <view class="list-inner">
+        <p class="elId">电表:{{item.deviceCode}}</p>
+        <p class="days">预计可用 <span class="normal">{{item.canUse}}</span> 天</p>
+      </view>
+    </view>
+    <image class="arrow" src="../../utils/images/jiantou.png"></image>
+  </view>
+</view>

+ 50 - 0
fz/pages/list/index.wxss

@@ -0,0 +1,50 @@
+.container_list{
+  background: #efefef;
+  padding: 10px 0;
+}
+.container_list .list{
+  width: 96%;
+  margin: 0 auto;
+  border-radius: 3px;
+  padding: 10px;
+  box-sizing: border-box;
+  background: #ffffff;
+  border-bottom:1px solid #e6e6e6;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 10px;
+}
+.container_list .list .list-left{
+  width: 95%;
+}
+.container_list .list .list-left .list-inner{
+  display: flex;
+  margin-bottom: 10px;
+}
+.container_list .list .list-left .list-inner p:first-child{
+  width: 60%;
+  display: block;
+  color: #222;
+  font-size: 14px;
+}
+.container_list .list .list-left .list-inner .house{
+  font-weight: bold;
+}
+.container_list .list .list-left .list-inner .days{
+  font-size: 14px;
+  color: #999;
+}
+.container_list .list .arrow{
+  width: 20px;
+  height: 15px;
+}
+.red{
+  color: red;
+}
+.blod{
+  font-weight: bold;
+}
+.normal{
+  color: #222;
+}

+ 103 - 0
fz/pages/recharge/index.js

@@ -0,0 +1,103 @@
+const app = getApp()
+const httpUtils = require('../../utils/http.js')
+const ui = require('../../utils/ui.js')
+Page({
+  data: {
+    tab: 1,
+    money: 100,
+    deviceid: '',
+    roomName: '',
+    deviceCode: '',
+    balance: ''
+  },
+  deviceid: '',
+  roomName: '',
+  deviceCode: '',
+  balance: '',
+  onLoad(options) {
+    this.setData({
+      deviceid: options.deviceid,
+      roomName: options.roomName,
+      deviceCode: options.deviceCode,
+      balance: options.balance
+    })
+    this.deviceid = options.deviceid
+    this.roomName = options.roomName
+    this.deviceCode = options.deviceCode
+    this.balance = options.balance
+  },
+  getInputName(e){
+    this.setData({
+      money: e.detail.value
+    })
+  },
+  changeTab(e){
+    console.log(e)
+    this.setData({
+      tab: e.target.dataset.info
+    })
+    if(e.target.dataset.info == 1){
+      this.setData({
+        money: 100
+      })
+    }else if(e.target.dataset.info == 2){
+      this.setData({
+        money: 200
+      })
+    }else if(e.target.dataset.info == 3){
+      this.setData({
+        money: 500
+      })
+    }
+  },
+  toRecharge(){
+    let that = this
+    let obj = {
+      url: '/wePhoneCharge',
+      data: {
+        deviceId: that.deviceid,
+        deposit: that.data.money,
+        token: wx.getStorageSync('token'),
+      }
+    }
+    httpUtils.request(obj).then(res=>{
+      console.log("pay",res)
+      let payInfo = res.data.data
+      // 调取后端接口后微信下单
+      wx.requestPayment({
+        timeStamp:payInfo.timeStamp,
+        nonceStr:payInfo.nonceStr,
+        package:payInfo.package,
+        signType:payInfo.signType,
+        paySign:payInfo.paySign,
+        success (res1) {
+          console.log("支付",res1)
+          if(res1.errMsg == 'requestPayment:ok'){
+            wx.showToast({
+              title: '支付成功!',
+              icon: 'success',
+              duration: 2000
+            })
+            wx.navigateTo({
+              url: '/pages/record/index?deviceid=' + that.deviceid + '&roomName=' + that.roomName + '&deviceCode=' + that.deviceCode
+            })
+          }
+        },
+        fail (res1) { 
+          wx.showToast({
+            title: '支付失败!',
+            icon: 'error',
+            duration: 2000
+          })
+        }
+      })
+    }).catch(err=>{
+      console.log(err)
+      wx.showToast({
+        title: "创建订单失败!",
+        icon: 'error',
+        duration: 2000
+      })
+    });
+  }
+})

+ 4 - 0
fz/pages/recharge/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "充值"
+}

+ 19 - 0
fz/pages/recharge/index.wxml

@@ -0,0 +1,19 @@
+<view class="container_bill">
+  <view class="bill_top">
+    <p class="top_style">房号:{{roomName}}</p>
+    <p class="top_style">表号:{{deviceCode}}</p>
+  </view>
+  <view class="bill_top">
+    <p class="top_style">余额:{{balance}}</p>
+  </view>
+  <view class="input_box">
+    <input class="input_style" bindinput='getInputName' type="digit" placeholder="请输入充值金额"/>
+  </view>
+  <view class="money_num">
+    <view class="num_inner {{ tab == 1? 'blue_style':'' }}" data-info="{{1}}" bindtap="changeTab">100</view>
+    <view class="num_inner {{ tab == 2? 'blue_style':'' }}" data-info="{{2}}" bindtap="changeTab">200</view>
+    <view class="num_inner {{ tab == 3? 'blue_style':'' }}" data-info="{{3}}" bindtap="changeTab">500</view>
+  </view>
+  <view class="btn_box" bindtap="toRecharge">充值</view>
+  
+</view>

+ 56 - 0
fz/pages/recharge/index.wxss

@@ -0,0 +1,56 @@
+.container_bill{
+  padding: 5px 0;
+}
+.bill_top{
+  width: 90%;
+  margin: 0 auto;
+  font-size: 14px;
+  color: #222;
+  display: flex;
+  margin-bottom: 10px;
+}
+.bill_top .top_style{
+  width: 50%;
+}
+.input_style{
+  width: 90%;
+  height: 35px;
+  margin: 0 auto;
+  background: #efefef;
+  border-radius: 3px;
+  box-sizing: border-box;
+  padding: 2px 5px;
+  margin-top: 30px;
+}
+.money_num{
+  width: 90%;
+  margin: 0 auto;
+  margin-top: 25px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 100px;
+}
+.num_inner{
+  width: 60px;
+  height: 35px;
+  line-height: 35px;
+  background: #ebebeb;
+  color: #ffffff;
+  text-align: center;
+  border-radius: 3px;
+}
+.blue_style{
+  background: #7dc5eb;
+}
+.btn_box{
+  width: 90%;
+  margin: 0 auto;
+  background: #1296db;
+  color: #ffffff;
+  font-size: 14px;
+  text-align: center;
+  height: 35px;
+  border-radius: 3px;
+  line-height: 35px;
+}

+ 38 - 0
fz/pages/record/index.js

@@ -0,0 +1,38 @@
+const app = getApp()
+const httpUtils = require('../../utils/http.js')
+const ui = require('../../utils/ui.js')
+Page({
+  data: {
+   list: [],
+   deviceid: '',
+   roomName: '',
+   deviceCode: ''
+  },
+  onLoad(options) {
+    console.log(options)
+    this.setData({
+      deviceid: options.deviceid,
+      roomName: options.roomName,
+      deviceCode: options.deviceCode
+    })
+    this.getList(options.deviceid)
+  },
+  getList(id){
+    let obj = {
+      url: '/chargeRecords',
+      data: {
+        deviceId: id,
+        token: wx.getStorageSync('token'),
+      }
+    }
+    httpUtils.request(obj).then(res=>{
+      console.log(res)
+      this.setData({
+        list: res.data.data
+      })
+    }).catch(err=>{
+      console.log('ERROR')
+    });
+  }
+  
+})

+ 4 - 0
fz/pages/record/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "充值记录"
+}

+ 16 - 0
fz/pages/record/index.wxml

@@ -0,0 +1,16 @@
+<view class="container_bill">
+  <view class="bill_top">
+    <p class="top_style">房号:{{roomName}}</p>
+    <p class="top_style">表号:{{deviceCode}}</p>
+  </view>
+  <view class="list" wx:for="{{list}}" wx:key="index">
+    <view class="list-inner">
+      <p class="days">{{index + 1}}.日期:<span class="normal">{{item.createTime}}</span></p>
+    </view>
+    <view class="list-inner">
+      <p class="days">充值方式: <span class="normal">{{item.paywayName}}</span></p>
+      <p class="days">充值金额: <span class="blod red">{{item.amount}}</span></p>
+    </view>
+  </view>
+</view>
+

+ 69 - 0
fz/pages/record/index.wxss

@@ -0,0 +1,69 @@
+.container_bill{
+  background: #efefef;
+  padding: 5px 0;
+}
+.bill_top{
+  width: 96%;
+  margin: 0 auto;
+  font-size: 14px;
+  color: #222;
+  display: flex;
+  margin-bottom: 10px;
+}
+.bill_top .top_style{
+  width: 50%;
+}
+.bill_btn{
+  display: flex;
+  margin: 10px 0;
+}
+.bill_btn .btn_style2{
+  width: 45%;
+  margin: 0 auto;
+  font-size: 14px;
+  background: #1296db;
+  color: #fff;
+}
+.bill_btn .btn_style1{
+  width: 45%;
+  margin: 0 auto;
+  font-size: 14px;
+  background: #7dc5eb;
+  color: #fff;
+}
+.container_bill .list{
+  width: 96%;
+  margin: 0 auto;
+  border-radius: 3px;
+  padding: 10px;
+  box-sizing: border-box;
+  background: #ffffff;
+  border-bottom:1px solid #e6e6e6;
+  margin-bottom: 10px;
+}
+.container_bill .list .list-inner{
+  display: flex;
+  margin-bottom: 10px;
+}
+.container_bill .list .list-inner .days{
+  width: 60%;
+  display: block;
+  color: #999;
+  font-size: 14px;
+}
+.container_bill .list .list-inner .days{
+  color: #999;
+}
+.container_bill .list .arrow{
+  width: 20px;
+  height: 15px;
+}
+.red{
+  color: red;
+}
+.blod{
+  font-weight: bold;
+}
+.normal{
+  color: #222;
+}

+ 33 - 0
fz/pages/submitPhone/index.js

@@ -0,0 +1,33 @@
+const app = getApp()
+const httpUtils = require('../../utils/http.js')
+const ui = require('../../utils/ui.js')
+Page({
+  data: {
+    phone: ''
+  },
+  getInputName(e){
+    this.setData({
+      phone: e.detail.value
+    })
+  },
+  toSubmit() {
+    let phoneNumber = this.data.phone;
+    let obj = {
+      url: '/phoneInfo',   
+      data: {
+        phone: phoneNumber,
+        openId: wx.getStorageSync('openId')
+      }
+    }
+    httpUtils.request(obj).then(res=>{
+      console.log(res)
+      wx.setStorageSync('token', res.data.data.token)
+      wx.setStorageSync('phone', phoneNumber)
+      wx.switchTab({
+        url: '/pages/list/index',
+      })
+    }).catch(err=>{
+      console.log('ERROR')
+    });
+  }
+})

+ 4 - 0
fz/pages/submitPhone/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "提交手机号码"
+}

+ 6 - 0
fz/pages/submitPhone/index.wxml

@@ -0,0 +1,6 @@
+<view class="container">
+    <input class="input_style" type="number" bindinput='getInputName' placeholder="请输入手机号码" />
+    <view class="tips">请输入已报备到物业公司的手机号码</view>
+    <view class="btn_box" bindtap="toSubmit">提交</view>
+    
+</view>

+ 31 - 0
fz/pages/submitPhone/index.wxss

@@ -0,0 +1,31 @@
+.container{
+  width: 100%;
+}
+.input_style{
+  width: 300px;
+  height: 35px;
+  margin: 0 auto;
+  background: #efefef;
+  border-radius: 3px;
+  box-sizing: border-box;
+  padding: 2px 5px;
+  margin-top: 10px;
+}
+.tips{
+  width: 300px;
+  margin-bottom: 100px;
+  color: #1296db;
+  font-size: 14px;
+  margin-top: 5px;
+}
+.btn_box{
+  width: 300px;
+  margin: 0 auto;
+  background: #1296db;
+  color: #ffffff;
+  font-size: 14px;
+  text-align: center;
+  height: 35px;
+  border-radius: 3px;
+  line-height: 35px;
+}

+ 55 - 0
fz/project.config.json

@@ -0,0 +1,55 @@
+{
+  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "setting": {
+    "bundle": false,
+    "userConfirmedBundleSwitch": false,
+    "urlCheck": true,
+    "scopeDataCheck": false,
+    "coverView": true,
+    "es6": false,
+    "postcss": true,
+    "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "autoAudits": false,
+    "newFeature": false,
+    "uglifyFileName": false,
+    "uploadWithSourceMap": true,
+    "useIsolateContext": true,
+    "nodeModules": false,
+    "enhance": true,
+    "useMultiFrameRuntime": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmManually": false,
+    "enableEngineNative": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true,
+    "showES6CompileOption": false,
+    "minifyWXML": true,
+    "useStaticServer": true,
+    "checkInvalidKey": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "disableUseStrict": false,
+    "useCompilerPlugins": false,
+    "ignoreUploadUnusedFiles": true
+  },
+  "compileType": "miniprogram",
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  },
+  "libVersion": "2.24.6",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "appid": "wx820a8cd7aeb596bc",
+  "simulatorPluginLibVersion": {},
+  "projectname": "dghd_fz"
+}

+ 7 - 0
fz/project.private.config.json

@@ -0,0 +1,7 @@
+{
+  "projectname": "fz",
+  "setting": {
+    "compileHotReLoad": true
+  },
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
+}

+ 7 - 0
fz/sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}

BIN
fz/utils/.DS_Store


+ 66 - 0
fz/utils/http.js

@@ -0,0 +1,66 @@
+const ui = require('./ui');
+ const BASE_URL = 'https://www.dghdwy.cn/monitor/api/fz/we'
+  // const BASE_URL = 'http://119.29.97.109:8080/monitor' 
+  // const BASE_URL = 'http://192.168.3.51:8089/monitor/api/fz/we'
+ 
+function request(obj) {
+    return new Promise(function(resolve, reject) {
+      if(obj.showLoading){
+        ui.showLoading(obj.message? obj.message : '加载中...');
+      } 
+      var data = {};
+      if(obj.data) {
+        data = obj.data;
+      }
+      var contentType = 'application/json';
+      if(obj.contentType){
+        contentType = obj.contentType;
+      } 
+  
+      var method = 'post';
+      if(obj.method){
+        method = obj.method;
+      }
+  
+      wx.request({
+        url: BASE_URL + obj.url,
+        data: data,
+        method: method,
+        //添加请求头
+        // header: {
+        //   'Content-Type': contentType ,
+        //   'token': wx.getStorageSync('token') //获取保存的token
+        // },
+        //请求成功
+        success: function(res) {
+          if (res.statusCode == 200) {
+            resolve(res);
+          } else if (res.statusCode == 500) {//授权失效
+            reject("登录已过期");
+            jumpToLogin();//跳转到登录页
+          } else {
+            //请求失败
+            reject("请求失败:" + res.statusCode)
+          }
+        },
+        fail: function(err) {
+          reject("服务器连接异常,请检查网络再试");
+        },
+        complete: function() {
+          ui.hideLoading();
+        }
+      })
+    });
+  }
+  
+ 
+  //跳转到登录页
+  function jumpToLogin(){
+    wx.reLaunch({
+      url: '/pages/index/index',
+    })
+  }
+  
+  module.exports = {
+    request,
+  }

BIN
fz/utils/images/.DS_Store


BIN
fz/utils/images/home-1.png


BIN
fz/utils/images/home-img1.jpeg


BIN
fz/utils/images/home-img2.jpeg


BIN
fz/utils/images/home.png


BIN
fz/utils/images/jiantou.png


BIN
fz/utils/images/list-1.png


BIN
fz/utils/images/list.png


+ 26 - 0
fz/utils/ui.js

@@ -0,0 +1,26 @@
+export const showToast = function(content,duration) {
+  if(!duration) duration = 2000
+  wx.showToast({
+      title: content,
+      icon: 'none',
+      duration: duration,
+  })
+}
+
+var isShowLoading = false
+export const showLoading = function(title) {
+  if(isShowLoading) return
+  wx.showLoading({
+      title: title?title:'',
+      mask:true,
+      success:()=>{
+          isShowLoading = true
+      }
+  })
+}
+
+export const hideLoading = function() {
+  if(!isShowLoading) return
+  isShowLoading = false
+  wx.hideLoading()
+}

+ 1 - 1
ks/pages/index/index.js

@@ -29,7 +29,7 @@ Page({
     wx.login({
       success (res) {
         if (res.code) {
-          console.log("code",res)
+          console.log("code 00",res)
           let code = res.code
           wx.setStorageSync('code', res.code)
           // 调userinfo接口

+ 2 - 2
ks/utils/http.js

@@ -1,6 +1,6 @@
 const ui = require('./ui');
- // const BASE_URL = 'https://www.dghdwy.cn/monitor/api/erp/we'
- const BASE_URL = 'https://www.szkis.cn/monitor/api/kis/we' 
+ // const BASE_URL = 'https://www.dghdwy.cn/monitor/api/kis/we'
+ const BASE_URL = 'http://192.168.3.51:8089/monitor/api/kis/we'  
  
 function request(obj) {
     return new Promise(function(resolve, reject) {

+ 1 - 1
lt/pages/bill/index.js

@@ -38,7 +38,7 @@ Page({
   },
   getList(id){
     let obj = {
-      url: '/api/erp/we/monthBill',
+      url: '/monthBill',
       data: {
         deviceId: id,
         token: wx.getStorageSync('token'),

+ 1 - 1
lt/pages/index/index.js

@@ -34,7 +34,7 @@ Page({
           wx.setStorageSync('code', res.code)
           // 调userinfo接口
           let obj = {
-            url: '/api/erp/we/userInfo',   
+            url: '/userInfo',   
             data: {
               code: code
             }

+ 2 - 2
lt/pages/index/index.wxml

@@ -1,6 +1,6 @@
 <view class="container">
-  <view class="title">电费充值系统</view>
-  <image class="img-style" src="/utils/images/home-img1.jpeg"></image>
+  <view class="title">恒生物业-二区电费充值</view>
+
   <image class="img-style" src="/utils/images/home-img2.jpeg"></image>
   <button class="btn_box" wx-if="{{tab == 1}}" bindtap="toLogin">微信授权登陆</button>
   <button class="btn_box" wx-if="{{tab == 2}}" bindtap="toOut">更换账号登陆</button>

+ 1 - 1
lt/pages/list/index.js

@@ -26,7 +26,7 @@ Page({
   },
   getList(){
     let obj = {
-      url: '/api/erp/we/roomList',
+      url: '/roomList',
       data: {
         phone: wx.getStorageSync('phone'),
         token: wx.getStorageSync('token'),

+ 1 - 1
lt/pages/recharge/index.js

@@ -53,7 +53,7 @@ Page({
   toRecharge(){
     let that = this
     let obj = {
-      url: '/api/erp/we/wePhoneCharge',
+      url: '/wePhoneCharge',
       data: {
         deviceId: that.deviceid,
         deposit: that.data.money,

+ 1 - 1
lt/pages/record/index.js

@@ -19,7 +19,7 @@ Page({
   },
   getList(id){
     let obj = {
-      url: '/api/erp/we/chargeRecords',
+      url: '/chargeRecords',
       data: {
         deviceId: id,
         token: wx.getStorageSync('token'),

+ 1 - 1
lt/pages/submitPhone/index.js

@@ -13,7 +13,7 @@ Page({
   toSubmit() {
     let phoneNumber = this.data.phone;
     let obj = {
-      url: '/api/erp/we/phoneInfo',   
+      url: '/phoneInfo',   
       data: {
         phone: phoneNumber,
         openId: wx.getStorageSync('openId')

+ 1 - 1
lt/project.private.config.json

@@ -1,5 +1,5 @@
 {
-  "projectname": "It",
+  "projectname": "lt",
   "setting": {
     "compileHotReLoad": true
   },

+ 2 - 1
lt/utils/http.js

@@ -1,6 +1,7 @@
 const ui = require('./ui');
- const BASE_URL = 'https://www.szkis.cn/monitor'
+ const BASE_URL = 'https://www.dghdwy.cn/monitor/api/lt/we'
   // const BASE_URL = 'http://119.29.97.109:8080/monitor' 
+  // const BASE_URL = 'http://192.168.3.51:8089/monitor/api/lt/we'
  
 function request(obj) {
     return new Promise(function(resolve, reject) {