<template>
	<view v-if="loadlogo">
		<view class="container">
			<far-bottom></far-bottom>
			<view class="orderList">
				<view class="dis-flex flex-dir-column orderList-header">
					<view class="orderList-search">
						<view class="search-main">
							<view class="search-box dis-flex flex-y-center">
								<view class="search-input">
									<view class="i icon iconfont icon-sousuo"></view>
									<input type="text" value="" placeholder="请输入订单号进行搜索" placeholder-style="color:#999999;margin-left:10upx;"
									 class="f-24" v-model="keyword" @blur="doSearch" />
								</view>
								<!-- <picker @change="search" :value="indexs" :range="typeList" range-key="label">
									<view class="dis-flex search-select f-28">
										{{ typeList[indexs].label }}
										<view class="i icon iconfont icon-unfold"></view>
									</view>
								</picker> -->
							</view>
						</view>
					</view>
					<view class="topNav">
						<view @click="changeStatus(0)">
							<view :class="status == 0 ? 'check' : ''">
								<span>全部</span>
								<view class="line"></view>
							</view>
						</view>
						<view @click="changeStatus(1)">
							<view :class="status == 1 ? 'check' : ''">
								<span>待使用</span>
								<view class="line"></view>
							</view>
						</view>
						<view @click="changeStatus(8)">
							<view :class="status == 8 ? 'check' : ''">
								<span>待发货</span>
								<view class="line"></view>
							</view>
						</view>
						<view @click="changeStatus(3)">
							<view :class="status == 3 ? 'check' : ''">
								<span>已完成</span>
								<view class="line"></view>
							</view>
						</view>
						<view @click="changeStatus(9)">
							<view :class="status == 9 ? 'check' : ''">
								<span>已过期</span>
								<view class="line"></view>
							</view>
						</view>
					</view>
				</view>

				<!-- <view class="topFull"></view> -->

				<!-- 列表区域 -->
				<scroll-view class="scrollList" :style="{ height: scrollHeight }" :scroll-y="true" @scrolltolower="load">
					<nonemores v-if="pagetotal == 0"></nonemores>
					<view class="orderList-body" v-if="pagetotal != 0">
						<view  style="position: fixed;right: 280upx;top:320upx;z-index: 99999;" v-if="idos">
							<view  style=" width: 0;height: 0;border-left: 20upx solid transparent;border-right: 20upx solid transparent;border-bottom: 20upx solid rgba(255,68,68,0.7);position: absolute;left: 50%;top: -20upx;transform: translateX(-50%);">
								
							</view>
							<view class="f-20 dis-il-block col-f" style="padding: 0upx 20upx;border-radius: 15upx;background-color: rgba(255,68,68,0.7);font-weight: 400;height: 180upx;width: 300upx;">
								<view class="f-20" style="padding: 30upx 10upx;">
									亲~~点击订单号可以复制订单号到粘贴板哦~!
								</view>
								<view class="t-r" @click="ido">
									我知道了
								</view>
							</view>
							
						</view>
						<view class="orderList-list-item m-btm20" v-for="(item, index) in orderlist" :key="index">
							<view class="dis-flex flex-x-between f-24 orderList-list-item-header">
								<view class="dis-flex flex-y-center">
									<view class="tag">{{ item.pluginname }}订单</view>
									<view class="f-20" @click="copy(item.orderno)">{{ item.orderno }}</view>
								</view>
								<view class="color-status f-22 f-w" style="line-height: 44upx;">{{ item.statusname }}</view>
							</view>
							<view class="user-msg dis-flex f-24 flex-y-center">
								<view class="m-right30 claMickname">{{ item.nickname }}</view>
								<view>{{ item.mobile }}</view>
								<image :src="imgfixUrls + 'centerMerchant/phone.png'" class="img" alt="" v-if="item.mobile" />
								<view class="blue" @click="kfPhone(item)" v-if="item.mobile">联系客户</view>
							</view>
							<view class="orderList-list-item-content dis-flex">
								<image class="orderList-img" :src="item.gimg" />
								<view class="dis-flex flex-dir-column flex-x-between">
									<view class="goods-name f-24">{{ item.gname || '' }}</view>
									<view class="dis-flex flex-x-between m-top10" v-if="!item.goodsarray">
										<view class="dis-flex goods-sku f-24">
											{{ item.optiontitle }}
											<view class="m-left10">×{{ item.num }}</view>
										</view>
										<view class="goods-price f-24">￥{{ item.price }}</view>
									</view>
									<view class="dis-flex flex-x-between" style="margin-bottom: 10upx;" v-if="item.goodsarray" v-for="(items,indexs) in item.goodsarray" :key="indexs">
										<view class="dis-flex goods-sku f-24">
											{{ items.name }}
											<view class="m-left10">×{{ items.num }}</view>
										</view>
										<view class="goods-price f-24">￥{{ items.money }}</view>
									</view>
								</view>
							</view>
							<view class="orderList-list-item-footer f-24" style="position: relative;" >
								<!-- <view class="footer-item dis-flex flex-x-between color-33" v-if="!!item.remark" >
									<view>备注:</view>
									<view>{{item.remark}}</view>
								</view> -->
								<view  v-if="item.express && item.plugin != 'housekeep'">
									<view style="padding: 20upx 0 10upx 0upx;display: flex;" v-if="item.express.name">
										<view style="width: 127upx;display: inline-block;text-align: left;color: #999999;"class="flex-box">
											<text >收货人</text>
										</view>
										<view style="padding-left: 10upx;text-align: right;"class="flex-box">
											<text @click="copy(item.express.name)">{{ item.express.name }}</text>
										</view>
									</view>
									
									<view style="padding-bottom: 10upx;display: flex;" v-if="item.express.tel">
										<view style="width: 127upx;display: inline-block;text-align: left;color: #999999;"class="flex-box">
											<text >收货人手机</text>
										</view>
										<view style="padding-left: 10upx;text-align: right;"class="flex-box">
											<text  @click="copy(item.express.tel)">{{ item.express.tel }}</text>
										</view>
									</view>
									
									<view style="padding-bottom: 10upx;display: flex;" v-if="item.express.address">
										<view style="width: 127upx;display: inline-block;text-align: left;color: #999999;"class="flex-box">
											<text >收货人地址</text>
										</view>
										<view style="padding-left: 10upx;text-align: right;"class="flex-box">
											<text @click="copy(item.express.address)">{{ item.express.address}}</text>
										</view>
									</view>
									
									
								</view>
								<view  v-if="item.express && item.plugin == 'housekeep'">
									<view style="padding-top: 10upx;display: flex;" v-if="item.express.address">
										<view style="width: 127upx;display: inline-block;text-align: left;color: #999999;"class="flex-box">
											<text >上门地址</text>
										</view>
										<view style="padding-left: 10upx;text-align: right;"class="flex-box">
											<text >{{ item.express.address}}</text>
										</view>
									</view>
									
									
								</view>
								
								<view class="footer-item dis-flex flex-x-end color-33" style="position: relative;padding-top: 15upx;">
									<view class="t-l " style="flex: 0.4;">
										<view style="padding-bottom: 10upx;display: flex;" v-if="item.remark">
											<view style="width: 127upx;display: inline-block;text-align: left;color: #999999;"class="flex-box">
												<text >备注</text>
											</view>
											<view style="padding-left: 10upx;"class="flex-box">
												<text >{{ item.remark }}</text>
											</view>
										</view>
									</view>
									<view class="t-r" style="flex: 0.6;">
										<view>共{{item.num}}件商品，合计：<text class="color-red">¥{{ item.price }}</text></view>
									</view>
								</view>
								<view  style="position: relative;left: 1%;top: 1%;" v-if="item.express || item.remark">
								<!-- <view style="padding-bottom: 10upx;" v-if="item.express.tel">
									<text style="width: 127upx;display: inline-block;text-align: right;color: #999999;">收货人手机</text><text style="padding-left: 10upx;">{{ item.express.tel }}</text>
								</view>
								<view style="padding-bottom: 10upx;" v-if="item.express.address">
									<text style="width: 127upx;display: inline-block;text-align: right;color: #999999;">收货人地址</text><text style="padding-left: 10upx;">{{ item.express.address }}</text>
								</view>
								<view style="padding-bottom: 10upx;" v-if="item.remark">
									<text style="width: 127upx;display: inline-block;text-align: right;color: #999999;">备注</text><text style="padding-left: 10upx;">{{ item.remark }}</text>
								</view>	 -->
								</view> 
								<view class="dis-flex" style="justify-content: flex-end;">
									<view class="footer-item lookform" @click="lookfrom(index)"  v-if="item.moinfoflag == 1">
										查看表单
									</view>
									<view class="flex-box" v-if="item.moinfoflag == 1">
										
									</view>
									<view class="footer-item dis-flex flex-x-end color-33" v-if="item.status == 1 && item.plugin !== 'citydelivery' && item.plugin !== 'housekeep'">
										<view class="btn" @click="goHx" >去核销</view>
									</view>
									<view class="footer-item dis-flex flex-x-end color-33"  v-if="item.refundflag == 1">
										<view class="btn" @click="tuiler(item)">退款</view>
									</view>
									<view class="footer-item dis-flex flex-x-end color-33"  v-if="item.status == 8 && item.plugin == 'citydelivery'">
										<view class="btn" @click="orderReceiving(item)">接单</view>
									</view>
									<view class="footer-item dis-flex flex-x-end color-33"  v-if="((item.plugin == 'housekeep' && orderInfo.hkhidefish != 1) || item.plugin == 'citydelivery') && (item.status == 1 || item.status == 4) && item.statusname !== '退款审核' && item.statusname !== '退款申请中'">
										<view class="btn" @click="accomplish(item)">完成</view>
									</view>
									<view class="footer-item dis-flex flex-x-end color-33" v-if="item.status == 8 && item.plugin !== 'citydelivery' && item.plugin !== 'housekeep'">
										<view class="btn"  @click="showPop(item, 8)">去发货</view>
									</view>
									<view class="footer-item dis-flex flex-x-end color-33"  v-if="item.status == 4 && item.plugin !== 'citydelivery' && item.plugin !== 'housekeep'">
										<view class="btn" @click="showPop(item, 4)">修改物流</view>
									</view>
								</view>
								<view style="overflow: hidden;">
									
								
								<view class="moinfoBox"  :class="{'checkisbox':item.check}">
									<view class="moinfoItem" v-for="(items,indexs) in item.moinfo" :key="indexs">
										<view class="dis-flex textItem" v-if="items.id == 'text' || items.id == 'select' || items.id == 'time' || items.id == 'textarea'">
											<view class="f-24">
												{{items.title}}
											</view>
											<view class="f-24 flex-box t-r">
												{{items.data}}
											</view>
										</view>
										<view class="dis-flex textItem" v-if="items.id == 'city' || items.id =='datetime'">
											<view class="f-24">
												{{items.title}}
											</view>
											<view class="flex-box t-r dis-flex flex-x-end">
												<view class="f-24" v-for="(cityItem,i) in items.data" :key="i">
													{{cityItem}}
													<text v-if="(items.data.length-1 != i) && items.id == 'city'">-</text>
														<text style="padding: 0 10upx;" v-if="(items.data.length-1 != i) && items.id != 'city'">至</text>
												</view>
											</view>
											
										</view>
										<view class="textItem" v-if="items.id == 'img'">
											<view class="f-24" style="padding-bottom: 20upx;">
												{{items.title}}
											</view>
											<view class="imgItem t-r dis-flex">
												<image :src="imgItem" v-for="(imgItem,imgindex) in items.data" :key="imgindex" @click="lookimg(items.data,imgindex)" mode=""></image>
											</view>
											
										</view>
									</view>
								</view>
								</view>
							</view>
						</view>
						<view class="tips">
							<loadmore :isMore="isMore"></loadmore>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
		<navBar :tabBarAct="3" v-if="0" />

		<!-- 发货弹框 -->
		<PopManager :show="popShow" :type="popType" @clickmask="closePop">
			<view class="popView">
				<view class="popViewPackage">
					<view class="popTitle">
						<view class="popTitlePackage"><span>填写发货信息</span></view>
						<view class="popTitleBody dis-flex1">
							<view class="titleBodyLeft1" v-if="!!items.express">
								<view><text class="textf">姓名 {{items.express.name}}</text></view>
								<view><text class="textf">电话 {{items.express.tel}}</text></view>
								<view><text class="textf">地址 {{items.express.address}}</text></view>
							</view>
							<view class="titleBodyRight1" @click="fz"><text>复制发货信息</text></view>
						</view>
					</view>
					<view class="popBody">
						<view class="popInput"><input placeholder="请输入快递单号" v-model="expresssn" v-if="popShow" /></view>
						<picker class="popPicker" @change="checkComparison" :value="index" :range="comparisonTable" range-key="name">
							<view class="popInput">
								<span>{{ comparisonTable[index].name }}</span>
							</view>
						</picker>
						<view class="popButton" @click="sendGoods"><span>确认发货</span></view>
					</view>
				</view>
			</view>
		</PopManager>
		<!-- 发货弹框 -->
		<!-- 上传图片弹窗 -->
		<PopManager :show="uploadShow" :type="'center'" @clickmask="uploadPop">
			<view class="uploadDiv">
				<view class="imgPreview" v-if="thumb != ''">					<image :src="thumb" />					<image :src="imgfixUrls + 'merchant/close.png'" class="close" @click="closeImg(1)" />				</view>					<!-- 图片预览循环模板 -->				<view class="userImgUpdata" @click="updataImg(1)" v-else>						<image :src="imgfixUrls + 'merchant/addImg.svg'" />				</view>
				<view class="dis-flex">
					<view class="closeDiv" @click="uploadPop">
						取消
					</view>
					<view class="flex-box">
						
					</view>
					<view class="accomplish" @click="iFinished">
						完成
					</view>
				</view>
			</view>
		</PopManager>
	</view>
</template>
<script>
	import App from '@/common/js/app.js';
	// #ifdef H5
	import wxApi from '@/common/js/wxApi.js';
	// #endif
	import Loadlogo from '@/components/template/loadlogo';
	import navBar from '@/components/template/navBar.vue';
	import PopManager from '@/components/template/PopManager';
	import nonemores from '@/components/template/nonemores.vue';
	import loadmore from '@/components/template/loadmore.vue';
	export default {
		data() {
			const date = new Date();
			const years = [];
			const year = date.getFullYear();
			const months = [];
			const month = date.getMonth() + 1;
			const days = [];
			const day = date.getDate();
			for (let i = 1990; i <= date.getFullYear(); i++) {
				years.push(i);
			}
			for (let i = 1; i <= 12; i++) {
				months.push(i);
			}
			for (let i = 1; i <= 31; i++) {
				days.push(i);
			}
			return {
				isMore: true,
				indexs: 0,
				typeList: [],
				popIndex: null,
				keyword: '',
				orderid: null,
				ordertype: null,
				expressname: null,
				expresssn: '',
				alias: null,
				edit_flag: null,
				comparisonTable: [],
				array: ['中国', '美国', '巴西', '日本'],
				index: 0,
				popType: 'center',
				scrollHeight: null,
				typeShow: 'bottom',
				popShow: false,
				scdpText: '',
				orderlist: [],
				orderInfo: {},
				storeid: null,
				pagetotal: null,
				type: '',
				status: 0,
				sort: '',
				time: '',
				page: 1,
				loadlogo: true,
				shopShow: '',
				filterDialog: true,
				title: 'picker-view',
				years,
				year,
				months,
				month,
				days,
				day,
				value: [9999, month - 1, day - 1],
				visible: true,
				indicatorStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth / (750 / 100))}px;`,
				userid: null,
				items: {},
				itemis:{},
				idos:true,
				uploadShow:false,
				thumb:'',
				thumbeg:''
			};
		},
		components: {
			Loadlogo,
			navBar,
			PopManager,
			nonemores,
			loadmore
		},
		computed: {},
		onShow() {},
		onLoad(e) {
			let _this = this;
			if (!!e.userid) {
				_this.userid = e.userid;
			} else {
				_this.userid = '';
			}
			if (!!e.storeid) {
				// _this.storeid = e.storeid;
				// uni.setStorageSync('checkStoreid', e.storeid);
				_this.storeid = e.sid;
			} else {}
			_this.init();
		},
		watch: {
			popShow: {
				handler() {
					let _this = this;
					if (_this.popShow == false) {
						_this.index = 0;
						_this.expressname = _this.comparisonTable[0].name;
						_this.alias = _this.comparisonTable[0].alias;
						_this.expresssn = '';
					}
				}
			}
		},
		mounted() {},
		methods: {
			lookfrom(index){
				let _this = this;
				_this.orderlist.map((item,ins)=>{
					if(ins == index && !item.check){
						_this.$set(item,'check',true);
					}else{
						_this.$set(item,'check',false);
					}
				});
				_this.loadlogo = !_this.loadlogo;
				_this.loadlogo = !_this.loadlogo;
				
			},
			lookimg(imgs,img){
				uni.previewImage({					
					current: imgs[img],					
					urls: imgs,
					});
			},
			closeImg(type){
				this.thumb = '';
				this.thumbeg = '';
			},
			async updataImg(type) {
				let _this = this;
				// #ifdef H5
				if(App.getClientType() == 2){
					let res = await App.browser_upload(1);
				    console.info(res);
				    for (let i = 0; i < res.tempFilePaths.length; i++) {
				    	let aa = await App._upLoad(res.tempFilePaths[i]);
				    	if (type == 1) {
				    		_this.thumb = aa.data.img;
				    		_this.thumbeg = aa.data.image;
				    		// _this.goodsInfo.goods.thumb = aa.data.img;
				    	}
				    	if (type == 2) {
				    		_this.thumbs.push(aa.data.img);
				    		_this.goodsInfo.goods.thumbs.push(aa.data.img);
				    	}
				    }
					return
				}
				wxApi.choseImage(res => {
					wxApi.uoloadIg(res.localIds[0], data => {
						if (data.errMsg === 'uploadImage:ok') {
							uni.showLoading({});
							let requestData = {
								upload_type: 2,
								id: data.serverId
							};
							App._post_form(
								'&do=uploadFiles',
								requestData,
								res => {
									if (res.errno === 0) {
										if (type == 1) {
											_this.thumb = res.data.img;
											_this.thumbeg = res.data.image;
											// _this.goodsInfo.goods.thumb = res.data.img;
										}
										if (type == 2) {
											_this.thumbs.push(res.data.img);
											_this.goodsInfo.goods.thumbs.push(res.data.img);
										}
									}
								},
								false,
								() => {
									uni.hideLoading();
								}
							);
						} else {
							uni.hideLoading();
							App.showError('上传失败');
						}
					});
				});
				// #endif
				// #ifndef H5
				wx.chooseImage({
					count: 1,
					sourceType: ['album', 'camera'],
					success: async function(res) {
						console.info(res);
						for (let i = 0; i < res.tempFilePaths.length; i++) {
							let aa = await App._upLoad(res.tempFilePaths[i]);
							if (type == 1) {
								_this.thumb = aa.data.img;
								_this.thumbeg = aa.data.image;
								// _this.goodsInfo.goods.thumb = aa.data.img;
							}
							if (type == 2) {
								_this.thumbs.push(aa.data.img);
								_this.goodsInfo.goods.thumbs.push(aa.data.img);
							}
						}
					}
				});
				// #endif
			},
			iFinished(){
				let item = this.itemis;
				App.showError(
					`确认完成此订单？`,
					data => {
						if (data.confirm) {
							if(item.plugin == 'housekeep'){
								
								let data = {
									channel: 1,
									id: item.i
								};
								App._post_form(
									`&p=housekeep&do=finishOrder`,
									data,
									res => {
										console.log(res);
										uni.showToast({
											title: res.message
										});
										this.uploadShow = false;
										this.thumb = '';
										this.thumbeg = '';
										this.changeStatus();
									},
									false,
									() => {}
								);
							}else{
								this.allWithdrawal(item);
								this.uploadShow = false;
								this.thumb = '';
								this.thumbeg = '';
							}
						}
					},
					true
				);
				console.log(item);
			},
			uploadPop(){
				this.uploadShow = false;
				this.thumb = '';
				this.thumbeg = '';
			},
			copy(text){
				//#ifdef H5
					App.clipboard(text);
				//#endif
				//#ifndef H5
					uni.setClipboardData({
					    data: text,
					    success: function () {
					        uni.showToast({
					        	title:`复制成功`,
								icon:'none'
					        })
					    }
					});
				//#endif
				
			},
			ido(){
				this.idos = false;
			},
			allWithdrawal(item){
				let data = {
					id:item.id,
					type:2,
					fishimg:this.thumbeg
				}
				App._post_form(`&p=citydelivery&do=finishOrder`, data, res => {
					console.log(res);
					uni.showToast({
						icon: "none",
						title: res.message,
						duration: 2000
					});
					this.changeStatus();
				});
			},
			tuiler(item){
				App.showError(
					`确认发起退款？`,
					data => {
						if (data.confirm) {
							!!data && this.tuilers(item);
						}
					},
					true
				);
			},
			tuilers(item){
				App._post_form(`&p=store&do=storeRefund&id=${item.id}&plugin=${item.plugin}`, {}, res => {
					console.log(res);
					uni.showToast({
						icon: "none",
						title: res.message,
						duration: 2000
					});
					this.changeStatus();
				});
			},
			// 接单
			orderReceiving(item){
				App.showError(
					`确认接单?`,
					data => {
						if (data.confirm) {
								let data = {
									orderid: item.id
								};
								App._post_form(
									`&p=citydelivery&do=acceptOrderApi`,
									data,
									res => {
										console.log(res);
										uni.showToast({
											title: res.message
										});
										this.changeStatus();
									},
									false,
									() => {}
								);
						}
					},
					true
				);
			},
			// 外卖订单完成
			accomplish(item){
				this.itemis = item;
				if(this.orderInfo.fishimg == 1){
					this.uploadShow = true;
					return
				}
				App.showError(
					`确认完成此订单？`,
					data => {
						if (data.confirm) {
							if(item.plugin == 'housekeep'){
								
								let data = {
									channel: 1,
									id: item.i,
									
								};
								App._post_form(
									`&p=housekeep&do=finishOrder`,
									data,
									res => {
										console.log(res);
										uni.showToast({
											title: res.message
										});
										this.changeStatus();
									},
									false,
									() => {}
								);
							}else{
								this.allWithdrawal(item);
							}
						}
					},
					true
				);
			},
			fz() {
				let _this = this
				console.info(_this.items)
				//#ifdef H5
					App.clipboard('姓名:' + _this.items.express.name + ',电话:' + _this.items.express.tel + ',地址:' + _this.items.express.address);
				//#endif
				uni.setClipboardData({
					data: '姓名:' + _this.items.express.name + ',电话:' + _this.items.express.tel + ',地址:' + _this.items.express.address,
					success: function() {
						uni.showToast({
							icon: "none",
							title: '复制成功',
							duration: 2000
						});
					}
				});
			},
			init() {
				let _this = this;
				uni.getSystemInfo({
					success(res) {
						_this.phoneHight = res.windowHeight;
						_this.scrollHeight = _this.phoneHight - 65 + 'px';
					}
				});
				uni.getStorage({
					key: 'checkStoreid',
					success: function(res) {
						_this.storeid = res.data;
						_this.getOrderList(res.data);
					}
				});

				_this.getComparisonTable();
			},
			kfPhone(item) {
				let _this = this;
				uni.showModal({
					title: '联系客户',
					content: item.mobile,
					success: function(res) {
						if (res.confirm) {
							uni.makePhoneCall({
								phoneNumber: item.mobile //仅为示例
							});
						} else if (res.cancel) {}
					}
				});
			},
			closePop() {
				let _this = this;
				_this.popShow = false;
			},
			search(e) {
				let _this = this;
				_this.indexs = e.detail.value;
				_this.type = _this.typeList[e.detail.value].value;
				_this.doSearch();
			},
			doSearch() {
				let _this = this;
				_this.page = 1;
				_this.isMore = false;
				let data = {
					storeid: _this.storeid,
					type: _this.type,
					status: _this.status,
					sort: _this.sort,
					time: _this.time,
					page: _this.page,
					keyword: _this.keyword,
					getinfoflag: 1,
					cc_id: ''
				};
				App._post_form('&p=store&do=orderList', data, res => {
					_this.orderlist = res.data.orderlist;
					_this.orderlist.map(item=>{
						item.check = false;
					})
					_this.orderInfo = res.data;
					_this.pagetotal = res.data.pagetotal;
					_this.isMore = true;
				});
			},
			// 手机端发货接口
			sendGoods() {
				let _this = this;
				let data = {
					orderid: _this.orderid,
					ordertype: _this.ordertype,
					expressname: _this.expressname,
					expresssn: _this.expresssn,
					alias: _this.alias,
					edit_flag: _this.edit_flag
				};
				App._post_form('&p=pay&do=sendGoods', data, res => {
					_this.doSearch();
					_this.popShow = false;
					uni.showToast({
						icon: 'none',
						title: '操作成功',
						duration: 2000
					});
				});
			},
			load() {
				let _this = this;
				if (_this.pagetotal == _this.page) {
					_this.isMore = true;
				} else {
					_this.page++;
					_this.getOrderList();
				}
			},
			changeStatus(status) {
				let _this = this;
				_this.status = status;
				_this.page = 1;
				_this.isMore = false;
				let data = {
					userid: _this.userid,
					storeid: _this.storeid,
					type: _this.type,
					status: _this.status,
					sort: _this.sort,
					time: _this.time,
					page: _this.page,
					getinfoflag: 1
				};
				App._post_form('&p=store&do=orderList', data, res => {
					_this.orderlist = res.data.orderlist;
					_this.orderlist.map(item=>{
						item.check = false;
					})
					_this.orderInfo = res.data;
					_this.pagetotal = res.data.pagetotal;
					_this.isMore = true;
				});
			},
			showPop(item, index) {
				let _this = this;
				_this.popShow = true;
				_this.popIndex = index;
				_this.items = item;
				console.info('items', item)
				if (index == 8) {
					_this.orderid = item.id;
					_this.ordertype = item.a;
					_this.edit_flag = 0;
				} else {
					_this.edit_flag = 1;
					_this.orderid = item.id;
					_this.ordertype = item.a;
					_this.expresssn = item.express.expresssn;
					for (let i = 0; i < _this.comparisonTable.length; i++) {
						if (item.express.expressname == _this.comparisonTable[i].alias) {
							_this.expressname = _this.comparisonTable[i].name;
							_this.alias = _this.comparisonTable[i].alias;
							_this.index = i;
							console.info(_this.index);
						}
					}
				}
			},
			// 获取快递公司列表
			getComparisonTable() {
				let _this = this;
				let data = {};
				App._post_form('&p=pay&do=getComparisonTable', data, res => {
					_this.comparisonTable = res.data;
					_this.expressname = _this.comparisonTable[0].name;
					_this.alias = _this.comparisonTable[0].alias;
				});
			},
			checkComparison(e) {
				let _this = this;
				if (_this.popIndex == 8) {
					_this.index = e.detail.value;
					_this.expressname = _this.comparisonTable[_this.index].name;
					_this.alias = _this.comparisonTable[_this.index].alias;
				} else {
					_this.index = e.detail.value;
					_this.expressname = _this.comparisonTable[_this.index].name;
					_this.alias = _this.comparisonTable[_this.index].alias;
				}
			},
			// 店铺订单列表
			getOrderList(storeid) {
				let _this = this;
				_this.isMore = false;
				let data = {
					userid: _this.userid,
					storeid: storeid || _this.storeid,
					type: _this.type,
					status: _this.status,
					sort: _this.sort,
					time: _this.time,
					page: _this.page,
					getinfoflag: 1
				};
				App._post_form('&p=store&do=orderList', data, res => {
					_this.orderlist = [..._this.orderlist, ...res.data.orderlist];
					_this.orderlist.map(item=>{
						if(!item.check && item.check != false){
							item.check = false;
						}
					})
					_this.orderInfo = res.data;
					_this.pagetotal = res.data.pagetotal;
					_this.isMore = true;
					for (let key in res.data.typelist) {
						let obj = {
							label: res.data.typelist[key],
							value: key
						};
						_this.typeList.push(obj);
					}
					console.info(res.data.typelist);
				});
			},
			bindChange: function(e) {
				const val = e.detail.value;
				this.year = this.years[val[0]];
				this.month = this.months[val[1]];
				this.day = this.days[val[2]];
			},
			// 跳转
			goHx() {
				App.navigationTo({
					url: 'pages/subPages/merchant/merchantVerification/merchantVerification'
				});
			},
			navgateTo(e, navType) {
				let _this = this;
				switch (navType) {
					case 'contactway':
						App.navigationTo({
							url: 'pages/subPages/dealer/contactway/contactway'
						});
						break;
					case 'withdraw':
						App.navigationTo({
							url: 'pages/subPages/dealer/withdraw/withdraw'
						});
						break;
					case 'setshop':
						App.navigationTo({
							url: 'pages/subPages/dealer/setshop/setshop'
						});
						break;
					case 'order':
						App.navigationTo({
							url: 'pages/subPages/merchant/merchantUserCenter/merchantUserCenter'
						});
						break;
					case 'rank':
						App.navigationTo({
							url: 'pages/subPages/dealer/rank/rank'
						});
						break;
					case 'level':
						App.navigationTo({
							url: 'pages/subPages/dealer/level/level'
						});
						break;
					case 'client':
						App.navigationTo({
							url: 'pages/subPages/dealer/client/client'
						});
						break;
					case 'help':
						App.navigationTo({
							url: 'pages/subPages/dealer/richtext/setrich'
						});
						break;
					case 'gener':
						App.navigationTo({
							url: 'pages/subPages/dealer/gener/gener'
						});
						break;
					case 'poster':
						// #ifdef H5
						location.href = e.currentTarget.dataset.url;
						// #endif
						break;
					case 'shops':
						// #ifdef H5
						location.href = e.currentTarget.dataset.url;
						// #endif
						break;
				}
			}
		}
	};
</script>

<style lang="less">
	.textf {
		font-size: 24upx !important;
		color: #FFFFFF !important;
	}

	.popTitleBody {
		padding: 0 30upx;
	}

	.titleBodyRight1 {
		display: inline-block;
		vertical-align: top;
		height: 42upx;
		border: 1upx solid rgba(255, 255, 255, 1);
		border-radius: 21upx;

		>text {
			padding: 10upx;
			line-height: 42upx;
			width: 118upx;
			height: 20upx;
			font-size: 20upx;
			color: rgba(255, 255, 255, 1);
		}
	}

	.dis-flex1 {
		display: flex;
		justify-content: space-between;
	}

	.titleBodyLeft1 {
		width: 300upx;
		display: inline-block;
		vertical-align: top;
	}

	.popTitlePackage {
		text-align: center;

		>span {
			line-height: 80upx;
			font-size: 28upx;

			color: #ffffff;
		}
	}

	.popButton {
		margin: 20upx auto 0 auto;
		width: 480upx;
		height: 80upx;
		background: rgba(51, 136, 255, 1);
		border-radius: 40upx;
		text-align: center;

		>span {
			line-height: 80upx;
			font-size: 28upx;
			color: rgba(255, 255, 255, 1);
		}
	}

	.popInput {
		margin: 20upx auto 0 auto;
		width: 480upx;
		height: 80upx;
		background: rgba(246, 246, 246, 1);
		border-radius: 10upx;

		padding-left: 20upx;

		>input {
			height: 100%;
			width: 100%;
			background: rgba(246, 246, 246, 1);
			font-size: 24upx;

			color: rgba(51, 51, 51, 1);
		}

		>span {
			text-align: center;
			line-height: 80upx;
			font-size: 24upx;

			color: rgba(51, 51, 51, 1);
		}
	}

	.popTitle {
		width: 540upx;
		height: 271upx;
		background: linear-gradient(0deg, rgba(51, 136, 255, 1) 0%, rgba(80, 153, 255, 1) 100%);

		>span {
			font-size: 30upx;

			font-weight: bold;
			color: rgba(51, 51, 51, 1);
		}
	}
	
	.uploadDiv{
		// width: 70vw;
		padding: 30upx;
		border-radius: 20upx;
		background-color: #FFFFFF;
		.imgPreview {
		display: inline-block;
		overflow: hidden;
		width: 60vw;
		height: 60vw;
		background: gray;
		// margin-right: 37upx;
		margin-bottom: 10upx;
		border-radius: 10upx;
		position: relative;

		>image {
			width: 60vw;
			height: 60vw;
		}
		
	}
	
	.closeDiv{
		width: 200upx;
		height: 60upx;
		line-height: 60upx;
		background-color: #999999;
		border-radius: 60upx;
		text-align: center;
		font-size: 28upx;
		color: #FFFFFF;
		// margin-left: 30upx;
		margin-top: 30upx;
	}
	
	.accomplish{
		width: 200upx;
		height: 60upx;
		line-height: 60upx;
		background-color: #FF4444;
		border-radius: 60upx;
		text-align: center;
		font-size: 28upx;
		color: #FFFFFF;
		// margin-right: 30upx;
		margin-top: 30upx;
	}
	
	.userImgUpdata {
		width: 60vw;
		height: 60vw;
		background: rgba(246, 246, 246, 1);
		border: 1upx solid rgba(204, 204, 204, 1);
		border-radius: 10upx;
		text-align: center;
		> image {
			margin-top: 170upx;
			width: 100upx;
			height: 100upx;
		}
	}
	
	.close {
		width: 50rpx !important;
		height: 50rpx !important;
		position: absolute;
		top: 10rpx;
		right: 10rpx;
		z-index: 30;
	}
	}
	
	.popViewPackage {}

	.popView {
		padding-bottom: 20upx;
		overflow: hidden;
		width: 540upx;
		background: rgba(255, 255, 255, 1);
		border-radius: 10upx;
	}

	.tips {
		height: 80upx;
		text-align: center;

		>span {
			line-height: 80upx;
			font-size: 28upx;

			color: black;
		}
	}

	page {
		font-size: 0;
		background-color: #f6f6f6;
	}

	.scrollList {
		background-color: #f6f6f6;
	}

	.color-33 {
		color: #333333;
	}

	.color-red {
		color: #ff4444;
	}

	.container {
		.orderList-header {
			z-index: 2;
			position: fixed;
			top: 0upx;
			left: 0;
			right: 0;
		}

		.topNav {
			// top: 88upx;
			// width: 750upx;
			// height: 86upx;
			background: rgba(255, 255, 255, 1);
			display: flex;
			justify-content: space-between;

			.line {
				position: absolute;
				opacity: 0;
				bottom: 0;
				display: inline-block;
				width: 48upx;
				height: 7upx;
				left: 50%;
				transform: translateX(-50%);
				background: #3388ff;
				border-radius: 4px 4px 0px 0px;
			}

			>view {
				text-align: center;
				width: 20%;
				display: inline-block;

				>view {
					height: 81upx;
					margin: auto;
					border-bottom: 4upx solid rgba(0, 0, 0, 0);
					position: relative;

					>span {
						line-height: 85upx;
						font-size: 24upx;

						color: rgba(51, 51, 51, 1);
					}
				}
			}
		}

		.check {
			.line {
				opacity: 1;
			}

			>span {
				font-size: 28upx !important;

				font-weight: 500 !important;
				color: #3388ff !important;
			}
		}

		// 搜索栏内容
		.search-main {
			.search-box {
				.search-input {
					position: relative;
					padding: 0 60upx 0 80upx;
					margin-right: 40upx;
					background: rgba(246, 246, 246, 1);
					height: 76upx;
					border-radius: 38upx;
					flex: 1;

					input {
						width: 100%;
						height: 100%;
					}

					.icon.icon-sousuo {
						position: absolute;
						top: 50%;
						transform: translateY(-50%);
						left: 30upx;
					}
				}

				.search-select {
					width: 100upx;
					white-space: nowrap;
					color: #333333;

					.icon {
						margin-left: 10upx;
						color: #999999;
					}
				}
			}
		}

		//权限名字
		.permission-name {
			font-size: 28upx;

			color: rgba(153, 153, 153, 1);
		}

		// 头部内容
		.pages-header {
			width: 100%;
			height: 400upx;
			background-repeat: no-repeat;
			background-size: 100% 400upx;
		}

		// 详情内容
		.orderList {
			background-color: #ffffff;

			// padding-bottom: 100upx;
			.orderList-search {
				padding: 30upx;
				background-color: #ffffff;
			}

			.orderList-body {
				padding: 30upx;
				margin-top: 206upx;
				background-color: #f6f6f6;

				.orderList-list-item {
					padding: 30upx;
					border-radius: 10upx;
					background: #ffffff;

					.user-msg {
						padding: 25upx 30upx;
						background: rgba(248, 248, 248, 1);
						border-radius: 8upx;
						color: #999999;

						.blue {
							color: #2196f3;
						}

						.img {
							margin: 0 15upx 0 43upx;
							height: 34upx;
							width: 34upx;
						}
						.claMickname{
							width: 180upx;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
						}
					}

					.orderList-list-item-header {
						padding-bottom: 28upx;

						.color-status {
							color: #3388ff;
						}

						.tag {
							padding: 4upx;
							border: 1px solid #ff4444;
							border-radius: 4upx;
							text-align: center;
							font-size: 17upx;
							margin-right: 5upx;
							color: #ff4444;
						}
					}

					.orderList-list-item-content {
						padding: 30upx 0;
						border-bottom: 1px solid rgb(238, 238, 238);

						.orderList-img {
							width: 130upx;
							height: 130upx;
							border-radius: 4upx;
							margin-right: 30upx;
							flex-shrink: 0;
						}

						.goods-name {
							color: #000000;
							line-height: 36upx;
						}

						.goods-sku {
							color: #999999;
						}
					}
					
					.checkisbox{
						height: auto!important;
						transform: translateY(0%)!important;
						// animation: scale 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;
						transition: all 0.3s ease-in-out;
						opacity: 1!important;
					}
					
					.moinfoBox{
						overflow: hidden;
						// transform: scale(0.1);
						transform: translateY(-50%);
						height: 0;
						opacity: 0.1;
						transition: all 0.3s ease-in-out;
						.moinfoItem{
							.textItem{
								padding: 20upx 0;
								.imgItem{
									display: flex;
									flex-wrap: wrap;
									// justify-content: space-around;
									justify-content: flex-start;
									image{
										flex: 0.30;
										min-width: 30%;
										height: 195upx;
										margin-bottom: 20upx;
										margin-right: 21upx;
										border-radius: 10upx;
									}
								}
								.imgItem:after {
									content: "";
									flex: 0.30;
									min-width: 30%;
									
								}
							}
						}
					}
					
					.orderList-list-item-footer {
						.footer-item {
							padding-top: 30upx;
							padding-right: 20upx;

							.btn {
								width: 109upx;
								height: 50upx;
								line-height: 50upx;
								text-align: center;
								background: #3388ff;
								color: #ffffff;
								font-size: 24upx;
								border-radius: 25upx;
							}
						}
						.lookform{
							border: 1upx solid #999999;
							color: #999999;
							border-radius: 10upx;
							padding: 0;
							margin: 30upx 20upx 0 0;
							// width: 120upx;
							padding: 0 20upx;
							line-height: 50upx;
						}
					}
				}
			}
		}
	}
</style>
