| @ -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 () { | |||
| } | |||
| }) | |||
| @ -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" | |||
| } | |||
| } | |||
| @ -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> | |||
| @ -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%; | |||
| } | |||
| @ -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": [] | |||
| } | |||
| } | |||
| } | |||