更新
This commit is contained in:
@@ -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
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="padding-xl text-center">
|
<view class="padding-xl text-center">
|
||||||
<text class="text-xxl text-bold oil-main-color" v-if='type == "oil"'>
|
<text class="text-xxl text-bold oil-main-color" v-if='type == "oil"'>
|
||||||
{{order.realAmount>0?order.realAmount:'xxx.x'|moneyFormat}}
|
{{order.realAmount>0?order.realAmount:'xxx.x'|moneyFormat}}
|
||||||
</text>
|
</text>
|
||||||
<text class="text-xxl text-bold oil-main-color" v-if='type == "urea"'>
|
<text class="text-xxl text-bold oil-main-color" v-if='type == "urea"'>
|
||||||
@@ -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>
|
||||||
@@ -107,31 +108,36 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 尿素 -->
|
<!-- 尿素 -->
|
||||||
<view class="cu-item" v-if='type == "urea"' @tap="ureaSelectCompanyCard(itemx)"
|
<view class="cu-item" v-if='type == "urea"' @tap="ureaSelectCompanyCard(itemx)"
|
||||||
v-for="itemx in ureaCompanyOtherList" :key="itemx.id">
|
v-for="itemx in ureaCompanyOtherList" :key="itemx.id">
|
||||||
<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">
|
|
||||||
<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>
|
|
||||||
</view>
|
|
||||||
<view class="text-sm padding-left-xl margin-left-xs">
|
|
||||||
{{itemx.name}} {{itemx.shareCompanyQuota==1?'共享额度':'非共享'}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="action">
|
|
||||||
<view class="site-icon-sm">
|
<view class="site-icon-sm">
|
||||||
<image
|
<image :src="imgURL+'pay-qy.png'" mode="widthFix" width="100upx"
|
||||||
:src="imgURL+(card.accountCardCode == itemx.accountCardCode?'pay-xz.png':'pay-qx.png')"
|
v-if='itemx.companyNature =="0"'></image>
|
||||||
mode="widthFix" width="100upx"></image>
|
<image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/gr.png"
|
||||||
<!-- <image :src="imgURL+'pay-qx.png'" mode="widthFix" width="100upx"></image> -->
|
mode="widthFix" width="100upx" v-if='itemx.companyNature =="1"'></image>
|
||||||
</view>
|
</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>
|
<view class="text-sm padding-left-xl margin-left-xs">
|
||||||
|
{{itemx.name}} {{itemx.shareCompanyQuota==1?'共享额度':'非共享'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="action">
|
||||||
|
<view class="site-icon-sm">
|
||||||
|
<image
|
||||||
|
:src="imgURL+(card.accountCardCode == itemx.accountCardCode?'pay-xz.png':'pay-qx.png')"
|
||||||
|
mode="widthFix" width="100upx"></image>
|
||||||
|
<!-- <image :src="imgURL+'pay-qx.png'" mode="widthFix" width="100upx"></image> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class=" radius my-shadow solid-top margin margin-top-0">
|
<view class=" radius my-shadow solid-top margin margin-top-0">
|
||||||
@@ -150,8 +156,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="padding-tb-xs text-left">
|
<view class="padding-tb-xs text-left">
|
||||||
油站:
|
油站:
|
||||||
<view class="fr">{{order.siteName?order.siteName:''}}
|
<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> -->
|
<!-- <text v-if="order.siteLevel" class="cu-tag text-xs tag-red" style="margin-left: 20px;">{{order.siteLevel}}级</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-tb-xs text-left">
|
<view class="padding-tb-xs text-left">
|
||||||
@@ -168,14 +174,13 @@
|
|||||||
加油金额:
|
加油金额:
|
||||||
<!-- <text
|
<!-- <text
|
||||||
class="fr">{{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
class="fr">{{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
||||||
<text class="fr">{{ moneyIntercept(order.xoilAmountGun )}}</text>
|
<text class="fr">{{ moneyIntercept(order.xoilAmountGun )}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<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">
|
||||||
优惠券:
|
优惠券:
|
||||||
@@ -198,48 +203,50 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="padding-tb-xs text-left">
|
<view class="padding-tb-xs text-left">
|
||||||
油站:
|
油站:
|
||||||
<view class="fr">{{order.siteName?order.siteName:''}}
|
<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> -->
|
<!-- <text v-if="order.siteLevel" class="cu-tag text-xs tag-red" style="margin-left: 20px;">{{order.siteLevel}}级</text> -->
|
||||||
</view>
|
</view>
|
||||||
</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">¥{{list.totalPrice}}</view>
|
<view class="formats_box_list_right w30">¥{{list.totalPrice}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-tb-xs text-left" v-if='order.formats != "2"'>
|
<view class="padding-tb-xs text-left" v-if='order.formats != "2"'>
|
||||||
加注量:
|
加注量:
|
||||||
<text class="fr">{{order.oldRealLiter?order.oldRealLiter :'xxx.x' }}</text>
|
<text class="fr">{{order.oldRealLiter?order.oldRealLiter :'xxx.x' }}</text>
|
||||||
</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>
|
||||||
<view class="padding placeholder-hidden">
|
<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>
|
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding fixed-bar-bottom">
|
<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>
|
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding fixed-bar-bottom" v-if='type == "urea"'>
|
<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>
|
<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>
|
||||||
|
|
||||||
@@ -255,18 +262,18 @@
|
|||||||
AbnormalPopup
|
AbnormalPopup
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checkType:false,
|
checkType: false,
|
||||||
PopupType:null,
|
PopupType: null,
|
||||||
PopupShow:false,
|
PopupShow: false,
|
||||||
ureaInfo:{
|
ureaInfo: {
|
||||||
accountCardCode:'',
|
accountCardCode: '',
|
||||||
companyId:''
|
companyId: ''
|
||||||
},
|
},
|
||||||
isdisabled:false,
|
isdisabled: false,
|
||||||
showtitles:"",
|
showtitles: "",
|
||||||
imgURL: this.global.imgURL,
|
imgURL: this.global.imgURL,
|
||||||
order:{},
|
order: {},
|
||||||
activePay: 0,
|
activePay: 0,
|
||||||
isCompany: uni.getStorageSync('accountStatus'),
|
isCompany: uni.getStorageSync('accountStatus'),
|
||||||
accountCardCode: '',
|
accountCardCode: '',
|
||||||
@@ -274,33 +281,33 @@
|
|||||||
datatime: "",
|
datatime: "",
|
||||||
checked: '',
|
checked: '',
|
||||||
cooling: false,
|
cooling: false,
|
||||||
payMethod:0,
|
payMethod: 0,
|
||||||
user:uni.getStorageSync('user'),
|
user: uni.getStorageSync('user'),
|
||||||
type:'',
|
type: '',
|
||||||
ureaCompanyOtherList:[],
|
ureaCompanyOtherList: [],
|
||||||
companyNature:'',
|
companyNature: '',
|
||||||
shareCompanyQuota:''
|
shareCompanyQuota: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
if(option.type == 'urea'){
|
if (option.type == 'urea') {
|
||||||
this.order = uni.getStorageSync('ureaOrderMade')
|
this.order = uni.getStorageSync('ureaOrderMade')
|
||||||
this.order.companyStatus = true
|
this.order.companyStatus = true
|
||||||
this.type = 'urea'
|
this.type = 'urea'
|
||||||
this.findUreaAccount()
|
this.findUreaAccount()
|
||||||
}else{
|
} else {
|
||||||
let oilItem = uni.getStorageSync('oilItem')
|
let oilItem = uni.getStorageSync('oilItem')
|
||||||
// console.log
|
// console.log
|
||||||
this.order = uni.getStorageSync('orderMade')
|
this.order = uni.getStorageSync('orderMade')
|
||||||
this.type = 'oil'
|
this.type = 'oil'
|
||||||
this.showtitles = oilItem.listTag
|
this.showtitles = oilItem.listTag
|
||||||
if(option.payMethod == null){
|
if (option.payMethod == null) {
|
||||||
this.payMethod =oilItem.payMethod
|
this.payMethod = oilItem.payMethod
|
||||||
// console.log(this.payMethod )
|
// console.log(this.payMethod )
|
||||||
}else {
|
} else {
|
||||||
this.payMethod =option.payMethod
|
this.payMethod = option.payMethod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
companyList() {
|
companyList() {
|
||||||
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -328,19 +337,45 @@
|
|||||||
this.accountCardCode = this.card.accountCardCode
|
this.accountCardCode = this.card.accountCardCode
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getureaFinanceApi(){
|
sortParticulars(arr, field) {
|
||||||
ureaFinanceApi.queryWhetherToHangUp(this.order.orderId).then(res=>{
|
let map = new Map()
|
||||||
if(res.data == '2'){
|
let keys = [],
|
||||||
this.checkType = true
|
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() {
|
||||||
|
ureaFinanceApi.queryWhetherToHangUp(this.order.orderId).then(res => {
|
||||||
|
if (res.data == '2') {
|
||||||
|
this.checkType = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
hidenPopup(e){
|
hidenPopup(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.PopupShow =e
|
this.PopupShow = e
|
||||||
},
|
},
|
||||||
findUreaAccount(){
|
findUreaAccount() {
|
||||||
ureaFinanceApi.findUreaAccount(this.order.driverId).then(res => {
|
ureaFinanceApi.findUreaAccount(this.order.driverId).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
this.ureaCompanyOtherList = res.data
|
this.ureaCompanyOtherList = res.data
|
||||||
@@ -353,7 +388,7 @@
|
|||||||
return timestampDeadline
|
return timestampDeadline
|
||||||
},
|
},
|
||||||
ureaCancelOrder(id) {
|
ureaCancelOrder(id) {
|
||||||
console.log(id)
|
console.log(id)
|
||||||
ureaFinanceApi.cancelTheOrder(id).then(res => {
|
ureaFinanceApi.cancelTheOrder(id).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
@@ -365,7 +400,7 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack(2)
|
uni.navigateBack(2)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -393,17 +428,17 @@
|
|||||||
this.card = card
|
this.card = card
|
||||||
this.checked = 'person'
|
this.checked = 'person'
|
||||||
},
|
},
|
||||||
ureaSelectCompanyCard(card){
|
ureaSelectCompanyCard(card) {
|
||||||
this.ureaInfo.accountCardCode = card.accountCardCode
|
this.ureaInfo.accountCardCode = card.accountCardCode
|
||||||
this.ureaInfo.companyId = card.companyId
|
this.ureaInfo.companyId = card.companyId
|
||||||
this.card = card
|
this.card = card
|
||||||
this.checked = card.accountCardCode
|
this.checked = card.accountCardCode
|
||||||
this.accountCardCode = card.accountCardCode
|
this.accountCardCode = card.accountCardCode
|
||||||
this.companyNature = card.companyNature
|
this.companyNature = card.companyNature
|
||||||
this.shareCompanyQuota =card.shareCompanyQuota
|
this.shareCompanyQuota = card.shareCompanyQuota
|
||||||
},
|
},
|
||||||
selectCompanyCard(card) {
|
selectCompanyCard(card) {
|
||||||
console.log(card)
|
console.log(card)
|
||||||
this.card = card
|
this.card = card
|
||||||
this.checked = card.accountCardCode
|
this.checked = card.accountCardCode
|
||||||
this.accountCardCode = card.accountCardCode
|
this.accountCardCode = card.accountCardCode
|
||||||
@@ -415,8 +450,8 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.cooling = false
|
this.cooling = false
|
||||||
}, 5000)
|
}, 5000)
|
||||||
if (this.activePay == 0) {
|
if (this.activePay == 0) {
|
||||||
this.selfCardPay()
|
this.selfCardPay()
|
||||||
} else if (this.activePay == 2) {
|
} else if (this.activePay == 2) {
|
||||||
this.selfWxPay()
|
this.selfWxPay()
|
||||||
}
|
}
|
||||||
@@ -426,7 +461,7 @@
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.isdisabled = false
|
this.isdisabled = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selfWxPay() {
|
selfWxPay() {
|
||||||
let payData = {
|
let payData = {
|
||||||
@@ -444,7 +479,7 @@
|
|||||||
provider: 'wxpay',
|
provider: 'wxpay',
|
||||||
...res.data.baseWxOrderVo,
|
...res.data.baseWxOrderVo,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.isdisabled=false
|
this.isdisabled = false
|
||||||
// this.getPayStatus(this.outTradeNo)
|
// this.getPayStatus(this.outTradeNo)
|
||||||
// this.getLastMoney()
|
// this.getLastMoney()
|
||||||
// this.getCards()
|
// this.getCards()
|
||||||
@@ -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)
|
||||||
}
|
}
|
||||||
@@ -490,14 +526,14 @@
|
|||||||
this.isdisabled = false
|
this.isdisabled = false
|
||||||
return 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)
|
console.log(this.type)
|
||||||
if(this.type =='urea'){
|
if (this.type == 'urea') {
|
||||||
this.PopupShow = true
|
this.PopupShow = true
|
||||||
this.PopupType = 2
|
this.PopupType = 2
|
||||||
this.isdisabled = false
|
this.isdisabled = false
|
||||||
return
|
return
|
||||||
}else if(this.type =='oil'){
|
} else if (this.type == 'oil') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '该油卡余额不足',
|
title: '该油卡余额不足',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -505,11 +541,11 @@
|
|||||||
this.isdisabled = false
|
this.isdisabled = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
let payData
|
let payData
|
||||||
if(this.type == 'oil'){
|
if (this.type == 'oil') {
|
||||||
payData = {
|
payData = {
|
||||||
...this.card,
|
...this.card,
|
||||||
"orderSerialNumber": this.order.orderSerialNumber, //类型:String 必有字段 备注:订单编号
|
"orderSerialNumber": this.order.orderSerialNumber, //类型:String 必有字段 备注:订单编号
|
||||||
"payChannel": "BALANCE_PAYMENT", //类型:String 必有字段 备注:支付渠道(BALANCE_PAYMENT:余额支付)
|
"payChannel": "BALANCE_PAYMENT", //类型:String 必有字段 备注:支付渠道(BALANCE_PAYMENT:余额支付)
|
||||||
@@ -525,13 +561,14 @@
|
|||||||
})
|
})
|
||||||
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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.isdisabled = false
|
this.isdisabled = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -541,32 +578,33 @@
|
|||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}else if (this.type ='urea'){
|
} else if (this.type = 'urea') {
|
||||||
payData={
|
payData = {
|
||||||
belongCompanyId:this.ureaInfo.companyId,
|
belongCompanyId: this.ureaInfo.companyId,
|
||||||
driverId:this.user.id,
|
driverId: this.user.id,
|
||||||
accountCardCode:this.ureaInfo.accountCardCode,
|
accountCardCode: this.ureaInfo.accountCardCode,
|
||||||
driverPhone:this.user.userPhone,
|
driverPhone: this.user.userPhone,
|
||||||
oldRealAmount:this.order.oldRealAmount,
|
oldRealAmount: this.order.oldRealAmount,
|
||||||
vehicleNo:this.order.vehicleNo,
|
vehicleNo: this.order.vehicleNo,
|
||||||
orderId:this.order.orderId,
|
orderId: this.order.orderId,
|
||||||
driverName:this.order.driverName,
|
driverName: this.order.driverName,
|
||||||
userSource:'urea',
|
userSource: 'urea',
|
||||||
formats:this.order.formats,
|
formats: this.order.formats,
|
||||||
oilCardNature:this.companyNature,
|
oilCardNature: this.companyNature,
|
||||||
companyShared:this.shareCompanyQuota
|
companyShared: this.shareCompanyQuota
|
||||||
}
|
}
|
||||||
ureaFinanceApi.orderPay(payData).then(res => {
|
ureaFinanceApi.orderPay(payData).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if(res.code == 20000){
|
if (res.code == 20000) {
|
||||||
uni.setStorageSync('ureaOrderMade',res.data)
|
uni.setStorageSync('ureaOrderMade', res.data)
|
||||||
if(res.data.formats == '2'){
|
if (res.data.formats == '2') {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/BagStation/orderDetail/orderDetailUrea?type=orderPay',
|
url: '/BagStation/orderDetail/orderDetailUrea?type=orderPay',
|
||||||
fail: (err) => {}
|
fail: (err) => {}
|
||||||
@@ -576,14 +614,14 @@
|
|||||||
_that.PopupShow = true
|
_that.PopupShow = true
|
||||||
_that.PopupType = 5
|
_that.PopupType = 5
|
||||||
this.isdisabled = false
|
this.isdisabled = false
|
||||||
} else if(res.code == 40000 && res.msg == '余额不足'){
|
} else if (res.code == 40000 && res.msg == '余额不足') {
|
||||||
_that.PopupShow = true
|
_that.PopupShow = true
|
||||||
_that.PopupType = 2
|
_that.PopupType = 2
|
||||||
this.isdisabled = false
|
this.isdisabled = false
|
||||||
}
|
}
|
||||||
console.log(res)
|
console.log(res)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCopy(id) {
|
onCopy(id) {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
@@ -598,28 +636,28 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
ureaFormats(value){
|
ureaFormats(value) {
|
||||||
if(value == 1){
|
if (value == 1) {
|
||||||
return '加注站'
|
return '加注站'
|
||||||
}else{
|
} else {
|
||||||
return '桶装'
|
return '桶装'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
moneyFormath(value) {
|
moneyFormath(value) {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
if (value != 'xxx.x') {
|
if (value != 'xxx.x') {
|
||||||
let number = value.toFixed(2)
|
let number = value.toFixed(2)
|
||||||
return number
|
return number
|
||||||
} else {
|
} else {
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
moneyFormat(value) {
|
moneyFormat(value) {
|
||||||
if (value != 'xxx.x') {
|
if (value != 'xxx.x') {
|
||||||
let realAmount = Math.round(value * 100) / 100;
|
let realAmount = Math.round(value * 100) / 100;
|
||||||
return realAmount
|
return realAmount
|
||||||
} else {
|
} else {
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -627,31 +665,34 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.w30{
|
.w30 {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
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;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 2%;
|
padding: 2%;
|
||||||
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;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 3%;
|
margin-bottom: 3%;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user