<template>
	<view class="container">
		<navBar title="GIGESI 吉格斯" :back="false" color="black"
			background="linear-gradient(to bottom, #FBDFAE, #f5f3ea)" />
		<view class="content">
			<view class="top">
				<view class="userInfo">
					<view class="left">
						<navigator url="/pages/my/userInfo/index">
							<!-- <button class="avatarBox" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> -->
							<button class="avatarBox">
								<!-- <image class="avatar" :src="avatarUrl"></image> -->
								<image class="avatar" src="/static/index/img1.png"></image>
								<!-- <image class="avatar" src="/static/index/img1.png"></image> -->
							</button>
						</navigator>
						<text class="btn">请点击登录</text>
					</view>
					<navigator url="/pages/my/set/index">
						<image src="/static/my/set.png" mode="" style="width: 37rpx;height: 41rpx;margin-right: 22rpx;">
						</image>
					</navigator>
				</view>

				<view class="invite" @click="show=true">
					<view class="left">
						<image src="/static/my/vip.png" mode="" style="width: 27rpx;height: 30rpx;">
						</image>
						<text>邀约VIP</text>
					</view>

					<view class="right">
						<text class="price">VIP享专属价格</text>
						<text class="ar">></text>
						<!-- <image src="/static/my/set.png" mode="" style="width: 12rpx;height: 20rpx;"></image> -->


					</view>
					<!-- <image src="/static/index/img1.png" mode=""
						style="width: 136rpx;height: 80rpx;position: absolute;z-index: 0;right: 0;right: 32rpx;border-radius: 0rpx 24rpx 8rpx 0rpx;">
					</image> -->


				</view>
			</view>

			<view class="serList">
				<navigator :url="item.url" v-for="(item,index) in serList">
					<view class="item">
						<view class="left">
							<image :src="item.icon" mode="" style="height: 31rpx;width: 35rpx;"></image>
							<text>{{item.name}}</text>
						</view>
						<view class="right">
							<text class="num" v-if="item.phone">{{item.phone}}</text>
							<image src="/static/my/arr_r.png" mode="" style="height: 24rpx;width: 14rpx;"></image>
						</view>
					</view>
				</navigator>
			</view>
		</view>

		<u-action-sheet :actions="list" :title="title" :show="show" cancelText="取消" @close="show=false"
			@select="handleSel"></u-action-sheet>
	</view>
</template>

<script>
	// import navBar from '@/components/navBar/index.vue'
	import uploadUrl from '@/common/config.js'
	export default {
		// components: {
		// 	navBar
		// },
		data() {
			return {
				serList: [{
						icon: require('@/static/my/mset.png'),
						name: '设置',
						url: '/pages/my/set/index'
					},
					{
						icon: require('@/static/my/sh.png'),
						name: '售后',
						url: '/pages/my/sellAfter/index'
					},
					{
						icon: require('@/static/my/hd.png'),
						name: '活动商品',
						url: '/pages/my/actGoods/index'
					},
					{
						icon: require('@/static/my/sc.png'),
						name: '收藏'
					},
					{
						icon: require('@/static/my/qt.png'),
						name: '其他信息',
						// url: '/pages/my/useLead/index'
						url: '/pages/my/otherInfo/index'
					},

					{
						icon: require('@/static/my/hd.png'),
						name: '一键联系',
						phone: '12983098478'
					},
					{
						icon: require('@/static/my/sc.png'),
						name: '兑奖信息',
						url: '/pages/my/chapinShip/index'
					},
					{
						icon: require('@/static/my/qt.png'),
						name: '小程序使用指南',
						url: '/pages/my/useLead/index'
					},
				],

				showPrivacy: true,

				avatarUrl: '',
				nickName: '',
				PhoneCode: '',
				imgUrl: '',
				isPhone: false,

				user_img: '', //微信头像
				user_name: '',

				show: false,
				list: [{
						name: '邀约Vip会员'
					},
					{
						name: '邀约LS会员'
					},
					{
						name: '邀约产业电工'
					}
				],
			}
		},
		onLoad() {
			wx.onNeedPrivacyAuthorization((resolve, eventInfo) => {
				console.log('触发本次事件的接口是：' + eventInfo.referrer)
				// 需要用户同意隐私授权时
				// 弹出开发者自定义的隐私授权弹窗
				this.showPrivacy = true

				this.resolvePrivacyAuthorization = resolve
			})

			// wx.getUserProfile({
			// 	success: console.log,
			// 	fail: console.error
			// })
		},
		methods: {
			handleSel(e) {
				console.log('sheet选择参数：', e);
				let type = -1

				if (e.name == '邀约Vip会员') {
					type = 'vip'
				} else if (e.name == '邀约LS会员') {
					type = 'ls'
				} else if (e.name == '邀约产业电工') {
					type = 'dg'
				}
				uni.navigateTo({
					url: '/pages/my/inviteDetail/index?type=' + type
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "./index.scss";
</style>