| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 | 
							- <template>
 
- 	<view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
 
- 		<cus-header title='我的订单'></cus-header>
 
- 		<view class="tab adfac">
 
- 			<view class="tab-pre" :class="{'active':tindex===index}" @click="changeTab(item,index)"
 
- 				v-for="(item,index) in statusList" :key="index">{{item.name}}</view>
 
- 		</view>
 
- 		<view class="list">
 
- 			<view class="list-pre" v-for="(item,index) in list" :key="index" @click.prevent="handleDetail(item)">
 
- 				<view class="list-pre-top adfacjb">
 
- 					<view class="list-pre-top-no">订单号:{{item.orderNo}}</view>
 
- 					<view class="list-pre-top-status" :class="statusColor[item.orderStatus]">{{statusCfg[item.orderStatus]}}</view>
 
- 				</view>
 
- 				<view class="list-pre-info adf">
 
- 					<view class="list-pre-info-left adfac">
 
- 						<image class="list-pre-info-left-img" :src="imgBase+'order_img.png'"></image>
 
- 						<view class="list-pre-info-left-texts">
 
- 							<view class="list-pre-info-left-texts-num">{{typeCfg[item.type]}}{{item.totalFrequency}}次,剩余{{item.useFrequency}}次可用</view>
 
- 							<view class="list-pre-info-left-texts-date">有效期至 {{item.expirationTime}}</view>
 
- 						</view>
 
- 					</view>
 
- 					<view class="list-pre-info-right">¥{{(+item.totalAmount||0).toFixed(2)}}</view>
 
- 				</view>
 
- 				<view class="list-pre-btns adf">
 
- 					<view class="list-pre-btns-pre cancel" v-if="item.orderStatus==0" @click.stop="orderCancel">取消订单</view>
 
- 					<view class="list-pre-btns-pre" @click.stop="buyAgain">再次购买</view>
 
- 				</view>
 
- 			</view>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	export default {
 
- 		data(){
 
- 			return {
 
- 				tindex:0,
 
- 				statusList:[
 
- 					{state:'',name:'全部'},
 
- 					{state:'1',name:'已支付'},
 
- 					{state:'0',name:'待支付'},
 
- 					{state:'-2',name:'已取消'}
 
- 				],
 
- 				statusCfg:{
 
- 					'-3':'已退款',
 
- 					'-2':'已取消',
 
- 					'-1':'已失效',
 
- 					0:'待支付',
 
- 					1:'已支付',
 
- 					2:'已完成'
 
- 				},
 
- 				statusColor:{
 
- 					0:'dzf',
 
- 					1:'yzf',
 
- 					2:'yzf',
 
- 					'-2':'yqx'
 
- 				},
 
- 				typeCfg:{
 
- 					1:'基础版',
 
- 					2:'专业版'
 
- 				},
 
- 				query:{
 
- 					page:1,
 
- 					limit:10,
 
- 					orderStatus:'',
 
- 					userId:''
 
- 				},
 
- 				isOver:false,
 
- 				list:[]
 
- 			}
 
- 		},
 
- 		onReachBottom() {
 
- 			if(this.isOver) return
 
- 			this.getList()
 
- 		},
 
- 		onLoad(options) {
 
- 			try{
 
- 				this.query.userId = JSON.parse(uni.getStorageSync('userInfo')).id;
 
- 				this.getList()
 
- 			}catch(e){
 
- 				this.query.userId = '';
 
- 			}
 
- 		},
 
- 		methods:{
 
- 			init(){
 
- 				this.query.page = 1;
 
- 				this.isOver = false;
 
- 				this.list = [];
 
- 				this.getList()
 
- 			},
 
- 			getList(){
 
- 				this.$api.get('/que/order/page',this.query).then(({data:res})=>{
 
- 					if(res.code!==0) return this.$showToast(res.msg)
 
- 					this.list = [...this.list,...res.data.list]
 
- 					if(this.list.length < res.data.total) this.query.page++
 
- 					else this.isOver = true
 
- 				})
 
- 			},
 
- 			changeTab(item,index){
 
- 				this.tindex = index;
 
- 				this.query.orderStatus = item.state;
 
- 				this.init()
 
- 			},
 
- 			handleDetail(item){
 
- 				uni.navigateTo({
 
- 					url:'/pagesMy/orderDetail?item='+encodeURIComponent(JSON.stringify(item))
 
- 				})
 
- 			},
 
- 			orderCancel(){
 
- 			},
 
- 			buyAgain(){
 
- 				uni.navigateTo({
 
- 					url:'/pagesPublish/rechargeCenter'
 
- 				})
 
- 			},
 
- 		}
 
- 	}
 
- </script>
 
- <style scoped lang="scss">
 
- 	.default_page{
 
- 		padding: 0 24rpx 40rpx;
 
- 		box-sizing: border-box;
 
- 		background: #F7F7F7;
 
- 		
 
- 		.tab{
 
- 			position: fixed;
 
- 			left: 0;
 
- 			right: 0;
 
- 			height: 90rpx;
 
- 			background: #FFFFFF;
 
- 			&-pre{
 
- 				width: 25%;
 
- 				height: 90rpx;
 
- 				font-family: PingFangSC, PingFang SC;
 
- 				font-weight: 400;
 
- 				font-size: 28rpx;
 
- 				color: #667E90;
 
- 				line-height: 90rpx;
 
- 				text-align: center;
 
- 				position: relative;
 
- 				&.active{
 
- 					font-weight: bold;
 
- 					font-size: 32rpx;
 
- 					color: #002846;
 
- 					&::after{
 
- 						content: '';
 
- 						width: 48rpx;
 
- 						height: 6rpx;
 
- 						background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
 
- 						border-radius: 5rpx;
 
- 						position: absolute;
 
- 						left: 50%;
 
- 						margin-left: -24rpx;
 
- 						bottom: 4rpx;
 
- 					}
 
- 				}
 
- 			}
 
- 		}
 
- 		
 
- 		.list{
 
- 			padding-top: 110rpx;
 
- 			&-pre{
 
- 				background: #FFFFFF;
 
- 				border-radius: 25rpx;
 
- 				margin-top: 20rpx;
 
- 				padding: 36rpx 24rpx 29rpx;
 
- 				&:first-child{
 
- 					margin-top: 0;
 
- 				}
 
- 				
 
- 				&-top{
 
- 					&-no{
 
- 						font-family: PingFangSC, PingFang SC;
 
- 						font-weight: 400;
 
- 						font-size: 26rpx;
 
- 						color: #667E90;
 
- 						line-height: 30rpx;
 
- 					}
 
- 					&-status{
 
- 						padding: 6rpx 13rpx;
 
- 						border-radius: 6rpx;
 
- 						font-family: PingFangSC, PingFang SC;
 
- 						font-weight: 400;
 
- 						font-size: 24rpx;
 
- 						line-height: 30rpx;
 
- 						&.yzf{
 
- 							color: #33A7A7;
 
- 							background: rgba(51,167,167,0.08);
 
- 						}
 
- 						&.dzf{
 
- 							color: #FD4F66;
 
- 							background: rgba(244,101,122,0.1);
 
- 						}
 
- 						&.yqx{
 
- 							color: #667E90;
 
- 							background: #F0F2F8;
 
- 						}
 
- 					}
 
- 				}
 
- 				
 
- 				&-info{
 
- 					margin-top: 16rpx;
 
- 					border-top: 1rpx solid #EFEFEF;
 
- 					padding-top: 32rpx;
 
- 					justify-content: space-between;
 
- 					&-left{
 
- 						&-img{
 
- 							width: 64rpx;
 
- 							height: 64rpx;
 
- 						}
 
- 						&-texts{
 
- 							margin-left: 20rpx;
 
- 							&-num{
 
- 								font-family: PingFang-SC, PingFang-SC;
 
- 								font-weight: bold;
 
- 								font-size: 30rpx;
 
- 								color: #002846;
 
- 								line-height: 30rpx;
 
- 							}
 
- 							&-date{
 
- 								font-family: PingFangSC, PingFang SC;
 
- 								font-weight: 400;
 
- 								font-size: 26rpx;
 
- 								color: #667E90;
 
- 								line-height: 30rpx;
 
- 								margin-top: 20rpx;
 
- 							}
 
- 						}
 
- 					}
 
- 					&-right{
 
- 						font-family: PingFang-SC, PingFang-SC;
 
- 						font-weight: bold;
 
- 						font-size: 30rpx;
 
- 						color: #1D2129;
 
- 						line-height: 30rpx;
 
- 						text-align: right;
 
- 					}
 
- 				}
 
- 				
 
- 				&-btns{
 
- 					justify-content: flex-end;
 
- 					margin-top: 30rpx;
 
- 					&-pre{
 
- 						background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
 
- 						border-radius: 27rpx;
 
- 						border: 1rpx solid #33A7A7;
 
- 						font-family: PingFangSC, PingFang SC;
 
- 						font-weight: 400;
 
- 						font-size: 24rpx;
 
- 						color: #FFFFFF;
 
- 						line-height: 30rpx;
 
- 						padding: 12rpx 26rpx;
 
- 						letter-spacing: 2rpx;
 
- 						margin-left: 30rpx;
 
- 						&.cancel{
 
- 							background: #FFFFFF;
 
- 							border: 1rpx solid #E2E2E2;
 
- 							color: #95A5B1;
 
- 						}
 
- 					}
 
- 				}
 
- 			}
 
- 		}
 
- 	}
 
- </style>
 
 
  |