Commit 6e5b5a53 authored by hanfeng zhang's avatar hanfeng zhang

321

parent 0b9b6b47
NODE_ENV = DEVELOPMENT
VUE_APP_ENV = DEVELOPMENT
VUE_APP_TITLE=开发版本
VUE_APP_URL = http://172.16.101.135:8001
\ No newline at end of file
NODE_ENV = TEST
VUE_APP_ENV = TEST
VUE_APP_TITLE=测试版本
VUE_APP_URL = http://172.16.101.136:8001
\ No newline at end of file
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build": "vue-cli-service build", "test":"vue-cli-service serve --mode test",
"lint": "vue-cli-service lint" "deploy:test":"vue-cli-service build --mode test && bash ./test_deploy.sh",
"build": "vue-cli-service build"
}, },
"dependencies": { "dependencies": {
"@tailwindcss/line-clamp": "^0.2.1", "@tailwindcss/line-clamp": "^0.2.1",
...@@ -43,6 +44,8 @@ ...@@ -43,6 +44,8 @@
"postcss": "^7.0.36", "postcss": "^7.0.36",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.4", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.4",
"typescript": "~4.1.5", "typescript": "~4.1.5",
"vue-template-compiler": "^2.6.11" "vue-template-compiler": "^2.6.11",
"terser-webpack-plugin": "^4.2.3",
"compression-webpack-plugin": "^1.1.11"
} }
} }
...@@ -54,7 +54,6 @@ export default Vue.extend({ ...@@ -54,7 +54,6 @@ export default Vue.extend({
name: "App", name: "App",
mounted() { mounted() {
// this.$service.userService.isPwdSet('13013370014')
this.routerController(); this.routerController();
}, },
methods: { methods: {
......
<template> <template>
<div class="list-container font-light"> <div class="list-container font-light">
<div class="list-row flex justify-between relative text-font-white text-sm mb-3" v-for="(i,index) in outputData" :key="index"> <div class="list-row flex justify-start relative text-font-white text-sm mb-3" v-for="(i,index) in outputData" :key="index" :id="i.id">
<div class='item flex flex-col w-4/12 items-center z-10' v-for="(k,kindex) in i" :key="kindex"> <div class='item flex flex-col w-4/12 items-center z-10' v-for="(k,kindex) in i" :key="kindex">
<div class='w-full '> <div class='w-full '>
<img :src='k.cover' class=" w-11/12 mx-auto rounded-xl shadow-md"> <img src='/img/cover.png' class=" w-11/12 mx-auto rounded-xl shadow-md">
</div> </div>
<div class='mt-3'> <div class='mt-3'>
{{k.text}} {{k.name}}
</div> </div>
</div> </div>
<div class='absolute bottom-6 z-0 w-full '> <div class='absolute bottom-6 z-0 w-full '>
......
...@@ -16,18 +16,23 @@ ...@@ -16,18 +16,23 @@
</div> </div>
<div class="right w-8/12"> <div class="right w-8/12">
<div class="w-full px-4"> <div class="w-full px-4">
<div class=" text-lg">飙车大师</div> <div class=" text-lg">{{mydata.name}}</div>
<div class="flex flex-wrap w-full mt-1 text-sm">
<div class="mt-8">
<div class="text-font-dark-blue">NFT编号</div>
<p class=" break-words line-clamp-2 w-full text-2xs ">
{{mydata.nftId}}
</p>
</div>
<div class="flex flex-wrap w-full mt-1 text-sm mt-3">
<div class="text-font-dark-blue">题材</div> <div class="text-font-dark-blue">题材</div>
<div class="flex px-3 gap-x-2"> <div class="flex px-3 gap-x-2" v-for='(i,index) in getThemeList' :key="index">
<span>谍战</span> <span>{{i}}</span>
<span>穿越</span>
<span>奇幻</span>
</div> </div>
</div> </div>
<p class=" break-words line-clamp-2 mt-8 w-full text-sm text-font-dark-blue">
sdfkjsdlkfjsdlkfsadfsdfsdfsdfsdfsdfsdfsdfsdfsdfdsfdsfsdfsddsfasdfsdfsdf
</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,12 +40,26 @@ ...@@ -35,12 +40,26 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
import {MyNFTItem} from '@/types/Dto'
export default Vue.extend({ export default Vue.extend({
name: "CollectionCard", name: "CollectionCard",
props: { props: {
colletionData:{} colletionData:{}
}, },
data(){
return{
mydata:this.colletionData as MyNFTItem
}
},
computed:{
getThemeList():any[]{
if(this.mydata){
let i = this.mydata.theme.split(',')
return i
}
return []
}
}
}); });
</script> </script>
import axios, { AxiosInstance } from "axios" import axios, { AxiosInstance } from "axios"
const url = { // const url = {
development: 'http://172.16.101.135:8001', // development: 'http://172.16.101.135:8001',
test: '', // test: 'http://172.16.101.136:8001',
production: '' // production: ''
} // }
import { Toast } from "vant" import { Toast } from "vant"
export class Service { export class Service {
public service: AxiosInstance; public service: AxiosInstance;
constructor() { constructor() {
this.service = axios.create({ this.service = axios.create({
baseURL: process.env.NODE_ENV === 'production' ? url.production : url.development, baseURL:'/proxyApi',
timeout: 15000, timeout: 15000,
}) })
const get = this.service.get const get = this.service.get
......
...@@ -71,7 +71,7 @@ export class NFTService extends Service { ...@@ -71,7 +71,7 @@ export class NFTService extends Service {
* @param categoryId * @param categoryId
* @returns * @returns
*/ */
async getMyList(categoryId?: number) { async getMyList(categoryId?: number):Promise<any> {
return await this.service.get(this.router.getMyList.path, { return await this.service.get(this.router.getMyList.path, {
headers: { headers: {
Authorization: this.auth, Authorization: this.auth,
......
...@@ -67,7 +67,10 @@ body{ ...@@ -67,7 +67,10 @@ body{
height: calc(100vh - 400px); height: calc(100vh - 400px);
overflow-y: scroll; overflow-y: scroll;
} }
.myNFT-list-scroll{
height: calc(100vh - 290px);
overflow-y: scroll;
}
.van-dialog{ .van-dialog{
background-color: #1D2649; background-color: #1D2649;
......
...@@ -11,6 +11,14 @@ import { PRODUCT_STATUS } from '@/constant/product' ...@@ -11,6 +11,14 @@ import { PRODUCT_STATUS } from '@/constant/product'
// sent_at_second: number // sent_at_second: number
// } // }
export interface MyNFTItem{
category:string;
id:number;
name:string;
nftId:string;
theme:string;
}
export interface LoginDto { export interface LoginDto {
codetype: string codetype: string
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
<div class="container-view w-11/12 mx-auto"> <div class="container-view w-11/12 mx-auto">
<app-scrollbar :list='categoryTypes' @tabChange='getDataByCategory'></app-scrollbar> <app-scrollbar :list='categoryTypes' @tabChange='getDataByCategory'></app-scrollbar>
<div class="list-scroll"> <div class="list-scroll">
<app-cardList :data='mokeData'></app-cardList> <app-cardList :data='listData' v-if="listData.length"></app-cardList>
<van-empty image="error" description="没有找到更多内容" v-else/>
<div class="h-12"></div>
</div> </div>
</div> </div>
</Layout-Main> </Layout-Main>
...@@ -23,49 +25,13 @@ ...@@ -23,49 +25,13 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { Badge } from 'vant'; import { Badge } from 'vant';
const mokeData= [ import { Empty } from 'vant';
{
cover:'/img/cover.png', Vue.use(Empty);
text:'dslfjl'
},
{
cover:'/img/cover.png',
text:'123213'
},
{
cover:'/img/cover.png',
text:'kkk'
},
{
cover:'/img/cover.png',
text:'ertfr'
},
{
cover:'/img/cover.png',
text:'ertfr'
},
{
cover:'/img/cover.png',
text:'ertfr'
},
{
cover:'/img/cover.png',
text:'ertfr'
},
{
cover:'/img/cover.png',
text:'ertfr'
},
{
cover:'/img/cover.png',
text:'ertfr'
},
]
Vue.use(Badge) Vue.use(Badge)
export default Vue.extend({ export default Vue.extend({
data() { data() {
return{ return{
mokeData,
categoryTypes:[] as any[], categoryTypes:[] as any[],
currentCategory:1, currentCategory:1,
currentPage:1, currentPage:1,
...@@ -83,8 +49,8 @@ export default Vue.extend({ ...@@ -83,8 +49,8 @@ export default Vue.extend({
async created(){ async created(){
this.categoryTypes = await this.$service.nftService.getCategory() this.categoryTypes = await this.$service.nftService.getCategory()
}, },
mounted() { async mounted() {
this.listData = this.$service.nftService.getList(this.currentPage,this.pagesize) this.listData = await this.$service.nftService.getList(this.currentPage,this.pagesize,this.currentCategory)
}, },
methods:{ methods:{
search(){ search(){
...@@ -95,10 +61,9 @@ export default Vue.extend({ ...@@ -95,10 +61,9 @@ export default Vue.extend({
console.log(222); console.log(222);
}, },
async getDataByCategory(item:any){ async getDataByCategory(item:any){
console.log(11); console.log(item);
console.log(item.activeIndex);
this.currentCategory = item.activeIndex this.currentCategory = item.data.id
this.listData = await this.$service.nftService.getList(this.currentPage,this.pagesize,this.currentCategory) this.listData = await this.$service.nftService.getList(this.currentPage,this.pagesize,this.currentCategory)
} }
} }
......
...@@ -320,7 +320,7 @@ export default Vue.extend({ ...@@ -320,7 +320,7 @@ export default Vue.extend({
this.createNFT.archives, this.createNFT.archives,
this.createNFT.value_name, this.createNFT.value_name,
this.createNFT.value_des, this.createNFT.value_des,
this.pickedList.map((i: any) => i.id as string).toString(), this.pickedList.map((i: any) => i.text as string).toString(),
this.file, this.file,
this.createNFT.grant this.createNFT.grant
); );
......
<template> <template>
<Layout-Child class="page-scroll text-center"> <Layout-Child class="page-scroll text-center">
<div class="text-font-white mt-20 text-center mb-20">请上传剧本附件</div> <div class="text-font-white mt-20 text-center mb-20">请上传剧本附件</div>
...@@ -73,6 +74,7 @@ ...@@ -73,6 +74,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
/* eslint-disable */
import Vue from "vue"; import Vue from "vue";
import { Uploader, Loading } from "vant"; import { Uploader, Loading } from "vant";
import { mapMutations, mapState } from "vuex"; import { mapMutations, mapState } from "vuex";
......
...@@ -8,15 +8,14 @@ ...@@ -8,15 +8,14 @@
</div> </div>
<div class='flex items-end justify-between flex-wrap'> <div class='flex items-end justify-between flex-wrap'>
<div class=' text-3xl'>30</div> <div class=' text-3xl'>30</div>
<div>sidfhuoisdufsdjufosdfjosdi</div> <div class=' text-xs'>{{getUserInfo.wallet}}</div>
</div> </div>
</div> </div>
</div> </div>
<div class="container-view w-11/12 mx-auto"> <div class="container-view w-11/12 mx-auto">
<app-scrollbar :list='categoryTypes' @tabChange='getDataByCategory'></app-scrollbar> <app-scrollbar :list='categoryTypes' @tabChange='getDataByCategory'></app-scrollbar>
<div> <div class="myNFT-list-scroll">
<app-collectionCard></app-collectionCard> <app-collectionCard v-for="i in listData" :key="i.id" class="mt-3" :colletionData='i'></app-collectionCard>
</div> </div>
</div> </div>
</Layout-Child> </Layout-Child>
...@@ -30,20 +29,32 @@ export default Vue.extend({ ...@@ -30,20 +29,32 @@ export default Vue.extend({
return{ return{
categoryTypes:[] as any[], categoryTypes:[] as any[],
listData:{}, listData:{},
currentCategory:0 currentCategory:1
} }
}, },
async created(){ async created(){
this.categoryTypes = await this.$service.nftService.getCategory() this.categoryTypes = await this.$service.nftService.getCategory()
}, },
mounted() { async mounted() {
this.listData = this.$service.nftService.getMyList() await this.$service.nftService.getMyList(this.currentCategory).then(res=>{
this.listData = res.list
})
},
computed:{
getUserInfo(){
return this.$util.userMsg.getUserMsg()
}
}, },
methods: { methods: {
getDataByCategory(item:any){ async getDataByCategory(item:any){
console.log(item); this.currentCategory = item.data.id
await this.$service.nftService.getMyList(this.currentCategory).then(res=>{
this.listData = res.list
console.log(this.listData);
} })
},
}, },
components:{ components:{
'Layout-Child':()=>import('@/layout/Child.vue'), 'Layout-Child':()=>import('@/layout/Child.vue'),
......
const colors = require('tailwindcss/colors') const colors = require('tailwindcss/colors')
module.exports = { module.exports = {
purge: [], purge: [
'./src/**/*.html',
'./src/**/*.vue',
],
presets: [], presets: [],
darkMode: false, // or 'media' or 'class' darkMode: false, // or 'media' or 'class'
theme: { theme: {
......
tar -czf NFT_TEST.tar NFT_TEST
scp NFT_TEST.tar root@47.114.159.142:/usr/share/nginx/html/NFT_TEST.tar
rm -rf NFT_TEST.tar
ssh root@47.114.159.142 'cd /usr/share/nginx/html && rm -rf NFT_TEST && tar -xzf NFT_TEST.tar && rm -rf NFT_TEST.tar'
echo '👉 http://47.114.159.142/8983'
\ No newline at end of file
const CompressionWebpackPlugin = require("compression-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = { module.exports = {
// ...other vue-cli plugin options... // ...other vue-cli plugin options...
outputDir: 'NFT', outputDir: process.env.VUE_APP_ENV === 'TEST'?'NFT_TEST':'NFT',
css: { css: {
loaderOptions: { loaderOptions: {
less: { less: {
...@@ -11,34 +14,28 @@ module.exports = { ...@@ -11,34 +14,28 @@ module.exports = {
devServer: { devServer: {
proxy: { // 设置代理 proxy: { // 设置代理
'/proxyApi': { '/proxyApi': {
target: 'http://172.16.101.135:8001', target:process.env.VUE_APP_URL,
// target: 'http://' + "124.71.183.184:8093", // target: 'http://' + "124.71.183.184:8093",
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/proxyApi': '' '^/proxyApi': ''
} }
},
// '/proxyWs': {
// target: 'ws://' + "172.16.102.150:8091",
// // target: 'ws://' + "124.71.183.184:8093",
// changeOrigin: true,
// ws: true,
// pathRewrite: {
// '^/proxyWs': ''
// }
// },
// "/gyl_search": {
// target: appConfig.blockChainExplorerAddress,
// changeOrigin: true,
// pathRewrite: {
// "^/gyl_search": '',
// }
// },
// "/root": {
// target: appConfig.blockChainExplorerAddress,
// changeOrigin: true,
// },
} }
}
},
configureWebpack: {
optimization: {
minimize: process.env.VUE_APP_ENV === 'DEVELOPMENT'?false: true,
minimizer: [
new TerserPlugin({
sourceMap: false,
parallel: true,
}),
],
},
plugins: [
new CompressionWebpackPlugin(),
],
}, },
// pwa: { // pwa: {
// name: 'My App', // name: 'My App',
......
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