pull/9/head
xiaozhiyong 2 years ago
parent 0ad09f5917
commit c2e72737be
  1. 59
      BagMoney/pages/oilCards/oilCards.vue
  2. 75
      BagStation/pages/makeOrder/orderPaying.vue

@ -162,9 +162,9 @@
this.TowerSwiper('swiperList'); this.TowerSwiper('swiperList');
}, },
onLoad(option) { onLoad(option) {
this.getCards() // this.getCards()
this.getTotalOilCardInfo() // this.getTotalOilCardInfo()
this.TowerSwiper('swiperList'); // this.TowerSwiper('swiperList');
// towerSwiper // towerSwiper
}, },
onReachBottom() { onReachBottom() {
@ -180,14 +180,6 @@
} }
}, },
methods: { methods: {
getAmount() {
accountApi.getTotalOilCardInfo().then(res => {
if (res.code == 20000) {
this.userTotal = res.data
}
})
},
getTotalOilCardInfo() { getTotalOilCardInfo() {
accountApi.getTotalOilCardInfo().then(res => { accountApi.getTotalOilCardInfo().then(res => {
if (res.code == 20000) { if (res.code == 20000) {
@ -233,15 +225,17 @@
await accountApi.getUserAccount().then(res => { await accountApi.getUserAccount().then(res => {
if (res.code == 20000) { if (res.code == 20000) {
if (res.data.length > 0) { if (res.data.length > 0) {
this.cardList = res.data
this.cardList = this.cardList.filter(item => !this.hideCard.includes(item let staging = res.data.filter(item => !this.hideCard.includes(item
.companyId)) .companyId))
this.cardList.forEach(item => { staging.forEach(item => {
this.$set(item, 'currentPage', 1) this.$set(item, 'currentPage', 1)
this.$set(item, 'loadStatus', 'more') this.$set(item, 'loadStatus', 'more')
this.$set(item, 'historyList', []) this.$set(item, 'historyList', [])
}) })
console.log(this.cardList) let target = this.sortHandler(staging)
this.cardList = target
setTimeout(() => { setTimeout(() => {
this.getMoneyDetail(this.cardList[0], 0) this.getMoneyDetail(this.cardList[0], 0)
}, 100) }, 100)
@ -249,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()
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) { DotStyle(e) {
this.dotStyle = e.detail.value this.dotStyle = e.detail.value
}, },

@ -61,7 +61,8 @@
<view class="content padding-tb-sm"> <view class="content padding-tb-sm">
<view class="text-left"> <view class="text-left">
<view class="site-icon-sm"> <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> </view>
<text class="padding-left-sm">自营企业油卡支付 <text <text class="padding-left-sm">自营企业油卡支付 <text
v-if="item.shareCompanyQuota==0">余额{{item.balance|moneyFormat}}</text></text> v-if="item.shareCompanyQuota==0">余额{{item.balance|moneyFormat}}</text></text>
@ -113,11 +114,16 @@
<view class="content padding-tb-sm"> <view class="content padding-tb-sm">
<view class="text-left"> <view class="text-left">
<view class="site-icon-sm"> <view class="site-icon-sm">
<image :src="imgURL+'pay-qy.png'" mode="widthFix" width="100upx" v-if='itemx.companyNature =="0"'></image> <image :src="imgURL+'pay-qy.png'" mode="widthFix" width="100upx"
<image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/gr.png" mode="widthFix" width="100upx" v-if='itemx.companyNature =="1"'></image> v-if='itemx.companyNature =="0"'></image>
</view> <image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/gr.png"
<text class="padding-left-sm" v-if='itemx.companyNature =="0"'>外请油卡支付余额{{itemx.balance|moneyFormat}}</text> mode="widthFix" width="100upx" v-if='itemx.companyNature =="1"'></image>
<text class="padding-left-sm" v-if='itemx.companyNature =="1"'>企业油卡支付 {{itemx.companyNature =="1" ? itemx.shareCompanyQuota==0? '(余额:'+itemx.balance+')' :'':''}} </text> </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>
</view> </view>
<view class="text-sm padding-left-xl margin-left-xs"> <view class="text-sm padding-left-xl margin-left-xs">
{{itemx.name}} {{itemx.shareCompanyQuota==1?'共享额度':'非共享'}} {{itemx.name}} {{itemx.shareCompanyQuota==1?'共享额度':'非共享'}}
@ -174,8 +180,7 @@
<view class="padding-tb-xs text-left"> <view class="padding-tb-xs text-left">
星油优惠 星油优惠
<!-- order.oilDiscountAmount>0?order.oilDiscountAmount:'xxx.x'|moneyFormat --> <!-- order.oilDiscountAmount>0?order.oilDiscountAmount:'xxx.x'|moneyFormat -->
<text <text class="text-red fr">{{ moneyIntercept(order.oilDiscountAmount)}}</text>
class="text-red fr">{{ moneyIntercept(order.oilDiscountAmount)}}</text>
</view> </view>
<view class="padding-tb-xs text-left"> <view class="padding-tb-xs text-left">
优惠券 优惠券
@ -204,15 +209,15 @@
</view> </view>
<view class="padding-tb-xs text-left"> <view class="padding-tb-xs text-left">
加注类型 加注类型
<text <text class="fr nowrap">{{order.formats | ureaFormats }}</text>
class="fr nowrap">{{order.formats | ureaFormats }}</text>
</view> </view>
<view class="padding-tb-xs formats_box" v-if='order.formats == "2"'> <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" v-for="(list,i) in order.xoilUreaOrderRelations " :key='i'>
<view class="formats_box_list_left w30"> <view class="formats_box_list_left w30">
{{list.brandName}} {{list.brandName}}
</view> </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">&#165;{{list.totalPrice}}</view> <view class="formats_box_list_right w30">&#165;{{list.totalPrice}}</view>
</view> </view>
</view> </view>
@ -222,7 +227,8 @@
</view> </view>
<view class="padding-tb-xs text-left"> <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>
</view> </view>
@ -239,7 +245,8 @@
<button class="cu-btn margin-top block lg " @tap="ureaCancelOrder(order.orderId)">取消订单</button> <button class="cu-btn margin-top block lg " @tap="ureaCancelOrder(order.orderId)">取消订单</button>
</view> </view>
</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> </view>
</template> </template>
@ -310,7 +317,9 @@
}, },
companyOtherList() { companyOtherList() {
if (this.isCompany) { if (this.isCompany) {
return this.order.otherAccounts // return this.order.otherAccounts
let target = this.sortParticulars(this.order.otherAccounts,'balance')
return target
} }
} }
}, },
@ -329,6 +338,32 @@
} }
}, },
methods: { methods: {
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()
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() { getureaFinanceApi() {
ureaFinanceApi.queryWhetherToHangUp(this.order.orderId).then(res => { ureaFinanceApi.queryWhetherToHangUp(this.order.orderId).then(res => {
if (res.data == '2') { if (res.data == '2') {
@ -453,7 +488,8 @@
title: res.msg title: res.msg
}) })
uni.redirectTo({ uni.redirectTo({
url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod='+this.payMethod, url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod=' +
this.payMethod,
fail: (err) => { fail: (err) => {
// console.log(err) // console.log(err)
} }
@ -525,7 +561,8 @@
}) })
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod='+this.payMethod, url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod=' +
this.payMethod,
fail: (err) => { fail: (err) => {
// console.log(err) // console.log(err)
} }
@ -541,7 +578,8 @@
setTimeout(() => { setTimeout(() => {
let msg = res.msg let msg = res.msg
uni.redirectTo({ 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) }, 1000)
} }
@ -634,6 +672,7 @@
font-weight: 700; font-weight: 700;
font-size: 28rpx; font-size: 28rpx;
} }
.formats_box { .formats_box {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -642,6 +681,7 @@
box-sizing: border-box; box-sizing: border-box;
flex-direction: column; flex-direction: column;
} }
.formats_box_list { .formats_box_list {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
@ -652,6 +692,7 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
} }
.site-icon-sm { .site-icon-sm {
width: 40upx; width: 40upx;
vertical-align: middle; vertical-align: middle;

Loading…
Cancel
Save