<template>
	<view class="agreement-rules">	
		<view class="list">
			<view class='item acea-row row-between-wrapper' v-for="(item,index) in listDta" @click="goMultiple(item.key)">
				<view>{{item.label}}</view>
				<text class='iconfont icon-you'></text>
			</view>
		</view>
	</view>
</template>

<script>

	import {cacheLst} from '@/api/user.js';
  import spread from "../../../libs/spread";
  import { mapGetters } from "vuex";
	export default{
		name:'agreement-rules',
		data(){
			return{
				listDta:''
			}
		},
    computed: mapGetters(['isLogin','uid']),
		onLoad: function(options) {
			this.getInfo()
      // 关系处理
      if(options.spread) spread(options.spread, this.isLogin)
		},
		methods:{
			getInfo(){
				cacheLst().then(res=>{
					this.listDta = res.data
				})
			}, 
			goMultiple(e){
				uni.navigateTo({
					url: '/pages/users/user_about/index?from='+e
				})
			}
		},
    // #ifdef MP
    // 分享给好友
    onShareAppMessage () {
      let pages = getCurrentPages();
      let page = pages[pages.length - 1]
      let shareData = {
        title: '协议规则',
        path: page.$page.fullPath || '/' + page.route,
      };
      // 判断：用户是否登录  已经登录则添加分享人信息，未登录则正常分享
      if (this.isLogin) shareData.path = shareData.path + '?spread=' + this.uid;
      // 返回最终的分享配置信息
      return shareData
    },
    // 分享到朋友圈
    onShareTimeline() {
      let shareData = {
        title: '协议规则',
        query: {},
      };
      // 判断：用户是否登录  已经登录则添加分享人信息，未登录则正常分享
      if (this.isLogin) shareData.query.spread = this.uid;
      // 返回最终的分享配置信息
      return shareData
    },
    // #endif
	} 
</script>

<style scoped lang="scss">
	.agreement-rules {
		.list {
			background-color: #fff;

			.item {
				padding: 30rpx 30rpx 30rpx 0;
				border-bottom: 1px solid #f2f2f2;
				margin-left: 30rpx;
				font-size: 32rpx;
				color: #242424;

				.iconfont {
					font-size: 30rpx;
					color: #8A8A8A;
				}
			}
		}
	}
</style>
