<template>
	<view class="content">
		<view class="centerbox">
			<u--form labelPosition="left" :model="dataForm" ref="uForm">
				<u-form-item borderBottom :label="'联系方式'" label-width="200rpx" prop="phone">
					<u-input border="none" v-model="dataForm.phone" disabled placeholder-class="place-class"
          maxlength="20"
						class="border-color" :placeholder="'请输入'" />
				</u-form-item>

				<u-form-item borderBottom :label="'备注'" label-width="200rpx" prop="remark">
					<u-input border="none" v-model="dataForm.remark" placeholder-class="place-class"
						class="border-color" :placeholder="'请输入'" />
				</u-form-item>

				<view class="thetexts">
					<view class="text_title">
						{{'会员须知'}}
					</view>
					<view class="text_content">
						1.{{'提交申请后，系统将以站内信/短信/邮件的形式发送给您【自提码】，请注意保存！'}}
						</br>2.{{'自提时间：每日9：00至18：00'}}
						</br>3.{{'自提地址：山东省青岛市崂山区金家岭街道金岭广场1号楼13层101前台'}}
						</br>4.{{'获取自提码请尽快在1个工作日内完成自提，若未完成自提，系统将默认重新发货！'}}
					</view>
				</view>
			</u--form>
		</view>
		<view class="bottombtn">
			<u-button shape="circle" @click="submit" :text="'确认自提'" color="#FB3024"></u-button>
		</view>
		<u-popup class="thePopup" :show="successShow" mode="center" @close="successShow = false">
			<view class="successPopup">

				<view class="poupTop">
					<view class="theiconbox">
						<u-icon name="checkbox-mark" color="#ffffff" size="26"></u-icon>
					</view>
					<view class="theicontitle">
						{{'提交成功'}}
					</view>
				</view>
				<view class="poupContent">
					<!-- {{selfCode}} -->
					<text class="green">{{selfCode}}</text>
					<text class="copy" @click="copy(selfCode)">{{'复制'}}</text>
				</view>
				<view class="tipcontent">
					<view class="tip1">
						{{'提货地址'}}
					</view>
					<view class="tip2">
						{{'自提地址：山东省青岛市崂山区金家岭街道金岭广场1号楼13层101前台'}}</br>
						{{'提货电话'}}：400-111-2818
					</view>
				</view>
				<view class="poupBtn" @click="sureBtn">
					{{'确定'}}
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import * as sel from '@/config/selfService.js'
	export default {
		data() {
			return {
				dataForm: {
					remark: ""
				},
				selfCode: "",
				successShow: false,
        userInfo:''


			}
		},
		onLoad(query) {
			this.dataForm.phone = query.recPhone
			this.dataForm.orderCode = query.orderCode
			this.dataForm.remark = ""
      this.userInfo = uni.getStorageSync('User')
		},
		methods: {
			sureBtn() {
				this.successShow = false
				uni.navigateBack()
			},
			copy(data) {
				uni.setClipboardData({
					data: data,
					success: () => {
						uni.showToast({
							title: '复制成功'
						})
					}
				})
			},
			submit() {
				sel.saveSelfPick(this.dataForm).then((res) => {
					if (res.code == 200) {
						this.selfCode = res.data.selfCode
						// uni.showToast({
						// 	title: res.msg,
						// 	icon: 'none',
							
						// })
						this.successShow = true

					}
				})
			},


		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background: #F9F9F9;
		padding: 10rpx 12rpx;

		.centerbox {
			padding: 18rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 2rpx 10rpx 0rpx rgba(204, 204, 204, 0.4);
			border-radius: 10rpx 10rpx 0rpx 0rpx;

			.thetexts {
				font-size: 26rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #333333;
				margin-top: 40rpx;

				.text_title {
					margin-bottom: 16rpx;
				}

				.text_content {
					color: #999999;
					line-height: 40rpx;
				}
			}
		}

		.bottombtn {
			padding: 10rpx 30rpx 40rpx 30rpx;
			margin-top: 68rpx;
		}

		.successPopup {
			width: 560rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			padding: 26rpx 60rpx;

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

				.theiconbox {
					background-color: #029b00;
					border-radius: 50%;
					display: flex;
					align-content: center;
					justify-content: center;
				}

				.theicontitle {
					font-size: 30rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					margin-left: 13rpx;
					color: #333333;
				}
			}

			.poupContent {
				margin-top: 50rpx;

				text-align: center;

				.green {
					font-size: 36rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					color: #69A35B;
					margin-right: 18rpx;
				}

				.copy {
					font-size: 26rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #FB3024;
				}
			}

			.tipcontent {
				font-size: 26rpx;
				font-family: Source Han Sans CN;
				margin-top: 36rpx;

				.tip1 {
					color: #333333;

					font-weight: bold;
				}

				.tip2 {
					color: #666666;
					font-weight: 400;
					line-height: 42rpx;
				}

			}

			.poupBtn {
				background: #FB3024;
				border-radius: 39rpx;
				padding: 26rpx 0;
				display: flex;
				align-items: center;
				justify-content: center;
				color: #FFFFFF;
				margin-top: 70rpx;
				margin-bottom: 40rpx;
			}
		}
	}
</style>