<template>
	<view>
		<view class="order">
			<u-tabs :list="list" :is-scroll="false" active-color="#FF7F00" inactive-color=" #666666" :bold="bold"
				:current="current" @change="change"></u-tabs>
			<!-- 全部 -->
			<view class="tabs_box" :class="{dis:current == 0}">
				<view class="order_box" v-for="(item,index) in lists" :key="index"
					@click="bindorderDetail(item.indentNumber,item.orderId)">
					<view class="order_success" v-if="item.indentState=='2'">
						<view class="order_name">待支付领取</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='3'">
						<view class="order_name">待取货</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='4'">
						<view class="order_name">配送中</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='5'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='6'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='7'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='10'">
						<view class="order_name">已取消</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='9'">
						<view class="order_name">已取消</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_city">
						<view class="city_type">
							<view class="type_name" v-if="item.indentType == 1">帮我送</view>
							<view class="type_name" v-if="item.indentType == 2">帮我取</view>
							<view class="type_name" v-if="item.indentType == 3">同城帮买</view>
							<view class="type_name" v-if="item.indentType == 4">同城服务</view>
							<view class="type_name" v-if="item.indentType == 5">同城外卖</view>
							<view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
						</view>
						<view style="padding:0 30rpx;color:#FF7F00">{{item.shopName}}</view>
						<view style="padding:0 30rpx">订单编号：{{item.indentNumber}}</view>
						<view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
							<view class="fh_box">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 3">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 4">
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 5">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_btn">
						<view class="btn1" v-if="item.indentState=='3'" @click.stop="quxiao(item.indentNumber)">取消订单
						</view>
						<!-- <view class="btn1"  v-if="item.indentState=='6'">客户待确认</view> -->
						<view class="btn2" v-if="item.indentState=='3'" @click.stop="quhuo(item.indentId)">确认取货</view>
						<view class="btn2" v-if="item.indentState=='4'" @click.stop="onshow(item)">确认送达</view>
						<view class="btn2" v-if="item.indentState=='9'">已取消</view>
						<view class="btn2" v-if="item.indentState=='10'">已取消</view>
					</view>
				</view>
			</view>
			<!-- 待取货 -->
			<view class="tabs_box" :class="{dis:current == 1}">
				<view class="order_box" v-for="(item,index) in lists" :key="index"
					@click="bindorderDetail(item.indentNumber,item.orderId)">
					<view class="order_success" v-if="item.indentState=='2'">
						<view class="order_name">待支付领取</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='3'">
						<view class="order_name">待取货</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_city">
						<view class="city_type">
							<view class="type_name" v-if="item.indentType == 1">帮我送</view>
							<view class="type_name" v-if="item.indentType == 2">帮我取</view>
							<view class="type_name" v-if="item.indentType == 3">同城帮买</view>
							<view class="type_name" v-if="item.indentType == 4">同城服务</view>
							<view class="type_name" v-if="item.indentType == 5">同城外卖</view>
							<view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
						</view>
						<view style="padding:0 30rpx;color:#FF7F00">{{item.shopName}}</view>
						<view style="padding:0 30rpx">订单编号：{{item.indentNumber}}</view>
						<view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
							<view class="fh_box">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 3">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 4">
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 5">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_btn">
						<view class="btn1" v-if="item.indentState=='3'" @click.stop="quxiao(item.indentNumber)">取消订单
						</view>
						<view class="btn2" v-if="item.indentState=='3'" @click.stop="quhuo(item.indentId)">确认取货</view>
					</view>
				</view>
			</view>
			<!-- 配送中 -->
			<view class="tabs_box" :class="{dis:current == 2}">
				<view class="order_box" v-for="(item,index) in lists" :key="index"
					@click="bindorderDetail(item.indentNumber,item.orderId)">
					<view class="order_success" v-if="item.indentState=='4'">
						<view class="order_name">配送中</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='5'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='6'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='7'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_city">
						<view class="city_type">
							<view class="type_name" v-if="item.indentType == 1">帮我送</view>
							<view class="type_name" v-if="item.indentType == 2">帮我取</view>
							<view class="type_name" v-if="item.indentType == 3">同城帮买</view>
							<view class="type_name" v-if="item.indentType == 4">同城服务</view>
							<view class="type_name" v-if="item.indentType == 5">同城外卖</view>
							<view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
						</view>
						<view style="padding:0 30rpx;color:#FF7F00">{{item.shopName}}</view>
						<view style="padding:0 30rpx">订单编号：{{item.indentNumber}}</view>
						<view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
							<view class="fh_box">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 3">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 4">
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 5">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_btn">
						<view class="btn1" v-if="item.indentState=='3'">取消订单</view>
						<!-- <view class="btn1" v-if="item.indentState=='6'">客户待确认</view> -->
						<view class="btn2" v-if="item.indentState=='3'" @click.stop="quhuo(item.indentId)">确认取货</view>
						<view class="btn2" v-if="item.indentState=='4'" @click.stop="onshow(item)">确认送达</view>
						<view class="btn2" v-if="item.indentState=='9'">已取消</view>
					</view>
				</view>
			</view>
			<!-- 配送完 -->
			<view class="tabs_box" :class="{dis:current == 3}">
				<view class="order_box" v-for="(item,index) in lists" :key="index"
					@click="bindorderDetail(item.indentNumber,item.orderId)">
					<!-- <view class="order_success" v-if="item.indentState=='4'">
						<view class="order_name">配送中</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view> -->
					<view class="order_success" v-if="item.indentState=='5'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='6'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='7'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_city">
						<view class="city_type">
							<view class="type_name" v-if="item.indentType == 1">帮我送</view>
							<view class="type_name" v-if="item.indentType == 2">帮我取</view>
							<view class="type_name" v-if="item.indentType == 3">同城帮买</view>
							<view class="type_name" v-if="item.indentType == 4">同城服务</view>
							<view class="type_name" v-if="item.indentType == 5">同城外卖</view>
							<view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
						</view>
						<view style="padding:0 30rpx;color:#FF7F00">{{item.shopName}}</view>
						<view style="padding:0 30rpx">订单编号：{{item.indentNumber}}</view>
						<view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
							<view class="fh_box">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 3">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 4">
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 5">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_btn">
						<view class="btn1" v-if="item.indentState=='3'">取消订单</view>
						<!-- <view class="btn1" v-if="item.indentState=='6'">客户待确认</view> -->
						<view class="btn2" v-if="item.indentState=='3'" @click="quhuo(item.indentId)">确认取货</view>
						<view class="btn2" v-if="item.indentState=='4'" @click="onshow(item)">确认送达</view>
						<view class="btn2" v-if="item.indentState=='9'">已取消</view>
					</view>
				</view>
			</view>
			<!-- 已完成 -->
			<view class="tabs_box" :class="{dis:current == 4}">
				<view class="order_box" v-for="(item,index) in lists" :key="index"
					@click="bindorderDetail(item.indentNumber,item.orderId)">
					<view class="order_success" v-if="item.indentState=='4'">
						<view class="order_name">配送中</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='5'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='6'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='7'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_city">
						<view class="city_type">
							<view class="type_name" v-if="item.indentType == 1">帮我送</view>
							<view class="type_name" v-if="item.indentType == 2">帮我取</view>
							<view class="type_name" v-if="item.indentType == 3">同城帮买</view>
							<view class="type_name" v-if="item.indentType == 4">同城服务</view>
							<view class="type_name" v-if="item.indentType == 5">同城外卖</view>
							<view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
						</view>
						<view style="padding:0 30rpx;color:#FF7F00">{{item.shopName}}</view>
						<view style="padding:0 30rpx">订单编号：{{item.indentNumber}}</view>
						<view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
							<view class="fh_box">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 3">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 4">
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 5">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_btn">
						<view class="btn1" v-if="item.indentState=='3'">取消订单</view>
						<!-- <view class="btn1" v-if="item.indentState=='6'">客户待确认</view> -->
						<view class="btn2" v-if="item.indentState=='3'" @click="quhuo(item.indentId)">确认取货</view>
						<view class="btn2" v-if="item.indentState=='4'" @click="onshow(item)">确认送达</view>
						<view class="btn2" v-if="item.indentState=='9'">已取消</view>
					</view>
				</view>
			</view>
			<!-- 已取消 -->
			<view class="tabs_box" :class="{dis:current == 5}">
				<view class="order_box" v-for="(item,index) in lists" :key="index"
					@click="bindorderDetail(item.indentNumber,item.orderId)">
					<view class="order_success" v-if="item.indentState=='4'">
						<view class="order_name">配送中</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='5'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='6'">
						<view class="order_name">已完成</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<view class="order_success" v-if="item.indentState=='9'">
						<view class="order_name">已取消</view>
						<view class="order_data">{{item.receivingTime}}</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_city">
						<view class="city_type">
							<view class="type_name" v-if="item.indentType == 1">帮我送</view>
							<view class="type_name" v-if="item.indentType == 2">帮我取</view>
							<view class="type_name" v-if="item.indentType == 3">同城帮买</view>
							<view class="type_name" v-if="item.indentType == 4">同城服务</view>
							<view class="type_name" v-if="item.indentType == 5">同城外卖</view>
							<view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
						</view>
						<view style="padding:0 30rpx;color:#FF7F00">{{item.shopName}}</view>
						<view style="padding:0 30rpx">订单编号：{{item.indentNumber}}</view>
						<view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
							<view class="fh_box">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 3">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 4">
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
						<view class="city_address" v-if="item.indentType == 5">
							<view class="fh_box" v-if="item.buy_type == 1">
								<view class="fh_image">
									<image src="../../static/image/icon_f.png"></image>
								</view>
								<view class="box">
									<view class="fh_name">{{item.shopAddressDetail}}</view>
									<view class="fh_type">{{item.shopName}}
										<text>{{item.shopPhone}}</text>
									</view>
								</view>
							</view>
							<view class="sh_box">
								<view class="sh_image">
									<image src="../../static/image/icon_s.png"></image>
								</view>
								<view class="box">
									<view class="sh_name">{{item.userAddressDetail}}</view>
									<view class="sh_type">{{item.userName}}
										<text>{{item.userPhone}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<u-line color="#E6E6E6" />
					<view class="order_btn">
						<view class="btn2" v-if="item.indentState=='9'">已取消</view>
					</view>
				</view>
			</view>
			<empty v-if="lists.length == 0"></empty>
			<!-- 收货码弹框 -->
			<u-popup v-model="shows" mode="center" border-radius="18" :closeable="closeable" close-icon="close-circle"
				close-icon-size="45" width="580rpx" height="400rpx">
				<view class="receipt_code">
					<view class="code_title">填写收货码</view>
					<u-input v-model="shouhuoma" type="text" placeholder="请输入收货码" :border="true" />
					<view class="sure" @click="querenSh">确定</view>
				</view>
			</u-popup>
			<!-- 确认收货拍照弹出框 -->
			<u-popup v-model="alertPhone" mode="center" border-radius="18" :closeable="closeable" close-icon="close-circle"
				close-icon-size="45" width="680rpx" height="900rpx" @close="onclose">
				<view class="receipt_code">
					<view class="phone_title">图片凭证</view>
					<view class="phone_title2">请在确认外卖送达后、通过拍照，进行现场还原</view>
					<view>
						<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
							<view v-if="goodsPicture.length">
								<view class="margin-top flex margin-right-sm flex-wrap">
									<view class="flex"
										style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;"
										v-for="(image,index) in goodsPicture" :key="index">
										<image :src="image" style="width: 100%;height: 100%;"></image>
										<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
											@click="removeImg(index,'lb')">
											<u-icon name="close-circle-fill" color="#FCD202" size="50rpx"></u-icon>
										</view>
					
									</view>
								</view>
							</view>
							<view class="margin-top" @click="addImages(1)" v-if="goodsPicture.length<=1">
								<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
									class="flex justify-center align-center">
									<view>
										<view class="text-center">
											<image src="../../static/addimg.png" style="width: 65rpx;height: 55rpx;">
											</image>
										</view>
										<view class="text-center text-black">添加图片</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="receipt_code" v-if="alertduan">
						<view class="code_title">是否确认送达</view>
						<view class="code_title2">已选订单：1单</view>
						<view class="code_title2">通知形式：短信</view>
						<view class="code_title2">通知内容：{{duanxin[0].templateContent.substring(0, 21)}}{{qiPhone}}</view>
						<view class="sure" @click="querenSh">确认送达</view>
					</view>
					<!-- <view class="sure" @click="querenduanxin">确认拍照</view> -->
				</view>
			</u-popup>
			<!-- 确认收货选择短信框 -->
			<!-- <u-popup v-model="alertduan" mode="center" border-radius="18" :closeable="closeable" close-icon="close-circle"
				close-icon-size="45" width="680rpx" height="600rpx">
				<view class="receipt_code">
					<view class="code_title">是否确认送达</view>
					<view class="code_title2">已选订单：1单</view>
					<view class="code_title2">通知形式：短信</view>
					<view class="code_title2">通知内容：{{duanxin[0].templateContent.substring(0, 21)}}{{qiPhone}}</view>
					<view class="sure" @click="querenSh">确认送达</view>
				</view>
			</u-popup> -->
		</view>

	</view>
</template>

<script>
	import empty from '@/components/empty'
	import configdata from '@/common/config.js';
	export default {
		components: {
			empty
		},
		data() {
			return {
				shows: false,
				alertPhone:false,//确认收货拍照弹出框
				alertduan:false,//确认收货选择短信框
				closeable: true,
				shouhuoma: '',
				list: [{
					name: '全部'
				}, {
					name: '待取货'
				}, {
					name: '配送中'
				}, {
					name: '已完成'
				}],
				current: 0,
				bold: false,
				page: 1,
				limit: 5,
				order: [],
				lists: [],
				totalCount: 0,
				longitude: '', //经度
				latitude: '', //纬度
				indentState: '', //订单状态
				indentNumber: '', //订单号
				goodsPicture: [],
				count: 3,
				duanxin:[],//发送的短信
				qiPhone:'',//骑手电话
			}
		},
		onLoad() {
			this.qiPhone=uni.getStorageSync('phone')

			var that = this
			uni.getLocation({
				type: 'wgs84',
				success: function(res) {
					console.log('当前位置的经度：' + res.longitude);
					console.log('当前位置的纬度：' + res.latitude);
					that.longitude = res.longitude
					that.latitude = res.latitude
					that.taskData()
				}
			});
		},
		onShow() {
			let zhuandan = this.$queue.getData('zhuandan');
			if (zhuandan) {
				this.$queue.remove('zhuandan');
				this.page = 1;
				this.taskData();
			}
		},
		methods: {
			change(index) {
				uni.showLoading({
					title: '加载中......',
					icon: 'none'
				})
				this.current = index;
				this.lists = []
				this.page = 1;
				if (index == 0) {
					this.indentState = ''
				}
				if (index == 1) {
					this.indentState = 3
				}
				if (index == 2) {
					this.indentState = 4
				}
				if (index == 3) {
					this.indentState = 6
				}
				if (index == 4) {
					this.indentState = 9
				}
				this.taskData()
			},
			// 订单获取
			taskData() {
				uni.showLoading({
					title: '加载中......',
					icon: 'none'
				})
				this.$Request.getT('/app/tbindent/findRiderIndent', {
					page: this.page,
					limit: 10,
					indentState: this.indentState
				}).then(res => {
					uni.hideLoading()
					if (this.page == 1) {
						this.lists = res.data.list
					} else {
						this.lists = this.lists.concat(res.data.list)
					}
					for (var i in this.lists) {
						if (this.lists[i].distanceInitial > 1000) {
							this.lists[i].distanceInitials = (Number(this.lists[i].distanceInitial) / 100)
								.toFixed(2)
						}
						if (this.lists[i].distance > 1000) {
							this.lists[i].distances = (Number(this.lists[i].distance) / 100).toFixed(2)
						}
					}
					console.log('lists', this.lists)
					this.totalCount = res.data.totalCount
					uni.stopPullDownRefresh();
				});
			},
			// 订单详情
			bindorderDetail(indentNumber, orderId) {
				console.log(indentNumber, orderId)
				uni.navigateTo({
					url: '/pages/index/orderdetail/orderdetail?id=' + indentNumber + '&orderId=' + orderId
				})
			},
			// 取消订单
			quxiao(indentNumber) {
				let that = this
				console.log('indentNumber', indentNumber)
				uni.showModal({
					title: '取消订单将会被扣保证金',
					content: '',
					cancelText: '取消',
					confirmText: '确认'
				}).then(res => {
					that.$Request.postT('/app/tbindent/riderCancleIndent', {
						indentNumber: indentNumber
					}).then(res => {
						console.log(res)
						if (res.code == 0) {
							that.page = 1
							that.taskData()
							uni.showToast({
								title: '订单已取消',
								icon: "none"
							});

						} else {
							uni.showToast({
								title: res.msg,
								icon: "none"
							});
						}
					});
				}).catch(err => {})

			},
			quhuo(indentId) {
				let that = this
				uni.showModal({
					title: '提示',
					content: '确认取到货吗',
					success: function(res) {
						if (res.confirm) {
							that.$Request.postJson('/app/tbindent/riderBuyGoods', {
								indentId: indentId,
								indentState: 4
							}).then(res => {
								if (res.code == 0) {
									that.page = 1
									that.taskData()
									uni.showToast({
										title: '确认取货成功',
										icon: "none"
									});
								} else {
									uni.showToast({
										title: res.msg,
										icon: "none"
									});
								}
							});
						}
					}
				})
			},
			onshow(e) {
				this.indentNumber = e.indentNumber
				if (e.itemCodeFlag == 0) {
					this.shows = true
				} else {
					//需拍照的弹出框
					this.alertPhone=true
					// this.querenSh()
				}
			},
			// 图片上传
			addImages(e) {
				if (e == 1) {
					var num = this.goodsPicture.length
					this.count = 2 - num
				}
			
				let that = this
				uni.chooseImage({
					count: this.count,
					sourceType: ['camera'],
					success: res => {
						for (let i = 0; i < res.tempFilePaths.length; i++) {
							that.$queue.showLoading("上传中...");
							uni.uploadFile({ // 上传接口
								url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
								// url: 'https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload',
								filePath: res.tempFilePaths[i],
								name: 'file',
								success: (uploadFileRes) => {
									if (e == 1) {
										if (that.goodsPicture.length < 2) {
											that.goodsPicture.push(JSON.parse(uploadFileRes.data)
												.data)
										}
									}
									uni.hideLoading();
									this.querenduanxin()
								}
							});
						}
					}
				})
			},
			// 图片删除
			removeImg(index, texts) {
				if (texts == 'lb') {
					this.goodsPicture.splice(index, 1)
				}
			},
			config: function(name) {
				var info = null;
				if (name) {
					var name2 = name.split("."); //字符分割
					if (name2.length > 1) {
						info = configdata[name2[0]][name2[1]] || null;
					} else {
						info = configdata[name] || null;
					}
					if (info == null) {
						let web_config = cache.get("web_config");
						if (web_config) {
							if (name2.length > 1) {
								info = web_config[name2[0]][name2[1]] || null;
							} else {
								info = web_config[name] || null;
							}
						}
					}
				}
				return info;
			},
			// 监听拍照框关闭
			onclose(){
				this.alertPhone=false
				this.alertduan = false
				this.goodsPicture=[]
			},
			// 获取确认送达短信模板
			querenduanxin() {
				// this.$Request.postT('/app/tb-indent-sms/template', {
				this.$Request.getT('/app/tb-indent-sms/template', {
					// indentNumber: this.indentNumber,
					// itemCode: this.shouhuoma
				}).then(res => {
					console.log(res)
					this.duanxin=res.data.list
					if (res.code == 0) {
						this.page = 1;
						// this.alertPhone = false
						this.alertduan = true
			
					} else {
						uni.showToast({
							title: res.msg,
							icon: "none"
						});
					}
				});
			},
			querenSh() {
				var tupian=this.goodsPicture.toString()
				console.log(this.goodsPicture.toString())
				// this.$Request.postT('/app/tbindent/riderDelivery', {
				this.$Request.postJson('/app/tbindent/riderDelivery', {
					imgs:tupian,
					smsTemplateId:this.duanxin[0].id,
					indentNumber: this.indentNumber,
					itemCode: this.shouhuoma
				}).then(res => {
					console.log(res)
					if (res.code == 0) {
						this.page = 1;
						this.taskData()
						uni.showToast({
							title: '订单完成',
							icon: "none"
						});
						this.alertPhone = false
						// this.alertduan = false
						this.shows = false

					} else {
						uni.showToast({
							title: res.msg,
							icon: "none"
						});
					}
				});
			}
		},
		onReachBottom: function() {
			if (this.page < this.totalCount) {
				this.page += 1;
				this.taskData();
			}
		},
		onPullDownRefresh: function() {
			this.page = 1;
			this.taskData();
		},

	}
</script>

<style>
	body {
		background: #F5F5F5;
	}

	.tabs_box {
		display: none;
	}

	.dis {
		display: block;
		width: 100%;
	}

	.u-tab-item {
		font-size: 26upx !important;
		/* color: #666666 !important; */
	}

	.success_box {
		width: 100%;
	}

	.order_box {
		width: 90%;
		margin: 0 auto;
		/* height: 390rpx; */
		background: #FFFFFF;
		margin-top: 20rpx;
		border-radius: 16px;
		padding-bottom: 16rpx;
	}

	.order_success {
		width: 90%;
		margin: 0 auto;
		display: flex;
		height: 80upx;
	}

	.order_name {
		flex: 1;
		display: flex;
		justify-content: left;
		align-items: center;
		font-weight: bold;
		font-size: 26rpx;
		letter-spacing: 1upx;
	}

	.order_data {
		flex: 1;
		color: #999999;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		font-size: 24rpx;
	}

	.city_type {
		width: 90%;
		margin: 0 auto;
		height: 60upx;
		line-height: 60upx;
		display: flex;
		justify-content: left;
		align-items: center;
	}

	.type_name {
		font-size: 27rpx;
	}

	.city_text {
		width: 70rpx;
		line-height: 36rpx;
		color: #49A5FF;
		background: #c4e2ff;
		text-align: center;
		font-size: 19rpx;
		margin-left: 20rpx;
	}

	.city_address {
		width: 85%;
		margin: 0 auto;
		margin-top: -10rpx;
	}

	/* 发货地址 */
	.fh_box {
		display: flex;
		/* height: 80upx; */
		margin-top: 20upx;
	}

	.fh_image {
		flex: 1;
	}

	.box {
		flex: 11;
	}

	.fh_name {
		font-size: 26rpx;
		font-weight: 600;
		letter-spacing: 2upx;
	}

	.fh_type {
		color: #999999;
		font-size: 22upx;
	}

	.fh_type text {
		margin-left: 20upx;
	}

	/* 送货地址 */
	.sh_box {
		display: flex;
		margin-bottom: 14upx;
		margin-top: 14rpx;
	}

	.sh_image {
		flex: 1;
	}

	.sh_name {
		font-size: 26rpx;
		font-weight: 600;
		letter-spacing: 2upx;
	}

	.sh_type {
		color: #999999;
		font-size: 22upx;
	}

	.sh_type text {
		margin-left: 20upx;
	}

	.fh_image image {
		width: 30upx;
		height: 30upx;
	}

	.sh_image image {
		width: 30upx;
		height: 30upx;
	}

	.order_btn {
		display: flex;
		justify-content: flex-end;
		align-items: center;
		/* height: 80upx; */
		margin-top: 8upx;
	}

	.btn1 {
		width: 170upx;
		font-size: 22upx;
		line-height: 60upx;
		text-align: center;
		border: 1upx solid #9C9C9C;
		border-radius: 20upx;
		color: #9C9C9C;
		margin-right: 30upx;
	}

	.btn2 {
		width: 170upx;
		line-height: 60upx;
		color: white;
		background: #FF6A04;
		font-size: 22upx;
		text-align: center;
		margin-right: 30upx;
		border-radius: 20upx;
	}

	/* 收货码弹框 */
	.receipt_code {
		width: 90%;
		margin: 0 auto;
	}

	.code_title {
		width: 100%;
		line-height: 100rpx;
		font-size: 31rpx;
		font-weight: bold;
		text-align: center;
		letter-spacing: 2rpx;
		margin-top: 21rpx;
		margin-bottom: 25rpx;
	}

	.u-input--border {
		border: 1px solid #F2F2F2 !important;
		background: #F2F2F2 !important;
		color: #999999 !important;
		font-weight: 500 !important;
		letter-spacing: 2rpx !important;
	}

	.u-input__input {
		font-size: 30rpx;
		font-weight: bold;
		flex: 1;
		color: #999999 !important;
		min-height: 85rpx !important;
		margin-top: 7rpx;
	}

	.sure {
		width: 100%;
		height: 80rpx;
		background: #FF7F00;
		color: white;
		border-radius: 46rpx;
		text-align: center;
		line-height: 80rpx;
		margin-top: 30rpx;
		letter-spacing: 2rpx;
	}
	/* 确认送达拍照框 */
	.phone_title{
		margin-top: 10px;
		width: 100%;
		height: 40px;
		/* background-color: #FF7F00; */
		text-align: center;
		line-height: 40px;
		/* color:#FFFFFF; */
	}
	.phone_title2{
		margin-top: 10px;
		text-align: center;
		color:#9d9d9d;
	}
	.code_title2 {
	    width: 100%;
	    line-height: 50rpx;
	    text-align: center;
	    letter-spacing: 2rpx;
	    margin-top: 21rpx;
	    margin-bottom: 25rpx;
	}
</style>