|
@@ -78,16 +78,17 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { onMounted, ref } from 'vue'
|
|
|
+import { onMounted, ref, nextTick } from 'vue'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import Api from '../../static/http/api';
|
|
|
import { postRequest } from '../../static/http'
|
|
|
-import { getStorage, storageKey, removeStorage } from '../../static/utils/storage'
|
|
|
+import { getStorage, setStorage, storageKey, removeStorage } from '../../static/utils/storage'
|
|
|
import { Report } from '../../static/report'
|
|
|
import { businessType, pageSource, objectType } from '../../static/report/enum'
|
|
|
|
|
|
const userInfo: any = ref({})
|
|
|
-
|
|
|
+const route = useRoute()
|
|
|
const publishType = ref(0)
|
|
|
const publishItem = ref(null)
|
|
|
const publishDialog = ref(false)
|
|
@@ -211,6 +212,7 @@ const getList = () => {
|
|
|
pageSize: pageSize
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log(333, res)
|
|
|
let { code, data } = res;
|
|
|
if (code === 0) {
|
|
|
pageList.value = data;
|
|
@@ -290,12 +292,9 @@ const confirmPublishLayer = () => {
|
|
|
}).then(res => {
|
|
|
let { code, msg } = res;
|
|
|
if ( code === 0 ) {
|
|
|
- pageList.value.some((row) => {
|
|
|
- if (row.nftProjectId === item.nftProjectId) {
|
|
|
- row.publishStatus = status;
|
|
|
- return true;
|
|
|
- }
|
|
|
- })
|
|
|
+ // list
|
|
|
+ getList()
|
|
|
+
|
|
|
ElMessage({
|
|
|
type: 'success',
|
|
|
message: publishType.value === 1 ? 'Published Successfully!' : 'We have listed your NFT collection!',
|
|
@@ -318,10 +317,17 @@ const confirmPublishLayer = () => {
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
- ElMessage({
|
|
|
- type: 'error',
|
|
|
- message: msg
|
|
|
- })
|
|
|
+ if (code === 5004) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: `You can list at most one NFT collection, unlist one collection to list another.`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: msg
|
|
|
+ })
|
|
|
+ }
|
|
|
if (publishType.value === 1) {
|
|
|
// Report
|
|
|
Report({
|
|
@@ -345,19 +351,31 @@ const confirmPublishLayer = () => {
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- userInfo.value = getStorage(storageKey.userInfo);
|
|
|
- // 获取列表
|
|
|
- getList()
|
|
|
- // Report
|
|
|
- Report({
|
|
|
- baseInfo: {
|
|
|
- pageSource: pageSource.managerPage,
|
|
|
- },
|
|
|
- params: {
|
|
|
- eventData: {
|
|
|
- businessType: businessType.pageView,
|
|
|
+ // jump login
|
|
|
+ let str = route.query && route.query.params || ''
|
|
|
+ if (str) {
|
|
|
+ // @ts-ignore
|
|
|
+ let params = JSON.parse(atob(str));
|
|
|
+ setStorage(storageKey.userInfo, params)
|
|
|
+ userInfo.value = params;
|
|
|
+ } else {
|
|
|
+ userInfo.value = getStorage(storageKey.userInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ nextTick(() => {
|
|
|
+ // 获取列表
|
|
|
+ getList()
|
|
|
+ // Report
|
|
|
+ Report({
|
|
|
+ baseInfo: {
|
|
|
+ pageSource: pageSource.managerPage,
|
|
|
+ },
|
|
|
+ params: {
|
|
|
+ eventData: {
|
|
|
+ businessType: businessType.pageView,
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
</script>
|