remove unused

This commit is contained in:
AceDataCloud committed 2023-04-07 13:05:35 +08:00
1 parent 301dab1ca5
commit ea1c3413a5
88 files changed
+29 -5766

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { getCookie, removeCookie } from 'typescript-cookie';
import { getAuthBaseUrl, getDataBaseUrl } from '@/utils';
import { getCookie } from 'typescript-cookie';
import { getAuthBaseUrl, getChatBaseUrl } from '@/utils';
import { removeCookies } from '@/utils/cookie';
interface IData {
@@ -37,10 +37,10 @@ export default defineComponent({
}
} else {
console.debug('access token and refresh token not found, try to re-auth again');
const dataBaseUrl = getDataBaseUrl();
const chatBaseUrl = getChatBaseUrl();
const authBaseUrl = getAuthBaseUrl();
// callback url used to init access token and then redirect back of `redirect`
const callbackUrl = `${dataBaseUrl}/auth/callback?redirect=${this.redirect}`;
const callbackUrl = `${chatBaseUrl}/auth/callback?redirect=${this.redirect}`;
// redirect to auth service to get access token then redirect back
const targetUrl = `${authBaseUrl}/auth/login?redirect=${callbackUrl}`;
window.location.href = targetUrl;
+3 -3
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { getAuthBaseUrl, getDataBaseUrl } from '@/utils';
import { getAuthBaseUrl, getChatBaseUrl } from '@/utils';
import { defineComponent } from 'vue';
interface IData {
@@ -14,10 +14,10 @@ export default defineComponent({
};
},
async mounted() {
const dataBaseUrl = getDataBaseUrl();
const chatBaseUrl = getChatBaseUrl();
const authBaseUrl = getAuthBaseUrl();
// callback url used to init access token and then redirect back of `redirect`
const callbackUrl = `${dataBaseUrl}/auth/callback?redirect=${this.redirect}`;
const callbackUrl = `${chatBaseUrl}/auth/callback?redirect=${this.redirect}`;
// redirect to auth service to get access token then redirect back
const targetUrl = `${authBaseUrl}/auth/login?redirect=${callbackUrl}`;
window.location.href = targetUrl;
-142
View File
@@ -1,142 +0,0 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('application.title.manageApplication') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
<el-row>
<el-col :span="12" :offset="6">
<el-form :inline="true" label-width="120px">
<el-form-item :label="$t('application.field.id')">
<el-input v-model="id" />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loading" @click="onQuery">
{{ $t('application.button.query') }}
</el-button>
</el-form-item>
</el-form>
<el-divider border-style="dashed" />
<el-form v-if="application" :inline="true" label-width="120px">
<el-form-item :label="$t('application.field.remainingAmount')">
<el-input v-model="application.remaining_amount" />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="updating" @click="onUpdateRemainingAmount">
{{ $t('common.button.update') }}
</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { applicationOperator, IApplication, IApplicationDetailResponse } from '@/operators';
import { ElRow, ElCol, ElCard, ElForm, ElFormItem, ElInput, ElButton, ElDivider, ElMessage } from 'element-plus';
interface IData {
application: IApplication | undefined;
loading: boolean;
updating: boolean;
id: string | undefined;
}
export default defineComponent({
name: 'ConsoleApplication',
components: {
ElRow,
ElCol,
ElCard,
ElForm,
ElFormItem,
ElInput,
ElButton,
ElDivider
},
data(): IData {
return {
application: undefined,
id: undefined,
loading: false,
updating: false
};
},
computed: {},
methods: {
onQuery() {
if (!this.id) {
return;
}
this.loading = true;
applicationOperator
.get(this.id)
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
this.application = data;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
onUpdateRemainingAmount() {
if (!this.id) {
return;
}
this.updating = true;
applicationOperator
.updateRemainingAmount(this.id, {
remaining_amount: this.application?.remaining_amount
})
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
this.application = data;
this.updating = false;
ElMessage.success(this.$t('application.message.updateSuccessfully'));
})
.catch(() => {
this.updating = false;
ElMessage.error(this.$t('application.message.updateFailed'));
});
}
}
});
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-card {
min-height: 500px;
padding-top: 50px;
}
.panel {
padding: 30px;
.credential {
.copy {
cursor: pointer;
}
}
}
.pagination {
float: right;
}
</style>
-102
View File
@@ -1,102 +0,0 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('common.title.buyMore') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
<el-row>
<el-col :span="12" :offset="6">
<el-skeleton v-if="loading" />
<create-order v-else-if="application" :application="application" />
</el-col>
</el-row>
</el-card>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { applicationOperator, IApplication, IApplicationDetailResponse } from '@/operators';
import CreateOrder from '@/components/order/Create.vue';
import { ElRow, ElCol, ElCard, ElSkeleton } from 'element-plus';
interface IData {
application: IApplication | undefined;
loading: boolean;
}
export default defineComponent({
name: 'ConsoleApplicationBuy',
components: {
CreateOrder,
ElSkeleton,
ElRow,
ElCol,
ElCard
},
data(): IData {
return {
application: undefined,
loading: false
};
},
computed: {
id() {
return this.$route.params?.id?.toString();
}
},
mounted() {
console.log('this', this.id);
this.onFetchData();
},
methods: {
onFetchData() {
this.loading = true;
applicationOperator
.get(this.id)
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
this.application = data;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-card {
min-height: 500px;
padding-top: 50px;
}
.panel {
padding: 30px;
.credential {
.copy {
cursor: pointer;
}
}
}
.pagination {
float: right;
}
</style>
-327
View File
@@ -1,327 +0,0 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('common.title.allApplications') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
<el-menu :default-active="type" class="mb-4" mode="horizontal" @select="onFilterType">
<el-menu-item :index="applicationType.API">{{ $t('application.field.api') }}</el-menu-item>
<el-menu-item :index="applicationType.PROXY">{{ $t('application.field.proxy') }}</el-menu-item>
</el-menu>
<el-table v-loading="loading" :data="applications" stripe table-layout="fixed">
<el-table-column prop="id" :label="$t('application.field.id')" width="350px" class-name="text-center">
<template #default="scope">
<span>{{ scope.row.id }}</span>
<span class="copy">
<copy-to-clipboard :content="scope?.row?.id" />
</span>
</template>
</el-table-column>
<el-table-column :label="$t('application.field.name')" width="220px">
<template #default="scope">
<span v-if="scope.row.type === applicationType.API">{{ scope.row?.api?.title }}</span>
<span v-if="scope.row.type === applicationType.PROXY">{{ scope.row?.proxy?.title }}</span>
</template>
</el-table-column>
<el-table-column
prop="remaining_amount"
:label="$t('application.field.remainingAmount')"
width="120px"
class-name="text-center"
>
<template #default="scope">
<span>{{ getRemainingAmount(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column
prop="used_amount"
:label="$t('application.field.usedAmount')"
width="120px"
class-name="text-center"
>
<template #default="scope">
<span>{{ getUsedAmount(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('application.field.credential')" class-name="credential" width="380px">
<template #default="scope">
<div v-if="scope?.row?.credential?.type === credentialType.TOKEN">
<span class="key">{{ scope?.row?.credential?.token }}</span>
<span class="copy">
<copy-to-clipboard :content="scope?.row?.credential?.token" />
</span>
<span class="rotate">
<rotate-credential @rotate="onRotateCredential(scope.row)" />
</span>
</div>
<div v-if="scope?.row?.credential?.type === credentialType.IDENTITY">
<span class="key"
>{{ scope?.row?.credential?.username }}:{{ scope?.row?.credential?.password }}</span
>
<span class="copy">
<copy-to-clipboard
:content="`${scope?.row?.credential?.username}:${scope?.row?.credential?.password}`"
/>
</span>
</div>
</template>
</el-table-column>
<el-table-column fixed="right" width="220px">
<template #default="scope">
<div class="float-right">
<el-button v-if="scope.row?.api?.document_id" @click="onGoDocument(scope?.row)">
{{ $t('application.button.goDocument') }}
</el-button>
<el-button type="primary" @click="onBuyMore(scope?.row)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="14">
<div class="pagination m-v-lg">
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange"> </pagination>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<create-order v-if="active.application" :visible="buying" :application="active.application" @hide="buying = false" />
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import {
applicationOperator,
IApplication,
IApplicationDetailResponse,
IApplicationListResponse,
IApplicationType,
ICredentialType,
IService
} from '@/operators';
import Pagination from '@/components/common/Pagination.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import RotateCredential from '@/components/application/RotateCredential.vue';
import CreateOrder from '@/components/order/Create.vue';
import { ElTable, ElRow, ElCol, ElTableColumn, ElButton, ElCard, ElMenu, ElMenuItem, ElMessage } from 'element-plus';
import { ROUTE_CONSOLE_APPLICATION_BUY, ROUTE_DOCUMENT_DETAIL } from '@/router/constants';
interface IData {
applications: IApplication[];
loading: boolean;
total: number | undefined;
limit: number;
buying: boolean;
form: {
amount: number | undefined;
};
active: {
service: IService | undefined;
application: IApplication | undefined;
};
applicationType: typeof IApplicationType;
credentialType: typeof ICredentialType;
}
export default defineComponent({
name: 'ConsoleApplicationList',
components: {
Pagination,
CopyToClipboard,
RotateCredential,
CreateOrder,
ElTable,
ElRow,
ElCol,
ElTableColumn,
ElButton,
ElCard,
ElMenu,
ElMenuItem
},
data(): IData {
return {
credentialType: ICredentialType,
applicationType: IApplicationType,
applications: [],
loading: false,
total: undefined,
buying: false,
limit: 10,
form: {
amount: 1
},
active: {
service: undefined,
application: undefined
}
};
},
computed: {
redirect() {
return this.$route.query?.redirect;
},
page() {
return parseInt(this.$route.query.page?.toString() || '1');
},
type() {
return (this.$route.query.type?.toString() || IApplicationType.API) as IApplicationType;
}
},
watch: {
page: {
handler() {
this.onFetchData();
}
},
type: {
handler() {
this.onFetchData();
}
}
},
mounted() {
this.onFetchData();
},
methods: {
onFilterType(type: string) {
if (type === this.type) {
return;
}
this.$router.push({
...this.$route,
query: {
...this.$route.query,
page: 1,
type
}
});
},
onRotateCredential(application: IApplication) {
const id = application.id;
if (!id) {
ElMessage.error(this.$t('application.message.idDoesNotExist'));
return;
}
applicationOperator
.rotateCredential(id)
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
console.log('rotate successfully');
ElMessage.success(this.$t('application.message.rotateCredentialSuccessfully'));
application.credential = data.credential;
})
.catch(() => {
ElMessage.error(this.$t('application.message.rotateCredentialFailed'));
});
},
onGoDocument(application: IApplication) {
const documentId = application?.api?.document_id;
this.$router.push({
name: ROUTE_DOCUMENT_DETAIL,
params: {
id: documentId
}
});
},
onBuyMore(application: IApplication) {
// this.active.application = application;
// this.buying = true;
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_BUY,
params: {
id: application.id
}
});
},
onPageChange(page: number) {
this.$router.push({
name: this.$route.name?.toString(),
query: {
...this.$route.query,
page: page
}
});
},
onFetchData() {
this.loading = true;
applicationOperator
.getAll({
limit: this.limit,
offset: (this.page - 1) * this.limit,
user_id: this.$store.getters.user.id,
type: this.type,
ordering: '-created_at'
})
.then(({ data: data }: { data: IApplicationListResponse }) => {
this.applications = data.items;
this.loading = false;
this.total = data.count;
})
.catch(() => {
this.loading = false;
});
},
getRemainingAmount(application: IApplication) {
if (application.type === IApplicationType.API) {
const unit = this.$t(`api.unit.${application?.api?.unit}`);
return `${application.remaining_amount}${unit}`;
}
if (application.type === IApplicationType.PROXY) {
const unit = this.$t(`proxy.unit.${application?.proxy?.unit}`);
if (unit === 'MB') {
return `${(application.remaining_amount || 0).toFixed(2)}${unit}`;
}
}
},
getUsedAmount(application: IApplication) {
if (application.type === IApplicationType.API) {
const unit = this.$t(`api.unit.${application?.api?.unit}`);
return `${application.used_amount}${unit}`;
}
if (application.type === IApplicationType.PROXY) {
const unit = this.$t(`proxy.unit.${application?.proxy?.unit}`);
if (unit === 'MB') {
return `${((application.used_amount || 0) / 1024 / 1024).toFixed(2)}${unit}`;
}
}
}
}
});
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-table {
min-height: calc(100vh - 350px);
margin-bottom: 50px;
}
.panel {
padding: 30px;
.credential {
.copy {
cursor: pointer;
}
}
}
.pagination {
float: right;
}
</style>
-307
View File
@@ -1,307 +0,0 @@
<template>
<el-row class="wrapper">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('order.title.info') }}</h2>
</el-col>
</el-row>
<el-row class="panel">
<el-col :span="24">
<el-card shadow="hover">
<el-row>
<el-col :span="12" :offset="6">
<div v-if="loading" class="pt-5">
<el-skeleton animated />
</div>
<div v-else class="order">
<el-descriptions :column="1">
<el-descriptions-item :label="$t('order.field.id')">{{ order?.id }}</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.description')">
{{ order?.description }}
</el-descriptions-item>
<el-descriptions-item
v-if="order?.application?.type === applicationType.API"
:label="$t('order.field.api')"
>
{{ order?.application?.api?.title }}
</el-descriptions-item>
<el-descriptions-item
v-if="order?.application?.type === applicationType.PROXY"
:label="$t('order.field.proxy')"
>
{{ order?.application?.proxy?.title }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.amount')">
<span v-if="order?.application?.type === applicationType.API">
{{ order?.amount }}{{ $t(`api.unit.${order?.application?.api?.unit}`) }}
</span>
<span v-if="order?.application?.type === applicationType.PROXY">
{{ order?.amount }}{{ $t(`proxy.unit.${order?.application?.proxy?.unit}`) }}
</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.createdAt')">
{{ $dayjs.format(order?.created_at) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.price')">
<span v-if="order?.price && order?.price > 0" class="price unfree">
¥{{ order?.price?.toFixed(2) }}
</span>
<span v-else class="price free"> {{ $t('order.message.free') }} </span>
</el-descriptions-item>
<el-descriptions-item v-if="order?.pay_way" :label="$t('order.field.payWay')">
<span v-if="order?.pay_way === PayWay.WechatPay">
{{ $t('order.title.wechatPay') }}
</span>
<span v-if="order?.pay_way === PayWay.AliPay">
{{ $t('order.title.aliPay') }}
</span>
</el-descriptions-item>
</el-descriptions>
</div>
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PAID" class="mb-5">
<el-col :span="12" :offset="6">
<el-divider border-style="dashed" />
<el-alert :title="$t('order.message.paidSuccessfully')" type="success" show-icon :closable="false" />
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PENDING || order?.state === OrderState.FAILED">
<el-col :span="12" :offset="6">
<el-divider border-style="dashed" />
<div v-if="order.price && order.price > 0 && !order.pay_way" class="payways mb-4">
<div
:class="{
payway: true,
wechatpay: true,
active: payWay === PayWay.WechatPay
}"
@click="payWay = PayWay.WechatPay"
>
<span class="payicon wechatpay"></span>
{{ $t('order.title.wechatPay') }}
</div>
<div
v-if="false"
:class="{
payway: true,
alipay: true,
active: payWay === PayWay.AliPay
}"
@click="payWay = PayWay.AliPay"
>
<span class="payicon alipay"></span>
{{ $t('order.title.aliPay') }}
</div>
</div>
<div v-if="!order?.pay_way">
<el-button :loading="prepaying" type="primary" size="large" class="btn-pay" @click="onPay">{{
$t('common.button.pay')
}}</el-button>
</div>
<div v-else>
<el-button type="primary" size="large" class="btn-repay" @click="onRepay">{{
$t('common.button.repay')
}}</el-button>
</div>
</el-col>
</el-row>
</el-card>
</el-col>
</el-row>
</el-col>
</el-row>
<pay-order v-if="order" v-model="order" :visible="paying" @hide="paying = false" />
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { IOrder, IOrderDetailResponse, orderOperator, OrderState } from '@/operators/order';
import {
ElRow,
ElCol,
ElCard,
ElSkeleton,
ElDivider,
ElAlert,
ElDescriptions,
ElDescriptionsItem,
ElButton
} from 'element-plus';
import PayOrder from '@/components/order/Pay.vue';
import { IApplicationType } from '@/operators';
enum PayWay {
WechatPay = 'WechatPay',
AliPay = 'AliPay'
}
interface IData {
PayWay: typeof PayWay;
OrderState: typeof OrderState;
payWay: PayWay | undefined;
order: IOrder | undefined;
loading: boolean;
paying: boolean;
prepaying: boolean;
applicationType: typeof IApplicationType;
}
export default defineComponent({
name: 'ConsoleOrderDetail',
components: {
ElButton,
ElRow,
ElCol,
ElCard,
ElSkeleton,
ElDivider,
ElAlert,
ElDescriptions,
ElDescriptionsItem,
PayOrder
},
data(): IData {
return {
PayWay: PayWay,
payWay: PayWay.WechatPay,
OrderState: OrderState,
order: undefined,
loading: false,
paying: false,
prepaying: false,
applicationType: IApplicationType
};
},
computed: {
id() {
return this.$route.params?.id?.toString();
},
redirect() {
return this.$route.query?.redirect;
}
},
watch: {
order: {
handler(val) {
if (val?.state === OrderState.PAID) {
setTimeout(() => {
if (this.redirect) {
window.location.replace(this.redirect?.toString());
}
}, 2000);
return;
}
},
deep: true
}
},
mounted() {
this.onFetchData();
},
methods: {
onFetchData() {
this.loading = true;
orderOperator
.refresh(this.id)
.then(({ data: data }: { data: IOrderDetailResponse }) => {
this.order = data;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
onRepay() {
this.paying = true;
},
onPay() {
this.prepaying = true;
orderOperator
.pay(this.id, {
pay_way: this.payWay
})
.then(({ data: data }: { data: IOrderDetailResponse }) => {
this.prepaying = false;
this.order = data;
if (this.order.price && this.order.price > 0) {
this.paying = true;
}
})
.catch(() => {
this.prepaying = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.wrapper {
padding: 30px;
.panel {
.el-card {
min-height: 500px;
}
.order {
padding-top: 50px;
.price {
font-size: 20px;
font-weight: bold;
&.unfree {
color: #ff5441;
}
&.free {
color: #29c287;
}
}
}
.payways {
overflow: hidden;
.payway {
cursor: pointer;
font-size: 14px;
float: left;
width: 120px;
line-height: 40px;
text-align: center;
height: 40px;
border: 1px solid #eee;
&.active {
border: 1px solid #3879d1;
}
}
.payicon {
width: 20px;
height: 20px;
margin-top: 2px;
display: inline-block;
&.wechatpay {
position: relative;
top: 3px;
width: 22px;
height: 19px;
background-image: url(//midas.gtimg.cn/enterprise/images/ep_new_sprites@2x.png);
background-repeat: no-repeat;
background-size: 60px 250px;
background-position: 0 -50px;
}
}
}
.btn-pay {
width: 150px;
}
}
}
</style>
-211
View File
@@ -1,211 +0,0 @@
<template>
<el-row class="wrapper">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('common.title.allOrders') }}</h2>
</el-col>
</el-row>
<el-row class="panel">
<el-col :span="24">
<el-card shadow="hover">
<el-table v-loading="loading" :data="orders" stripe>
<el-table-column prop="id" :label="$t('order.field.id')" class-name="text-center" width="350px">
<template #default="scope">
<span class="key">{{ scope.row.id }}</span>
<span class="copy">
<copy-to-clipboard :content="scope.row.id" />
</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.price')" width="100px">
<template #default="scope">
<span class="price">¥{{ scope.row?.price?.toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.createdAt')" width="250px">
<template #default="scope">
<span class="created-at">{{ $dayjs.format(scope.row.created_at) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.description')">
<template #default="scope">
<span class="description">{{ scope.row.description }}</span>
</template>
</el-table-column>
<el-table-column prop="state" :label="$t('order.field.state')" class-name="text-center" width="100px">
<template #default="scope">
<span v-if="scope.row.state === OrderState?.PENDING">
<el-tag type="info" class="mx-1" effect="dark">{{ $t('order.state.pending') }}</el-tag>
</span>
<span v-else-if="scope.row.state === OrderState?.PAID" class="state state-paid">
<el-tag type="success" class="mx-1" effect="dark">{{ $t('order.state.paid') }}</el-tag>
</span>
<span v-else-if="scope.row.state === OrderState?.EXPIRED" class="state state-expired">
<el-tag type="warning" class="mx-1" effect="dark">{{ $t('order.state.expired') }}</el-tag>
</span>
<span v-else-if="scope.row.state === OrderState?.FAILED" class="state state-failed">
<el-tag type="danger" class="mx-1" effect="dark"> {{ $t('order.state.failed') }}</el-tag>
</span>
</template>
</el-table-column>
<el-table-column min-width="300px">
<template #default="scope">
<div class="float-right">
<el-button
v-if="scope.row.state !== OrderState.PAID"
type="primary"
@click="
$router.push({
name: 'console-order-detail',
params: {
id: scope.row.id
}
})
"
>
{{ $t('order.button.continuePay') }}
</el-button>
<el-button
v-else
@click="
$router.push({
name: 'console-order-detail',
params: {
id: scope.row.id
}
})
"
>
{{ $t('order.button.checkDetail') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="14">
<div class="pagination m-v-lg">
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange"> </pagination>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { IOrder, IOrderListResponse, orderOperator, OrderState } from '@/operators/order';
import Pagination from '@/components/common/Pagination.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import { ElRow, ElCol, ElTable, ElTableColumn, ElButton, ElTag, ElCard } from 'element-plus';
interface IData {
orders: IOrder[];
loading: boolean;
total: number | undefined;
limit: number;
OrderState: typeof OrderState;
}
export default defineComponent({
name: 'ConsoleOrderList',
components: {
Pagination,
CopyToClipboard,
ElRow,
ElCol,
ElTable,
ElTableColumn,
ElButton,
ElTag,
ElCard
},
data(): IData {
return {
OrderState: OrderState,
orders: [],
loading: false,
total: undefined,
limit: 10
};
},
computed: {
redirect() {
return this.$route.query.redirect;
},
page() {
return parseInt(this.$route.query.page?.toString() || '1');
}
},
watch: {
page: {
handler() {
this.onFetchData();
}
}
},
mounted() {
this.onFetchData();
},
methods: {
onPageChange(page: number) {
this.$router.push({
name: this.$route.name?.toString(),
query: {
page: page
}
});
},
onFetchData() {
this.loading = true;
orderOperator
.getAll({
ordering: '-created_at',
limit: this.limit,
offset: (this.page - 1) * this.limit,
user_id: this.$store.getters.user.id
})
.then(({ data: data }: { data: IOrderListResponse }) => {
this.orders = data.items;
this.loading = false;
this.total = data.count;
})
.catch(() => {
this.loading = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-table {
min-height: calc(100vh - 300px);
margin-bottom: 50px;
}
.wrapper {
padding: 30px;
.api-key {
.copy {
cursor: pointer;
margin: 0 10px;
}
}
}
.pagination {
float: right;
}
</style>
-168
View File
@@ -1,168 +0,0 @@
<template>
<!-- center part -->
<div class="center">
<div v-if="loading">
<el-skeleton animated />
</div>
<div v-else-if="document">
<div v-if="document.type === documentType.TEXT">
<markdown-renderer :content="document?.content" />
</div>
<div v-else-if="document.type === documentType.API">
<api-info v-if="document.api" :api="document.api" />
<el-divider />
<api-usage v-if="document.api" v-model:form="form" :api="document.api" />
<markdown-renderer :content="document?.content" />
</div>
<div v-else-if="document.type === documentType.PROXY">
<proxy-info v-if="document.proxy" :proxy="document.proxy" />
<el-divider />
<markdown-renderer :content="document?.content" />
</div>
</div>
</div>
<!-- end center part -->
<!-- right part -->
<div class="right">
<div v-if="loading">
<el-skeleton />
</div>
<div v-else-if="document">
<div v-if="document?.type === documentType.API && document?.api">
<api-code :form="form" :api="document?.api" />
<api-try :form="form" :api="document?.api" />
</div>
</div>
</div>
<!-- end right part -->
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import ApiUsage from '@/components/api/Usage.vue';
import ApiTry from '@/components/api/Try.vue';
import ApiInfo from '@/components/api/Info.vue';
import ProxyInfo from '@/components/proxy/Info.vue';
import ApiCode from '@/components/api/Code.vue';
import { documentOperator, IDocument, IDocumentDetailResponse, IDocumentType } from '@/operators';
import { IForm } from '@/operators/api/models';
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
import { ElSkeleton, ElDivider } from 'element-plus';
import axios from 'axios';
export interface IData {
document: IDocument | undefined;
loading: boolean;
form: IForm;
documentType: typeof IDocumentType;
canceler: AbortController | undefined;
}
export default defineComponent({
name: 'DocumentDetail',
components: {
ApiUsage,
ApiTry,
ApiCode,
ApiInfo,
ProxyInfo,
ElSkeleton,
ElDivider,
MarkdownRenderer
},
data(): IData {
return {
document: undefined,
loading: false,
form: {},
documentType: IDocumentType,
canceler: undefined
};
},
computed: {
id() {
return this.$route.params?.id?.toString();
}
},
watch: {
id: {
handler(val) {
if (val) this.getDocument(val);
}
}
},
mounted() {
this.getDocument(this.id);
},
methods: {
getDocument(id: string) {
this.loading = true;
this.form = {};
// cancel existing pending request
if (this.canceler) {
this.canceler.abort();
}
this.canceler = new AbortController();
documentOperator
.get(id, {
signal: this.canceler.signal
})
.then(({ data: data }: { data: IDocumentDetailResponse }) => {
this.loading = false;
this.document = data;
})
.catch((error) => {
if (axios.isCancel(error)) {
return;
}
this.loading = false;
console.error(error);
});
}
}
});
</script>
<style lang="scss" scoped>
.center {
float: left;
width: calc(100% - 760px);
height: 100%;
padding: 30px;
.markdown-body {
background: none;
}
}
.right {
float: left;
width: 480px;
height: 100%;
padding: 30px;
box-shadow: -1px 0 0 #eee;
}
@media (max-width: 1199px) and (min-width: 900px) {
.center {
width: calc(100% - 400px);
height: fit-content;
}
.right {
width: 400px;
height: fit-content;
}
}
@media (max-width: 899px) {
.center {
width: 100%;
height: fit-content;
}
.right {
width: 100%;
display: block;
height: fit-content;
}
}
</style>
-76
View File
@@ -1,76 +0,0 @@
<template>
<div class="center">
<el-skeleton animated />
<el-divider />
<el-skeleton animated />
</div>
</template>
<script lang="ts">
import { IDocument, IDocumentListResponse } from '@/operators/document/models';
import { documentOperator } from '@/operators/document/operator';
import { ROUTE_DOCUMENT_DETAIL } from '@/router';
import { defineComponent } from 'vue';
import { ElSkeleton, ElDivider } from 'element-plus';
interface IData {
documents: IDocument[];
}
export default defineComponent({
name: 'DocumentIndex',
components: {
ElSkeleton,
ElDivider
},
data(): IData {
return {
documents: []
};
},
mounted() {
this.getDocuments(0, 1);
},
methods: {
getDocuments(offset: number, limit: number) {
documentOperator
.getAll({
offset,
limit,
ordering: 'rank',
private: false
})
.then(({ data: data }: { data: IDocumentListResponse }) => {
this.documents = data.items;
if (this.documents.length > 0) {
const firstDocument = this.documents[0];
this.$router.push({
name: ROUTE_DOCUMENT_DETAIL,
params: {
id: firstDocument.id
}
});
}
})
.catch((error) => {
console.error(error);
});
}
}
});
</script>
<style lang="scss" scoped>
.center {
float: left;
width: calc(100% - 760px);
height: 100%;
padding: 30px;
}
.right {
float: left;
width: 480px;
height: 100%;
box-shadow: -1px 0 0 #eee;
}
</style>
-583
View File
@@ -1,583 +0,0 @@
<template>
<el-row class="banner">
<el-col :span="24">
<el-row>
<el-col :md="10" :offset="2" :sm="24" :xs="24" class="left">
<div v-if="loading" class="info">
<el-skeleton animated>
<template #template>
<el-skeleton-item variant="p" class="title-placeholder" />
<el-skeleton-item variant="p" class="description-placeholder" />
<el-skeleton-item variant="p" class="price-placeholder" />
<el-skeleton-item variant="p" class="operations-placeholder" />
</template>
</el-skeleton>
</div>
<div v-if="service" class="info">
<h1>
{{ service.title }}
</h1>
<p>
{{ service.description }}
</p>
<div class="price">
<p v-if="service && service.price && service.price > 0" class="unfree">
<span class="value">¥{{ service.price }}</span>
<span class="unit"> / {{ $t(`service.unit.${service.unit}`) }}</span>
<span class="from">
{{ $t('service.message.fromPrice') }}
</span>
</p>
<p v-else class="free">
{{ $t('service.message.free') }}
</p>
</div>
<div class="operations">
<el-button type="danger" class="btn-apply" @click="onToApis">
{{ $t('service.button.apply') }}
</el-button>
</div>
</div>
</el-col>
<el-col :md="10" :sm="0" :xs="0" class="right">
<div class="demo">
<img src="@/assets/images/illustration.png" />
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row v-if="service && service.introduction" class="introduction">
<el-col :span="20" :offset="2">
<el-card shadow="hover" :body-style="{ padding: '50px' }">
<markdown-renderer :content="service?.introduction" />
</el-card>
</el-col>
</el-row>
<el-row v-if="service && apis?.length > 0" id="apis" class="apis">
<el-col :span="20" :offset="2">
<el-card shadow="hover" :body-style="{ padding: '50px' }">
<div v-for="(api, apiIndex) in apis" :key="apiIndex">
<el-row>
<el-col :span="20">
<api-preview :api="api" />
</el-col>
<el-col :span="4" class="operations">
<div v-if="!api.applied">
<el-button type="primary" @click="onConfirm(api, applicationType.API)">
{{ $t('common.button.apply') }}
</el-button>
</div>
<div v-else>
<el-button v-if="api?.document_id" @click="onGoDocument(api?.document_id!)">
{{ $t('application.button.goDocument') }}
</el-button>
<el-button v-if="api?.application_id" type="primary" @click="onBuyMore(api?.application_id!)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</el-col>
</el-row>
<el-divider v-if="apiIndex < apis.length - 1" border-style="dashed" />
</div>
</el-card>
</el-col>
</el-row>
<el-row v-if="service && proxies?.length > 0" id="proxies" class="proxies">
<el-col :span="20" :offset="2">
<el-card shadow="hover" :body-style="{ padding: '50px' }">
<div v-for="(proxy, proxyIndex) in proxies" :key="proxyIndex">
<el-row>
<el-col :span="20">
<proxy-preview :proxy="proxy" />
</el-col>
<el-col :span="4" class="operations">
<div v-if="!proxy.applied">
<el-button type="primary" @click="onConfirm(proxy, applicationType.PROXY)">
{{ $t('common.button.apply') }}
</el-button>
</div>
<div v-else>
<el-button v-if="proxy?.document_id" @click="onGoDocument(proxy?.document_id!)">
{{ $t('application.button.goDocument') }}
</el-button>
<el-button v-if="proxy?.application_id" type="primary" @click="onBuyMore(proxy?.application_id!)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</el-col>
</el-row>
<el-divider v-if="proxyIndex < apis.length - 1" />
</div>
</el-card>
</el-col>
</el-row>
<application-confirm
v-if="confirm.object && confirm.type"
v-model.visible="confirming"
:object="confirm.object"
:type="confirm.type"
@apply="onApply(confirm.object!, confirm.type!)"
/>
</template>
<script lang="ts">
import {
applicationOperator,
IApplication,
IApplicationDetailResponse,
IProxy,
IProxyListResponse,
IService,
IServiceDetailResponse,
proxyOperator,
serviceOperator
} from '@/operators';
import { defineComponent } from 'vue';
import { ERROR_CODE_DUPLICATION, ERROR_CODE_UNVERIFIED } from '@/constants';
import { ElMessage } from 'element-plus';
import { apiOperator } from '@/operators/api/operator';
import { IApi, IApiListResponse } from '@/operators/api/models';
import { IApplicationType } from '@/operators/application/models';
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
import {
ROUTE_AUTH_LOGIN,
ROUTE_CONSOLE_APPLICATION_BUY,
ROUTE_CONSOLE_APPLICATION_LIST,
ROUTE_DOCUMENT_DETAIL
} from '@/router';
import { ElCol, ElRow, ElButton, ElCard, ElDivider, ElSkeleton, ElSkeletonItem } from 'element-plus';
import ApiPreview from '@/components/api/Preview.vue';
import ProxyPreview from '@/components/proxy/Preview.vue';
import ApplicationConfirm from '@/components/application/Confirm.vue';
import { getVerificationUrl } from '@/utils';
interface IData {
service: IService | undefined;
apis: IApi[];
proxies: IProxy[];
application: IApplication | undefined;
loading: boolean;
loadingApis: boolean;
loadingProxies: boolean;
activeTab: string;
applicationType: typeof IApplicationType;
confirming: boolean;
confirm: {
type: IApplicationType | undefined;
object: IApi | IProxy | undefined;
};
}
export default defineComponent({
name: 'ServiceDetail',
components: {
MarkdownRenderer,
ElCol,
ElRow,
ElButton,
ElCard,
ElDivider,
ApiPreview,
ApplicationConfirm,
ProxyPreview,
ElSkeleton,
ElSkeletonItem
},
data(): IData {
return {
service: undefined,
apis: [],
proxies: [],
application: undefined,
loading: false,
loadingApis: false,
loadingProxies: false,
activeTab: 'introduction',
applicationType: IApplicationType,
confirming: false,
confirm: {
object: undefined,
type: undefined
}
};
},
computed: {
id() {
return this.$route.params.id.toString();
}
},
async mounted() {
this.onFetchService();
this.onFetchApis();
this.onFetchProxies();
},
methods: {
onShowApiPolicy() {},
onFetchService() {
this.loading = true;
serviceOperator.get(this.id).then(({ data: data }: { data: IServiceDetailResponse }) => {
this.service = data;
this.loading = false;
});
},
onFetchApis() {
this.loadingApis = true;
apiOperator
.getAllForService(this.id, {
ordering: 'rank'
})
.then(({ data: data }: { data: IApiListResponse }) => {
this.apis = data.items;
this.loadingApis = false;
})
.catch(() => {
this.loadingApis = false;
});
},
onFetchProxies() {
this.loadingProxies = true;
proxyOperator
.getAllForService(this.id, {
ordering: 'rank'
})
.then(({ data: data }: { data: IProxyListResponse }) => {
this.proxies = data.items;
})
.catch(() => {
this.loadingProxies = false;
});
},
onToApis() {
window.scrollTo({
top: document.getElementById('apis')?.offsetTop,
left: 0,
behavior: 'smooth'
});
},
onBuyMore(id: string) {
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_BUY,
params: {
id
}
});
},
onConfirm(obj: IApi | IProxy, type: IApplicationType) {
if (!this.$store.getters.authenticated) {
this.$router.push({
name: ROUTE_AUTH_LOGIN,
query: { redirect: this.$route.fullPath }
});
}
this.confirming = true;
this.confirm.object = obj;
this.confirm.type = type;
},
onGoDocument(documentId: string) {
this.$router.push({
name: ROUTE_DOCUMENT_DETAIL,
params: {
id: documentId
}
});
},
onApply(obj: IApi | IProxy, type: IApplicationType) {
applicationOperator
.create({
type,
...(type === IApplicationType.API
? {
api_id: obj.id
}
: {}),
...(type === IApplicationType.PROXY
? {
proxy_id: obj.id
}
: {})
})
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
this.application = data;
obj.applied = true;
ElMessage.success(this.$t('application.message.applySuccessfully'));
setTimeout(() => {
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_LIST
});
}, 2000);
})
.catch((error) => {
if (error?.response?.data?.code === ERROR_CODE_DUPLICATION) {
ElMessage.error(this.$t('application.message.alreadyApplied'));
setTimeout(() => {
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_LIST
});
}, 2000);
}
if (error?.response?.data?.code === ERROR_CODE_UNVERIFIED) {
ElMessage({
dangerouslyUseHTMLString: true,
duration: 0,
showClose: true,
message: `${this.$t(
'application.message.unverified'
)} <a class="underline" href="${getVerificationUrl()}">${this.$t('application.message.goVerify')}</a>`,
type: 'warning'
});
}
});
}
}
});
</script>
<style lang="scss" scoped>
.banner {
$height: calc(100vh - 60px);
$min-height: 600px;
background-color: #111827;
background-image: url('@/assets/images/bg.png');
background-position: 50% 50%;
background-size: cover;
background-repeat: no-repeat;
position: relative;
z-index: 1;
height: $height;
min-height: $min-height;
margin-bottom: 30px;
.left {
position: relative;
height: $height;
min-height: $min-height;
.info {
position: absolute;
left: 0;
width: 100%;
top: 50%;
transform: translateY(-50%);
.title-placeholder {
height: 64px;
width: 200px;
margin-bottom: 24px;
}
.description-placeholder {
height: 50px;
margin-bottom: 56px;
}
.price-placeholder {
height: 32px;
margin-bottom: 56px;
}
.operations-placeholder {
height: 52px;
margin-bottom: 40px;
visibility: hidden;
}
h1 {
max-width: 1064px;
margin-bottom: 24px;
color: #fff;
font-size: 56px;
line-height: 64px;
}
p {
max-width: 650px;
margin-bottom: 56px;
color: #d1d5db;
font-size: 24px;
line-height: 32px;
font-weight: 500;
}
.price {
margin: 0;
.unfree {
.value {
font-weight: bold;
color: #ff5441;
font-size: 40px;
}
.unit {
color: white;
}
.from {
color: white;
}
}
.free {
color: #29c287;
}
}
.operations {
.btn-apply {
margin: 0 auto 40px;
padding: 25px 62px;
color: #fff;
font-size: 20px;
line-height: 20px;
font-weight: 700;
text-align: center;
}
}
}
}
.right {
position: relative;
height: $height;
min-height: $min-height;
padding: 50px;
overflow: hidden;
.demo {
width: 100%;
height: 100%;
position: relative;
img {
max-width: 100%;
max-height: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
}
}
}
.preview {
overflow: hidden;
$left-width: 320px;
$left-height: 290px;
margin: 15px 0;
.body {
display: flex;
.left {
float: left;
position: relative;
border: 1px solid #e8e8e8;
border-radius: 8px;
width: $left-width;
height: $left-height;
text-align: center;
box-sizing: border-box;
box-shadow: none;
padding-top: 50px;
.icon {
width: 150px;
height: 150px;
margin: 0 auto;
font-size: 80px;
}
.icon-placeholder {
display: flex;
width: 80px;
height: 80px;
text-align: center;
margin: 30px auto 10px auto;
}
.count {
color: #999;
}
}
.right {
position: relative;
padding: 15px;
float: left;
width: calc(100% - $left-width);
.title {
font-size: 18px;
color: #000;
line-height: 26px;
padding-right: 8px;
}
.title-placeholder {
width: 100px;
height: 30px;
display: block;
margin-bottom: 10px;
}
.description {
line-height: 22px;
color: #303030;
padding: 15px 0;
font-size: 14px;
}
.description-placeholder {
width: 300px;
height: 20px;
display: block;
margin-bottom: 10px;
}
.price {
margin: 0;
.unfree {
.value {
font-weight: bold;
color: #ff5441;
font-size: 30px;
}
.unit {
color: #666;
}
}
.free {
color: #29c287;
}
}
.price-placeholder {
width: 100px;
height: 30px;
}
.operations {
position: absolute;
left: 15px;
bottom: 10px;
}
}
}
}
.introduction {
margin-bottom: 20px;
}
.apis {
margin-bottom: 40px;
.operations {
align-items: center;
justify-items: center;
display: flex;
}
}
.proxies {
margin-bottom: 40px;
.operations {
align-items: center;
justify-items: center;
display: flex;
}
}
.dialog-confirm {
.title {
font-size: 14px;
font-weight: bold;
}
}
</style>
-356
View File
@@ -1,356 +0,0 @@
<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" @click="onApply">
{{ $t('common.button.startForFree') }}
</el-button>
</div>
</div>
</el-col>
</el-row>
<el-row id="services">
<el-col :span="20" :offset="2">
<el-row v-if="loading" :gutter="15" class="services">
<el-col v-for="_ in 8" :key="_" :lg="6" :md="8" :sm="12" :xs="24">
<el-card shadow="hover" class="service">
<el-skeleton animated>
<template #template>
<el-skeleton-item variant="image" class="icon-placeholder" />
<el-skeleton-item variant="p" class="title-placeholder" />
<el-skeleton-item variant="p" class="price-placeholder" />
</template>
</el-skeleton>
</el-card>
</el-col>
</el-row>
<el-row v-else :gutter="15" class="services">
<el-col v-for="(service, serviceIndex) in services" :key="serviceIndex" :lg="6" :md="8" :sm="12" :xs="24">
<router-link
:to="{
name: 'service-detail',
params: {
id: service.id
}
}"
>
<el-card shadow="hover" class="service" :body-style="{ padding: 0 }">
<el-image class="thumb" :src="service?.thumbnail" />
<div class="title">{{ service.title }}</div>
<div class="price">
<service-price :price="service?.price" :unit="$t(`service.unit.${service.unit}`)" />
</div>
<div class="description">
<p>
{{ service.description }}
</p>
</div>
</el-card>
</router-link>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="14">
<div class="pagination m-v-lg">
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange" />
</div>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
import { serviceOperator, IService, IServiceListResponse } from '@/operators';
import { defineComponent } from 'vue';
import Pagination from '@/components/common/Pagination.vue';
import { ElRow, ElCol, ElButton, ElCard, ElSkeleton, ElImage, ElSkeletonItem } from 'element-plus';
import ServicePrice from '@/components/common/Price.vue';
interface IData {
services: IService[];
loading: boolean;
total: number | undefined;
limit: number;
}
export default defineComponent({
name: 'ServiceList',
components: {
Pagination,
ElRow,
ElCol,
ElButton,
ElCard,
ElSkeleton,
ElImage,
ElSkeletonItem,
ServicePrice
},
data(): IData {
return {
services: [],
loading: true,
total: undefined,
limit: 8
};
},
computed: {
page() {
return parseInt(this.$route.query.page?.toString() || '1');
}
},
watch: {
page: {
handler() {
this.onFetchData();
}
}
},
async mounted() {
this.onFetchData();
},
methods: {
onApply() {
window.scrollTo({
top: document.getElementById('services')?.offsetTop,
left: 0,
behavior: 'smooth'
});
},
onPageChange(page: number) {
this.$router.push({
name: this.$route.name?.toString(),
query: {
page: page
}
});
},
onFetchData() {
this.loading = true;
console.debug('start to load all services');
serviceOperator
.getAll({
limit: this.limit,
offset: (this.page - 1) * this.limit,
ordering: 'rank',
private: false
})
.then(({ data: data }: { data: IServiceListResponse }) => {
this.services = data.items;
this.total = data.count;
this.loading = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.banner {
// display: none;
height: calc(100vh - 60px);
background-color: #111827;
width: 100%;
background-image: url('https://zhishuyun-1256437459.cos.ap-beijing.myqcloud.com/background-lines.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;
@media (min-width: 1400px) {
.services {
width: 1300px;
margin: auto !important;
}
}
.services {
padding: 50px 0;
.service {
$hover-offset: 50px;
width: 100%;
height: 250px;
margin-bottom: 15px;
border-radius: 30px !important;
position: relative;
transition: all $transition-duration;
.icon-placeholder {
display: flex;
width: 80px;
height: 80px;
margin: 0 auto 15px auto;
text-align: center;
}
.title-placeholder {
display: block;
width: 80px;
height: 20px;
margin: 0 auto 10px auto;
}
.price-placeholder {
display: block;
width: 100px;
height: 16px;
margin: 0 auto 10px auto;
}
.icon {
font-size: 60px;
text-align: center;
}
.thumb {
position: relative;
text-align: center;
width: 100%;
height: 150px;
top: 0px;
opacity: 1;
transition: all $transition-duration;
}
.title {
color: #666;
font-size: 16px;
text-align: center;
margin-top: 10px;
margin-bottom: 8px;
padding: 0 20px;
font-weight: bold;
transition: all $transition-duration;
position: relative;
top: 0;
}
.price {
position: relative;
top: 0;
font-size: 16px;
font-weight: bold;
text-align: center;
margin: 0;
.unfree {
color: #ff5441;
}
.free {
color: #29c287;
}
transition: all $transition-duration;
}
.description {
padding: 5px 15px;
text-align: center;
margin: 0 auto;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
color: #9f9f9f;
font-size: 12px;
opacity: 0;
position: absolute;
bottom: 30px;
word-break: break-all;
transition: all $transition-duration;
text-overflow: ellipsis;
height: 42px;
}
&:hover {
.thumb {
top: -$hover-offset;
opacity: 0.5;
}
.title {
top: -$hover-offset;
}
.price {
top: -$hover-offset;
}
.description {
opacity: 1;
}
.operations {
opacity: 1;
}
}
}
}
.pagination {
padding-bottom: 50px;
float: right;
}
</style>