第一提交
This commit is contained in:
511
packageOrders/pages/orderList/OrderDetail/OrderDetail.vue
Normal file
511
packageOrders/pages/orderList/OrderDetail/OrderDetail.vue
Normal file
@@ -0,0 +1,511 @@
|
||||
<template>
|
||||
<view class="page-content my-bg">
|
||||
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">订单详情</block>
|
||||
</cu-custom>
|
||||
<view class="padding margin">
|
||||
</view>
|
||||
<view class="text-center margin-top icon-container">
|
||||
<view class="cu-avatar xl round text-sl headImg"></view>
|
||||
<!-- <view class="cu-avatar xl round text-sl" v-if="orderItem.sourceType===3" :style="'background-image:url('+baseURL+'static/img/order-wjy.png)'"></view>
|
||||
<view class="cu-avatar xl round text-sl" v-else-if="orderItem.sourceType===4||orderItem.sourceType===6" :style="'background-image:url('+baseURL+'static/img/order-xy.png)'"></view>
|
||||
<view class="cu-avatar xl round text-sl" v-else-if="orderItem.sourceType===5" :style="'background-image:url('+baseURL+'static/img/order-lv.png)'"></view>
|
||||
<view class="cu-avatar xl round text-sl" v-else :style="'background-image:url('+baseURL+'static/img/order-xy.png)'"></view> -->
|
||||
</view>
|
||||
<view class="radius margin margin-top bg-white padding-top padding">
|
||||
<!-- sourceType 万金油3 老吕5 星油4/6 -->
|
||||
<!-- <image size="20" v-if="orderItem.sourceType===4||orderItem.sourceType===6" :src="baseURL+'static/img/order-xy.png'"></image>
|
||||
<image size="20" v-else-if="orderItem.sourceType===3" :src="baseURL+'static/img/order-wjy.png'"></image>
|
||||
<image size="20" v-else-if="orderItem.sourceType===5" :src="baseURL+'static/img/order-lv.png'"></image> -->
|
||||
<view class="margin padding">
|
||||
<view class="text-lg text-center orderText" style="font-weight:700;margin-top: 10rpx;" >{{orderItem.orderStatus|formatZyStr}}</view>
|
||||
<view class="text-lg text-center" v-if="orderSource=='zy'">{{orderItem.orderStatus|formatZyStr}}</view>
|
||||
<view class="text-lg text-center" v-else>{{istate|formatStr}}</view>
|
||||
<view class="number text-xl text-center oil-main-color">¥{{displayMoney|numberFormat}}</view>
|
||||
</view>
|
||||
<view class="margin-bottom-sm" @tap="copyId(orderItem.customerId,'司机编号')">
|
||||
司机编号
|
||||
<text class="fr">{{orderItem.customerId}}<text :class="orderItem.customerId?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red">
|
||||
</text></text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
加油司机
|
||||
<view class="fr">
|
||||
<text>{{orderItem.customerName|nameFilter}}</text> <text class="padding-left-sm">{{orderItem.plateNumber|plateFilter}}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- <view class="margin-bottom-sm" @tap="copyId(orderItem.carNo,'司机车牌')">
|
||||
司机车牌
|
||||
<text class="fr">{{orderItem.carNo?orderItem.carNo:'暂无'}}<text :class="orderItem.carNo?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red">
|
||||
</text></text>
|
||||
</view> -->
|
||||
|
||||
<view class="margin-bottom-sm">
|
||||
油枪油号
|
||||
<text class="fr">{{orderItem.oilsBar}}号枪{{orderItem.oilName||orderItem.oilsCode}}</text>
|
||||
</view>
|
||||
<!-- <view class="margin-bottom-sm">
|
||||
加油总金额
|
||||
<text
|
||||
class="fr">¥{{orderItem.amount?orderItem.amount:(orderItem.xoilDiscountAmount+orderItem.realamount)|numberFormat}}</text>
|
||||
</view> -->
|
||||
<view class="margin-bottom-sm">
|
||||
油机单价
|
||||
<text class="fr">¥{{orderItem.sitePrice|| orderItem.price | UnitPriceFormat}} / {{orderItem.oilProductType=='GAS'?'L':'L'}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
{{ orderItem.oilProductType=='GAS'?'加气升数':'加油升数' }}
|
||||
<text class="fr">{{orderItem.volume|numberFormats}} {{orderItem.oilProductType=='GAS'?'L':'L'}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm" v-if="orderSource=='mpxoil'">
|
||||
油机总价
|
||||
<text class="fr">¥{{displayMoney|numberFormat}}</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="margin-bottom-sm" v-if="orderItem.xoilDiscountAmount">
|
||||
星卡优惠
|
||||
<text class="fr">¥ {{(orderItem.xoilDiscountAmount)|numberFormat}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm" v-else>
|
||||
星卡优惠
|
||||
<text class="fr">¥ {{(orderItem.amount-orderItem.realamount)|numberFormat}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
优惠券
|
||||
<text class="fr">{{orderItem.coupon|couponFormat}}</text>
|
||||
</view> -->
|
||||
<!-- <view class="margin-bottom-sm">
|
||||
实扣款
|
||||
<text class="fr oil-main-color">¥ {{orderItem.realamount|numberFormat}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="radius bg-white margin padding ">
|
||||
|
||||
<view class="flex padding-bottom-sm">
|
||||
|
||||
<view class="basis-sm">
|
||||
加油站名称
|
||||
</view>
|
||||
<view class="basis-lg text-right text-cut">{{orderItem.siteName}}</view>
|
||||
</view>
|
||||
<view class="flex padding-bottom-sm">
|
||||
|
||||
<view class="basis-xs">
|
||||
地址
|
||||
</view>
|
||||
<view class="basis-xl text-right text-cut">{{orderItem.address}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="radius bg-white margin margin-bottom-0 padding">
|
||||
<view class="margin-bottom-sm" @tap="copyId(orderItem.orderSerialNumber,'订单号')">
|
||||
订单号
|
||||
<text class=" fr">{{orderItem.orderSerialNumber}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
</text></text>
|
||||
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
{{orderItem.suppleMark==0 ? '订单创建时间' : '补单订单创建时间'}}
|
||||
<text class="fr">{{orderItem.orderTime||` ${orderItem.createTime}`}} </text>
|
||||
</view>
|
||||
<!-- <view class="margin-bottom-sm">
|
||||
扣款时间
|
||||
<text class="fr">{{orderItem.paydatetime}}</text>
|
||||
</view> -->
|
||||
<!-- <view class="padding-bottom-sm">
|
||||
开票状态
|
||||
<text class="fr" v-if="formQr">未开票</text>
|
||||
<text class="fr" v-else>{{orderItem.invoiceState|invoiceStateFormat}}</text>
|
||||
</view> -->
|
||||
<!-- <view class="margin-bottom-sm" v-if="orderItem.paydatetime">
|
||||
支付时间
|
||||
<text class="fr">{{orderItem.paydatetime}}</text>
|
||||
</view>-->
|
||||
</view>
|
||||
<view class="radius bg-white margin margin-bottom-0 padding" v-if='orderItem.plateNumberImages'>
|
||||
<view class="flex padding-bottom-sm">
|
||||
<view class="basis-sm">
|
||||
车辆照片
|
||||
</view>
|
||||
<view class="basis-lg text-right text-cut" @tap="showImg('car')">点击查看</view>
|
||||
</view>
|
||||
<view class="flex padding-bottom-sm">
|
||||
<view class="basis-xs">
|
||||
油机照片
|
||||
</view>
|
||||
<view class="basis-xl text-right text-cut" @tap="showImg('oli')">点击查看</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-lg padding-top-40 padding-bottom-xl">
|
||||
<button v-show="formQr" @tap="scanQr" class="bg-main-oil margin-bottom">
|
||||
<text class="cuIcon-scan padding-right-xs"></text>
|
||||
继续加油</button>
|
||||
<button class="bg-red light margin-bottom" @tap="backHome">
|
||||
<text class="cuIcon-home padding-right-xs"></text>
|
||||
返回首页</button>
|
||||
|
||||
</view>
|
||||
<u-popup v-model="show" mode="center" @close="close" >
|
||||
<view style="width: 100%;height: 100%;">
|
||||
<image :src="showUrl" style=" max-width: 100%;max-height:100%;display: block;object-fit: cove;" mode=""></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import oilFnanceApi from '@/api/oil-finance.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderStatue:'下单成功',
|
||||
show:false,
|
||||
// orderId:'',
|
||||
showUrl:'',
|
||||
plateNumberImages:'',
|
||||
refuellerImages:'',
|
||||
orderId: uni.getStorageSync('orderId'),
|
||||
formQr: uni.getStorageSync('formQr') ? true : false,
|
||||
tempOrderInfo: uni.getStorageSync('tempOrderInfo'),
|
||||
orderSource: uni.getStorageSync('orderSource'),
|
||||
orderType: uni.getStorageSync('orderType'),
|
||||
orderItem: {},
|
||||
baseURL: this.global.baseURL,
|
||||
zeyiType:0,
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
uni.setStorageSync('orderSource', null)
|
||||
this.clearStatus()
|
||||
},
|
||||
filters:{
|
||||
company(e){
|
||||
if(e) return e=='GAS'?'L':'L';
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
displayMoney(){
|
||||
if(this.orderSource=='mpxoil'){
|
||||
console.log('mpxoil')
|
||||
return this.orderItem.sitePriceAmount
|
||||
|
||||
}else{
|
||||
console.log('zeyi')
|
||||
// return this.orderItem.price*this.orderItem.vol
|
||||
console.log('这里是则一++++')
|
||||
|
||||
return this.orderItem.sitePriceAmount
|
||||
}
|
||||
},
|
||||
istate() {
|
||||
let orderType = uni.getStorageSync('orderType')
|
||||
if (orderType == 1) {
|
||||
console.log(this.orderItem.OrderStatus)
|
||||
switch (parseInt(this.orderItem.OrderStatus)) {
|
||||
// 网页版 0:待支付, 1:已支付 ,-1:支付失败 ,-2:退款,
|
||||
//小程序 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
case 1:
|
||||
return 1
|
||||
case -1:
|
||||
return -1
|
||||
case 2:
|
||||
return 2
|
||||
case 0:
|
||||
return 0
|
||||
case 3:
|
||||
return -2
|
||||
}
|
||||
} else {
|
||||
return this.orderItem.OrderStatus
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// if (this.orderType == 1) {
|
||||
// // 小程序订单
|
||||
// this.getMPorder()
|
||||
// return false
|
||||
// }
|
||||
|
||||
console.log(this.tempOrderInfo)
|
||||
if (this.orderSource === 'zy') {
|
||||
// 则一
|
||||
// let obj = {
|
||||
// addres : this.tempOrderInfo.address ,
|
||||
// oilsBar : this.tempOrderInfo.bar ,
|
||||
// plateNumber :this.tempOrderInfo.carNo ,
|
||||
// // coupon: 0
|
||||
// createTime : this.tempOrderInfo.createDatetime,
|
||||
// orderStatus : this.tempOrderInfo.istate,
|
||||
// oilName : this.tempOrderInfo.oilName,
|
||||
// siteName : this.tempOrderInfo.oilSiteName,
|
||||
// Id : this.tempOrderInfo.orderID,
|
||||
// // orderStatus: 1,
|
||||
// payRealAmount : this.tempOrderInfo.realamount,
|
||||
// customerName : this.tempOrderInfo.userName,
|
||||
// volume :this.tempOrderInfo.vol,
|
||||
// xoilDiscountAmount : this.tempOrderInfo.xoilDiscountAmount
|
||||
// }
|
||||
this.getZyPorder()
|
||||
// this.orderItem = obj
|
||||
} else if (this.orderSource === 'mpxoil') {
|
||||
// 则一
|
||||
this.getMPorder()
|
||||
} else if (this.formQr && !this.tempOrderInfo.payOrderId) {
|
||||
if (this.orderType == 0) {
|
||||
// 一般订单的网页订单
|
||||
this.orderItem = {
|
||||
...this.tempOrderInfo,
|
||||
orderID: this.tempOrderInfo.payOrderId,
|
||||
amount: this.tempOrderInfo.standardAmount,
|
||||
realamount: this.tempOrderInfo.oilAmount,
|
||||
userName: this.tempOrderInfo.driverId,
|
||||
carNo: this.tempOrderInfo.plateNumber,
|
||||
createDatetime: this.tempOrderInfo.createTime,
|
||||
paydatetime: this.tempOrderInfo.payTime,
|
||||
bar: this.tempOrderInfo.oilGun,
|
||||
vol: this.tempOrderInfo.volume,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// G7
|
||||
let _that = this
|
||||
_that.zeyiType = 1
|
||||
this.getOrderDetail()
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.clearStatus()
|
||||
},
|
||||
methods: {
|
||||
close(){
|
||||
console.log('关闭')
|
||||
},
|
||||
showImg(type){
|
||||
if(type === 'car'){
|
||||
console.log('1111111',type,this.plateNumberImages,this.showUrl)
|
||||
this.showUrl =this.plateNumberImages
|
||||
}else{
|
||||
console.log('2222222',type,this.plateNumberImages,this.showUrl)
|
||||
this.showUrl =this.refuellerImages
|
||||
}
|
||||
this.show = true
|
||||
},
|
||||
getMPorder() {
|
||||
console.log('这里是星油')
|
||||
oilFnanceApi.getOrderInfo({
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
// 小程序点动感详情
|
||||
console.log('这里是星油',res)
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
this.plateNumberImages = res.data.plateNumberImages
|
||||
this.refuellerImages = res.data.refuellerImages
|
||||
console.log(this.orderItem)
|
||||
}
|
||||
})
|
||||
},
|
||||
getZyPorder(){
|
||||
console.log('这里是则一')
|
||||
console.log(this.tempOrderInfo.orderId)
|
||||
oilFnanceApi.getOrderInfo({
|
||||
id:this.tempOrderInfo.orderId
|
||||
}).then(res => {
|
||||
console.log('这里是则一',res)
|
||||
// 小程序点动感详情
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
console.log(this.orderItem)
|
||||
}
|
||||
})
|
||||
},
|
||||
clearStatus() {
|
||||
uni.removeStorageSync('formQr')
|
||||
},
|
||||
scanQr() {
|
||||
var scanUrl = '/pages/station-info/scan-camera/scan-camera'
|
||||
uni.navigateTo({
|
||||
url: scanUrl,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
},
|
||||
success: (res) => {
|
||||
// console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
},
|
||||
backHome() {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
},
|
||||
copyId(id, name) {
|
||||
if (id) {
|
||||
uni.setClipboardData({
|
||||
data: id,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: name + '已复制',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
getOrderDetail() {
|
||||
console.log('这里是g7')
|
||||
oilFnanceApi.getOrderInfo({id:this.orderId}).then(res => {
|
||||
// G7
|
||||
console.log('这里是g7',res)
|
||||
console.log(res.data)
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
UnitPriceFormat(value){
|
||||
console.log('++++++++++++++++++++',value)
|
||||
if(value){
|
||||
return value
|
||||
} else{
|
||||
return '--'
|
||||
}
|
||||
},
|
||||
nameFilter(value) {
|
||||
if (value) {
|
||||
var arr = value.split('')
|
||||
arr[1] = "*"
|
||||
return arr.join('')
|
||||
}
|
||||
},
|
||||
plateFilter(value) {
|
||||
if (value) {
|
||||
const numBegin = value.substring(0, 2);
|
||||
const numEnd = value.substring(5);
|
||||
return numBegin + '***' + numEnd;
|
||||
}else{
|
||||
return '暂无'
|
||||
}
|
||||
},
|
||||
formatZyStr(value) {
|
||||
switch (parseInt(value)) {
|
||||
case 1:
|
||||
return '订单已支付'
|
||||
case -1:
|
||||
return '订单支付失败'
|
||||
case 2:
|
||||
return '订单已取消'
|
||||
case 3:
|
||||
return '订单已退款'
|
||||
default:
|
||||
return '订单待支付'
|
||||
}
|
||||
},
|
||||
formatStr(value) {
|
||||
switch (parseInt(value)) {
|
||||
case 1:
|
||||
return '订单已支付'
|
||||
case -1:
|
||||
return '订单支付失败'
|
||||
case -2:
|
||||
return '订单已退款'
|
||||
case 4:
|
||||
return '订单支付失败'
|
||||
case 0:
|
||||
return '订单待支付'
|
||||
case 2:
|
||||
return '订单已取消'
|
||||
|
||||
}
|
||||
},
|
||||
couponFormat(value) {
|
||||
if (value) {
|
||||
return value
|
||||
} else {
|
||||
return '未使用'
|
||||
}
|
||||
},
|
||||
numberFormats(value) {
|
||||
if (value) {
|
||||
console.log(value)
|
||||
// let _thast = this.zeyiType
|
||||
// console.log(_thast)
|
||||
// if( _that.zeyiType == 1){
|
||||
// return value
|
||||
// }
|
||||
let number = (Math.round(value * 100) / 100).toFixed(2)
|
||||
return number
|
||||
} else {
|
||||
return '0.00'
|
||||
}
|
||||
},
|
||||
numberFormat(value) {
|
||||
if (value) {
|
||||
console.log(value)
|
||||
// let _thast = this.zeyiType
|
||||
// console.log(_thast)
|
||||
// if( _that.zeyiType == 1){
|
||||
// return value
|
||||
// }
|
||||
// let number = Number(value.toString().match(/^\d+(?:\.\d{0,2})?/))
|
||||
let number = Number(value).toFixed(2)
|
||||
return number
|
||||
} else {
|
||||
return '0.00'
|
||||
}
|
||||
},
|
||||
invoiceStateFormat(value) {
|
||||
switch (parseInt(value)) {
|
||||
case 1:
|
||||
return '已申请'
|
||||
case 2:
|
||||
return '已开票'
|
||||
case -1:
|
||||
return '开票失败'
|
||||
case 0:
|
||||
return '未开票'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 去付款弹窗 */
|
||||
.popup-container p.title {
|
||||
padding: 16px 10px;
|
||||
}
|
||||
|
||||
text.fr {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-container .text-sl {
|
||||
position: absolute;
|
||||
margin-left: -64rpx;
|
||||
margin-top: -64rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
.headImg{
|
||||
background-image: url(../../../../packageQr/static/img/new_logo.png);
|
||||
background-size: cover;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orderText{
|
||||
font-weight: 700;
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
</style>
|
||||
451
packageOrders/pages/orderList/dailyOrder/dailyOrder.vue
Normal file
451
packageOrders/pages/orderList/dailyOrder/dailyOrder.vue
Normal file
@@ -0,0 +1,451 @@
|
||||
<template>
|
||||
<view class="content my-bg">
|
||||
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">加油记录</block>
|
||||
</cu-custom>
|
||||
<view class="fixed-t">
|
||||
<view class="flex bg-main-oil padding solid-bottom">
|
||||
<!-- <view class="flex-sub">
|
||||
订单来源
|
||||
</view> -->
|
||||
<!-- <view class="flex-treble text-right">
|
||||
<picker @change="pickSource" mode="selector" :value="indexSource" :range="sources">
|
||||
<view class="picker">
|
||||
{{activeSource}}
|
||||
<text class="cuIcon-right"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view> -->
|
||||
</view>
|
||||
<scroll-view scroll-x class="bg-white nav">
|
||||
<view class="flex text-center">
|
||||
<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''"
|
||||
v-for="(item,index) in tabList" :key="index" @tap="tabSelect" :data-id="index">{{item}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- <view class="placeholder-hidden">
|
||||
<view class="flex bg-main-oil padding solid-bottom">
|
||||
<view class="flex-sub">
|
||||
订单来源
|
||||
</view>
|
||||
<view class="flex-treble text-right">
|
||||
<picker @change="pickSource" mode="selector" :value="indexSource" :range="sources">
|
||||
<view class="picker">
|
||||
{{sources[indexSource]}}
|
||||
<text class="cuIcon-right"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-x class="bg-white nav">
|
||||
<view class="flex text-center">
|
||||
<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''"
|
||||
v-for="(item,index) in tabList" :key="index" @tap="" :data-id="index">{{item}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
<view class="padding padding-bottom-0" style="padding-top: 200upx;">
|
||||
<!-- 0 全部 1 待支付 2 已支付 3退款 -->
|
||||
<view v-show="TabCur==2" class="order-list">
|
||||
<view v-for="(item,index) in allOrder" v-if="allOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="allOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore1">
|
||||
<uni-load-more :status="load.loadStatus1"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="TabCur==1" class="order-list">
|
||||
<view v-for="(item,index) in payingOrder" v-if="payingOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="payingOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore2">
|
||||
<uni-load-more :status="load.loadStatus2"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="TabCur==0" class="order-list">
|
||||
<view v-for="(item,index) in finishedOrder" v-if="finishedOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="finishedOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore3">
|
||||
<uni-load-more :status="load.loadStatus3"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="TabCur==3" class="order-list">
|
||||
<view v-for="(item,index) in refundOrder" v-if="refundOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="refundOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore4">
|
||||
<uni-load-more :status="load.loadStatus4"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import oliSiteApi from '@/api/oli-site.js'
|
||||
import OrderItem from '@/packageOrders/components/order-item.vue'
|
||||
import UniLoadMore from '@/components/uni-load-more/uni-load-more.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
OrderItem,
|
||||
|
||||
UniLoadMore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
startTime:'',
|
||||
endTime:"",
|
||||
activeSource: '小程序',
|
||||
indexSource: 1,
|
||||
sources: ['网页版', '小程序'],
|
||||
tabList: [
|
||||
'全部','待支付', '已支付 ', '退款'
|
||||
],
|
||||
TabCur: 0,
|
||||
pageNumber: 1,
|
||||
istate: -3,
|
||||
scrollLeft: 0,
|
||||
order: {
|
||||
istate: 0,
|
||||
vol: 3,
|
||||
oilName: '0#',
|
||||
orderID: '15979997825872',
|
||||
oilCode: '12396989',
|
||||
oilSiteName: '疯疯疯加油站',
|
||||
carNo: '皖A12354',
|
||||
sourceType: 3,
|
||||
realamount: 4.66,
|
||||
credateDatetime: '2020-10-12 12:30:10'
|
||||
},
|
||||
allOrder: [],
|
||||
finishedOrder: [],
|
||||
refundOrder: [],
|
||||
payingOrder: [],
|
||||
loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
||||
isLoadMore: false, //是否加载中
|
||||
pageNumber1: 0,
|
||||
pageNumber2: 0,
|
||||
pageNumber3: 0,
|
||||
pageNumber4: 0,
|
||||
load: {
|
||||
isLoadMore1: false,
|
||||
loadStatus1: 'loading',
|
||||
isLoadMore2: false,
|
||||
loadStatus2: 'loading',
|
||||
isLoadMore3: false,
|
||||
loadStatus3: 'loading',
|
||||
isLoadMore4: false,
|
||||
loadStatus4: 'loading',
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getTime()
|
||||
this.loadList(-3, this.pageNumber1, 'created')
|
||||
this.loadList(0, this.pageNumber2, 'created')
|
||||
this.loadList(1, this.pageNumber3, 'created')
|
||||
this.loadList(-2, this.pageNumber4, 'created')
|
||||
},
|
||||
onLoad() {
|
||||
uni.setStorageSync('orderType', 1)
|
||||
},
|
||||
onReachBottom() { //上拉触底函数
|
||||
// console.log('触底函数')
|
||||
this.loadMoreOrder('onReachBottom')
|
||||
},
|
||||
methods: {
|
||||
getTime(){
|
||||
let nowDate = new Date();
|
||||
let year = nowDate.getFullYear();
|
||||
let month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
|
||||
let day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
|
||||
let hr = nowDate.getHours()
|
||||
let mf = nowDate.getMinutes() < 10 ? '0' + nowDate.getMinutes() : nowDate.getMinutes()
|
||||
let ss =nowDate.getSeconds() < 10 ? '0' + nowDate.getSeconds() :nowDate.getSeconds()
|
||||
this.startTime = year + "-" + month + "-" + day+" " + '00:00:00';
|
||||
this.endTime = year + "-" + month + "-" + day+" " +hr+':'+mf+':'+ss
|
||||
},
|
||||
loadMoreOrder(from) {
|
||||
// console.log(from,'loadMoreOrder时间')
|
||||
// <!-- 0 全部 1 待支付 2 已支付 3退款 -->
|
||||
if (this.TabCur === 0) {
|
||||
console.log('这里是0')
|
||||
if (this.load.loadStatus3 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore3 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
} else if (this.TabCur === 1) {
|
||||
console.log('这里是1')
|
||||
if (this.load.loadStatus2 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore2 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
} else if (this.TabCur === 2) {
|
||||
console.log('这里是2')
|
||||
if (this.load.loadStatus1 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore1 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
} else if (this.TabCur === 3) {
|
||||
console.log('这里是3')
|
||||
if (this.load.loadStatus4 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore4 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
}
|
||||
},
|
||||
tabSelect(e) {
|
||||
this.TabCur = e.currentTarget.dataset.id;
|
||||
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
|
||||
// console.log('tabSelect时间')
|
||||
this.loadMoreOrder('tabSelect')
|
||||
},
|
||||
pickSource(e) {
|
||||
console.log(e)
|
||||
this.indexSource = parseInt( e.detail.value)
|
||||
console.log(this.indexSource)
|
||||
this.activeSource = this.sources[this.indexSource]
|
||||
console.log(this.activeSource )
|
||||
uni.setStorageSync('orderType', this.indexSource)
|
||||
this.pageNumber1 = 0
|
||||
this.pageNumber2 = 0
|
||||
this.pageNumber3 = 0
|
||||
this.pageNumber4 = 0
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.allOrder = []
|
||||
this.refundOrder = []
|
||||
this.finishedOrder = []
|
||||
this.payingOrder = []
|
||||
this.calcIstate(this.TabCur)
|
||||
},
|
||||
calcIstate(id) {
|
||||
switch (id) {
|
||||
case 0:
|
||||
this.istate = -3
|
||||
this.loadList(this.istate, this.pageNumber3, 'calcIstate全部')
|
||||
break
|
||||
case 1:
|
||||
this.istate = 0
|
||||
this.loadList(this.istate, this.pageNumber2, 'calcIstate待支付')
|
||||
break
|
||||
case 2:
|
||||
this.istate = 1
|
||||
this.loadList(this.istate, this.pageNumber1, 'calcIstate已支付')
|
||||
break
|
||||
case 3:
|
||||
this.istate = -2
|
||||
this.loadList(this.istate, this.pageNumber4, 'calcIstate退款')
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList(istate, pageNumber, from) {
|
||||
// console.log(istate)
|
||||
// console.log(pageNumber)
|
||||
// console.log(from)
|
||||
console.log( this.startTime)
|
||||
console.log( this.endTime)
|
||||
let that = this
|
||||
const data2 = {
|
||||
istate: istate, //类型:Number 必有字段 备注:订单状态 0待支付 1支付成功 查所有传 ''
|
||||
pageIndex: pageNumber ,//类型:Number 必有字段 备注:查询第几页,默认一页10条
|
||||
startTime: that.startTime,
|
||||
endTime: that.endTime
|
||||
}
|
||||
console.log('这里是this.indexSource',this.indexSource)
|
||||
if (this.indexSource == 0) {
|
||||
// 网页版
|
||||
if (data2.istate == -3) {
|
||||
data2.istate = ''
|
||||
} else if (data2.istate == -2) {
|
||||
data2.istate = 3
|
||||
}
|
||||
console.log(data2)
|
||||
oliSiteApi.getNewItemSiteOrder(data2).then(res => {
|
||||
console.log(res)
|
||||
console.log('-----------------------------------------')
|
||||
// console.log('参数', data2.istate, '页码', data2.pageIndex, '来源', from)
|
||||
if (res.code === 20000) {
|
||||
switch (istate) {
|
||||
case -3:
|
||||
console.log('获取全部')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.allOrder = this.allOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore1 = true
|
||||
this.load.loadStatus1 = 'nomore'
|
||||
} else if (res.data.length == 10) {
|
||||
this.pageNumber1++
|
||||
this.load.isLoadMore1 = false
|
||||
}
|
||||
break
|
||||
case -2:
|
||||
console.log('退款')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.refundOrder = this.refundOrder.concat(res.data)
|
||||
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore4 = true
|
||||
this.load.loadStatus4 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber4++
|
||||
this.load.isLoadMore4 = false
|
||||
}
|
||||
break
|
||||
case 0:
|
||||
console.log('待支付')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.payingOrder = this.payingOrder.concat(res.data)
|
||||
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore2 = true
|
||||
this.load.loadStatus2 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber2++
|
||||
this.load.isLoadMore2 = false
|
||||
}
|
||||
break
|
||||
case 1:
|
||||
console.log('已支付')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.finishedOrder = this.finishedOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore3 = true
|
||||
this.load.loadStatus3 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber3++
|
||||
this.load.isLoadMore3 = false
|
||||
}
|
||||
break
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else if (this.indexSource == 1) {
|
||||
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
// 小程序
|
||||
if (data2.istate == -3) {
|
||||
data2.istate = ''
|
||||
} else if (data2.istate == -2) {
|
||||
data2.istate = 3
|
||||
}
|
||||
console.log(data2)
|
||||
oliSiteApi.getNewItemSiteOrder(data2).then(res => {
|
||||
console.log(res)
|
||||
console.log('+++++++++++++++++++++++++++++++++++++++++')
|
||||
// console.log(data2.istate, data2.pageIndex)
|
||||
if (res.code === 20000) {
|
||||
switch (istate) {
|
||||
case 1:
|
||||
console.log('获取全部')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
|
||||
this.allOrder = this.allOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore1 = true
|
||||
this.load.loadStatus1 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber1++
|
||||
this.load.isLoadMore1 = false
|
||||
}
|
||||
break
|
||||
|
||||
case -2:
|
||||
console.log('退款')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.refundOrder = this.refundOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore4 = true
|
||||
this.load.loadStatus4 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber4++
|
||||
this.load.isLoadMore4 = false
|
||||
}
|
||||
break
|
||||
case 0:
|
||||
console.log('待支付')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.payingOrder = this.payingOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore2 = true
|
||||
this.load.loadStatus2 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber2++
|
||||
this.load.isLoadMore2 = false
|
||||
}
|
||||
break
|
||||
case -3:
|
||||
console.log('全部')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
|
||||
this.finishedOrder = this.finishedOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore3 = true
|
||||
this.load.loadStatus3 = 'nomore'
|
||||
} else if (res.data.length == 10) {
|
||||
this.pageNumber3++
|
||||
this.load.isLoadMore3 = false
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.order-list .order-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.placeholder-hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.fixed-t {
|
||||
position: fixed;
|
||||
width: 750upx;
|
||||
z-index: 3;
|
||||
}
|
||||
</style>
|
||||
451
packageOrders/pages/orderList/orderList.vue
Normal file
451
packageOrders/pages/orderList/orderList.vue
Normal file
@@ -0,0 +1,451 @@
|
||||
<template>
|
||||
<view class="content my-bg">
|
||||
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">加油记录</block>
|
||||
</cu-custom>
|
||||
<view class="fixed-t">
|
||||
<view class="flex bg-main-oil padding solid-bottom">
|
||||
<!-- <view class="flex-sub">
|
||||
订单来源
|
||||
</view> -->
|
||||
<!-- <view class="flex-treble text-right">
|
||||
<picker @change="pickSource" mode="selector" :value="indexSource" :range="sources">
|
||||
<view class="picker">
|
||||
{{activeSource}}
|
||||
<text class="cuIcon-right"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view> -->
|
||||
</view>
|
||||
<scroll-view scroll-x class="bg-white nav">
|
||||
<view class="flex text-center">
|
||||
<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''"
|
||||
v-for="(item,index) in tabList" :key="index" @tap="tabSelect" :data-id="index">{{item}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- <view class="placeholder-hidden">
|
||||
<view class="flex bg-main-oil padding solid-bottom">
|
||||
<view class="flex-sub">
|
||||
订单来源
|
||||
</view>
|
||||
<view class="flex-treble text-right">
|
||||
<picker @change="pickSource" mode="selector" :value="indexSource" :range="sources">
|
||||
<view class="picker">
|
||||
{{sources[indexSource]}}
|
||||
<text class="cuIcon-right"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-x class="bg-white nav">
|
||||
<view class="flex text-center">
|
||||
<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''"
|
||||
v-for="(item,index) in tabList" :key="index" @tap="" :data-id="index">{{item}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
<view class="padding padding-bottom-0" style="padding-top: 200upx;">
|
||||
<!-- 0 全部 1 待支付 2 已支付 3退款 -->
|
||||
<view v-show="TabCur==2" class="order-list">
|
||||
<view v-for="(item,index) in allOrder" v-if="allOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="allOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore1">
|
||||
<uni-load-more :status="load.loadStatus1"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="TabCur==1" class="order-list">
|
||||
<view v-for="(item,index) in payingOrder" v-if="payingOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="payingOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore2">
|
||||
<uni-load-more :status="load.loadStatus2"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="TabCur==0" class="order-list">
|
||||
<view v-for="(item,index) in finishedOrder" v-if="finishedOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="finishedOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore3">
|
||||
<uni-load-more :status="load.loadStatus3"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="TabCur==3" class="order-list">
|
||||
<view v-for="(item,index) in refundOrder" v-if="refundOrder.length" :key='index'>
|
||||
<OrderItem :indexSource="indexSource" class="cu-list order-item menu-avatar comment" :item="item" />
|
||||
</view>
|
||||
<view v-if="refundOrder.length<1">
|
||||
<Empty />
|
||||
</view>
|
||||
<view v-show="load.isLoadMore4">
|
||||
<uni-load-more :status="load.loadStatus4"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import oliSiteApi from '@/api/oli-site.js'
|
||||
import OrderItem from '@/packageOrders/components/order-item.vue'
|
||||
import UniLoadMore from '@/components/uni-load-more/uni-load-more.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
OrderItem,
|
||||
|
||||
UniLoadMore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
startTime:'',
|
||||
endTime:"",
|
||||
activeSource: '小程序',
|
||||
indexSource: 1,
|
||||
sources: ['网页版', '小程序'],
|
||||
tabList: [
|
||||
'全部','待支付', '已支付 ', '退款'
|
||||
],
|
||||
TabCur: 0,
|
||||
pageNumber: 1,
|
||||
istate: -3,
|
||||
scrollLeft: 0,
|
||||
order: {
|
||||
istate: 0,
|
||||
vol: 3,
|
||||
oilName: '0#',
|
||||
orderID: '15979997825872',
|
||||
oilCode: '12396989',
|
||||
oilSiteName: '疯疯疯加油站',
|
||||
carNo: '皖A12354',
|
||||
sourceType: 3,
|
||||
realamount: 4.66,
|
||||
credateDatetime: '2020-10-12 12:30:10'
|
||||
},
|
||||
allOrder: [],
|
||||
finishedOrder: [],
|
||||
refundOrder: [],
|
||||
payingOrder: [],
|
||||
loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
||||
isLoadMore: false, //是否加载中
|
||||
pageNumber1: 0,
|
||||
pageNumber2: 0,
|
||||
pageNumber3: 0,
|
||||
pageNumber4: 0,
|
||||
load: {
|
||||
isLoadMore1: false,
|
||||
loadStatus1: 'loading',
|
||||
isLoadMore2: false,
|
||||
loadStatus2: 'loading',
|
||||
isLoadMore3: false,
|
||||
loadStatus3: 'loading',
|
||||
isLoadMore4: false,
|
||||
loadStatus4: 'loading',
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getTime()
|
||||
this.loadList(-3, this.pageNumber1, 'created')
|
||||
this.loadList(0, this.pageNumber2, 'created')
|
||||
this.loadList(1, this.pageNumber3, 'created')
|
||||
this.loadList(-2, this.pageNumber4, 'created')
|
||||
},
|
||||
onLoad() {
|
||||
uni.setStorageSync('orderType', 1)
|
||||
},
|
||||
onReachBottom() { //上拉触底函数
|
||||
// console.log('触底函数')
|
||||
this.loadMoreOrder('onReachBottom')
|
||||
},
|
||||
methods: {
|
||||
getTime(){
|
||||
let nowDate = new Date();
|
||||
let year = nowDate.getFullYear();
|
||||
let month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
|
||||
let day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
|
||||
let hr = nowDate.getHours()
|
||||
let mf = nowDate.getMinutes() < 10 ? '0' + nowDate.getMinutes() : nowDate.getMinutes()
|
||||
let ss =nowDate.getSeconds() < 10 ? '0' + nowDate.getSeconds() :nowDate.getSeconds()
|
||||
this.startTime = year + "-" + month + "-" + day+" " + '00:00:00';
|
||||
this.endTime = year + "-" + month + "-" + day+" " +hr+':'+mf+':'+ss
|
||||
},
|
||||
loadMoreOrder(from) {
|
||||
// console.log(from,'loadMoreOrder时间')
|
||||
// <!-- 0 全部 1 待支付 2 已支付 3退款 -->
|
||||
if (this.TabCur === 0) {
|
||||
console.log('这里是0')
|
||||
if (this.load.loadStatus3 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore3 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
} else if (this.TabCur === 1) {
|
||||
console.log('这里是1')
|
||||
if (this.load.loadStatus2 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore2 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
} else if (this.TabCur === 2) {
|
||||
console.log('这里是2')
|
||||
if (this.load.loadStatus1 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore1 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
} else if (this.TabCur === 3) {
|
||||
console.log('这里是3')
|
||||
if (this.load.loadStatus4 != 'nomore') { //此处判断,上锁,防止重复请求
|
||||
this.load.isLoadMore4 = true
|
||||
this.calcIstate(this.TabCur)
|
||||
}
|
||||
}
|
||||
},
|
||||
tabSelect(e) {
|
||||
this.TabCur = e.currentTarget.dataset.id;
|
||||
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
|
||||
// console.log('tabSelect时间')
|
||||
this.loadMoreOrder('tabSelect')
|
||||
},
|
||||
pickSource(e) {
|
||||
console.log(e)
|
||||
this.indexSource = parseInt( e.detail.value)
|
||||
console.log(this.indexSource)
|
||||
this.activeSource = this.sources[this.indexSource]
|
||||
console.log(this.activeSource )
|
||||
uni.setStorageSync('orderType', this.indexSource)
|
||||
this.pageNumber1 = 0
|
||||
this.pageNumber2 = 0
|
||||
this.pageNumber3 = 0
|
||||
this.pageNumber4 = 0
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.load.isLoadMore1 = false
|
||||
this.load.loadStatus1 = 'load'
|
||||
this.allOrder = []
|
||||
this.refundOrder = []
|
||||
this.finishedOrder = []
|
||||
this.payingOrder = []
|
||||
this.calcIstate(this.TabCur)
|
||||
},
|
||||
calcIstate(id) {
|
||||
switch (id) {
|
||||
case 0:
|
||||
this.istate = -3
|
||||
this.loadList(this.istate, this.pageNumber3, 'calcIstate全部')
|
||||
break
|
||||
case 1:
|
||||
this.istate = 0
|
||||
this.loadList(this.istate, this.pageNumber2, 'calcIstate待支付')
|
||||
break
|
||||
case 2:
|
||||
this.istate = 1
|
||||
this.loadList(this.istate, this.pageNumber1, 'calcIstate已支付')
|
||||
break
|
||||
case 3:
|
||||
this.istate = -2
|
||||
this.loadList(this.istate, this.pageNumber4, 'calcIstate退款')
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList(istate, pageNumber, from) {
|
||||
// console.log(istate)
|
||||
// console.log(pageNumber)
|
||||
// console.log(from)
|
||||
console.log( this.startTime)
|
||||
console.log( this.endTime)
|
||||
let that = this
|
||||
const data2 = {
|
||||
istate: istate, //类型:Number 必有字段 备注:订单状态 0待支付 1支付成功 查所有传 ''
|
||||
pageIndex: pageNumber ,//类型:Number 必有字段 备注:查询第几页,默认一页10条
|
||||
// startTime: that.startTime,
|
||||
// endTime: that.endTime
|
||||
}
|
||||
console.log('这里是this.indexSource',this.indexSource)
|
||||
if (this.indexSource == 0) {
|
||||
// 网页版
|
||||
if (data2.istate == -3) {
|
||||
data2.istate = ''
|
||||
} else if (data2.istate == -2) {
|
||||
data2.istate = 3
|
||||
}
|
||||
console.log(data2)
|
||||
oliSiteApi.getNewItemSiteOrder(data2).then(res => {
|
||||
console.log(res)
|
||||
console.log('-----------------------------------------')
|
||||
// console.log('参数', data2.istate, '页码', data2.pageIndex, '来源', from)
|
||||
if (res.code === 20000) {
|
||||
switch (istate) {
|
||||
case -3:
|
||||
console.log('获取全部')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.allOrder = this.allOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore1 = true
|
||||
this.load.loadStatus1 = 'nomore'
|
||||
} else if (res.data.length == 10) {
|
||||
this.pageNumber1++
|
||||
this.load.isLoadMore1 = false
|
||||
}
|
||||
break
|
||||
case -2:
|
||||
console.log('退款')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.refundOrder = this.refundOrder.concat(res.data)
|
||||
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore4 = true
|
||||
this.load.loadStatus4 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber4++
|
||||
this.load.isLoadMore4 = false
|
||||
}
|
||||
break
|
||||
case 0:
|
||||
console.log('待支付')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.payingOrder = this.payingOrder.concat(res.data)
|
||||
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore2 = true
|
||||
this.load.loadStatus2 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber2++
|
||||
this.load.isLoadMore2 = false
|
||||
}
|
||||
break
|
||||
case 1:
|
||||
console.log('已支付')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.finishedOrder = this.finishedOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore3 = true
|
||||
this.load.loadStatus3 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber3++
|
||||
this.load.isLoadMore3 = false
|
||||
}
|
||||
break
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else if (this.indexSource == 1) {
|
||||
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
// 小程序
|
||||
if (data2.istate == -3) {
|
||||
data2.istate = ''
|
||||
} else if (data2.istate == -2) {
|
||||
data2.istate = 3
|
||||
}
|
||||
console.log(data2)
|
||||
oliSiteApi.getNewItemSiteOrder(data2).then(res => {
|
||||
console.log(res)
|
||||
console.log('+++++++++++++++++++++++++++++++++++++++++')
|
||||
// console.log(data2.istate, data2.pageIndex)
|
||||
if (res.code === 20000) {
|
||||
switch (istate) {
|
||||
case 1:
|
||||
console.log('获取全部')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
|
||||
this.allOrder = this.allOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore1 = true
|
||||
this.load.loadStatus1 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber1++
|
||||
this.load.isLoadMore1 = false
|
||||
}
|
||||
break
|
||||
|
||||
case -2:
|
||||
console.log('退款')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.refundOrder = this.refundOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore4 = true
|
||||
this.load.loadStatus4 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber4++
|
||||
this.load.isLoadMore4 = false
|
||||
}
|
||||
break
|
||||
case 0:
|
||||
console.log('待支付')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
this.payingOrder = this.payingOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore2 = true
|
||||
this.load.loadStatus2 = 'nomore'
|
||||
} else {
|
||||
this.pageNumber2++
|
||||
this.load.isLoadMore2 = false
|
||||
}
|
||||
break
|
||||
case -3:
|
||||
console.log('全部')
|
||||
console.log(res.data)
|
||||
console.log(this.allOrder)
|
||||
|
||||
this.finishedOrder = this.finishedOrder.concat(res.data)
|
||||
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.load.isLoadMore3 = true
|
||||
this.load.loadStatus3 = 'nomore'
|
||||
} else if (res.data.length == 10) {
|
||||
this.pageNumber3++
|
||||
this.load.isLoadMore3 = false
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.order-list .order-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.placeholder-hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.fixed-t {
|
||||
position: fixed;
|
||||
width: 750upx;
|
||||
z-index: 3;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user