11
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<homeNavBar v-model="page.params.oilProductCode" :productCodeList="productCodeList" @seach="seach" ref="homeNavBar" />
|
||||
<homeNavBar @getlist="onRefresh" v-model="page.params.oilProductCode" :productCodeList="productCodeList" @seach="seach" ref="homeNavBar" />
|
||||
<div :style="{}" id="list" class="list">
|
||||
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
||||
<van-list @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多了">
|
||||
<van-list id = 'vanList' ref="vanList" @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多了">
|
||||
<van-cell v-for="(item, index) in list" :key="index">
|
||||
<div @click="goDetails(item)" slot>
|
||||
<listItem ref="listItem" :listItem="item" />
|
||||
<listItem ref="listItem" :index="index" :listItem="item" />
|
||||
</div>
|
||||
</van-cell>
|
||||
</van-list>
|
||||
@@ -16,7 +16,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import useStore from '../store/piniaIndex';
|
||||
import homeNavBar from '@/components/homeNavBar.vue'
|
||||
import listItem from '@/components/listItem.vue'
|
||||
import oilSiteApi from '@/api/oil-site.js'
|
||||
@@ -59,24 +58,19 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
console.log('created')
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
this.init();
|
||||
console.log(this.$refs.vanList,'/////')
|
||||
},
|
||||
watch: {
|
||||
'page.params.oilProductCode':function(n){},
|
||||
loading: function (n) {},
|
||||
position: function (n) {
|
||||
let store = useStore();
|
||||
store.setPosition({latitude:n.coords.latitude,longitude:n.coords.longitude});
|
||||
this.page.params.latitude = n.coords.latitude;
|
||||
this.page.params.longitude = n.coords.longitude;
|
||||
this.getlist();
|
||||
console.log(n, '检测到地理位置授权')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listCheck(){
|
||||
console.log(arguments,'listCheck')
|
||||
},
|
||||
getmenu(){
|
||||
oilSiteApi.getCheckInfo().then(res=>{
|
||||
this.productCodeList = [];
|
||||
@@ -93,10 +87,9 @@ export default {
|
||||
this.onRefresh()
|
||||
},
|
||||
onLoad() {
|
||||
if(this.position){
|
||||
if(this.refreshing) return
|
||||
this.page.currentPage += 1
|
||||
this.getlist()
|
||||
}
|
||||
},
|
||||
goDetails(item) {
|
||||
this.$router.push({
|
||||
@@ -110,26 +103,40 @@ export default {
|
||||
this.page.currentPage = 1;
|
||||
this.getlist();
|
||||
},
|
||||
// onscroll() {
|
||||
// let that = this
|
||||
// let container = document.getElementById('list');
|
||||
// container.onscroll = function (e) {
|
||||
// if (Math.ceil(e.currentTarget.scrollTop + e.currentTarget.clientHeight) >= e.currentTarget.scrollHeight) { //容差:20px
|
||||
// that.page.currentPage += 1
|
||||
// that.getlist()
|
||||
// console.log(that.page.currentPage, '滚动到底部');
|
||||
// }
|
||||
// };
|
||||
// },
|
||||
onscroll() {
|
||||
let that = this
|
||||
let container = document.getElementById('vanList');
|
||||
container.onscroll = function (e) {
|
||||
console.log(e.currentTarget.scrollTop, '滚动到底部');
|
||||
|
||||
if (Math.ceil(e.currentTarget.scrollTop + e.currentTarget.clientHeight) >= e.currentTarget.scrollHeight) { //容差:20px
|
||||
console.log(e.currentTarget.scrollTop, '滚动到底部');
|
||||
}
|
||||
};
|
||||
},
|
||||
init() {
|
||||
this.getPosition();
|
||||
this.getlist();
|
||||
this.homeNavBarStyle = this.$refs.homeNavBar.$el.clientHeight;
|
||||
// this.onscroll();
|
||||
this.getmenu();
|
||||
// this.onscroll()
|
||||
},
|
||||
positionChenk(position){
|
||||
return !position?.latitude&&!position?.longitude?true:false
|
||||
},
|
||||
getlist() {
|
||||
let position = this.$pinia.state.value.user.position
|
||||
console.log(Object.assign(this.page.params,position),position,'地理位置数据')
|
||||
if(this.positionChenk(position)){
|
||||
position = JSON.parse(localStorage.getItem("position"))
|
||||
if(this.positionChenk(position)){
|
||||
console.log(position,this.$pinia.state.value.user.position,'地理位置错误');
|
||||
this.finished = true
|
||||
return
|
||||
}
|
||||
}
|
||||
this.page.params = Object.assign(this.page.params,position)
|
||||
this.loading = true
|
||||
oilSiteApi.getSiteList(this.page).then(res => {
|
||||
oilSiteApi.getSiteList( this.page).then(res => {
|
||||
if (res.code == 20000) {
|
||||
if (res.data.list.length < 10) {
|
||||
this.finished = true
|
||||
@@ -140,7 +147,7 @@ export default {
|
||||
this.list = this.list.concat(res.data.list);
|
||||
}
|
||||
this.loading = false
|
||||
this.refreshing = false;
|
||||
this.refreshing = false;
|
||||
}
|
||||
console.log(res)
|
||||
}).catch(error => {
|
||||
@@ -151,7 +158,7 @@ export default {
|
||||
let that = this
|
||||
navigator.geolocation.getCurrentPosition(function (position) {
|
||||
that.position = position
|
||||
});
|
||||
},this.showError);
|
||||
},
|
||||
onClickLeft() {
|
||||
},
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: () => {
|
||||
|
||||
@@ -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 ;
|
||||
},
|
||||
|
||||
@@ -4,91 +4,119 @@
|
||||
<div class="oilEvaluate-text flex">
|
||||
<span>客户评价</span>
|
||||
<div class="oilEvaluate-lable flex">
|
||||
<div class="oilEvaluate-lable-item">服务周到</div>
|
||||
<div class="oilEvaluate-lable-item">交通便利</div>
|
||||
<div class="oilEvaluate-lable-item">便捷高效</div>
|
||||
|
||||
<div class="oilEvaluate-lable-item">服务周到</div>
|
||||
<div class="oilEvaluate-lable-item">交通便利</div>
|
||||
<div class="oilEvaluate-lable-item">便捷高效</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="oilDetails.oilSiteOrderInfoVos" class="oilEvaluate-order-body flex">
|
||||
<div v-if="oilDetails.oilSiteOrderInfoVos" class="oilEvaluate-order-body flex">
|
||||
<span class="oilEvaluate-order-text">客户订单</span>
|
||||
<div class="oilEvaluate-order">
|
||||
<div v-for="(item, index) in oilDetails.oilSiteOrderInfoVos" :key="index" class="oilEvaluate-order-item flex">
|
||||
<div>
|
||||
<span>{{item.userName|usernameF}} </span>
|
||||
<span> {{item.plateNumber|plateNumberF}}</span>
|
||||
<span>{{ item.userName | usernameF }} </span>
|
||||
<span> {{ item.plateNumber | plateNumberF }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>加 {{item.oilsCode}} {{Number(item.volume).toFixed(2)}}L 节省 <span class="red">¥{{item.discountAmount}}</span> </span>
|
||||
<span>加 {{ item.oilsCode }} {{ Number(item.volume).toFixed(2) }}L 节省 <span class="red">¥{{
|
||||
Number(item.discountAmount).toFixed(2)
|
||||
}}</span> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oilEvaluate-footer">
|
||||
<van-button @click="gopaly('/nextOrderDetails')" class="oilEvaluate-footer-butten" block color="#FF6700" type="primary">一键支付</van-button>
|
||||
<van-button :disabled="!open" @click="gopaly('/nextOrderDetails')" class="oilEvaluate-footer-butten" block
|
||||
color="#FF6700" type="primary">一键支付</van-button>
|
||||
<!-- <van-button class="oilEvaluate-footer-butten" block color="#FF6700" type="primary">二维码支付</van-button> -->
|
||||
</div>
|
||||
<van-dialog @cancel="show=false" @confirm="gopaly('/nextOrderDetails',true)" v-model="show" title="距离提示" show-cancel-button>
|
||||
<div style="margin:20px">
|
||||
距离油站距离大于500M,<br/> 是否确认下单
|
||||
</div>
|
||||
</van-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
|
||||
oilDetails: {
|
||||
props: {
|
||||
|
||||
oilDetails: {
|
||||
type: Object,
|
||||
default: () => null
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
gopaly(path){
|
||||
data() {
|
||||
return {
|
||||
show:false,
|
||||
open: 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
juliFn() {
|
||||
return this.oilDetails.juli > 500?true:false
|
||||
},
|
||||
gopaly(path,open=false) {
|
||||
if(this.juliFn()&&!open){
|
||||
this.show = true;
|
||||
return
|
||||
}
|
||||
this.$router.push({
|
||||
path:path,
|
||||
query:{
|
||||
path: path,
|
||||
query: {
|
||||
oilDetails: JSON.stringify(this.oilDetails)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created(){},
|
||||
filters: {
|
||||
distanceFilter(value) {
|
||||
if (value) {
|
||||
return value > 1000 ? ((value / 1000).toFixed(2) + 'km') : (value + 'm')
|
||||
}
|
||||
},
|
||||
usernameF(value) {
|
||||
if (value) {
|
||||
return value.substr(0, 1) + '**'
|
||||
} else {
|
||||
return '匿名'
|
||||
}
|
||||
},
|
||||
plateNumberF(value) {
|
||||
if (value) {
|
||||
return value.substr(0, 2) + '*****'
|
||||
} else {
|
||||
return '车牌号已隐藏'
|
||||
}
|
||||
}
|
||||
}
|
||||
created() {
|
||||
this.open = (() => {
|
||||
let xoil = this.oilDetails.oilSiteChannelDetailsVos.filter((item) => item.channelCode == 'XOIL')[0]
|
||||
return xoil.activePay;
|
||||
})()
|
||||
console.log(this.open)
|
||||
},
|
||||
filters: {
|
||||
distanceFilter(value) {
|
||||
if (value) {
|
||||
return value > 1000 ? ((value / 1000).toFixed(2) + 'km') : (value + 'm')
|
||||
}
|
||||
},
|
||||
usernameF(value) {
|
||||
if (value) {
|
||||
return value.substr(0, 1) + '**'
|
||||
} else {
|
||||
return '匿名'
|
||||
}
|
||||
},
|
||||
plateNumberF(value) {
|
||||
if (value) {
|
||||
return value.substr(0, 2) + '*****'
|
||||
} else {
|
||||
return '车牌号已隐藏'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.oilEvaluate-container{
|
||||
.oilEvaluate-container {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.oilEvaluate-footer-butten {
|
||||
margin-top: 20px;
|
||||
border-radius: 15px;
|
||||
height:90px ;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.oilEvaluate-footer {
|
||||
}
|
||||
.oilEvaluate-footer {}
|
||||
|
||||
.red {
|
||||
color: red;
|
||||
|
||||
@@ -4,16 +4,19 @@
|
||||
<div class="seleOilGun-title">油枪选择:</div>
|
||||
<div class="seleOilGun-container">
|
||||
<div @click="seleGun(index, item)"
|
||||
:style="{ background: seleIndex == index ? '#FF6700' : '', color: seleIndex == index ? '#FFFFFF' : '', border: seleIndex == index ? '0px' : '' }"
|
||||
:style="{ background: seleIndex == item ? '#FF6700' : '', color: seleIndex == item ? '#FFFFFF' : '', border: seleIndex == item ? '0px' : '' }"
|
||||
v-for="(item, index) in 9" :key="index" class="seleOilGun-item ac jc">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div :style="{background:seleIndex==0 ? '#FF6700' : '',color:seleIndex==0 ? '#FFFFFF' : '',border: seleIndex==0 ?'0px' : ''}" @click="isShow.keyboard=true;seleIndex=0" class="other-seleOilGun-item ac jc">
|
||||
{{seleIndex?'other':otherOilsBar}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oilGun-information">
|
||||
<div @click="isShowFn" class="oilGun-information-item ac">
|
||||
<img src="@/assets/kc.png" alt="" />
|
||||
<span :class=" page.plateNumber ?'cp' : '' " class="oilGun-information-item-text ">
|
||||
<span :class="page.plateNumber ? 'cp' : ''" class="oilGun-information-item-text ">
|
||||
{{ page.plateNumber ? page.plateNumber : '请输入车牌号' }}
|
||||
</span>
|
||||
<van-icon name="arrow" />
|
||||
@@ -46,7 +49,7 @@
|
||||
<div class="flex discount-title">优惠:</div>
|
||||
<div class="flex bw top">
|
||||
<span>星油优惠金额</span>
|
||||
<span>{{ page.oilDiscountAmount ? `-¥${page.oilDiscountAmount}` : '---' }}</span>
|
||||
<span>{{ page.oilDiscountAmount ? `-¥${Number(page.oilDiscountAmount).toFixed(2)}` : '---' }}</span>
|
||||
</div>
|
||||
<div class="flex bw top">
|
||||
<span>优惠券</span>
|
||||
@@ -55,15 +58,16 @@
|
||||
</div>
|
||||
<van-popup round closeable :style="{ height: '35%' }" position="bottom" v-model="isShow.licensePlate">
|
||||
<div class="license-plate-popup">
|
||||
<div class="license-plate-popup-title">选择车牌号</div>
|
||||
<div class="license-plate-popup-title">请输入车牌号</div>
|
||||
<div class="license-plate-popup-input flex ac">
|
||||
<div class="license-plate-popup-input-lable">
|
||||
<span>车牌号</span>
|
||||
<input v-model="page.plateNumber" class="license-plate-popup-input-input" type="text">
|
||||
<input v-model="plateNumber" class="license-plate-popup-input-input" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
<van-number-keyboard @hide="keyboardHide" v-model="otherOilsBar" :show="isShow.keyboard" :maxlength="2" @blur="isShow.keyboard = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -78,7 +82,9 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
otherOilsBar:'',
|
||||
timer: null,
|
||||
plateNumber:'',
|
||||
page: {
|
||||
oilDiscountAmount: '',
|
||||
volume: '',
|
||||
@@ -88,28 +94,51 @@ export default {
|
||||
},
|
||||
aboutLiters: 0,
|
||||
price: '',
|
||||
seleIndex: 0,
|
||||
seleIndex: 1,
|
||||
isShow: {
|
||||
licensePlate: false
|
||||
licensePlate: false,
|
||||
keyboard:false
|
||||
},
|
||||
show: true,
|
||||
selePriceIndex: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
seleIndex:function(n){
|
||||
if(n!==0){
|
||||
this.otherOilsBar = ''
|
||||
}
|
||||
},
|
||||
'seleOil.oilProductCode': {
|
||||
handler(n, o) {
|
||||
console.log(n,o,'------------------')
|
||||
if (n !== o) {
|
||||
this.blur()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
'isShow.licensePlate': {
|
||||
handler(n) {
|
||||
if (!n) {
|
||||
if (this.checkFn('plateNumber', this.plateNumber)) {
|
||||
this.page.plateNumber = this.plateNumber
|
||||
} else {
|
||||
this.$notify('请输入正确车牌号')
|
||||
this.$nextTick(function () {
|
||||
this.plateNumber = ''
|
||||
this.page.plateNumber = ''
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
page: {
|
||||
handler() {
|
||||
this.$nextTick(function () {
|
||||
this.$emit('input', Object.assign(JSON.parse(JSON.stringify(this.seleOil)), this.page));
|
||||
console.log(this.page.oilsBar,'this.page.oilsBar')
|
||||
this.$emit('input', Object.assign(JSON.parse(JSON.stringify(this.seleOil)), {...this.page,oilsBar:this.page.oilsBar?this.page.oilsBar:this.otherOilsBar}));
|
||||
})
|
||||
},
|
||||
deep: true
|
||||
@@ -118,11 +147,54 @@ export default {
|
||||
},
|
||||
created() { },
|
||||
mounted() {
|
||||
this.plateNumber = this.$pinia.state.value.user.user.plateNumber
|
||||
this.page.plateNumber = this.$pinia.state.value.user.user.plateNumber
|
||||
this.$nextTick(function () {
|
||||
this.$emit('input', Object.assign(this.seleOil, this.page))
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
keyboardHide(){
|
||||
setTimeout(()=>{
|
||||
if(this.otherOilsBar){
|
||||
this.page = Object.assign({}, { ...this.page, oilsBar: this.otherOilsBar })
|
||||
}else{
|
||||
this.seleIndex= 1
|
||||
}
|
||||
},0)
|
||||
},
|
||||
chenkFn() {
|
||||
let chenk = /^\d+(.\d{1,2})?$/
|
||||
if (!chenk.test(Number(this.price))) {
|
||||
this.$nextTick(function () {
|
||||
this.price = this.price.slice(0, this.price.length - 1);
|
||||
})
|
||||
} else {
|
||||
if (this.price.indexOf('.') !== -1 && this.price.split('.')[1].length > 2) {
|
||||
this.$nextTick(function () {
|
||||
this.price = Number(this.price).toFixed(2);
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
checkFn(e, n) {
|
||||
switch (e) {
|
||||
case 'name':
|
||||
/(^[\u4e00-\u9fa5]{1}[\u4e00-\u9fa5\.·。]{0,18}[\u4e00-\u9fa5]{1}$)|(^[a-zA-Z]{1}[a-zA-Z\s]{0,18}[a-zA-Z]{1}$)/
|
||||
.test(n);
|
||||
break
|
||||
case 'plateNumber':
|
||||
return /(^[\u4E00-\u9FA5]{1}[A-Z0-9]{6}$)|(^[A-Z]{2}[A-Z0-9]{2}[A-Z0-9\u4E00-\u9FA5]{1}[A-Z0-9]{4}$)|(^[\u4E00-\u9FA5]{1}[A-Z0-9]{5}[挂学警军港澳]{1}$)|(^[A-Z]{2}[0-9]{5}$)|(^(08|38){1}[A-Z0-9]{4}[A-Z0-9挂学警军港澳]{1}$)/
|
||||
.test(n)
|
||||
break
|
||||
case 'phone':
|
||||
return /^1[3456789]\d{9}$/.test(n);
|
||||
break;
|
||||
case 'replacePhone':
|
||||
/^1[3456789]\d{9}$/.test(n);
|
||||
break;
|
||||
}
|
||||
},
|
||||
resetFn() {
|
||||
this.page = Object.assign(
|
||||
{},
|
||||
@@ -143,11 +215,11 @@ export default {
|
||||
}
|
||||
oilSiteApi.getOrderDiscountInfo(page).then(res => {
|
||||
let { payRealAmount, oilDiscountAmount, volume } = res.data;
|
||||
this.page = Object.assign(JSON.parse(JSON.stringify(this.page)),{ payRealAmount, oilDiscountAmount, volume });
|
||||
this.page = Object.assign(JSON.parse(JSON.stringify(this.page)), { payRealAmount, oilDiscountAmount, volume });
|
||||
})
|
||||
},
|
||||
seleGun(index, item) {
|
||||
this.seleIndex = index;
|
||||
this.seleIndex = item;
|
||||
this.page = Object.assign({}, { ...this.page, oilsBar: item })
|
||||
},
|
||||
selePrice(index) {
|
||||
@@ -155,6 +227,7 @@ export default {
|
||||
this.blur()
|
||||
},
|
||||
change() {
|
||||
this.chenkFn()
|
||||
if (this.timer) {
|
||||
clearTimeout(this.timer)
|
||||
}
|
||||
@@ -183,6 +256,7 @@ export default {
|
||||
.license-plate-popup-input-input {
|
||||
border: none !important;
|
||||
background-color: #fcfcfc;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.license-plate-popup-input-lable {
|
||||
@@ -328,6 +402,18 @@ export default {
|
||||
padding: 0 30px;
|
||||
}
|
||||
|
||||
.other-seleOilGun-item {
|
||||
width: 110px;
|
||||
height: 50px;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
opacity: 1;
|
||||
border: 1px solid #cecece;
|
||||
display: flex;
|
||||
font-size: 28px;
|
||||
color: #333333;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.seleOilGun-item {
|
||||
width: 110px;
|
||||
height: 50px;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div v-for="(itemx, index) in oilType.oilSitePriceDetailsVos" :key="index" class="oilLableDetails-item flex ac">
|
||||
<span class="oilLableDetails-item-tip">惠</span>
|
||||
<span class="oilLableDetails-item-oilNumber">{{ itemx.oilProductCode }}</span>
|
||||
<span class="oilLableDetails-item-oilPrice">¥{{ itemx.sitePrice }}/L</span>
|
||||
<span class="oilLableDetails-item-oilPrice">¥{{ moneyIntercept(itemx.sitePrice)}}/L</span>
|
||||
<span class="oilLableDetails-item-originalPrice">¥{{ itemx.oilSitePrice | moneyIntercept }}/L</span>
|
||||
<span class="oilLableDetails-item-text">预计每100L节省{{ (100 * (itemx.oilSitePrice - itemx.sitePrice)) | moneyFormat}}元</span>
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,18 @@ export default {
|
||||
update(e) {
|
||||
this.payRealAmount = e
|
||||
},
|
||||
positionChenk(position) {
|
||||
return !position?.latitude && !position?.longitude ? true : false
|
||||
},
|
||||
gopaly() {
|
||||
let position = this.$pinia.state.value.user.position;
|
||||
if (this.positionChenk(position)) {
|
||||
position = JSON.parse(localStorage.getItem("position"))
|
||||
if (this.positionChenk(position)) {
|
||||
console.log(position, this.$pinia.state.value.user.position, '地理位置错误');
|
||||
return
|
||||
}
|
||||
}
|
||||
let page = {
|
||||
shareCompanyQuota: 0, // 共享标识
|
||||
priceId: this.seleOil.priceId, //类型:String 必有字段 备注:油价主键
|
||||
@@ -140,18 +151,22 @@ export default {
|
||||
// "networkIp": "mock" //类型:String 可有字段 备注:ip地址
|
||||
kaliState: 1,
|
||||
'version': 1,
|
||||
'xoilAmountGun': Number( Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2)) ,
|
||||
latitude: 31.82057,
|
||||
longitude: 117.22901
|
||||
'xoilAmountGun': Number(Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2)),
|
||||
latitude: position.latitude,
|
||||
longitude: position.longitude
|
||||
}
|
||||
if (!page.plateNumber || !page.volume || !page.realPrice) {
|
||||
this.$notify('请检查提交的数据哦')
|
||||
return
|
||||
}
|
||||
oilOrderApi.createOrder(page).then(res => {
|
||||
if(res.code==20000){
|
||||
this.$router.push({
|
||||
name:'cashier',
|
||||
params:{
|
||||
order:res.data
|
||||
}
|
||||
})
|
||||
if (res.code == 20000) {
|
||||
this.$router.push({
|
||||
'path': '/cashier',
|
||||
query: {
|
||||
order: JSON.stringify(res.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(res, '创建订单')
|
||||
})
|
||||
|
||||
@@ -4,17 +4,20 @@
|
||||
请提醒加油员使用 <span style="color:red">“星油云站”</span> 进行订单核实
|
||||
</div>
|
||||
<div class="oilLableDetails">
|
||||
<div @click="seleFn(index)" v-for="(itemx, index) in oilType.oilSitePriceDetailsVos" :key="index" class="oilLableDetails-item flex ac">
|
||||
<div @click="seleFn(index)" v-for="(itemx, index) in oilType.oilSitePriceDetailsVos" :key="index"
|
||||
class="oilLableDetails-item flex ac">
|
||||
<div :class="seleIndex == index ? 'seleLable' : 'label'" class=" flex ac jc">
|
||||
<van-icon size="15" :color="seleIndex == index ? '#FFFFFF' : '#636262'" name="success" />
|
||||
</div>
|
||||
<div style=" overflow: hidden;" class="flex ac">
|
||||
<span class="oilLableDetails-item-tip">惠</span>
|
||||
<span class="oilLableDetails-item-oilNumber">{{ itemx.oilProductCode }}</span>
|
||||
<span class="oilLableDetails-item-oilPrice">¥{{ itemx.sitePrice|moneyIntercept }}/L</span>
|
||||
<span class="oilLableDetails-item-originalPrice">¥{{ itemx.oilSitePrice | moneyIntercept }}/L</span>
|
||||
<span class="oilLableDetails-item-text ">预计每100L节省{{ (100 * (itemx.oilSitePrice - itemx.sitePrice)) | moneyFormat}}元</span>
|
||||
</div>
|
||||
<div style=" overflow: hidden;" class="flex ac">
|
||||
<span class="oilLableDetails-item-tip">惠</span>
|
||||
<span class="oilLableDetails-item-oilNumber">{{ itemx.oilProductCode }}</span>
|
||||
<span class="oilLableDetails-item-oilPrice">¥{{ itemx.sitePrice | moneyIntercept }}/L</span>
|
||||
<span class="oilLableDetails-item-originalPrice">¥{{ itemx.oilSitePrice | moneyIntercept }}/L</span>
|
||||
<span class="oilLableDetails-item-text ">预计每100L节省{{ (100 * (itemx.oilSitePrice - itemx.sitePrice))
|
||||
| moneyFormat
|
||||
}}元</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,13 +26,13 @@
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value:{
|
||||
type:Object,
|
||||
default:null
|
||||
value: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
oilType: {
|
||||
type: Object,
|
||||
default: ()=> null
|
||||
default: () => null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -37,17 +40,17 @@ export default {
|
||||
seleIndex: 0
|
||||
}
|
||||
},
|
||||
created(){
|
||||
created() {
|
||||
this.seleFn(this.seleIndex)
|
||||
},
|
||||
methods:{
|
||||
seleFn(index){
|
||||
methods: {
|
||||
seleFn(index) {
|
||||
console.log(11)
|
||||
this.seleIndex = index;
|
||||
this.$emit('input',Object.assign(Object.assign(JSON.parse(JSON.stringify(this.value)),this.oilType.oilSitePriceDetailsVos[index])))
|
||||
this.$emit('input', Object.assign(Object.assign(JSON.parse(JSON.stringify(this.value)), this.oilType.oilSitePriceDetailsVos[index])))
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
filters: {
|
||||
moneyIntercept(value) {
|
||||
if (value != 'xxx.x') {
|
||||
return String(value).split('.')[1] && String(value).split('.')[1].length > 2 ? Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0, 1)}${Number(String(value).split('.')[1].substring(1, 2)) + 1}`) : Number(value).toFixed(2);
|
||||
|
||||
@@ -37,6 +37,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
update(e) {
|
||||
this.$refs.oilNextFooter.update(e)
|
||||
},
|
||||
|
||||
@@ -38,7 +38,7 @@ export default {
|
||||
},
|
||||
oilTypeFn(){
|
||||
let a = this.oilDetails.oilSiteChannelDetailsVos.filter((item)=> item.channelCode=='XOIL');
|
||||
this.oilType = a.length?a[0]:null;
|
||||
this.oilType = a.length?a[0]:null;
|
||||
},
|
||||
getDetails(){
|
||||
this.oilDetails = JSON.parse(this.$route.query.seleItem)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<Input-box-search @seach="getList" v-model="page.params.search" ref="homeNavBar" />
|
||||
<Input-box-search @seach="onRefresh" v-model="page.params.search" ref="homeNavBar" />
|
||||
<div :style="{}" id="list" class="list">
|
||||
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
||||
<van-list @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多了">
|
||||
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
||||
<van-list @load="onLoad" v-model="loading" :finished="finished" finished-text="没有更多了">
|
||||
<van-cell v-for="(item, index) in list" :key="index">
|
||||
<div style="height: 100%" slot>
|
||||
<paymentlListItem @goPlay="goPlay" :listItem="item" />
|
||||
@@ -58,18 +58,18 @@ export default {
|
||||
switch (type) {
|
||||
case '待支付':
|
||||
this.$router.push({
|
||||
name: 'cashier',
|
||||
params: {
|
||||
order: res.data
|
||||
path: '/cashier',
|
||||
query: {
|
||||
order: JSON.stringify( res.data)
|
||||
}
|
||||
})
|
||||
break;
|
||||
default:
|
||||
this.$router.push({
|
||||
name: 'paymentl',
|
||||
params: {
|
||||
orderData: res.data,
|
||||
type:type=='支付成功'?true:false
|
||||
path: '/paymentl',
|
||||
query: {
|
||||
orderData:JSON.stringify( res.data),
|
||||
type:type=='已支付'?'true':'false'
|
||||
}
|
||||
})
|
||||
break;
|
||||
@@ -82,8 +82,11 @@ export default {
|
||||
orderApi.getOrderInfoByPage(this.page).then((res) => {
|
||||
if (res.data.list.length < 10) {
|
||||
this.finished = true
|
||||
}else{
|
||||
this.finished = false
|
||||
}
|
||||
if (res.code == 20000) {
|
||||
console.log(this.page.currentPage,'+++++++++++++++')
|
||||
if (this.page.currentPage == 1) {
|
||||
this.list = res.data.list;
|
||||
} else {
|
||||
@@ -91,6 +94,7 @@ export default {
|
||||
}
|
||||
this.loading = false
|
||||
this.refreshing = false;
|
||||
|
||||
}
|
||||
}).catch(error => {
|
||||
this.finished = true
|
||||
@@ -100,7 +104,6 @@ export default {
|
||||
this.$router.push("/orderDetails");
|
||||
},
|
||||
onRefresh() {
|
||||
console.log(11)
|
||||
this.loading = false;
|
||||
this.finished = false;
|
||||
this.page.currentPage = 1;
|
||||
@@ -119,6 +122,8 @@ export default {
|
||||
// };
|
||||
// },
|
||||
onLoad() {
|
||||
if(this.refreshing) return
|
||||
console.log('loding----------------')
|
||||
this.page.currentPage += 1
|
||||
this.getList();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user