<template>
|
<view class="user-index" :data-theme='theme()' :class="theme() || ''">
|
<view class="user-header">
|
<!-- #ifdef MP-WEIXIN || APP-PLUS -->
|
<view class="ww100" :style="'height:'+topBarTop()+'px;'"></view>
|
<view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'">
|
<view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view>
|
<view class="fb">会员码</view>
|
</view>
|
<!-- #endif -->
|
|
<view v-if="!loadding">
|
<view class="qrcode-body bg-white p30">
|
<view class="user-box pt20">
|
<view class="user-info">
|
<view class="photo">
|
<image :src="detail.avatarUrl" mode="aspectFill"></image>
|
</view>
|
<view class="info">
|
<view class="name">{{ detail.nickName }}</view>
|
</view>
|
</view>
|
</view>
|
<view class="qrcode-box mt30 pb100">
|
<view class="codeimg pt30 d-c-c">
|
<image :src="codeImg" mode="aspectFit"></image>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<request-loading :loadding='isloadding'></request-loading>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
isloadding: true,
|
/*签到数据*/
|
sign: {},
|
/*是否加载完成*/
|
loadding: true,
|
detail: {},
|
codeImg: ''
|
};
|
},
|
onPullDownRefresh() {
|
|
},
|
onShow() {
|
/*获取数据*/
|
this.getData();
|
},
|
onLoad(){
|
let self = this;
|
//#ifdef MP-WEIXIN
|
wx.login({
|
success(res) {
|
// 发送用户信息
|
self._post('user.user/getSession', {
|
code: res.code
|
}, result => {
|
self.sessionKey = result.data.session_key;
|
});
|
}
|
});
|
//#endif
|
},
|
methods: {
|
/*获取数据*/
|
getData() {
|
let self = this;
|
self.isloadding = true;
|
self._get('user.Qrcode/qrcode', {
|
source: self.getPlatform()
|
}, function(res) {
|
self.detail = res.data.userInfo;
|
self.codeImg = res.data.qrcode;
|
self.loadding = false;
|
uni.stopPullDownRefresh();
|
self.isloadding = false;
|
});
|
},
|
goback() {
|
uni.navigateBack();
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
page {
|
background-color: #EBEBEB;
|
height: 100%;
|
}
|
|
.iconfont {
|
font-size: 14px;
|
}
|
|
.reg180 {
|
padding-right: 20rpx;
|
text-align: right;
|
transform: rotateY(180deg);
|
position: absolute;
|
bottom: 0;
|
}
|
|
.head_top .icon-jiantou {
|
color: #FFFFFF;
|
font-size: 30rpx;
|
}
|
|
.head_top {
|
width: 100%;
|
position: relative;
|
/* padding-top: var(--status-bar-height); */
|
height: 30px;
|
line-height: 30px;
|
color: #FFFFFF;
|
font-size: 36rpx;
|
}
|
|
.user-index {
|
height: 100%;
|
}
|
|
.w100 {
|
width: 100%;
|
}
|
|
.user-header {
|
position: relative;
|
height: 100%;
|
@include background_color('background_color');
|
}
|
|
.user-header .user-info {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.user-header .photo,
|
.user-header .photo image {
|
width: 50rpx;
|
height: 50rpx;
|
border-radius: 50%;
|
}
|
|
.user-header .photo {
|
border: 2rpx solid #ffffff;
|
}
|
|
.user-header .info {
|
padding-left: 20rpx;
|
box-sizing: border-box;
|
overflow: hidden;
|
}
|
|
.user-header .info .name {
|
font-size: 26rpx;
|
}
|
|
.qrcode-body {
|
margin: 80rpx 30rpx 30rpx;
|
border-radius: 20rpx;
|
}
|
.qrcode-box .codeimg image {
|
width: 400rpx;
|
height: 400rpx;
|
}
|
|
|
|
</style>
|