-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DM2-2833-estado-de-su-solicitud-de-arreglo-de-electrodomesticos
- Loading branch information
Showing
13 changed files
with
286 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.card{ | ||
margin-left: 200px; | ||
margin-right: 300px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
<app-menu></app-menu> | ||
<div class="custom-position"> | ||
<button (click)="goToHome()" | ||
class="inline-flex items-center justify-center w-10 h-10 bg-indigo-600 rounded-md shadow-sm text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" | ||
title="Go to Home"> | ||
<svg class="h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> | ||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path> | ||
</svg> | ||
</button> | ||
</div> | ||
|
||
<div class="card"> | ||
<div class="mx-auto grid max-w-2xl grid-cols-1 gap-x-8 gap-y-16 sm:gap-y-20 lg:mx-0 lg:max-w-none lg:grid-cols-2"> | ||
<div class="lg:pr-8 lg:pt-4"> | ||
<div class="lg:max-w-lg"> | ||
<h2 class="text-base font-semibold leading-7 text-indigo-600">{{ 'repair' | translate }}</h2> | ||
<p class="mt-2 text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">{{ product?.appliance_type | ||
}}-{{ product?.brand }}</p> | ||
<p class="mt-6 text-lg leading-8 text-gray-600">{{ product?.problem_details}}</p> | ||
<dl class="mt-10 max-w-xl space-y-8 text-base leading-7 text-gray-600 lg:max-w-none"> | ||
<div class="relative pl-9"> | ||
<dt class="inline font-semibold text-gray-900"> | ||
<svg class="absolute left-1 top-1 h-5 w-5 text-indigo-600" viewBox="0 0 20 20" fill="currentColor" | ||
aria-hidden="true"> | ||
<path fill-rule="evenodd" | ||
d="M5.5 17a4.5 4.5 0 01-1.44-8.765 4.5 4.5 0 018.302-3.046 3.5 3.5 0 014.504 4.272A4 4 0 0115 17H5.5zm3.75-2.75a.75.75 0 001.5 0V9.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.1 0l-3.25 3.5a.75.75 0 101.1 1.02l1.95-2.1v4.59z" | ||
clip-rule="evenodd" /> | ||
</svg> | ||
{{ 'service' | translate }} | ||
</dt> | ||
<br> | ||
<dd class="inline">{{ product?.service_type}}</dd> | ||
</div> | ||
<div class="relative pl-9"> | ||
<dt class="inline font-semibold text-gray-900"> | ||
<svg class="absolute left-1 top-1 h-5 w-5 text-indigo-600" viewBox="0 0 20 20" fill="currentColor" | ||
aria-hidden="true"> | ||
<path fill-rule="evenodd" | ||
d="M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z" | ||
clip-rule="evenodd" /> | ||
</svg> | ||
{{ 'contact' | translate }} | ||
</dt> | ||
<br> | ||
<dd class="inline">{{ product?.preferred_contact_method}}</dd> | ||
<br> | ||
<dd class="inline">{{ product?.user?.email}}</dd> | ||
<br> | ||
<dd class="inline">{{ product?.user?.phone_number}}</dd> | ||
</div> | ||
<div class="relative pl-9"> | ||
<dt class="inline font-semibold text-gray-900"> | ||
<svg class="absolute left-1 top-1 h-5 w-5 text-indigo-600" viewBox="0 0 20 20" fill="currentColor" | ||
aria-hidden="true"> | ||
<path | ||
d="M4.632 3.533A2 2 0 016.577 2h6.846a2 2 0 011.945 1.533l1.976 8.234A3.489 3.489 0 0016 11.5H4c-.476 0-.93.095-1.344.267l1.976-8.234z" /> | ||
<path fill-rule="evenodd" | ||
d="M4 13a2 2 0 100 4h12a2 2 0 100-4H4zm11.24 2a.75.75 0 01.75-.75H16a.75.75 0 01.75.75v.01a.75.75 0 01-.75.75h-.01a.75.75 0 01-.75-.75V15zm-2.25-.75a.75.75 0 00-.75.75v.01c0 .414.336.75.75.75H13a.75.75 0 00.75-.75V15a.75.75 0 00-.75-.75h-.01z" | ||
clip-rule="evenodd" /> | ||
</svg> | ||
{{ 'collection_address' | translate }} | ||
</dt> | ||
<br> | ||
<dd class="inline">{{ product?.collection_address}}-{{ product?.application_date}}</dd> | ||
</div> | ||
</dl> | ||
|
||
</div> | ||
</div> | ||
<img [src]="product?.damaged_appliance_image" alt="Product screenshot" | ||
class="w-[48rem] max-w-none rounded-xl shadow-xl ring-1 ring-gray-400/10 sm:w-[30rem] md:-ml-4 lg:-ml-0" | ||
width="2432" height="1442"> | ||
</div> | ||
</div> | ||
|
||
<div class="bg-white mt-8 ml-10 mr-10"> | ||
<div | ||
class="relative isolate overflow-hidden bg-white-900 px-6 pt-16 shadow-2xl sm:rounded-3xl sm:px-16 md:pt-24 lg:px-24 lg:pt-0"> | ||
<ul role="list" class="divide-y divide-gray-100"> | ||
<li class="flex justify-between gap-x-6 py-5"> | ||
<div class="flex min-w-0 gap-x-4"> | ||
<div class="h-12 w-12 flex-none rounded-full bg-gray-50 flex items-center justify-center"> | ||
<svg class="h-6 w-6 text-blue-600" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> | ||
<path d="M12 2a2 2 0 00-2 2v4a2 2 0 00-2 2v4a2 2 0 002 2h4a2 2 0 002-2V8a2 2 0 00-2-2V4a2 2 0 00-2-2z" /> | ||
</svg> | ||
</div> | ||
<div class="min-w-0 flex-auto"> | ||
<p class="text-sm font-semibold leading-6 text-gray-900">{{ 'collection' | translate }}</p> | ||
<p class="mt-1 truncate text-xs leading-5 text-gray-500">{{ 'collection_details' | translate }} {{ | ||
product?.collection_address}}-{{ product?.application_date}}.</p> | ||
</div> | ||
</div> | ||
</li> | ||
<li class="flex justify-between gap-x-6 py-5"> | ||
<div class="flex min-w-0 gap-x-4"> | ||
<div class="h-12 w-12 flex-none rounded-full bg-gray-50 flex items-center justify-center"> | ||
<svg class="h-6 w-6 text-green-600" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> | ||
<path d="M5 3h10a1 1 0 011 1v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4a1 1 0 011-1z" /> | ||
<path d="M3 4h14v1H3V4z" /> | ||
</svg> | ||
</div> | ||
<div class="min-w-0 flex-auto"> | ||
<p class="text-sm font-semibold leading-6 text-gray-900">{{ 'diagnosis' | translate }}</p> | ||
<p class="mt-1 truncate text-xs leading-5 text-gray-500">{{ 'diagnosis_details' | translate }}</p> | ||
</div> | ||
</div> | ||
</li> | ||
<li class="flex justify-between gap-x-6 py-5"> | ||
<div class="flex min-w-0 gap-x-4"> | ||
<div class="h-12 w-12 flex-none rounded-full bg-gray-50 flex items-center justify-center"> | ||
<svg class="h-6 w-6 text-yellow-600" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> | ||
<path d="M6 9h8V7H6v2zm0 4h8v-2H6v2z" /> | ||
</svg> | ||
</div> | ||
<div class="min-w-0 flex-auto"> | ||
<p class="text-sm font-semibold leading-6 text-gray-900">{{ 'repair' | translate }}</p> | ||
<p class="mt-1 truncate text-xs leading-5 text-gray-500">{{ 'repair_details' | translate }}</p> | ||
</div> | ||
</div> | ||
</li> | ||
<li class="flex justify-between gap-x-6 py-5"> | ||
<div class="flex min-w-0 gap-x-4"> | ||
<div class="h-12 w-12 flex-none rounded-full bg-gray-50 flex items-center justify-center"> | ||
<svg class="h-6 w-6 text-red-600" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> | ||
<path d="M10 3.5a1 1 0 00-1 1v7a1 1 0 002 0v-7a1 1 0 00-1-1zM10 13.5a1 1 0 100 2 1 1 0 000-2z" /> | ||
</svg> | ||
</div> | ||
<div class="min-w-0 flex-auto"> | ||
<p class="text-sm font-semibold leading-6 text-gray-900">{{ 'delivery' | translate }}</p> | ||
<p class="mt-1 truncate text-xs leading-5 text-gray-500">{{ 'delivery_details' | translate }}</p> | ||
</div> | ||
</div> | ||
</li> | ||
<li class="flex justify-between gap-x-6 py-5"> | ||
<div class="flex min-w-0 gap-x-4"> | ||
<div class="h-12 w-12 flex-none rounded-full bg-gray-50 flex items-center justify-center"> | ||
<svg class="h-6 w-6 text-purple-600" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> | ||
<path d="M8 4v4H6v4h2v4h4v-4h2V8h-2V4H8z" /> | ||
</svg> | ||
</div> | ||
<div class="min-w-0 flex-auto"> | ||
<p class="text-sm font-semibold leading-6 text-gray-900">{{ 'completion' | translate }}</p> | ||
<p class="mt-1 truncate text-xs leading-5 text-gray-500">{{ 'completion_details' | translate }}</p> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<div class="mt-24"> | ||
<app-footer></app-footer> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Component, inject } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { ApplianceServiceService } from '../services/appliance-service.service'; | ||
import { ProductService } from '../services/product.service'; | ||
import { Product } from 'src/app/models/product'; | ||
|
||
@Component({ | ||
selector: 'app-product', | ||
templateUrl: './product.component.html', | ||
styleUrls: ['./product.component.css'], | ||
}) | ||
export class ProductComponent { | ||
private readonly productService: ProductService = inject(ProductService); | ||
|
||
userId: number | undefined; | ||
productId: number | undefined; | ||
|
||
product: Product | null = null; | ||
|
||
constructor(private router: Router, private route: ActivatedRoute) { | ||
this.getid(); | ||
} | ||
|
||
getid() { | ||
return this.route.paramMap.subscribe((params) => { | ||
const userIdParam = params.get('userId'); | ||
const productIdParam = params.get('id'); | ||
|
||
this.userId = userIdParam ? +userIdParam : undefined; | ||
this.productId = productIdParam ? +productIdParam : undefined; | ||
|
||
if (this.productId) { | ||
this.loadUserProduct(this.productId); | ||
} | ||
}); | ||
} | ||
|
||
loadUserProduct(productId: number): void { | ||
this.productService.getProduct(productId).subscribe((response) => { | ||
this.product = response.data; | ||
}); | ||
} | ||
|
||
getUserIdFromRoute(): string { | ||
const urlSegments = window.location.pathname.split('/'); | ||
return urlSegments[urlSegments.indexOf('pages') + 1]; | ||
} | ||
goToHome(): void { | ||
const userId = this.getUserIdFromRoute(); | ||
this.router.navigate([`/pages/${userId}/home`]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { ProductComponent } from './product.component'; | ||
import { MenuModule } from '../components/menu/menu.module'; | ||
import { FooterModule } from '../components/footer/footer.module'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
|
||
|
||
|
||
@NgModule({ | ||
declarations: [ProductComponent], | ||
imports: [ | ||
CommonModule, | ||
MenuModule, | ||
FooterModule, | ||
TranslateModule | ||
], | ||
exports: [ProductComponent] | ||
}) | ||
export class ProductModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.