<template>
	<view class="hapPasDetBox column" style="width:100vw;height:100vh;background: #F3F1EF;">
		<view class="hapPasDetTitle">幸福存折{{PassbookAata.type==1?'收入':'支出'}}</view>
		<view class="hapPasDetNum">{{PassbookAata.type==1?'+':'-'}}{{ PassbookAata.money }}</view>
		<view class="hapPasDetBox">
			<view class="hapPasDetImg row" @click="goProduct">
				<image mode="aspectFit" :src="PassbookAata.imgCover" />
				<view class="col">{{ PassbookAata.lineName }}</view>
			</view>
			<view class="row hapPasDetText">
				<text class="hapPasDetL">订单号</text>
				<view class="hapPasDetR col">
					<text class="hapPasDetRC">{{ PassbookAata.orderId }}</text>
					<text class="hapPasDetRCop" @click="handleCopy(PassbookAata.orderId)">复制</text>
				</view>
			</view>
			<view class="row hapPasDetText">
				<text class="hapPasDetL">{{PassbookAata.type==1?'收入':'支出'}}日期</text>
				<view class="hapPasDetR col">
					<text class="hapPasDetRC">{{ PassbookAata.updateTime }}</text>
				</view>
			</view>
			<view class="row hapPasDetText">
				<text class="hapPasDetL">团号</text>
				<view class="hapPasDetR col">
					<text class="hapPasDetRC">{{ PassbookAata.tcnum }}</text>
					<text class="hapPasDetRCop" @click="handleCopy(PassbookAata.tcnum)">复制</text>
				</view>
			</view>
			<view class="row hapPasDetText">
				<text class="hapPasDetL">出团日期</text>
				<view class="hapPasDetR col">
					<text class="hapPasDetRC">{{ PassbookAata.tcStartDate }}</text>
				</view>
			</view>
			<view class="row hapPasDetText">
				<text class="hapPasDetL">订单人数</text>
				<view class="hapPasDetR col">
					<text class="hapPasDetRC active">{{ PassbookAata.peopleNum }}人</text>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		components: {
			
		},
		data() {
			return {
				scrollTop: 0,
				b2b_user_info: {},
				mall_UserInfo: {},
				PassbookAata:{},
			};
		},
		onLoad(option) {
			if(option.data){
				this.PassbookAata = decodeURIComponent(option.data)
			}
			this.b2b_user_info = uni.getStorageSync('b2b_user');
			this.mall_UserInfo = uni.getStorageSync("mall_UserInfo");
			this.showAuth = !this.mall_UserInfo || !this.b2b_user_info;
		},
		onShow() {
			uni.setNavigationBarTitle({
				title: ""
			})
		},
		methods: {
			async handleCopy(text){
				try {
					await uni.copyText(text);
					uni.showToast({
						title: '复制成功',
						icon: 'success',
					});
				} catch (err) {
					uni.showToast({
						title: '复制失败',
						icon: 'none',
						duration: 1500
					});
				}
			},
			goProduct(){
				return
				uni.navigateTo({
					url: "/pages/product/productDetails/productDetails?id="+this.PassbookAata.orderId
				})
			}
		}
	};
</script>

<style scoped>
	@import url('../../asset/css/flex.css');
	.hapPasDetTitle{
		font-weight: bold;
		font-size: 32rpx;
		color: #080A0A;
		line-height: 70rpx;
		text-align: center;
		padding: 39rpx 0 40rpx 0;
	}
	.hapPasDetNum{
		font-weight: bold;
		font-size: 52rpx;
		color: #B99846;
		line-height: 70rpx;
		text-align: center;
		margin-bottom: 48rpx;
	}
	.hapPasDetBox{
		background: #FFFFFF;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
		padding: 40rpx;
	}
	.hapPasDetImg{
		margin-bottom: 50rpx;
	}
	.hapPasDetImg image{
		width: 141rpx;
		height: 141rpx;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
		border: 1rpx solid #000000;
		display: inline-block;
	}
	.hapPasDetImg view{
		margin-left: 30rpx;
		font-weight: bold;
		font-size: 28rpx;
		color: #080A0A;
		word-break: break-all;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical; 
		-webkit-line-clamp: 4;
		overflow: hidden;
	}
	.hapPasDetText{
		padding: 0 0 10rpx 0;
	}
	.hapPasDetL{
		width: 180rpx;
		font-weight: 500;
		font-size: 28rpx;
		color: #757776;
		line-height: 70rpx;
	}
	.hapPasDetR{
		font-size: 28rpx;
		line-height: 70rpx;
	}
	.hapPasDetRC{
		font-weight: bold;
		color: #080A09;
	}
	.hapPasDetRC.active{
		color: #FF3166;	
	}
	.hapPasDetRCop{
		line-height: 35rpx;
		background: #E9E4E0;
		border-radius: 15rpx 15rpx 15rpx 15rpx;
		color: #000000;
		font-weight: 500;
		display: inline-block;
		padding: 0 10rpx;
		margin-left: 30rpx;
	}
</style>