<template>
	<view class="outter-wrapper">
		<u--image width="750rpx" height="100vh" mode="aspectFit" :src="currentImgUrl"></u--image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentImgUrl: '',
				pageOptions: {name: 'gzh'}
			}
		},
		onLoad(options) {
			this.pageOptions = options
			let title = options.name == 'gzh' ? '关注公众号' : '加入社群'
			uni.setNavigationBarTitle({
				title: title
			})
			this.getData()
		},
		methods: {
			getData() {
				uni.showLoading()
				this.$api.getData({name: this.pageOptions.name}).then(res => {
					uni.hideLoading()
					if (res.data&&res.data.length) {
						this.currentImgUrl = res.data[0].img
					}
				}).catch(() => {
					uni.hideLoading()
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.outter-wrapper {
		background-color: #000;
		height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		
	}

</style>
