Commit dd2b2aa0 authored by chenqikuai's avatar chenqikuai

s

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