0225263 4 月之前
父節點
當前提交
e2e03ea8c9
共有 4 個文件被更改,包括 18 次插入6 次删除
  1. 4 4
      src/app/creator/creator.page.html
  2. 1 0
      src/app/creator/creator.page.scss
  3. 13 2
      src/app/creator/creator.page.ts
  4. 二進制
      src/assets/img/paint.png

+ 4 - 4
src/app/creator/creator.page.html

@@ -17,18 +17,18 @@
 
 
 <ion-content>
-  <div class="creator-info">
+  <div class="creator-info" style="background-image: url('../assets/img/paint.png');">
     <div class="profile">
       <ion-avatar>
-        <img src="avatar.jpg"> <!-- 头像图片 -->
+        <img src="https://ionicframework.com/docs/img/demos/avatar.svg"> <!-- 头像图片 -->
       </ion-avatar>
-      <ion-label class="nickname">0105</ion-label> <!-- 昵称 -->
+      <ion-label class="nickname">{{user?.get("username")}}</ion-label> <!-- 昵称 -->
     </div>
     <div class="stats">
       <ion-label class="label-icon"><ion-icon name="thumbs-up-outline"></ion-icon> 点赞数:300</ion-label>
       <ion-label class="label-icon"><ion-icon name="eye-outline"></ion-icon> 浏览量:6000</ion-label>
       <ion-label class="label-icon"><ion-icon name="star-outline"></ion-icon> 最佳作品点赞数:150</ion-label>
-      <ion-label class="label-icon"><ion-icon name="cash-outline"></ion-icon> 收入:2000元</ion-label>
+      <ion-label class="label-icon"><ion-icon name="cash-outline"></ion-icon> 上月收入:2000元</ion-label>
     </div>
 </div>
 

+ 1 - 0
src/app/creator/creator.page.scss

@@ -4,6 +4,7 @@
   background-position: center;
   padding: 20px;
   border-radius: 10px;
+  
 }
 
 .profile {

+ 13 - 2
src/app/creator/creator.page.ts

@@ -1,4 +1,5 @@
 import { Component, OnInit } from '@angular/core';
+import Parse from "parse";
 
 @Component({
   selector: 'app-creator',
@@ -9,10 +10,20 @@ export class CreatorPage implements OnInit {
 
   goToCommunity(){
     
+  }
+  // 由于Parse.User.current()是随着localStorage变化的属性
+  // 为了避免首次复制后用户状态变化,页面不同步,通过get方法实现实时获取
+  user:Parse.User|undefined
+  async ngOnInit() {
+    // this.showContent(this.selectedContent);
+    this.user = await Parse.User.current()
+      setInterval(async ()=>{
+      this.user = await Parse.User.current()
+    },1000)
   }
   constructor() { }
 
-  ngOnInit() {
-  }
+  // ngOnInit() {
+  // }
 
 }

二進制
src/assets/img/paint.png