emojigen wip25
This commit is contained in:
parent
04c7dcd201
commit
522e148146
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
|
||||
<FormSuspense :p="init">
|
||||
<div class="_formRoot">
|
||||
<FormInput v-model="emojiName" class="_formBlock">
|
||||
<template #label>{{ $ts.emojiName }}</template>
|
||||
@ -39,7 +38,7 @@
|
||||
</FormRadios>
|
||||
|
||||
<FormFolder :default-open="true" class="_formBlock">
|
||||
<template #label>{{ i18n.ts.accentColor }}</template>
|
||||
<template #label>{{ $ts.accentColor }}</template>
|
||||
<div class="cwepdizn-colors">
|
||||
<div class="row">
|
||||
<button v-for="color in accentColors" :key="color" class="color rounded _button" @click="setAccentColor(color)">
|
||||
@ -65,9 +64,7 @@
|
||||
<p>{{ emojiUrl }}</p>
|
||||
</FormSection>
|
||||
<FormButton primary class="_formBlock" @click="emojiApproval">{{ $ts.emojiApproval }}</FormButton>
|
||||
|
||||
</div>
|
||||
</FormSuspense>
|
||||
</MkSpacer>
|
||||
</template>
|
||||
|
||||
@ -79,6 +76,7 @@ import FormTextarea from '@/components/form/textarea.vue';
|
||||
import FormRadios from '@/components/form/radios.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import FormButton from '@/components/ui/button.vue';
|
||||
import FormFolder from '@/components/form/folder.vue';
|
||||
import * as os from '@/os';
|
||||
import * as symbols from '@/symbols';
|
||||
import {defaultStore} from "@/store";
|
||||
@ -92,7 +90,8 @@ export default defineComponent({
|
||||
FormRadios,
|
||||
FormSection,
|
||||
FormSwitch,
|
||||
FormButton
|
||||
FormButton,
|
||||
FormFolder
|
||||
},
|
||||
|
||||
emits: ['info'],
|
||||
@ -134,15 +133,6 @@ export default defineComponent({
|
||||
|
||||
emojiApproval: function () {
|
||||
|
||||
// const returnKoke = () => new Promise(resolve => {
|
||||
// setTimeout(() => {
|
||||
// resolve("Koke")
|
||||
// }, 5000)
|
||||
// })
|
||||
|
||||
//const strKoke = await returnKoke()
|
||||
|
||||
|
||||
//emojiUploadでは、絵文字をdrive/files/upload-from-urlでアップロードしたあと、emojiAddでリネーム、登録をして、emojiAddの戻り値(絵文字のid)を返す
|
||||
const emojiUpload = () => new Promise(async resolve => {
|
||||
const marker = Math.random().toString(); // TODO: UUIDとか使う
|
||||
@ -176,11 +166,10 @@ export default defineComponent({
|
||||
|
||||
resolve(response);
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
//emoji関数 admin/emoji/listでは、idによる検索ができないため、自分のidをuntilIdに入れて1つ前のidを取得してからそれをsinceIdに指定して、絵文字情報をlist→objectで取得する
|
||||
const emoji = (emojiId) => new Promise(async resolve => {
|
||||
const emoji = (emojiId) => new Promise<Record<string, any> | null>(async resolve => {
|
||||
const sinceId = await os.api('admin/emoji/list', {
|
||||
limit: 1,
|
||||
untilId: emojiId.id
|
||||
@ -215,9 +204,7 @@ export default defineComponent({
|
||||
(async () => {
|
||||
await this.emojiGenerate()
|
||||
const emojiId = await emojiUpload();//emojiIdはファイルID emojiUploadはファイルIDを返す
|
||||
//console.log(emojiId.id);
|
||||
const emojiObj = emoji(emojiId);//emojiObjはemojiオブジェクト emoji関数はemojiIdを引数に受け取りemojiオブジェクトを返す
|
||||
console.log(emojiObj);
|
||||
const emojiObj = await emoji(emojiId);//emojiObjはemojiオブジェクト emoji関数はemojiIdを引数に受け取りemojiオブジェクトを返す
|
||||
edit(emojiObj);
|
||||
})();
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user