update index page
This commit is contained in:
1 parent
fbc08db592
commit
d987f3e998
12 files changed
+128
-41
No files matched your search
@@ -37,7 +37,7 @@ export default defineComponent({
|
||||
$height: 80px;
|
||||
.footer {
|
||||
height: $height;
|
||||
background-image: radial-gradient(circle at 15% -3%, #365280, #080e17 116%);
|
||||
background: radial-gradient(circle at 0 2%, #111827, #1a125d 99%);
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
@@ -2,11 +2,12 @@
|
||||
<el-pagination
|
||||
class="mt-3 mb-3"
|
||||
background
|
||||
:hide-on-single-page="true"
|
||||
layout="prev, pager, next"
|
||||
:current-page="currentPage"
|
||||
:total="total"
|
||||
:page-size="pageSize"
|
||||
@currentChange="onPageChange"
|
||||
@current-change="onPageChange"
|
||||
>
|
||||
</el-pagination>
|
||||
</template>
|
||||
@@ -22,15 +23,19 @@ export default defineComponent({
|
||||
name: 'Pagination',
|
||||
props: {
|
||||
total: {
|
||||
type: Number
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
currentPage: {
|
||||
type: Number
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
pageSize: {
|
||||
type: Number
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
emits: ['change'],
|
||||
data(): IData {
|
||||
return {
|
||||
loaded: false
|
||||
@@ -38,14 +43,14 @@ export default defineComponent({
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
// use this flag to fix the bug of el-paginition,
|
||||
// use this flag to fix the bug of el-pagination,
|
||||
// always emit page 1 when load first time.
|
||||
this.loaded = true;
|
||||
}, 1000);
|
||||
},
|
||||
methods: {
|
||||
onPageChange(val: number, oldVal: number): void {
|
||||
// if not finshed loading, ignore the wrong emit event
|
||||
// if not finished loading, ignore the wrong emit event
|
||||
if (!this.loaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<div v-if="schema" class="wrapper">
|
||||
<div v-for="(item, itemKey) in schema.properties" :key="itemKey" class="item">
|
||||
<div v-for="(item, itemKey) in schema?.properties" :key="itemKey" class="item">
|
||||
<div class="left">
|
||||
<div class="info">
|
||||
<span class="key">{{ itemKey }}</span>
|
||||
<span class="type">{{ item.type }}</span>
|
||||
<span v-if="!item.optional" class="required">required</span>
|
||||
<span class="type">{{ item?.type }}</span>
|
||||
<span v-if="!item?.optional" class="required">required</span>
|
||||
</div>
|
||||
<div class="description">
|
||||
{{ item.title }}
|
||||
{{ item?.title }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-select
|
||||
v-if="item.enum"
|
||||
v-model="value[itemKey.toString()]"
|
||||
v-if="item?.enum"
|
||||
v-model="value[itemKey?.toString()]"
|
||||
clearable
|
||||
:placeholder="$t('common.title.select')"
|
||||
>
|
||||
<el-option v-for="e in item.enum" :key="e" :label="e" :value="e" />
|
||||
<el-option v-for="e in item?.enum" :key="e" :label="e" :value="e" />
|
||||
</el-select>
|
||||
<el-input v-else v-model="value[itemKey.toString()]" />
|
||||
<el-input v-else v-model="value[itemKey?.toString()]" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<el-collapse-item v-for="(response, responseKey) in responses" :key="responseKey" class="item" :name="responseKey">
|
||||
<template #title>
|
||||
<span class="badge">
|
||||
<el-tag v-if="response.is_success" class="ml-2" type="success">{{ $t('api.entity.success') }}</el-tag>
|
||||
<el-tag v-if="response?.is_success" class="ml-2" type="success">{{ $t('api.entity.success') }}</el-tag>
|
||||
<el-tag v-else class="ml-2" type="danger">{{ $t('api.entity.failure') }}</el-tag>
|
||||
</span>
|
||||
<span class="status-code">
|
||||
{{ response.status_code }}
|
||||
{{ response?.status_code }}
|
||||
</span>
|
||||
<span class="error-code">
|
||||
{{ response.error_code }}
|
||||
{{ response?.error_code }}
|
||||
</span>
|
||||
</template>
|
||||
<div class="item-body">
|
||||
@@ -20,10 +20,10 @@
|
||||
<div class="property">
|
||||
<div class="info">
|
||||
<span class="key">{{ itemKey }}</span>
|
||||
<span class="type">{{ item.type }}</span>
|
||||
<span class="type">{{ item?.type }}</span>
|
||||
</div>
|
||||
<div class="description">
|
||||
{{ item.title }}
|
||||
{{ item?.title }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -33,10 +33,10 @@
|
||||
<div v-for="(item, itemKey) in response?.body?.properties" :key="itemKey" class="property">
|
||||
<div class="info">
|
||||
<span class="key">{{ itemKey }}</span>
|
||||
<span class="type">{{ item.type }}</span>
|
||||
<span class="type">{{ item?.type }}</span>
|
||||
</div>
|
||||
<div class="description">
|
||||
{{ item.title }}
|
||||
{{ item?.title }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { IApi, IForm, IRequest } from '@/operators/api/models';
|
||||
import { IApi, IForm } from '@/operators/api/models';
|
||||
import { defineComponent } from 'vue';
|
||||
import axios, { Method } from 'axios';
|
||||
import urlJoin from 'url-join';
|
||||
@@ -40,23 +40,18 @@ export default defineComponent({
|
||||
},
|
||||
methods: {
|
||||
onTry() {
|
||||
console.log('try', this.api, this.form);
|
||||
const config = {
|
||||
method: this.api?.request?.method as Method,
|
||||
url: urlJoin(this.api?.endpoint, this.api?.path),
|
||||
params: { ...this.form.queries },
|
||||
data: { ...this.form.body }
|
||||
};
|
||||
console.debug('config', config);
|
||||
console.debug('config of testing', config);
|
||||
axios(config)
|
||||
.then((response) => {
|
||||
this.responseData = JSON.stringify(response?.data, null, ' ');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error', error);
|
||||
console.log(error);
|
||||
console.log('error');
|
||||
console.log(error.response);
|
||||
this.responseData = JSON.stringify(error?.response?.data, null, ' ');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
<el-divider />
|
||||
<div class="queries">
|
||||
<h2 class="title">{{ $t('api.entity.requestQueries') }}</h2>
|
||||
<api-form v-model:form="formValue.queries" :schema="api?.request.queries" />
|
||||
<api-form v-model:form="formValue.queries" :schema="api?.request?.queries" />
|
||||
</div>
|
||||
<div class="headers">
|
||||
<h2 class="title">{{ $t('api.entity.requestHeaders') }}</h2>
|
||||
<api-form v-model:form="formValue.headers" :schema="api?.request.headers" />
|
||||
<api-form v-model:form="formValue.headers" :schema="api?.request?.headers" />
|
||||
</div>
|
||||
<div class="body">
|
||||
<h2 class="title">{{ $t('api.entity.requestBody') }}</h2>
|
||||
<api-form v-model:form="formValue.body" :schema="api?.request.body" />
|
||||
<api-form v-model:form="formValue.body" :schema="api?.request?.body" />
|
||||
</div>
|
||||
<div v-if="api?.responses" class="responses">
|
||||
<h2 class="title">{{ $t('api.entity.response') }}</h2>
|
||||
|
||||
@@ -16,5 +16,6 @@ export default {
|
||||
console: '控制台',
|
||||
learn: '学习',
|
||||
buy: '购买',
|
||||
try: '测试'
|
||||
try: '测试',
|
||||
startForFree: '免费体验'
|
||||
};
|
||||
@@ -1,4 +1,6 @@
|
||||
export default {
|
||||
free: '免费',
|
||||
appliedCount: '申请次数'
|
||||
appliedCount: '申请次数',
|
||||
indexTitle: '数据驱动未来',
|
||||
indexSubtitle: '一个个标准化服务,助力科技和生活的方方面面。'
|
||||
};
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<el-header class="header">
|
||||
<top-header />
|
||||
</el-header>
|
||||
<el-container class="container">
|
||||
<el-header class="header">
|
||||
<top-header />
|
||||
</el-header>
|
||||
<el-aside class="aside">
|
||||
<navigator />
|
||||
</el-aside>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { applicationOperator, IApplication, IApplicationListResponse } from '@/operators';
|
||||
import ApplicationPreviewCard from '@/components/application/PreviewCard.vue';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-row v-if="service" class="introduction">
|
||||
<el-row v-if="service" class="banner">
|
||||
<el-col :span="24">
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="2" class="left">
|
||||
@@ -144,9 +144,8 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.introduction {
|
||||
.banner {
|
||||
$height: calc(100vh - 60px);
|
||||
|
||||
background-color: #111827;
|
||||
background-image: url('@/assets/images/bg.png');
|
||||
background-position: 50% 50%;
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
<template>
|
||||
<el-row class="banner">
|
||||
<el-col :span="24" class="main">
|
||||
<div class="info">
|
||||
<h1 class="title">
|
||||
{{ $t('service.message.indexTitle') }}
|
||||
</h1>
|
||||
<h3 class="subtitle">
|
||||
{{ $t('service.message.indexSubtitle') }}
|
||||
</h3>
|
||||
<div class="operations">
|
||||
<el-button type="danger" class="btn-apply">
|
||||
{{ $t('common.button.startForFree') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="20" :offset="2">
|
||||
<el-row v-if="loading" :gutter="15" class="services">
|
||||
@@ -128,6 +145,75 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.banner {
|
||||
height: calc(100vh - 60px);
|
||||
background-color: #111827;
|
||||
width: 100%;
|
||||
background-image: url('@/assets/images/bg.png');
|
||||
background-position: 50% 50%;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
.main {
|
||||
position: relative;
|
||||
.info {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
transform: translateY(-50%);
|
||||
h1.title {
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
font-size: 80px;
|
||||
line-height: 84px;
|
||||
position: relative;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
-webkit-text-fill-color: transparent;
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
background-image: linear-gradient(
|
||||
90deg,
|
||||
#fb60d7,
|
||||
#eb69dc 15%,
|
||||
#dc5cff 30%,
|
||||
#c555fe 45%,
|
||||
#a02fff 60%,
|
||||
#7752ff 75%,
|
||||
#5f98fa 90%,
|
||||
#44beff
|
||||
);
|
||||
}
|
||||
h3.subtitle {
|
||||
color: hsla(0, 0%, 100%, 0.7);
|
||||
font-size: 24px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
margin-bottom: 70px;
|
||||
}
|
||||
.operations {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
.btn-apply {
|
||||
margin: 0 auto 40px auto;
|
||||
padding: 25px 62px;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
line-height: 20px;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$transition-duration: 0.5s;
|
||||
.services {
|
||||
padding: 50px 0;
|
||||
|
||||
Reference in new issue
Block a user