Commit dd2b2aa0 authored by chenqikuai's avatar chenqikuai

s

parent f8ccb71b
......@@ -210,8 +210,7 @@ export default Vue.extend({
(item: any) => item.value === selected
) as any;
console.log(item, selected);
return item.name;
return item && item.name
},
},
computed: {
......
......@@ -27,7 +27,10 @@ export class NFTService extends Service {
getMd5: { path: '/nft/file/md5', dataType: 'multipart/form-data' },
save: { path: '/nft/save', dataType: 'multipart/form-data' },
publish: { path: '/nft/publish', dataType: 'application/json' },
getCategory:{path:'/category/list',dataType:'application/x-www-form-urlencoded'}
getCategory: {
path: '/category/list',
dataType: 'application/x-www-form-urlencoded',
},
}
auth = 'Bearer ' + token.getToken()
constructor() {
......@@ -59,10 +62,9 @@ export class NFTService extends Service {
},
})
}
async getCategory():Promise<any[]>{
return await this.service.get(this.router.getCategory.path)
}
async getCategory(): Promise<any[]> {
return await this.service.get(this.router.getCategory.path)
}
/**
* 获取我的NFT列表
......@@ -157,7 +159,7 @@ export class NFTService extends Service {
return await this.service.post(this.router.publish.path, obj, {
headers: {
Authorization: this.auth,
'Content-Type': this.router.getMd5.dataType,
'Content-Type': this.router.publish.dataType,
},
})
}
......
......@@ -34,6 +34,14 @@
class="text-font-white my-3"
@onClick="what"
></app-cell>
<!-- <app-cell
text="分类"
type="select"
:selected="createNFT.categoryType"
:list="categoryTypes2"
class="text-font-white my-3"
@cellOnChange="(v) => (createNFT.categoryType = v)"
></app-cell> -->
<div>
<div class="text-font-white my-2">剧本简介</div>
<textarea
......@@ -177,6 +185,7 @@ export default Vue.extend({
value_des: "",
archives: 0,
grant: 0,
categoryType: NaN,
},
publish: {
nftId: "",
......@@ -193,6 +202,7 @@ export default Vue.extend({
{ value: 0, name: "不需要授权" },
{ value: 1, name: "需要授权" },
],
categoryTypes: [] as any[],
mySteps: [
{
text: "step1",
......@@ -213,6 +223,11 @@ export default Vue.extend({
"app-cell": () => import("@/components/common/Cell.vue"),
"app-btn": () => import("@/components/common/Btn.vue"),
},
async mounted() {
const list = await this.$service.nftService.getCategory();
this.categoryTypes = list;
this.createNFT.categoryType = (list.length !== 0 && list[0].id) || NaN;
},
computed: {
...mapState("create", {
fileHash: "fileHash",
......@@ -240,6 +255,14 @@ export default Vue.extend({
}
return disabled;
},
categoryTypes2(): any[] {
return this.categoryTypes.map((item: any) => {
return {
name: item.categoryName,
value: item.id,
};
});
},
},
methods: {
setCreateNFT(obj: any) {
......@@ -295,6 +318,7 @@ export default Vue.extend({
wallet: this.publish.wallet,
nftId: this.publish.nftId,
});
this.$router.back()
}
if (this.currentStep < this.mySteps.length + 1) {
this.currentStep += val;
......
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