<template>
	<view class="pages">
		<u-navbar title="推广管理" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
			title-size='36' height='44'></u-navbar>
         <view class="list">
         	<view class="img" @click="btnpage(1)" v-if="type == 2">
         		<image src="https://api.ccttiot.com/smartmeter/img/static/uizHnwqSgXv8sqsnW4yJ" mode=""></image>
         	</view>
			<view class="img" @click="btnpage(2)">
				<image src="https://api.ccttiot.com/smartmeter/img/static/ullaHV7ekElj4lAXWuGQ" mode=""></image>
			</view>
			<view class="img" @click="btnpage(3)">
				<image src="https://api.ccttiot.com/smartmeter/img/static/uIpmf4ICgCCBf9oyT4sg" mode=""></image>
			</view>
			<view class="img" @click="btnpage(4)">
				<image src="https://api.ccttiot.com/smartmeter/img/static/uaaS0g2CDVCGHhsbEo7T" mode=""></image>
			</view>
         </view>
		 <view class="qtg" @click="btnpage(5)">
		 	去推广
		 </view>
		 
		 
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: "#8883f0",
				}, 
				type:''
			}
		},
		onLoad() {
           
		},
		onShow() {
			this.getinfo()
		},
		// 分享到好友(会话)
		onShareAppMessage: function() {
			return {
				title: '创亿康',
				path: '/pages/index/index'
			}
		},

		// 分享到朋友圈  
		onShareTimeline: function() {
			return {
				title: '创亿康',
				query: '',
				path: '/pages/index/index'
			}
		},
		methods: {
            // 跳转
			btnpage(num){
				if(num == 1){
					uni.navigateTo({
						url:'/page_user/daili'
					})
				}else if(num == 2){
					uni.navigateTo({
						url:'/page_user/yewuyuan'
					})
				}else if(num == 3){
					uni.navigateTo({
						url:'/page_user/touzi'
					})
				}else if(num == 4){
					uni.navigateTo({
						url:'/page_user/changsuo'
					})
				}else if(num == 5){
					uni.navigateTo({
						url:'/page_user/creadtg'
					})
				}
			},
			
			getinfo(){
				this.$u.get(`/app/user/userInfo`).then(res => {
					if(res.code == 200){
						this.type = res.data.type
					}
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	/deep/ .u-title {
		padding-bottom: 15rpx;
	}

	/deep/ .u-icon__icon {
		padding-bottom: 15rpx;
	}

	.pages {
		background-color: #F7FAFE !important;
		height: 100vh;
		width: 100%;
		.qtg{
			width: 584rpx;
			height: 90rpx;
			background: #8883F0;
			border-radius: 54rpx 54rpx 54rpx 54rpx;
			text-align: center;
			line-height: 90rpx;
			font-size: 40rpx;
			color: #FFFFFF;
			position: fixed;
			bottom: 102rpx;
			left: 50%;
			transform: translateX(-50%);
		}
		.list{
			display: flex;
			justify-content: flex-start;
			flex-wrap: wrap;
			justify-content: space-between;
			padding: 0 70rpx;
			box-sizing: border-box;
			.img{
				margin-top: 60rpx;
				height: 276rpx;
				image{
					width: 276rpx;
					height: 276rpx;
				}
			}
		}
	}

</style>