| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800 | <template>	<view class="box">		<homenav :iStatusBarHeight="iStatusBarHeight" :title="'我的订单'" :cj="3"></homenav>		<view class="tab">			<view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">全部</view>			<view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>			<view class="tabLine" :class="{tabActive:tabIndex==5}" @click="tabClick(5)">待成团</view>			<view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">待服务</view>			<view class="tabLine" :class="{tabActive:tabIndex==3}" @click="tabClick(3)">已完成</view>            <view class="tabLine" :class="{tabActive:tabIndex==6}" @click="tabClick(6)">售后</view>		</view>		<view class="main">			<view v-if="tabIndex!==6" >				<view class="itemBg"  v-for="(item,index) in items" @click="goDetail(item)">					<view class="itemTop">						<view class="orderCodeBox">							<view class="itemType" v-if="item.SheetType==1">商城-商品订单</view>							<view class="itemType" v-if="item.SheetType==2">商城-项目订单</view>							<view class="itemType" v-if="item.SheetType==3">商城-套餐订单</view>							<view class="itemType" v-if="item.SheetType==4">救援订单</view>							<view class="itemType" v-if="item.SheetType==5">钣喷订单</view>							<view class="itemType" v-if="item.SheetType==6">集客订单</view>							<view class="itemType" v-if="item.SheetType==7">保养订单</view>							<view class="itemType" v-else></view>							<view class="orderCode">:{{item.Code}}</view>						</view>										        <view class="itemSheetState redColor" v-if="item.SheetState==5">待成团</view>						<view class="itemSheetState redColor" v-if="item.SheetState==1">待付款</view>						<!-- <view v-if="item.SheetType==7">							<view class="itemSheetState orangeColor" v-if="item.SheetState==2">已完成</view>						</view> -->						<view class="itemSheetState orangeColor" v-if="item.SheetState==2">待服务</view>						<view class="itemSheetState greenColor" v-if="item.SheetState==3">已完成</view>						<view class="itemSheetState" v-if="item.SheetState==4">已取消</view>				       					</view>					<!-- <view class="itemShopBg">						<view class="shopName">{{item.SheetContent}}</view>						<view style="color: #333333;font-size: 22rpx;">¥<span class="price">{{item.RealMoney}}</span></view>					</view> -->					<view class="afterSalesLineCont">						<view v-if="item.ImgUrl"><!-- getNewValue(item.ImgUrl) -->							<image v-for="(url,index) in item.ImgUrl.split(',')" :src="url" v-if="index<3" class="afterSalesLineImg" mode=""></image>						</view>												<image v-else src="../../../static/timg/noimg.png" class="afterSalesLineImg" mode=""></image>					    <view class="shCont">							<view class="shCOntName" v-if="item.sheetType!=5">{{item.SheetContent}}</view>							<view class="shCOntName" v-if="item.sheetType==5">钣喷</view>							<view class="shContMS">共 {{item.detailCount}} 件商品</view>							<view class="shContMS">¥{{item.RealMoney}}</view>						</view>					</view>				     <view class="renBox" v-if="item.SheetType==6">						<image src="../../../static/timg/icon_ren.png" mode="" class="renimg"></image> 						<view class="renMobilePhone">{{item.MobilePhone}}</view>						<view class="renNickName">{{item.NickName?item.NickName:''}}</view>					 </view>					<view class="itemName">{{item.CreateTime}}</view>				    <view class="itemName" style="padding-top: 2rpx;padding-bottom: 0;">{{item.ShopName}}</view>					<view class="package" v-if="item.SheetType==7" style="display: flex;">						<view class="packageName" v-if="item.packageName">{{item.packageName}}</view>						<view class="packageQty" v-if="item.packageQty" style="padding-left: 10rpx;">共{{item.packageQty}}件</view>					</view>					<view class="bottom" v-if="item.SheetState == 1">						<view class="cancel" @click.stop="cancelBespeak(item)">取消订单</view>						<view class="defer" v-if="item.PayType == 1"  @click.stop="pay(item)">立即支付</view>					</view>				</view>				<nodata v-show="isload&&items.length==0"></nodata>			</view>						<view v-if="tabIndex==6" class="afterSales">				<view class="afterSalesLine" v-for="(item,index) in RefundList"  @click="goReDetail(item)">					<view class="afterSalesLineTop">						<view class="" style="display: flex;">							<view class="afterSalesShop">{{item.WriteoffShopName?item.WriteoffShopName:item.serverShopName}}</view>							<image class="afterSalesLineJt" src="/static/img2/jt1.png" mode=""></image>						</view>						<view class="afterSalesLineState">退款</view>					</view>					<view class="afterSalesLineCont">												<image v-if="item.ImgUrl" :src="getNewValue(item.ImgUrl)" class="afterSalesLineImg" mode=""></image>						<image v-else src="../../../static/timg/noimg.png" class="afterSalesLineImg" mode=""></image>					    <view class="shCont">							<view class="shCOntName" v-if="item.sheetType!=5">{{item.ItemName}}</view>							<view class="shCOntName" v-if="item.sheetType==5">钣喷</view>							<view class="shContMS">共 {{item.CouponCount}} 件商品</view>							<view class="shContMS">退款:¥{{item.Money}}</view>						</view>					</view>					<view class="tkStateBox">						<span style="font-weight: 500;color: #222222;" v-if="item.RefundState==0">无退款</span>						<span style="font-weight: 500;color: #222222;" v-if="item.RefundState==1">退款中</span>						<span style="font-weight: 500;color: #222222;" v-if="item.RefundState==2">退款成功</span>						<span style="font-weight: 500;color: #222222;" v-if="item.RefundState==3">退款拒绝</span>						<span style="font-weight: 500;color: #222222;" v-if="item.RefundState==4">退款失败</span>						<span style="font-weight: 500;color: #222222;" v-if="item.RefundState==5">退款关闭</span>						<span style="font-weight: 500;color: #222222;" v-if="item.RefundState==6">待退款到账</span>						<span style="padding-left: 24rpx;" >请查看详情</span>					</view>					<view class="tkBottom">						<view class="tkBottomBtn">查看详情</view>					</view>									</view>				<nodata v-show="RefundList.length==0&&isload"></nodata>											</view>								</view>		<!-- 手机号授权 -->			<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">				<view class="authorizCont" @click.stop="">					<view class="authorizName">{{wxOpenData.miniAppName}}</view>					<view class="authorizMs">未注册的手机号登录后将自动创建会员账号,如果您不同意授权获取手机号,会影响您使用我们的产品和服务。</view>					<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>				</view>				<view style="text-align: center;padding-top: 56rpx;">					<image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>				</view>			</view>	</view></template><script>	import nodata from '@/components/nodata/nodata.vue'	import homenav from "@/components/homenav/nav.vue"	export default {		components: {			nodata,homenav		},		data() {			return {				page: 1,				tabIndex: '',				items: [],				isload: false,                iStatusBarHeight:'',				userInfo:'',				ext:'',				wxOpenData:'',				themeColor:'',				authorizShow:false,				code:'',				RefundList:[],			}		},		onLoad(opt) {            this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;			this.tabIndex = opt.num;            this.userInfo=this.$store.state.userInfo;            this.ext=this.$common.getExtStoreId();			this.themeColor = uni.getStorageSync("themeColor");            if(this.userInfo){            	this.getData()            }else{            	this.$common.automaticlogin().then(val => {            		this.userInfo=this.$store.state.userInfo;            		this.wxOpenData=this.$store.state.wxOpenData;					this.themeColor = uni.getStorageSync("themeColor");            		this.getData();            		if(!this.userInfo){            			this.authorizShow=true            		}            	})            }					},		onShow() {			console.log(this.tabIndex)			this.getData()		},		computed:{			getNewValue(item) {			      return item => {					  var arr=item.split(",")					  if(arr.length>1){						  item=arr[0]					  }else{						  //item=item					  }					  return item			        // 根据item做一些处理,返回新值			        //return item.value + ' modified';			      };			    }		},		methods: {			goReDetail(item){			   uni.navigateTo({			   	url:'../../subPack/refundDetail?id='+item.ID			   })				},			pay(item){				this.$http('openMallOrder/unifiedPay', {					sheetId:item.ID				},'POST').then(res => {										if(res.code==0){												this.requestPayment(res.data)					}else{						uni.showToast({							title: res.msg,							icon: 'none',							duration: 3000						});					}				 })			},			requestPayment(res){				var payInfo=res;				//console.log(payInfo)				//console.log(String(Date.now()))				var that=this;				uni.requestPayment({					provider: 'wxpay',					//timeStamp: String(Date.now()),					timeStamp: payInfo.timeStamp,					nonceStr: payInfo.nonceStr,					package:payInfo.package,					signType: payInfo.signType,					paySign: payInfo.paySign,					appid:payInfo.appId,									    success: function (res) {				        console.log('success:' + JSON.stringify(res));						 uni.showToast({							 title: '支付成功',							 icon:'none',							 duration: 2000						 });						that.tabIndex=0						that.page = 1;						that.getData()				    },				    fail: function (err) {					  console.log(err)				      uni.showToast({						 title: '支付失败',						 icon:'none',						 duration: 2000				      });									    }				}); 			},			cancelBespeak(item){				var that = this				uni.showModal({				    title: '提示',				    content: '是否取消该订单',					cancelText:'否',					confirmText:'是',				    success: function (res) {				        if (res.confirm) {															uni.showLoading({									title: '加载中'								})																that.$http('openOrderManagement/updateSheetState', {																id: item.ID,															}, 'POST').then(res => {									uni.hideLoading();									// var list = res.data.Items									if(res.code==0){										uni.showToast({											title: '取消成功',											icon: 'none',											duration: 2000										});										setTimeout(function() {											that.page = 1;											that.getData();										}, 100);									}else{										uni.showToast({											title: res.msg,											icon: 'none',											duration: 3000										});									}																	})											          				        } else if (res.cancel) {				           				        }				    }				});			},           decryptPhoneNumber: function(e) {             console.log(e);             this.code=e.detail.code             this.wxPhoneLogin()             this.authorizShow=false;           },           wxPhoneLogin(){           		 var that=this;           		 this.$http('miniApp2/sys/wxPhoneLogin', {           		   appId:this.ext.appId,           		   unionId:this.ext.unionId,           		   code:this.code,           		   openId:this.wxOpenData.openid           		  },'POST').then(res => {           			var data = res.data;           			if(data.loginInfo){           				this.userInfo=data.loginInfo.openUser;           				this.wxOpenData=data.loginInfo;           				this.$store.commit('mutationswxOpenData', data)           				this.$store.commit('mutationsuserInfo', this.userInfo)           			    this.getData()           			}	           		  })           },			tabClick(num) {				this.tabIndex = num;				this.page = 1;				if(num==6){					this.getOpenSheetRefundList()				}else{					this.getData()				}							},			getOpenSheetRefundList(){				uni.showLoading({					title: '加载中'				});				this.isload = false;				var padata = {					page: this.page,					limit: 10,					//sheetState: this.tabIndex > 0 ? this.tabIndex : ''				}								this.$http('openOrderManagement/getOpenSheetRefundList', padata, 'GET').then(res => {					uni.hideLoading();					this.isload = true;									var list = res.data.Items;									if (this.page == 1) {						this.RefundList = list					} else {						this.RefundList = this.RefundList.concat(list)					}								})			},			goDetail(item) {				//SheetType 1 商品2项目3套餐4救援5钣喷6集客				if((item.SheetType==1)||(item.SheetType==2)||(item.SheetType==3)){					uni.navigateTo({						url: "mallOrderDetail?id=" + item.ID +"&SheetType=" + item.SheetType					})				}				else if (item.SheetType==5){					uni.navigateTo({						url: "paintOrderDetail?id=" + item.ID					})				}				else if (item.SheetType==6){					uni.navigateTo({						url: "activityOrderDetail?id=" + item.ID//+'&sx=1'					})				}			},			getData() {				uni.showLoading({					title: '加载中'				});				this.isload = false;				var padata = {					page: this.page,					limit: 10,					sheetState: this.tabIndex > 0 ? this.tabIndex : ''				}				this.$http('openOrderManagement/getOpenSheetList', padata, 'GET').then(res => {					uni.hideLoading();					this.isload = true;					var list = res.data.Items;					if (this.page == 1) {						this.items = list					} else {						this.items = this.items.concat(list)					}				})			},		},		onReachBottom() {			this.page++;			this.getData()		},		onPullDownRefresh() {			this.page = 1;			this.getData()			setTimeout(function() {				uni.stopPullDownRefresh();			}, 1000);		}	}</script><style scoped>	.box {		min-height: 100vh;		background: #F4F5F7;	}   .renBox{	   color: #1A1A1A;	   background: #F7F7F7;	   border-radius: 10rpx;	   display: flex;	   padding: 20rpx;font-size: 24rpx;	   line-height: 30rpx;	   margin-top: 16rpx;   }   .renimg{	   width: 30rpx;height: 30rpx;   }   .renMobilePhone{	   padding-left: 13rpx;   }   .renNickName{	   padding-left: 20rpx;   }	.tab {		background: #FFFFFF;		display: flex;		justify-content: space-between;		line-height: 92rpx;		position: fixed;		width: calc(100vw - 100rpx);		padding-left: 50rpx;		padding-right: 50rpx;		height: 92rpx;		z-index: 11;	}	.tabLine {		font-size: 28rpx;		color: #333333;		text-align: center;	}	.tabActive {		color: #EC0F0A;		font-weight: bold;		border-bottom: 4rpx solid #EC0F0A;	}	.main {		padding-top: 92rpx;		padding-bottom: 20rpx;		background-color: #F4F5F7;	}	.itemBg {		margin: 20rpx 24rpx;		background-color: #FFFFFF;		border-radius: 10rpx;		padding: 20rpx;	}	.itemTop {		display: flex;		justify-content: space-between;	}	.itemType {		color: #999999;		font-size: 24rpx;	}	.itemSheetState {		font-size: 24rpx;		color: #999999	}	.redColor {		color: #EC0F0A;	}	.orangeColor {		color: #F19D01;	}	.greenColor {		color: #00A040;	}		.itemShopBg {		display: flex;		justify-content: space-between;		margin-top: 20rpx;			}	.shopName {		color: #333333;		font-size: 30rpx;		font-weight: bold;		/* 隐藏文字显示 ...不换行 */		overflow: hidden;		text-overflow: ellipsis;		white-space: nowrap;	}	.price {		color: #333333;		font-weight: bold;		font-size: 32rpx;	}	.itemName {		color: #666666;		font-size: 24rpx;		padding: 16rpx 0;		height: 30rpx;		overflow: hidden;		text-overflow: ellipsis;		white-space: nowrap;	}	.plateBg {		display: flex;		justify-content: space-between;		align-items: center;	}	.plateNumber {		color: #666666;		font-size: 24rpx;		margin-bottom: 20rpx;		display: flex;	}	.itemLineBottom {		display: flex;		justify-content: flex-end;	}	.itemBtn1 {		width: 150rpx;		height: 56rpx;		border-radius: 36rpx;		border: 2rpx solid #DDDDDD;		text-align: center;		line-height: 56rpx;		font-size: 28rpx;		color: #3C3C3C;		margin-left: 40rpx;	}	.itemBtn2 {		width: 150rpx;		height: 56rpx;		border-radius: 36rpx;		border: 2rpx solid #FF4F00;		text-align: center;		line-height: 56rpx;		font-size: 28rpx;		color: #FF4F00;		margin-left: 40rpx;	}	.orderState {		color: #F19D01;		font-size: 24rpx;		padding-left: 20rpx;	}	.authorizBox{			width: 100vw;			height: 100vh;			background: rgba(0, 0, 0, 0.5);			position: fixed;			top: 0;			left: 0;		}		.authorizCont{			margin-top: 30vh;			width: 564rpx;			height: 408rpx;			background: #FFFFFF;			border-radius: 24rpx;			margin-left: 93rpx;			position: relative;		}		.authorizCloseImg{			width: 62rpx;			height: 62rpx;		}		.sqLogoBox{			width: 180rpx;			height: 180rpx;			background: #FFFFFF;			border-radius: 90rpx;			text-align: center;			position: absolute;			top: -50rpx;			left: 192rpx;		}		.authorizName{			color: #333333;			line-height: 42rpx;			font-size: 30rpx;			text-align: center;			padding-top: 58rpx;		}		.authorizMs{			color: #999999;			line-height: 36rpx;			font-size: 26rpx;			width: 452rpx;			padding-top: 24rpx;			text-align: center;			margin-left: 56rpx;		}		.authorizContbutton{			width: 422rpx;			height: 88rpx;			background: #EC0F0A;			border-radius: 44rpx;			line-height: 88rpx;			text-align: center;			font-size:30rpx;			color: #FFFFFF;			margin-top: 62rpx;			margin-left:71rpx;		}		.shopBoxpt{			margin-top: 20rpx;		}		button::after{		 	border: none;		}		button{			position: relative;			display: block;			margin-left: 0;			margin-right: 0;			padding-left: 0px;			padding-right: 0px;			box-sizing: border-box;			// font-size: 18px;			text-align: center;			text-decoration: none;			// line-height: 1;			line-height: 1.35;			// border-radius: 5px;			-webkit-tap-highlight-color: transparent;			overflow: hidden;			color: #000000;			background-color: #fff;						height: 100%;			}			.orderCodeBox{				display: flex;			}			.orderCode{				color: #999999;    font-size: 24rpx;			}			.cancel {				color: #3C3C3C;				font-size: 24rpx;				width: 130rpx;				height: 56rpx;				border-radius: 8rpx;				border: 1rpx solid #DDDDDD;				text-align: center;				line-height: 56rpx;				/* margin-right: 20rpx; */			}						.defer {				color: #EC0F0A;				font-size: 24rpx;				width: 130rpx;				height: 56rpx;				border-radius: 8rpx;				border: 1rpx solid #EC0F0A;				text-align: center;				line-height: 56rpx;				margin-left: 20rpx;					}			.bottom{				display: flex;				justify-content: flex-end;			}.packageName{	font-size: 22rpx;	color: #FF0035;	border-radius: 5rpx;	border: 1px solid #FF0035;	padding: 2rpx 8rpx;}.package{	justify-content: space-between;	padding-top: 10rpx;padding-bottom: 10rpx;}.packageQty{	font-size: 26rpx;	color: #666666;}.afterSalesLineJt{	width: 10rpx;height: 20rpx;	margin-top: 12rpx;	margin-left: 10rpx;}.afterSales{	padding: 0 24rpx;}.afterSalesLine{	background: #FFFFFF;	margin-top: 20rpx;	padding: 30rpx 20rpx;border-radius: 16rpx;}.afterSalesLineTop{	    display: flex;	    justify-content: space-between;}.afterSalesShop{	font-size: 30rpx;	color: #222222;	line-height: 42rpx;	font-weight: 500;}.afterSalesLineState{	font-size: 26rpx;line-height: 42rpx;	color: #666666;}.afterSalesLineImg{	width: 144rpx;	height: 144rpx;	border-radius: 10rpx;	margin-right: 20rpx;}.afterSalesLineCont{	display: flex;padding: 24rpx 0;}.shCont{	color: #222222;padding-left: 10rpx;}.shCOntName{	font-size: 26rpx;line-height: 37rpx;}.shContMS{	font-size: 22rpx;	color: #222222;	line-height: 30rpx;	padding-top: 8rpx;}.tkStateBox{	height: 60rpx;padding-left: 16rpx;	background: #F9F9F9;color: #666666;	border-radius: 10rpx;	line-height: 60rpx;font-size: 26rpx;}.tkBottomBtn{	font-size: 24rpx;	color: #222222;	width: 137rpx;	height: 56rpx;	line-height: 58rpx;	font-size: 24rpx;	color: #222222;	border-radius: 8rpx;	border: 1rpx solid #DDDDDD;	margin-top: 24rpx;	text-align: center;}.tkBottom{	display: flex;justify-content: flex-end;}</style>
 |