<template>
	<!-- 快递导入 第二步 -->
	<view class="guidegoodstwo">
		<view class="prolist">
			<view class="proitems" v-for="(item,index) in checkedProList" :key="index">
				<view class="cellspro">标题:{{item.product_name}}</view>
				<view class="cellspro flex ali-c">
					<text>价格:</text>
					<input class="inputs" type="digit" value="" v-model="item.price" />
				</view>
			</view>
		</view>
		
		<view class="fixed_btns flex ali-c jus-c">
			<view class="submitbtnss" @tap="submitfun">提交</view>
		</view>
	</view>
</template>

<script>
	import {CopyAdd} from "@/utils/api/goods.js";
	export default {
		data() {
			return {
				checkedProList:[],
			}
		},
		onLoad() {
			this.checkedProList = uni.getStorageSync("checkedProList");
		},
		methods: {
			//提交修改的内容
			submitfun(){
				let checkedProList = this.checkedProList.map((item,index)=>{
					return {product_id:item.product_id,price:item.price}
				})
				CopyAdd({
					list:checkedProList,
				}).then((res)=>{
					if(res.code==0){
						this.$api.msg("提交成功,可在外卖商品列表查看!");
						setTimeout(()=>{
							uni.navigateBack({
								
							})
						},800)
					}else{
						this.$api.msg(res.msg);
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.guidegoodstwo{
		padding-bottom: 100upx;
	}
	.prolist{
		padding: 30upx;
	}
	.proitems{
		margin-bottom: 15upx;
		padding: 20upx 15upx;
		background-color: #FFFFFF;
		border-radius: 14upx;
		
	}
	.proitems .cellspro{
		color: #757575;
		font-size: 30upx;
		margin-top: 20upx;
	}
	.proitems .cellspro .inputs{
		height: 50upx;
		line-height: 50upx;
		border:1px solid #ccc;
		font-size: 30upx;
		box-sizing: border-box;
		padding: 0 20upx;
	}
	
	.fixed_btns{
		height: 120upx;
		width: 100%;
		background-color: #fff;
		position: fixed;
		left: 0;
		bottom: 0;
		padding: 0 40upx;
		box-sizing: border-box;
	}
	.fixed_btns .submitbtnss{
		width: 100%;
		background: #ff6900;
		color: #FFFFFF;
		font-size: 32upx;
		border-radius: 12upx;
		height: 88upx;
		line-height: 88upx;
		text-align: center;
	}
</style>
