<template>
	<view class="submit">
		<view class="icon"
		@click="$emit('share')">
			<button open-type="share"
			class="share">
				<uv-icon
				size="40rpx"
				name="share-square"></uv-icon>
			</button>
		</view>
		<!-- <view class="icon"
		@click="$utils.navigateTo('/index/cart')">
			<button
			class="share">
				<uv-icon 
				size="40rpx"
				name="shopping-cart"></uv-icon>
				<view class="">
					购物车
				</view>
			</button>
		</view> -->
		
		<!-- <view class="btn"
		@click="$emit('submit')">
			{{ submiitTitle }}
		</view> -->
		
		<view class="submit-btn"
		v-if="pay == 'Y'"
		@click="submit">
			<view class="r"
			v-if="isProductPoint(detail)">
				立即兑换
			</view>
			<view class="r"
			v-if="isProductPrice(detail)">
				立即购买
			</view>
		</view>
		
	</view>
</template>

<script>
	import productMixins from '@/mixins/product.js'
	export default {
		name:"submit",
		mixins : [productMixins],
		props : {
			submiitTitle : {
				default : '立即兑换',
				type : String,
			},
			pay : {
				default : 'N',
				type : String,
			},
			detail : {
				default : {}
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			// 
			submit(){
				if(this.isShopBuy(this.detail)){
					uni.navigateTo({
						url: '/pages_order/gourmet/gourmetDetail?id=' + this.detail.shopId
					})
					return
				}
				this.$emit('submit')
			},
		}
	}
</script>

<style lang="scss" scoped>
.submit-btn{
	width: 600rpx;
	height: 80rpx;
	color: #fff;
	border-radius: 40rpx;
	font-size: 28rpx;
	margin: 20rpx auto;
	display: flex;
	justify-content: center;
	align-items: center;
	border: 1rpx solid $uni-price-color;
	overflow: hidden;
	.l{
		flex: 1;
		display: flex;
		justify-content: center;
		align-items: center;
		color: $uni-price-color;
	}
	.r{
		background: $uni-price-color;
		flex: 1;
		height: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
	}
}
.submit{
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100vw;
	background-color: #fff;
	height: 120rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 24rpx;
	.btn{
		background: $uni-price-color;
		width: 600rpx;
		height: 80rpx;
		color: #fff;
		border-radius: 40rpx;
		font-size: 28rpx;
	}
	
	.icon{
		width: 100rpx;
		margin: 0 10rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
	}
	.share{
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		font-size: 24rpx;
		margin: 0;
		padding: 0;
		background-color: #fff;
		&::after{
			border: none;
		}
	}
}
</style>
