<template>
	<view class="u-page">
		<view class="se-pt-50 se-pb-120 se-px-40 se-bgc-orange se-c-white se-pos">
			<view class="se-flex">
				<image :src="headImage" class="se-br-p-50 se-bgc-f5 se-w-100 se-h-100" mode=""></image>
				<view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
					<view class="se-flex">
						<text class="se-fw-6 se-fs-30">{{nickName}}</text>
						<view class="se-flex se-flex-ai-c se-ml-20" @click="editInfo">
							<image class="se-a-25 se-mr-10" src="@/static/image/pencil.png" mode=""></image>
							<text class="se-fs-22">修改资料</text>
						</view>
					</view>
					<view class="se-fs-24 se-display-ib">
						<text>手机号:</text>
						<text class="se-ml-20">{{phone}}</text>
					</view>
				</view>
			</view>
			<view class="se-pos-cb se-flex se-flex-h-sb se-w-vw-82 se-br-10 se-bgc-white se-py-30 se-px-30"
				style="bottom: -80rpx;">
				<view class="se-flex se-flex-h-fs se-b-r se-flex-1">
					<view class="se-pos se-w-130">
						<image src="@/static/image/wall.png" class="se-w-120 se-h-120" mode=""></image>
						<view @click="onNavigateTo()"
							class="se-w-80 se-ta-c se-b-orange se-br-30 se-bgc-orange se-py-5 se-px-22 se-c-white se-fs-20 se-pos-cb">
							钱包
						</view>
					</view>
					<view class="se-flex se-flex-v-sa se-flex-ai-fs">
						<view class="se-flex se-fs-28 se-c-black">
							我的余额
						</view>
						<view class="se-fs-30 se-display-ib se-pt-20" style="color: #DC2828;">
							￥{{myMoney}}
						</view>
					</view>
				</view>
				<view class="se-flex se-flex-h-fe se-flex-1 se-pr-20">
					<image src="@/static/image/piao.png" class="se-w-120 se-h-120" mode=""></image>
					<view class="se-flex se-flex-v-sa se-flex-ai-fs ">
						<view class="se-flex se-fs-28 se-c-black">
							金额记录
						</view>
						<view class="se-fs-30 se-display-ib se-pt-20" @click="onRecord()">
							<view class="se-b-orange se-fs-22 se-c-orange se-br-30 se-py-5 se-px-20">
								去查看
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="se-px-40 se-py-30 se-mt-80">
			<u-swiper height="200rpx" style="background-color: #f5f5f5;height: 200rpx;" :indicator="true"
				:list="swiperList" keyName="image" @change="change" @click="click"></u-swiper>
			<!-- <u-swiper :height="100" :list="list" @click="swiperClick"></u-swiper> -->
			<!-- <image class="se-h-200 se-w-p-100" src="@/static/image/59.png" mode=""></image> -->
		</view>
		<view class="se-p-20 se-mx-40 se-mt-20 se-br-20 se-bgc-white">
			<view class="se-flex se-flex-ai-c se-pb-20">
				<view class="line-orange se-ml-10"></view>
				<view class="se-ml-10 se-fs-32 se-c-black se-fw-5">
					我的服务
				</view>
			</view>
			<view class="se-grid">
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onCustomerService()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-50" src="@/static/image/setting.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">联系客服</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onSystem()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-50" src="@/static/image/setting.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">系统设置</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onFeedback()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-50" src="@/static/image/setting.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">帮助与反馈</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onVersion()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-50" src="@/static/image/setting.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">关于本程序</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		userInfo,
		bannerList
	} from "@/common/api.js"
	export default {
		data() {
			return {
				swiperList: [],
				list: [
					'@/static/image/59.png'
				],
				id: "",
				headImage: "",
				myMoney: 0,
				nickName: "",
				phone: "",
				worker: {},
				boss: {},
				company: {},

			}
		},
		mounted() {

		},
		onShow() {
			this.onUserInfo()
			this.onBannerList()
		},
		methods: {
			// 编辑信息
			editInfo() {
				uni.navigateTo({
					url: "/pages/login/index"
				})
			},
			onBannerList() {
				bannerList({}).then(response => {
					console.info("banner", response)
					this.swiperList = response.result[1]
				}).catch(error => {

				})
			},
			onUserInfo() {
				let params = {}
				userInfo(params).then(response => {
					console.info("userInfo", response)
					this.id = response.result.id
					this.headImage = response.result.headImage
					this.myMoney = response.result.myMoney ? response.result.myMoney : 0
					this.nickName = response.result.nickName ? response.result.nickName : "微信昵称"
					this.phone = response.result.phone ? response.result.phone : ""
					this.worker = response.result.worker ? response.result.worker : ""
					this.boss = response.result.boss ? response.result.boss : ""
					this.company = response.result.company ? response.result.company : ""

				}).catch(error => {

				})
			},
			swiperClick(event) {
				console.info(event);
			},
			onNavigateTo() {
				uni.navigateTo({
					url: "/pages_subpack/wallet/index"
				})
			},
			onRecord() {
				uni.navigateTo({
					url: "/pages_subpack/record/index"
				})
			},
			onSystem() {
				uni.navigateTo({
					url: "/pages_subpack/system/index"
				})
			},
			onFeedback() {
				uni.navigateTo({
					url: "/pages_subpack/feedback/index"
				})
			},
			onVersion() {
				uni.navigateTo({
					url: "/pages_subpack/version/index"
				})
			},
			onCustomerService() {
				uni.showModal({
					title: '联系客服',
					content: '确定拨打客服电话？',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			}
		}
	}
</script>

<style>
	page {
		background-color: #f5f5f5 !important;
	}

	.se-grid {
		display: grid;
		grid-template-columns: 1fr 1fr 1fr 1fr;
		gap: 10rpx;
		padding-bottom: 4rpx;
	}
</style>