You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

291 lines
6.4 KiB

4 years ago
<template>
<view>
<view class="mine-top">
4 years ago
<image :src="topimg" class="mine-top-img"></image>
4 years ago
</view>
<view class="mine-box">
<view class="mine-box-user">
<view class="user_avator">
2 years ago
<u-avatar :src="info.headimgurl?info.headimgurl:headReplace" size="61"></u-avatar>
4 years ago
</view>
<view class="user_info">
<view class="user_name">
4 years ago
{{info.nickname||"暂未授权"}}
4 years ago
</view>
<view class="user_phone">
4 years ago
{{info.mobile||"暂未设置"}}
2 years ago
</view>
<view class="user_phone">
欢迎来到苏州革命博物馆~
4 years ago
</view>
</view>
</view>
<view class="mine-box-nav">
<view class="mine-box-navtitle">
3 years ago
预约记录
4 years ago
</view>
<view class="mine-box-navlist">
<view class="mine-box-navitem" @click="toPage(1)">
2 years ago
<image src="../../static/img/index_icon_1.png" class="mine-box-navitemimg"
></image>
4 years ago
<text class="mine-box-navitemtxt">参观预约</text>
</view>
<view class="mine-box-navitem" @click="toPage(2)">
2 years ago
<image src="../../static/img/index_icon_2.png" class="mine-box-navitemimg"
></image>
4 years ago
<text class="mine-box-navitemtxt">活动预约</text>
</view>
<view class="mine-box-navitem" @click="toPage(3)">
2 years ago
<image src="../../static/img/index_icon_3.png"
4 years ago
class="mine-box-navitemimg"></image>
<text class="mine-box-navitemtxt">停车场预约</text>
</view>
</view>
</view>
2 years ago
<!-- <view class="mine-box-list">
4 years ago
<view class="list-item" style="position: relative;">
4 years ago
<button open-type="feedback" class="hideBtn"
style="width: 100%;height: 100%;top:0rpx;left: 0rpx;"></button>
4 years ago
<view class="list-item-left">
<text class="iconfont icon-yijianfankui"></text>
<text class="list-item-lefttxt">意见反馈</text>
</view>
<view class="list-item-right">
<u-icon name="arrow-right" color="#ccc"></u-icon>
</view>
</view>
4 years ago
<view class="list-item" @click="toPage(4)">
4 years ago
<view class="list-item-left">
<text class="iconfont icon-fenxiang"></text>
<text class="list-item-lefttxt">推荐预约管理系统</text>
</view>
<view class="list-item-right">
<u-icon name="arrow-right" color="#ccc"></u-icon>
</view>
</view>
2 years ago
</view> -->
4 years ago
</view>
4 years ago
<u-popup :show="showAuthorization" mode="bottom" @close="closeInfo" :round="10">
<view class="box">
<view class="box-title" style="text-align: center;padding: 20rpx 0;font-size: 32rpx;">
请授权您的微信头像和昵称
</view>
<view class="box-content" style="padding: 20px;">
<u-button type="primary" @click="getUserProfile"></u-button>
</view>
</view>
2 years ago
</u-popup>
<tabbar :current-page="4"></tabbar>
4 years ago
</view>
</template>
<script>
2 years ago
import tabbar from "../../components/tabbar/tabbar.vue"
export default {
components:{
tabbar
},
4 years ago
data() {
return {
2 years ago
topimg: require('@/static/img/top_bg.png'),
headReplace:require('@/static/img/headreplace.png'),
4 years ago
info: {},
showAuthorization: false
4 years ago
}
4 years ago
},
onReady() {
},
4 years ago
onShow() {
4 years ago
4 years ago
var that = this;
this.loadInfo(function(res) {
if (that.util.isNull(res.headimgurl) || that.util.isNull(res.nickname)) {
that.showAuthorization = true;
} else {
that.showAuthorization = false;
}
});
4 years ago
},
methods: {
4 years ago
closeInfo() {
that.showAuthorization = false;
},
4 years ago
loadInfo(cb) {
var that = this;
this.util.getOpenidInfo(function(res) {
that.util.getUserInfo(function(r) {
that.info = r;
cb(r);
}, true)
4 years ago
}, true);
},
getUserProfile() {
var that = this;
this.util.getUserProfile((res) => {
console.log(res)
that.util.request({
api: '/api/mobile/user/save',
method: 'POST',
data: {
headimgurl: res.avatarUrl,
nickname: res.nickName
},
utilSuccess: function(r) {
that.loadInfo(function() {
that.showAuthorization = false;
})
}
})
})
},
4 years ago
toPage(type) {
var url = "";
switch (type) {
case 1:
url = "../order/visitorder"
break;
4 years ago
case 2:
url = "../order/activityorder"
break;
case 3:
url = "../order/parkorder"
break;
case 4:
url = "recommend"
break;
4 years ago
}
uni.navigateTo({
url: url
})
}
}
}
</script>
<style>
.uni-navbar--border {
border-bottom-width: 0 !important;
}
page {
2 years ago
background: #fbf3ea;
height:100vh;
4 years ago
}
.mine-box-user {
margin-bottom: 65rpx;
}
.mine-top-img {
2 years ago
width: 100%;
height:448rpx;
4 years ago
}
.mine-box {
width: 100%;
position: relative;
z-index: 1024;
2 years ago
box-sizing: border-box;
margin-top: -260rpx;
/* margin-top: -288rpx; */
/* height: calc(100vh); */
4 years ago
}
.mine-box-user {
display: flex;
align-items: center;
2 years ago
padding-left: 63rpx;
4 years ago
}
.user_info {
margin-left: 33rpx;
}
.user_name {
font-size: 32rpx;
font-family: PingFang SC;
2 years ago
color: #fff;
4 years ago
}
.user_phone {
font-size: 24rpx;
2 years ago
color: #fff;
4 years ago
line-height: 40rpx;
}
.mine-box-nav {
2 years ago
margin: 39rpx;
box-sizing: border-box;
background: #FBF3EA;
margin-top: -10rpx;
border-radius:20rpx 20rpx 0 0;
4 years ago
}
.mine-box-navtitle {
font-size: 32rpx;
font-family: PingFang SC;
2 years ago
/* color: #4E4E4E; */
padding:30rpx;
4 years ago
}
.hideBtn {
width: 170rpx;
height: 170rpx;
opacity: 0;
border-radius: 50%;
position: absolute;
top: 30rpx;
4 years ago
left: 30rpx;
4 years ago
z-index: 9999;
}
.mine-box-navlist {
display: flex;
justify-content: space-around;
margin-top: 40rpx;
}
.mine-box-navitem {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
align-items: center;
}
.mine-box-navitemtxt {
font-size: 24rpx;
font-family: PingFang SC;
2 years ago
/* color: #4E4E4E; */
4 years ago
margin-top: 30rpx;
}
.mine-box-list {
display: flex;
margin-top: 27rpx;
font-size: 32rpx;
2 years ago
/* color: #4E4E4E; */
4 years ago
flex-direction: column;
}
2 years ago
.mine-box-navitemimg{
width:125rpx;
height:125rpx;
}
4 years ago
.list-item {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-top: 32rpx;
padding-bottom: 32rpx;
border-bottom: 2rpx solid #F7F6F4;
}
.list-item-lefttxt {
margin-left: 41rpx;
}
4 years ago
</style>