<template>
    <view class="main-block">
        <view class="page-block">
            <view class="btn-list">
		           <block v-for="(item,index) in power_list" :key='index'>
						<navigator v-if="item.id!=960" class="item flex flex-col flex-center" :url="item.address">
							<image :src="item.image" class="icon-img" mode="aspectFit"></image>
							<view class="name">{{item.name}}</view>
						</navigator>
						<view v-if="item.id==960" @click="navToZhida(item.list)" class="item flex flex-col flex-center">
							<image src="../static/images/sszdgl.png" class="icon-img" mode="aspectFit"></image>
							<view class="name">搜索直达管理</view>
						</view>
					</block>	

  <!--              <navigator url="./ShopCoupon" class="item flex flex-col flex-center">
                    <image src="../static/images/sjyhq.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">商家优惠劵</view>
                </navigator>

                <navigator url="./couponLog" class="item flex flex-col flex-center">
                    <image src="../static/images/yhqjl.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">优惠劵记录</view>
                </navigator> -->
				
                <!-- <navigator url="./cashCoupon" class="item flex flex-col flex-center">
                    <image src="../static/images/icon_8.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">现金抵扣券</view>
                </navigator>
                <navigator url="./couponList" class="item flex flex-col flex-center">
                    <image src="../static/images/icon_8.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">抵扣券列表</view>
                </navigator> -->
				
              <!-- <navigator url="./huodongCouponList" class="item flex flex-col flex-center">
                    <image src="../static/images/sjhdq.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">商家活动券</view>
                </navigator>
                <navigator url="./serviceForm" class="item flex flex-col flex-center">
                    <image src="../static/images/fwtb.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">服务提报</view>
                </navigator>
                <navigator url="./imgForm" class="item flex flex-col flex-center">
                    <image src="../static/images/sctb.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">素材提报</view>
                </navigator>
				
                <navigator url="./searchForm" class="item flex flex-col flex-center">
                    <image src="../static/images/gjcss.png" class="icon-img" mode="aspectFit"></image>
                    <view class="name">关键词搜索</view>
                </navigator> -->
				
            </view>
        </view>
    </view>
</template>

<script>
    export default {
		
        methods:{
            navToZhida(list){
				let urls=[],itemList=[];
				for(let i of list){
					urls.push(i.address)
					itemList.push(i.name)
				}
    //             let urls = list
				//  ['./searchOperation','./searchList','./aliPlan']:['授权管理','搜索直达','投放计划']
                uni.showActionSheet({
                    itemList:itemList,
                    success: (r) => {
                        uni.navigateTo({
                            url:urls[r.tapIndex]
                        })
                    }
                })
            },
        },	
		data() {
			return {
				power_list:[],
			}
		},
		onLoad(e) {
			this.sid=e.id;
			let { list } = this.$store.state.management_list_store.find((v, i) => v.id == e.id)

			this.power_list = list
			
		},
    }
</script>

<style>
    .main-block {
        padding: 50rpx 25rpx 0;
    }

    .btn-list {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -webkit-flex-flow: row wrap;
        flex-flow: row wrap;
        -webkit-box-pack: start;
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
        -webkit-align-content: flex-start;
        align-content: flex-start;
    }

    .page-block {
        width: 700rpx;
        background-color: #fff;
        box-sizing: border-box;
        border-radius: 8rpx;
        margin-bottom: 30rpx;

    }

    .btn-list .item {
        width: 33.33%;
        height: 145rpx;
    }

    .btn-list .item .icon-img {
        display: block;
        width: 48rpx;
        height: 48rpx;
    }

    .btn-list .item .name {
        font-size: 24rpx;
        line-height: 33rpx;
        margin-top: 16rpx;
        color: #666;
    }
</style>
