<template>
	<view>
		<view class="form">
			<view class="form-item-title">产品标题</view>
			<view class="form-input-box">
				<input placeholder-class="form-input-placeholder" placeholder="请输入产品标题"/>
			</view>
			<view class="form-item-title">产品链接</view>
			<view class="form-input-box ddflex">
				<input class="flex" v-model="productLink" placeholder-class="form-input-placeholder" placeholder="请填写或粘贴产品链接"/>
				<view class="clear-btn">清空</view>
			</view>
			<view class="next-btn" @click="submit">保存</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	const req = require("../../utils/request.js");

	export default {
		components: {},
		props: {},
		data() {
			return {
				systems: {},
				isTop:0,
				productLink:''
			}
		},
		onLoad(options) {

		},
		onShow() {
			
		},
		methods: {
			submit(){
				let pages = getCurrentPages();
				var prevPage = pages[pages.length - 2];
				if (prevPage) {
					prevPage.$vm.setData({
						productLink: this.productLink
					});
				}
			}
		},
		mounted() {
			const systemInfo = uni.getSystemInfoSync();
			// px转换到rpx的比例
			let pxToRpxScale = 750 / systemInfo.windowWidth;
			let systems = {
				ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
				navigationHeight: 44 * pxToRpxScale // 导航栏的高度
			};
			systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
			this.systems = systems;
		},
		onPageScroll: function(e) {
			if (e.scrollTop > this.systems.barHeight) {
				this.isTop = 1;
			} else {
				this.isTop = 0;
			}
		}
	}
</script>

<style>
	@import "./productLink.css";
</style>