油站二维码
This commit is contained in:
@@ -15,16 +15,17 @@
|
||||
@result="qrR" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-center padding-bottom-xs padding-bottom-xs">
|
||||
<view @tap="refreashQr" class="text-center padding-bottom-xs padding-bottom-xs">
|
||||
<text class="color-999 font-12">
|
||||
<text class="cuIcon-refresh padding-right-xs"></text>
|
||||
付款码自动 (25s)
|
||||
<!-- 付款码自动 (25s) -->
|
||||
付款码
|
||||
<text class="oil-main-color">
|
||||
刷新
|
||||
刷新
|
||||
</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="text-center color-000 font-10 margin-bottom-sm">
|
||||
<view class="text-center color-000 font-10 margin-bottom-sm" @tap="refreashQr">
|
||||
提示:司机扫描二维码支付油费
|
||||
</view>
|
||||
<view class="padding font-12 solid-top">
|
||||
@@ -39,7 +40,10 @@
|
||||
</view>
|
||||
|
||||
<view class="text-right flex-sub oil-main-color">
|
||||
¥1.20
|
||||
<text v-if="!showData.realPay">
|
||||
未指定
|
||||
</text>
|
||||
<text v-else>¥{{showData.realPay}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex padding-left padding-right">
|
||||
@@ -54,7 +58,10 @@
|
||||
|
||||
|
||||
<text class="text-right flex-sub">
|
||||
约56.00L
|
||||
<text v-if="!showData.vol">
|
||||
未指定
|
||||
</text>
|
||||
<text v-else>{{showData.vol}}L</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -74,7 +81,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-left padding-bottom padding-top-0 bg-white">
|
||||
<OrderOilForm />
|
||||
<OrderOilForm @confirmVol="getDesignatedQr" :oilList="oilList" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -85,7 +92,7 @@
|
||||
import OrderOilForm from '@/components/OrderOil.vue'
|
||||
// 引入二维码库
|
||||
import QR from "@/utils/wxqrcode.js" // 二维码生成器
|
||||
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
|
||||
|
||||
export default {
|
||||
@@ -95,19 +102,81 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
oilList: [],
|
||||
modalName: 'mod',
|
||||
oilSiteName: '',
|
||||
qrImg: "https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1102530589,2787379918&fm=11&gp=0.jpg",
|
||||
val: '羊的屎是猪',
|
||||
iconUrl: '../../static/img/qr-icon.png'
|
||||
val: '',
|
||||
iconUrl: '../../static/img/qr-icon.png',
|
||||
oilDate: {
|
||||
oilSiteCode: uni.getStorageSync('oilSite').oilSiteCode,
|
||||
oilSiteName: uni.getStorageSync('oilSite').oilSiteName,
|
||||
oilCode: '',
|
||||
oilName: '',
|
||||
gunId: '',
|
||||
standardPrice: '',
|
||||
oilPrice: '',
|
||||
vol: ''
|
||||
},
|
||||
showData: {
|
||||
vol: '',
|
||||
realPay: ''
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.oilSiteName = uni.getStorageSync('oilSiteName')
|
||||
this.getDefaultQr()
|
||||
this.getSiteInfo()
|
||||
// this.getDesignatedQr/()
|
||||
console.log('oilDate', this.oilDate)
|
||||
},
|
||||
methods: {
|
||||
// 刷新
|
||||
refreashQr() {
|
||||
console.log('刷新函数')
|
||||
if (this.showData.vol) {
|
||||
this.getDesignatedQr()
|
||||
} else {
|
||||
this.getDefaultQr()
|
||||
}
|
||||
},
|
||||
getSiteInfo() {
|
||||
cloudSiteApi.getSiteDetail().then(res => {
|
||||
console.log('...', res)
|
||||
if (res.code === 20000) {
|
||||
this.site = res.data.site
|
||||
this.oilList = res.data.oil
|
||||
uni.setStorage({
|
||||
key: 'oilSite',
|
||||
data: res.data.site
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getDefaultQr() {
|
||||
cloudSiteApi.getSiteQrCode().then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.val = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getDesignatedQr(data) {
|
||||
const data6 = {
|
||||
...this.oilDate,
|
||||
...data
|
||||
}
|
||||
this.showData = data
|
||||
cloudSiteApi.getDesignatedSiteQrCode(data6).then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.val = res.data
|
||||
this.hideModal()
|
||||
}
|
||||
})
|
||||
},
|
||||
hideModal() {
|
||||
console.log('关闭呀')
|
||||
this.modalName = ''
|
||||
},
|
||||
qrR() {
|
||||
|
||||
Reference in New Issue
Block a user