用户中心接口,商品接口
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- <view class="user-demo">
|
||||
<view @click="$Router.push({name: 'Address'})">地址管理</view>
|
||||
<view @click="$Router.push({name: 'Order'})">订单管理</view>
|
||||
</view> -->
|
||||
<!-- 用户信息 -->
|
||||
<view class="info-box">
|
||||
<image src="@/static/user/user_back.png" mode="aspectFill"></image>
|
||||
<view class="user-flex">
|
||||
<image class="cover" src="@/static/dev/cover.jpg" mode="aspectFill"></image>
|
||||
<image class="cover" :src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill"></image>
|
||||
<view class="user-content">
|
||||
<block v-if="$store.state.token != ''">
|
||||
<view class="name">唐明明</view>
|
||||
<view class="name">{{userInfo.nickname}}</view>
|
||||
<view class="tabs">
|
||||
<view class="tabs-item"><image src="@/static/user/icon_07.png"></image>会员</view>
|
||||
</view>
|
||||
@@ -115,19 +111,32 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { info } from '@/apis/interfaces/user'
|
||||
import userAuth from '@/public/userAuth'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
cardText: ['老用户专属特权', '老用户专属健康会员']
|
||||
cardText: ['老用户专属特权', '老用户专属健康会员'],
|
||||
userInfo: {
|
||||
nickname: "",
|
||||
avatar : ""
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
uni.setNavigationBarTitle({
|
||||
title: "唐明明"
|
||||
})
|
||||
onShow() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods:{
|
||||
// 用户信息
|
||||
getInfo(){
|
||||
if(this.$store.state.token === '') return
|
||||
info().then(res => {
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.nickName
|
||||
})
|
||||
this.userInfo = res
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
Login(){
|
||||
const Auth = new userAuth()
|
||||
@@ -181,6 +190,7 @@
|
||||
line-height: 40rpx;
|
||||
font-weight: bold;
|
||||
font-size: $title-size + 8;
|
||||
@extend .nowrap;
|
||||
}
|
||||
.tabs{
|
||||
padding-top: 10rpx;
|
||||
|
||||
Reference in New Issue
Block a user