|
@@ -34,6 +34,82 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</mescroll-body>
|
|
|
+ <view class="button-wrap" v-if="owelist.length&&owelist.length>=1">
|
|
|
+ <!-- <button class="button" type="primary" @click="all()">全部缴费</button> -->
|
|
|
+ <button class="button" type="primary" @click="confirmPrice()">全部缴费</button>
|
|
|
+ </view>
|
|
|
+ <!-- 缴费提示-->
|
|
|
+ <u-modal
|
|
|
+ v-model="payTipsPop"
|
|
|
+ :title-style="{color: '#404040'}"
|
|
|
+ title="缴费提示"
|
|
|
+ :show-confirm-button="true"
|
|
|
+ confirm-text="立即缴费"
|
|
|
+ :confirm-style="{backgroundColor: '#3397FA', color: '#fff'}"
|
|
|
+ :show-cancel-button="true"
|
|
|
+ cancel-text="取消"
|
|
|
+ :cancel-style="{backgroundColor: '#EBF1FF', color: '#3397FA'}"
|
|
|
+ @confirm="payTipsPopConfirm">
|
|
|
+ <view class="slot-content">
|
|
|
+ <view class="pay-tips">
|
|
|
+ <text>{{payTipsItem.num}}</text>场停车欠费,共
|
|
|
+ <text>{{payTipsItem.price}}</text>元
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
+ <u-modal
|
|
|
+ v-model="payWayPop"
|
|
|
+ :title-style="{color: '#404040'}"
|
|
|
+ title="缴费方式"
|
|
|
+ :show-confirm-button="false"
|
|
|
+ :show-cancel-button="false">
|
|
|
+ <view class="slot-content">
|
|
|
+ <view class="pay-way">
|
|
|
+ <view class="pay-way-item" @click="scanPay">
|
|
|
+ <image src="/static/img/payway-scan.png" mode=""></image>
|
|
|
+ <view>扫码收费</view>
|
|
|
+ </view>
|
|
|
+ <view class="pay-way-item" @click="cashPay">
|
|
|
+ <image src="/static/img/payway-xj.png" mode=""></image>
|
|
|
+ <view>现金支付</view>
|
|
|
+ </view>
|
|
|
+ <view class="pay-way-item" @click="qrPay">
|
|
|
+ <image src="/static/img/payway-qr.png" mode=""></image>
|
|
|
+ <view>收款码</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <button class="pay-way-close-btn" @click="payWayPop = false">关闭</button>
|
|
|
+ </view>
|
|
|
+ </u-modal>
|
|
|
+ <u-popup class="popup cashPay-popup" v-model="showCash" :mask-close-able="false" mode="center" border-radius="20" width="90%">
|
|
|
+ <view class="popup-title">本次收到缴费</view>
|
|
|
+ <view class="popup-body">
|
|
|
+ <u-input v-model="payParams.cashMoney" type="number" :border="true" :clearable="false" placeholder="请输入本次收到的金额(元)" />
|
|
|
+ </view>
|
|
|
+ <view class="popup-footer u-flex">
|
|
|
+ <view class="popup-btn1" ><u-button type="primary" @click="consfimPayway">确认</u-button> </view>
|
|
|
+ <view class="popup-btn2" ><u-button type="primary" :plain="true"@click="closecashPayway">关闭</u-button> </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <u-popup class="popup qrcode-popup" v-model="showQrcode" :mask-close-able="false" mode="center" border-radius="20" width="90%">
|
|
|
+ <tki-qrcode
|
|
|
+ ref="qrcode"
|
|
|
+ cid="tki-qrcode-canvas"
|
|
|
+ :val="qrcontent"
|
|
|
+ :size="200"
|
|
|
+ unit="px"
|
|
|
+ background="#000000"
|
|
|
+ foreground="#ffffff"
|
|
|
+ pdground="#ffffff"
|
|
|
+ :iconSize="40"
|
|
|
+ :onval="true"
|
|
|
+ :loadMake="false"
|
|
|
+ :usingComponents="true"
|
|
|
+ :showLoading="false"
|
|
|
+ loadingText="loadingText"
|
|
|
+ />
|
|
|
+ <view class="qrcode-popup-btn" @click="hideQrcode">关闭</view>
|
|
|
+ </u-popup>
|
|
|
<u-toast ref="uToast" />
|
|
|
</view>
|
|
|
</template>
|
|
@@ -43,10 +119,27 @@
|
|
|
//#ifdef APP-PLUS
|
|
|
let device = uni.requireNativePlugin("DeviceInfo");
|
|
|
//#endif
|
|
|
+ import tkiQrcode from "tki-qrcode";
|
|
|
export default{
|
|
|
mixins: [MescrollMixin], // 使用mixin
|
|
|
data(){
|
|
|
return{
|
|
|
+ // cashMoney:'',
|
|
|
+ showCash:false,
|
|
|
+ qrcontent:'',
|
|
|
+ showQrcode:false,
|
|
|
+ payParams:{
|
|
|
+ orderList:[],
|
|
|
+ code:'',
|
|
|
+ cashMoney:'',
|
|
|
+ },
|
|
|
+ currentItem: [],
|
|
|
+ payWayPop: false,
|
|
|
+ payTipsItem: {
|
|
|
+ num: '',
|
|
|
+ price: ''
|
|
|
+ },
|
|
|
+ payTipsPop: false,
|
|
|
vehicleNo:'',
|
|
|
listEmpty:false,
|
|
|
owelist:[],
|
|
@@ -64,6 +157,163 @@
|
|
|
// this.getData();
|
|
|
},
|
|
|
methods:{
|
|
|
+ cashPay(){
|
|
|
+ this.showCash = true;
|
|
|
+ },
|
|
|
+ closecashPayway(){
|
|
|
+ this.showCash = false;
|
|
|
+ },
|
|
|
+ consfimPayway(){
|
|
|
+ if(this.payParams.cashMoney==this.payTipsItem.price){
|
|
|
+ this.$u.api.cashPay(this.payParams)
|
|
|
+ .then(res=>{
|
|
|
+ uni.showLoading({
|
|
|
+ title: '查询支付状态中'
|
|
|
+ });
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.handlePayQuery(res.data.polyOrderId)
|
|
|
+ }, 3000);
|
|
|
+ }).catch(err=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: err.msg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '支付金额小于欠费金额,不能支付',
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ qrPay(){
|
|
|
+ console.log('this.payParams',this.payParams);
|
|
|
+ this.$u.api.gzbankPolypay(this.payParams)
|
|
|
+ .then(res=>{
|
|
|
+ // this.$refs.uToast.show({
|
|
|
+ // title: res.msg,
|
|
|
+ // type: 'success',
|
|
|
+ // });
|
|
|
+ this.showPayway = false;
|
|
|
+ this.showQrcode = true;
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.qrcontent = res.data.qrCodeUrl;
|
|
|
+ },500)
|
|
|
+
|
|
|
+ // 启动定时器查询订单状态
|
|
|
+ uni.showLoading({
|
|
|
+ title: '等待支付中'
|
|
|
+ });
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.handlePayQuery(res.data.polyOrderId)
|
|
|
+ }, 3000);
|
|
|
+ console.log('gzbankPolypay',res)
|
|
|
+ }).catch(err=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: err.msg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ console.log('gzbankPolypay ',err)
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ hideQrcode(){
|
|
|
+ this.showQrcode = false;
|
|
|
+ },
|
|
|
+ scanPay(){
|
|
|
+ setTimeout(() =>{
|
|
|
+ uni.scanCode({
|
|
|
+ onlyFromCamera: true,
|
|
|
+ scanType:['barCode','qrCode'],
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res)
|
|
|
+ this.payParams.code = res.result;
|
|
|
+ this.$u.api.gzbankSwept(this.payParams)
|
|
|
+ .then(res=>{
|
|
|
+ // 启动定时器查询订单状态
|
|
|
+ uni.showLoading({
|
|
|
+ title: '查询支付状态中'
|
|
|
+ });
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.handlePayQuery(res.data.polyOrderId)
|
|
|
+ }, 3000);
|
|
|
+
|
|
|
+ }).catch(err=>{
|
|
|
+ //#ifdef APP-PLUS
|
|
|
+ plus.nativeUI.toast(err.msg);
|
|
|
+ //#endif
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ fail:function(err){
|
|
|
+ //#ifdef APP-PLUS
|
|
|
+ plus.nativeUI.toast('扫码失败');
|
|
|
+ ALog.info({msg:'条码类型:err' + err});
|
|
|
+ //#endif
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },2000)
|
|
|
+ },
|
|
|
+ handlePayQuery(polyOrderId){
|
|
|
+ this.$u.api.payQuery({polyOrderId:polyOrderId})
|
|
|
+ .then(res=>{
|
|
|
+ // this.$refs.uToast.show({
|
|
|
+ // title: res.msg,
|
|
|
+ // type: 'success',
|
|
|
+ // });
|
|
|
+ // 支付成功后的页面跳转
|
|
|
+ if (res.data.payStatus==1) {
|
|
|
+ uni.hideLoading();
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title:'支付成功',
|
|
|
+ type: 'success',
|
|
|
+ url:'pages/index/index',
|
|
|
+ // params: {
|
|
|
+ // vehicleNo:this.orderVehicleNo,
|
|
|
+ // },
|
|
|
+ duration:10000
|
|
|
+ });
|
|
|
+ };
|
|
|
+ console.log('handlePayQuery',res)
|
|
|
+ }).catch(err=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: err.msg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ console.log('handlePayQuery ',err)
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ // 缴费提示弹框确认
|
|
|
+ payTipsPopConfirm() {
|
|
|
+ this.payWayPop = true
|
|
|
+ },
|
|
|
+ // 全部缴费确认
|
|
|
+ confirmPrice(){
|
|
|
+ let orderNum = 0, price = 0
|
|
|
+ this.currentItem = []
|
|
|
+ this.owelist.forEach(item => {
|
|
|
+ console.log(item)
|
|
|
+ if ((item.orderStatus == 2||item.orderStatus == 3) && item.payStatus !== 1 ) {
|
|
|
+ price += item.payAmount
|
|
|
+ orderNum ++
|
|
|
+ this.currentItem.push(item.orderId);
|
|
|
+ this.payParams.orderList.push(item.orderId);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.payTipsItem.num = orderNum
|
|
|
+ this.payTipsItem.price = price
|
|
|
+ if (orderNum !== 0 && price !== 0) {
|
|
|
+ this.payTipsPop = true
|
|
|
+ } else {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '没有需要支付的订单',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
customBack(){
|
|
|
uni.reLaunch({
|
|
|
url: '/pages/index/index'
|
|
@@ -113,33 +363,45 @@
|
|
|
|
|
|
},
|
|
|
onParkIn(item){
|
|
|
- this.$u.api.printIn({orderId:item.orderId})
|
|
|
- .then(res => {
|
|
|
- if(res.code == 200){
|
|
|
- //#ifdef APP-PLUS
|
|
|
- device.print(res.data);
|
|
|
- //#endif
|
|
|
- plus.nativeUI.toast('打印成功');
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err=>{
|
|
|
- plus.nativeUI.toast('打印失败');
|
|
|
+ this.$u.route({
|
|
|
+ url:'pages/receipts/receiptsIn',
|
|
|
+ params: {
|
|
|
+ orderId:item.orderId
|
|
|
+ }
|
|
|
});
|
|
|
+ // this.$u.api.printIn({orderId:item.orderId})
|
|
|
+ // .then(res => {
|
|
|
+ // if(res.code == 200){
|
|
|
+ // //#ifdef APP-PLUS
|
|
|
+ // device.print(res.data);
|
|
|
+ // //#endif
|
|
|
+ // plus.nativeUI.toast('打印成功');
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(err=>{
|
|
|
+ // plus.nativeUI.toast('打印失败');
|
|
|
+ // });
|
|
|
|
|
|
},
|
|
|
onParkLeave(item){
|
|
|
- this.$u.api.printLeave({orderId:item.orderId})
|
|
|
- .then(res => {
|
|
|
- if(res.code == 200){
|
|
|
- //#ifdef APP-PLUS
|
|
|
- device.print(res.data);
|
|
|
- //#endif
|
|
|
- plus.nativeUI.toast('打印成功');
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err=>{
|
|
|
- plus.nativeUI.toast('打印失败');
|
|
|
+ this.$u.route({
|
|
|
+ url:'pages/receipts/receiptsOut',
|
|
|
+ params: {
|
|
|
+ orderId:item.orderId
|
|
|
+ }
|
|
|
});
|
|
|
+ // this.$u.api.printLeave({orderId:item.orderId})
|
|
|
+ // .then(res => {
|
|
|
+ // if(res.code == 200){
|
|
|
+ // //#ifdef APP-PLUS
|
|
|
+ // device.print(res.data);
|
|
|
+ // //#endif
|
|
|
+ // plus.nativeUI.toast('打印成功');
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(err=>{
|
|
|
+ // plus.nativeUI.toast('打印失败');
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
}
|