<template>
	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
		<image class="bg_img" src="https://i.ringzle.com/file/20240129/3931d06eaa3346c9955aa7e5e535a95b.png"
			mode="widthFix"></image>
		<view class="account" :style="{'margin-top':(mt-44)+'px'}">
			<view class="a_left">
				<view class="al_avatar">
					<image :src="dto.shopSign"></image>
				</view>
				<view class="al_name_edit">
					<text>{{dto.linkName==''?'临时商户':dto.linkName}}</text>
					<view class="ane_edit" @tap="toTurn('/pagesHouse/Mine/PersonalEditing/PersonalEditing',true)">
						<text>编辑</text>
						<image src="https://i.ringzle.com/file/20240129/e824a765b6c24ac6aafbb49b12c23aa9.png"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="orders box">
			<view class="o_title">
				<text>我的订单</text>
				<view class="ot_all" @tap="toTurn('/pagesHouse/Mine/ordersList/index?type=',true)">
					<!-- <view class="ot_all" @tap="toToast"> -->
					<text>全部订单</text>
					<!-- <image src="../../static/index/steamerTicket/icon_yjt.png"></image> -->
				</view>
			</view>
			<view class="o_menus">
				<view v-for="(item,index) in orderMenus" :key="index"
					@tap="toTurn('/pagesHouse/Mine/ordersList/index?type='+item.type,true)">
					<!-- <view v-for="(item,index) in orderMenus" :key="index" @tap="toToast"> -->
					<image :src="item.img"></image>
					<text>{{item.text}}</text>
				</view>
			</view>
		</view>

		<view class="wallet box ">
			<view class="w_left">
				<view class="wl_top">
					<image src="https://i.ringzle.com/file/20240225/337c4c20cbc94bdcb4f17b6058a9d39f.png"></image>
					<text>钱包余额</text>
				</view>
				<view class="wl_price"><span>¥</span><text>{{price.toFixed(2)}}</text></view>
			</view>
			<view class="w_right" @tap="toTurn('/pagesMy/wallet/index',true)">去结算</view>
		</view>

		<view class="one" @tap="toTurn('/pagesHouse/Mine/Businesses/Businesses',true)">
			<view class="">
				商户信息
			</view>
			<view class="">
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>

		<view class="" style="padding: 24rpx; background-color: #fff; margin: 0 20rpx ; border-radius: 16rpx;">
			<view class="one-input">
				<u-row customStyle="margin-bottom: 10px">
					<u-col span="7.8">
						<view class="demo-layout bg-purple-light">
							<view class="one2">
								<!-- {{myList.islandName}} -->
								{{dto.name}}
							</view>
							<view class="two2">
								{{dto.address}}
							</view>
						</view>
					</u-col>
					<u-col span="4" @click="navigation">
						<view class="demo-layout bg-purple">
						</view>
					</u-col>
				</u-row>
			</view>
		</view>
		<Tabbares :tabbarid="2"></Tabbares>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				h: uni.getSystemInfoSync().windowHeight,
				w: uni.getSystemInfoSync().windowWidth,
				mt: uni.getSystemInfoSync().statusBarHeight + 44,
				avatar: 'https://i.ringzle.com/file/20240129/5b4a757190334fa7ae8616620c770bc4.png',
				name: '游客',
				orderMenus: [ //type:1 待付款、2 待使用、3 待评价、4 退款/售后
					{
						type: 0,
						img: 'https://i.ringzle.com/file/20240129/818fa751cf8d4772ac1cf818522a7f54.png',
						text: '待付款'
					},
					{
						type: 4,
						img: 'https://i.ringzle.com/file/20240129/c4ef5f92f5274dbe9e281ad509571fc3.png',
						text: '待使用'
					},
					{
						type: 3,
						img: 'https://i.ringzle.com/file/20240129/2a73e5e9afcf4d759b31e5332a21d012.png',
						text: '已完成'
					},
					{
						type: -3,
						img: 'https://i.ringzle.com/file/20240129/f3fd049aaffb4768aa115572851a2bb1.png',
						text: '退款/售后'
					}
				],
				price: 0, //钱包余额
				merchantName: uni.getStorageSync('merchantName'),
				dto: {}
			}
		},
		onLoad() {
			this.getInfo();
		},
		methods: {
			toTurn(url, login) { //login 是否需要验证登录跳转
				if (!url) return this.$showToast('正在开发中...')
				console.log(url);
				uni.navigateTo({
					url
				});


			},
			getInfo() {
				this.$api.get('/merchant/merchantFisherman/home/' + uni.getStorageSync('merchantId')).then(res => {
					console.log(res)
					if (res.data.code == 0) {
						this.dto = res.data.data;
						if (!res.data.data.shopSign) {
							this.dto.shopSign =
								'https://i.ringzle.com/file/20240225/26feb8cc8f744123a980211ebdfb8d40.png';
						}
						this.shopImgs = res.data.data.split(',');
						console.log(this.shopImgs)
					}
				})
			},
		}
	}
</script>
<style scoped lang="less">
	.page {
		background: #F5F8FA;
		padding-bottom: 256rpx;
		box-sizing: border-box;

		.bg_img {
			width: 100%;
			position: absolute;
			top: 0;
			left: 0;
			z-index: 0;
		}

		.account {
			width: 100%;
			display: flex;
			justify-content: space-between;

			.a_left {
				padding: 10rpx 0 0 40rpx;
				display: flex;
				z-index: 1;

				.al_avatar {
					width: 120rpx;
					height: 120rpx;
					border-radius: 50%;
					background: #FFFFFF;
					padding: 4rpx;
					box-sizing: border-box;

					image {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}

				.al_name_edit {
					margin-left: 30rpx;
					display: flex;
					flex-direction: column;

					&>text {
						font-size: 36rpx;
						font-family: PingFang-SC, PingFang-SC;
						font-weight: bold;
						color: #111111;
						line-height: 50rpx;
						padding-top: 4rpx;
					}

					.ane_edit {
						width: 120rpx;
						height: 54rpx;
						border-radius: 27rpx;
						border: 1rpx solid #D3D7DE;
						margin-top: 10rpx;
						display: flex;
						align-items: center;
						justify-content: center;

						&>text {
							font-size: 26rpx;
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							color: #5A697C;
							line-height: 37rpx;
						}

						&>image {
							margin-left: 8rpx;
							width: 24rpx;
							height: 24rpx;
						}
					}
				}
			}


		}

		.one {
			// padding: ;
			margin: 0 40rpx;
			height: 120rpx;
			line-height: 120rpx;
			display: flex;
			// border-bottom: 1rpx solid #EFEFEF;
			justify-content: space-between;
			align-items: center;
			font-size: 36rpx;
			color: #111111;
			font-weight: bold;
		}

		.box {
			width: calc(100% - 40rpx);
			margin: 0 20rpx;
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 20rpx;
			position: relative;
		}

		.bg-img {
			background-color: #F0F8F6 !important;
		}

		.one-input {
			box-sizing: border-box;
			// width: 100%;
			height: 128rpx;
			background: #F0F8F6;
			// line-height: 128rpx;
			border-radius: 16rpx;
			padding: 0 20rpx;
			// margin: 0 20rpx;

			.bg-purple-light {

				// display: flex;
				.one2 {
					// height: 36rpx !important;
					font-size: 26rpx;
					color: #000000;
					margin: 12rpx 6rpx;
					font-weight: bold;
				}

				.two2 {
					font-size: 24rpx;
					color: #666666;
					// height: 36rpx !important;
					margin: 6rpx 6rpx;
					font-weight: Regular;
				}
			}

			.bg-purple {
				// align-items: center;
				// display: flex;
				text-align: center;
				// text-align: right;
				font-size: 24rpx;
				color: #808080;
				background-image: url('https://i.ringzle.com/file/20240129/dcf2338517e344c697ef7cd853ce2234.png');
				background-repeat: no-repeat;
				background-size: 100% 100%;
				width: 240rpx;
				height: 128rpx;


				.one1 {
					margin: auto 110rpx;
					padding-top: 30rpx;
					width: 46rpx;
					height: 46rpx;

					image {
						width: 100%;
						height: 100%;
						// width: 46rpx;
						// height: 46rpx;
					}

				}

				.two1 {

					margin: 4rpx 12rpx;
					font-size: 22rpx;
					color: #007A69;

					text {
						margin-left: 30rpx;
					}
				}
			}
		}

		.wallet {
			margin-top: 32rpx;
			padding: 34rpx 40rpx 30rpx 31rpx;
			// background: url(https://i.ringzle.com/file/20240129/062264cb5e224845b86e4567c2ec37a6.png) no-repeat;
			// background-size: 100% 100%;
			background-color: #fff;
			display: flex;
			justify-content: space-between;

			.w_left {
				.wl_top {
					display: flex;
					align-items: center;

					image {
						width: 30rpx;
						height: 30rpx;
					}

					text {
						margin-left: 12rpx;
						font-size: 26rpx;
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						color: #111;
						line-height: 37rpx;
					}
				}

				.wl_price {
					margin-top: 17rpx;

					span {
						font-size: 36rpx;
						font-family: DINAlternate, DINAlternate;
						font-weight: bold;
						color: #111;
						line-height: 42rpx;
					}

					text {
						font-size: 48rpx;
						font-family: DINAlternate, DINAlternate;
						font-weight: bold;
						color: #111;
						line-height: 56rpx;
						margin-left: 10rpx;
					}
				}
			}

			.w_right {
				margin-top: 16rpx;
				width: 156rpx;
				height: 60rpx;
				// background: linear-gradient(270deg, #D6F6ED 0%, #FFFFFF 100%);
				background-color: #007A69;
				border-radius: 36rpx;
				line-height: 60rpx;
				text-align: center;
				font-size: 26rpx;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: bold;
				color: #FFFFFF;
			}

			.w_right-image {
				margin-top: 16rpx;
				width: 156rpx;
				// height: 60rpx;
				// background: linear-gradient(270deg, #D6F6ED 0%, #FFFFFF 100%);
				background-color: #007A69;
				background-image: url('https://i.ringzle.com/file/20240225/b918fbd7e3424908a10497c4e4f71fda.png');
				background-repeat: no-repeat;
				background-size: 100% 100%;
				border-radius: 36rpx;
				// line-height: 60rpx;
				text-align: center;
				font-size: 26rpx;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: bold;
				color: #FFFFFF;
			}
		}

		.orders {
			margin-top: 20rpx;
			padding: 40rpx 0;

			.o_title {
				width: 100%;
				padding: 0 20rpx;
				box-sizing: border-box;
				display: flex;
				align-items: center;
				justify-content: space-between;

				&>text {
					font-size: 36rpx;
					font-family: PingFang-SC, PingFang-SC;
					font-weight: bold;
					color: #1C1E41;
					line-height: 36rpx;
				}

				.ot_all {
					display: flex;
					align-items: center;

					&>text {
						font-size: 28rpx;
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						color: #808080;
						line-height: 28rpx;
					}

					&>image {
						margin-left: 8rpx;
						width: 24rpx;
						height: 24rpx;
					}
				}
			}

			.o_menus {
				margin-top: 44rpx;
				display: flex;
				align-items: center;
				justify-content: space-around;

				&>view {
					width: 25%;
					display: flex;
					flex-direction: column;
					align-items: center;

					image {
						width: 54rpx;
						height: 54rpx;
					}

					text {
						font-size: 26rpx;
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						color: #111111;
						line-height: 26rpx;
						margin-top: 24rpx;
					}
				}
			}
		}


	}
</style>