This commit is contained in:
caolc
2022-08-29 09:45:23 +08:00
parent f6cef4b439
commit 63bb475012
34 changed files with 742 additions and 231 deletions

View File

@@ -96,7 +96,7 @@ export default {
}
},
created(){
this.orderData = this.$route.params.order;
this.orderData = JSON.parse(this.$route.query.order);
this.time = this.getCountDownTime(this.orderData.createTime);
this.updateDetails();
this.cardListFn();
@@ -113,7 +113,7 @@ export default {
this.detailsList[1][1].value = this.orderData.oilsCode + ' '+ this.orderData.oilsBar+'号枪' ||'暂无数据';
this.detailsList[1][2].value = Number(this.orderData.volume).toFixed(2) + 'L'||'暂无数据';
this.detailsList[2][0].value = '¥'+Number(this.orderData.xoilAmountGun).toFixed(2)|| '¥'+Number(this.orderData.baseRealPriceAmount).toFixed(2)||'暂无数据';
this.detailsList[2][1].value = '-¥'+Number(this.orderData.oilDiscountAmount).toFixed(2)||'-¥'+Number(this.orderData.discountAmount).toFixed(2)||'暂无数据';
this.detailsList[2][1].value = '-¥'+Number(this.orderData.oilDiscountAmount).toFixed(2)||'-¥'+ Number(this.orderData.discountAmount).toFixed(2)||'暂无数据';
this.detailsList[2][2].value = '-¥'+Number(this.orderData.couponDiscountAmount).toFixed(2)||'暂无数据';
this.detailsList[3][0].value = '¥'+Number(this.orderData.realAmount).toFixed(2)||'暂无数据';
},
@@ -134,19 +134,20 @@ export default {
"orderSerialNumber": this.orderData.orderSerialNumber, //类型String 必有字段 备注:订单编号
"payChannel": "BALANCE_PAYMENT", //类型String 必有字段 备注支付渠道BALANCE_PAYMENT余额支付
"orderMethod": "CUSTOMER_ACTIVE", //类型String 必有字段 备注订单产生方式CUSTOMER_ACTIVE客户扫码支付客户扫描油站二维码完成支付
"createSource": "XOIL_DRIVER_COMPANY_WECHAT_APPLET"
"createSource": "XOIL_DRIVER_COMPANY_WECHAT_APPLET",
oilCardType:-1
}
let orderType = 0
let orderType = false
oilOrderApi.payOrder(payData).then(res=>{
if(res.code==20000){
orderType = 1
orderType = true
}
}).finally((e)=>{
this.$router.push({
name:'paymentl',
params:{
orderData:this.orderData,
orderType:orderType
query:{
orderData:JSON.stringify(this.orderData),
type:JSON.stringify(orderType)
}
})
})

View File

@@ -1,15 +1,14 @@
<template>
<div :style="{boxShadow:boxShadow?'':'none'}" class="payment-details">
<div v-if="title" v-html="title" class="payment-details-title flex ac jc"></div>
<div :style="{ boxShadow: boxShadow ? '' : 'none' }" class="payment-details">
<div v-if="title" v-html="title" class="payment-details-title flex ac jc"></div>
<div class="payment-details-container">
<div
v-for="(item, index) in detailsList"
:key="index"
class="payment-details-item"
>
<div v-for="(items,indexs) in item" :key="indexs" class="payment-details-item-row flex ac bw">
<div v-for="(item, index) in detailsList" :key="index" class="payment-details-item">
<div v-for="(items, indexs) in item" :key="indexs" class="payment-details-item-row flex ac bw">
<span class="payment-details-item-row-lable">{{ items.lable }}</span>
<span :style="{color:items.valueStyle?.color?items.valueStyle.color:''}" >{{ items.value }}</span>
<span :style="{ color: items.valueStyle?.color ? items.valueStyle.color : '' }">
{{ items.value }}
<van-icon size="20" v-if="items.lable == '订单编号:'" @click="copy(items)" name="newspaper-o" />
</span>
</div>
</div>
<div v-if="statistics" class="payment-details-item">
@@ -26,7 +25,7 @@
export default {
name: "detailsCard",
props: {
boxShadow: {
boxShadow: {
type: Boolean,
default: true,
},
@@ -43,6 +42,30 @@ export default {
default: () => [],
},
},
methods: {
copy(e) {
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(e.value);
this.$toast('复制成功');
} else {
let input = document.createElement('input');
input.setAttribute('value', e.value);
document.body.appendChild(input);
input.select();
try {
var copyed = document.execCommand("copy");
if (copyed) {
document.body.removeChild(input);
this.$toast('复制成功');
}
} catch {
this.$toast("复制失败,请检查浏览器兼容");
}
}
}
}
};
</script>
<style>
@@ -55,15 +78,19 @@ export default {
.payment-details-item-row-lable {
color: #999999;
}
.payment-details-item-row {
margin-top: 10px;
}
.payment-details-item:first-child {
margin-top: 0q;
}
.payment-details-item:last-child {
border-bottom: dashed 0px #b9b9b9;
}
.payment-details-item {
box-sizing: border-box;
border-bottom: dashed 1px #b9b9b9;
@@ -76,6 +103,7 @@ export default {
margin-top: 30px;
padding: 0 20px;
box-sizing: border-box;
padding-top: 10px;
}
.payment-details-title {
@@ -90,6 +118,7 @@ export default {
font-weight: normal;
color: #333333;
}
.payment-details {
width: 690px;
background: #ffffff;

View File

@@ -4,7 +4,10 @@
<img v-if="!codeTpe.switch" class="paymentl-header-img" :src="codeTpe.imgType? cg :sb " alt="">
<div v-else class="paymentl-vue-qr">
<vue-qr v-if="codeTpe.codeValue" :text="codeTpe.codeValue"></vue-qr>
<div class="paymentl-vue-qr-tip">提示该二维码每隔3分钟自动刷新一次</div>
<div class="paymentl-vue-qr-tip">
<van-count-down style="color:#999999" format="mm:ss" :time="countTimer" />
提示该二维码每隔3分钟自动刷新一次
</div>
</div>
</div>
</template>
@@ -14,6 +17,10 @@ import vueQr from 'vue-qr'
export default {
props: {
countTimer:{
type:Number,
default:0
},
codeTpe: {
type: Object,
default: () => {

View File

@@ -1,7 +1,7 @@
<template>
<div class="paymentl">
<detailsCardHeader :codeTpe="codeTpe" ></detailsCardHeader>
<detailsCard :title=" codeTpe.imgType? '请提醒加油员使用 <span>“星油云站”</span> 进行订单核实': '支付<span>“失败”</span> 请重新支付 ' " :detailsList="detailsList"></detailsCard>
<detailsCardHeader :countTimer='countTimer' :codeTpe="codeTpe" ></detailsCardHeader>
<detailsCard :detailsList="detailsList"></detailsCard>
<div @click="goHome" class="paymentl-footer flex ac jc">返回首页</div>
</div>
</template>
@@ -10,7 +10,9 @@
import vueQr from 'vue-qr'
import detailsCard from "./components/detailsCard.vue";
import detailsCardHeader from "./components/detailsCardHeader.vue";
import oilSiteApi from '@/api/oil-site.js'
import oilSiteApi from '@/api/oil-site.js';
import useStore from '@/store/piniaIndex';
let store = useStore();
export default {
components: {
detailsCard,
@@ -19,6 +21,7 @@ export default {
},
data() {
return {
user:store.user,
countTimer:180,
timer:null,
codeTpe:{
@@ -87,7 +90,7 @@ export default {
},
{
lable: '加油司机:',
value: '孙司机(100038)',
value: (store.user&&store.user.name)||'---',
},
{
lable: '油卡性质:',
@@ -99,30 +102,31 @@ export default {
};
},
created(){
console.log(this.user,'user')
this.init()
},
watch:{
countTimer:function(n){
console.log(n,'+++')
}
},
methods:{
init(){
this.orderData = this.$route.params.orderData
this.codeTpe.imgType = this.$route.params.type
this.orderData = JSON.parse(this.$route.query.orderData)
this.codeTpe.imgType = JSON.parse(this.$route.query.type)
console.log(this.codeTpe.imgType)
this.getCode();
this.updateDetails();
},
Timekeeping(){
this.countTimer = 180
this.countTimer = 180000
this.timer = setInterval(()=>{
if(this.countTimer==0){
clearInterval(this.timer);
this.getCode()
return
}
this.countTimer-=1;
},100)
this.countTimer-=10;
},10)
},
goHome(){
this.$router.push('/')
@@ -134,7 +138,7 @@ export default {
this.detailsList[1][2].value = `${Number(this.orderData.volume).toFixed(2)}L`;
this.detailsList[1][3].value = this.orderData.siteUserName ;
this.detailsList[2][0].value = '¥'+this.orderData.realAmount ;
this.detailsList[2][1].value = '¥'+this.orderData.oilDiscountAmount ;
this.detailsList[2][1].value = '¥'+ Number(this.orderData.oilDiscountAmount).toFixed(2) ;
this.detailsList[3][0].value = this.orderData.plateNumber ;
// this.detailsList[3][2].value = '¥'+this.orderData.plateNumber ;
},