佰川加油

This commit is contained in:
caolc
2022-08-08 09:20:48 +08:00
commit a10b2b7dcc
130 changed files with 24997 additions and 0 deletions

View File

@@ -0,0 +1,219 @@
<template>
<view>
<view class="content text-left padding">
<view class="strong padding-bottom-xs color-333 ">
{{oilSite.oilSiteName}}
</view>
<view class="font-12 color-999">
<text class=" text-cut">{{oilSite.address}}</text>
</view>
</view>
<view class="padding-left padding-right">
<view class="padding-bottom-sm">
油号选择
</view>
<view class="grid col-5 justify-start">
<view class="padding-xs" v-for="(item,index) in oilList" :key="index">
<button class="cu-btn" @tap="oilNameSel(item)" :class="[selected.oilName===item.oilName?'bg-main-oil':'line-gray']">{{item.oilName}}</button>
</view>
</view>
</view>
<view class="padding-top-xs padding-left padding-right">
<text class="strong padding-right font-16">
{{selected.oilName}}
</text>
<text class="padding-right">星油价格:<text class="oil-main-color text-bold">{{selected.xkPrice?selected.xkPrice:selected.lvPrice|numberFilter}}/L</text></text>
<text class="s-rich">市场价:{{selected.standardPrice|numberFilter}}/L</text>
</view>
<view class="padding-left padding-right">
<view class="padding-bottom-sm">
油枪选择
</view>
<view class="grid col-5 justify-start">
<view class="padding-xs" v-for="(item,index) in ColorList" :key="index">
<button @tap="gunIdSel(index)" class="cu-btn" :class="[gunId===index?'bg-main-oil':'line-gray']">{{index+1}}</button>
</view>
</view>
</view>
<view class="solid-top margin-top-sm shadow-warp">
<view class="cu-form-group">
<view class="title">加油升数</view>
<input type="digit" v-model="vol" @input="calcMoney" placeholder="请输入加油升数" name="input" />
<text>{{money.total|numberFilter}}</text>
</view>
<view class="my-cell">
<text class="font-12">星卡优惠金额</text><text class="fr">-{{money.discount|numberFilter}}</text>
</view>
<view class="my-cell">
<text class="font-12">实际支付金额</text><text class="oil-main-color fr">{{money.realPay|numberFilter}}</text>
</view>
</view>
<button class="margin round bg-main-oil" @tap="onConfirm">确定</button>
</view>
</template>
<script>
export default {
props: {
oilList: {
type: Array,
default () {}
}
},
data() {
return {
active: 0,
vol: '',
oliNameList: [1, 2, 9, 10],
ColorList: [1, 2, 9, 10],
gunId: 0,
oilSite: uni.getStorageSync('oilSite'),
selected: {
xkPrice: '',
standardPrice: ''
},
money: {
total: '',
discount: '',
realPay: ''
},
price: 1
}
},
created() {
console.log(this.oilList)
this.initForm()
},
watch: {
oilList: {
handler(newVal, oldVal) {
console.log('深度监听', newVal, oldVal)
this.oilList = newVal
this.initForm()
},
deep: true
},
selected: {
handler(newVal, oldVal) {
console.log('深度监听2323', newVal, oldVal)
this.selected = newVal
if (newVal) {
this.calcMoney()
}
},
deep: true
},
},
methods: {
gunIdSel(index) {
this.gunId = index
},
oilNameSel(item) {
this.selected = item
},
initForm() {
if (this.oilList) {
this.selected = this.oilList[0]
}
},
onConfirm() {
const data5 = {
...this.selected,
vol: this.vol,
oilPrice: this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice,
gunId: this.gunId + 1,
realPay: this.money.realPay
}
console.log('被选中的', data5)
this.$emit('confirmVol', data5)
},
calcMoney(e) {
// var vol;
// vol = e.detail.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');
// this.vol = vol
this.price = this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice
this.money.total = this.vol * this.selected.standardPrice
// this.money.discount = this.money.total - this.vol * (this.selected.standardPrice - this.price)
// this.money.realPay = (this.money.total - this.money.discount).toFixed(2)
this.money.discount = this.vol * (this.selected.standardPrice - this.price)
this.money.realPay = (this.money.total - this.money.discount).toFixed(2)
console.log('总金额', '折扣', '实际支付')
}
},
filters: {
numberFilter(value) {
value = value - 1 + 1
if (value) {
return value.toFixed(2)
} else {
return '0.00'
}
}
}
}
</script>
<style scoped>
.page-content {
background-color: #F1F2F7;
min-height: 100%;
position: relative;
}
.navigation {
position: absolute;
right: 16px;
top: 10px;
}
.icon-self {
width: 1rem;
height: 1rem;
}
.oil-price {
position: relative;
}
.oil-price radio {
position: absolute;
left: 0rem;
top: 10px;
}
.qr-icon {
font-size: 2rem;
}
.pay-desc {
line-height: 2rem;
}
.bottom-pay {
min-height: 100rpx;
width: 750upx;
}
.pay-bar {
width: 750upx;
position: absolute;
bottom: 0;
}
.money-container {
position: relative;
}
.money-position {
position: absolute;
top: 0;
right: 0;
display: block;
border-radius: 0 0 0 100upx;
}
</style>

View File

@@ -0,0 +1,110 @@
<template>
<view class="margin padding bg-gragul-oil radius company-card">
<view class="padding-top padding-bottom-lg flex">
<view class="basis-xl">
<text class="text-white">{{company.companyName}}</text>
<view class="padding-top-xs">
<text class="text-white" @tap="makeCall(company.leaderPhone)">负责人{{company.leaderName}} ({{company.leaderPhone|phoneFilter}})</text>
</view>
</view>
<view class="basis-xs">
<!-- bg-qy -->
<view class="bg-qy">
<image style="width: 100%;" :src="mainURL+'bg-qy.png'" mode="widthFix"></image>
</view>
</view>
</view>
<view class="dashed-top padding-top">
<view class="flex">
<view class="flex-sub text-center" v-show="company.openJoinCompany" @tap="joinqr">
<button class="cu-btn round bg-white text-red text-sm">
<text class="text-lg">
<text class="cuIcon-qr_code padding-right-xs"></text>
</text>
出示二维码
</button>
</view>
<view class="flex-sub text-center" v-show="company.openDirectOil" @tap="oiling">
<button class="cu-btn round bg-white text-red text-sm">
<text class="text-lg">
<text class="cuIcon-addressbook padding-right-xs"></text>
</text>
<!-- <text class="cuIcon-crown padding-right-xs"></text> -->
直接加油
</button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
company:{
type:Object,
default(){}
}
},
data() {
return {
mainURL: this.global.mainURL,
}
},
methods: {
oiling() {
uni.navigateTo({
url: `/packageQr/pages/partnership/partner-group/partner-group?id=${this.company.companyId}`
})
},
joinqr() {
uni.navigateTo({
url: `/packageQr/pages/partnership/join-qr/join-qr?id=${this.company.companyId}&name=${this.company.companyName}`
})
},
makeCall(number){
uni.makePhoneCall({
phoneNumber:number
})
}
},
filters:{
phoneFilter(value){
if(value){
return value.substring(0, 3) + ' ' + ' **** ' + ' ' + value.substring(7, 11)
}else{
return '暂无手机号'
}
}
}
}
</script>
<style scoped>
.bg-gragul-oil {
background: linear-gradient(-51deg, rgba(255, 0, 0, 0.81), rgba(255, 19, 19, 0.81));
}
.dashed-top::after {
border-color: #fff !important;
}
.company-card {
position: relative;
margin-bottom: 1rem;
}
.bg-qy {
position: absolute;
z-index: 1;
width: 120upx;
height: 120upx;
top: 15rpx;
right: 2.5rem;
}
.cu-btn {
border-radius: 100upx 100upx 100upx 0;
}
</style>

View File

@@ -0,0 +1,67 @@
<template>
<view class="solid-bottom content" @tap="virtualScan(driver.driverId)">
<view class="text-xl">
<text class="cuIcon-deliver text-red padding-sm padding-bottom-0">
</text>
<text class="text-df text-black padding-top-sm">
{{driver.plateNumber?driver.plateNumber:'暂无车牌号'}}
</text>
</view>
<view class="padding-left padding-bottom margin-left">
<view class="bg-white padding-left-xs">
<text class="padding-right-lg text-df">{{driver.userName}} ({{driver.driverId}})</text>{{driver.phone|phoneFilter}}
</view>
</view>
</view>
</template>
<script>
import partnerApi from '@/api/partner.js'
export default {
props: {
driver: {
type: Object,
default () {}
}
},
data() {
return {
mainURL: this.global.mainURL,
loginUser: uni.getStorageSync('loginUser'),
};
},
methods: {
virtualScan(id) {
partnerApi.getQrCode(id).then(res=>{
if(res.code==20000){
uni.setStorageSync('qrCode', res.data)
uni.navigateTo({
url:`/pages/stationDetail/stationDetail`
})
}
})
}
},
filters: {
phoneFilter(value) {
if (value) {
return value.substring(0, 3) + ' ' + ' **** ' + ' ' + value.substring(7, 11)
} else {
return '暂无手机号'
}
}
}
}
</script>
<style scoped>
.cu-tag {
border-radius: 100upx 0 0 100upx;
position: absolute;
right: 0;
top: 30rpx;
}
</style>