Files
LSM_OIL_SITE/packageQr/pages/qrsite/QrCode_xy.vue
xk_guohonglei d2949e657a 二维码生成页面中心icon没了的bug
一次大型分包更新生产了
合作企业路由
/packageQr/pages/partnership/partnership

员工管理路由
/packageStaff/pages/staff/List/List

油站二维码路由
/packageQr/pages/qrsite/QrCode_xy

加油订单路由改成
/packageOrders/pages/orderList/orderList
2021-01-22 17:19:34 +08:00

202 lines
5.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="page-content bg-main-oil">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">油站二维码</block>
</cu-custom>
<view class="margin-xl padding radius bg-white">
<view class="text-center padding">
<text class="text-lg text-black">{{oilSiteName}}</text>
</view>
<view class="qr-container padding-top text-center ">
<view class="qrimg">
<tki-qrcode ref="qrcode" :val="val" :size="400" unit="upx" background="#fff" foreground="#000" pdground="#000"
:icon="iconUrl" iconSize="40" :onval="true" :loadMake="true" :usingComponents="usingComponents" :showLoading="true"
@result="qrR" />
</view>
</view>
<view @tap="refreashQr" class="text-center padding-top padding-bottom-xs padding-bottom-xs">
<text class="color-999 font-12">
<text class="cuIcon-refresh padding-right-xs"></text>
<!-- 付款码自动 25s -->
收款码
<text class="oil-main-color">
刷新
</text>
</text>
</view>
<view class="text-center color-000 font-10 margin-bottom-sm" @tap="refreashQr">
提示司机扫描二维码支付油费
</view>
<view class="padding font-12 solid-top">
<view class="flex padding-bottom-sm padding-left padding-right">
<view class="flex-sub">
<text class="cuIcon-moneybagfill oil-main-color font-16 padding-right-xs">
</text>
<text>
加油金额
</text>
</view>
<view class="text-right flex-sub oil-main-color">
<text v-if="!showData.realPay">
未指定
</text>
<text v-else>{{showData.realPay}}</text>
</view>
</view>
<view class="flex padding-left padding-right">
<view class="flex-sub">
<text class="cuIcon-infofill color-wjy font-16 padding-right-xs">
</text>
<text>
加油升数
</text>
</view>
<text class="text-right flex-sub">
<text v-if="!showData.vol">
未指定
</text>
<text v-else>{{showData.vol}}L</text>
</text>
</view>
</view>
</view>
<view class="margin-xl padding-top">
<button class="bg-white oil-main-color" @tap="modalName='show'">设置油品加油升数</button>
</view>
<view class="cu-modal" :class="modalName">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content ">
{{oilSiteName}}
</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="text-left padding-bottom padding-top-0 bg-white">
<OrderOilForm @confirmVol="getDesignatedQr" :oilList="oilList" />
</view>
</view>
</view>
</view>
</template>
<script>
import OrderOilForm from '@/packageQr/components/OrderOil.vue'
// 引入二维码库
import cloudSiteApi from '@/api/cloud-site.js'
import tkiQrcode from "@/packageQr/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
export default {
components: {
OrderOilForm,
tkiQrcode
},
data() {
return {
oilList: [],
xkPrice:'',
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',
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(this.showData)
} 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() {
console.log('5555')
}
}
}
</script>
<style scoped>
.page-content {
min-height: 100%;
}
.qr-img {
width: 400upx;
height: 400rpx;
margin: auto;
}
</style>