<template>
	<view>
		<view class="entrust-lable">
			<text class="entrust-lable-text active-entrust-lable">限价委托({{ entrustlist.length }})</text>
			<!-- <text class="entrust-lable-text">计划委托(1)</text> -->
		</view>
		<view class="lable-title">
			<text class="lable-title-text">委托信息</text>
			<text class="lable-title-btn" @click.stop="setCloseLeverAll()">全部撤单</text>
		</view>
		<template v-for="item in entrustlist">
			<view class="content-box" :rise-fall="stocksColor">
				<view class="content-top">
					<view class="top-left">
						<view class="top-left-title">
							<text>{{ item.symbol }}</text>
							<text>{{ item.type_name }}</text>
						</view>
						<view class="top-left-b">
							<text>{{ item.multiple }}倍杠杆</text>
							<text class="top-left-b-tag">逐仓做多</text>
						</view>
					</view>
		
					<view class="top-right  top-right-btns">
						<text class="top-right-btn">撤单</text>
					</view>
				</view>
				<view class="content-info">
					<view class="info-item">
						<text class="info-item-lable">委托数量(张)</text>
						<text class="info-item-val">{{ item.caution_money }}</text>
					</view>
					<view class="info-item">
						<text class="info-item-lable">保证金(USDT)</text>
						<text class="info-item-val">{{ item.price }}</text>
					</view>
					<view class="info-item">
						<text class="info-item-lable">委托价(USDT)</text>
						<text class="info-item-val">{{ item.origin_price }}</text>
					</view>
					 
					 
					<view class="info-item">
						<text class="info-item-lable">止损价(USDT)</text>
						<text class="info-item-val"
							@click.stop="setRestrict(item)">{{ item.stop_loss_price || '--' }} <text
								class="iconfont">&#xe610;</text></text>
					</view>
					<view class="info-item">
						<text class="info-item-lable">预计价(USDT)</text>
						<text class="info-item-val"
							@click.stop="setRestrict(item)">{{ item.target_profit_price || '--' }} <text
								class="iconfont">&#xe610;</text> </text>
					</view>
					<view class="info-item">
						<text class="info-item-lable">创建时间(USDT)</text>
						<text class="info-item-val">{{ $getData_(item.create_time , false) }}</text>
					</view>
				</view>
				 
			</view>
			<gap />
		</template>
		<restrictPopup ref="restrictRef" @setSuccess="setSuccess" />
	</view>
</template>

<script>
	import restrictPopup from "./../modules/restrict.vue"
	export default {
		name:'entrust',
		props:{
			entrustlist: {
				type: Array,
				default: () => {
					return []
				}
			}
		},
		components:{restrictPopup},
		data() {
			return {
				
			};
		},
		mounted() {
		 
		},
		methods:{
			setRestrict(item) {
				this.$nextTick(() => {
					this.$refs.restrictRef.open(item)
				})
			},
			setSuccess() {
				this.$emit('closeLeverSuccess')
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "~./index.scss"
</style>