mycenter.vue 5.94 KB
<template>
	<view class="box">
		<view class="topBg">
			<view class="userInfoBox">
				<view class="nameBox">
					{{ user.nickName }}
					<text>{{user.userNo}}</text>
				</view>
				<view class="company">
					<text>{{user.deptName}}  {{user.postName}}</text>
					{{user.companyName}}
				</view>
			</view>
		</view>
		<view class="rMainBox">
			<uni-list :border="false" class="myList">
				<uni-list-item :border="false" title="我的培训" showArrow clickable="true" @click="goTrain">
					<template v-slot:header>
						<view class="slot-box">
							<image class="slot-image" src="/static/user_icon03.png" mode="widthFix"></image>
						</view>
					</template>
				</uni-list-item>
	<!-- 			<uni-list-item :border="false" title="我的订单" showArrow clickable="true" @click="goBills">
					<template v-slot:header>
						<view class="slot-box">
							<image class="slot-image" src="/static/user_icon02.png" mode="widthFix"></image>
						</view>
					</template>
				</uni-list-item> -->
				<uni-list-item :border="false" title="我的发票" showArrow  clickable="true" @click="goMyInvoiceBill">
					<template v-slot:header>
						<view class="slot-box">
							<image class="slot-image" src="/static/user_icon04.png" mode="widthFix"></image>
						</view>
					</template>
				</uni-list-item>
			</uni-list>
		</view>
		
		<view class="paddingline">
			<button class="btn btn1" @click="changeUser">切换账号</button>
		</view>
	</view>
</template>

<script setup>
import * as api from '@/common/api.js';
import * as match from '@/common/match.js';
	import {
		showLogin,
		h5Login
	} from '@/common/login.js';
import { ref } from 'vue';
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
const vTypeImg = ref('/static/v1.png');
const card = ref({});
const reportData = ref({});
const user = ref({});
const userImg = ref('');
const avatarUrl = ref('');
const captchaPhonenumber = ref('');
const captcha = ref('');
const inputDialog = ref(null);
const start = ref(false);
const canSend = ref(true);
const app = getApp();
const isMaster = ref(false);

onShow(() => {
	if (app.globalData.isLogin) {
		init();
	} else {
		app.firstLoadCallback = () => {
			init();
		};
	}
});
function init() {
	api.checkReport().then((res)=>{
		user.value = res.data
	})
}

function goBack() {
	uni.navigateBack({});
}

function goBills() {
	let path = '/pages_hotel/hotel/myBills';
	uni.navigateTo({
		url: path
	});
}

function goTrain() {
	let path = '/pages_hotel/hotel/myTrain';
	uni.navigateTo({
		url: path
	});
}

function goMyInvoiceBill() {
	let path = '/pages_hotel/hotel/myInvoice';
	uni.navigateTo({
		url: path
	});
}
function goAboutUs(){
	let path = '/pages_hotel/hotel/aboutUs';
	uni.navigateTo({
		url: path
	});
}
function building() {
	uni.showToast({
		title: '暂未开放,敬请期待。',
		icon: 'none',
		duration: 2000
	});
}
function changeUser(){
	// 切换账号
	// showLogin(() => {
	// 	init()
	// })
	// uni.clearStorageSync()
	let path = '/pages/index/index?relogo==1';
	uni.navigateTo({
		url: path
	});
}
</script>

<style scoped lang="scss">
.box {
	width: 100vw;
	overflow: hidden;
}
.rMainBox {
	box-sizing: border-box;
	padding: 20rpx 25rpx 0;
	margin: 25rpx;
}
.userInfoBox {
text-align: center;padding: 0 0 60rpx;
}
.nameBox {
	padding: 80rpx 0 0;
	font-size: 36rpx;
	text{font-size: 26rpx;display: block;color: #999;margin: 20rpx 0 0;}
}
.company{color: #666;font-size: 24rpx;
text{display: block;font-size: 28rpx;margin: 20rpx 0 10rpx;}
}
.nameBox view {
	color: #7b7f83;
	font-size: 26rpx;
	margin-top: 10rpx;
}
.goback {
	position: absolute;
	color: #fff;
	top: 100rpx;
	left: 35rpx;
}
.forAdmin {
	padding: 25rpx;
	box-sizing: border-box;
}
.topBg {
	background:url('/static/bg.png') no-repeat center;background-size: cover;
}
.onlyCardBottom {
	position: relative;
	width: 660rpx;
	margin: auto;
	height: 90rpx;
	.bbg {
		height: 90rpx;
		width: 660rpx;
	}
	.cardBottom {
		width: 660rpx;
		background: transparent;
		height: 90rpx;
		text {
			font-size: 28rpx;
			color: #925921;
		}
		.renewBtn {
			background: #874f02;
			color: #fff;
		}
	}
}
.headImg {
	border-radius: 50%;
	position: relative;
	top: 50rpx;
	overflow: hidden;
	width: 100rpx;
	height: 100rpx;
	border: 4px solid #ffffff;
	background: #c4f9cb;
	left: 40rpx;
	button {
		display: block;
		padding: 0;
	}
	image {
		width: 100rpx;
		height: 100rpx;
		display: block;
	}
}

.slot-image {
	width: 50rpx;
	position: relative;
	top: -8rpx;
	height: 50rpx;
	margin-right: 30rpx;
}

.myList {
}
.funcBar {
	display: flex;
	background: #fff;
	width: 700rpx;
	height: 140rpx;
	justify-content: space-around;
}
.funcBar view {
	display: flex;
	align-items: center;
	font-size: 36rpx;
}
.funcBar image {
	width: 80rpx;
	height: 80rpx;
}
.topbgimg {
	width: 100vw;
	position: absolute;
	z-index: -1;
}
.reportItembox {
	overflow: hidden;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
}
.reportItem {
	background: #fff;
	border-radius: 15rpx;
	width: 340rpx;
	margin-top: 25rpx;
	.t {
		border-bottom: 1px solid #e5e5e5;
		height: 70rpx;
		line-height: 70rpx;
		color: #2b3133;
		font-size: 30rpx;
		padding-left: 36rpx;
	}
	.rbody {
		display: flex;
		padding: 36rpx;
		box-sizing: border-box;
		view {
			font-size: 26rpx;
			color: #888;
			width: 40%;
		}
		text {
			color: #00c176;
			font-weight: bold;
			font-size: 36rpx;
			display: block;
			margin-bottom: 20rpx;
		}
	}
}
.changephonepop {
	width: 100%;
}
.changephonepop view {
	width: 100%;
	margin: 0 0 30rpx;
}
.changephonepop view input {
	width: 100%;
	background: #f4f4f4;
	font-size: 30rpx;
	height: 80rpx;
	padding: 0 15rpx;
	box-sizing: border-box;
	line-height: 80rpx;
}
.changephonepop view.ffff {
	display: flex;
}
.changephonepop view button {
	font-size: 24rpx;
	margin-left: 10rpx;
	white-space: nowrap;
	width: 260rpx;
	line-height: 80rpx;
	background: linear-gradient(90deg, #00c176, #3ed89b);
	color: #fff;
	padding: 0;
	border: none;
}
.paddingline{padding: 20rpx;position: fixed;bottom:80rpx;width: 100%;
	button{margin:auto;}
}
</style>