<template>
  <!-- svip会员模块 -->
	<view class="card_content">
		<view class="card-section">
			<view class="header-card" :style="'background-image: url('+domain+'/static/images/svip_section.png)'">
				<view class="header-avatar acea-row">
					<view class="acea-row row-middle">
						<view class="avatar-box on">
							<image class="image" :src="userInfo.avatar ? userInfo.avatar : '/static/images/f.png'"></image>
							<view class="headwear">
								<image src="/static/images/crown.png"></image>
							</view>
						</view>
						<view class="text acea-row">
							<view class="name">{{userInfo.nickname || ''}}</view>
							<image class="vip" src="../../../static/images/svip.png"></image>
						</view>
					</view>
					<view v-if="userInfo.is_svip == 3" class="expire">终身会员</view>
					<view v-else class="expire">{{userInfo.svip_endtime | dateFormat}}到期</view>
				</view>
				<view class="header_count">
					<view class="acea-row row-between vip_save">
						<view class="save_money">
							<text class="name">累计节省(元)</text>
							<view class="money">{{userInfo.svip_save_money}}</view>
						</view>
						<view v-if="userInfo.is_svip != 3" @click="scrollToCard" class="renew_btn">立即续费</view>
					</view>
					<view class="save_list acea-row">
						<scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
							<view v-for="(item,index) in memberRights" :key="index" class='item' @click="goUrl(item.link)">
								<image class="pic" :src="item.on_pic"></image>
								<view class="text">
									<view class="name">{{item.name}}</view>
									<view class="info line1">{{item.info}}</view>
								</view>
							</view>
						</scroll-view>
					</view>
				</view>
			</view>
		</view>
		<!--卡片下方内容-->
		<view class="vip_center">
			<!-- <view v-if="memberCoupons.length > 0" class="coupon-section">
				<view class="section-hd">
					<view class="title">会员优惠券</view>
					<text class="desc">会员专享优惠券，全场通用</text>
				</view>
				<scroll-view class="section-bd" scroll-x="true">
					<view v-for="item in memberCoupons" :key="item.coupon_id" class="item"
						:class="{gray: item.svipIssue}"
						:style="'background-image: url('+domain+'/static/images/svip_coupon.png)'">
						<view class="coupon-count">
							<view class="money">
								<text>￥</text>
								<text class="num">{{item.coupon_price}}</text>
							</view>
							<view class="text">
								<view v-if="item.use_min_price === '0.00'" class="mark">无门槛券</view>
								<view v-else class="mark">满{{item.use_min_price | moneyFormat}}可用</view>
							</view>
						</view>
						<navigator hover-class="none" :url="'/pages/columnGoods/goods_coupon_list/index?coupon_id='+item.coupon_id" v-if="item.svipIssue" class="coupon-btn">去使用</navigator>
						<view v-else @click="receiveCoupon(item)" class="coupon-btn">立即领取</view>
					</view>
				</scroll-view>
			</view> -->
			<!--立即续费-->
			<view v-if="userInfo.is_svip != 3" class="type-section" id="card" :style="{ 'background-image':`url(../static/renew_bg.png)`}">
				<view class="section-hd">
					<view class="title">会员续费</view>
					<text class="desc">续费可继续享受优惠价</text>
				</view>
				<scroll-view class="scroll" scroll-x="true">
					<view v-for="(item,index) in memberType" :key="item.group_data_id" class="item" :class="{on: index === type}"
						@click="checkType(item,index)">
						<view class="title line1">{{item.value && item.value.svip_name}}</view>
						<view class="new">￥<text class="num">{{item.value && item.value.price | moneyFormat}}</text></view>
						<view class="old">￥{{item.value && item.value.cost_price | moneyFormat}}</view>
					</view>
				</scroll-view>
				<view class="buy" @click="pay">立即支付</view>
				<!--<view v-if="memberExplain" class="agree">-->
				<!--	<navigator class="link" url="/pages/annex/vip_clause/index" hover-class="none">购买即视为同意<text-->
				<!--		class="mark">《会员用户协议》</text></navigator>-->
				<!--</view>	-->
			</view>
			<view v-if="goodsList.length" class="goods-section">
				<view class="section-hd">
					<view class="title">会员专享价</view>
				</view>
				<view class="section-bd acea-row">
					<view v-for="item in goodsList" :key="item.product_id" class="item" @click="goDetail(item.product_id)">
			      <easy-loadimage class="image" mode="widthFix" :image-src="item.image"></easy-loadimage>
						<view class="name line2">
							<text v-if="item.merchant.type_name && item.product_type == 0" class="font-bg-red bt-color">{{item.merchant.type_name}}</text>
							{{item.store_name}}
						</view>
						<view class="svip-price">￥{{item.svip_price}}
							<image src="../../../static/images/svip.png"></image>
						</view>
						<view class="shop-price">商城价：￥{{item.price}}</view>
					</view>
				</view>
			</view>
		</view>
		<payment :payMode="payMode" :pay_close="pay_close" :is-call="true" @onChangeFun="onChangeFun"
			:order_id="pay_order_id" :totalPrice="totalPrice"></payment>
		<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
		<view v-show="false" v-html="formContent"></view>
	</view>
</template>

<script>

  import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
	import payment from '@/components/payment';
	import authorize from '@/components/Authorize';
	import { mapGetters } from "vuex";
	import {
		memberCard,
		memberEquity,
		memberCouponLst,
		memberCardDraw,
		memberCardCreate,
		groomList,
		getAgreementApi,
		receiveMemberCoupon
	} from '@/api/user.js';
	import { toLogin } from '@/libs/login.js';
	import { openPaySubscribe } from '@/utils/SubscribeMessage.js';
	import dayjs from '@/plugin/dayjs/dayjs.min.js';
	import { HTTP_REQUEST_URL } from '@/config/app';
  import spread from "@/libs/spread";
  import {merBindShop} from "@/api/exchange";
	export default {
		components: {
			payment,
			authorize,
      easyLoadimage
		},
		filters: {
			dateFormat: function(value) {
				return dayjs(value).format('YYYY-MM-DD');
			},
			moneyFormat: function(value) {
				return parseFloat(value);
			}
		},
		data() {
			return {
				domain: HTTP_REQUEST_URL,
				memberType: [],
				userInfo: {},
				memberRights: [],
				memberExplain: [],
				memberCoupons: [],
				isGetFree: null,
				popupShow: false,
				account: '',
				password: '',
				goodsList: [],
				pay_order_id: '',
				payMode: [{
					name: '微信支付',
					icon: 'icon-weixinzhifu',
					// #ifdef H5
					value: this.$wechat.isWeixin() ? 'weixin' : 'h5',
					// #endif
					// #ifdef MP
					value: 'routine',
					// #endif
					// #ifdef APP-PLUS
					value: 'weixin',
					// #endif
					title: '微信快捷支付',
					payStatus: true
					}
					// #ifdef H5 ||APP-PLUS
					,
					{
					name: '支付宝支付',
					icon: 'icon-zhifubao',
					// #ifdef H5 || APP-PLUS
					value: 'alipay',
					// #endif
					// #ifdef MP
					value: 'alipayQr',
					// #endif
					title: '支付宝支付',
					payStatus: true
					}
					// #endif
				],
				pay_close: false,
				totalPrice: '0',
				formContent: '',
				page: 1,
				limit: 15,
				finished: false,
				loading: false,
				memberEndTime: '',
				// #ifdef H5
				isWeixin: this.$wechat.isWeixin(),
				// #endif
				type: 0,
				svip_type: 1,
				svip: null,
				svipDef: {},
				isAuto: false, //没有授权的不会自动授权
				isShowAuth: false, //是否隐藏授权
        //员工邀请开通会员卡
        bind_mer_id: 0,
        bind_staff_id: 0,

			}
		},
		watch: {

		},
		computed: mapGetters(['isLogin','uid']),
		onLoad(options) {
      // 二维码参数接收
      if(options.scene){
        console.log("接收参数 - 未转义",options.scene)
        var scene = this.$util.getUrlParams(decodeURIComponent(options.scene));
        console.log("接收参数 - 转义后",scene)
        this.bind_mer_id = scene.mid || 0;
        this.bind_staff_id = scene.suid || 0;
        // 判断：如果存在邀请人  判断对应的商家是否绑定酒道馆
        if(this.bind_mer_id > 0 && this.bind_staff_id > 0){
          this.isBindShop();
        }
      }

			this.getCouponLst();
			if (this.isLogin) {
				this.getMemberCard();
				this.memberEquity();
				this.groomList();
			} else {
				this.isAuto = true;
				this.isShowAuth = true
			}

      // 关系处理
      if(options.spread) spread(options.spread, this.isLogin)
		},
		onShow(){

		},
		onReachBottom() {
			this.groomList();
		},
		methods: {
			onLunch() {
				this.getMemberCard();
				this.memberEquity();
				this.getCouponLst();
			},
			onLoadFun() {
				this.isShowAuth = false;
				this.getMemberCard();
				this.memberEquity();
			},
			// 授权关闭
			authColse: function(e) {
				this.isShowAuth = e
			},
			goUrl(url){
				if(url.indexOf("http") != -1){
					// #ifdef H5
					location.href = url
					// #endif
				}else{
					if(['/pages/goods_cate/goods_cate','/pages/order_addcart/order_addcart','/pages/user/index','/pages/plant_grass/index'].indexOf(url) == -1){
						uni.navigateTo({
							url:url
						})
					}else{
						uni.switchTab({
							url:url
						})
					}
				}
			},
			// 付费会员数据
			getMemberCard() {
				uni.showLoading({
					title: '正在加载…'
				});
				memberCard().then(res => {
					uni.hideLoading();
					this.memberType = res.data.list;
					this.svipDef = res.data.def;
					this.totalPrice = res.data.def.price.toString();
					this.pay_order_id = res.data.def.group_data_id.toString();
					this.svip_type = res.data.def.svip_type;
				}).catch(err => {
					uni.showToast({
						title: err,
						icon: 'none'
					});
				});
			},
			// 付费会员权益
			memberEquity() {
				memberEquity().then(res => {
					this.memberRights = res.data.interests;
					this.userInfo = res.data.user;
				}).catch(err => {
					uni.showToast({
						title: err,
						icon: 'none'
					});
				});
			},
			// 会员优惠券
			getCouponLst() {
				memberCouponLst().then(res => {
					this.memberCoupons = res.data
				}).catch(err => {
					uni.showToast({
						title: err,
						icon: 'none'
					});
				});
			},
			receiveCoupon(item) {
				let that = this;
				if (that.isLogin === false) {
					this.isAuto = true;
					this.isShowAuth = true
				} else {
					receiveMemberCoupon(item.coupon_id).then(res => {
						item.svipIssue = 1
						uni.showToast({
							title: res.message,
							icon: 'none'
						})
					}).catch(err => {
						uni.showToast({
							title: err,
							icon: 'none'
						})
					})
				}
			},
			pay() {
				if (this.totalPrice == 0) {
					this.createMemberCard('weixin');
				} else {
					this.pay_close = true;
				}
			},
			payClose: function() {
				this.pay_close = false;
			},
			// 立即购买
			createMemberCard(type) {
				uni.showLoading({
					title: '正在加载…'
				});
				let query = {
					pay_type: type,
          bind_mer_id: this.bind_mer_id,
          bind_staff_id: this.bind_staff_id,
					// #ifdef H5
					return_url: location.port ? location.protocol + '//' + location.hostname + ':' + location.port +
						'/pages/annex/vip_paid/index' : location.protocol + '//' + location.hostname +
						'/pages/annex/vip_paid/index'
					// #endif
				};
				let group_id = this.pay_order_id
				// #ifdef MP
				openPaySubscribe().then(() => {
					memberCardCreate(group_id,query).then(res => {
						if (parseFloat(this.totalPrice) > 0) {
							this.callPay(res);
						} else {
							uni.hideLoading();
							return this.$util.Tips({
								title: this.svip_type == 1 ? '成功开启0元试用' : '续费成功',
							}, () => {
								this.onLunch()
							});
						}
					}).catch(err => {
						uni.hideLoading();
						uni.showToast({
							title: err,
							icon: 'none'
						});
					});
				});
				// #endif
				// #ifndef MP
				memberCardCreate(group_id,query).then(res => {
					if (parseFloat(this.totalPrice) > 0) {
						this.callPay(res);
					} else {
						uni.hideLoading();
						return this.$util.Tips({
							title:  this.svip_type == 1 ? '成功开启0元试用' : '续费成功',
						}, () => {
							this.onLunch()
						});
					}
				}).catch(err => {
					uni.showToast({
						title: err,
						icon: 'none'
					});
				});
				// #endif
			},
			// 调用支付
			callPay(res) {
        let that = this;
        let status = res.data.status,
            orderId = res.data.result.order_id,
            callback_key = res.data.result.pay_key,
            jsConfig = res.data.result.config,
            // goPages = '/pages/annx/vip_center/index'
            goPages = '/pages/users/user_coupon/index';

        console.log('支付成功', status)
				switch (status) {
					case 'ORDER_EXIST':
					case 'EXTEND_ORDER':
					case 'PAY_ERROR':
					case 'error':
						uni.hideLoading();
						that.payClose();
						return that.$util.Tips({
							title: res.message
						});
						break;
					case 'success':
						uni.hideLoading();
						that.payClose();
						return that.$util.Tips({
							title: res.message,
							icon: 'success'
						});
						break;
					case 'alipay':
					case "alipayQr":
						uni.hideLoading();
						that.payClose();
						uni.navigateTo({
							url: '/pages/order_pay_back/index?keyCode='+callback_key+'&url='+jsConfig+'&type=11',
						})
						return;
						break;
						// #ifndef MP
					case "wechat":
					case "weixin":
					case "weixinApp":
						jsConfig.timeStamp = jsConfig.timestamp;
						// #ifndef APP-PLUS
						this.$wechat.pay(jsConfig).then(res => {
							uni.hideLoading();
							that.payClose();
							return that.$util.Tips({
								title: res.message,
								icon: 'success'
							});
						}).catch(res => {
							uni.hideLoading();
							if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
								title: '取消支付'
							});
						})
						// #endif
						// #ifdef APP-PLUS
						let mp_pay_name=''
						if(uni.requestOrderPayment){
							mp_pay_name='requestOrderPayment'
						}else{
							mp_pay_name='requestPayment'
						}
						uni[mp_pay_name]({
							provider: 'wxpay',
							orderInfo: jsConfig,
							success: (e) => {
								uni.hideLoading();
								that.payClose();
								return that.$util.Tips({
									title: '支付成功',
									icon: 'success'
								});
							},
							fail: (e) => {
								uni.hideLoading();
								that.payClose();
								uni.showModal({
									content: "支付失败",
									showCancel: false,
									success: function(res) {}
								})
							},
							complete: () => {
								uni.hideLoading();
							},
						});
						// #endif
						break;
						// #endif
						// #ifdef MP
					case "routine":
						jsConfig.timeStamp = jsConfig.timestamp;
						let mp_pay_name = '';
						if(uni.requestOrderPayment){
							mp_pay_name='requestOrderPayment'
						}else{
							mp_pay_name='requestPayment'
						}
						uni[mp_pay_name]({
							...jsConfig,
							success: function(res) {
                console.log("支付成功：", res)
								uni.hideLoading();
								that.payClose();
								return that.$util.Tips({
									title: '支付成功！',
									icon: 'success'
								}, {
									tab: 5,
									url: goPages
								});
							},
							fail: function(e) {
								uni.hideLoading();
								that.payClose();
								return that.$util.Tips({
									title: '取消支付'
								});
							},
						})
						break;
						// #endif
					case "balance":
						uni.hideLoading();
						that.payClose();
						//余额不足
						return that.$util.Tips({
							title: res.message
						}, {
							tab: 5,
							url: goPages
						});
						break;
						// #ifdef H5
					case 'h5':
						let host = window.location.protocol + "//" + window.location.host;
						let url = `${host}/pages/annex/vip_center/index`
						let eUrl = encodeURIComponent(url)
						let jsurl = jsConfig.mweb_url || jsConfig.h5_url
						let locations = `${jsurl}&redirect_url=${eUrl}`
						setTimeout(() => {
							location.href = locations;
						}, 100);
						break;
						// #endif
						// #ifdef APP-PLUS
					case 'alipayApp':
						uni.requestPayment({
							provider: 'alipay',
							orderInfo: jsConfig,
							success: (e) => {
								uni.hideLoading();
								that.payClose();
								return that.$util.Tips({
									title: '支付成功',
									icon: 'success'
								});
							},
							fail: (e) => {
								uni.hideLoading();
								uni.showModal({
									content: "支付失败",
									showCancel: false,
									success: function(res) {}
								})
							},
							complete: () => {
								uni.hideLoading();
							},
						});
						break;
						// #endif
				}
			},
			payCheck: function(type) {
				this.createMemberCard(type);
			},
			onChangeFun: function(e) {
				let opt = e;
				let action = opt.action || null;
				let value = opt.value != undefined ? opt.value : null;
				action && this[action] && this[action](value);
			},
			scrollToCard() {
				const query = uni.createSelectorQuery().in(this);
				query.select('#card').boundingClientRect(data => {
					uni.pageScrollTo({
						scrollTop: data.top
					});
				}).exec();
			},
			checkType(svip,index) {
				this.svipDef = svip.value;
				this.type = index;
				this.svip_type = svip.value.svip_type;
				this.pay_order_id = svip.group_data_id.toString();
				this.totalPrice = svip.value.price.toString();
			},
			goDetail(id) {
				uni.navigateTo({
					url: `/pages/goods_details/index?id=${id}`
				});
			},
			groomList() {
				if (this.finished || this.loading) {
					return;
				}
				this.loading = true
				groomList({
					page: this.page,
					limit: this.limit
				}).then(res => {
					this.goodsList = this.goodsList.concat(res.data.list);
					this.finished = res.data.list.length < this.limit;
					this.loading = false;
					this.page += 1;
				}).catch(err => {

				});
			},
      // 判断：邀请人关联的商家是否绑定酒道馆
      isBindShop(){
        let _this = this;
        merBindShop(_this.bind_mer_id).then(res => {
          let data = res.data || {};
          let merId = data.mer_id || 0;
          if(merId <= 0){
            _this.$util.Tips({
              title: '该商户未绑定酒道馆！',
            },{tab:1,url:'/pages/user/index'});
          }
        })
      }
		},
		// 滚动监听
		onPageScroll(e) {
			// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
			uni.$emit('scroll');
		},

    // #ifdef MP
    // 分享给好友
    onShareAppMessage () {
      let pages = getCurrentPages();
      let page = pages[pages.length - 1]
      let shareData = {
        title: '会员中心',
        path: page.$page.fullPath || '/' + page.route,
      };
      // 判断：用户是否登录  已经登录则添加分享人信息，未登录则正常分享
      if (this.isLogin) shareData.path = shareData.path + '?spread=' + this.uid;
      // 返回最终的分享配置信息
      return shareData
    },
    // 分享到朋友圈
    onShareTimeline() {
      let shareData = {
        title: '会员中心',
        query: {},
      };
      // 判断：用户是否登录  已经登录则添加分享人信息，未登录则正常分享
      if (this.isLogin) shareData.query.spread = this.uid;
      // 返回最终的分享配置信息
      return shareData
    },
    // #endif
	}
</script>
<style lang="scss" scoped>
	.card_content{
		background: #F5f5f5;
	}
	.card-section {
		height: 600rpx;
		background: url("data:image/png;base64,[encoded data, 28312 characters]");
		background-size: cover;
		background-repeat: no-repeat;
		position: relative;
		.header-card{
			width: 750rpx;
			margin: 0 auto;
			background-image: url("data:image/png;base64,[encoded data, 49540 characters]");
			background-repeat: no-repeat;
			background-size: 100% 100%;
			padding: 53rpx 0 60rpx;
			position: absolute;
			left: 0;
			top: 64rpx;
			z-index: 10;
			.header-avatar{
				justify-content: space-between;
				align-items: center;
				padding: 0 53rpx;
				.text {
					flex: 1;
					margin-left: 15rpx;
					font-size: 22rpx;
					line-height: 30rpx;
					color: #89735B;
				}
				.name {
					margin-bottom: 2rpx;
					font-weight: bold;
					font-size: 30rpx;
					line-height: 42rpx;
					color: #865622;
				}
			}
			.vip{
				width: 82rpx;
				height: 36rpx;
				position: relative;
				top: 5rpx;
				margin-left: 7rpx;
			}
			.expire {
				font-size: 22rpx;
				color: #865622;
			}
		}
		.avatar-box{
			position: relative;
			.image {
				width: 64rpx;
				height: 64rpx;
				border-radius: 50%;
				border: 3rpx solid rgb(255, 210, 104);
				margin-right: 20rpx;
			}
			.headwear {
				position: absolute;
				right: 18rpx;
				top: -18rpx;
				width: 18rpx;
				height: 18rpx;
				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
	.header_count{
		margin-top: 20rpx;
		.vip_save{
			padding: 0 53rpx;
			.save_money{
				color: #666666;
				font-size: 24rpx;
				.money{
					font-size: 58rpx;
					color: #282828;
				}
			}
			.renew_btn{
				width: 160rpx;
				line-height: 60rpx;
				height: 60rpx;
				text-align: center;
				background: #282828;
				border-radius: 30rpx;
				color: #F7E1A6;
				font-size: 24rpx;
				font-weight: bold;
				position: relative;
				top: 30rpx;
			}
		}
	}
	.save_list{
		margin-top: 20rpx;
		padding: 0 30rpx 0 53rpx;
		display: flex;
		.item{
			width: 22%;
			display: inline-block;
			text-align: center;
			margin-right: 12rpx;
			&:last-child{
				margin-right: 0;
			}
			.pic{
				width: 84rpx;
				height: 84rpx;
				border-radius: 100%;
			}
			.text{
				margin-top: 10rpx;
				color: #282828;
				.name{
					font-size: 26rpx;
					font-weight: bold;
				}
				.info{
					max-width: 100%;
					color: #666666;
					font-size: 18rpx;
					margin-top: 4rpx;
				}
			}
		}
	}
	.vip_center{
		border-radius: 34rpx 34rpx 0 0;
		background: #F5F5F5;
		padding: 215rpx 20rpx 0;
		position: relative;
		margin-top: -260rpx;
		z-index: 5;
		.coupon-section {
			margin-top: 20rpx;
			background-color: #FFFFFF;
			background-size: 100%;
			background-repeat: no-repeat;
			border-radius: 16rpx;
			.section-bd {
				white-space: nowrap;
				padding: 0 20rpx;
				.item {
					display: inline-flex;
					width: 160rpx;
					height: 190rpx;
					margin: 26rpx 20rpx 30rpx 0;
					background-size: cover;
					background-repeat: no-repeat;
					position: relative;
					.coupon-count{
						width: 160rpx;
						text-align: center;
						margin-top: 36rpx;
					}
					&:last-child {
						margin-right: 0;
					}
					&.gray {
						&::before{
							content: "";
							display: block;
							width: 160rpx;
							height: 190rpx;
							background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAC+BAMAAABAPRn1AAAAJFBMVEVHcEzvypbsyZXsypTtyZXwzpPtypXsyZXsyZXsyZXsyZXsyZUx55mvAAAAC3RSTlMAJqVDehFfv9vwj03dKpUAAAVNSURBVGje7VjLU9tGGF9Zlm3IRaGZOMAFE/IAXww2kISLzRhaqoubmmcuCu/WF2xKAtUFSEiZ6JKZ0CapLqSdJJ1wQjb2mu+f6+5KNjaTzlTrTk/7O0i7q9Fv9nvu9y1CvFiw8MRMb188Hl/9tpBS1uAFagl+qxJ7cDvjzhIDahietcInGZXhdKxhPq6Pwq0WCKeqK5/J9ia/Z7vVEVLW9HUc4+Z7CFvLVFwNk0fgZI+urQ2flLgFNstZlbxlyybPdgC2tc+yySv0ffxVkr7bLaC8UGarcn6ukuHboHWw5Iy6U5To5WtnNjtsbHARdtoLqjMKOK9p98PtYIWHTzG3IggNf+GLb8XgIQziBVUqFL/06eMcD6F28B4hy3b1LzVu1TfIYxJIxJBiVXUq/Y+f0uk/+i4cmsdvQuddxLI7Z9S+vWx70mKk7vEchCcHPZSEPOS+mtt1HDNrkSUOG0PC9Rmlr9mN5QKXE7ZXFtxRWG3mM4ArTrpPP7gETQbIvjCwofMQntxyf1ts4rMA62M9PGEC11zvOW7mi+JM2ysOwkAl62aCTCOfbayYx8FTnrgrP2YZGkUasw9Wx3Y7y/4iB+Gjs2NZyxOTJOtLQ2gb1M6yDMs8GVvLJ/00QwfrK6OgI7MAGOVsHsJoWkUW+XH1gu8og3JwZOoB4CE0hxDCRFc9db7z6RgKVTK5XZTDKofX+JCiDtadJghvy1O/okB1WisjGWzPjDJ23NDP/vTf9B1lgUpq7gAOZDF4PgL8tnM8+djzCmx+F4XSO6rEiGGOlzrAK6GvlGogfLQP23BY1pIoZBMN3iiiLu+ETmpwBB/b6gBYxfNEiXDVKne/4gkUx7wJh3AnOartmtShTRPjk2OO/O8SXkUKCRVtB8dC5dzBWzKsDsJfKgdh0XVAZYrUH9EV7Vkfbitquh/2UD9POqztUJkisYZM1Q8lc/H8Xkw6IvVDgCvZMD1JU/DE0tE9kvZLuecYv0dU2iAPYYkSSlHYRNoukRkGiiEborBx4Use3eY85fKheaLEHyb8xUABlPVdXsJ2EimEj2ZXP1GiIvlOSWZAKHPhnB5PABLLMuNTvqF169i7UxStJWpS8kx4L2xIsZFSmJk3afEOsA+1KpO8vZdzMESzrMr45KdEzGi1q1aHJcnp4j3BLhIHid5i+1MsMpbSdYOpJD16P+c3STx0V+EmOw+agreDRrdnwrEzoikfOIfoWFONTtfaPRO2lSPUNE6JqTXmq0CSq/jyVWjmim44B9TxJYk5IEOYlmBFxtfY0Sq8XZRxU6f7RGi9uUOeVTkJc6cbTImX+KQIb+MYspkSDy918KMZ92j1Hs0wRH6cv8T3kJg49IbPzsYelXmSinm7tnaNCCybxJkUDsL58+X6bgeYlMoQixuN9LpBLpk7YhdXDQPpxHjvilNH9OroI5fMB/mGWTxes0XgcmfwbzGHw//UkKxxdaOSld+6fKnh7nHL4PNtu9ZESe49kOFo9etZ4CL0Q/6JM7qSZtVCN9gscfQYRb5oOamEHe13AyMMAWtQn8+CjjijZW89xrTpJLB51uWtL5mveQP6PqQKVI2z2Cl1JDIJf9Awb8ZBkolH9snf8kW72BUJw1YLt31gX99v3M9aPgu/tXLfdwMqI09TtdnM3Ui2fk/CiXXAqbVf/hycVq4m7vwce2DZKmoNowA/DSY+3ykMTKoz/fB7q3wkCZoALyeX4vGRu4Q7g1qH3A8u3kyg/wbXP22/qx4WHiMBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGB/wd/A1K7dDGJQCorAAAAAElFTkSuQmCC");
							background-size: cover;
							background-repeat: no-repeat;
							position: absolute;
							top: 0;
							left: 0;
							z-index: 2;
						}
					}
					.coupon-btn {
						position: absolute;
						bottom: 10rpx;
						color: #8F5C11;
						font-size: 22rpx;
						font-weight: bold;
						display: block;
						width: 100%;
						text-align: center;
						z-index: 3;
					}
					.text {
						max-width: 194rpx;
						margin-top: 10rpx;
						display: block;
					}
					.name {
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						font-weight: bold;
						font-size: 28rpx;
						line-height: 40rpx;
						color: #5D3324;
					}
					.mark {
						display: inline-block;
						height: 35rpx;
						font-size: 22rpx;
						line-height: 35rpx;
						color: #8F5C11;
					}
					.money {
						max-width: 170rpx;
						text-align: center;
						font-size: 22rpx;
						font-weight: 800;
						color: #8F5C11;
						margin-top: -20rpx;
					}
					.num {
						position: relative;
						font-size: 44rpx;
					}
				}
			}
		}
		.type-section {
		  margin-top: 30rpx;
			border-radius: 20rpx;
			background-color: #FFFFFF;
			padding-bottom: 30rpx;
			background-size: 100%;
			background-repeat: no-repeat;
			.title_bd {
				padding: 26rpx 40rpx 0 0;
				font-size: 24rpx;
				color: #797979;
				.bold {
					display: inline-block;
					margin-right: 14rpx;
					font-weight: bold;
					font-size: 32rpx;
					line-height: 45rpx;
					color: #333333;
					+view {
						display: inline-block;
					}
				}
				.time {
					margin-left: 14rpx;
					font-size: 24rpx;
					color: #AE5A2A;
				}
			}
			.scroll {
				white-space: nowrap;
				padding: 0 30rpx;
			}
			.item {
				display: inline-flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				width: 210rpx;
				height: 232rpx;
				border-radius: 12rpx;
				margin: 32rpx 20rpx 30rpx 0;
				border: 1px solid #CFCFCF;
				line-height: 42rpx;
				&:last-child {
					margin-right: 0;
				}
				&.on {
					border: 3rpx solid #FCC282;
					background-color: #FEF7EC;
					.new {
						color: #DBAA4D;
					}
				}
				.title{
					color: #282828;
					font-weight: bold;
					font-size: 30rpx;
					width: 180rpx;
					text-align: center;
				}
			}
			.new {
				margin-top: 22rpx;
				font-weight: 600;
				font-size: 34rpx;
				color: #E7BE7D;
				.num {
					font-size: 48rpx;
					line-height: 48rpx;
				}
			}
			.old {
				margin-top: 13rpx;
				text-decoration: line-through;
				font-size: 24rpx;
				color: #999999;
			}
			.info {
				margin-top: 13rpx;
				font-size: 24rpx;
			}
			.agree {
				font-size: 22rpx;
				text-align: center;
				color: #797979;
				margin-top: 30rpx;
				.link {
					display: inline-block;
				}
				.mark {
					color: #AE5A2A;
				}
			}
			.buy {
				height: 80rpx;
				border-radius: 12rpx;
				margin: 0 30rpx;
				background: linear-gradient(270deg, #E5BA62 0%, #ECCA7F 51%, #F3D99B 100%);
				font-size: 30rpx;
				font-weight: bold;
				line-height: 80rpx;
				text-align: center;
				color: #865622;
				border-radius:: 43rpx;
			}
			.cash {
				padding-top: 26rpx;
				padding-bottom: 29rpx;
				font-size: 28rpx;
				text-align: center;
				color: #754E19;
			}
		}
		.section-hd {
			padding: 30rpx 30rpx 0;
			.title {
				font-weight: bold;
				font-size: 32rpx;
				line-height: 45rpx;
				color: #333333;
			}
			.desc {
				font-size: 20rpx;
				color: #999999;
			}
		}
	}
	.goods-section {
		margin-top: 30rpx;
		background-color: #ffffff;
		background-image: url("data:image/png;base64,[encoded data, 11884 characters]");
		background-size: 100%;
		background-repeat: no-repeat;
		border-radius: 16rpx;
		.section-hd {
			padding: 26rpx 30rpx 0;
			font-weight: bold;
			font-size: 32rpx;
			line-height: 45rpx;
			color: #333333;
			text {
				color: #999999;
				font-size: 24rpx;
				font-weight: normal;
			}
		}
		.section-bd {
			margin-top: 26rpx;
			.item {
				width: 325rpx;
				padding-bottom: 24rpx;
				margin-left: 20rpx;
			}
			/deep/image, /deep/uni-image, /deep/.easy-loadimage {
				width: 325rpx;
				height: 325rpx;
				border-radius: 16rpx 16rpx 0 0;
			}
			.name {
				margin-top: 10rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				font-size: 30rpx;
				line-height: 37rpx;
				color: #282828;
			}
			.svip-price {
				margin-top: 6rpx;
				font-size: 28rpx;
				color: #282828;
				font-weight: bold;
				image {
					width: 65rpx;
					height: 28rpx;
					margin-left: 6rpx;
					position:  relative;
					top: 5rpx;
				}
			}
			.shop-price {
				margin-top: 4rpx;
				font-size: 18rpx;
				color: #999999;
			}
		}
	}
</style>
