<template>
	<view :class="[AppTheme]" class="container" v-if="cache">
		<view class="carousel">
			<u-swiper :list="appalbum" indicator indicatorMode="line" circular radius="0" height="750rpx" showTitle
				:autoplay="true" @click="previewImage(index)">
			</u-swiper>
		</view>
		<view class="introduce-section">
			<text class="title">{{ cache.name }}</text>
			<view class="price-box">
				<text class="price-tip">¥</text>
				<text class="price text-neutral">{{ cache.price }}</text>
				<text class="m-price">¥{{ cache.oprice }}</text>
				<!-- <text class="coupon-tip">7折</text> -->
			</view>
			<view class="bot-row">
				<text>销量: {{ cache.dissells }}</text>
				<text>单位: {{ cache.unit }}</text>
				<text>库存: {{ cache.num }}</text>
			</view>
		</view>

		<!--  分享 -->
		<view class="share-section">
			<view class="share-icon">
				<text class="yticon icon-xingxing"></text>
				返
			</view>
			<text class="tit">该商品分享可得佣金</text>
			<text class="yticon icon-bangzhu1"></text>
			<view class="share-btn" @click="opensharebox">
				<u-icon name="share" :color="primary" size="20"></u-icon>
			</view>
		</view>
		<view class="c-list">
			<view class="c-row b-b" @click="toggleSpec(0)">
				<text class="tit">购买类型</text>
				<view class="con">
					<text class="selected-text" v-for="(sItem, sIndex) in specSelected"
						:key="sIndex">{{ sItem.name }}</text>
				</view>
				<text class="yticon icon-you"></text>
			</view>
			<view class="c-row b-b">
				<text class="tit">温馨提示</text>
				<view class="bz-list con">
					<text>{{ cache.title }}</text>
				</view>
			</view>
			<!-- <view class="c-row b-b">
                <text class="tit">促销活动</text>
                <view class="con-list">
                    <text>新人首单送20元无门槛代金券</text>
                    <text>订单满50减10</text>
                    <text>订单满100减30</text>
                    <text>单笔购买满两件免邮费</text>
                </view>
            </view>
            <view class="c-row b-b">
                <text class="tit">服务</text>
                <view class="bz-list con">
                    <text>7天无理由退换货 ·</text>
                    <text>假一赔十 ·</text>
                </view>
            </view>      -->
		</view>
		<view v-if="ifpeon" class="sel">
			<view>
				<u-checkbox-group size='35rpx' active-color="green" @change="checkboxChange">
					<u-checkbox name='tgxy' shape="circle" :checked="isChecked"></u-checkbox>
				</u-checkbox-group>
			</view>
			<text class="text" @click="goContract(partyinfo.id, 2)">
				阅读并同意
				<text class="text-primary">《{{ partyinfo != null ? partyinfo.name : '暂无' }}》</text>
			</text>
		</view>
		<!-- 评价 -->
		<!--        <view class="eva-section">
            <view class="e-header">
                <text class="tit">评价</text>
                <text>(86)</text>
                <text class="tip">好评率 100%</text>
                <text class="yticon icon-you"></text>
            </view>
            <view class="eva-box">
                <image class="portrait" src="http://img3.imgtn.bdimg.com/it/u=1150341365,1327279810&fm=26&gp=0.jpg" mode="aspectFill"></image>
                <view class="right">
                    <text class="name">Leo yo</text>
                    <text class="con">商品收到了，79元两件，质量不错，试了一下有点瘦，但是加个外罩很漂亮，我很喜欢</text>
                    <view class="bot">
                        <text class="attr">购买类型：XL 红色</text>
                        <text class="time">2019-04-01 19:21</text>
                    </view>
                </view>
            </view>
        </view>
 -->
 <view class="farm" v-if="cache.farm_id">
 	<view class="text_area">
 		<view class="shop_name">
 			<image :src="farm_info.farm_logo" :lazy-load="true" class="shop_thumbnail"></image>
 			<view class="right_shop_mess">
 				<view class="shop_line">
 					<view class="shop_line_p1">{{farm_info.farm_name}}
 					</view>
 					<view class="right_shop_mess_p2" @click="gostoredetail(farm_info.id)">
 						进店逛逛
 					</view>
 				</view>
 				<view class="shop_line_fl">
 				</view>
 				<view class="shop_line">
 					<view class="shop_line_p2">
 						<u-icon   name="map" size="20" color="#9C9C9C"></u-icon>
 						<view class="address">
 							{{farm_info.farm_address}}
 						</view>
 					</view>
 				</view>
 			</view>
 		</view>
 	</view>
 	<view class="shop_one">
 		<view class="shop_one_1">
 			<view class="view1">{{farm_info.page_view}}</view>
 			<view class="view2">访客数</view>
 		</view>
 		<view>
 			<u-line color="#999998" direction="col" length='60%'></u-line>
 		</view>
 	
 		<view class="shop_one_1">
 			<view class="view1">{{farm_info.shopnum}}</view>
 			<view class="view2">全部商品</view>
 		</view>
 		<view>
 			<u-line color="#999998" direction="col" length='60%'></u-line>
 		</view>
 	
 		<view class="shop_one_1">
 	
 			<view class="view1">{{farm_info.shoporder}}</view>
 	
 			<view class="view2">已售出</view>
 		</view>
 	</view>
 	<!-- <view style="padding: 0 0 20rpx 0;">
 		<u-album singleSize="75" multipleSize='75' singleMode="aspectFill"
 			multipleMode="aspectFill" :urls="farm_info.detail_img" maxCount="4" :showMore='true'
 			rowCount="4"></u-album>
 	</view> -->
 </view>
 
 
 
 
 
 
		<view class="detail-desc">
			<view class="d-header"><text>商品详情</text></view>
			<u-parse :content="cache.content" :lazy-load="true" :show-with-animation="true">
			</u-parse>
		</view>
		<!-- 底部操作菜单 -->
		<view class="page-bottom">
			<navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
				<u-icon labelSize="12" color="#909399" label="首页" labelPos="bottom" labelColor="#909399" size="25"
					name="home"></u-icon>
			</navigator>
			<view class="p-b-btn" @click="gouwuche">
				<view class="">
					<u-icon labelSize="12" color="#909399" label="购物车" labelPos="bottom" labelColor="#909399" size="25"
						name="shopping-cart"></u-icon>
				</view>
				<view class="badge">
					<u-badge v-if="list.count" :showZero="false" size="mini" bgColor="red" :offset="offset"
						type="success" :value="list.count"></u-badge>
				</view>
			</view>
			<view class="p-b-btn " :class="{ active: favorite }" @click="toFavorite">
				<u-icon labelSize="12" :color="favorite?primary:'#909399'" label="收藏" labelPos="bottom"
					:labelColor="favorite?primary:'#909399'" size="25" name="heart-fill"></u-icon>
			</view>

			<view class="action-btn-group bg-linear-gradient">
				<button type="primary" class=" action-btn no-border add-cart-btn" @click="buy(1)">加入购物车</button>
				<button type="primary" class=" action-btn no-border buy-now-btn" @click="buy(2)">立即购买</button>
			</view>
		</view>

		<!-- 规格-模态层弹窗 -->
		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec(0)">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer attr-content" @click.stop="stopPrevent">
				<view class="a-t">
					<image :src=" apppic" v-if="apppic"></image>
					<view class="right">
						<text class="price text-neutral">¥{{ cache.price }}</text>
						<text class="stock">库存：{{ cache.num }}件</text>
						<view class="selected" v-if="skujson.length>0">
							已选：
							<text class="selected-text">{{ sku.skuattr }}</text>
						</view>
					</view>
				</view>

				<view v-for="(item, index) in list.skuinfo" :key="index" class="attr-list">
					<text>{{ item.attrlabel }}</text>
					<view class="item-list">
						<text v-for="(childItem, childIndex) in item.allitems" v-if="childItem.checked === 1"
							:key="childIndex" class="tit" :class="{ selected: childItem.selected }"
							@click="selectSpec(childIndex, childItem.pid, item)">
							{{ childItem.name }}
						</text>
					</view>
				</view>
				<view class="row-between">
					<text>数量</text>
					<u-number-box v-model="num" @change="valChange" :max="cache.num * 1"></u-number-box>
				</view>
				<button class="btn bg-linear-gradient" @click="toggleSpec(isOpen)">完成</button>
			</view>
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<nologin ref="nologin" v-on:loginback="loginback"></nologin>
		<!-- #endif -->
		<!-- 分享 -->
		<sharebox ref="sbox" v-if="sharedata" :data="sharedata"></sharebox>
		<admyself :opshow="true"></admyself>
		<tarpty :list='parttext' :tarptyshow="tarptyshow" @tarptycolse='tarptycolse' :type='2'></tarpty>
	</view>
</template>
<script>
	import api from '@/api/mall/index.js';
	import nologin from '@/components/nologin/nologin.vue';
	import tarpty from '@/components/ui-tarpty/ui-tarpty.vue';
	export default {
		components: {
			nologin,
			tarpty
		},
		data() {
			return {
				parttext: '',
				isChecked: false,
				tarptyshow: false,
				tarpty: '',
				partyinfo: {},
				ifpeon: false,
				primary: this.$theme.primary,
				goodslike: false,
				specClass: 'none',
				specSelected: [],
				offset: [5, 496],
				num: 1, // 默认为1
				list: '',
				cache: '',
				apppic: '',
				skujson: '',
				sku: '',
				isOpen: 0,
				favorite: false,
				shareList: [],
				imgList: [],
				specList: [],
				specChildList: [],
				settingFile: getApp().globalData.siteinfo,
				timer: null,
				appalbum: [],
				isc: '',
				sharedata: null,
				farm_info:''
			};
		},

		onLoad(options) {
			//接收传值,id里面放的是标题，因为测试数据并没写id
			this.$bindid.getbindid(options, this.$store);
			let id = options.id;
			this.isc = options.isc;
			this.shoopgoods(id);
		},
		onShow() {

		},
		onShareAppMessage(res) {
			let that = this
			let data = {
				title: that.sharedata.title,
				imageUrl: that.sharedata.imageUrl,
				path: that.sharedata.path
			};
			return data;
		},
		onShareTimeline(res) {
			let that = this
			let data = {
				title: that.sharedata.title,
				imageUrl: that.sharedata.imageUrl,
				path: that.sharedata.path
			};
			return data;
		},
		methods: {
			checkboxChange(e) {
				this.tarpty = e
			},
			goContract(id, type) {
				console.log(id,type,'kkkkkk')
				if (!this.parttext) {
					this.$api.msg(`暂无租赁协议，联系客服添加`);
					return;
				} else {
					this.tarptyshow = true
				}
				console.log(this.tarptyshow,'this.tarptyshow')
			},
			gostoredetail(farmid) { //跳转店铺详情
			 
				uni.navigateTo({
					url: "/pagesC/pages/merchantdetails/merchantdetails?id=" + farmid
				})
			},
			loginback() {
				//登录回调
			},
			previewImage(index) { //预览商品详情轮播图片
				uni.previewImage({
					current: index,
					urls: this.appalbum,
					indicator: 'number'
				})
			},
			//规格弹窗开关
			toggleSpec(index) {
				/* 如果只点击规格 则不进行购买 || 添加购物车 */
				if (index == 0) {
					this.isOpen = 0
					if (this.specClass === 'show') {
						this.specClass = 'hide';
						setTimeout(() => {
							this.specClass = 'none';
						}, 250);
					} else if (this.specClass === 'none') {
						this.specClass = 'show';
					}
					return
				}
				if (index == 1) {
					if (this.specClass === 'show') {
						this.stock();
						// #ifdef MP-WEIXIN
						let id = uni.getStorageSync('userInfo').id;
						// #endif
						// #ifdef H5
						try{
							let id = uni.getStorageSync('userInfo').userinfo.id || uni.getStorageSync('userInfo').id;
						}catch(e){
							//TODO handle the exception
							console.log(e,'eee');
						}
						// #endif
						let obj = {
							sid: 0,
							goodstype: this.cache.type,
							goodsid: this.cache.id,
							num: this.num,
							isame: this.list.isadmin,
							sku: this.sku.sku,
							vipid: id
						};
						api.addtobasket(obj).then(res => {
							uni.showToast({
								title: res.data.msg,
								icon: 'none', //如果要纯文本，不要icon，将值设为'none'
								duration: 2000 //持续时间为 2秒
							})
							if (res.status == 200) {
								this.list.count = this.list.count + this.num;
								uni.showToast({
									title: res.data.msg,
									icon: 'none', //如果要纯文本，不要icon，将值设为'none'
									duration: 2000 //持续时间为 2秒
								})
							}
						});

						this.specClass = 'hide';
						setTimeout(() => {
							this.specClass = 'none';
						}, 250);
					} else if (this.specClass === 'none') {
						this.specClass = 'show';
					}
					return
				}
				/* 如果点击立即购买则为 2 */
				if (index == 2) {
					if (this.specClass === 'show') {
						this.stock();
						let id
						// #ifdef MP-WEIXIN
						id = uni.getStorageSync('userInfo').id;
						// #endif
						// #ifdef H5
						try{
							id = uni.getStorageSync('userInfo').id || uni.getStorageSync('userInfo').userinfo.id;
						}catch(e){
							console.log(e,'eeee2e');
							console.log(uni.getStorageSync('userInfo'),'ddddddddddddddd');
							//TODO handle the exception
						}
						// #endif
						let obj = {
							sid: 0,
							goodstype: this.cache.type,
							goodsid: this.cache.id,
							num: this.num,
							isame: this.list.isadmin,
							sku: this.sku.sku,
							vipid: id
						};
						api.fastbuys(obj).then(res => {

							if (res.status == 200) {
								uni.showToast({
									icon: 'loading',
									title: '生成订单',
									duration: 2000
								});
								setTimeout(() => {
									this.$u.route('/pagesD/pages/order/createOrder', {
										id,
										sid: 0,
										goodstype: this.cache.type,
										lasturl: this.list.lasturl,
										ftype: 2,
										goodsid: this.cache.id,
									});
								}, 2000);
							} else {
								this.$u.toast(res.msg);
							}
						});

						this.specClass = 'hide';
						setTimeout(() => {
							this.isOpen = 0
							this.specClass = 'none';
						}, 250);
					} else if (this.specClass === 'none') {
						this.specClass = 'show';
					}
					return
				}



			},
			//选择规格
			selectSpec(index, pid, item) {
				let list = item.allitems;
				let arr_sku = this.cache.id;
				list.forEach(item => {
					this.$set(item, 'selected', false);
				});
				this.$set(list[index], 'selected', true);
				for (let cItem of this.list.skuinfo) {
					for (let cItem2 of cItem.allitems) {
						if (cItem2.checked == 1 && cItem2.selected == true) {
							arr_sku += '-' + cItem2.path
						}
					}
				}
				if (this.skujson) {
					this.sku = this.skujson[arr_sku];
				}
			},
			//分享
			opensharebox() {
				this.$refs.sbox.opensharebox(this.sharedata);
			},
			//收藏
			toFavorite() {
				if (this.timer) return
				this.timer = setTimeout(() => {}, 1000)
				this.favorite = !this.favorite;
				let data = {
					id: this.cache.id,
					status: Number(this.favorite),
					goodstype: this.cache.type
				}
				api.goodslike(data).then(res => {
					this.timer = null
					this.$u.toast(res.msg)
					if (res.msg == "收藏成功") {
						this.goodslike = true
					} else if (res.msg == "取消成功") {
						this.goodslike = false
					}

					if (this.isc) {
						let pages = getCurrentPages();
						let prevPage = pages[pages.length - 2]; //获取到A页面
						prevPage.onLoad(); // 执行前一个页面的onLoad方法
					}
				})
			},
			// 库存校验
			stock() {
				if (this.cache.issku == 1) {
					if (this.cache.num - this.num < 0) {
						this.$api.msg(`该属性产品库存不足！请调整购买数量或选择其他属性!`);
						return;
					}
				} else {
					if (this.cache.num - this.num < 0) {
						this.$api.msg(`该属性产品库存不足！请调整购买数量或选择其他属性!`);
						return;
					}
				}
			},
			// 购买
			buy(e) {
				let that = this;
				if(that.ifpeon) {
					if (this.tarpty[0]!='tgxy') {
						this.$api.msg(`请同意${that.partyinfo.name}`);
						return;
					}
				}
				that.isOpen = e
				// #ifdef MP-WEIXIN
				if (that.$store.state.islogin()) {
					that.toggleSpec(that.isOpen)
				} else {
					that.$refs.nologin.open();
				}
				// #endif
				// #ifdef H5 || APP-PLUS
					that.toggleSpec(that.isOpen)
				// #endif
			},
			// 计步器
			valChange(e) {

			},
			stopPrevent() {},
			shoopgoods(id) {
				let that = this;
				api.shoopgoods({
					id: id + ''
				}).then(res => {
					let arr = []; //创建空数组
					if (res.status == 200) {
						if(res.data.party && res.data.party.id) {
							that.ifpeon = true
							that.partyinfo = res.data.party
							that.parttext = that.partyinfo.content
							console.log(res.data.party,'res.data.party');
						}
						that.sharedata = res.data.sharedata;
						that.farm_info=res.data.farm;
						that.sharedata.title = res.data.cache.name;
						that.sharedata.path = '/pagesD/pages/product/product?pid=' + that.$getuid() + '&id=' + id;

						that.list = res.data;
						that.cache = res.data.cache;
						that.apppic = res.data.apppic;
						that.appalbum = res.data.appalbum
						that.$store.state.lasturl = res.data.lasturl
						if (res.data.cache.issku == 1 && res.data.skujson !== "") {
							that.skujson = JSON.parse(res.data.skujson);
						} else {
							that.sku = {
								num: that.cache.num,
								price: that.cache.price
							};
						}
						that.favorite = that.cache.islike == 1 ? true : false
						/* 处理富文本*/
						that.cache.content = that.cache.content.replace(/\<img src="/gi,
							`<img style='width:100%;display:block' src="${that.settingFile.root_rich_img}`);
						if (res.data.skuinfo) {
							for (let cItem of res.data.skuinfo) {
								let num = 1;
								for (let cItem2 of cItem.allitems) {
									if (num == 1) {
										that.$set(cItem2, 'selected', false);
										arr.push(cItem2);
									}
									num++;
								}
							}
						}
						if (arr && arr.length > 0) {
							let arr_sku = that.cache.id;
							arr.forEach(item => {
								arr_sku += '-' + item.path
								/* 默认取第一个*/
								that.$set(item, 'selected', true);
								that.specSelected.push(item);
							})
							if (that.skujson) {
								that.sku = that.skujson[arr_sku];
							}
						}
					} else {
						that.$u.toast(res.msg);
					}
				});
			},
			gouwuche() {
				this.$u.route('pagesE/pages/cart/cart')
			}
		}
	};
</script>

<style lang="scss">
	/deep/.buy-now-btn:after {
		border: 0rpx
	}

	/deep/.add-cart-btn:after {
		border: 0rpx
	}

	page {
		background: $page-color-base;
		padding-bottom: 160upx;
	}

	.icon-you {
		font-size: $font-base + 2upx;
		color: #888;
	}

	.row-between {
		display: flex;
		justify-content: space-between;
		padding: 20rpx;
	}

	.carousel {
		height: 750rpx;
		position: relative;

		swiper {
			height: 100%;
		}

		.image-wrapper {
			width: 100%;
			height: 100%;
		}

		.swiper-item {
			display: flex;
			justify-content: center;
			align-content: center;
			height:750rpx;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}
		}
	}

	/* 标题简介 */
	.introduce-section {
		background: #fff;
		padding: 20upx 30upx;

		.title {
			font-size: 32upx;
			color: $font-color-dark;
			height: 50upx;
			line-height: 50upx;
		}

		.price-box {
			display: flex;
			align-items: baseline;
			height: 64upx;
			padding: 10upx 0;
			font-size: 26upx;
			color: $uni-color-primary;
		}

		.price {
			font-size: $font-lg + 2upx;
		}

		.m-price {
			margin: 0 12upx;
			color: $font-color-light;
			text-decoration: line-through;
		}

		.coupon-tip {
			align-items: center;
			padding: 4upx 10upx;
			background: $uni-color-primary;
			font-size: $font-sm;
			color: #fff;
			border-radius: 6upx;
			line-height: 1;
			transform: translateY(-4upx);
		}

		.bot-row {
			display: flex;
			align-items: center;
			height: 50upx;
			font-size: $font-sm;
			color: $font-color-light;

			text {
				flex: 1;
			}
		}
	}

	/* 分享 */
	.share-section {
		display: flex;
		align-items: center;
		color: $font-color-base;
		background: linear-gradient(left, #fdf5f6, #fbebf6);
		padding: 12upx 30upx;

		.share-icon {
			display: flex;
			align-items: center;
			width: 70upx;
			height: 30upx;
			line-height: 1;
			border: 1px solid $uni-color-primary;
			border-radius: 4upx;
			position: relative;
			overflow: hidden;
			font-size: 22upx;
			color: $uni-color-primary;
			justify-content: center;
			display: flex;

			&:after {
				content: '';
				width: 50upx;
				height: 50upx;
				border-radius: 50%;
				left: -20upx;
				top: -12upx;
				position: absolute;
				// background: $uni-color-primary;
			}
		}

		.icon-xingxing {
			position: relative;
			z-index: 1;
			font-size: 24upx;
			color: #fff;
			line-height: 1;
		}

		.tit {
			font-size: $font-base;
			margin-left: 10upx;
		}

		.icon-bangzhu1 {
			padding: 10upx;
			font-size: 30upx;
			line-height: 1;
		}

		.share-btn {
			flex: 1;
			display: flex;
			display: flex;
			justify-content: flex-end;
			font-size: $font-sm;
			color: $uni-color-primary;
		}

		.icon-you {
			font-size: $font-sm;
			margin-left: 4upx;
			color: $uni-color-primary;
		}
	}

	.c-list {
		font-size: $font-sm + 2upx;
		color: $font-color-base;
		background: #fff;

		.c-row {
			display: flex;
			align-items: center;
			padding: 20upx 30upx;
			position: relative;
		}

		.tit {
			width: 140upx;
		}

		.con {
			flex: 1;
			color: $font-color-dark;

			.selected-text {
				margin-right: 10upx;
			}
		}

		.bz-list {
			font-size: $font-sm + 2upx;
			color: $font-color-dark;

			text {
				display: inline-block;
				margin-right: 30upx;
				line-height: 38upx;
			}
		}

		.con-list {
			flex: 1;
			display: flex;
			flex-direction: column;
			color: $font-color-dark;
			line-height: 40upx;
		}

		.red {
			color: $uni-color-primary;
		}
	}

	/* 评价 */
	.eva-section {
		display: flex;
		flex-direction: column;
		padding: 20upx 30upx;
		background: #fff;
		margin-top: 16upx;

		.e-header {
			display: flex;
			align-items: center;
			height: 70upx;
			font-size: $font-sm + 2upx;
			color: $font-color-light;

			.tit {
				font-size: $font-base + 2upx;
				color: $font-color-dark;
				margin-right: 4upx;
			}

			.tip {
				flex: 1;
				text-align: right;
			}

			.icon-you {
				margin-left: 10upx;
			}
		}
	}

	.eva-box {
		display: flex;
		padding: 20upx 0;

		.portrait {
			flex-shrink: 0;
			width: 80upx;
			height: 80upx;
			border-radius: 100px;
		}

		.right {
			flex: 1;
			display: flex;
			flex-direction: column;
			font-size: $font-base;
			color: $font-color-base;
			padding-left: 26upx;

			.con {
				font-size: $font-base;
				color: $font-color-dark;
				padding: 20upx 0;
			}

			.bot {
				display: flex;
				justify-content: space-between;
				font-size: $font-sm;
				color: $font-color-light;
			}
		}
	}

	/*  详情 */
	.detail-desc {
		background-color: #FFFFFF;
		margin-top: 16upx;
		line-height: 40rpx;
		box-sizing: border-box;
		.d-header {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80upx;
			font-size: $font-base + 2upx;
			position: relative;

			text {
				padding: 0 20upx;
				background: #fff;
				position: relative;
				z-index: 1;
			}

			&:after {
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateX(-50%);
				width: 300upx;
				height: 0;
				content: '';
				border-bottom: 1px solid #ccc;
			}
		}
	}

	/* 规格选择弹窗 */
	.attr-content {
		padding: 10upx 30upx;

		.a-t {
			position: relative;
			display: flex;

			image {
				width: 170upx;
				height: 170upx;
				flex-shrink: 0;
				margin-top: -40upx;
				border-radius: 8upx;
			}

			.right {
				display: flex;
				flex-direction: column;
				padding-left: 24upx;
				font-size: $font-sm + 2upx;
				color: $font-color-base;
				line-height: 42upx;

				.price {
					font-size: $font-lg;
					margin-bottom: 10upx;
				}

				.selected-text {
					margin-right: 10upx;
				}
			}
		}

		.attr-list {
			display: flex;
			flex-direction: column;
			font-size: $font-base + 2upx;
			color: $font-color-base;
			padding-top: 30upx;
			padding-left: 10upx;
		}

		.item-list {
			padding: 20upx 0 0;
			display: flex;
			flex-wrap: wrap;

			text {
				display: flex;
				align-items: center;
				justify-content: center;
				background: #eee;
				margin-right: 20upx;
				margin-bottom: 20upx;
				border-radius: 100upx;
				min-width: 60upx;
				height: 60upx;
				padding: 0 20upx;
				font-size: $font-base;
				color: $font-color-dark;
			}

			.selected {
				background: $tab-color-2;
				color: #fff;
			}
		}
	}

	/*  弹出层 */
	.popup {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 99;

		&.show {
			display: block;

			.mask {
				animation: showPopup 0.2s linear both;
			}

			.layer {
				animation: showLayer 0.2s linear both;
			}
		}

		&.hide {
			.mask {
				animation: hidePopup 0.2s linear both;
			}

			.layer {
				animation: hideLayer 0.2s linear both;
			}
		}

		&.none {
			display: none;
		}

		.mask {
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: 1;
			background-color: rgba(0, 0, 0, 0.4);
		}

		.layer {
			position: fixed;
			z-index: 99;
			bottom: 0;
			width: 94%;
			min-height: 40vh;
			border-radius: 10upx 10upx 0 0;
			background-color: #fff;

			.btn {
				height: 66upx;
				line-height: 66upx;
				border-radius: 100upx;
				font-size: $font-base + 2upx;
				color: #fff;
				margin: 30upx auto 20upx;
			}
		}

		@keyframes showPopup {
			0% {
				opacity: 0;
			}

			100% {
				opacity: 1;
			}
		}

		@keyframes hidePopup {
			0% {
				opacity: 1;
			}

			100% {
				opacity: 0;
			}
		}

		@keyframes showLayer {
			0% {
				transform: translateY(120%);
			}

			100% {
				transform: translateY(0%);
			}
		}

		@keyframes hideLayer {
			0% {
				transform: translateY(0);
			}

			100% {
				transform: translateY(120%);
			}
		}
	}

	/* 底部操作菜单 */
	.page-bottom {
		position: fixed;
		left: 30upx;
		bottom: 30upx;
		z-index: 95;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 690upx;
		height: 100upx;
		background: rgba(255, 255, 255, 0.9);
		box-shadow: 0 0 20upx 0 rgba(0, 0, 0, 0.5);
		border-radius: 16upx;

		.p-b-btn {
			position: relative;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			font-size: $font-sm;
			color: $font-color-base;
			width: 96upx;
			height: 80upx;

			.yticon {
				font-size: 40upx;
				line-height: 48upx;
				color: $font-color-light;
			}

			&.active,
			&.active .yticon {}

			.icon-fenxiang2 {
				font-size: 42upx;
				transform: translateY(-2upx);
			}

			.icon-shoucang {
				font-size: 46upx;
			}

			.badge {
				position: absolute;
				top: -10rpx;
				right: 8rpx;
			}
		}

		.action-btn-group {
			display: flex;
			height: 76upx;
			border-radius: 100px;
			overflow: hidden;
			margin-left: 20upx;
			position: relative;

			&:after {
				content: '';
				position: absolute;
				top: 50%;
				right: 50%;
				transform: translateY(-50%);
				height: 28upx;
				width: 0;
				border-right: 1px solid rgba(255, 255, 255, 0.5);
			}

			.action-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 180upx;
				height: 100%;
				font-size: $font-base;
				padding: 0;
				border-radius: 0;
				background: transparent;
			}
		}
	}
	.text_area {
		.shop_name {
			display: flex;
			justify-content: space-between;
			align-items: center;
	
			.shop_thumbnail {
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
			}
	
			.right_shop_mess {
				width: calc(100% - 90rpx);
	            // margin-left: 15rpx;
				.shop_line {
					display: flex;
					justify-content: space-between;
					align-items: center;
	
					.shop_line_p1 {
						color: #1f1f1f;
						font-size: 32rpx;
						padding-left: 3rpx;
						font-weight: 300;
					}
	
					.shop_line_p2 {
						width: 100%;
						display: flex;
						align-items: center;
	
						.address {
							color: #333;
							font-size: 26rpx;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}
					}
				}
	
				.shop_line_fl {
					display: flex;
					justify-content: flex-start;
					align-items: center;
					margin: 5rpx 0;
				}
	
				.right_shop_mess_p2 {
					border: 1rpx solid #cccccc;
					color: #666;
					font-size: 24rpx;
					padding: 12rpx 20rpx;
					border-radius: 40rpx;
				}
			}
		}
	}
	
	.shop_one {
		display: flex;
		justify-content: space-evenly;
		padding: 30rpx 0rpx;
	
		.shop_one_1 {
			display: flex;
			flex-direction: column;
			align-items: center;
	
			.view1 {
				font-size: 28rpx;
				margin-bottom: 10rpx;
	
			}
	
			.view2 {
				font-size: 24rpx;
				color: #999999;
			}
		} 
	}
	.farm{
			 background-color: #ffffff;
			 margin-top: 20rpx;
			 padding: 20rpx 20rpx 0rpx 20rpx;
	}
	.sel {
		height: 96rpx;
		padding: 0 20rpx;
		display: flex;
		align-items: center;
		border-bottom: 1px solid #f2f2f2;
		background-color: #ffffff;
	}
	
	.sel .ipt {
		height: 40rpx;
		width: 40rpx;
		border-radius: 10rpx;
	}
	
	.sel .text {
		position: relative;
		top: -2rpx;
		font-size: 26rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(0, 0, 0, 1);
	}
</style>
