Browse Source

版本1.0.6 2024-01-04 xh

1、添加订单列表接口
2、对接水电房租费用总接口创建和获取
master
LAPTOP-9N9MIRBL\琥 1 year ago
parent
commit
2efd8fcca4
14 changed files with 418 additions and 128 deletions
  1. +17
    -17
      app.js
  2. +3
    -2
      app.json
  3. +1
    -1
      pages/login/login.wxml
  4. +11
    -0
      pages/my/my.wxml
  5. +0
    -6
      pages/openLockLog/openLockLog.wxml
  6. +20
    -8
      pages/rentManagement/rentManagement.js
  7. +176
    -0
      pagesA/orderList/orderList.js
  8. +10
    -0
      pagesA/orderList/orderList.json
  9. +62
    -0
      pagesA/orderList/orderList.wxml
  10. +36
    -0
      pagesA/orderList/orderList.wxss
  11. +75
    -75
      project.config.json
  12. BIN
      static/images/logo2.jpg
  13. +1
    -15
      utils/ICINPakage/ICINLocker.js
  14. +6
    -4
      utils/request.js

+ 17
- 17
app.js View File

@ -10,8 +10,8 @@ App({
onLaunch() { onLaunch() {
this.globalData.sysinfo = wx.getSystemInfoSync() this.globalData.sysinfo = wx.getSystemInfoSync()
// wx885b65d99da00084 // wx885b65d99da00084
// wx20de9fe5943934a1 公寓
plugin.init('wx20de9fe5943934a1', '458f9df0-3405-66a9-1cdb-49d5f4197e6a')
// wx20de9fe5943934a1 公寓 '458f9df0-3405-66a9-1cdb-49d5f4197e6a'
plugin.init('wx885b65d99da00084', '4f24f9d7-3cae-4f3b-b48C-5429544f617b')
.then(function(res){ .then(function(res){
console.log('res', res) console.log('res', res)
if(res.code != 200){ if(res.code != 200){
@ -20,21 +20,21 @@ App({
}) })
} }
}) })
// wx.login({
// success (res) {
// if (res.code) {
// let data={
// code:res.code
// }
// WXAPI.getOpenId(data).then(res=>{
// console.log(res)
// wx.setStorageSync('openid', res.openid)
// })
// } else {
// console.log('登录失败!' + res.errMsg)
// }
// }
// })
wx.login({
success (res) {
if (res.code) {
let data={
code:res.code
}
WXAPI.getOpenId(data).then(res=>{
console.log(res)
wx.setStorageSync('openid', res.openid)
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
// 展示本地存储能力 // 展示本地存储能力
var logs = wx.getStorageSync('token') || '' var logs = wx.getStorageSync('token') || ''
var userRole = wx.getStorageSync('userRole') || '' var userRole = wx.getStorageSync('userRole') || ''


+ 3
- 2
app.json View File

@ -36,14 +36,15 @@
"faceinfo/faceinfo", "faceinfo/faceinfo",
"selectFace/selectFace", "selectFace/selectFace",
"newconstructionitem/newconstructionitem", "newconstructionitem/newconstructionitem",
"activatePayment/activatePayment"
"activatePayment/activatePayment",
"orderList/orderList"
] ]
} }
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#02BFFF", "navigationBarBackgroundColor": "#02BFFF",
"navigationBarTitleText": "智慧公寓管理系统",
"navigationBarTitleText": "小之锁",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
}, },
"plugins": { "plugins": {


+ 1
- 1
pages/login/login.wxml View File

@ -1,7 +1,7 @@
<!--pages/login/login.wxml--> <!--pages/login/login.wxml-->
<view class="content"> <view class="content">
<view class="logoimg"> <view class="logoimg">
<image src="../../static/images/logo.jpg" mode="widthFix"></image>
<image src="../../static/images/logo2.jpg" mode="widthFix"></image>
</view> </view>
<view class="forminput"> <view class="forminput">
<van-tabs type="card" color="#02BFFF" active="{{ active }}" bind:change="onChangeActive"> <van-tabs type="card" color="#02BFFF" active="{{ active }}" bind:change="onChangeActive">


+ 11
- 0
pages/my/my.wxml View File

@ -77,6 +77,17 @@
</view> </view>
</view> </view>
</navigator> </navigator>
<navigator url="/pagesA/orderList/orderList" wx:if="{{userInfo.type==0}}">
<view class="serviceLi">
<view class="servicetxt">
<icon class="iconfont iconziliao"></icon>
<text>订单列表</text>
</view>
<view class="serviceright">
<icon class="iconfont icon-right"></icon>
</view>
</view>
</navigator>
<!-- <navigator url="/pages/changeLock/changeLock" wx:if="{{userInfo.type<2}}"> <!-- <navigator url="/pages/changeLock/changeLock" wx:if="{{userInfo.type<2}}">
<view class="serviceLi"> <view class="serviceLi">
<view class="servicetxt"> <view class="servicetxt">


+ 0
- 6
pages/openLockLog/openLockLog.wxml View File

@ -1,11 +1,5 @@
<!--pages/openLockLog/openLockLog.wxml--> <!--pages/openLockLog/openLockLog.wxml-->
<view class="loglist"> <view class="loglist">
<!-- <view class="lockli" wx:for="{{locklogList}}" :key="index">
<view class="devicenum">设备号:<span class="blue">{{item.deviceNum}}</span></view>
<view class="phone">电话:<span class="">{{item.userTelephone}}</span></view>
<view class="openType">开锁方式:<span class="">{{item.openType}}</span></view>
<view class="openTime">开锁时间:<span class="">{{item.openTime}}</span></view>
</view> -->
<van-tabs active="{{ active }}" color="#419AFE" sticky bind:change="onChange"> <van-tabs active="{{ active }}" color="#419AFE" sticky bind:change="onChange">
<van-tab title="其他开锁"> <van-tab title="其他开锁">
<view wx:for="{{locklogList}}" wx:key="locklogList" class="box" style="margin-bottom: 10px;"> <view wx:for="{{locklogList}}" wx:key="locklogList" class="box" style="margin-bottom: 10px;">


+ 20
- 8
pages/rentManagement/rentManagement.js View File

@ -43,7 +43,8 @@ Page({
leases:{}, leases:{},
selectKey:'', selectKey:'',
selectRoomName:'', selectRoomName:'',
pid:''
pid:'',
siteOrder:{}
}, },
/** /**
@ -225,13 +226,24 @@ validObject(obj) {
}, },
rentMethods(e){ rentMethods(e){
let leases = e.currentTarget.dataset.item let leases = e.currentTarget.dataset.item
// wx.setStorageSync('leases', leases)
// wx.navigateTo({
// url: '/pages/paymentInterface/paymentInterface?type=1',
// data:{
// }
// })
let data={
q:JSON.stringify({
sid:leases.siteId
})
}
WXAPI.getItemsPay(data).then(res2=>{
if(res2.success){
this.setData({
siteOrder:res2.data.list[0]
})
}else{
wx.showToast({
title: res2.message,
duration:200,
icon:'none'
})
}
})
this.setData({ this.setData({
show:true, show:true,
leases leases


+ 176
- 0
pagesA/orderList/orderList.js View File

@ -0,0 +1,176 @@
// pagesA/orderList/orderList.js
const app = getApp()
const WXAPI = require('../../utils/request')
import moment from '../../utils/moment'
var util = require('../../utils/util');
Page({
/**
* 页面的初始数据
*/
data: {
active:0,
orderLogList:[],
pageSize:10,
pageNum:1,
radio:'2',
leases:{},
show:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getOrderList()
},
onChange(event){
this.setData({
active:event.detail.name
})
if(event.detail.name=='0'){
this.getOrderList()
}else if(event.detail.name==1){
this.getOrderList()
}else if(event.detail.name==2){
this.getOrderList()
}
},
onClose() {
this.setData({ show: false });
},
confirmMethods(event) {
this.confimPay()
},
confimPay(){
let leases =this.data.leases
let userInfo = wx.getStorageSync('userInfo')
var data = {
description: "交租",
productName: "交租",
total: parseInt(leases.monthRent)*100,//parseInt(this.data.leases.expand.rent)*100,
userId: leases.cardId,
cardId:leases.cardId,
openid:wx.getStorageSync('openid'),
appid:'wx20de9fe5943934a1',
uid:userInfo.id,
eid:userInfo.enterpriseId,
orderType:1,
payType:this.data.radio,
expand:JSON.stringify({
phone:leases.phone,
nickname:leases.name
})
}
// WXAPI.miniPrepayOrder(data).then(res=>{
// let dataOne={
// code: "wx/updatePrepayStatus",
// data: {
// orderNo: res.data.data.orderNo,
// status:0
// }
// }
// WXAPI.sendCommand(dataOne).then(res2=>{
// if(res2.success){
// wx.showToast({
// title: "支付成功",
// duration: 2000,
// icon: 'success'
// })
// }else{
// wx.showToast({
// title: res2.message,
// duration: 2000,
// icon: 'error'
// })
// }
// })
// })
},
onChangeRadio(event){
this.setData({
radio: event.detail,
});
},
rentMethods(e){
let leases = e.currentTarget.dataset.item
this.setData({
show:true,
leases
})
},
getOrderList(){
let data={
pageSize:this.data.pageSize,
pageNum:this.data.pageNum,
q:JSON.stringify({
orderStatus:this.data.active
})
}
WXAPI.getSiteOrder(data).then(res=>{
if(res.success){
res.data.list.map(li=>{
li.createTime = moment(li.createTime).format('YYYY-MM-DD HH:mm:ss')
})
this.setData({
orderLogList:res.data.list
})
}else{
wx.showToast({
title: res.message,
duration:200,
icon:'none'
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

+ 10
- 0
pagesA/orderList/orderList.json View File

@ -0,0 +1,10 @@
{
"usingComponents": {
"van-tab": "../../components/dist/tab/index",
"van-tabs": "../../components/dist/tabs/index",
"van-empty": "../../components/dist/empty/index",
"van-radio": "../../components/dist/radio/index",
"van-radio-group": "../../components/dist/radio-group/index",
"van-dialog": "../../components/dist/dialog/index"
}
}

+ 62
- 0
pagesA/orderList/orderList.wxml View File

@ -0,0 +1,62 @@
<!--pagesA/orderList/orderList.wxml-->
<view class="loglist">
<van-tabs active="{{ active }}" color="#419AFE" sticky bind:change="onChange">
<van-tab title="待支付">
<view wx:for="{{orderLogList}}" wx:key="locklogList" class="box" style="margin-bottom: 10px;">
<van-cell-group>
<van-cell title="租客:" value="{{item.cardName}}" />
<van-cell title="电话:" value="{{item.phone}}" />
<van-cell title="租金:" value="{{item.siteFee}}" />
<van-cell title="水费:" value="{{item.waterFee}}" />
<van-cell title="电费:" value="{{item.electricityFee}}" />
<van-cell title="总金额:" value="{{item.totalFee}}" />
<van-cell title="创建时间:" value="{{item.createTime}}" />
<van-cell title="操作:">
<van-button slot="right-icon" type="primary" round size="mini" bindtap="rentMethods" data-item="{{item}}">去支付</van-button>
</van-cell>
</van-cell-group>
</view>
</van-tab>
<van-tab title="已支付">
<view wx:for="{{orderLogList}}" wx:key="locklogListOne" class="box" style="margin-bottom: 10px;">
<van-cell-group>
<van-cell title="租客:" value="{{item.cardName}}" />
<van-cell title="电话:" value="{{item.phone}}" />
<van-cell title="租金:" value="{{item.siteFee}}" />
<van-cell title="水费:" value="{{item.waterFee}}" />
<van-cell title="电费:" value="{{item.electricityFee}}" />
<van-cell title="总金额:" value="{{item.totalFee}}" />
<van-cell title="创建时间:" value="{{item.createTime}}" />
</van-cell-group>
</view>
</van-tab>
<van-tab title="未支付">
<view wx:for="{{orderLogList}}" wx:key="locklogListTwo" class="box" style="margin-bottom: 10px;">
<van-cell-group>
<van-cell title="租客:" value="{{item.cardName}}" />
<van-cell title="电话:" value="{{item.phone}}" />
<van-cell title="租金:" value="{{item.siteFee}}" />
<van-cell title="水费:" value="{{item.waterFee}}" />
<van-cell title="电费:" value="{{item.electricityFee}}" />
<van-cell title="总金额:" value="{{item.totalFee}}" />
<van-cell title="创建时间:" value="{{item.createTime}}" />
</van-cell-group>
</view>
</van-tab>
</van-tabs>
</view>
<van-dialog
use-slot
title="支付方式"
show="{{ show }}"
show-cancel-button
bind:close="onClose"
bind:confirm="confirmMethods"
>
<van-radio-group value="{{ radio }}" bind:change="onChangeRadio" class="groupRadio">
<van-radio name="2" class="radioView">现金</van-radio>
<van-radio name="3" class="radioView">刷卡</van-radio>
<van-radio name="0" class="radioView">微信支付</van-radio>
</van-radio-group>
</van-dialog>

+ 36
- 0
pagesA/orderList/orderList.wxss View File

@ -0,0 +1,36 @@
/* pagesA/orderList/orderList.wxss */
.box{
padding: 10rpx;
box-shadow: 10px ;
}
.voucher-list{
box-sizing: border-box;
padding: 10rpx;
width: 100%;
}
.voucher-item{
width: 90%;
margin: 20rpx auto;
border-radius: 20rpx;
border: 2rpx solid #eee;
box-shadow: 2rpx 2rpx 10rpx #eee;
padding: 20rpx;
}
.voucheritem{
display: flex;
justify-content: space-between;
padding: 10rpx;
}
.btn{
margin-top: 10rpx;
width: 20%;
height: 50rpx;
border: 2rpx solid #e54857;
border-radius: 10rpx;
text-align: center;
line-height: 50rpx;
background-color: #e54857;
color: #ffffff;
font-size: 32rpx;
margin: 0 0 0 80%;
}

+ 75
- 75
project.config.json View File

@ -1,82 +1,82 @@
{ {
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": [
{
"value": ".eslintrc.js",
"type": "file"
}
],
"include": []
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": [
{
"value": ".eslintrc.js",
"type": "file"
}
],
"include": []
},
"setting": {
"urlCheck": false,
"es6": false,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}, },
"setting": {
"urlCheck": false,
"es6": false,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false
"enableEngineNative": false,
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false
},
"compileType": "miniprogram",
"libVersion": "2.23.4",
"appid": "wx885b65d99da00084",
"projectname": "appltegy",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {
"qywx_simulator_plugin": "2.4.0"
},
"condition": {
"search": {
"list": []
}, },
"compileType": "miniprogram",
"libVersion": "2.23.4",
"appid": "wx20de9fe5943934a1",
"projectname": "appltegy",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
"conversation": {
"list": []
}, },
"simulatorType": "wechat",
"simulatorPluginLibVersion": {
"qywx_simulator_plugin": "2.4.0"
"game": {
"list": []
}, },
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
} }
}
} }

BIN
static/images/logo2.jpg View File

Before After
Width: 300  |  Height: 150  |  Size: 15 KiB

+ 1
- 15
utils/ICINPakage/ICINLocker.js View File

@ -2653,7 +2653,6 @@ export default class ICINLocker {
) )
) )
); );
console.log("2656", authCode);
authCodeLen = (authCode.length / 2).toString(16).PadLeft(2, "0"); authCodeLen = (authCode.length / 2).toString(16).PadLeft(2, "0");
} }
let reqData = let reqData =
@ -2668,18 +2667,6 @@ export default class ICINLocker {
endTime + endTime +
authCodeLen + authCodeLen +
authCode; authCode;
console.log("2672", authUserId+"---",
keyId+"---",
userId+"---",
_pwdNo+"---",
pwd+"---",
useCountLimit+"---",
token+"---",
startTime+"---",
endTime+"---",
authCodeLen+"---",
authCode);
console.log("2673", reqData, reqData.length, reqData.length / 2, (reqData.length / 2).toString(16), typeof ((reqData.length / 2).toString(16)));
let reqDataLength = (reqData.length / 2).toString(16).PadLeft(2, "0"); let reqDataLength = (reqData.length / 2).toString(16).PadLeft(2, "0");
let dataModular = cmdId + subCmdId + reqDataLength + reqData; let dataModular = cmdId + subCmdId + reqDataLength + reqData;
let dataModularLength = (dataModular.length / 2) let dataModularLength = (dataModular.length / 2)
@ -3800,7 +3787,6 @@ export default class ICINLocker {
String.prototype.PadLeft = function (len, charStr) { String.prototype.PadLeft = function (len, charStr) {
var s = this + ""; var s = this + "";
console.log("3794", s);
return new Array(len - s.length + 1).join(charStr, "") + s; return new Array(len - s.length + 1).join(charStr, "") + s;
}; };
@ -3855,7 +3841,7 @@ function getIIData() {
function datasubpck(datahex) { function datasubpck(datahex) {
var arrayObj = new Array(); var arrayObj = new Array();
let dataPackageLength = packageSize let dataPackageLength = packageSize
console.log('分包大小', dataPackageLength, datahex)
console.log('分包大小', dataPackageLength)
for (var i = 0; i < datahex.length; i += dataPackageLength) { for (var i = 0; i < datahex.length; i += dataPackageLength) {
// 预加 最大包长度,如果依然小于总数据长度,可以取最大包数据大小 // 预加 最大包长度,如果依然小于总数据长度,可以取最大包数据大小
if (i + dataPackageLength < datahex.length) { if (i + dataPackageLength < datahex.length) {


+ 6
- 4
utils/request.js View File

@ -1,7 +1,7 @@
const app = getApp() const app = getApp()
let subDomain = '' // 子域名,没有就等于 let subDomain = '' // 子域名,没有就等于
const API_BASE_URL = 'https://apartmentcloud.xiaozhisz.cn/' // 主域名
// const API_BASE_URL = 'http://test.zhiweisz.cn/' // 主域名
// const API_BASE_URL = 'https://apartmentcloud.xiaozhisz.cn/' // 主域名
const API_BASE_URL = 'http://test.zhiweisz.cn/' // 主域名
// const API_BASE_URL = 'https://yktms-cs.utsz.edu.cn/' // 主域名 // const API_BASE_URL = 'https://yktms-cs.utsz.edu.cn/' // 主域名
import JSEncrypt from '../js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js'; import JSEncrypt from '../js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js';
function setCode(str, text) { function setCode(str, text) {
@ -11,8 +11,8 @@ function setCode(str, text) {
let data = encryptStr.encrypt(text.toString()); // 进行加密 let data = encryptStr.encrypt(text.toString()); // 进行加密
return data; return data;
} }
// let tenantIdEnter='100'
let tenantIdEnter='1200'
let tenantIdEnter='100'
// let tenantIdEnter='1200'
function setTenantId(tenantId){ function setTenantId(tenantId){
tenantIdEnter=tenantId tenantIdEnter=tenantId
wx.setStorageSync('tenantId',tenantId) wx.setStorageSync('tenantId',tenantId)
@ -507,4 +507,6 @@ module.exports = {
getDeviceOperateUserInfo:(data)=>requestOne('v1/device/isp/operateUserInfo','POST',data), getDeviceOperateUserInfo:(data)=>requestOne('v1/device/isp/operateUserInfo','POST',data),
// bleUnlockRecord: (data) => request('v1/zg/bleUnlockRecord','POST', data),//上传蓝牙开锁记录 // bleUnlockRecord: (data) => request('v1/zg/bleUnlockRecord','POST', data),//上传蓝牙开锁记录
// bleRspRecord: (data) => request3('http://192.168.1.34:8900/iot/v1/ble/deviceReport','POST', data),//传输蓝牙返回数据包 // bleRspRecord: (data) => request3('http://192.168.1.34:8900/iot/v1/ble/deviceReport','POST', data),//传输蓝牙返回数据包
getItemsPay:(data)=>request('v1/price/get/items','POST',data),//计算待支付金额,生成对应订单
getSiteOrder:(data)=>request('v1/price/get/siteOrder','POST',data),//获取计算待支付金额订单
} }

Loading…
Cancel
Save