<template>
	<view class="mySupplierList" :style="{'height':contentHeight}">
		<view style="width: 100%;height: 100%;">
			<u-empty v-if="g.length==0" text="暂无数据" mode="data"></u-empty>
			<template v-if="g.length > 0">
				<view  
				  style="
						height: calc(100vh);
						width: calc(100vw);
						overflow: hidden;
						padding: 10px 0;
				  ">
					<scroll-view
						:scroll-y="true"
						:enable-back-to-top="true"
						:enable-flex="true"
						@scrolltolower="lower"
						:style="{ height: '100%' }">
						<view style="display: flex;flex-direction: column;align-items: center;">
							<view v-for="(item, index) in g" :key="index" class="listbox" >
								<view>
									<view style="font-size: 14px;color: #000000;">{{item.Name}}</view>
									<view  style="font-size: 10px;color: #999999;margin-top: 5px;">{{item.Mobile}}</view>
								</view>
								<view style="display: flex;flex-direction: row;align-items: center;" @click="checkBL(item.SupplierCommissionList)">
									<text  style="font-size: 12px;color: #888888;">返佣比例查询</text>
									<u-icon name="arrow" size="24" color="#A5A4AC"></u-icon>
								</view>
							</view>
						</view>
							<!-- <u-loadmore
							  :status="status"
							  :load-text="loadText"
							  :font-size="24"
							  :margin-top="20"
							  :margin-bottom="20"
							  bg-color="#f3f4f6"
							/> -->
					</scroll-view>
					
				</view>
				<view class="agreementbox" v-if='isshowagreement==true'></view>
				<view class="agreementbox_t" v-if='isshowagreement==true'>
					<view class="agreement_b">
						<view style="width: 100%;height: 45px;font-size: 14px;color: #000000;display: flex;flex-direction: row;border-bottom: 1px solid #E2E2E2">
							<view class="popupstyle">
								<text>毛利率</text>
							</view>
							<view class="popupstyle">
								<text>返佣比例</text>
							</view>
						</view>
						<view style="width: 100%;max-height: 360px;font-size: 12px;color: #111111;display: flex;flex-direction: row;">
							<view style="width: 50%;display: flex;flex-direction: column;align-items: center;">
								<view class="popupstyle_t" v-for="(item, index) in supplierList" :key="index">
									<text>≤{{index+1}}0%</text>
								</view>
							</view>
							<view style="width: 50%;display: flex;flex-direction: column;align-items: center;">
								<view class="popupstyle_t" v-for="(item, index2) in supplierList" :key="index2">
									<text>{{item.CommissionRate}}%</text>
								</view>
							</view>
							
						</view>
						<u-icon name="close" style='position: absolute;left: 50%;bottom: -60px;margin-left: -30rpx;' color="#FFFFFF" size="60" @click='read'></u-icon>
						
					</view>
				</view>
			</template>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageTitle: "我的供应商",
				contentHeight:0,
				mainColor:'',
				secondary:'',
				g:[],
				isshowagreement:false,
				msg:{
					pageIndex: 1,
					pageSize:10,
					BillId:0
				},
				SelectBillState:0,
				page_count:1,
				status: "loadmore",
				loadText: {
				  loadmore: "轻轻上拉，加载更多",
				  loading: "努力加载中",
				  nomore: "没有更多了",
				},
				supplierList:[],
			}
		},
	
		created(){
			 this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
			 this.mainColor = this.$uiConfig.mainColor;
			 this.secondary = this.$uiConfig.secondary;
			
		},
		onLoad(options){
			uni.setNavigationBarTitle({
			  title: this.pageTitle,
			});
			 this.init()
		},
		mounted() {
			
		},
		methods: {
			init(){
				
				uni.showLoading({
					title: '加载中'
				});
				this.request2(
				  {
				  	url: '/api/AppletUser/GetUserMemberSupplier',
				  	data: {}
				  },
							
				  (res) => {
					 
					uni.hideLoading();
					
					this.g = res.data;
					// this.g = this.g.concat(res.data.pageData);
					
					// this.page_count = res.data.pageCount;
					// if (this.page_count == 1) {
					//   this.status = "nomore";
					// }
					
				  }
			);
			},
			
			lower(e) {
			 //  if (this.msg.pageIndex < this.page_count) {
				// this.msg.pageIndex++;
				// this.status = "loading";
				// this.init();
			 //  } else {
				// this.status = "nomore";
			 //  }
			},
			checkBL(list){
				this.isshowagreement = true;
				this.supplierList = list
			},
			read(){
				this.isshowagreement = false
			},
		}
	}
</script>

<style>
.mySupplierList{
	background: #FAF8F9;
	
}

	.mySupplierList .listbox{
		width: 100%;
		padding: 15px;
		background: #fff;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid #E2E2E2;
		
	}
	.mySupplierList .box_t{
		display: flex;
		flex-direction: row;
		align-items: center;
		width: 100%;
		overflow: hidden;
		height: 32px;
	}
	.mySupplierList .box_c{
		display: flex;
		flex-direction: row;
		align-items: center;
		width: 100%;
		overflow: hidden;
		margin-top: 15px;
	}
	.mySupplierList .box_c_name{
		text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		line-clamp: 1;
		-webkit-box-orient: vertical;
		font-size: 13px;
		color: #111111;
	}
	.mySupplierList .box_r_b{
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		margin-top: 3px;
	}
	.mySupplierList .OrderNoStyle{
		width: 100%;
		height: 35px;
		background: #F8F6F5;
		display: flex;
		flex-direction: row;
		align-items: center;
		font-size: 11px;
		color: #888888;
		margin-top: 15px;
		
	}
	.mySupplierList .agreementbox{
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		background: #333333;
		opacity: 0.3;
		z-index: 888;
	}
	.mySupplierList .agreementbox_t{
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 999;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.mySupplierList .agreementbox_t .agreement_b{
		width:80% ;
		border-radius: 10px;
		background: #fff;
		display: flex;
		flex-direction: column;
		align-items: center;
		min-height: 100px;
		position: relative;
		margin-top: -60px;
	}
	.mySupplierList .agreementbox_t .agreement_bottom{
		width: 100%;
		height: 50px;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.mySupplierList .agreement_b .popupstyle{
		width: 50%;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}
	.mySupplierList .agreement_b .popupstyle_t{
		width: 100%;
		height: 30px;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}
	
</style>
