Commit 0bfe7b17 authored by chenqikuai's avatar chenqikuai

style:样式优化

parent 77986b1c
<template> <template>
<div class="text-xs px-3 py-2 text-center cursor-pointer rounded my-3 flex items-center justify-center" :class="disabled?'filter grayscale':'' " @click="eventEmit"> <div
{{text}} <slot name="icon-right"></slot> class="
text-xs
px-3
py-2
text-center
cursor-pointer
rounded
my-3
flex
items-center
justify-center
"
:class="[disabled ? 'filter grayscale' : '', loading ? ' opacity-75' : '']"
@click="eventEmit"
>
{{ text }} <slot name="icon-right"></slot>
<Loading type="spiner" size="16" class="ml-2" v-if="loading" />
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import { Loading } from "vant";
import Vue from "vue";
export default Vue.extend({ export default Vue.extend({
name: 'AppIcon', components: {
Loading,
},
name: "AppIcon",
props: { props: {
size: String, size: String,
disabled: { disabled: {
type:Boolean, type: Boolean,
default:false default: false,
}, },
text:{ text: {
type: String, type: String,
required: true required: true,
}, },
border:{ border: {
type: String, type: String,
default:'border border-app-dark-4' default: "border border-app-dark-4",
}
}, },
methods:{ loading: {
eventEmit(v:any){ type: Boolean,
if(this.disabled){ default: false,
return },
} },
this.$emit('btnClicked',v) methods: {
eventEmit(v: any) {
if (this.disabled || this.loading) {
return;
} }
this.$emit("btnClicked", v);
},
}, },
}); });
</script> </script>
...@@ -8,10 +8,16 @@ ...@@ -8,10 +8,16 @@
" "
> >
<div class="left flex items-center"> <div class="left flex items-center">
<app-icon v-if="labelIcon" :name="labelIcon" size="18px"></app-icon>
<div class="px-2"> <div class="px-2">
{{ text }} {{ text }}
</div> </div>
<app-icon
v-if="labelIcon"
:name="labelIcon"
color="#ED6F6F"
@click.native="$emit('clickIcon')"
size="18px"
></app-icon>
</div> </div>
<div class="right flex items-center overflow-hidden"> <div class="right flex items-center overflow-hidden">
<div v-if="type == 'click'" @click="eventEmit(type)"> <div v-if="type == 'click'" @click="eventEmit(type)">
...@@ -85,11 +91,7 @@ ...@@ -85,11 +91,7 @@
> >
{{ name }} {{ name }}
</div> </div>
<div <div :data-clipboard-text="name" ref="btn" @click="handleClickCopy">
:data-clipboard-text="name"
ref="btn"
@click="handleClickCopy"
>
<app-icon name="icon-fuzhi" size="18px"></app-icon> <app-icon name="icon-fuzhi" size="18px"></app-icon>
</div> </div>
</div> </div>
...@@ -206,7 +208,7 @@ export default Vue.extend({ ...@@ -206,7 +208,7 @@ export default Vue.extend({
(item: any) => item.value === selected (item: any) => item.value === selected
) as any; ) as any;
console.log(item, selected); console.log(item, selected);
return item && item.name return item && item.name;
}, },
}, },
computed: { computed: {
......
...@@ -89,6 +89,8 @@ ...@@ -89,6 +89,8 @@
text="平台存档" text="平台存档"
type="select" type="select"
:selected="createNFT.archives" :selected="createNFT.archives"
labelIcon="icon-wenhao"
@clickIcon="alertPlatformSave"
:list="archivesList" :list="archivesList"
class="text-font-white my-3" class="text-font-white my-3"
@cellOnChange="(v) => (createNFT.archives = v)" @cellOnChange="(v) => (createNFT.archives = v)"
...@@ -97,6 +99,8 @@ ...@@ -97,6 +99,8 @@
text="授权阅读" text="授权阅读"
type="select" type="select"
:selected="createNFT.grant" :selected="createNFT.grant"
labelIcon="icon-wenhao"
@clickIcon="alertAuthorizeRead"
:list="grantList" :list="grantList"
class="text-font-white my-3" class="text-font-white my-3"
@cellOnChange="(v) => (createNFT.grant = v)" @cellOnChange="(v) => (createNFT.grant = v)"
...@@ -112,6 +116,7 @@ ...@@ -112,6 +116,7 @@
text="下一步" text="下一步"
class="w-5/12 mx-auto text-font-white rounded-2xl bg-font-blue" class="w-5/12 mx-auto text-font-white rounded-2xl bg-font-blue"
:disabled="validation" :disabled="validation"
:loading="loading2"
border="none" border="none"
@btnClicked="currentStepChange(1)" @btnClicked="currentStepChange(1)"
></app-btn> ></app-btn>
...@@ -162,6 +167,7 @@ ...@@ -162,6 +167,7 @@
class="w-5/12 mx-auto text-font-white rounded-2xl bg-font-blue" class="w-5/12 mx-auto text-font-white rounded-2xl bg-font-blue"
border="none" border="none"
:disabled="validation" :disabled="validation"
:loading="loading3"
@btnClicked="currentStepChange(1)" @btnClicked="currentStepChange(1)"
></app-btn> ></app-btn>
</div> </div>
...@@ -171,6 +177,7 @@ ...@@ -171,6 +177,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Dialog } from "vant";
import Vue from "vue"; import Vue from "vue";
import { mapState } from "vuex"; import { mapState } from "vuex";
...@@ -205,16 +212,18 @@ export default Vue.extend({ ...@@ -205,16 +212,18 @@ export default Vue.extend({
categoryTypes: [] as any[], categoryTypes: [] as any[],
mySteps: [ mySteps: [
{ {
text: "step1", text: "基本信息",
}, },
{ {
text: "step2", text: "加密上链",
}, },
{ {
text: "step3", text: "NFT发行",
}, },
], ],
currentStep: 1, currentStep: 1,
loading2: false,
loading3: false,
}; };
}, },
components: { components: {
...@@ -271,6 +280,20 @@ export default Vue.extend({ ...@@ -271,6 +280,20 @@ export default Vue.extend({
...obj, ...obj,
}; };
}, },
alertPlatformSave() {
Dialog.alert({
title: "标题",
message: `1、选择加密存档后,您的剧本将由平台审核保管,您可以授权是否给其他人查看;
2、选择不存档后,您的剧本将由自己保管,您可以通过私下发送给其他用户查看;`,
});
},
alertAuthorizeRead() {
Dialog.alert({
title: "标题",
message: `1、选择作者授权阅读,剧本需要您本人授权后方可查看;
2、选择无需授权,剧本可公开阅读。`,
});
},
addStep() { addStep() {
this.currentStep++; this.currentStep++;
}, },
...@@ -288,6 +311,7 @@ export default Vue.extend({ ...@@ -288,6 +311,7 @@ export default Vue.extend({
}, },
async currentStepChange(val: number) { async currentStepChange(val: number) {
if (this.currentStep === 2 && val === 1) { if (this.currentStep === 2 && val === 1) {
this.loading2 = true;
let mistake = false; let mistake = false;
try { try {
const { id, nftId, wallet, fileHash } = const { id, nftId, wallet, fileHash } =
...@@ -308,17 +332,23 @@ export default Vue.extend({ ...@@ -308,17 +332,23 @@ export default Vue.extend({
this.publish.wallet = wallet; this.publish.wallet = wallet;
} catch (err) { } catch (err) {
mistake = true; mistake = true;
return;
} }
this.loading2 = false;
if (mistake) return; if (mistake) return;
} else if (this.currentStep === 3 && val === 1) { } else if (this.currentStep === 3 && val === 1) {
this.loading3 = true;
try {
await this.$service.nftService.publish({ await this.$service.nftService.publish({
fileHash: this.fileHash, fileHash: this.fileHash,
id: this.publish.id, id: this.publish.id,
wallet: this.publish.wallet, wallet: this.publish.wallet,
nftId: this.publish.nftId, nftId: this.publish.nftId,
}); });
this.$router.back() this.$router.back();
} catch (err) {
console.log(err);
}
this.loading3 = false;
} }
if (this.currentStep < this.mySteps.length + 1) { if (this.currentStep < this.mySteps.length + 1) {
this.currentStep += val; this.currentStep += val;
......
<template> <template>
<Layout-Child> <Layout-Child class='page-scroll'>
<div class="pt-6"> <div class="pt-6">
<div class="text-font-red text-sm text-center">*最多支持三个选项</div> <div class="text-font-red text-sm text-center">*最多支持三个选项</div>
<div class="grid grid-cols-3 w-11/12 mx-auto mt-6"> <div class="grid grid-cols-3 w-11/12 mx-auto mt-6">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment