<template>
	<view>
		<view class="searchBox flex-between">
			<view class="flex-center">
				<u-search placeholder="请输入订单号" style="width:600rpx" bg-color="#fff" height="60" :show-action="false" v-model="keyword"></u-search>
			</view>
			<view class="flex-center">
				取消
			</view>
		</view>
		<!-- <view>
			<saleAfterOrderItem
			  :data="item"
			  :orderType="orderType"
			  @update="updateList"
			  v-if="orderType === 2"
			/>
		</view> -->
	</view>
</template>

<script>
import tabbar from "./components/tabbar.vue";
import orderItem from "./components/orderItem.vue";
import saleAfterOrderItem from "./components/saleAfterOrderItem.vue";
export default {
  components: {
    tabbar,
    orderItem,
    saleAfterOrderItem,
  },
  data() {
    return {
      orderType: 1, //1普通订单，2售后订单
      loading: false,
      status: "loadmore",
      loadText: {
        loadmore: "轻轻上拉，加载更多",
        loading: "努力加载中",
        nomore: "没有更多了",
      },
      page_count: 1,
      msg: {
		pageIndex: 1,
		pageSize: 15,
		Name: "",
		OrderSource: 0,
		OrderType: 0,
		DeliveryMethod: 0,
		OrderId: 0,
		StartTime: "",
		EndTime: "",
		OrderStatus: 0,
		OrderNo: "",
		MerchantsNo: "",
		UserName: "",
		UserId: "",
		GoodsName: "",
		Consignee: "",
		Mobile: "",
		ProductCode: "",
		Recycled: 2,
		AnchorName: "",
		IsSelectPayMoney: 0,
		IsOffline: -1,
      }
    };
  },
  methods: {
    lower(e) {
        if (this.msg.pageIndex < this.page_count) {
          this.msg.pageIndex++;
          this.status = "loading";
          if (this.timer) {
            clearTimeout(this.timer);
          }
          this.timer = setTimeout(async () => {
            await this.getList();
            clearTimeout(this.timer);
          }, 500);
        } else {
          this.status = "nomore";
        }
    },
    //普通订单数据
    getList() {
      this.loading = true;
      this.requestAdmin("/api/order/GetGoodsOrderPageList", this.msg, (res) => {
        this.loading = false;
        this.page_count = res.data.pageCount;
		console.log(res,'数据');
      });
    },
  },
  onLoad(options) {
    uni.setNavigationBarTitle({
      title: "订单管理",
    });
	if(options.OrderNo){
		this.msg.OrderNo = options.OrderNo
	}
	console.log(options,'options');
	this.getList();
  },
};
</script>


<style>
	.searchBox {
	  height: 90rpx;
	  background-color: #efeff4;
	  padding: 0 40rpx 0 20rpx;
	}
	.flex-between {
	  display: flex;
	  justify-content: space-between;
	  align-items: center;
	}
	.flex-center {
	  display: flex;
	  justify-content: center;
	  align-items: center;
	}
</style>
