12
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
{{siteInfo.siteName?siteInfo.siteName:'油站名称'}}
|
||||
</view>
|
||||
<view class="font-12 color-999 site-label text-cut">
|
||||
{{siteInfo.address?siteInfo.siteName:'油站地址'}}
|
||||
{{siteInfo.address?siteInfo.address:'暂无地址'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="action " @tap="openMap">
|
||||
@@ -112,12 +112,13 @@
|
||||
getSiteInfo(id) {
|
||||
let data2 = {
|
||||
...uni.getStorageSync('location'),
|
||||
siteId: id,
|
||||
id: id,
|
||||
clientBelong: "ZHONGPIN"
|
||||
}
|
||||
oilSiteApi.getSiteDetails(data2).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.siteInfo = res.data
|
||||
this.siteInfo = res.data;
|
||||
this.siteInfo.oilSiteChannelDetailsVos[0].channelId = res.data.id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class="">
|
||||
<view class="padding-xl text-center">
|
||||
<text class="text-xxl text-bold oil-main-color">
|
||||
{{order.realAmount>0?order.realAmount:'xxx.x'|moneyFormat}}
|
||||
{{order.payRealAmount>0?order.payRealAmount:'xxx.x'}}
|
||||
</text>
|
||||
<view class="text-gray">
|
||||
支付剩余时间 <time-down :is-day="false" :is-hour="false" :tip-text="' '" :day-text="' '" :hour-text="':'"
|
||||
@@ -138,7 +138,7 @@
|
||||
</view>
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油金额:<text class="fr">{{moneyIntercept(order.xoilAmountGun) }}</text>
|
||||
加油金额:<text class="fr">{{moneyIntercept(order.sitePriceAmount) }}</text>
|
||||
<!-- <text
|
||||
class="fr">{{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
||||
</view>
|
||||
@@ -156,17 +156,17 @@
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
<text class="text-blues text-bold text-lg fr">
|
||||
¥{{order.realAmount>0? moneyIntercept(order.realAmount) :'xxx.x' }}</text>
|
||||
¥{{order.realAmount>0? order.payRealAmount:'xxx.x' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding placeholder-hidden">
|
||||
<button class="cu-btn block lg bg-main-oil" @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.id)">取消订单</button>
|
||||
</view>
|
||||
<view class="padding fixed-bar-bottom">
|
||||
<button class="cu-btn block lg bg-main-oil" @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.id)">取消订单</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油员:
|
||||
<text class="fr">{{order.siteUserName}}</text>
|
||||
<text class="fr">{{order.siteUserName||'---'}}</text>
|
||||
</view>
|
||||
<!-- <view class="padding-tb-xs flex text-left">
|
||||
<view class="flex-sub">
|
||||
@@ -80,7 +80,7 @@
|
||||
</view> -->
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油金额:<text class="fr">{{order.xoilAmountGun |moneyFormat}}</text>
|
||||
加油金额:<text class="fr">{{order.payRealAmount }}</text>
|
||||
<!-- <text class="fr">{{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
<text class="text-red text-bold text-lg fr">{{order.realAmount>0?'¥'+order.realAmount:'xxx.x'}}</text>
|
||||
<text class="text-red text-bold text-lg fr">{{order.payRealAmount>0?'¥'+order.payRealAmount:'xxx.x'}}</text>
|
||||
</view>
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
@@ -105,7 +105,7 @@
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油司机:
|
||||
<text class=" fr">{{user.customerCode}}</text>
|
||||
<text class=" fr">{{user.name}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油卡性质:
|
||||
@@ -128,6 +128,7 @@
|
||||
<script>
|
||||
import toilApi from '@/api/toil.js'
|
||||
import oilSiteApi from '@/api/oil-site.js'
|
||||
import orderApi from '@/api/oil-order.js'
|
||||
import tkiQrcode from "../components/tki-qrcode/tki-qrcode.vue" //二维码生成器
|
||||
|
||||
import ThirdPartyVoucher from '../components/third-party-voucher/third-party-voucher.vue'
|
||||
@@ -139,6 +140,7 @@
|
||||
data() {
|
||||
const now = new Date()
|
||||
return {
|
||||
statusTimer:null,
|
||||
showtitles:"",
|
||||
hour: now.getHours() < 10 ? '0' + now.getHours() : now.getHours(), //当小时为个为数时在在前加0(例:01),以下同理
|
||||
minutes: now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes(),
|
||||
@@ -184,7 +186,7 @@
|
||||
this.getOrderQrCode()
|
||||
},
|
||||
getOrderQrCode(){
|
||||
oilSiteApi.getOrderQrCode(this.order.orderSerialNumber).then( (res)=>{
|
||||
oilSiteApi.getOrderQrCode(this.order.id).then( (res)=>{
|
||||
console.log(res)
|
||||
if(res.code == 40000){
|
||||
this.showQr = false
|
||||
@@ -192,7 +194,12 @@
|
||||
}else if(res.code == 20000){
|
||||
this.showQr = true
|
||||
this.showtext =false
|
||||
this.val =res.data.codeStr
|
||||
this.val =res.data.codeStr;
|
||||
if(!this.timeinterval ){
|
||||
this.timeinterval = setInterval(() => {
|
||||
this.newQrString()
|
||||
}, 1000 * 60 * 3);
|
||||
}
|
||||
}
|
||||
} )
|
||||
},
|
||||
@@ -252,7 +259,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 三方支付结果弹窗结束
|
||||
backToIndex() {
|
||||
this.innerAudioContext.stop()
|
||||
@@ -270,12 +276,26 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getStatus(order,callBack){
|
||||
this.statusTimer = setInterval(()=>{
|
||||
orderApi.getOrderPayInfo(order.id,'hide').then(res=>{
|
||||
if(res.code==20000){
|
||||
if(Number(res.data.orderStatus)!==0){
|
||||
callBack(res.data.orderStatus);
|
||||
clearInterval(this.statusTimer);
|
||||
this.statusTimer = null;
|
||||
}
|
||||
}
|
||||
})
|
||||
},2000)
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option)
|
||||
console.log('支付进入onload')
|
||||
let oilItem = uni.getStorageSync('oilItem')
|
||||
let oilItem = uni.getStorageSync('oilItem');
|
||||
let order = uni.getStorageSync('orderMade');
|
||||
this.showtitles = oilItem.listTag
|
||||
if(oilItem.listTag == '万金油'){
|
||||
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/wanjinyou.mp3'
|
||||
@@ -293,10 +313,10 @@
|
||||
setInterval(() => {
|
||||
this.getTime()
|
||||
},1000) //设置定时器,时时间每隔一秒钟走一次(即每秒)
|
||||
this.timeinterval = setInterval(() => {
|
||||
console.log('1')
|
||||
this.newQrString()
|
||||
}, 1000 * 60 * 3);
|
||||
setTimeout(()=>{
|
||||
this.newQrString()
|
||||
},5000)
|
||||
|
||||
if(option.payMethod == '1' && option.status == 'success'){
|
||||
if(option.status == 'success') {
|
||||
console.log('这里是支付成功')
|
||||
@@ -323,6 +343,23 @@
|
||||
this.queryOrderStatusSq()
|
||||
return
|
||||
}
|
||||
this.getStatus(order,status=>{
|
||||
switch (Number(status)) {
|
||||
case 1:
|
||||
this.textstatus = '支付成功';
|
||||
break;
|
||||
case -1:
|
||||
this.textstatus ='支付失败';
|
||||
break;
|
||||
case 2:
|
||||
this.textstatus = '订单已取消';
|
||||
break;
|
||||
case 3:
|
||||
this.textstatus = '订单已退款';
|
||||
break;
|
||||
}
|
||||
console.log(this.textstatus,status)
|
||||
})
|
||||
},
|
||||
filters: {
|
||||
moneyFormath(value) {
|
||||
@@ -366,7 +403,8 @@
|
||||
},
|
||||
onUnload() {
|
||||
console.log('这里是卸载页面')
|
||||
this.innerAudioContext.stop()
|
||||
this.innerAudioContext.stop();
|
||||
if(this.timeinterval)clearInterval(this.timeinterval);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user