فهرست منبع

Merge branch 'master' of http://git.fmode.cn:3000/0225273/APPmy

0225236 4 ماه پیش
والد
کامیت
e1bfba20e4

+ 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() {
+  // }
 
 }

+ 16 - 4
src/app/tab1/tab1.page.html

@@ -391,10 +391,22 @@
               <img [src]="item.image">
             </ion-thumbnail>
             <ion-label>
-              <h2>{{item.title}}</h2>
-              <p style="color: red;">{{item.score}}分 {{item.price}}万元/套</p>
-              <p>{{item.locate}} 近期服务{{item.people}}人</p>
-              <p>{{item.tags}}</p>
+              <h2>
+                {{item.title}}
+              </h2>
+              <p style="color: red;">
+                {{item.score}}分 {{item.price}}万元/套
+              </p>
+              <p>
+                {{item.locate}} 近期服务{{item.people}}人
+              </p>
+              <ion-chip>
+                {{item.tag1}}
+              </ion-chip>
+              <ion-chip>
+                {{item.tag2}}
+              </ion-chip>
+
             </ion-label>
           </ion-item>
         </ion-list>

+ 11 - 5
src/app/tab1/tab1.page.ts

@@ -63,7 +63,9 @@ export class Tab1Page implements OnInit {
       price: 10-15, 
       locate: '红谷滩区', 
       people: 109,
-      tags: '十年老店 透明报价' 
+      tag1: '十年老店' ,
+      tag2: '透明报价' 
+
     },
     { 
       image: 'https://img.zcool.cn/community/01df555d65edcea8012187f4e41c2f.jpg@2o.jpg', 
@@ -72,7 +74,8 @@ export class Tab1Page implements OnInit {
       price: 8-13, 
       locate: '红谷滩区', 
       people: 98,
-      tags: '十年老店 透明报价' 
+      tag1: '十年老店' ,
+      tag2: '透明报价' 
     },
     { 
       image: 'https://img.zcool.cn/community/01df555d65edcea8012187f4e41c2f.jpg@2o.jpg', 
@@ -81,7 +84,8 @@ export class Tab1Page implements OnInit {
       price: 7-12, 
       locate: '东湖区', 
       people: 22,
-      tags: '十年老店 透明报价' 
+      tag1: '十年老店' ,
+      tag2: '透明报价' 
     },
     { 
       image: 'https://img.zcool.cn/community/01df555d65edcea8012187f4e41c2f.jpg@2o.jpg', 
@@ -90,7 +94,8 @@ export class Tab1Page implements OnInit {
       price: 7-12, 
       locate: '南昌县', 
       people: 11,
-      tags: '十年老店 毛坯装修' 
+      tag1: '十年老店',
+      tag2: '毛坯装修' 
     },
     { 
       image: 'https://img.zcool.cn/community/01df555d65edcea8012187f4e41c2f.jpg@2o.jpg', 
@@ -99,7 +104,8 @@ export class Tab1Page implements OnInit {
       price: 15-20, 
       locate: '青山湖区', 
       people: 22,
-      tags: '十年老店 透明报价' 
+      tag1: '十年老店',
+      tag2: '毛坯装修' 
     },
     // 添加更多示例数据
   ];

BIN
src/assets/img/paint.png