Commit 0056fa75 authored by qipeng's avatar qipeng

增加清除

parent 38606547
<template>
<view class="productBigBox">
<view class="product-SearchBox">
<!--头部切换-->
<view class="product-orderState">
<view class="orderState-click" :class="orderStatus===''?'orderState-clickAct':''" @click="screenChange('')">
全部
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus==='0'?'orderState-clickAct':''" @click="screenChange('0')">
待付款
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='2'?'orderState-clickAct':''" @click="screenChange('2')">
待使用
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='3'?'orderState-clickAct':''" @click="screenChange('3')">
待收货
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='5'?'orderState-clickAct':''" @click="screenChange('5')">
待评价
<view class="click-line">
<text></text>
</view>
</view>
</view>
<!--查询-->
<view class="product-searchBt">
<view class="searchBt-left" @click="orderShow=true">
<text>{{orderName}}</text>
<u-icon v-if="orderShow==false" name="arrow-down" color="#333333" size="20"></u-icon>
<u-icon v-else name="arrow-up" color="#333333" size="20"></u-icon>
<u-picker mode="selector" :show="orderShow" :default-selector="[orderType]" :columns="option" keyName="cateName" @confirm="industrysTypeConfirm($event)" @cancel="cancel"></u-picker>
</view>
<text @click="showQueryPhone()">手机查询</text>
</view>
</view>
<!--手机查询遮罩-->
<u-popup mode="bottom" :show="phoneQuery">
<view class="content">
<view class="content-title">
订单查询
<u-icon name="close" color="#333333" size="28" @click="phoneQuery=false"></u-icon>
</view>
<view class="content-list">
<text class="list-name">手机号码</text>
<text class="list-name2"></text>
<input class="uni-input" v-model.trim="touristPhone" />
</view>
<view class="content-list">
<text class="list-name">姓名</text>
<text class="list-name2"></text>
<input class="uni-input" v-model.trim="touristName" />
</view>
<view class="confrim-btn">
<u-button @click="queryPhoneOrder()">查询</u-button>
</view>
</view>
</u-popup>
<!--列表-->
<view class="product-goods" v-if="lists.length>0">
<template v-for="(item,index) in lists">
<view class="product-block" :key="index" v-if="item.showList" @click="orderJump(item.id,item.orderType)">
<view class="block-title">
<view class="title-left">
<view class="left-imgBox" v-if="item.orderType==1">
<image class="left-img" src="../../static/orderList/iconjingqumenpiao.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==2">
<image class="left-img" src="../../static/orderList/iconjiudian.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==3">
<image class="left-img" src="../../static/orderList/iconcanyin.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==4">
<image class="left-img" src="../../static/orderList/iconliwu1.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==5">
<image class="left-img" src="../../static/orderList/iconchuzuche.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==10">
<image class="left-img" src="../../static/orderList/iconzuhe.png"></image>
</view>
<view class="left-imgBox" v-else>
<image class="left-img" src="../../static/orderList/iconqita.png"></image>
</view>
<text class="left-Name">{{item.merchantName}}({{item.productName}})</text>
</view>
<view class="title-right" v-if="item.orderType!=10&&item.orderType!=0">
<template v-if="item.orderType==1&&item.subOrderType!=4">
{{item.orderStatus|orderStatus1}}
</template>
<template v-else-if="item.orderType==2&&item.subOrderType!=4">
{{item.orderStatus|orderStatus2}}
</template>
<template v-else-if="item.orderType==3&&item.subOrderType!=4">
{{item.orderStatus|orderStatus3}}
</template>
<template v-else-if="item.orderType==4&&item.subOrderType!=4">
{{item.orderStatus|orderStatus4}}
</template>
<template v-else>
{{item.orderStatus|orderStatus5}}
</template>
</view>
</view>
<view class="block-main">
<view class="mian-InfoWrap">
<view class="InfoWrap-mb30">订单时间:{{item.playDate.substr(0,10)}}</view>
<view>
购买数量:
<template v-if="item.orderType==1&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==2&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==3&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==4&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==10&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else>{{item.orderNum}}</template>
</view>
<view class="allPice">
<text>¥</text>{{item.totalMoney}}
</view>
</view>
<view class="main-right">
<u-icon name="arrow-right" color="#333333" size="28"></u-icon>
</view>
</view>
<view class="block-Btn">
<view class="block-button" @click.stop="operation(item,index)" v-if="item.orderStatus==9||item.orderStatus==10">删除</view>
<view class="block-button" @click.stop="operation(item,index)" v-if="item.orderStatus==0">取消订单</view>
<template v-if="item.orderType==4"><!--特产-->
<view class="block-button" v-if="item.orderStatus==1||item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10" @click.stop="orderJump(item.id,item.orderType)">查看详情</view>
<view class="block-button" v-if="item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10">查看物流</view>
<!-- <view class="block-button" v-if="item.orderStatus==5">评价</view> -->
</template>
<template v-else>
<template v-if="item.subOrderType!=4">
<view class="block-button" v-if="item.orderStatus==1||item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10" @click.stop="orderJump(item.id,item.orderType)">{{item.orderStatus==2?'去使用':'查看详情'}}</view>
</template>
<view class="block-button" v-if="item.orderStatus==2&&item.isRefund!=0||item.orderStatus==7&&item.isRefund!=0" @click.stop="refundJump(item.id)">退款/售后</view>
<!-- <view class="block-button" v-if="item.orderStatus==5">评价</view> -->
</template>
<view class="block-button block-buttonOrange" v-if="item.orderStatus==0">去支付</view>
</view>
</view>
</template>
<view class="goods-NoMore" v-if="dataLengthType==true">暂无更多数据</view>
</view>
<view class="product-goods" v-else>
<view class="order-No">暂无订单信息</view>
</view>
<!-- <u-toast ref="uToast" /> -->
<u-modal :show="configShow" show-cancel-button="true" :content="configTitle" @confirm="operationEnter()" @cancel="operationClose()"></u-modal>
</view>
</template>
<script>
// import uPicker from '@/uview-ui/components/u-picker/u-picker.vue'
// import uPopup from '@/uview-ui/components/u-popup/u-popup.vue'
// import uToast from '@/uview-ui/components/u-toast/u-toast.vue'
// import uModal from '@/uview-ui/components/u-modal/u-modal.vue'
export default {
filters:{
orderType(i){//订单类型
switch(i){
case 0:
return '其他'
break
case 1:
return '景区'
break
case 2:
return '酒店'
break
case 3:
return '餐饮'
break
case 4:
return '特产'
case 5:
return '运营车'
case 10:
return '组合订单'
}
},
orderStatus1(i){//景区订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '出票中'
break
case 2:
return '出票成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '核销完成'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
case 12:
return '退票审核中 '
break
}
},
orderStatus2(i){//酒店订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus3(i){//餐饮订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus4(i){//特产状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '待发货'
break
case 2:
return '待收货'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '已收货'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus5(i){
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '支付成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
}
},
components: {
// uPicker,
// uPopup,
// uToast,
// uModal
},
data() {
return {
queryLoad:false,//查询加载图标显示隐藏
phoneQuery:false,//手机查询显示隐藏
touristPhone:'',//旅客电话
touristName:'',//旅客姓名
orderStatus:'',//订单状态
nodataShow:false,//没有数据时展示
lists:[],//数据
orderType:0,//筛选 //1景区,2酒店,3餐饮,4特产,5运营车,10组合订单
orderName:'全部',//筛选 //1景区,2酒店,3餐饮,4特产,5运营车,10组合订单
orderShow:false,
option: [[
{ cateName: '全部', id: 0 },
{ cateName: '景区', id: 1 },
{ cateName: '酒店', id: 2 },
{ cateName: '餐饮', id: 3 },
{ cateName: '特产', id: 4 },
// { cateName: '运营车', id: 5 },
// { cateName: '组合订单', id: 10 },
]],
isTrue:true,//截留 防止重复加载
pageIndex:1,//当前页
pageTotal:0,//总条数
configShow:false,//删除订单确认框
configTitle:'',//弹窗title
operationItem:null,//操作项的数据 删除和取消订单
operationIndex:null,//操作下标
callbackurl:'',//回调页面
ifNotice:'',//是否通知
openId:'',
ifyukuaiCode:'',//渝快付
dataLengthType:false,//上拉加载无更多数据时显示
}
},
onLoad(option) {
this.openId = uni.getStorageSync('openid')
//this.openId = 'oh2UV1lyYABHMZ1rMlgjhVHyyYDQ'//oh2UV1lyYABHMZ1rMlgjhVHyyYDQ oroHZ5FaUQ_SOOC_uQQP92fJpBRE
this.orderStatus = option.orderStatus||''
this.ifyukuaiCode = option.ifyukuaiCode||''
this.getData(1)
},
onShow(){
this.pageIndex = 1
this.getData(1)
},
methods: {
screenChange(i){//顶部导航切换
this.orderStatus = i
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists = []
this.getData(1)
},
industrysTypeConfirm(e) {//单列----分类 点击确定
console.log('confirm', e)
this.orderType = e.value[0].id
this.orderName = e.value[0].cateName
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists = []
this.getData(1)
this.cancel()
},
cancel() {//单列 点击取消
this.orderShow = false
},
showQueryPhone(){//展示手机查询弹窗
this.touristPhone=''
this.touristName=''
this.phoneQuery=true
},
queryPhoneOrder(){//通过手机号查看订单
if(!(/^1[34578]\d{9}$/.test(this.touristPhone))){
uni.showToast({
title: '请填写正确的手机号码',
icon: 'none'
})
return
}
if(this.touristName==''){
uni.showToast({
title: '姓名不可为空',
icon: 'none'
})
return
}
let data={
openid:this.openId,//用户Id
touristPhone:this.touristPhone,//旅客电话
touristName:this.touristName,//旅客姓名
}
this.queryLoad=true
this.$request('order/pdOrder/findOrderInfoByPhone',data).then((res)=>{
this.queryLoad=false
if(res.code=='00'){
this.phoneQuery=false
// uni.navigateTo({
// url: '/pages/my/order/productList/productList'
// })
this.pageIndex = 1
this.getData(1)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
getData(flag){//获取订单列表
this.nodataShow = false
//显示加载框
uni.showLoading({
title: '加载中'
})
if(this.isTrue){
this.isTrue = false
if(this.orderStatus=='2'){//点击的待使用
var orderStatusList=[2,4,5]
var data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatusList :orderStatusList,
userId:this.openId
}
}else{
var data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatus:this.orderStatus=='3'?2:parseFloat(this.orderStatus),
userId:this.openId
}
}
this.$request('order/userOrder/findOrderList',data)
.then((res)=>{
var ret = res
if(ret.code=='00'){
if(flag==1){//第一次加载
this.lists = []
}
if(ret.data.list.length>0){
this.dataLengthType = true
}else{
this.dataLengthType = false
}
ret.data.list.forEach((item)=>{
if(this.orderStatus=='0'){////待付款的订单 pid 不能空的不显示
if(item.pid){
}else{
this.lists.push(item)
}
}else if(this.orderStatus=='2'){//待评价和待使用不能显示组合订单
if(item.orderType!=10&&item.orderType!=4){
this.lists.push(item)
}
}else if(this.orderStatus=='3'){//待收货和待使用不能显示组合订单
if(item.orderType!=10&&item.orderType==4){
this.lists.push(item)
}
}else if(this.orderStatus=='5'){//待评价不能显示组合订单
if(item.orderType!=10){
this.lists.push(item)
}
}else{
if(item.isDelete!=1){//( 0 未删除 1 已删除)
this.lists.push(item)
}
}
})
this.isTrue = true
this.pageIndex++
this.pageTotal = ret.data.pageTotal
if(this.lists.length==0){
this.nodataShow = true
}
// 主订单显示待支付子订单显示除了待支付
this.lists.forEach((item)=>{
if(item.subOrderType!=9){
if(item.orderType==10&&item.orderStatus==0){
item.showList=true
}
if(item.orderType!=10&&item.orderStatus!=0){
item.showList=true
}
}
})
//隐藏加载框
uni.hideLoading()
}else{
uni.showToast({
title: '暂无订单信息',
icon: 'none'
})
}
})
.catch((err)=>{
setTimeout(()=>{
this.getData(2)
},1000)
})
}
},
operation(item,index){//操作 删除和取消订单
this.operationItem = item
this.operationIndex = index
if(item.orderStatus==0){
this.configTitle = '确认取消订单'
}else{
this.configTitle = '确认删除订单'
}
this.configShow = true
},
operationEnter(){//操作 删除和取消订单 确定
if(this.operationItem.orderStatus==0){//取消订单
this.$request('order/userOrder/cancelOrder',{
id:this.operationItem.id,
userId:this.openId
})
.then((res)=>{
var ret = res
if(ret.code=='00'){
uni.showToast({
title: '订单取消成功',
icon: 'none'
})
//this.$store.commit('showLoading')
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists[this.operationIndex].orderStatus = 9
// this.lists = []
// this.getData(1)
this.configShow = false
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}else{//删除订单
this.$request('order/userOrder/deleteOrder',{
id:this.operationItem.id,
userId:this.openId
})
.then((res)=>{
var ret = res
if(ret.code=='00'){
uni.showToast({
title: '订单删除成功',
icon: 'none'
})
//this.$store.commit('showLoading')
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists.splice(this.operationIndex,1)
// this.lists = []
// this.getData(1)
this.configShow = false
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
},
operationClose(){//操作 删除和取消订单 取消
this.configShow =false
},
orderJump(orderId,orderType){//-------------------订单详情跳转
if(orderType==11||orderType==12){
uni.navigateTo({
url: '/pages/album/albumOrderdetail/albumOrderdetail?orderId='+orderId
})
}else{
uni.navigateTo({
url: '/pages/my/order/electronicTicket/electronicTicket?orderId='+orderId
})
}
},
refundJump(id){//-------------------退款
uni.navigateTo({
url: '/pages/my/order/afterSale/applyAfterSale/applyAfterSale?orderId='+id+'&ifyukuaiCode='+this.ifyukuaiCode
})
},
},
onReachBottom(){//上拉加载
this.pageIndex++
this.getData(2)
},
}
</script>
<style scoped lang="scss">
page{
background-color: #f5f5f5;
}
.productBigBox{
background-color: #f5f5f5;
min-height: 100vh;
}
.product-SearchBox{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 20;
}
.product-title{
display: flex;
justify-content: center;
width: 100%;
height: 80rpx;
background-color: #fff;
font-size: 32rpx;
font-weight: bold;
line-height: 80rpx;
text-align: center;
u-icon{
height: 80rpx;
position: absolute;
left: 24rpx;
top: 0;
bottom: 0;
}
}
.product-orderState{
display: flex;
justify-content: space-between;
width: 100%;
padding: 0 24rpx;
background-color: #fff;
.orderState-click{
display: flex;
justify-content: center;
width: 100rpx;
height: 80rpx;
align-items: center;
color: #999999;
font-size: 28rpx;
position: relative;
.click-line{
display: none;
width: 55%;
height: 4rpx;
background-image: linear-gradient(to right, #9FCFFF , #DAE6F6);
margin: auto;
position: absolute;
bottom: 12rpx;
left: 0;
right: 0;
}
}
.orderState-clickAct{
color: #191919;
font-size: 32rpx;
font-weight: bold;
.click-line{
display: inline-block;
}
}
}
.product-searchBt{
width: 100%;
height: 80rpx;
box-shadow: 0 0 0;
display: flex;
background-color:#fff;
justify-content: space-between;
padding: 0 30rpx;
line-height: 80rpx;
box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.08);
.searchBt-left{
display: flex;
width: 100rpx;
justify-content: center;
text:nth-child(1){
margin-right: 5rpx;
}
}
}
.content-title{
display: flex;
justify-content: center;
height: 80rpx;
line-height: 80rpx;
position: relative;
font-size: 32rpx;
font-weight: bold;
/deep/ .u-icon{
color: #c8c9cc;
position: absolute;
right: 16rpx;
top: 0;
bottom: 0;
}
}
.content-list{
display: flex;
padding: 0 24rpx 0 24rpx;
margin-top: 20rpx;
.list-name{
display: inline-block;
text-align: justify;
text-align-last: justify;
width: 110rpx;
font-size: 26rpx;
line-height: 40px;
flex-shrink: 0;
}
.list-name2{
line-height: 40px;
}
.uni-input{
height: 40px;
border-bottom: 1px solid #d1d1d1;
flex: 1;
}
}
.confrim-btn{
margin: 64rpx 24rpx 40rpx 24rpx;
/deep/ .u-reset-button{
height: 80rpx;
line-height: 80rpx;
border-radius: 15rpx;
color: #FFFFFF;
text-align: center;
background: linear-gradient(134deg, #ED400C 0%, #FB862C 100%);
font-size: 28rpx;
border-radius: 8rpx;
border: none;
}
}
.product-goods{
padding: 30rpx;
padding-top: 200rpx;
overflow: auto;
position: relative;
.product-block{
border-radius: 5px;
margin-bottom: 20rpx;
background: #fff;
box-shadow: 0px 3px 0px rgba(0, 0, 0, 0.02);
.block-title{
padding: 30rpx 24rpx 25rpx 24rpx;
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.08);
display: flex;
justify-content: space-between;
font-size: 30rpx;
color: #333;
.title-left{
flex: 1;
display: flex;
align-items: center;
.left-imgBox{
width: 32rpx;
height: 32rpx;
display: flex;
margin-right: 16rpx;
border-radius: 3px;
flex-shrink: 0;
background-color: #FEB221;
}
.left-img{
display: inline-block;
width: 32rpx;
height: 32rpx;
}
.left-Name{
font-size: 0.32rem;
color: #191919;
font-weight: bold;
flex: 1;
font-size: 28rpx;
line-height: 36rpx;
}
}
.title-right{
width: 160rpx;
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 24rpx;
color: #ED400C;
}
}
.block-main{
display: flex;
height: 174rpx;
border-bottom: none;
color: #333333;
position: relative;
padding: 36rpx 24rpx 24rpx 24rpx;
.mian-InfoWrap{
display: flex;
flex: 1;
font-size: 30rpx;
color: #666666;
flex-wrap: wrap;
word-break: break-all;
margin-right: 20rpx;
flex-direction: column;
justify-content: center;
height: 100%;
.InfoWrap-mb30{
margin-bottom: 30rpx;
}
.allPice{
position: absolute;
left: 24rpx;
bottom: -80rpx;
color: #ED400C;
font-size: 40rpx;
font-weight: bold;
display: flex;
text{
font-size: 24rpx;
font-weight: normal;
margin-right: 4rpx;
line-height: 60rpx;
}
}
}
.main-right{
height: 100%;
display: flex;
align-items: center;
color: #6b6b6b;
}
}
.block-Btn{
display: flex;
justify-content: flex-end;
height: 100rpx;
align-items: center;
padding: 0 20rpx;
.block-button{
width: 152rpx;
height: 64rpx;
line-height: 64rpx;
color: #333333;
padding: 0;
text-align: center;
display: inline-block;
box-sizing: content-box;
font-size: 28rpx;
border: 1px solid #cccccc;
border-radius: 8rpx;
align-items: center;
margin-right: 15rpx;
}
.block-button:nth-last-child(1){
margin-right: 0;
}
.block-buttonOrange{
color: #f9690e;
border: 1px solid #f9690e;
}
}
}
.goods-NoMore{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
}
.order-No{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
margin: auto;
position: absolute;
top: 400;
right: 0;
bottom: 0;
left: 0;
}
}
<template>
<view class="productBigBox">
<view class="product-SearchBox">
<!--头部切换-->
<view class="product-orderState">
<view class="orderState-click" :class="orderStatus===''?'orderState-clickAct':''" @click="screenChange('')">
全部
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus==='0'?'orderState-clickAct':''" @click="screenChange('0')">
待付款
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='2'?'orderState-clickAct':''" @click="screenChange('2')">
待使用
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='3'?'orderState-clickAct':''" @click="screenChange('3')">
待收货
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='5'?'orderState-clickAct':''" @click="screenChange('5')">
待评价
<view class="click-line">
<text></text>
</view>
</view>
</view>
<!--查询-->
<view class="product-searchBt">
<view class="searchBt-left" @click="orderShow=true">
<text>{{orderName}}</text>
<u-icon v-if="orderShow==false" name="arrow-down" color="#333333" size="20"></u-icon>
<u-icon v-else name="arrow-up" color="#333333" size="20"></u-icon>
<u-picker mode="selector" :show="orderShow" :default-selector="[orderType]" :columns="option" keyName="cateName" @confirm="industrysTypeConfirm($event)" @cancel="cancel"></u-picker>
</view>
<text @click="showQueryPhone()">手机查询</text>
</view>
</view>
<!--手机查询遮罩-->
<u-popup mode="bottom" :show="phoneQuery">
<view class="content">
<view class="content-title">
订单查询
<u-icon name="close" color="#333333" size="28" @click="phoneQuery=false"></u-icon>
</view>
<view class="content-list">
<text class="list-name">手机号码</text>
<text class="list-name2"></text>
<input class="uni-input" v-model.trim="touristPhone" />
</view>
<view class="content-list">
<text class="list-name">姓名</text>
<text class="list-name2"></text>
<input class="uni-input" v-model.trim="touristName" />
</view>
<view class="confrim-btn">
<u-button @click="queryPhoneOrder()">查询</u-button>
</view>
</view>
</u-popup>
<!--列表-->
<view class="product-goods" v-if="lists.length>0">
<template v-for="(item,index) in lists">
<view class="product-block" :key="index" v-if="item.showList" @click="orderJump(item.id,item.orderType)">
<view class="block-title">
<view class="title-left">
<view class="left-imgBox" v-if="item.orderType==1">
<image class="left-img" src="../../static/orderList/iconjingqumenpiao.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==2">
<image class="left-img" src="../../static/orderList/iconjiudian.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==3">
<image class="left-img" src="../../static/orderList/iconcanyin.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==4">
<image class="left-img" src="../../static/orderList/iconliwu1.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==5">
<image class="left-img" src="../../static/orderList/iconchuzuche.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==10">
<image class="left-img" src="../../static/orderList/iconzuhe.png"></image>
</view>
<view class="left-imgBox" v-else>
<image class="left-img" src="../../static/orderList/iconqita.png"></image>
</view>
<text class="left-Name">{{item.merchantName}}({{item.productName}})</text>
</view>
<view class="title-right" v-if="item.orderType!=10&&item.orderType!=0">
<template v-if="item.orderType==1&&item.subOrderType!=4">
{{item.orderStatus|orderStatus1}}
</template>
<template v-else-if="item.orderType==2&&item.subOrderType!=4">
{{item.orderStatus|orderStatus2}}
</template>
<template v-else-if="item.orderType==3&&item.subOrderType!=4">
{{item.orderStatus|orderStatus3}}
</template>
<template v-else-if="item.orderType==4&&item.subOrderType!=4">
{{item.orderStatus|orderStatus4}}
</template>
<template v-else>
{{item.orderStatus|orderStatus5}}
</template>
</view>
</view>
<view class="block-main">
<view class="mian-InfoWrap">
<view class="InfoWrap-mb30">订单时间:{{item.playDate.substr(0,10)}}</view>
<view>
购买数量:
<template v-if="item.orderType==1&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==2&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==3&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==4&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==10&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else>{{item.orderNum}}</template>
</view>
<view class="allPice">
<text>¥</text>{{item.totalMoney}}
</view>
</view>
<view class="main-right">
<u-icon name="arrow-right" color="#333333" size="28"></u-icon>
</view>
</view>
<view class="block-Btn">
<view class="block-button" @click.stop="operation(item,index)" v-if="item.orderStatus==9||item.orderStatus==10">删除</view>
<view class="block-button" @click.stop="operation(item,index)" v-if="item.orderStatus==0">取消订单</view>
<template v-if="item.orderType==4"><!--特产-->
<view class="block-button" v-if="item.orderStatus==1||item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10" @click.stop="orderJump(item.id,item.orderType)">查看详情</view>
<view class="block-button" v-if="item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10">查看物流</view>
<!-- <view class="block-button" v-if="item.orderStatus==5">评价</view> -->
</template>
<template v-else>
<template v-if="item.subOrderType!=4">
<view class="block-button" v-if="item.orderStatus==1||item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10" @click.stop="orderJump(item.id,item.orderType)">{{item.orderStatus==2?'去使用':'查看详情'}}</view>
</template>
<view class="block-button" v-if="item.orderStatus==2&&item.isRefund!=0||item.orderStatus==7&&item.isRefund!=0" @click.stop="refundJump(item.id)">退款/售后</view>
<!-- <view class="block-button" v-if="item.orderStatus==5">评价</view> -->
</template>
<view class="block-button block-buttonOrange" v-if="item.orderStatus==0">去支付</view>
</view>
</view>
</template>
<view class="goods-NoMore" v-if="dataLengthType==true">暂无更多数据</view>
</view>
<view class="product-goods" v-else>
<view class="order-No">暂无订单信息</view>
</view>
<!-- <u-toast ref="uToast" /> -->
<u-modal :show="configShow" show-cancel-button="true" :content="configTitle" @confirm="operationEnter()" @cancel="operationClose()"></u-modal>
</view>
</template>
<script>
// import uPicker from '@/uview-ui/components/u-picker/u-picker.vue'
// import uPopup from '@/uview-ui/components/u-popup/u-popup.vue'
// import uToast from '@/uview-ui/components/u-toast/u-toast.vue'
// import uModal from '@/uview-ui/components/u-modal/u-modal.vue'
export default {
filters:{
orderType(i){//订单类型
switch(i){
case 0:
return '其他'
break
case 1:
return '景区'
break
case 2:
return '酒店'
break
case 3:
return '餐饮'
break
case 4:
return '特产'
case 5:
return '运营车'
case 10:
return '组合订单'
}
},
orderStatus1(i){//景区订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '出票中'
break
case 2:
return '出票成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '核销完成'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
case 12:
return '退票审核中 '
break
}
},
orderStatus2(i){//酒店订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus3(i){//餐饮订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus4(i){//特产状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '待发货'
break
case 2:
return '待收货'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '已收货'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus5(i){
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '支付成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
}
},
components: {
// uPicker,
// uPopup,
// uToast,
// uModal
},
data() {
return {
queryLoad:false,//查询加载图标显示隐藏
phoneQuery:false,//手机查询显示隐藏
touristPhone:'',//旅客电话
touristName:'',//旅客姓名
orderStatus:'',//订单状态
nodataShow:false,//没有数据时展示
lists:[],//数据
orderType:0,//筛选 //1景区,2酒店,3餐饮,4特产,5运营车,10组合订单
orderName:'全部',//筛选 //1景区,2酒店,3餐饮,4特产,5运营车,10组合订单
orderShow:false,
option: [[
{ cateName: '全部', id: 0 },
{ cateName: '景区', id: 1 },
{ cateName: '酒店', id: 2 },
{ cateName: '餐饮', id: 3 },
{ cateName: '特产', id: 4 },
// { cateName: '运营车', id: 5 },
// { cateName: '组合订单', id: 10 },
]],
isTrue:true,//截留 防止重复加载
pageIndex:1,//当前页
pageTotal:0,//总条数
configShow:false,//删除订单确认框
configTitle:'',//弹窗title
operationItem:null,//操作项的数据 删除和取消订单
operationIndex:null,//操作下标
callbackurl:'',//回调页面
ifNotice:'',//是否通知
openId:'',
ifyukuaiCode:'',//渝快付
dataLengthType:false,//上拉加载无更多数据时显示
timerOutClear:null,
}
},
onLoad(option) {
this.openId = uni.getStorageSync('openid')
//this.openId = 'oh2UV1lyYABHMZ1rMlgjhVHyyYDQ'//oh2UV1lyYABHMZ1rMlgjhVHyyYDQ oroHZ5FaUQ_SOOC_uQQP92fJpBRE
this.orderStatus = option.orderStatus||''
this.ifyukuaiCode = option.ifyukuaiCode||''
this.getData(1)
},
onShow(){
this.pageIndex = 1
this.getData(1)
},
methods: {
screenChange(i){//顶部导航切换
this.orderStatus = i
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists = []
this.getData(1)
},
industrysTypeConfirm(e) {//单列----分类 点击确定
console.log('confirm', e)
this.orderType = e.value[0].id
this.orderName = e.value[0].cateName
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists = []
this.getData(1)
this.cancel()
},
cancel() {//单列 点击取消
this.orderShow = false
},
showQueryPhone(){//展示手机查询弹窗
this.touristPhone=''
this.touristName=''
this.phoneQuery=true
},
queryPhoneOrder(){//通过手机号查看订单
if(!(/^1[34578]\d{9}$/.test(this.touristPhone))){
uni.showToast({
title: '请填写正确的手机号码',
icon: 'none'
})
return
}
if(this.touristName==''){
uni.showToast({
title: '姓名不可为空',
icon: 'none'
})
return
}
let data={
openid:this.openId,//用户Id
touristPhone:this.touristPhone,//旅客电话
touristName:this.touristName,//旅客姓名
}
this.queryLoad=true
this.$request('order/pdOrder/findOrderInfoByPhone',data).then((res)=>{
this.queryLoad=false
if(res.code=='00'){
this.phoneQuery=false
// uni.navigateTo({
// url: '/pages/my/order/productList/productList'
// })
this.pageIndex = 1
this.getData(1)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
getData(flag){//获取订单列表
this.nodataShow = false
//显示加载框
uni.showLoading({
title: '加载中'
})
if(this.isTrue){
this.isTrue = false
if(this.orderStatus=='2'){//点击的待使用
var orderStatusList=[2,4,5]
var data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatusList :orderStatusList,
userId:this.openId
}
}else{
var data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatus:this.orderStatus=='3'?2:parseFloat(this.orderStatus),
userId:this.openId
}
}
this.$request('order/userOrder/findOrderList',data)
.then((res)=>{
var ret = res
if(ret.code=='00'){
if(flag==1){//第一次加载
this.lists = []
}
if(ret.data.list.length>0){
this.dataLengthType = true
}else{
this.dataLengthType = false
}
ret.data.list.forEach((item)=>{
if(this.orderStatus=='0'){////待付款的订单 pid 不能空的不显示
if(item.pid){
}else{
this.lists.push(item)
}
}else if(this.orderStatus=='2'){//待评价和待使用不能显示组合订单
if(item.orderType!=10&&item.orderType!=4){
this.lists.push(item)
}
}else if(this.orderStatus=='3'){//待收货和待使用不能显示组合订单
if(item.orderType!=10&&item.orderType==4){
this.lists.push(item)
}
}else if(this.orderStatus=='5'){//待评价不能显示组合订单
if(item.orderType!=10){
this.lists.push(item)
}
}else{
if(item.isDelete!=1){//( 0 未删除 1 已删除)
this.lists.push(item)
}
}
})
this.isTrue = true
this.pageIndex++
this.pageTotal = ret.data.pageTotal
if(this.lists.length==0){
this.nodataShow = true
}
// 主订单显示待支付子订单显示除了待支付
this.lists.forEach((item)=>{
if(item.subOrderType!=9){
if(item.orderType==10&&item.orderStatus==0){
item.showList=true
}
if(item.orderType!=10&&item.orderStatus!=0){
item.showList=true
}
}
})
//隐藏加载框
uni.hideLoading()
}else{
uni.showToast({
title: '暂无订单信息',
icon: 'none'
})
}
})
.catch((err)=>{
this.timerOutClear = setTimeout(()=>{
this.getData(2)
},1000)
})
}
},
operation(item,index){//操作 删除和取消订单
this.operationItem = item
this.operationIndex = index
if(item.orderStatus==0){
this.configTitle = '确认取消订单'
}else{
this.configTitle = '确认删除订单'
}
this.configShow = true
},
operationEnter(){//操作 删除和取消订单 确定
if(this.operationItem.orderStatus==0){//取消订单
this.$request('order/userOrder/cancelOrder',{
id:this.operationItem.id,
userId:this.openId
})
.then((res)=>{
var ret = res
if(ret.code=='00'){
uni.showToast({
title: '订单取消成功',
icon: 'none'
})
//this.$store.commit('showLoading')
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists[this.operationIndex].orderStatus = 9
// this.lists = []
// this.getData(1)
this.configShow = false
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}else{//删除订单
this.$request('order/userOrder/deleteOrder',{
id:this.operationItem.id,
userId:this.openId
})
.then((res)=>{
var ret = res
if(ret.code=='00'){
uni.showToast({
title: '订单删除成功',
icon: 'none'
})
//this.$store.commit('showLoading')
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists.splice(this.operationIndex,1)
// this.lists = []
// this.getData(1)
this.configShow = false
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
},
operationClose(){//操作 删除和取消订单 取消
this.configShow =false
},
orderJump(orderId,orderType){//-------------------订单详情跳转
if(orderType==11||orderType==12){
uni.navigateTo({
url: '/pages/album/albumOrderdetail/albumOrderdetail?orderId='+orderId
})
}else{
uni.navigateTo({
url: '/pages/my/order/electronicTicket/electronicTicket?orderId='+orderId
})
}
},
refundJump(id){//-------------------退款
uni.navigateTo({
url: '/pages/my/order/afterSale/applyAfterSale/applyAfterSale?orderId='+id+'&ifyukuaiCode='+this.ifyukuaiCode
})
},
},
onReachBottom(){//上拉加载
this.pageIndex++
this.getData(2)
},
onUnload() {
if(this.timerOutClear) {
clearTimeout(this.timerOutClear)
this.timerOutClear = null
}
//隐藏加载框 uni.hideLoading()
},
}
</script>
<style scoped lang="scss">
page{
background-color: #f5f5f5;
}
.productBigBox{
background-color: #f5f5f5;
min-height: 100vh;
}
.product-SearchBox{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 20;
}
.product-title{
display: flex;
justify-content: center;
width: 100%;
height: 80rpx;
background-color: #fff;
font-size: 32rpx;
font-weight: bold;
line-height: 80rpx;
text-align: center;
u-icon{
height: 80rpx;
position: absolute;
left: 24rpx;
top: 0;
bottom: 0;
}
}
.product-orderState{
display: flex;
justify-content: space-between;
width: 100%;
padding: 0 24rpx;
background-color: #fff;
.orderState-click{
display: flex;
justify-content: center;
width: 100rpx;
height: 80rpx;
align-items: center;
color: #999999;
font-size: 28rpx;
position: relative;
.click-line{
display: none;
width: 55%;
height: 4rpx;
background-image: linear-gradient(to right, #9FCFFF , #DAE6F6);
margin: auto;
position: absolute;
bottom: 12rpx;
left: 0;
right: 0;
}
}
.orderState-clickAct{
color: #191919;
font-size: 32rpx;
font-weight: bold;
.click-line{
display: inline-block;
}
}
}
.product-searchBt{
width: 100%;
height: 80rpx;
box-shadow: 0 0 0;
display: flex;
background-color:#fff;
justify-content: space-between;
padding: 0 30rpx;
line-height: 80rpx;
box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.08);
.searchBt-left{
display: flex;
width: 100rpx;
justify-content: center;
text:nth-child(1){
margin-right: 5rpx;
}
}
}
.content-title{
display: flex;
justify-content: center;
height: 80rpx;
line-height: 80rpx;
position: relative;
font-size: 32rpx;
font-weight: bold;
/deep/ .u-icon{
color: #c8c9cc;
position: absolute;
right: 16rpx;
top: 0;
bottom: 0;
}
}
.content-list{
display: flex;
padding: 0 24rpx 0 24rpx;
margin-top: 20rpx;
.list-name{
display: inline-block;
text-align: justify;
text-align-last: justify;
width: 110rpx;
font-size: 26rpx;
line-height: 40px;
flex-shrink: 0;
}
.list-name2{
line-height: 40px;
}
.uni-input{
height: 40px;
border-bottom: 1px solid #d1d1d1;
flex: 1;
}
}
.confrim-btn{
margin: 64rpx 24rpx 40rpx 24rpx;
/deep/ .u-reset-button{
height: 80rpx;
line-height: 80rpx;
border-radius: 15rpx;
color: #FFFFFF;
text-align: center;
background: linear-gradient(134deg, #ED400C 0%, #FB862C 100%);
font-size: 28rpx;
border-radius: 8rpx;
border: none;
}
}
.product-goods{
padding: 30rpx;
padding-top: 200rpx;
overflow: auto;
position: relative;
.product-block{
border-radius: 5px;
margin-bottom: 20rpx;
background: #fff;
box-shadow: 0px 3px 0px rgba(0, 0, 0, 0.02);
.block-title{
padding: 30rpx 24rpx 25rpx 24rpx;
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.08);
display: flex;
justify-content: space-between;
font-size: 30rpx;
color: #333;
.title-left{
flex: 1;
display: flex;
align-items: center;
.left-imgBox{
width: 32rpx;
height: 32rpx;
display: flex;
margin-right: 16rpx;
border-radius: 3px;
flex-shrink: 0;
background-color: #FEB221;
}
.left-img{
display: inline-block;
width: 32rpx;
height: 32rpx;
}
.left-Name{
font-size: 0.32rem;
color: #191919;
font-weight: bold;
flex: 1;
font-size: 28rpx;
line-height: 36rpx;
}
}
.title-right{
width: 160rpx;
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 24rpx;
color: #ED400C;
}
}
.block-main{
display: flex;
height: 174rpx;
border-bottom: none;
color: #333333;
position: relative;
padding: 36rpx 24rpx 24rpx 24rpx;
.mian-InfoWrap{
display: flex;
flex: 1;
font-size: 30rpx;
color: #666666;
flex-wrap: wrap;
word-break: break-all;
margin-right: 20rpx;
flex-direction: column;
justify-content: center;
height: 100%;
.InfoWrap-mb30{
margin-bottom: 30rpx;
}
.allPice{
position: absolute;
left: 24rpx;
bottom: -80rpx;
color: #ED400C;
font-size: 40rpx;
font-weight: bold;
display: flex;
text{
font-size: 24rpx;
font-weight: normal;
margin-right: 4rpx;
line-height: 60rpx;
}
}
}
.main-right{
height: 100%;
display: flex;
align-items: center;
color: #6b6b6b;
}
}
.block-Btn{
display: flex;
justify-content: flex-end;
height: 100rpx;
align-items: center;
padding: 0 20rpx;
.block-button{
width: 152rpx;
height: 64rpx;
line-height: 64rpx;
color: #333333;
padding: 0;
text-align: center;
display: inline-block;
box-sizing: content-box;
font-size: 28rpx;
border: 1px solid #cccccc;
border-radius: 8rpx;
align-items: center;
margin-right: 15rpx;
}
.block-button:nth-last-child(1){
margin-right: 0;
}
.block-buttonOrange{
color: #f9690e;
border: 1px solid #f9690e;
}
}
}
.goods-NoMore{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
}
.order-No{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
margin: auto;
position: absolute;
top: 400;
right: 0;
bottom: 0;
left: 0;
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment