<!-- 我的-服务中心 -->
<template>
	<!-- 竖向菜单 -->
	<view style="margin-bottom: 50upx;margin-top: 0upx;" class="main_width my_bg_box">
		<view style="width: 92%;margin-left: 4%;overflow: hidden;">
			<view @click="menu_click(item.key)" class="menu_item" :key="item.key" v-for="(item, index) in menu">
				<view style="display: flex;align-items: center;">
					<view style="color: #666666;">{{item.name}}</view>
				</view>
				<view style="color: #666666;font-size: 26upx;">{{item.con||''}} ></view>
			</view>
		</view>
	</view>
</template>

<script>
	import commonData from '../../../commonData.js'
	import commonFun from '../../../commonFun.js'

	export default {
		data() {
			return {
				picurls: '',
				sys_role: commonData.sys_role, //角色
				menu: [{
						key: 'guide',
						name: '新手指南',
					},
					{
						key: 'opinion',
						name: '意见反馈',
					},
					{
						key: 'message',
						name: '联系客服',
						con: '4006788729',
					},
					{
						key: '../../login/web?index=6',
						name: '用户协议',
					},
					{
						key: '../../login/web?index=7',
						name: '隐私政策',
					},
				],
			}
		},
		methods: {
			// 查看小优保险
			check_ins() {
				uni.previewImage({
					urls: [this.picurls],
					current: 0,
				});
			},
			get_ins(bizId) {
				commonFun.requestUrl('&WsAjaxBiz=Public&WsAjaxAction=entityDataHandle', {
					bizCatalog: 'AgreementEntity',
					handleMode: 'fetch',
					bizId,
				}, res => {
					if (res.status) {
						this.picurls = commonFun.serverUrlReq + res.data.Result.picurls
						console.log('获取操指南')
						console.log(this.picurls)
					}
					uni.hideLoading()
				})
			},
			menu_click(e) {
				console.log(e)
				if (e == 'message') {
					uni.makePhoneCall({
						phoneNumber: '4006788729'
					});
				} else if (e == 'guide') {
					uni.navigateTo({
						url: '/pages/login/web?index=' + (this.sys_role == 0 ? 10 : 11)
					})
				} else {
					uni.navigateTo({
						url: './' + e
					})
				}
			},
		},
		components: {},
		onLoad() {
			this.get_ins(this.sys_role == 0 ? 9 : 10)
		},
	}
</script>

<style>
	.menu_item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		height: 50upx;
		border-bottom: 2upx solid #E5E5E5;
		height: 110upx;
	}
</style>
