<?php $__env->startPush('style'); ?>
	<link rel="stylesheet" href="<?php echo e(asset($activeTemplateTrue.'css/invest.css')); ?><?php echo e($catch); ?>">
	<style>.plNjs .got[data-v-25a9fe6c]{background:#989898 !important}.promptCont{width:60%}.clickBtn_S{width:120px;background-color:#1c9c79;-webkit-border-radius:12px;border-radius:12px;}.KjkesMn{background-color:#ededed70;color:#000;-webkit-border-radius:2px;border-radius:2px;}</style>
<?php $__env->stopPush(); ?>


<?php $__env->startSection('content'); ?>
<uni-app class="uni-app--showtabbar uni-app--maxwidth">
	<uni-page data-page="pages/index/shop" class="plNjs">
		<uni-view data-v-098dd34f="" class="shop content" >
			<uni-view data-v-58cb4ed7="" data-v-5c2fef75="" class="back-title">
				<span data-href="<?php echo e(route('user.profile')); ?>" class="returnBank"><img src="<?php echo e(asset($activeTemplateTrue.'img/back.png')); ?>" style="margin-left:12px;width:28px;" /></span>
				<span data-v-58cb4ed7="" class="title-txt">My Product</span>
			</uni-view>

			<uni-view data-v-098dd34f="" class="color-bg" style="z-index:-2;"></uni-view>
			<img src="<?php echo e(asset('/users/assets/trade/img/giftbox.png')); ?>" alt="" style="width:140px;display:none;"  />

			<p data-v-098dd34f="" title="true" style="margin-bottom: 15px; margin-top: 30px;">&nbsp;</p>

			<div class="uni-swiper-wrapper" style="margin:15px">
				<div class="uni-scroll-view">
					<div class="uni-scroll-view" style="overflow: hidden;">
						<div class="uni-scroll-view-content">
							<uni-view data-v-62c02cd0="" data-v-098dd34f="">
								<uni-view data-v-62c02cd0="" class="waterfall">

			<?php $__empty_1 = true; $__currentLoopData = $logs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
			<?php
				$endTime = \Carbon\Carbon::parse($log->created_at)->addDays($log->total_return);
				if( $endTime->timestamp < now()->timestamp ){
					$timeDiff = " [zero]";
					$Expired = true;
				}else{
					$spentTi = now()->diffInDays($log->created_at);
					$timeDiff = ($log->total_return-$spentTi) . " days";
					$Expired = false;
				}
			?>

			<uni-view data-v-25a9fe6c="" data-v-62c02cd0="" style="position: relative;">
				<uni-view data-v-25a9fe6c="" class="goods-card active">
					<aside class='ribbon3'>
					<?php if( $log->status == 1 || $Expired ): ?> 
						Expired
					<?php else: ?>
						Valid
					<?php endif; ?>
					</aside>
					<uni-view data-v-25a9fe6c="" class="" style="">
						<uni-view data-v-25a9fe6c="" class="goods-content" style="margin-bottom:2px">
							<uni-view data-v-25a9fe6c="" class="thumb">
								<img data-v-25a9fe6c="" src="<?php echo e(asset('assets/'.$log->plan['img'])); ?>" style="border-radius:8px;">
							</uni-view>
							<uni-view data-v-25a9fe6c="" class="desc">
								<p data-v-25a9fe6c="" class="title" style="color:#FFF;margin-bottom:4px;"><?php echo e($log->plan['name']); ?> (<?php echo e($log->total_return); ?>Days)<br></p>
								<p data-v-25a9fe6c="">Price： <span data-v-25a9fe6c=""> <?php echo e(showAmount($log->amount,2)); ?></span></p>
								<p data-v-25a9fe6c="">Cycle： <span data-v-25a9fe6c=""> <?php echo e($log->total_return); ?></span></p>
								
								<uni-view data-v-25a9fe6c="" class="collapse-content" style="background: transparent;">
									<?php if( $log->status == 0): ?>
									<p data-v-25a9fe6c="">Remaining days ： <?php echo e($timeDiff); ?></p>
									<?php else: ?>
									<p data-v-25a9fe6c="">Remaining days ： [zero]</p>
									<?php endif; ?>
								</uni-view>
								<p data-v-25a9fe6c="">Received income ： <?php echo e(showAmount(($log->earned), 0)); ?></p>
								<p data-v-25a9fe6c="" style="color:#f6a530">Status： <span data-v-25a9fe6c="" style="color:#f6a530"> <?php echo e(($log->is_started ) ? 'Not received':'received'); ?></span></p>
							</uni-view>
						</uni-view>
						<uni-view data-v-25a9fe6c="" class="purchase">
							<span></span>
							<?php if( $log->status == 0  && !$Expired ): ?>
								<?php if( $log->is_started ): ?>
									<uni-button data-v-25a9fe6c="" class="mining-button whatsapp-share<?php echo e(($log->is_started==2 ) ? 'n got':''); ?>" data-interest="<?php echo e(config('settings')->cur_sym); ?><?php echo e(getAmount($log->interest_amount)); ?>" data-href="<?php echo e(route('user.take.reward', $log->id)); ?>"><?php echo e(($log->is_started==2 ) ? 'Waiting':'Receive'); ?></uni-button>
								<?php else: ?>
									<uni-button data-v-25a9fe6c="" class="mining-button got">Received</uni-button>
								<?php endif; ?>
							<?php else: ?>
							<uni-button data-v-25a9fe6c="" class="mining-button">Closed</uni-button>
							<?php endif; ?>
						</uni-view>
					</uni-view>
				</uni-view>
			</uni-view>
			<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
			<div style="padding:2px; width:95%; margin:0 auto; margin-top:50px;">
				<div style="border-radius: 5px; color:#fff; text-align:center; margin-top:35px;position:relative;">
					<img src="/assets/images/no.png" style=" width:100%;" /><br>
				</div>
			</div>
			<div class="layui-flow-more">You have not production line yet</div>
			<?php endif; ?>

								</uni-view>
							</uni-view>
						</div>
					</div>
				</div>
			</div>

		</uni-view>
	</uni-page>
	
	<?php echo $__env->make($activeTemplate.'layouts.menu',['activeLink'=>'invest'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

</uni-app>
<?php $__env->stopSection(); ?>


<?php $__env->startPush('script'); ?>
<script>
    $('.whatsapp-share').on('click', function() {
        var url = $(this).data('href');
		var interest = $(this).data('interest');

		$.ajax({
			type: "POST",
			url: url,
			data: {
                _token: '<?php echo e(csrf_token()); ?>'
			},
			beforeSend: function() {
				loading.showLoading({type: 2,tip: "Checking..."});
			},
			success: function(data) {
				loading.hideLoading();
				awarding("<?php echo e(asset('/users/assets/trade/img/giftbox.png')); ?>", interest, 'Congratulations!', data.message, data.link); 
			},
			error: function(xhr, status, error) {
                var data = JSON.parse(xhr.responseText);
                var responseMessage = data.message
				loading.hideLoading();
                Toast(responseMessage);
			},
			fail: function() {
				loading.hideLoading();
				Toast("Request Failed");
			}
		});
	});

</script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make($activeTemplate.'layouts.users', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/metalixz/public_html/core/resources/views/templates/gpt/user/my_income.blade.php ENDPATH**/ ?>