<template>
	<view class="content">
		<view class="item">
			<image style="width: 222rpx;height: 144rpx;" mode="aspectFit" src="../static/images/no_data.png"></image>
			<view>暂无咨询</view>
			<!-- <image mode="aspectFit" :show-menu-by-longpress="true" :src="urls[0]"  ></image> -->
			<!-- <view class="btn" @click="savePhoto()">
				保存本地
			</view> -->
		</view>
		 
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				urls:['https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20221119/61b277f036444bdebf6be3e9626b272c.jpg']
			};
		},
		onLoad(option) {
			 
			
		},
		onShow() {
		},
		methods: {
			savePhoto(){
				var that=this;
				uni.downloadFile({ //下载文件资源到本地,返回文件的本地临时路径
						url: that.urls[0], //网络图片路径
						success:(res)=>{
								  var imageUrl=res.tempFilePath;//临时文件路径
								  uni.saveImageToPhotosAlbum({ //保存图片到系统相册
									   filePath: imageUrl,
									   success: (res) => {
										  console.log('图片保存成功');
									   },
									   fail: (err) => {
										   console.log('图片保存失败');
									   }
								  })
						}
				}) 
			},
			showImg() {
			 	//预览图片
			 	uni.previewImage({
					urls: this.urls,
			 	 	current: this.urls[0],
					// 长按图片显示操作菜单，如不填默认为保存相册
					longPressActions:{
						itemList:[]
					}
			 	});
			},
		}
	}
</script>

<style lang="scss">
	.content{
		height: 100%;
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		.item{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			width: 100vw;
			height: 100vh;
			image{
				width: 100%;
				height:100%;
			}
			.btn{
				margin-top: 30rpx;
				background-image: linear-gradient(#ff4545,red);
				padding: 30rpx 60rpx;
				border-radius: 60rpx;
				background-color: red;
				color: #fff;
				font-size: 30rpx;
				font-family: 'PingFangTC-Regular';
				font-weight: 600;
			}
		}
		
	}
</style>
