<template>

	<view class="content">

		<view class="headerGetbg"></view>

		<view class="bgf mar-24 home-content">

			<view class="box-pack-between list flex-y-center br">
				<text class="ft32 list-title">基本信息</text>
				<view class="flex-y-center">
			<!-- 		<view @click="enit" class="flex-y-center" style="margin-right: 20rpx;color: #1296db;">
						<image src="../static/images/gx.png" class="list-icon" mode=""></image> 更新
					</view> -->
			<!-- 		<view @click="del" class="flex-y-center" style="margin-right: 0rpx;color: #FF5722;">
						<image src="../static/images/fj.png" class="list-icon" mode=""></image> 发劵
					</view> -->
				</view>
			</view>

			<view class="flex-y-center home-content-item" style="padding-top: 24rpx;">
				<text class="home-left-name">优惠券ID：</text>
				<view style="word-break:break-all;">{{info.voucher_id}}</view>
			</view>

			<view class="flex-y-center home-content-item">
				<text class="home-left-name">模板ID：</text>
				<text>{{info.template_id}}</text>
			</view>

			<view class="flex-y-center home-content-item">
				<text class="home-left-name">用户ID：</text>
				<text>{{info.user_id}}</text>
			</view>

	<view class="flex-y-center home-content-item">
				<text class="home-left-name">登录账号：</text>
				<text>{{info.login_id}}</text>
			</view>


<view class="flex-y-center home-content-item">
				<text class="home-left-name">核销金额：</text>
				<text>{{info.amount}}</text>
			</view>

		<view class="flex-y-center home-content-item">
				<text class="home-left-name">状态：</text>
				<text>{{info.status == 'ENABLED'?'未使用': info.status=='USED'? '已使用': info.status=='DELETE'?'已删除': 
		info.status=='REFUNDED'?'已退款': info.status=='EXPIRED'? '已过期':info.status=='UNC' ?'未领取': info.status=='USING'? '使用中': 
		info.status=='TRANS'? '发放中':info.status=='TRANSFER'? '已转增' :info.status=='REFUNDING'? '使用中' :info.status=='UNACTIVE'? '未激活': 
		item.status=='DISABLED'?'不可用':''	}}		</text>
			</view>


			<view class="flex-y-center home-content-item">
				<text class="home-left-name">账单类型：</text>
				<text>{{info.biz_type == '1'? '未使用': info.biz_type=='2'? '已过期': info.biz_type=='V_REFUND'? '已退款': info.biz_type=='V_USE'? '已支付':''}}</text>
			</view>


			<view class="flex-y-center home-content-item">
				<text class="home-left-name">订单状态：</text>
				<text> {{info.order_status == '1' ?'未使用':info.order_status=='2'? '已过期': info.order_status=='I' ?'处理中' :info.order_status=='S' ?'已交易':'' }}</text>
			</view>
			

			<view class="flex-y-center home-content-item">
				<text class="home-left-name">时间：</text>
				<text>{{ info.use_time}}</text>
			</view>
<!-- 
			<view class="flex-y-center home-content-item">
				<text class="home-left-name">使用时间：</text>
				<text>{{info.expire_start_time+"至"+info.expire_end_time}}</text>
			</view> -->
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {},
				id: '',
				is_enit: false,
				URL: getApp().globalData.URL,
				is_play: false,
				is_model: false,
			}
		},

		onLoad(e) {
			this.id = e.id;
			this.http();
		},
		methods: {
			
			bindno() {
				this.is_model = false;
			},

			
			http() {
				this.request({
					url: "Smdcshop/getCouponListinfo",
					data: {
						id: this.id,
					},
				}).then(res => {
					console.log(res, "res")
					if (res.code === '200') {
						this.info = res.data;
					}
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none',
						duration: 2000,
						success: (res) => {},
					})
				});
			},

			del() {
				this.is_model = true;
			},

			enit() {
				let data = {
					id: this.id,
					admin_id: uni.getStorageSync("admin_id")
				}
				this.request({
					url: "Smdcshop/selectNomoneyTemStatus",
					data,
				}).then(res => {
					console.log(res, "res")
					if (res.code === '200') {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration: 1000,
							success: (res) => {
								setTimeout(() => {
									uni.navigateBack();
								}, 2e3)
							},
						})
					}
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none',
						duration: 2000,
						success: (res) => {},
					})
				});
			},

			onSubmit(e) {
				let data = e.detail.value;
				data.coupon_type = 2;
				data.id = this.id;
				data.admin_id = uni.getStorageSync("admin_id");
				this.request({
					url: "Smdcshop/fa_alipaycoupon",
					data,
				}).then(res => {
					console.log(res, "res")
					if (res.code === '200') {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration: 1000,
							success: (res) => {
								setTimeout(() => {
									this.is_model = true;
								}, 2e3)
							},
						})
					}
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none',
						duration: 2000,
						success: (res) => {},
					})
				});
			},



		},
	}
</script>

<style lang="scss">
	page {
		background: #F5F7FA;
	}

	.model {
		position: fixed;
		top: 0;
		left: 0;
		background: rgba(0, 0, 0, 0.5);
		width: 100%;
		height: 100%;
	}

	.model-home {
		background: #FFFFFF;
		width: 635rpx;
		height: 700rpx;
		padding: 40rpx 30rpx;
		border-radius: 10rpx;
		font-size: 26rpx;
	}

	.model-home button {
		text-align: center;
		width: 80%;
		height: 90rpx;
		background: linear-gradient(132deg, #3387FF 0%, #3387FF 100%);
		box-shadow: 0px 2rpx 12rpx #3387FF;
		opacity: 1;
		border-radius: 8rpx;
		color: #fff;
		margin-top: 40rpx;
	}

	.border-b {
		border-bottom: 1rpx solid #F1F1F1;
		padding-top: 40rpx;
		padding-bottom: 20rpx;
	}

	.bottom-bar {
		position: fixed;
		bottom: 0px;
		width: 100%;
		z-index: 1000;
		background: #FFFFFF;
		padding: 30rpx 0;
	}

	.bottom-bar button {

		text-align: center;
		width: 690rpx;
		height: 90rpx;
		background: linear-gradient(132deg, #3387FF 0%, #3387FF 100%);
		box-shadow: 0px 2rpx 12rpx #3387FF;
		opacity: 1;
		border-radius: 8rpx;
		color: #fff;
	}

	.home-content {
		width: 690rpx;
		opacity: 1;
		background: #ffffff;
		border-radius: 14rpx;
		box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(204, 215, 230, 0.08);
		margin: 0 auto;
		position: relative;
		font-size: 28rpx;
		padding: 0 24rpx;
		margin-top: 30rpx;

		.list {
			height: 100rpx;
			color: #999999;

			.list-title {
				color: #000000;
				font-size: 30rpx;
			}

			.list-icon {
				width: 29rpx;
				height: 29rpx;
				margin-right: 6rpx;
			}
		}

		.home-content-item {
			padding-bottom: 40rpx;

			.home-left-name {
				opacity: 1;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				text-align: left;
				color: #99a0ad;
				min-width: 160rpx;
			}

			.home-left-input {
				border: 1rpx solid #ccc;
				padding: 10rpx;
				word-break: break-all;
				flex: 1;
			}

		}
	}

	.info-group {
		color: #999999;
		display: inline-block;
		border: 1rpx solid #F1F1F1;
		padding: 10rpx 20rpx;
		margin: 20rpx 20rpx;
		font-size: 30rpx;
		border-radius: 4rpx;
	}

	.video_path {
		width: 98%;
		display: block;
		margin: 0 auto;
	}

	.code-img {
		margin: 60rpx auto;
		text-align: center;
	}

	.code-img image {
		width: 100rpx;
		height: 100rpx;
		margin-bottom: 20rpx;
	}

	.logo {
		width: 100rpx;
		height: 100rpx;
	}
</style>
