diff --git a/app.json b/app.json index 2a112fe..34f99af 100644 --- a/app.json +++ b/app.json @@ -23,7 +23,8 @@ "pages/config/config", "pages/rentDetail/rentDetail", "pages/rentManagement/rentManagement", - "pages/paymentInterface/paymentInterface" + "pages/paymentInterface/paymentInterface", + "pages/orderList/orderList" ], "subPackages": [ { @@ -36,8 +37,7 @@ "faceinfo/faceinfo", "selectFace/selectFace", "newconstructionitem/newconstructionitem", - "activatePayment/activatePayment", - "orderList/orderList" + "activatePayment/activatePayment" ] } ], diff --git a/pages/my/my.wxml b/pages/my/my.wxml index ad57bb8..f5889e2 100644 --- a/pages/my/my.wxml +++ b/pages/my/my.wxml @@ -77,7 +77,7 @@ - + diff --git a/pagesA/orderList/orderList.js b/pages/orderList/orderList.js similarity index 58% rename from pagesA/orderList/orderList.js rename to pages/orderList/orderList.js index 23a6ae8..b8865db 100644 --- a/pagesA/orderList/orderList.js +++ b/pages/orderList/orderList.js @@ -46,23 +46,85 @@ Page({ confimPay(){ let leases =this.data.leases let userInfo = wx.getStorageSync('userInfo') + let productName = leases.orderType == '0'?'短信充值':leases.orderType == '1'?'交租':leases.orderType == '2'?'语音电话充值':leases.orderType == '3'?'系统续费':'未知' 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, cardId:leases.cardId, openid:wx.getStorageSync('openid'), - appid:'wx20de9fe5943934a1', + appid:'wx885b65d99da00084',//'wx20de9fe5943934a1',//'wx885b65d99da00084', uid:userInfo.id, eid:userInfo.enterpriseId, - orderType:1, + orderType:leases.orderType, payType:this.data.radio, expand:JSON.stringify({ 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=>{ // let dataOne={ // code: "wx/updatePrepayStatus", @@ -87,6 +149,7 @@ Page({ // } // }) // }) + }) }, onChangeRadio(event){ this.setData({ @@ -112,6 +175,8 @@ Page({ if(res.success){ res.data.list.map(li=>{ 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({ orderLogList:res.data.list diff --git a/pagesA/orderList/orderList.json b/pages/orderList/orderList.json similarity index 100% rename from pagesA/orderList/orderList.json rename to pages/orderList/orderList.json diff --git a/pagesA/orderList/orderList.wxml b/pages/orderList/orderList.wxml similarity index 100% rename from pagesA/orderList/orderList.wxml rename to pages/orderList/orderList.wxml diff --git a/pages/orderList/orderList.wxss b/pages/orderList/orderList.wxss new file mode 100644 index 0000000..4045ba0 --- /dev/null +++ b/pages/orderList/orderList.wxss @@ -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; +} diff --git a/pagesA/orderList/orderList.wxss b/pagesA/orderList/orderList.wxss deleted file mode 100644 index 1614ec3..0000000 --- a/pagesA/orderList/orderList.wxss +++ /dev/null @@ -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%; -} diff --git a/utils/request.js b/utils/request.js index f611aaa..fb631ea 100644 --- a/utils/request.js +++ b/utils/request.js @@ -499,8 +499,9 @@ module.exports = { tsAddCertificate:(data)=>requestOne('v1/card/ts/addCertificate', 'POST', data),//租客端添加凭证 toWXCorpUser:(data)=>requestOne('v1/account/to/WXCorp/user', '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),//租客端创建订单 + miniPrepayOrderT:(data)=>request('v1/pay/miniPrepayOrder','POST',data),//租客端创建订单 minGetOpenLocks:(data)=>requestOne('v1/card/ts/getOpenLocks','POST',data),//租客端获取开锁记录 getBleUnlockRecord:(data)=>requestOne('v1/card/ts/getBleUnlockRecord','POST',data),//租客端获取开锁记录 updateCard:(data)=>requestOne('v1/account/edit/myKey','POST',data),