<template>
	<view class="specs">
		<!-- 规格 -->
		<view class="specs_1" v-if="popupShow=='1'">
			111
		</view>
		<view class="specs_2" v-else-if="popupShow=='2'">
			222
		</view>
		<view class="specs_3" v-else>
			333
		</view>
	</view>
	<!-- 			<view class="info_3" v-else-if="popupShow=='2'">
				<scroll-view scroll-y="true" class="scroll-view">
					<view class="list" v-for="(item,index) in info.act" :key="index">
						<view class="list_1" @tap="toAct(item)">
							<view class="title_1">
								<view class="l">
									<text>{{item.tag||'暂无'}}</text>{{item.act_time.title}}
								</view>
								<view class="r">
									<text class="iconfont icon-jiantouyou"></text>
								</view>
							</view>
							<view class="title_2">
								<view class="text" v-if="item.type=='5'||item.type=='6'">{{item.text}}</view>
								<view class="time">{{item.config.time_start}}-{{item.config.time_end}}</view>
							</view>
							<view class="title_2" v-if="item.type=='2'">
								<view class="specList" v-for="(tag,indexx) in item.list" :key="indexx">
									<view class="name">规格:{{tag.spec_name}}</view>
									<view class="giftList" v-for="(tags,indexs) in tag.gift" :key="indexs"
										@tap.stop="tags.type=='0' && getDetail(tags)">
										<view class="left">
											<view class="goods">{{tags.goods_name}}{{tags.spec_name}}</view>
											<view class="goods">{{tags.desc}}</view>
											<view class="num">×{{tags.num}}</view>
										</view>
										<view class="right"><text class="iconfont icon-jiantouyou"></text>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="info_4" v-else>
				<view class="info_4">
					<scroll-view scroll-y="true" class="scroll-view">
						<view class="list-scroll-view">
							<view class="list" v-for="(item,index) in info.sets" :key="index">
								<view class="name"><text class="set">套装</text>{{item.name}}</view>
								<view class="set">
									<view class="set_1" v-for="(tag,indexx) in item.set" :key="indexx"
										@tap="toDeatil(tag)">
										<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''"
											mode="aspectFit">
										</image>
										<view class="goods textOver">{{tag.goods_name}}</view>
										<view class="spec textOver">{{tag.spec_name}}</view>
									</view>
								</view>
								<view class="bottom">
									<view class="money">
										共{{item.goods_total||0}}件，套装价：<text>￥{{item.sell_money||0}}</text>
									</view>
									<view class="add">
										<button size="mini" @tap="toSetMarket(item)">加入购物车</button>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
			</view> -->
	<!-- <view class="dialog" v-if="dialog.show==true" @tap="dialogClose">
				<view class="dialog_1" v-if="dialog.type=='1'">
					<swiper class="swiper" circular @change="diaSpecs" :current="is_specs">
						<swiper-item class="list" v-for="(item,index) in info.specs" :key="index">
							<view class="list_1">
								<image class="image"
									:src="item.file&&item.file.length>0?item.file[0].url:info.goods.file[0].url"
									mode="aspectFit"></image>
							</view>
							<view class="name">
								<text>{{item.name}}</text>
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view> -->
</template>

<script>
	export default {
		props: {
			goodsInfo: {
				type: Object,
			},
			specsInfo: {
				type: Object,
			},
			btn_type: {
				type: String
			},
			popupShow: {
				type: String
			},
			is_specs: {
				type: Number
			},
		},
		data() {
			return {
				// 商品图片
				goodsfileList: [],
				// 规格图片
				specfileList: [],
			};
		},
		methods: {
			diaView() {
				const that = this;
				that.$emit('diaView')
			},
			toSpecs(item) {
				const that = this;
				that.$emit('diaView', item)
			},
			toCount() {
				const that = this;
				that.$emit('toCount')
			},
			toMarket() {
				const that = this;
				that.$emit('toMarket')
			},
			toBuy() {
				const that = this;
				that.$emit('toBuy')
			},
			toGroup() {
				const that = this;
				that.$emit('toGroup')
			},
			toAct(item) {
				const that = this;
				that.$emit('toAct', item)
			},
			getDetail(item) {
				const that = this;
				that.$emit('getDetail', item)
			},
			toSetMarket(item) {
				const that = this;
				that.$emit('toSetMarket', item)
			},
		},
		watch: {
			specsInfo: {
				deep: true,
				immediate: true,
				handler(val) {
					if (val && val.file.length > 0) this.$set(this, `specfileList`, val.file)
				}
			},
			goodsInfo: {
				deep: true,
				immediate: true,
				handler(val) {
					if (val && val.file.length > 0) this.$set(this, `goodsfileList`, val.file)
				}
			}
		},
	}
</script>

<style lang="scss">
	.specs {
		.specs_1 {
			position: relative;
			display: flex;
			flex-direction: column;
			height: 54vh;

			.info_1 {
				position: relative;
				flex-grow: 1;

				.one {
					padding: 2vw;

					.one_1 {
						display: flex;
						margin: 0 0 2vw 0;
						padding: 0 0 2vw 0;
						border-bottom: 0.5vw solid var(--f9Color);

						.l {
							width: 25vw;
							height: 25vw;

							.image {
								width: 100%;
								height: 100%;
								border-radius: 5px;
							}
						}

						.r {
							width: 70vw;
							padding: 0 0 0 2vw;

							.money {

								margin: 0 0 2vw 0;

								.money_2 {
									color: #23B67A;
									font-size: 20px;
									padding: 0 1vw 0 0;
									font-weight: bold;

									text {
										font-size: 14px;
									}
								}

								.money_1 {
									font-size: 20px;
									color: #ff0000;
									padding: 0 2vw 0 0;

									text {
										font-size: 14px;
									}
								}

								.money_1:last-child {
									font-size: 16px;
									color: #858585;
									text-decoration: line-through;

								}
							}

							.other_1 {
								font-size: 15px;
								color: #858585;

								text:last-child {
									color: #000000;
								}
							}
						}
					}

					.one_2 {
						margin: 0 0 2vw 0;
						border-bottom: 0.5vw solid var(--f9Color);

						.one_2_1 {
							font-size: 14px;
							margin: 0 0 2vw 0;
						}

						.one_2_2 {
							display: flex;
							flex-wrap: wrap;

							.list {
								background-color: #F5F5F5;
								margin: 0 2vw 2vw 0;
								padding: 0.5vw 1vw;
								border-radius: 5px;

								text {
									font-size: 14px;
									color: #000;
								}
							}

							.huilist {
								background-color: #DCDCDC;

								text {
									color: #858585;
								}
							}

							.redlist {
								background-color: #ff0000;

								text {
									color: #ffffff;
								}
							}

							.huiilist {
								background-color: #808080;

								text {
									color: #cccccc;
								}
							}
						}
					}

					.one_3 {
						display: flex;

						.one_3_1 {
							margin: 0 2vw 0 0;

							text {
								font-size: 14px;
								color: #858585;
							}

							.limit {
								color: #ff0000;
								padding: 0 0 0 2vw;
							}
						}
					}
				}
			}

			.info_2 {
				display: flex;
				text-align: center;
				justify-content: space-between;

				.btns {
					width: 50vw;
				}

				.btn {
					width: 100vw;
				}

				button {
					width: 100%;
					border-radius: 0;
					background-color: var(--fFB1Color);
					color: #fff;
					border: 1px solid #f1f1f1;
				}

				.btncolor {
					background: #f1f1f1;
					color: #858585;
				}
			}
		}
	}
</style>
