<template>
	<view>
		<ul style="list-style: none;padding-left: 0px;margin-top: 20rpx;">
			<li v-for="data in msgdata" :key="data.researchId" style="margin:0 auto 40rpx;padding: 20rpx;width: 90%;background-color: #f5f5f5;">
				<view class="slot-text-filename" @click="clickDetail(data)">
					<text>{{data.marketName}}</text>
				</view>
				<view class="slot-text-msg" @click="clickDetail(data)" style="display: flex;flex-direction: column;">
					<text class="slot-text-msg-data" style="font-size: 30rpx;">市场地址：{{data.address}}</text>
					<text class="slot-text-msg-data" style="font-size: 30rpx;">竞争对手数量：{{data.competitorNumber}}</text>
					<text class="slot-text-msg-data" style="font-size: 30rpx;">潜在客户数量：{{data.customerNumber}}</text>
					<text class="slot-text-msg-data" style="font-size: 30rpx;">平均消费水平：{{data.avgPrice}} </text>
					<text class="slot-text-msg-data" style="font-size: 30rpx;">调研时间：{{data.researchTime}} </text>
				</view>
				<view class="slot-text-btn">
					<button class="btn-modify" @click="modifyF(data.researchId)">修改</button>
					<button class="btn-delete" @click="deleteF(data.researchId)">删除</button>
				</view>
			</li>
		</ul>
		<view  class="tips-box" v-show="isShow">
			<text style="line-height: 150rpx;">确认删除？</text>
			<view class="tips-btn">
				<button @click="close">取消</button>
				<button @click="handleDelete()">确认</button>
			</view>
		</view>
	</view>
</template>

<script>
	import { listResearch,delResearch } from "../../api/marketmini/index"
	export default {
		data() {
			return {
				visit:'visit',
				msgdata:[
					{
						address: "城北",
						avgPrice: 5,
						competitorNumber: 5,
						createBy: null,
						createTime: "2022-07-12 15:30:26",
						createUserId: null,
						customerNumber: 5,
						marketName: "城北市场",
						params: {},
						remark: null,
						researchId: "1",
						researchTime: "2022-07-12",
						searchValue: null,
						updateBy: null,
						updateTime: "2022-07-12 15:30:40",
						updateUserId: null
					}
				],
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					// marketName: null,
					// address: null,
					// researchTime: null,
				  },
				  isShow:false,
				  deleteid:''
			};
		},
		methods:{
			createF(){
				uni.navigateTo({
					url:"/pages/newAdd/newAdd"
				})
			},
			deleteF(data){
				// delCustomerInfo()
				this.isShow= true
				// this.$refs.popup.open('top')
				this.deleteid = data
				console.log(this.deleteid)
				
			},
			close() {
				// this.$refs.popup.close()
				this.isShow = false
			},
			handleDelete(){
				delResearch(this.deleteid).then(data=>{
					this.getlist()
					this.close()
				})
			},
			modifyF(id){
				uni.navigateTo({
					url:'/pages/addMarket/addMarket?id='+id
				})
			},
			exportF(){
				console.log("导出")
			},
			getlist(){
				listResearch(this.queryParams).then(data=>{
					this.msgdata = data.rows
				})
			}
		},
		onShow(){
			this.getlist()
		}
	}
</script>

<style lang="scss">
@import url("@/common/scss/core.scss");
.commonlist-text{
	margin: 50rpx 20rpx 20rpx;
}
/deep/ checkbox.round .wx-checkbox-input,
/deep/ checkbox.round .uni-checkbox-input {
	border-radius: 50%;
	width: 14px;
	height: 14px;
}
.slot-box {
	display: flex;
	flex-direction: row;
	align-items: center;
}

.slot-image {
	display: block;
	margin-right: 10px;
	width: 30px;
}

.slot-text {
	flex: 1;
	font-size: 13px;
	color: #000000;
	margin-right: 10px;
	.slot-text-msg{
		color: #8F8F94;
		font-size: 35rpx;
		.slot-text-msg-data{
			margin-right: 10px;
			font-size:20px ;
		}
	}
}
// .slot-box-checkbox{
// }
.slot-text-filename{
	font-size: 40rpx;
	border-bottom: 2px solid #c9c9cd;
}
.slot-text-btn{
	margin-top: 30rpx;
	display: flex;
	justify-content: space-around;
	button{
		width: 25%;
		font-size: 20rpx;
		color: white;
		background-color: blue;
	}
}
.tips-box{
	padding: 40rpx;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	// height: 100px;
	width: 70%;
	background-color: #fff;font-size: 40rpx;
	border-radius: 20px;
	text-align: center;
	.tips-btn{
		display: flex;
		justify-content: space-around;
	}
	// span{
	// 	margin-bottom: 50rpx;
	// 	line-height: 100rpx;
	// }
	button{
		background-color: blue;
		color: #fff;
		font-size: 35rpx;
		width: 30%;
	}
		
}
</style>
