Compare commits
9 Commits
e883da3fff
...
e2b1dee799
| Author | SHA1 | Date | |
|---|---|---|---|
| e2b1dee799 | |||
|
|
f1be3f30e2 | ||
|
|
27e90b27b8 | ||
|
|
b0a89c5a98 | ||
|
|
b49578295d | ||
|
|
d32d9687f0 | ||
|
|
87cd5e210f | ||
|
|
c2e72737be | ||
|
|
0ad09f5917 |
@@ -6,19 +6,17 @@
|
||||
</cu-custom>
|
||||
<view class="" v-show="accountStatus">
|
||||
<view class="placeholder bg-main-oil">
|
||||
|
||||
</view>
|
||||
<view class="move-top">
|
||||
|
||||
<view class="flex radius margin my-shadow position-re">
|
||||
<view class="basis-sm text-center padding bg-gradual-black">
|
||||
我的油卡
|
||||
</view>
|
||||
<view class="basis-lg padding bg-white">
|
||||
总余额:<text class="text-red">{{userTotal.oilCardTotalPrice|moneyFormat}}元</text><text class="cu-tag yu-tag-right position-ab sm">{{cardList.length>0?cardList.length:1}}张</text>
|
||||
总余额:<text class="text-red">{{userTotal.oilCardTotalPrice|moneyFormat}}元</text><text
|
||||
class="cu-tag yu-tag-right position-ab sm">{{cardList.length>0?cardList.length:1}}张</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="flex radius margin my-shadow position-re">
|
||||
<view class="basis-sm text-center padding bg-gradual-black">
|
||||
自营公司油卡
|
||||
@@ -38,12 +36,10 @@
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class=" margin-bottom-lg">
|
||||
<swiper class="screen-swiper square-dot" @change="cardSwiper" :indicator-dots="true" :circular="true" :autoplay="false"
|
||||
interval="5000" duration="500">
|
||||
<swiper class="screen-swiper square-dot" @change="cardSwiper" :indicator-dots="true" :circular="true"
|
||||
:autoplay="false" interval="5000" duration="500">
|
||||
<swiper-item v-for="(item,index) in cardList" :key="index" :class="cardCur==index?'cur':''">
|
||||
<!-- <image :src="imgURL+ (item.type=='zs'?'card-zs.png':'card-other.png')" mode="aspectFill">
|
||||
</image> -->
|
||||
@@ -58,16 +54,13 @@
|
||||
<view class="text-red padding-bottom-sm text-bold text-lg">
|
||||
共享企业余额
|
||||
</view>
|
||||
|
||||
<text class="text-grey">单日加油额度:{{cardList[cardCur].orderAmountToplimit}}元;单日加油升数额度:{{cardList[cardCur].orderVolumeToplimit}}L</text>
|
||||
<text
|
||||
class="text-grey">单日加油额度:{{cardList[cardCur].orderAmountToplimit}}元;单日加油升数额度:{{cardList[cardCur].orderVolumeToplimit}}L</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="text-center padding">
|
||||
<!-- <view class="text-red text-bold text-lg">
|
||||
{{userTotal.oilCardTotalPrice|moneyFormat}}元
|
||||
</view> -->
|
||||
|
||||
<text class="">交易记录</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -75,7 +68,6 @@
|
||||
<view class="cu-list menu" v-if="cardList[cardCur].historyList.length>0">
|
||||
<view class="cu-item" v-for="detail in cardList[cardCur].historyList" :key="detail.id">
|
||||
<view class="content padding-tb-sm">
|
||||
|
||||
<view class="text-gray text-sm">
|
||||
{{detail.createTime}}
|
||||
</view>
|
||||
@@ -109,7 +101,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hideCard:[],
|
||||
hideCard: [],
|
||||
loadStatus: 'load',
|
||||
userTotal: {},
|
||||
historyList: [],
|
||||
@@ -170,15 +162,15 @@
|
||||
this.TowerSwiper('swiperList');
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getCards()
|
||||
this.getTotalOilCardInfo()
|
||||
this.TowerSwiper('swiperList');
|
||||
// this.getCards()
|
||||
// this.getTotalOilCardInfo()
|
||||
// this.TowerSwiper('swiperList');
|
||||
// 初始化towerSwiper 传已有的数组名即可
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.cardList[this.cardCur].loadStatus == 'more') {
|
||||
setTimeout(() => {
|
||||
this.getMoneyDetail(this.cardList[this.cardCur],this.cardCur)
|
||||
this.getMoneyDetail(this.cardList[this.cardCur], this.cardCur)
|
||||
}, 100)
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -188,14 +180,6 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
getAmount() {
|
||||
accountApi.getTotalOilCardInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.userTotal = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getTotalOilCardInfo() {
|
||||
accountApi.getTotalOilCardInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
@@ -213,13 +197,7 @@
|
||||
oilCardType: card.oilCardType
|
||||
}
|
||||
}
|
||||
console.log('++++++++++++++')
|
||||
console.log(data2)
|
||||
console.log('++++++++++++++')
|
||||
accountApi.getOilCardRecordByPage(data2).then(res => {
|
||||
console.log('++++++++++++++')
|
||||
console.log(res)
|
||||
console.log('++++++++++++++')
|
||||
if (res.code == 20000) {
|
||||
if (res.data.list.length < 20) {
|
||||
this.cardList[index].loadStatus = 'nomore'
|
||||
@@ -228,10 +206,10 @@
|
||||
this.cardList[index].currentPage++
|
||||
}
|
||||
// this.cardList[index].historyList = []
|
||||
|
||||
if(this.cardList[index].currentPage!==1){
|
||||
this.cardList[index].historyList = this.cardList[index].historyList.concat(res.data.list)
|
||||
} else{
|
||||
if (this.cardList[index].currentPage !== 1) {
|
||||
this.cardList[index].historyList = this.cardList[index].historyList.concat(res.data
|
||||
.list)
|
||||
} else {
|
||||
this.cardList[index].historyList = res.data.list
|
||||
}
|
||||
|
||||
@@ -247,14 +225,17 @@
|
||||
await accountApi.getUserAccount().then(res => {
|
||||
if (res.code == 20000) {
|
||||
if (res.data.length > 0) {
|
||||
this.cardList = res.data
|
||||
this.cardList = this.cardList.filter(item=>!this.hideCard.includes(item.companyId))
|
||||
this.cardList.forEach(item => {
|
||||
this.$set(item,'currentPage',1)
|
||||
this.$set(item,'loadStatus','more')
|
||||
this.$set(item,'historyList',[])
|
||||
|
||||
let staging = res.data.filter(item => item.companyType != 5).filter(item => !this.hideCard.includes(item
|
||||
.companyId))
|
||||
staging.forEach(item => {
|
||||
this.$set(item, 'currentPage', 1)
|
||||
this.$set(item, 'loadStatus', 'more')
|
||||
this.$set(item, 'historyList', [])
|
||||
})
|
||||
console.log(this.cardList)
|
||||
let target = this.sortHandler(staging)
|
||||
this.cardList = target
|
||||
|
||||
setTimeout(() => {
|
||||
this.getMoneyDetail(this.cardList[0], 0)
|
||||
}, 100)
|
||||
@@ -262,6 +243,41 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
sortHandler(arr) {
|
||||
let internalArr = arr.filter(item => item.oilCardType == 2)
|
||||
let externalArr = arr.filter(item => item.oilCardType == 3)
|
||||
// let internalTarget = this.sortParticulars(internalArr, 'shareCompanyQuota')
|
||||
let externalTarget = this.sortParticulars(externalArr, 'balance')
|
||||
if (internalArr.length || externalTarget.length) return [...internalArr, ...externalTarget]
|
||||
else return arr
|
||||
},
|
||||
sortParticulars(arr, field) {
|
||||
let target = []
|
||||
let map = new Map()
|
||||
let keys = [],
|
||||
values = []
|
||||
arr.forEach(item => {
|
||||
map.set(item, item[field])
|
||||
})
|
||||
for (let key of map.keys()) {
|
||||
keys.push(key)
|
||||
}
|
||||
for (let value of map.values()) {
|
||||
values.push(value)
|
||||
}
|
||||
values.sort((a,b)=>{return a - b})
|
||||
values.reverse()
|
||||
values.forEach(value => {
|
||||
keys.forEach(key => {
|
||||
if (map.get(key) == value) {
|
||||
target.push(key)
|
||||
map.set(key, new Date().getTime())
|
||||
}
|
||||
})
|
||||
})
|
||||
return target
|
||||
},
|
||||
|
||||
DotStyle(e) {
|
||||
this.dotStyle = e.detail.value
|
||||
},
|
||||
@@ -332,10 +348,11 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.boxsingForCard{
|
||||
.boxsingForCard {
|
||||
position: relative;
|
||||
}
|
||||
.inCard{
|
||||
|
||||
.inCard {
|
||||
position: absolute;
|
||||
right: 11%;
|
||||
bottom: 17%;
|
||||
@@ -348,6 +365,7 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tower-swiper .tower-item {
|
||||
transform: scale(calc(0.5 + var(--index) / 10));
|
||||
margin-left: calc(var(--left) * 100upx - 150upx);
|
||||
|
||||
@@ -13,14 +13,15 @@
|
||||
<view class="qr-container ">
|
||||
<view class="qrimg">
|
||||
<view class="qrimg" @tap="newQrString">
|
||||
<tki-qrcode ref="qrcode" cid="2" loadMake :val="val" :size="250" unit="upx"
|
||||
background="#fff" :foreground="foreground" :pdground="foreground" :icon="iconUrl" iconSize="40" onval
|
||||
<tki-qrcode ref="qrcode" cid="2" loadMake :val="val" :size="250" unit="upx" background="#fff"
|
||||
:foreground="foreground" :pdground="foreground" :icon="iconUrl" iconSize="40" onval
|
||||
:usingComponents="usingComponents" showLoading />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-center text-sm justify-center align-center flex">
|
||||
<image src="../static/img/YDJY.png" mode="" style="width: 60upx;height:60upx;" class="margin-right-sm"></image>
|
||||
<image src="../static/img/YDJY.png" mode="" style="width: 60upx;height:60upx;" class="margin-right-sm">
|
||||
</image>
|
||||
<text>壳牌 {{test}} {{tsets}}</text>
|
||||
</view>
|
||||
<view class="text-center padding-top text-sm margin-bottom">
|
||||
@@ -43,67 +44,67 @@
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-list menu solid-bottom">
|
||||
<!-- <view class="cu-list menu solid-bottom">
|
||||
<view class="cu-item arrow" @tap="toDetail(order)">
|
||||
油站:
|
||||
<text class="fr">{{order.siteName?order.siteName:''}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view> -->
|
||||
<view class="padding-tb-xs text-left">
|
||||
油品油枪:
|
||||
<!-- <view class="cu-item arrow" @tap="toDetail(order)">
|
||||
|
||||
</view> -->
|
||||
油站
|
||||
<text class="fr nowrap">{{order.siteName?order.siteName:''}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油品油枪
|
||||
<text class="fr nowrap">
|
||||
{{order.oilsCode?order.oilsCode+' ':'' }} {{ order.gunName?order.gunName+'号枪': order.oilsBar?order.oilsBar+'号枪':'未选择油枪'}} </text>
|
||||
{{order.oilsCode?order.oilsCode+' ':'' }}{{ order.gunName?order.gunName+'号枪': order.oilsBar?order.oilsBar+'号枪':'未选择油枪'}} </text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
{{order.oilProductType=='GAS'?'加气重量:':'加油升数:'}}
|
||||
<text class="fr">{{order.volume?order.volume:'未输入' |moneyFormath}} {{order.oilProductType=='GAS'?'L':'L'}}</text>
|
||||
<text
|
||||
class="fr nowrap">{{order.volume?'约':''}}{{order.volume?order.volume:'未输入' |moneyFormath}}{{order.oilProductType=='GAS'?'L':'L'}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油站价格:
|
||||
<text class="fr">{{order.sitePrice?order.sitePrice+'¥/' +( order.oilProductType=='GAS'?'L':'L') :'暂无'}}</text>
|
||||
油站价格
|
||||
<text
|
||||
class="fr">{{order.sitePrice?order.sitePrice+'¥/' +( order.oilProductType=='GAS'?'L':'L') :'暂无'}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
优惠价格:
|
||||
<text class="fr">{{moneyIntercept(order.realPrice) }}¥/ {{order.oilProductType=='GAS'?'L':'L'}}</text>
|
||||
优惠价格
|
||||
<text class="fr">约{{moneyIntercept(order.realPrice) }}¥/{{order.oilProductType=='GAS'?'L':'L'}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油员:
|
||||
加油员
|
||||
<text class="fr">{{order.siteUser}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油渠道:
|
||||
加油渠道
|
||||
<text class="fr">{{order.channelCode|channelCodeFamt}}</text>
|
||||
</view>
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油机金额: <text class="fr">{{order.sitePriceAmount |moneyFormat}}</text>
|
||||
<!-- <text
|
||||
class="fr">{{order.xoilDiscountAmount>0?order.realAmount+order.xoilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
星油优惠:
|
||||
星油优惠
|
||||
<!-- order.xoilDiscountAmount>0?order.xoilDiscountAmount:'xxx.x'|moneyFormat -->
|
||||
<text
|
||||
class="text-red fr">{{ moneyIntercept(order.xoilDiscountAmount)}}</text>
|
||||
<text class="text-red fr">{{ moneyIntercept(order.xoilDiscountAmount)}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
优惠券:
|
||||
优惠券
|
||||
<text class="text-red fr">{{order.couponMark==1?order.couponDiscountAmount:'未使用优惠券'}}</text>
|
||||
</view>
|
||||
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
合计
|
||||
<text
|
||||
class="text-red text-bold text-lg fr">{{order.payRealAmount>0?order.payRealAmount:'xxx.x'|moneyFormat}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
支付方式:
|
||||
支付方式
|
||||
<text class=" fr">{{order.payAccountType==0?'星油豆':'企业账户支付'}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left" v-if="order.payTime">
|
||||
订单支付时间:
|
||||
订单支付时间
|
||||
<text class=" fr">{{order.payTime}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
@@ -113,26 +114,24 @@
|
||||
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油车牌:
|
||||
加油车牌
|
||||
<text class=" fr">{{order.plateNumber}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油司机:
|
||||
加油司机
|
||||
<text class=" fr">{{order.customerName}} {{order.customerCode}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left" v-if="order.oilCardNature">
|
||||
油卡性质:
|
||||
油卡性质
|
||||
<text class=" fr">{{order.oilCardNature|oilCardNatureF}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding bg-white fixed-bottom">
|
||||
<view class="flex margin-bottom" v-if="order.orderStatus==0">
|
||||
<button class="cu-btn block flex-sub lg bg-main-oil "
|
||||
@tap="makePay">立即支付</button>
|
||||
<button class="cu-btn block flex-sub lg margin-left"
|
||||
@tap="cancelOrder">取消订单</button>
|
||||
<button class="cu-btn block flex-sub lg bg-main-oil " @tap="makePay">立即支付</button>
|
||||
<button class="cu-btn block flex-sub lg margin-left" @tap="cancelOrder">取消订单</button>
|
||||
</view>
|
||||
<view class="cu-btn bg-white oil-main-color block flex-sub lg" @click="makeCall">
|
||||
<text class="cuIcon-service padding-right-sm">联系客服</text>
|
||||
@@ -142,10 +141,8 @@
|
||||
</view>
|
||||
<view class="padding placeholder-hidden">
|
||||
<view class="flex margin-bottom" v-if="order.orderStatus==0">
|
||||
<button class="cu-btn block flex-sub lg bg-main-oil "
|
||||
@tap="makePay">立即支付</button>
|
||||
<button class="cu-btn block flex-sub lg margin-left"
|
||||
@tap="cancelOrder">取消订单</button>
|
||||
<button class="cu-btn block flex-sub lg bg-main-oil " @tap="makePay">立即支付</button>
|
||||
<button class="cu-btn block flex-sub lg margin-left" @tap="cancelOrder">取消订单</button>
|
||||
</view>
|
||||
<view class="cu-btn bg-white oil-main-color block flex-sub lg" @click="makeCall">
|
||||
<text class="cuIcon-service padding-right-sm">联系客服</text>
|
||||
@@ -164,12 +161,12 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
foreground:'#000',
|
||||
showQr:false,
|
||||
val:'',
|
||||
foreground: '#000',
|
||||
showQr: false,
|
||||
val: '',
|
||||
id: '',
|
||||
test:null,
|
||||
tsets:'',
|
||||
test: null,
|
||||
tsets: '',
|
||||
order: {}
|
||||
}
|
||||
},
|
||||
@@ -193,7 +190,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
components:{
|
||||
components: {
|
||||
tkiQrcode
|
||||
},
|
||||
methods: {
|
||||
@@ -206,18 +203,18 @@
|
||||
newQrString() {
|
||||
this.getOrderQrCode()
|
||||
},
|
||||
getOrderQrCode(){
|
||||
oilSiteApi.getOrderQrCode(this.order.orderSerialNumber).then( (res)=>{
|
||||
getOrderQrCode() {
|
||||
oilSiteApi.getOrderQrCode(this.order.orderSerialNumber).then((res) => {
|
||||
console.log(res)
|
||||
this.val = res.data
|
||||
if(res.code == 40000){
|
||||
if (res.code == 40000) {
|
||||
this.showQr = false
|
||||
}else if(res.code == 20000){
|
||||
} else if (res.code == 20000) {
|
||||
this.showQr = true
|
||||
this.val =res.data.codeStr;
|
||||
this.foreground = this.val.indexOf('SHLFC/V1')==-1?'#000':'#1A487E';
|
||||
this.val = res.data.codeStr;
|
||||
this.foreground = this.val.indexOf('SHLFC/V1') == -1 ? '#000' : '#1A487E';
|
||||
}
|
||||
} )
|
||||
})
|
||||
},
|
||||
onCopy(id) {
|
||||
uni.setClipboardData({
|
||||
@@ -301,7 +298,7 @@
|
||||
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log('++++++++++++++++++',option)
|
||||
console.log('++++++++++++++++++', option)
|
||||
this.test = option.id
|
||||
this.id = option.id
|
||||
this.tsets = option.name
|
||||
@@ -314,10 +311,10 @@
|
||||
}, 1000 * 60 * 3);
|
||||
},
|
||||
filters: {
|
||||
moneyIntercept(value){
|
||||
if (value){
|
||||
moneyIntercept(value) {
|
||||
if (value) {
|
||||
console.log(value)
|
||||
let valus = (parseInt(value * 100) / 100).toFixed(2)+'¥/'
|
||||
let valus = (parseInt(value * 100) / 100).toFixed(2) + '¥/'
|
||||
console.log(valus)
|
||||
return valus
|
||||
} else {
|
||||
@@ -335,7 +332,7 @@
|
||||
},
|
||||
moneyFormat(value) {
|
||||
if (value != 'xxx.x') {
|
||||
return "¥" +(Math.round(value * 100) / 100).toFixed(2)
|
||||
return "¥" + (Math.round(value * 100) / 100).toFixed(2)
|
||||
} else {
|
||||
return value
|
||||
}
|
||||
@@ -398,19 +395,23 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>.move-tops{
|
||||
<style scoped>
|
||||
.move-tops {
|
||||
transform: translateY(-17px);
|
||||
}
|
||||
.bg-red{
|
||||
}
|
||||
|
||||
.bg-red {
|
||||
background-color: #FF6700;
|
||||
}
|
||||
.text-centers {
|
||||
}
|
||||
|
||||
.text-centers {
|
||||
text-align: center;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
border-radius: 7px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.move-top {
|
||||
margin-top: -2rem;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
<view class="" v-if="activeChannelCode!='TY'">
|
||||
<view class="padding-tb-xs margin-bottom text-left">
|
||||
加油升数:
|
||||
<text class="fr">{{vlom?vlom :'' | moneyVolm}} L </text>
|
||||
<text class="fr">{{vlom?'约' :''}}{{vlom?vlom :'' | moneyVolm}} L </text>
|
||||
</view>
|
||||
<view class=" dashed-top margin-top padding-top text-left">
|
||||
加油金额:
|
||||
|
||||
@@ -61,7 +61,8 @@
|
||||
<view class="content padding-tb-sm">
|
||||
<view class="text-left">
|
||||
<view class="site-icon-sm">
|
||||
<image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/gr.png" mode="widthFix" width="100upx"></image>
|
||||
<image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/gr.png"
|
||||
mode="widthFix" width="100upx"></image>
|
||||
</view>
|
||||
<text class="padding-left-sm">自营企业油卡支付 <text
|
||||
v-if="item.shareCompanyQuota==0">(余额:{{item.balance|moneyFormat}})</text></text>
|
||||
@@ -113,11 +114,16 @@
|
||||
<view class="content padding-tb-sm">
|
||||
<view class="text-left">
|
||||
<view class="site-icon-sm">
|
||||
<image :src="imgURL+'pay-qy.png'" mode="widthFix" width="100upx" v-if='itemx.companyNature =="0"'></image>
|
||||
<image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/gr.png" mode="widthFix" width="100upx" v-if='itemx.companyNature =="1"'></image>
|
||||
<image :src="imgURL+'pay-qy.png'" mode="widthFix" width="100upx"
|
||||
v-if='itemx.companyNature =="0"'></image>
|
||||
<image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/gr.png"
|
||||
mode="widthFix" width="100upx" v-if='itemx.companyNature =="1"'></image>
|
||||
</view>
|
||||
<text class="padding-left-sm" v-if='itemx.companyNature =="0"'>外请油卡支付(余额:{{itemx.balance|moneyFormat}})</text>
|
||||
<text class="padding-left-sm" v-if='itemx.companyNature =="1"'>企业油卡支付 {{itemx.companyNature =="1" ? itemx.shareCompanyQuota==0? '(余额:'+itemx.balance+')' :'':''}} </text>
|
||||
<text class="padding-left-sm"
|
||||
v-if='itemx.companyNature =="0"'>外请油卡支付(余额:{{itemx.balance|moneyFormat}})</text>
|
||||
<text class="padding-left-sm" v-if='itemx.companyNature =="1"'>企业油卡支付
|
||||
{{itemx.companyNature =="1" ? itemx.shareCompanyQuota==0? '(余额:'+itemx.balance+')' :'':''}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="text-sm padding-left-xl margin-left-xs">
|
||||
{{itemx.name}} {{itemx.shareCompanyQuota==1?'共享额度':'非共享'}}
|
||||
@@ -143,47 +149,46 @@
|
||||
<view class="padding" v-if='type == "oil"'>
|
||||
<view class="padding-bottom-xs margin-bottom-xs dashed-bottom">
|
||||
<view class="padding-tb-xs text-left" @tap="onCopy(order.orderSerialNumber)">
|
||||
订单编号:
|
||||
订单编号
|
||||
<text class="fr">{{order.orderSerialNumber?order.orderSerialNumber:''}} <text
|
||||
class="cuIcon-copy padding-left-xs"></text></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油站:
|
||||
油站
|
||||
<view class="fr">{{order.siteName?order.siteName:''}}
|
||||
<!-- <text v-if="order.siteLevel" class="cu-tag text-xs tag-red" style="margin-left: 20px;">{{order.siteLevel}}级</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油品油枪:
|
||||
油品油枪
|
||||
<text
|
||||
class="fr nowrap">{{order.oilsCode?order.oilsCode+' ':''}}&{{ order.gunName?order.gunName+'号枪': order.oilsBar?order.oilsBar+'号枪':'未选择油枪'}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油升数:
|
||||
<text class="fr">{{order.volume?order.volume :'xxx.x' | moneyFormath}} L</text>
|
||||
加油升数
|
||||
<text class="fr">约{{order.volume?order.volume :'xxx.x' | moneyFormath}} L</text>
|
||||
</view>
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油金额:
|
||||
加油金额
|
||||
<!-- <text
|
||||
class="fr">{{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
||||
<text class="fr">{{ moneyIntercept(order.xoilAmountGun )}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
星油优惠:
|
||||
星油优惠
|
||||
<!-- order.oilDiscountAmount>0?order.oilDiscountAmount:'xxx.x'|moneyFormat -->
|
||||
<text
|
||||
class="text-red fr">{{ moneyIntercept(order.oilDiscountAmount)}}</text>
|
||||
<text class="text-red fr">{{ moneyIntercept(order.oilDiscountAmount)}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
优惠券:
|
||||
优惠券
|
||||
<text
|
||||
class="text-red fr">{{order.couponDiscountAmount>0?order.couponDiscountAmount:'xxx.x'|moneyFormat}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
合计
|
||||
<text
|
||||
class="text-red text-bold text-lg fr">{{order.realAmount>0? '¥'+ order.realAmount:'xxx.x'|}}</text>
|
||||
</view>
|
||||
@@ -191,55 +196,57 @@
|
||||
<view class="padding" v-if='type == "urea"'>
|
||||
<view class="padding-bottom-xs margin-bottom-xs dashed-bottom">
|
||||
<view class="padding-tb-xs text-left" @tap="onCopy(order.orderId)">
|
||||
订单编号:
|
||||
订单编号
|
||||
<text class="fr">{{order.orderId?order.orderId:''}} <text
|
||||
class="cuIcon-copy padding-left-xs"></text></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油站:
|
||||
油站
|
||||
<view class="fr">{{order.siteName?order.siteName:''}}
|
||||
<!-- <text v-if="order.siteLevel" class="cu-tag text-xs tag-red" style="margin-left: 20px;">{{order.siteLevel}}级</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加注类型:
|
||||
<text
|
||||
class="fr nowrap">{{order.formats | ureaFormats }}</text>
|
||||
加注类型
|
||||
<text class="fr nowrap">{{order.formats | ureaFormats }}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs formats_box" v-if='order.formats == "2"'>
|
||||
<view class="formats_box_list" v-for="(list,i) in order.xoilUreaOrderRelations " :key='i'>
|
||||
<view class="formats_box_list_left w30">
|
||||
{{list.brandName}}
|
||||
</view>
|
||||
<view class="formats_box_list_main w30">{{list.options}}/桶<text style="color: red;">X{{list.goodsQuantity}}</text> </view>
|
||||
<view class="formats_box_list_main w30">{{list.options}}/桶<text
|
||||
style="color: red;">X{{list.goodsQuantity}}</text> </view>
|
||||
<view class="formats_box_list_right w30">¥{{list.totalPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left" v-if='order.formats != "2"'>
|
||||
加注量:
|
||||
加注量
|
||||
<text class="fr">{{order.oldRealLiter?order.oldRealLiter :'xxx.x' }}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
<text class="text-red text-bold text-lg fr">{{order.oldRealAmount>0? '¥'+ order.oldRealAmount:'xxx.x'|}}</text>
|
||||
合计
|
||||
<text
|
||||
class="text-red text-bold text-lg fr">{{order.oldRealAmount>0? '¥'+ order.oldRealAmount:'xxx.x'|}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding placeholder-hidden">
|
||||
<button class="cu-btn block lg bg-main-oil" :disabled = 'isdisabled' @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn block lg bg-main-oil" :disabled='isdisabled' @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||
</view>
|
||||
<view class="padding fixed-bar-bottom">
|
||||
<button class="cu-btn block lg bg-main-oil" :disabled = 'isdisabled' @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn block lg bg-main-oil" :disabled='isdisabled' @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||
</view>
|
||||
<view class="padding fixed-bar-bottom" v-if='type == "urea"'>
|
||||
<button class="cu-btn block lg bg-main-oil" :disabled = 'isdisabled' @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn block lg bg-main-oil" :disabled='isdisabled' @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="ureaCancelOrder(order.orderId)">取消订单</button>
|
||||
</view>
|
||||
</view>
|
||||
<AbnormalPopup :types='PopupType' :checkType='checkType' @hidenPopup='hidenPopup' :PopupShows='PopupShow' @getureaFinanceApi='getureaFinanceApi'></AbnormalPopup>
|
||||
<AbnormalPopup :types='PopupType' :checkType='checkType' @hidenPopup='hidenPopup' :PopupShows='PopupShow'
|
||||
@getureaFinanceApi='getureaFinanceApi'></AbnormalPopup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -256,17 +263,17 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkType:false,
|
||||
PopupType:null,
|
||||
PopupShow:false,
|
||||
ureaInfo:{
|
||||
accountCardCode:'',
|
||||
companyId:''
|
||||
checkType: false,
|
||||
PopupType: null,
|
||||
PopupShow: false,
|
||||
ureaInfo: {
|
||||
accountCardCode: '',
|
||||
companyId: ''
|
||||
},
|
||||
isdisabled:false,
|
||||
showtitles:"",
|
||||
isdisabled: false,
|
||||
showtitles: "",
|
||||
imgURL: this.global.imgURL,
|
||||
order:{},
|
||||
order: {},
|
||||
activePay: 0,
|
||||
isCompany: uni.getStorageSync('accountStatus'),
|
||||
accountCardCode: '',
|
||||
@@ -274,43 +281,49 @@
|
||||
datatime: "",
|
||||
checked: '',
|
||||
cooling: false,
|
||||
payMethod:0,
|
||||
user:uni.getStorageSync('user'),
|
||||
type:'',
|
||||
ureaCompanyOtherList:[],
|
||||
companyNature:'',
|
||||
shareCompanyQuota:''
|
||||
payMethod: 0,
|
||||
user: uni.getStorageSync('user'),
|
||||
type: '',
|
||||
ureaCompanyOtherList: [],
|
||||
companyNature: '',
|
||||
shareCompanyQuota: ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option.type == 'urea'){
|
||||
if (option.type == 'urea') {
|
||||
this.order = uni.getStorageSync('ureaOrderMade')
|
||||
this.order.companyStatus = true
|
||||
this.type = 'urea'
|
||||
this.findUreaAccount()
|
||||
}else{
|
||||
} else {
|
||||
let oilItem = uni.getStorageSync('oilItem')
|
||||
// console.log
|
||||
this.order = uni.getStorageSync('orderMade')
|
||||
this.type = 'oil'
|
||||
this.showtitles = oilItem.listTag
|
||||
if(option.payMethod == null){
|
||||
this.payMethod =oilItem.payMethod
|
||||
if (option.payMethod == null) {
|
||||
this.payMethod = oilItem.payMethod
|
||||
// console.log(this.payMethod )
|
||||
}else {
|
||||
this.payMethod =option.payMethod
|
||||
} else {
|
||||
this.payMethod = option.payMethod
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
companyList() {
|
||||
if (this.isCompany) {
|
||||
return this.order.companyAccounts
|
||||
let companyAccounts = this.order.companyAccounts || []
|
||||
let filterData = companyAccounts.filter(item => item.companyType != 5)
|
||||
return filterData
|
||||
}
|
||||
},
|
||||
companyOtherList() {
|
||||
if (this.isCompany) {
|
||||
return this.order.otherAccounts
|
||||
// return this.order.otherAccounts
|
||||
let otherAccounts = this.order.otherAccounts || []
|
||||
let filterData = otherAccounts.filter(item => item.companyType != 5)
|
||||
let target = this.sortParticulars(filterData,'balance')
|
||||
return target
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -329,18 +342,44 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getureaFinanceApi(){
|
||||
ureaFinanceApi.queryWhetherToHangUp(this.order.orderId).then(res=>{
|
||||
if(res.data == '2'){
|
||||
sortParticulars(arr, field) {
|
||||
let map = new Map()
|
||||
let keys = [],
|
||||
values = [],
|
||||
target = []
|
||||
arr.forEach(item => {
|
||||
map.set(item, item[field])
|
||||
})
|
||||
for (let key of map.keys()) {
|
||||
keys.push(key)
|
||||
}
|
||||
for (let value of map.values()) {
|
||||
values.push(value)
|
||||
}
|
||||
values.sort((a,b)=>{return a - b})
|
||||
values.reverse()
|
||||
values.forEach(value => {
|
||||
keys.forEach(key => {
|
||||
if (map.get(key) == value) {
|
||||
target.push(key)
|
||||
map.set(key, new Date().getTime())
|
||||
}
|
||||
})
|
||||
})
|
||||
return target
|
||||
},
|
||||
getureaFinanceApi() {
|
||||
ureaFinanceApi.queryWhetherToHangUp(this.order.orderId).then(res => {
|
||||
if (res.data == '2') {
|
||||
this.checkType = true
|
||||
}
|
||||
})
|
||||
},
|
||||
hidenPopup(e){
|
||||
hidenPopup(e) {
|
||||
console.log(e)
|
||||
this.PopupShow =e
|
||||
this.PopupShow = e
|
||||
},
|
||||
findUreaAccount(){
|
||||
findUreaAccount() {
|
||||
ureaFinanceApi.findUreaAccount(this.order.driverId).then(res => {
|
||||
console.log(res)
|
||||
this.ureaCompanyOtherList = res.data
|
||||
@@ -393,14 +432,14 @@
|
||||
this.card = card
|
||||
this.checked = 'person'
|
||||
},
|
||||
ureaSelectCompanyCard(card){
|
||||
ureaSelectCompanyCard(card) {
|
||||
this.ureaInfo.accountCardCode = card.accountCardCode
|
||||
this.ureaInfo.companyId = card.companyId
|
||||
this.card = card
|
||||
this.checked = card.accountCardCode
|
||||
this.accountCardCode = card.accountCardCode
|
||||
this.companyNature = card.companyNature
|
||||
this.shareCompanyQuota =card.shareCompanyQuota
|
||||
this.shareCompanyQuota = card.shareCompanyQuota
|
||||
},
|
||||
selectCompanyCard(card) {
|
||||
console.log(card)
|
||||
@@ -444,7 +483,7 @@
|
||||
provider: 'wxpay',
|
||||
...res.data.baseWxOrderVo,
|
||||
success: (res) => {
|
||||
this.isdisabled=false
|
||||
this.isdisabled = false
|
||||
// this.getPayStatus(this.outTradeNo)
|
||||
// this.getLastMoney()
|
||||
// this.getCards()
|
||||
@@ -453,7 +492,8 @@
|
||||
title: res.msg
|
||||
})
|
||||
uni.redirectTo({
|
||||
url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod='+this.payMethod,
|
||||
url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod=' +
|
||||
this.payMethod,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
}
|
||||
@@ -490,14 +530,14 @@
|
||||
this.isdisabled = false
|
||||
return false
|
||||
}
|
||||
if (this.card.balance < this.order.realAmount&& this.card.shareCompanyQuota!=1) {
|
||||
if (this.card.balance < this.order.realAmount && this.card.shareCompanyQuota != 1) {
|
||||
console.log(this.type)
|
||||
if(this.type =='urea'){
|
||||
if (this.type == 'urea') {
|
||||
this.PopupShow = true
|
||||
this.PopupType = 2
|
||||
this.isdisabled = false
|
||||
return
|
||||
}else if(this.type =='oil'){
|
||||
} else if (this.type == 'oil') {
|
||||
uni.showToast({
|
||||
title: '该油卡余额不足',
|
||||
icon: 'none'
|
||||
@@ -508,7 +548,7 @@
|
||||
|
||||
}
|
||||
let payData
|
||||
if(this.type == 'oil'){
|
||||
if (this.type == 'oil') {
|
||||
payData = {
|
||||
...this.card,
|
||||
"orderSerialNumber": this.order.orderSerialNumber, //类型:String 必有字段 备注:订单编号
|
||||
@@ -525,7 +565,8 @@
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod='+this.payMethod,
|
||||
url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod=' +
|
||||
this.payMethod,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
}
|
||||
@@ -541,32 +582,33 @@
|
||||
setTimeout(() => {
|
||||
let msg = res.msg
|
||||
uni.redirectTo({
|
||||
url: `/BagStation/pages/makeOrder/payResult?status=fail&&errMsg=${msg}payMethod=`+this.payMethod
|
||||
url: `/BagStation/pages/makeOrder/payResult?status=fail&&errMsg=${msg}payMethod=` +
|
||||
this.payMethod
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
})
|
||||
}else if (this.type ='urea'){
|
||||
payData={
|
||||
belongCompanyId:this.ureaInfo.companyId,
|
||||
driverId:this.user.id,
|
||||
accountCardCode:this.ureaInfo.accountCardCode,
|
||||
driverPhone:this.user.userPhone,
|
||||
oldRealAmount:this.order.oldRealAmount,
|
||||
vehicleNo:this.order.vehicleNo,
|
||||
orderId:this.order.orderId,
|
||||
driverName:this.order.driverName,
|
||||
userSource:'urea',
|
||||
formats:this.order.formats,
|
||||
oilCardNature:this.companyNature,
|
||||
companyShared:this.shareCompanyQuota
|
||||
} else if (this.type = 'urea') {
|
||||
payData = {
|
||||
belongCompanyId: this.ureaInfo.companyId,
|
||||
driverId: this.user.id,
|
||||
accountCardCode: this.ureaInfo.accountCardCode,
|
||||
driverPhone: this.user.userPhone,
|
||||
oldRealAmount: this.order.oldRealAmount,
|
||||
vehicleNo: this.order.vehicleNo,
|
||||
orderId: this.order.orderId,
|
||||
driverName: this.order.driverName,
|
||||
userSource: 'urea',
|
||||
formats: this.order.formats,
|
||||
oilCardNature: this.companyNature,
|
||||
companyShared: this.shareCompanyQuota
|
||||
}
|
||||
ureaFinanceApi.orderPay(payData).then(res => {
|
||||
console.log(res)
|
||||
if(res.code == 20000){
|
||||
uni.setStorageSync('ureaOrderMade',res.data)
|
||||
if(res.data.formats == '2'){
|
||||
if (res.code == 20000) {
|
||||
uni.setStorageSync('ureaOrderMade', res.data)
|
||||
if (res.data.formats == '2') {
|
||||
uni.redirectTo({
|
||||
url: '/BagStation/orderDetail/orderDetailUrea?type=orderPay',
|
||||
fail: (err) => {}
|
||||
@@ -576,7 +618,7 @@
|
||||
_that.PopupShow = true
|
||||
_that.PopupType = 5
|
||||
this.isdisabled = false
|
||||
} else if(res.code == 40000 && res.msg == '余额不足'){
|
||||
} else if (res.code == 40000 && res.msg == '余额不足') {
|
||||
_that.PopupShow = true
|
||||
_that.PopupType = 2
|
||||
this.isdisabled = false
|
||||
@@ -598,10 +640,10 @@
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
ureaFormats(value){
|
||||
if(value == 1){
|
||||
ureaFormats(value) {
|
||||
if (value == 1) {
|
||||
return '加注站'
|
||||
}else{
|
||||
} else {
|
||||
return '桶装'
|
||||
}
|
||||
},
|
||||
@@ -627,14 +669,15 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.w30{
|
||||
.w30 {
|
||||
width: 30%;
|
||||
flex: 0 0 auto;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.formats_box{
|
||||
|
||||
.formats_box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -642,7 +685,8 @@
|
||||
box-sizing: border-box;
|
||||
flex-direction: column;
|
||||
}
|
||||
.formats_box_list{
|
||||
|
||||
.formats_box_list {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
@@ -652,6 +696,7 @@
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.site-icon-sm {
|
||||
width: 40upx;
|
||||
vertical-align: middle;
|
||||
|
||||
@@ -52,28 +52,28 @@
|
||||
<view class="padding" style="padding-bottom: 200px;">
|
||||
<view class="padding-bottom-xs margin-bottom-xs dashed-bottom">
|
||||
<view class="padding-tb-xs text-left" @tap="onCopy(order.orderSerialNumber)">
|
||||
订单编号:
|
||||
订单编号
|
||||
<text class="fr">{{order.orderSerialNumber?order.orderSerialNumber:''}} <text
|
||||
class="cuIcon-copy padding-left-xs"></text></text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油站:
|
||||
油站
|
||||
<text class="fr">{{order.siteName?order.siteName:''}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油品油枪:
|
||||
油品油枪
|
||||
<text class="fr nowrap">
|
||||
{{order.oilsCode?order.oilsCode+' ':''}}&{{ order.gunName?order.gunName+'号枪': order.oilsBar?order.oilsBar+'号枪':'未选择油枪'}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油升数:
|
||||
<text class="fr">{{order.volume?order.volume :'未输入' | moneyFormath}} L</text>
|
||||
加油升数
|
||||
<text class="fr">{{order.volume?'约':''}}{{order.volume?order.volume :'未输入' | moneyFormath}} L</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油员:
|
||||
加油员
|
||||
<text class="fr">{{order.siteUserName}}</text>
|
||||
</view>
|
||||
<!-- <view class="padding-tb-xs flex text-left">
|
||||
@@ -87,40 +87,40 @@
|
||||
</view> -->
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油金额:
|
||||
加油金额
|
||||
<!-- {{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}} -->
|
||||
<!-- <text class="fr">{{order.realPriceAmount |moneyFormat}}</text> -->
|
||||
<text class="fr">{{order.xoilAmountGun |moneyFormat}}</text>
|
||||
<text class="fr">约{{order.xoilAmountGun |moneyFormat}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
星油优惠:
|
||||
星油优惠
|
||||
<text
|
||||
class="text-red fr">{{order.oilDiscountAmount>0?order.oilDiscountAmount:'xxx.x'|moneyFormat}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
优惠券:
|
||||
优惠券
|
||||
<text
|
||||
class="text-red fr">{{order.couponDiscountAmount>0?order.couponDiscountAmount:'xxx.x'|moneyFormat}}</text>
|
||||
</view>
|
||||
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
合计
|
||||
<text
|
||||
class="text-red text-bold text-lg fr">{{order.realAmount>0?'¥'+order.realAmount:'xxx.x'}}</text>
|
||||
</view>
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油车牌:
|
||||
加油车牌
|
||||
<text class=" fr">{{order.plateNumber}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油司机:
|
||||
加油司机
|
||||
<text class=" fr">{{user.customerCode}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油卡性质:
|
||||
油卡性质
|
||||
<!-- <text class=" fr">{{order.couponDiscountAmount>0?order.couponDiscountAmount:'xxx.x'|moneyFormat}}</text> -->
|
||||
<text class="fr">企业</text>
|
||||
</view>
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
</view>
|
||||
|
||||
<view class="text-right flex-sub oil-main-color">
|
||||
<text v-if="activeCard.shareCompanyQuota==1">
|
||||
<text v-if="activeCard && activeCard.shareCompanyQuota==1">
|
||||
共享余额
|
||||
</text>
|
||||
<text v-else>
|
||||
@@ -187,7 +187,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showtitles:"",
|
||||
showtitles: "",
|
||||
isCompany: uni.getStorageSync('accountStatus'),
|
||||
activeCardIndex: 0,
|
||||
showThreeSites: false,
|
||||
@@ -205,7 +205,7 @@
|
||||
posName: '',
|
||||
secondChannelCode: '',
|
||||
timeinterval: '',
|
||||
otherUser:'',
|
||||
otherUser: '',
|
||||
customerId: uni.getStorageSync('user').userCode
|
||||
}
|
||||
},
|
||||
@@ -235,11 +235,10 @@
|
||||
},
|
||||
cards() {
|
||||
if (this.cardList.length) {
|
||||
let cards = []
|
||||
// console.log(this.cardList,'---------------------')
|
||||
this.cardList.forEach((e) => {
|
||||
// cards.push(e.accountCardCode)
|
||||
e.companyName = e.companyName + '('+( e.companyType==0?`柴油账户:${e.balance}元`:e.companyType==1?`汽油账户:${e.balance}元`:e.companyType==2?`LNG账户:${e.balance}元`:`尿素:${e.balance}元`) + ')'
|
||||
e.companyName = e.companyName + '(' + (e.companyType == 0 ? `柴油账户:${e.balance}元` : e
|
||||
.companyType == 1 ? `汽油账户:${e.balance}元` : e.companyType == 2 ?
|
||||
`LNG账户:${e.balance}元` : `尿素:${e.balance}元`) + ')'
|
||||
})
|
||||
return this.cardList
|
||||
}
|
||||
@@ -251,11 +250,10 @@
|
||||
onLoad(option) {
|
||||
let oilItem = uni.getStorageSync('oilItem')
|
||||
let otherUserInfo = uni.getStorageSync('otherUserInfo')
|
||||
if(otherUserInfo){
|
||||
if (otherUserInfo) {
|
||||
this.otherUser = 'kl'
|
||||
}
|
||||
this.otherUserInfo = otherUserInfo
|
||||
// console.log('+++++',option)
|
||||
this.showtitles = oilItem.listTag
|
||||
this.siteId = option.siteId
|
||||
this.activeChannelCode = option.activeChannelCode
|
||||
@@ -267,6 +265,40 @@
|
||||
this.getSiteInfo(option.siteId)
|
||||
},
|
||||
methods: {
|
||||
sortHandler(arr) {
|
||||
let internalArr = arr.filter(item => item.oilCardType == 2)
|
||||
let externalArr = arr.filter(item => item.oilCardType == 3)
|
||||
// let internalTarget = this.sortParticulars(internalArr, 'shareCompanyQuota')
|
||||
let externalTarget = this.sortParticulars(externalArr, 'balance')
|
||||
if (internalArr.length || externalTarget.length) return [...internalArr, ...externalTarget]
|
||||
else return arr
|
||||
},
|
||||
sortParticulars(arr, field) {
|
||||
let target = []
|
||||
let map = new Map()
|
||||
let keys = [],
|
||||
values = []
|
||||
arr.forEach(item => {
|
||||
map.set(item, item[field])
|
||||
})
|
||||
for (let key of map.keys()) {
|
||||
keys.push(key)
|
||||
}
|
||||
for (let value of map.values()) {
|
||||
values.push(value)
|
||||
}
|
||||
values.sort((a,b)=>{return a - b})
|
||||
values.reverse()
|
||||
values.forEach(value => {
|
||||
keys.forEach(key => {
|
||||
if (map.get(key) == value) {
|
||||
target.push(key)
|
||||
map.set(key, new Date().getTime())
|
||||
}
|
||||
})
|
||||
})
|
||||
return target
|
||||
},
|
||||
qrR() {
|
||||
|
||||
},
|
||||
@@ -284,16 +316,8 @@
|
||||
oilCardNature: activeCard.oilCardType, //类型:String 必有字段 备注:油卡性质
|
||||
accountCardCode: activeCard.accountCardCode //类型:String 必有字段 备注:油卡卡号
|
||||
}
|
||||
// console.log('这里是二维码参数',data2)
|
||||
qrApi.getOilQrCode(data2).then(res => {
|
||||
// console.log('这里是二维码返回处+',res,'+')
|
||||
if (res.code === 20000) {
|
||||
// console.log(res.data)
|
||||
// console.log(this.otherUser,'++++++++++++++++++++')
|
||||
// if(this.otherUser = 'kl'){
|
||||
// this.val = res.data.codeStr+"&"+this.otherUser
|
||||
// return
|
||||
// }
|
||||
this.val = res.data.codeStr
|
||||
}
|
||||
})
|
||||
@@ -313,26 +337,21 @@
|
||||
})
|
||||
},
|
||||
getUserCard() {
|
||||
// console.log('%c look that ↓','color:red;font-size:50px')
|
||||
// console.log(uni.getStorageSync('oilItem'),'*-*-*-*-')
|
||||
accountApi.getNewUserAccount({siteId:uni.getStorageSync('oilItem').siteId}).then(res => {
|
||||
accountApi.getNewUserAccount({
|
||||
siteId: uni.getStorageSync('oilItem').siteId
|
||||
}).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.cardList = res.data
|
||||
if (this.cardList.length > 0) {
|
||||
// this.getMoneyDetail(this.cardList[0])
|
||||
}
|
||||
if (res.data.length) {
|
||||
let staging = res.data.filter(item => item.companyType != 5)
|
||||
let target = this.sortHandler(staging)
|
||||
this.cardList = target
|
||||
} else this.cardList = []
|
||||
}
|
||||
})
|
||||
},
|
||||
toSiteDetail(id) {
|
||||
uni.redirectTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?siteId=${id}&customerJump=false`,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
},
|
||||
success: () => {
|
||||
// console.log('err')
|
||||
}
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?siteId=${id}&customerJump=false`
|
||||
})
|
||||
},
|
||||
openPlugin() {
|
||||
|
||||
Reference in New Issue
Block a user