Ver código fonte

feat: init app-farmshop 0.1

LingYun 9 meses atrás
pai
commit
cf318bf44e

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 # Specifies intentionally untracked files to ignore when using Git
 # http://git-scm.com/docs/gitignore
+/test/
 
 *~
 *.sw[mnpcod]

+ 1 - 0
src/app/chat/fm-bubble/fm-bubble.component.html

@@ -0,0 +1 @@
+<div class="bubble" [style.backgroundColor]="color"></div>

+ 16 - 0
src/app/chat/fm-bubble/fm-bubble.component.scss

@@ -0,0 +1,16 @@
+.bubble {
+    width: 100px;
+    height: 100px;
+    background-color: #3498db;
+    border-radius: 50%;
+    animation: breathe 1.5s infinite alternate;
+}
+
+@keyframes breathe {
+    0% {
+        transform: scale(0.5);
+    }
+    100% {
+        transform: scale(1);
+    }
+}

+ 22 - 0
src/app/chat/fm-bubble/fm-bubble.component.spec.ts

@@ -0,0 +1,22 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+
+import { FmBubbleComponent } from './fm-bubble.component';
+
+describe('FmBubbleComponent', () => {
+  let component: FmBubbleComponent;
+  let fixture: ComponentFixture<FmBubbleComponent>;
+
+  beforeEach(waitForAsync(() => {
+    TestBed.configureTestingModule({
+      imports: [FmBubbleComponent],
+    }).compileComponents();
+
+    fixture = TestBed.createComponent(FmBubbleComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  }));
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 15 - 0
src/app/chat/fm-bubble/fm-bubble.component.ts

@@ -0,0 +1,15 @@
+import { Component, Input, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'fm-bubble',
+  templateUrl: './fm-bubble.component.html',
+  styleUrls: ['./fm-bubble.component.scss'],
+  standalone: true,
+})
+export class FmBubbleComponent  implements OnInit {
+  @Input() color:string = "#3498db"
+  constructor() { }
+
+  ngOnInit() {}
+
+}

+ 17 - 0
src/app/tab-mine/tab-mine-routing.module.ts

@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { TabMinePage } from './tab-mine.page';
+
+const routes: Routes = [
+  {
+    path: '',
+    component: TabMinePage
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class TabMinePageRoutingModule {}

+ 22 - 0
src/app/tab-mine/tab-mine.module.ts

@@ -0,0 +1,22 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { TabMinePageRoutingModule } from './tab-mine-routing.module';
+
+import { TabMinePage } from './tab-mine.page';
+import { FmBubbleComponent } from '../chat/fm-bubble/fm-bubble.component';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    TabMinePageRoutingModule,
+    FmBubbleComponent
+  ],
+  declarations: [TabMinePage]
+})
+export class TabMinePageModule {}

+ 23 - 0
src/app/tab-mine/tab-mine.page.html

@@ -0,0 +1,23 @@
+<ion-header [translucent]="true">
+  <ion-toolbar>
+    <ion-title>tab-mine</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content [fullscreen]="true">
+  <ion-header collapse="condense">
+    <ion-toolbar>
+      <ion-title size="large">tab-mine</ion-title>
+    </ion-toolbar>
+  </ion-header>
+
+  <fm-bubble></fm-bubble>
+  <fm-bubble color="#5cb85c"></fm-bubble>
+  <fm-bubble [color]="'red'"></fm-bubble>
+
+  <ion-select label="Default label" placeholder="Favorite Fruit">
+    <ion-select-option value="apple">Apple</ion-select-option>
+    <ion-select-option value="banana">Banana</ion-select-option>
+    <ion-select-option value="orange">Orange</ion-select-option>
+  </ion-select>
+</ion-content>

+ 0 - 0
src/app/tab-mine/tab-mine.page.scss


+ 17 - 0
src/app/tab-mine/tab-mine.page.spec.ts

@@ -0,0 +1,17 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { TabMinePage } from './tab-mine.page';
+
+describe('TabMinePage', () => {
+  let component: TabMinePage;
+  let fixture: ComponentFixture<TabMinePage>;
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(TabMinePage);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 15 - 0
src/app/tab-mine/tab-mine.page.ts

@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-tab-mine',
+  templateUrl: './tab-mine.page.html',
+  styleUrls: ['./tab-mine.page.scss'],
+})
+export class TabMinePage implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}

+ 83 - 11
src/app/tab1/tab1.page.html

@@ -1,17 +1,89 @@
-<ion-header [translucent]="true">
+<ion-header>
   <ion-toolbar>
-    <ion-title>
-      Tab 1
-    </ion-title>
+    <ion-buttons slot="start">
+      <ion-button>
+        <ion-icon name="person-circle"></ion-icon>
+        登录
+      </ion-button>
+    </ion-buttons>
+    <ion-title>1小时玩转平台宝典</ion-title>
+    <ion-buttons slot="end">
+      <ion-button>
+        <ion-icon name="cube"></ion-icon>
+        买货
+        <ion-icon name="chevron-forward"></ion-icon>
+      </ion-button>
+    </ion-buttons>
   </ion-toolbar>
 </ion-header>
 
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">Tab 1</ion-title>
-    </ion-toolbar>
-  </ion-header>
+<ion-content>
 
-  <app-explore-container name="Tab 1 page"></app-explore-container>
+  <div class="banner">
+    <div class="envelope-top">领取卖货福利红包,开启卖货之旅</div>
+    <div class="envelope-middle">
+        <div class="avatar"></div>
+        <div class="avatar"></div>
+        <div class="avatar"></div>
+        <div class="buyers">20名采购商正在等你联系</div>
+    </div>
+    <div class="envelope-bottom">
+        <div class="left-info">3天前 兴盛果蔬 158****8660 正在采购 桃</div>
+        <div class="right-info">等你来聊</div>
+    </div>
+</div>
+  
+  <!-- 活动横幅 -->
+  <div class="activity-banner">
+    <!-- 信封上部 -->
+    <div class="envelope-top">
+      <p>领取卖货福利红包,开启卖货之旅</p>
+      <div class="envelope-content">
+        <div class="user-images">
+          <!-- 用户头像 -->
+        </div>
+        <p>20名采购商正在等你联系</p>
+      </div>
+      <ion-button expand="block">免费发布</ion-button>
+    </div>
+    <!-- 信封底部 -->
+    <div class="envelope-bottom">
+      <div class="left-info">3天前 兴盛果蔬 158****8660 正在采购 桃</div>
+      <div class="right-info">等你来聊</div>
+    </div>
+  </div>
+
+  <!-- 推荐客户区域 -->
+  <div class="recommend-customers">
+    <div class="title-row">
+      <h2>推荐客户</h2>
+      <p>每天早8点/晚6点更新</p>
+    </div>
+    <div class="carousel">
+      <!-- 商机卡片 -->
+    </div>
+  </div>
+
+  <!-- 金刚区 -->
+  <div class="quick-actions">
+    <!-- 第一行金刚区按钮 -->
+    <div class="action-row">
+      <!-- 按钮图标 -->
+    </div>
+    <!-- 第二行金刚区按钮 -->
+    <div class="action-row">
+      <!-- 按钮图标 -->
+    </div>
+  </div>
+
+  <!-- 轮播图区域 -->
+  <div class="carousel-area">
+    <!-- 促销海报轮播 -->
+  </div>
 </ion-content>
+
+<ion-fab vertical="bottom" horizontal="end">
+  <ion-fab-button>
+    <ion-icon name="add"></ion-icon>
+  </ion-fab-button>
+</ion-fab>

+ 47 - 0
src/app/tab1/tab1.page.scss

@@ -0,0 +1,47 @@
+.banner {
+    width: 100%;
+    height: 300px;
+    background: linear-gradient(135deg, #ff4d4d 50%, transparent 50%);
+    position: relative;
+    border-radius: 10px;
+    color: white;
+    padding: 20px;
+}
+
+.envelope-top {
+    font-size: 18px;
+    font-weight: bold;
+}
+
+.envelope-middle {
+    display: flex;
+    align-items: center;
+    margin-top: 20px;
+}
+
+.avatar {
+    width: 40px;
+    height: 40px;
+    border-radius: 50%;
+    margin-right: -15px;
+    border: 2px solid white;
+}
+
+.buyers {
+    margin-left: 20px;
+}
+
+.envelope-bottom {
+    background: rgba(0, 0, 0, 0.5);
+    border-radius: 0 0 10px 10px;
+    padding: 10px;
+    margin-top: 20px;
+}
+
+.left-info {
+    float: left;
+}
+
+.right-info {
+    float: right;
+}

+ 16 - 0
src/app/tab4/tab4-routing.module.ts

@@ -0,0 +1,16 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { Tab4Page } from './tab4.page';
+
+const routes: Routes = [
+  {
+    path: '',
+    component: Tab4Page,
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class Tab4PageRoutingModule {}

+ 20 - 0
src/app/tab4/tab4.module.ts

@@ -0,0 +1,20 @@
+import { IonicModule } from '@ionic/angular';
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { Tab4Page } from './tab4.page';
+import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
+
+import { Tab4PageRoutingModule } from './tab4-routing.module';
+
+@NgModule({
+  imports: [
+    IonicModule,
+    CommonModule,
+    FormsModule,
+    ExploreContainerComponentModule,
+    Tab4PageRoutingModule
+  ],
+  declarations: [Tab4Page]
+})
+export class Tab4PageModule {}

+ 17 - 0
src/app/tab4/tab4.page.html

@@ -0,0 +1,17 @@
+<ion-header [translucent]="true">
+  <ion-toolbar>
+    <ion-title>
+      Tab 3
+    </ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content [fullscreen]="true">
+  <ion-header collapse="condense">
+    <ion-toolbar>
+      <ion-title size="large">聊生意</ion-title>
+    </ion-toolbar>
+  </ion-header>
+
+  <app-explore-container name="Tab 3 page"></app-explore-container>
+</ion-content>

+ 0 - 0
src/app/tab4/tab4.page.scss


+ 26 - 0
src/app/tab4/tab4.page.spec.ts

@@ -0,0 +1,26 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
+
+import { Tab4Page } from './tab4.page';
+
+describe('Tab4Page', () => {
+  let component: Tab4Page;
+  let fixture: ComponentFixture<Tab4Page>;
+
+  beforeEach(async () => {
+    await TestBed.configureTestingModule({
+      declarations: [Tab4Page],
+      imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
+    }).compileComponents();
+
+    fixture = TestBed.createComponent(Tab4Page);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 12 - 0
src/app/tab4/tab4.page.ts

@@ -0,0 +1,12 @@
+import { Component } from '@angular/core';
+
+@Component({
+  selector: 'app-tab4',
+  templateUrl: 'tab4.page.html',
+  styleUrls: ['tab4.page.scss']
+})
+export class Tab4Page {
+
+  constructor() {}
+
+}

+ 8 - 0
src/app/tabs/tabs-routing.module.ts

@@ -19,6 +19,14 @@ const routes: Routes = [
         path: 'tab3',
         loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
       },
+      {
+        path: 'tab4',
+        loadChildren: () => import('../tab4/tab4.module').then(m => m.Tab4PageModule)
+      },
+      {
+        path: 'tab-mine',
+        loadChildren: () => import('../tab-mine/tab-mine.module').then( m => m.TabMinePageModule)
+      },
       {
         path: '',
         redirectTo: '/tabs/tab1',

+ 30 - 1
src/app/tabs/tabs.page.html

@@ -1,4 +1,33 @@
 <ion-tabs>
+  <ion-tab-bar slot="bottom">
+    <ion-tab-button tab="tab1" href="/tabs/tab1">
+      <ion-icon name="home"></ion-icon>
+      <ion-label>首页</ion-label>
+    </ion-tab-button>
+
+    <ion-tab-button tab="tab2" href="/tabs/tab2">
+      <ion-icon name="search"></ion-icon>
+      <ion-label>找采购商</ion-label>
+    </ion-tab-button>
+
+    <ion-tab-button tab="tab3" href="/tabs/tab3">
+      <ion-icon name="people"></ion-icon>
+      <ion-label>我的客户</ion-label>
+    </ion-tab-button>
+
+    <ion-tab-button tab="tab4">
+      <ion-icon name="chatbubbles"></ion-icon>
+      <ion-label>聊生意</ion-label>
+    </ion-tab-button>
+
+    <ion-tab-button tab="tab-mine">
+      <ion-icon name="person"></ion-icon>
+      <ion-label>我的</ion-label>
+    </ion-tab-button>
+  </ion-tab-bar>
+</ion-tabs>
+
+<!-- <ion-tabs>
 
   <ion-tab-bar slot="bottom">
     <ion-tab-button tab="tab1" href="/tabs/tab1">
@@ -17,4 +46,4 @@
     </ion-tab-button>
   </ion-tab-bar>
 
-</ion-tabs>
+</ion-tabs> -->

+ 1 - 1
src/index.html

@@ -3,7 +3,7 @@
 
 <head>
   <meta charset="utf-8" />
-  <title>Ionic App</title>
+  <title>智慧助农</title>
 
   <base href="/" />