<template>
	<!-- 填写寄件人信息 -->
	<view class="back">
		<view class="info">
			<view class="item u-flex u-row-between">
				<text class="title">{{i18n.senderinfo}}</text>
				<view class="u-flex">
					<u-icon name="order" color="rgba(0, 0, 0, 0.6)" size="23"></u-icon>
					<text class="wx">{{i18n.wxAddress}}</text>
				</view>
			</view>
			<view class="item u-flex ">
				<text class="left">{{i18n.name}}</text>
				<view class="right">
					<input type="text" :placeholder="i18n.Fill" />
				</view>
			</view>
			<view class="item u-flex ">
				<text class="left">{{i18n.phone}}</text>
				<view class="right">
					<input type="text" :placeholder="i18n.Fill" />
				</view>
			</view>
			<view class="item u-flex ">
				<text class="left">{{i18n.city}}</text>
				<view class="right">
					<input type="text" :placeholder="i18n.selection" disabled="" />
				</view>
			</view>
			<view class="item u-flex ">
				<text class="left">{{i18n.detailed}}</text>
				<view class="right">
					<input type="area" :placeholder="i18n.Fill" disabled="" />
				</view>
			</view>
			<view class="item u-flex ">
				<input type="area" :placeholder="i18n.company" />
			</view>
			<!-- 默认地址 -->
			<view class="u-flex u-row-between" style="margin-top: 22rpx;">
				<view class="u-flex">
					<view class="">
						<u-checkbox-group v-model="checkboxValue1" placement="row" @change="checkboxChange">
							<u-checkbox shape='circle' :customStyle="{marginRight: '4px'}" :name="name">
							</u-checkbox>
						</u-checkbox-group>
					</view>
					<text class="clear">{{i18n.initial}}</text>
				</view>
				<text class="clear">
					{{i18n.empty}}
				</text>
			</view>
		</view>
		<view class="history">{{i18n.history}}</view>
		<view class="add">
			<view class="">
				<text class="name">陈盼盼</text>
				<text class="phone">176****3298</text>
			</view>
			<view class="addinfo">江苏省南京市浦口区浦口大道东方万汇城北区</view>
		</view>
		<view class="bottom">
			<view class="btn">
				{{i18n.enter}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				checkboxValue1: [],
				name: 1
			};
		},
		computed: {
			i18n() {
				return this.$t('index')
			}
		},
		onShow() {
			uni.setNavigationBarTitle({
				title: this.i18n.goods
			})
		},
		methods: {
			addadress() {
				const obj = {
					mobile: this.model1.userInfo.phone,
					name: this.model1.userInfo.name,
					is_default: this.model1.userInfo.is_default ? 1 : 0,
					company_name: this.model1.userInfo.company,
					address: this.model1.userInfo.detailed,
					country_id: this.model1.userInfo.country_id,
				};
				uni.$u.http
					.post(`/api/address`, {
						...obj,
						...this.cityPid
					})
					.then((res) => {
						console.log(res);
						uni.navigateBack({
							delta: 1,
						});
					})
					.catch(() => {});
			},

			checkboxChange(n) {
				console.log('change', n);
			}
		}
	}
</script>

<style lang="scss">
	.back {
		padding: 20rpx 24rpx;
		box-sizing: border-box;

		.bottom {
			width: 750rpx;
			height: 166rpx;
			background: #FFFFFF;
			position: fixed;
			bottom: 0;
			left: 0;
			padding: 18rpx 24rpx;
			box-sizing: border-box;

			.btn {
				width: 702rpx;
				height: 88rpx;
				background: #F83224;
				border-radius: 44rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: #FFFFFF;
				line-height: 88rpx;
				text-align: center;
				font-style: normal;
			}
		}

		.add {
			width: 702rpx;
			// height: 160rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			padding: 24rpx;
			box-sizing: border-box;

			.addinfo {
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #222222;
				line-height: 34rpx;
				text-align: left;
				font-style: normal;
			}

			.name {
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #333333;
				line-height: 40rpx;
				text-align: left;
				font-style: normal;
			}

			.phone {
				font-family: SFPro, SFPro;
				font-weight: 400;
				font-size: 24rpx;
				color: #333333;
				line-height: 28rpx;
				text-align: left;
				font-style: normal;
				margin-left: 16rpx;
			}
		}

		.history {
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 30rpx;
			color: #333333;
			line-height: 42rpx;
			text-align: left;
			font-style: normal;
			margin: 28rpx 0 24rpx;
		}

		.info {
			padding: 28rpx 24rpx;
			box-sizing: border-box;
			width: 702rpx;
			// height: 742rpx;
			background: #FFFFFF;
			border-radius: 16rpx;

			.clear {
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #333333;
				line-height: 34rpx;
				text-align: left;
				font-style: normal;
			}

			.item {
				border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
				// height: 100rpx;
				min-height: 100rpx;
				padding: 20rpx 0;
				box-sizing: border-box;

				.title {
					font-family: PingFangSC, PingFang SC;
					font-weight: 600;
					font-size: 32rpx;
					color: #333333;
					line-height: 44rpx;
					text-align: left;
					font-style: normal;
				}

				.wx {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #333333;
					line-height: 34rpx;
					text-align: left;
					font-style: normal;
				}

				.left {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #222222;
					line-height: 40rpx;
					text-align: left;
					font-style: normal;
					width: 160rpx;
				}

				.right {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #222222;
					line-height: 40rpx;
					text-align: left;
					font-style: normal;
					margin-left: 60rpx;
				}


			}
		}
	}
</style>