From 24010da98708debda5665b5f78a1d11f12bf8ab4 Mon Sep 17 00:00:00 2001 From: artem Date: Mon, 30 Dec 2024 11:26:53 +0300 Subject: [PATCH] edit workout --- src/main.ts | 4 +- src/pages/workouts/Definitions.vue | 6 ++ src/pages/workouts/Feed.vue | 3 +- src/pages/workouts/WorkoutItem.vue | 106 +++++++++++++++++++++++++++-- src/pages/workouts/WorkoutList.vue | 1 + 5 files changed, 113 insertions(+), 7 deletions(-) diff --git a/src/main.ts b/src/main.ts index 1ae1a18..c31e6a4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,8 +11,8 @@ import axios from 'axios'; import { AxiosResponse } from "axios"; import { createYmaps } from 'vue-yandex-maps'; -const HOST = "https://cycle-rider.ru"; -// const HOST = "http://localhost:8000"; +// const HOST = "https://cycle-rider.ru"; +const HOST = "http://localhost:8000"; axios.defaults.baseURL = HOST; diff --git a/src/pages/workouts/Definitions.vue b/src/pages/workouts/Definitions.vue index 8349095..72fed78 100644 --- a/src/pages/workouts/Definitions.vue +++ b/src/pages/workouts/Definitions.vue @@ -3,6 +3,10 @@ export type Attachment = { url: string; } + export type WorkoutLink = { + type: string; + value: string; + } export type WorkoutItem = { id: string; name: string; @@ -24,6 +28,8 @@ attachment: Attachment; latitude: number; longitude: number; + is_public: boolean; + external_links: Array; } export const secondsToDuration = (seconds: number) => { let hours = Math.floor(seconds / 3600); diff --git a/src/pages/workouts/Feed.vue b/src/pages/workouts/Feed.vue index 787ff2e..a82d3e4 100644 --- a/src/pages/workouts/Feed.vue +++ b/src/pages/workouts/Feed.vue @@ -16,6 +16,7 @@
  • Расстояние: {{ distConvert(item.distantion) }} км
  • Продолжительность: {{ secondsToDuration(item.duraion_sec) }}
  • Мощность: {{ Math.round(item.power) }} Вт
  • +
  • Ссылки: Дзен
  • -

    {{ workoutItem.name }}

    +
    +

    {{ workoutItem.name }}

    + +
    Средняя мощность:
    {{ Math.floor(workoutItem.power) }} Вт
    @@ -59,6 +62,15 @@
    Максимальная скорость:
    {{ speedConvert(workoutItem.max_speed || 0) }} км / ч
    +
    +
    Сделать публичной: 
    + +
    +
    +
    Ссылки на описание:
    +
    Дзен
    +
    Добавить
    +
    @@ -83,6 +95,23 @@ > + +

    Редактирование названия

    + +
    Тренировка не найдена
    +
    + +

    Редактирование ссылок

    + +