<template>
	<view class="hb column">
		<view>
			<view v-for="(item,index) in discountlist" :key="index"> 
				<view class="justify-between align-center p48 m20 colorf bgmap" @click="todetail(item)"
				>
					<view class="justify-center">
						<view>
							<view class="fs48 bold">￥{{item.couponPrice}}</view>
						</view>
						<view class="ml80">
							<view>{{item.couponName}}</view>
							<view class="fs24 mt16">可与优惠卷叠加使用</view>
						</view>
					</view>
					<view class="bgf base-price plr28 ptb12 radius40">查看</view>
				</view>
			</view>
		</view>
		<view v-if="discountlist.length == 0" class="centerV" >
			<image src="https://czwh.obs.cn-southwest-2.myhuaweicloud.com/app/orangeShop/no_data.png" mode="aspectFit"></image>
			<view class="centerV">暂无数据</view>
		</view>
	</view>
</template>

<script>
	import { getCompanyCouponIssueList} from '@/api/coupon'
	export default {
		data(){
			return{
				discountlist:[],
				companyUserId:"",
				companyId:"",
				imageMap: 'https://czwh.obs.cn-southwest-2.myhuaweicloud.com/app/orangeShop/Direct-sel.png',
			}
		},
		onLoad(option) {
			this.companyId=option.companyId
			this.companyUserId=option.companyUserId
			this.getCompanyCouponIssueLists()
			console.log(option)
		},
		methods:{
			todetail(item){
				uni.navigateTo({
					url: '/pages_company/order/DirectDetail?companyUserId='+this.companyUserId+'&companyId='+this.companyId
					+"&item="+JSON.stringify(item)
				})
				console.log(JSON.stringify(item))
			},
			getCompanyCouponIssueLists(){
				const data={
					couponType:3,
				}
				getCompanyCouponIssueList(data).then(res=>{
					if(res.code==200){
						this.discountlist=res.data.list
						console.log(this.discountlist)
					}else{
						uni.showToast({
							icon:'none',
							title: res.msg,
						});
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bgmap{
		background: url('https://czwh.obs.cn-southwest-2.myhuaweicloud.com/app/orangeShop/Direct-sel.png');
		background-size: cover;
	}
</style>