|
|
@@ -1,216 +1,250 @@
|
|
|
<template>
|
|
|
- <view>
|
|
|
- <view class="subject">
|
|
|
- <view style="width: 100%;background-color: #FFFFFF;position: relative;">
|
|
|
- <view class="personal">
|
|
|
- <view class="personal_left">
|
|
|
- <image :src="userinfos.image" mode="" @error="error"></image>
|
|
|
- </view>
|
|
|
- <view class="personal_center">
|
|
|
- <p>{{usernames}}</p>
|
|
|
- <p>{{userinfos.email || userinfos.mobile}}</p>
|
|
|
- </view>
|
|
|
- <view class="personal_right" @click="userinfo">
|
|
|
- <uni-icons type="compose" style="margin-right: 10rpx;" color="#FFFFFF"></uni-icons>
|
|
|
- 编辑
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view style="background-color: #FFFFFF;margin: 20rpx auto 0;">
|
|
|
- <view class="AboutUs" @click="about">
|
|
|
- <u-icon name="pingtai" custom-prefix="custom-icon" class="icon_left"></u-icon>
|
|
|
- 关于我们
|
|
|
- <uni-icons type="arrowright" class="icon_right"></uni-icons>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view style="background-color: #FFFFFF;">
|
|
|
- <view class="quit" @click="outto">
|
|
|
- <u-icon name="tuichudenglu" custom-prefix="custom-icon" class="icon_left"></u-icon>
|
|
|
- 退出登录
|
|
|
- <uni-icons type="arrowright" class="icon_right"></uni-icons>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view>
|
|
|
+ <view class="subject">
|
|
|
+ <view style="width: 100%; background-color: #ffffff; position: relative">
|
|
|
+ <view class="personal" v-if="isLogin">
|
|
|
+ <view class="personal_left">
|
|
|
+ <image :src="userinfos.image" mode="" @error="error"></image>
|
|
|
+ </view>
|
|
|
+ <view class="personal_center">
|
|
|
+ <p>{{ usernames }}</p>
|
|
|
+ <p>{{ userinfos.email || userinfos.mobile }}</p>
|
|
|
+ </view>
|
|
|
+ <view class="personal_right" @click="userinfo">
|
|
|
+ <uni-icons
|
|
|
+ type="compose"
|
|
|
+ style="margin-right: 10rpx"
|
|
|
+ color="#FFFFFF"
|
|
|
+ ></uni-icons>
|
|
|
+ 编辑
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="background-color: #ffffff; margin: 20rpx auto 0">
|
|
|
+ <view class="AboutUs" @click="about">
|
|
|
+ <u-icon
|
|
|
+ name="pingtai"
|
|
|
+ custom-prefix="custom-icon"
|
|
|
+ class="icon_left"
|
|
|
+ ></u-icon>
|
|
|
+ 关于我们
|
|
|
+ <uni-icons type="arrowright" class="icon_right"></uni-icons>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="background-color: #ffffff" v-if="isLogin">
|
|
|
+ <view class="quit" @click="outto">
|
|
|
+ <u-icon
|
|
|
+ name="tuichudenglu"
|
|
|
+ custom-prefix="custom-icon"
|
|
|
+ class="icon_left"
|
|
|
+ ></u-icon>
|
|
|
+ 退出登录
|
|
|
+ <uni-icons type="arrowright" class="icon_right"></uni-icons>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="background-color: #ffffff" v-else>
|
|
|
+ <view class="quit" @click="handleLogin">
|
|
|
+ <u-icon
|
|
|
+ name="tuichudenglu"
|
|
|
+ custom-prefix="custom-icon"
|
|
|
+ class="icon_left"
|
|
|
+ ></u-icon>
|
|
|
+ 去登录
|
|
|
+ <uni-icons type="arrowright" class="icon_right"></uni-icons>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
<script>
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- usernames: '',
|
|
|
- userinfos: {
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ usernames: '',
|
|
|
+ userinfos: {},
|
|
|
+ isLogin: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //user.login.user_login_info
|
|
|
+ //home.homes.personal_center
|
|
|
+ async getUserlogin() {
|
|
|
+ const session_key = uni.getStorageSync('session_key');
|
|
|
+ this.isLogin = !!session_key;
|
|
|
+ if (!this.isLogin) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //user.login.user_login_info
|
|
|
- //home.homes.personal_center
|
|
|
- async getUserlogin() {
|
|
|
- const res = await this.$myRequest({
|
|
|
- url: '/api/api_gateway?method=user.login.user_login_info',
|
|
|
- })
|
|
|
- console.log(res.children)
|
|
|
- this.usernames = res.username
|
|
|
- this.getUsermsg(this.usernames)
|
|
|
- uni.setStorage({
|
|
|
- key: 'jurisdiction',
|
|
|
- data: JSON.stringify(res.children)
|
|
|
- })
|
|
|
- },
|
|
|
- async getuserinfonew() {
|
|
|
- const res = await this.$myRequest({
|
|
|
- url: '/api/v2/theme/home/info/',
|
|
|
- })
|
|
|
- if(res.items && res.items.logo_url){
|
|
|
- this.userinfos.image = res.items.logo_url
|
|
|
- } else{
|
|
|
- this.userinfos.image = ''
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- async getUsermsg(user) {
|
|
|
- const res = await this.$myRequest({
|
|
|
- url: '/api/api_gateway?method=home.homes.personal_center',
|
|
|
- data: {
|
|
|
- username: user
|
|
|
- }
|
|
|
- })
|
|
|
- console.log(res)
|
|
|
- this.userinfos = res
|
|
|
- this.getuserinfonew()
|
|
|
- }, //user.login.logout_user
|
|
|
- async getlogout() {
|
|
|
- const res = await this.$myRequest({
|
|
|
- url: '/api/api_gateway?method=user.login.logout_user',
|
|
|
- })
|
|
|
- },
|
|
|
- about() {
|
|
|
- uni.navigateTo({
|
|
|
- url: "../about/about"
|
|
|
- })
|
|
|
- },
|
|
|
- error(e){
|
|
|
- this.userinfos.image = "../../../static/images/my/f856c0422304bdd24a008f4d75b76e3.png"
|
|
|
- },
|
|
|
- // feedback(){
|
|
|
- // uni.navigateTo({
|
|
|
- // url:"../feedback/feedback"
|
|
|
- // })
|
|
|
- // },
|
|
|
- userinfo() {
|
|
|
- uni.navigateTo({
|
|
|
- url: "../user-info/user-info?data=" + JSON.stringify(this.userinfos)
|
|
|
- })
|
|
|
- },
|
|
|
- outto() {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '是否退出登录',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- this.getlogout()
|
|
|
- uni.removeStorage({
|
|
|
- key:"session_key"
|
|
|
- })
|
|
|
- uni.reLaunch({
|
|
|
- url: "../../login/login"
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
- this.getUserlogin()
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- this.getUserlogin()
|
|
|
- this.$forceUpdate()
|
|
|
- }
|
|
|
- }
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=user.login.user_login_info',
|
|
|
+ });
|
|
|
+ console.log(res.children);
|
|
|
+ this.usernames = res.username;
|
|
|
+ this.getUsermsg(this.usernames);
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'jurisdiction',
|
|
|
+ data: JSON.stringify(res.children),
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async getuserinfonew() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/v2/theme/home/info/',
|
|
|
+ });
|
|
|
+ if (res.items && res.items.logo_url) {
|
|
|
+ this.userinfos.image = res.items.logo_url;
|
|
|
+ } else {
|
|
|
+ this.userinfos.image = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getUsermsg(user) {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=home.homes.personal_center',
|
|
|
+ data: {
|
|
|
+ username: user,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ console.log(res);
|
|
|
+ this.userinfos = res;
|
|
|
+ this.getuserinfonew();
|
|
|
+ }, //user.login.logout_user
|
|
|
+ async getlogout() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=user.login.logout_user',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleLogin() {
|
|
|
+ console.log('---------------------- login');
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/login',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ about() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '../about/about',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ error(e) {
|
|
|
+ this.userinfos.image =
|
|
|
+ '../../../static/images/my/f856c0422304bdd24a008f4d75b76e3.png';
|
|
|
+ },
|
|
|
+ // feedback(){
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url:"../feedback/feedback"
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ userinfo() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '../user-info/user-info?data=' + JSON.stringify(this.userinfos),
|
|
|
+ });
|
|
|
+ },
|
|
|
+ outto() {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否退出登录',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ this.getlogout();
|
|
|
+ uni.removeStorage({
|
|
|
+ key: 'session_key',
|
|
|
+ });
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '../../login/login',
|
|
|
+ });
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.getUserlogin();
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.getUserlogin();
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
- .subject {
|
|
|
- width: 100%;
|
|
|
- height: 100vh;
|
|
|
- background-color: #F9F9F9;
|
|
|
- }
|
|
|
+.subject {
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+ background-color: #f9f9f9;
|
|
|
+}
|
|
|
|
|
|
- .personal {
|
|
|
- width: 90%;
|
|
|
- margin: 0 auto;
|
|
|
- display: flex;
|
|
|
- padding: 20rpx 0 40rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- .personal_left {
|
|
|
- width: 18%;
|
|
|
- margin-right: 30rpx;
|
|
|
+.personal {
|
|
|
+ width: 90%;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: flex;
|
|
|
+ padding: 20rpx 0 40rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .personal_left {
|
|
|
+ width: 18%;
|
|
|
+ margin-right: 30rpx;
|
|
|
|
|
|
- image {
|
|
|
- width: 124rpx;
|
|
|
- height: 120rpx;
|
|
|
- border-radius: 60rpx;
|
|
|
- }
|
|
|
- }
|
|
|
+ image {
|
|
|
+ width: 124rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ border-radius: 60rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .personal_center {
|
|
|
- padding-top: 20rpx;
|
|
|
+ .personal_center {
|
|
|
+ padding-top: 20rpx;
|
|
|
|
|
|
- p:nth-child(1) {
|
|
|
- font-size: 34rpx;
|
|
|
- font-weight: 700;
|
|
|
- margin-bottom: 10rpx;
|
|
|
- }
|
|
|
+ p:nth-child(1) {
|
|
|
+ font-size: 34rpx;
|
|
|
+ font-weight: 700;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+ }
|
|
|
|
|
|
- p:nth-child(2) {
|
|
|
- font-size: 24rpx;
|
|
|
- }
|
|
|
- }
|
|
|
+ p:nth-child(2) {
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .personal_right {
|
|
|
- width: 150rpx;
|
|
|
- background-color: #55C87B;
|
|
|
- height: 60rpx;
|
|
|
- text-align: center;
|
|
|
- border-radius: 30rpx;
|
|
|
- line-height: 60rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- position: absolute;
|
|
|
- top: 50rpx;
|
|
|
- right: 30rpx;
|
|
|
- }
|
|
|
- }
|
|
|
+ .personal_right {
|
|
|
+ width: 150rpx;
|
|
|
+ background-color: #55c87b;
|
|
|
+ height: 60rpx;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 30rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ position: absolute;
|
|
|
+ top: 50rpx;
|
|
|
+ right: 30rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- .AboutUs,
|
|
|
- .quit,
|
|
|
- .opinion {
|
|
|
- width: 90%;
|
|
|
- height: 100rpx;
|
|
|
- line-height: 100rpx;
|
|
|
- margin: 20rpx auto 0;
|
|
|
- position: relative;
|
|
|
- padding-left: 20rpx;
|
|
|
- font-size: 28rpx;
|
|
|
+.AboutUs,
|
|
|
+.quit,
|
|
|
+.opinion {
|
|
|
+ width: 90%;
|
|
|
+ height: 100rpx;
|
|
|
+ line-height: 100rpx;
|
|
|
+ margin: 20rpx auto 0;
|
|
|
+ position: relative;
|
|
|
+ padding-left: 20rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
|
- .icon_left {
|
|
|
- margin-right: 20rpx;
|
|
|
- color: #55C87B !important;
|
|
|
- font-size: 32rpx;
|
|
|
- }
|
|
|
+ .icon_left {
|
|
|
+ margin-right: 20rpx;
|
|
|
+ color: #55c87b !important;
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
|
|
|
- .icon_right {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- right: 10rpx;
|
|
|
- font-size: 32rpx !important;
|
|
|
- }
|
|
|
- }
|
|
|
+ .icon_right {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 10rpx;
|
|
|
+ font-size: 32rpx !important;
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- .opinion {
|
|
|
- margin: 0 auto;
|
|
|
- border-top: 2rpx solid #EAEAEA;
|
|
|
- }
|
|
|
+.opinion {
|
|
|
+ margin: 0 auto;
|
|
|
+ border-top: 2rpx solid #eaeaea;
|
|
|
+}
|
|
|
</style>
|