<template>
	<view class="allContent">
		<view class="list-item">
			<view><text>产品名称：</text><text>{{state.tableData['promoteName']}}</text></view>
			<view><text>操作员工姓名：</text><text>{{state.tableData['operateUserName']}}</text></view>
			<view><text>产品金额：</text><text>{{state.tableData['fee']/100}}元</text></view>
			<view><text>产品发行产品编号：</text><text>{{state.tableData['releaseId']}}</text></view>
			<view><text>产品编号：</text><text>{{state.tableData['promoteId']}}</text></view>
			<view><text>产品生效时间：</text><text>{{state.params['start']}}</text></view>
			<view><text>产品过期时间：</text><text>{{state.params['end']}}</text></view>
			<view><text>产品状态：</text><text>{{state.tableData['status']=="ENABLE"?'可使用':"禁用"}}</text></view>
			<view><text>产品渠道：</text><text>{{state.params['agencyName']?(state.params['agencyName'])[0]:""}}</text>
			</view>
		</view>
	</view>

</template>

<script setup lang="ts">
	import { reactive } from "vue";
	import { onLoad } from "@dcloudio/uni-app";
	import { ETCProductStatusListQueryDetailsApi } from "@/utils/network/api.js";
	import { request } from "@/utils/network/request.js";
	import { stringToJson } from "@/utils/network/encryption.js";
	const state = reactive({
		params: {},  //上一个页面传递过来的参数
		promoteName: "",  //产品名称
		promoteId: "",//产品编号
		tableData: [],

	});
	onLoad((options) => {
		state.params = JSON.parse(decodeURIComponent(options.params))
		state.promoteId = state.params.promoteId
		console.log("options.promoteId", 1111, state.params)
		query();
	})
	const query = () => {
		const options = {
			type: 2,
			data: {
				"promoteId": state.promoteId,
			},
			method: "POST",
			showLoading: true,
		};
		//调用方式
		request(ETCProductStatusListQueryDetailsApi, options).then((res) => {
			state.tableData = stringToJson(res.bizContent)
			console.log("res", state.tableData)
		})
	}
</script>

<style scoped>
	.allContent {
		background-color: #EEF7F7;
		height: 100vh;
		overflow: hidden;
	}

	.list-item {
		width: 95%;
		border-radius: 10rpx;
		margin: 30rpx auto;
		font-size: 28rpx;
		border: 1rpx solid #ccc;
		padding: 12rpx;
		box-sizing: border-box;
		background-color: white;

	}

	.list-item>view {
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
	}

	.list-item>view>text:first-child {
		width: 38%;
		display: inline-block;
	}

	.list-item>view>text:last-child {
		width: 62%;
		display: inline-block;
		word-break: break-all;
	}
</style>