<template>
	<view class="page">
		<u-navbar title="详情" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
			height='58'></u-navbar>
        <view class="box">
        	<view class="shopname">
               {{listobj.name}}	
        	</view>
			<view class="shoplist">
				<view class="tit">
					基本信息
				</view>
				<view class="jiben">
					<text class="qian">ID：</text> <text class="shen">{{listobj.agentId}}</text>
				</view>
				<view class="jiben">
					<text class="qian">分成比例：</text> <text class="shen">{{listobj.point}}%</text>
				</view>
				<view class="jiben">
					<text class="qian">手机号码：</text> <text class="shen">{{listobj.mobile}}</text>
				</view>
				<view class="jiben">
					<text class="qian">创建时间：</text> <text class="shen">{{listobj.createTime}}</text>
				</view>
				<view class="jiben">
					<text class="qian">累计订单：</text> <text class="shen">{{listobj.orderCount}}单</text>
				</view>
			</view>
			<view class="icons">
				<image src="https://api.ccttiot.com/smartmeter/img/static/uJreernkkDxjqg7gM4vd" mode="" @click="btnpag(1)"></image>
				<image src="https://api.ccttiot.com/smartmeter/img/static/uYbxDwKqfER2BaDt0mSm" mode="" @click="btnpag(2)"></image>
				<image src="https://api.ccttiot.com/smartmeter/img/static/utOebuXrB5CSxJ7dyQFv" mode="" @click="btnpag(3)"></image>
			</view>
        </view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				storeId:'',
				listobj:{},
				flag:false,
				agentId:''
			}
		},
		onLoad(option) {
			this.agentId = option.agentId
			this.getxq()
		},
		methods: {
			getxq(){
				this.$u.get(`/agent/agent/${this.agentId}`).then(res => {
					if (res.code == 200) {
				        this.listobj = res.data
					}
				})
			},
			
			btnpag(num){
				if(num == 1){
					uni.navigateTo({
						url:'/page_user/listshu/quanxian?obj=' + JSON.stringify(this.listobj)
					})
				}else if(num == 2){
					uni.navigateTo({
						url:'/page_user/listshu/edit?obj=' + JSON.stringify(this.listobj)
					})
				}else if(num == 3){
					let vm = this
					uni.showModal({  
					    title: '提示',  
					    content: '你确定要注销这个代理吗？',  
					    success: function (res) {  
					        if (res.confirm) {  
								vm.$u.delete(`/agent/agent/${vm.agentId}`).then(res => {
									if (res.code == 200) {
										uni.showToast({
											title: '注销成功',
											icon: 'success',
											duration: 1000
										})
										setTimeout(()=>{
											uni.navigateBack()
										},1500)
									}else if(res.code == 500){
										uni.showToast({
											title: res.msg,
											icon: 'none',
											duration: 1000
										})
									}
								})
					        } else if (res.cancel) {  
					            console.log('用户点击了取消');  
					        }  
					    }  
					});
				}
			},

			 
		}
	}
</script>

<style lang="scss">
	/deep/ .u-title,
	/deep/ .uicon-nav-back {
		padding-bottom: 40rpx;
	}
	page {
		background: linear-gradient(180deg, #25CE88 0%, rgba(255, 255, 255, 0) 100%);
	}

	.page {
		width: 750rpx;
		position: fixed;
		top: 0;
		left: 0;
		.box{
			width: 750rpx;
			height: 1440rpx;
			background: #F4F5F7;
			border-radius: 0rpx 0rpx 0rpx 0rpx;
			padding: 22rpx 36rpx;
			box-sizing: border-box;
			.shopname{
				width: 680rpx;
				height: 102rpx;
				background: #FFFFFF;
				border-radius: 24rpx 24rpx 24rpx 24rpx;
				margin: auto;
				padding-left: 30rpx;
				padding-top: 30rpx;
				font-weight: 600;
				font-size: 32rpx;
				color: #3D3D3D;
			}
			.shoplist{
				padding: 30rpx;
				box-sizing: border-box;
				width: 680rpx;
				height: 330rpx;
				background: #FFFFFF;
				border-radius: 24rpx 24rpx 24rpx 24rpx;
				margin-top: 24rpx;
				.tit{
					font-weight: 600;
					font-size: 28rpx;
					color: #3D3D3D;
				}
				.jiben{
					margin-top: 16rpx;
					display: flex;
					justify-content: space-between;
					.qian{
						font-size: 24rpx;
						color: #808080;
						width: 40%;
						// margin-right: 20rpx;
					}
					.shen{
						font-size: 24rpx;
						color: #3D3D3D;
					}
				}
			}
			.icons{
				padding-top: 30rpx;
				padding-left: 50rpx;
				padding-right: 50rpx;
				box-sizing: border-box;
				width: 680rpx;
				height: 170rpx;
				background: #FFFFFF;
				border-radius: 24rpx 24rpx 24rpx 24rpx;
				margin: auto;
				display: flex;
				justify-content: space-between;
				margin-top: 26rpx;
				image{
					width: 96rpx;
					height: 96rpx;
				}
			}
		}
	}
</style>