<template>
	<view class="container">
		<view class="page-block">
			<view class="page-title-block">
				<view class="title">类型信息</view>
			</view>
			<view class="content">
				<view class="cell flex flex-y-center">
					<view class="title-block">
						<text>类型名称</text>
					</view>
					<view class="desc">
						<view class="input-box">{{info.name}}</view>
					</view>
				</view>
				
				<view class="cell flex flex-y-center">
					<view class="title-block">
						<text>分类标识</text>
					</view>
					<view class="desc">
						<view class="input-box">{{info.mark}}</view>
					</view>
				</view>
				
				<view class="cell flex flex-y-center">
					<view class="title-block">
						<text>使用人数备注</text>
					</view>
					<view class="desc">
						<view class="input-box">{{info.content}}</view>
					</view>
				</view>
				
			
				
				<view class="cell flex flex-y-center">
					<view class="title-block">
						<text>排序</text>
					</view>
					<view class="desc">
						<view class="input-box">{{info.num}}</view>
					</view>
				</view>
			</view>
		</view>
    
		<!-- 		<view class="page-block">
			<view class="page-title-block">
				<view class="title">费用信息</view>
			</view>
			<view class="content">
				<view class="cell flex flex-y-center">
					<view class="title-block">
						<text>服务金额</text>
					</view>
					<view class="desc">
						<view class="input-box">大开发将大力</view>
					</view>
				</view>
				<view class="cell flex flex-y-center">
					<view class="title-block">
						<text>预订预付款</text>
					</view>
					<view class="desc">
						<view class="input-box">大开发将大力</view>
					</view>
				</view>
				<view class="cell flex flex-y-center">
					<view class="title-block">
						<text>最低消费</text>
					</view>
					<view class="desc">
						<view class="input-box">大开发将大力</view>
					</view>
				</view>
			</view>
		</view> -->
		<view style="height:30rpx;"></view>
		<view class="footer-bar" style="height: 100rpx;">
			<view class="content flex flex-center" style="height: 100rpx;">
				<view class="detail-btn flex flex-center" @click="del" style="border-right: 2rpx solid #F4F5F7;">
					<image src="../static/images/icon_16.png" mode="aspectFit" class="btn-icon"></image>
					<view style="color:#999999">删除</view>
				</view>
				<view class="detail-btn flex flex-center" @click="enit">
					<image src="../static/images/icon_17.png" mode="aspectFit" class="btn-icon"></image>
					<view style="color:#3387FF">重新编辑</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {},
			}
		},
		onLoad(e) {
			console.log(e)
			this.getData(e.id);
			this.id=e.id;
		},
		methods: {
			enit(){
			   let info=this.info;
				uni.redirectTo({
					url:`../editTableType/editTableType?id=${info.id}&name=${info.name}&num=${info.num}`
				})
				
			},
			del() {
				uni.showModal({
					title: '提示',
					content: '是否要删除？',
					showCancel: true,
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							this.request({
								url: 'Smdcshop/table_type_delect',
								data: {
									id: this.id,
								},
							}).then(res => {
								console.log(res, "res")
								if (res.code === 200 || res.code === "200") {
									uni.showToast({
										title: "删除成功",
										icon: "none",
									})
									setTimeout(()=>{
										  uni.navigateBack()
										},2000)
								}
							}).catch((res) => {
								uni.showToast({
									title: res.message,
									icon: "none",
								})
							});
						}
					},
					fail: () => {},
					complete: () => {}
				});
			},
			
			
			getData(id) {
				this.request({
					url: 'Smdcshop/table_type_update_info',
					data: {
						id: id
					}
				}).then(res => {
					if (res.code == "200") {
						this.info = res.data
					} else {
						this.is_bottom = true
					}
				})
			}
		}
	}
</script>

<style>
	@import url("../static/css/common.css");

	page {
		background-color: #F4F5F7;
	}
</style>
