<template>
	<view style="position: relative;">
		<!-- 胶囊 -->
		<mvBar :mysNavConfig="mysNavConfig"></mvBar>
		<view style="margin-top: 160rpx;"></view>



		<view v-if="projectForm == 1">

			<view class="address">
				<view class="address_icon">
					<image style="width: 50rpx;height: 50rpx;" :src="picture.icon_loc" mode="">
					</image>
				</view>
				<view style="width: 70%;">
					<view style="display: flex;">
						<p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
						<p class='ipon'>{{address.phone_number}}</p>
					</view>
					<p class='ipon'>{{address.detail_addr}}</p>
				</view>
				<view class="address_edit" @click="editAddress()">
					<image :src="picture.icon_edit" mode="">
					</image>
				</view>
			</view>

			<view class="logistics1">
				<p style="margin-bottom: 10rpx;">物流公司：{{logistics.company_name}}</p>
				<p>物流单号：{{logistics.logistics_number}}</p>
			</view>
		</view>

		<view v-if="projectForm == 2" style="margin: 0 10%;">
			<p>券码信息：{{logistics.coupon_code_information}}</p>
		</view>

		<view v-if="projectForm == 3" style="margin: 0 10%;">
			<p style="margin-bottom: 30rpx;">探店时间</p>
			<p>{{logistics.explorestore_starttime}} &nbsp;&nbsp;至&nbsp;&nbsp;{{logistics.explorestore_endtime}}</p>
		</view>

	</view>
</template>

<script>
	import mvBar from "@/components/mys_navBar/mysNavBar";
	export default {
		components: {
			mvBar,
		},
		data() {
			return {
				address: {},
				taskId: "",
				projectForm: "",
				logistics: {},
				picture: {
					togoimg: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/task16.png',
					icon_edit: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-edit.png',
					icon_loc: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-loc.png',
					icon_right: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/icon-arrow-right.png',
					home8: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home8.png',
					home10: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home10.png',
					home11: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home11.png',
				},
				mysNavConfig: {
					/* 开启单页显示首页图标 */
					isHome: true,
					/* 固定导航  */
					navFixed: true,
					/* 标题 （屏幕中心居中 两边图标中心居中使用slot center1） */
					navTitle: {
						text: "物流信息",
						color: "",
						fontSize: "32rpx", // px upx rpx
						fontWeight: "normal", // 100 - 700
					},
					btnType: "type2",
					onLeftClick: '',
					/* type2 按钮 */
					type2Config: {
						// 左图标
						leftPath: "/static/img/png2.png",
						// 右图标
						rightPath: "/static/img/png4.png",
						// 圆角
						radius: "40rpx",
					},
				},
			}
		},
		onLoad(options) {
			let data = options.textObj.replace(/""/g, "");
			data = JSON.parse(decodeURIComponent(data))
			this.address = data.address
			this.taskId = data.taskId
			this.projectForm = data.projectForm

			uni.showLoading({
				title: '加载中'
			});
			this.getTaskInfo()
		},
		methods: {
			getTaskInfo() {
				this.$https.get('/youngee/c/t/g/get-task-logistics-info' +
					"?" +
					"task_id" +
					"=" +
					this.taskId
				).then(res => {
					this.logistics = res.data.data
					this.logistics.explorestore_starttime = this.logistics.explorestore_starttime.slice(0, 16)
					this.logistics.explorestore_endtime = this.logistics.explorestore_endtime.slice(0, 16)
					this.loading = false;
					uni.hideLoading();
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	p {
		font-size: 30rpx;
	}

	.address {
		display: flex;
		margin: 20rpx 0;
		// padding: 20rpx 20rpx;
		background-color: #FFFFFF;
		justify-content: space-around;
		align-items: center;

		.address_icon {
			width: 15%;
			vertical-align: middle;
			display: flex;
			justify-content: center;
		}

		.address_edit {
			width: 15%;
		}

		.address_edit image {
			vertical-align: middle;
			width: 50rpx;
			height: 50rpx;
			display: inline-block;
			padding-right: 14rpx;
		}

		.ipon {
			color: #333333;
			font-size: 30rpx;
			font-weight: 500;
			margin-bottom: 10rpx;
		}
	}

	.logistics1 {
		margin-left: 15%;
		margin-top: 50rpx;
	}
</style>
