Browse Source

版本1.0.6 2024-01-05 xh

1、小程序订单列表功能支付接口对接
master
LAPTOP-9N9MIRBL\琥 1 year ago
parent
commit
2aac095e8a
11 changed files with 362 additions and 289 deletions
  1. +3
    -3
      app.json
  2. +1
    -1
      pages/my/my.wxml
  3. +72
    -7
      pages/orderList/orderList.js
  4. +0
    -0
      pages/orderList/orderList.json
  5. +0
    -0
      pages/orderList/orderList.wxml
  6. +43
    -0
      pages/orderList/orderList.wxss
  7. +0
    -36
      pagesA/orderList/orderList.wxss
  8. +2
    -1
      utils/request.js

+ 3
- 3
app.json View File

@ -23,7 +23,8 @@
"pages/config/config", "pages/config/config",
"pages/rentDetail/rentDetail", "pages/rentDetail/rentDetail",
"pages/rentManagement/rentManagement", "pages/rentManagement/rentManagement",
"pages/paymentInterface/paymentInterface"
"pages/paymentInterface/paymentInterface",
"pages/orderList/orderList"
], ],
"subPackages": [ "subPackages": [
{ {
@ -36,8 +37,7 @@
"faceinfo/faceinfo", "faceinfo/faceinfo",
"selectFace/selectFace", "selectFace/selectFace",
"newconstructionitem/newconstructionitem", "newconstructionitem/newconstructionitem",
"activatePayment/activatePayment",
"orderList/orderList"
"activatePayment/activatePayment"
] ]
} }
], ],


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

@ -77,7 +77,7 @@
</view> </view>
</view> </view>
</navigator> </navigator>
<navigator url="/pagesA/orderList/orderList" wx:if="{{userInfo.type==0}}">
<navigator url="/pages/orderList/orderList" wx:if="{{userInfo.type==0}}">
<view class="serviceLi"> <view class="serviceLi">
<view class="servicetxt"> <view class="servicetxt">
<icon class="iconfont iconziliao"></icon> <icon class="iconfont iconziliao"></icon>


pagesA/orderList/orderList.js → pages/orderList/orderList.js View File

@ -46,23 +46,85 @@ Page({
confimPay(){ confimPay(){
let leases =this.data.leases let leases =this.data.leases
let userInfo = wx.getStorageSync('userInfo') let userInfo = wx.getStorageSync('userInfo')
let productName = leases.orderType == '0'?'短信充值':leases.orderType == '1'?'交租':leases.orderType == '2'?'语音电话充值':leases.orderType == '3'?'系统续费':'未知'
var data = { var data = {
description: "交租",
productName: "交租",
total: parseInt(leases.monthRent)*100,//parseInt(this.data.leases.expand.rent)*100,
description: productName,
productName: productName,
total: parseInt(leases.totalFee)*100,//parseInt(this.data.leases.expand.rent)*100,
userId: leases.cardId, userId: leases.cardId,
cardId:leases.cardId, cardId:leases.cardId,
openid:wx.getStorageSync('openid'), openid:wx.getStorageSync('openid'),
appid:'wx20de9fe5943934a1',
appid:'wx885b65d99da00084',//'wx20de9fe5943934a1',//'wx885b65d99da00084',
uid:userInfo.id, uid:userInfo.id,
eid:userInfo.enterpriseId, eid:userInfo.enterpriseId,
orderType:1,
orderType:leases.orderType,
payType:this.data.radio, payType:this.data.radio,
expand:JSON.stringify({ expand:JSON.stringify({
phone:leases.phone, phone:leases.phone,
nickname:leases.name
})
nickname:leases.cardName
}),
relevanceId:leases.id
} }
WXAPI.miniPrepayOrderT(data).then(res=>{
wx.requestPayment({
timeStamp: res.data.data.timeStamp,
appid: res.data.data.appId,
nonceStr: res.data.data.nonceStr,
package: res.data.data.package,
signType: res.data.data.signType,
totalFee: parseInt(leases.totalFee)*100,
paySign: res.data.data.paySign,
success (res1) {
wx.showToast({
title: "支付成功",
duration: 2000,
icon: 'success'
})
let dataOne={
code: "wx/updatePrepayStatus",
cardId:leases.cardId,
data: {
orderNo: res.data.data.orderNo,
status:0
}
}
WXAPI.sendCommand(dataOne).then(res2=>{
wx.showToast({
title: '支付成功',
duration:2000
})
})
},
fail (res1) {
wx.showToast({
title: "支付失败",
duration: 2000,
icon: 'none'
})
let dataOne={}
if(res1.errMsg == 'requestPayment:fail cancel'){
dataOne={
code: "wx/updatePrepayStatus",
data: {
orderNo: res.data.data.orderNo,
status:8
}
}
}else{
dataOne={
code: "wx/updatePrepayStatus",
cardId:leases.cardId,
data: {
orderNo: res.data.data.orderNo,
status:6
}
}
}
WXAPI.sendCommand(dataOne).then(res2=>{
})
}
})
// WXAPI.miniPrepayOrder(data).then(res=>{ // WXAPI.miniPrepayOrder(data).then(res=>{
// let dataOne={ // let dataOne={
// code: "wx/updatePrepayStatus", // code: "wx/updatePrepayStatus",
@ -87,6 +149,7 @@ Page({
// } // }
// }) // })
// }) // })
})
}, },
onChangeRadio(event){ onChangeRadio(event){
this.setData({ this.setData({
@ -112,6 +175,8 @@ Page({
if(res.success){ if(res.success){
res.data.list.map(li=>{ res.data.list.map(li=>{
li.createTime = moment(li.createTime).format('YYYY-MM-DD HH:mm:ss') li.createTime = moment(li.createTime).format('YYYY-MM-DD HH:mm:ss')
li.waterFee = parseFloat(li.waterFee/100).toFixed(2)
li.electricityFee = parseFloat(li.electricityFee/100).toFixed(2)
}) })
this.setData({ this.setData({
orderLogList:res.data.list orderLogList:res.data.list

pagesA/orderList/orderList.json → pages/orderList/orderList.json View File


pagesA/orderList/orderList.wxml → pages/orderList/orderList.wxml View File


+ 43
- 0
pages/orderList/orderList.wxss View File

@ -0,0 +1,43 @@
/* pagesA/orderList/orderList.wxss */
.loglist {
padding: 20upx;
box-sizing: border-box;
}
.lockli {
margin-bottom: 10upx;
padding: 20upx;
border-bottom: 2upx solid #f2f3f5;
line-height: 50upx;
}
.blue {
color: #02BFFF;
}
.box{
margin-bottom: 10px;
box-sizing: border-box;
margin: 30rpx;
box-shadow: 2px 2px 10px #eeee;
}
.d-fixed{
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 99;
}
.groupRadio{
margin: 0 40rpx;
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
margin-top: 10px;
}
.groupRadio .radioView{
display: inline-block;
width: 50%;
margin-bottom: 10px;
}

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

@ -1,36 +0,0 @@
/* 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%;
}

+ 2
- 1
utils/request.js View File

@ -499,8 +499,9 @@ module.exports = {
tsAddCertificate:(data)=>requestOne('v1/card/ts/addCertificate', 'POST', data),//租客端添加凭证 tsAddCertificate:(data)=>requestOne('v1/card/ts/addCertificate', 'POST', data),//租客端添加凭证
toWXCorpUser:(data)=>requestOne('v1/account/to/WXCorp/user', 'POST', data),//租客端登录 toWXCorpUser:(data)=>requestOne('v1/account/to/WXCorp/user', 'POST', data),//租客端登录
getApartmentCardInfo:(data)=>requestOne('v1/account/get/apartmentCardInfo', 'POST', data),// 获取合同信息,交租订单 getApartmentCardInfo:(data)=>requestOne('v1/account/get/apartmentCardInfo', 'POST', data),// 获取合同信息,交租订单
createOrderPay:(data)=>requestOne('v1/pay/createOrder', 'POST', data),// 创建交租订单
createOrderPay:(data)=>request('v1/pay/createOrder', 'POST', data),// 创建交租订单
miniPrepayOrder:(data)=>requestOne('v1/pay/miniPrepayOrder','POST',data),//租客端创建订单 miniPrepayOrder:(data)=>requestOne('v1/pay/miniPrepayOrder','POST',data),//租客端创建订单
miniPrepayOrderT:(data)=>request('v1/pay/miniPrepayOrder','POST',data),//租客端创建订单
minGetOpenLocks:(data)=>requestOne('v1/card/ts/getOpenLocks','POST',data),//租客端获取开锁记录 minGetOpenLocks:(data)=>requestOne('v1/card/ts/getOpenLocks','POST',data),//租客端获取开锁记录
getBleUnlockRecord:(data)=>requestOne('v1/card/ts/getBleUnlockRecord','POST',data),//租客端获取开锁记录 getBleUnlockRecord:(data)=>requestOne('v1/card/ts/getBleUnlockRecord','POST',data),//租客端获取开锁记录
updateCard:(data)=>requestOne('v1/account/edit/myKey','POST',data), updateCard:(data)=>requestOne('v1/account/edit/myKey','POST',data),


Loading…
Cancel
Save