Quellcode durchsuchen

Merge branch 'master' of http://git.izouma.com/xiongzhu/9th

xuqiang vor 4 Jahren
Ursprung
Commit
25f7e341ea

+ 1 - 1
src/main/java/com/izouma/nineth/web/UserController.java

@@ -80,7 +80,7 @@ public class UserController extends BaseController {
     //    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/all")
     public Page<UserDTO> all(@RequestBody PageQuery pageQuery) {
-        if (!SecurityUtils.getAuthenticatedUser().isAdmin()) {
+        if (!(SecurityUtils.getAuthenticatedUser() != null && SecurityUtils.getAuthenticatedUser().isAdmin())) {
             pageQuery.getQuery().put("hasRole", "ROLE_MINTER");
         }
         return userService.toDTO(userService.all(pageQuery));

+ 18 - 14
src/main/pc-space/public/index.html

@@ -1,17 +1,21 @@
 <!DOCTYPE html>
 <html lang="">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= htmlWebpackPlugin.options.title %></title>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
+    <head>
+        <meta charset="utf-8" />
+        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+        <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+        <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
+        <title><%= htmlWebpackPlugin.options.title %></title>
+        <link rel="stylesheet" href="https://at.alicdn.com/t/font_2852142_34ed1mq1h33.css" />
+    </head>
+    <body>
+        <noscript>
+            <strong
+                >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript
+                enabled. Please enable it to continue.</strong
+            >
+        </noscript>
+        <div id="app"></div>
+        <!-- built files will be auto injected -->
+    </body>
 </html>

+ 28 - 0
src/main/pc-space/src/mixins/asset.js

@@ -0,0 +1,28 @@
+export default {
+    data() {
+        return {
+            assetStatusOptions: [
+                {
+                    label: '仅展示',
+                    value: 'NORMAL'
+                },
+                {
+                    label: '出售中',
+                    value: 'ON_SALE'
+                },
+                {
+                    label: '盲盒中',
+                    value: 'IN_BLIND_BOX'
+                },
+                {
+                    label: '转让中',
+                    value: 'TRANSFERRING'
+                },
+                {
+                    label: '已转让',
+                    value: 'TRANSFERRED'
+                }
+            ]
+        };
+    }
+};

+ 44 - 0
src/main/pc-space/src/mixins/collect.js

@@ -0,0 +1,44 @@
+export default {
+    data() {
+        return {
+            typeOptions: [
+                {
+                    label: '精选推荐',
+                    value: ''
+                },
+                {
+                    label: '原创系列',
+                    value: 'DEFAULT'
+                },
+                {
+                    label: '数字盲盒',
+                    value: 'BLIND_BOX'
+                },
+                {
+                    label: '拍卖系列',
+                    value: 'AUCTION'
+                }
+            ],
+            picsTypes: [
+                {
+                    label: '视频',
+                    value: 'video/mp4'
+                }
+            ]
+        };
+    },
+    methods: {
+        changeImgs(list = []) {
+            return list.map(item => {
+                if (item.type === 'video/mp4') {
+                    return item.thumb;
+                } else {
+                    return item.url;
+                }
+            });
+        },
+        isVideo(info = {}) {
+            return info.type === 'video/mp4';
+        }
+    }
+};

+ 91 - 45
src/main/pc-space/src/mixins/common.js

@@ -1,63 +1,109 @@
-// import dayjs from 'dayjs';
-// import { checkSetting } from '../utils/getVariables.js'
+import http from '../plugins/http';
 export default {
     computed: {
         isLogin() {
             return !!this.$store.state.userInfo;
+        },
+        authStatus() {
+            let status = this.$store.state.userInfo?.authStatus;
+
+            return this.AuthStatus.has(status) ? this.AuthStatus.get(status) : '未认证';
         }
     },
+    data() {
+        return {
+            AuthStatus: new Map([
+                ['NOT_AUTH', '未认证'],
+                ['PENDING', '认证中'],
+                ['SUCCESS', '已认证'],
+                ['FAIL', '认证失败']
+            ])
+        };
+    },
     methods: {
-        getLabelName(val = '', list = []) {
-            let info = list.find(item => {
-                return item.value === val;
+        updateUser(info, sucess = true) {
+            if (info) {
+                return this.$http
+                    .post(
+                        '/user/save',
+                        {
+                            ...this.$store.state.userInfo,
+                            ...info
+                        },
+                        {
+                            body: 'json'
+                        }
+                    )
+                    .then(() => {
+                        return this.$store.dispatch('getUserInfo');
+                    })
+                    .then(() => {
+                        if (sucess) {
+                            this.$toast.success('更新成功');
+                        }
+                        return Promise.resolve();
+                    })
+                    .catch(e => {
+                        if (e) {
+                            this.$toast(e.error);
+                        }
+                        return Promise.reject();
+                    });
+            }
+        },
+        updateFile(e) {
+            const formData = new FormData();
+            formData.append('file', e.file, e.file.name);
+            return http.axios.post('/upload/file', formData).then(res => {
+                return Promise.resolve(res.data);
             });
-
-            return info ? info.label : val;
         },
-        showList(list = [], tag = ',') {
-            if (!list) {
+        getImg(imgs = '', type = '') {
+            if (!imgs) {
+                imgs = '';
+            }
+            if (!(imgs instanceof Array)) {
+                imgs = imgs.split(',');
+            }
+
+            imgs = imgs.filter(item => {
+                return !!item;
+            });
+            if (imgs.length > 0) {
+                let img = type ? imgs[0][type] : imgs[0];
+                return img + (/\.gif$/i.test(img) ? '' : '?x-oss-process=image/resize,h_300,m_lfit');
+            } else {
                 return '';
+            }
+        },
+        checkLogin() {
+            if (this.isLogin) {
+                return Promise.resolve();
             } else {
-                if (!(list instanceof Array)) {
-                    list = list.split(',');
-                }
-                return list.join(tag);
+                this.$dialog
+                    .confirm({
+                        title: '提示',
+                        message: '用户未登录,是否立即登录',
+                        confirmButtonText: '立即登录'
+                    })
+                    .then(() => {
+                        this.$router.push('/login');
+                    });
+                return Promise.reject();
             }
         },
-        sendCode(phone) {
-            this.sending = true;
-            this.$http
-                .get('/sms/sendVerify', {
-                    phone: phone
-                })
-                .then(() => {
-                    this.sending = false;
-                    this.checkTime();
-                })
-                .catch(e => {
-                    this.sending = false;
-                    this.$message.error(e.error);
-                });
+        getLabelName(val = '', list = []) {
+            let info = list.find(item => {
+                return item.value === val;
+            });
+
+            return info ? info.label : '';
         },
-        checkTime() {
-            this.time = 60;
-            let i = setInterval(() => {
-                this.time--;
-                if (this.time === 0) {
-                    clearInterval(i);
-                }
-            }, 1000);
+        scrollRefreash() {
+            this.$toast.clear();
         },
-        pdCode(phone, code) {
-            this.$http
-                .get('/sms/verify', {
-                    phone: phone,
-                    code: code
-                })
-                .then(() => {})
-                .catch(e => {
-                    this.$message.error(e.error);
-                });
+        wait() {
+            this.$toast('敬请期待');
         }
     }
 };

+ 40 - 0
src/main/pc-space/src/mixins/list.js

@@ -0,0 +1,40 @@
+export default {
+    data() {
+        return {
+            empty: false,
+            loading: false,
+            finished: false,
+            page: 0
+        };
+    },
+    methods: {
+        getData(isFirst = false) {
+            if (isFirst) {
+                this.page = 0;
+                this.list = [];
+                this.$root.$el.scrollTop = 0;
+            }
+
+            this.loading = true;
+            this.finished = false;
+            this.empty = false;
+            let data = { page: this.page, size: 20, sort: 'createdAt,desc' };
+            if (this.beforeData) {
+                data = {
+                    ...data,
+                    ...this.beforeData()
+                };
+            }
+
+            this.$http.post(this.url, data, { body: 'json' }).then(res => {
+                this.list = [...this.list, ...res.content];
+                this.empty = res.empty;
+                this.loading = false;
+                this.finished = res.last;
+                if (!this.finished) {
+                    this.page = this.page + 1;
+                }
+            });
+        }
+    }
+};

+ 16 - 0
src/main/pc-space/src/mixins/order.js

@@ -0,0 +1,16 @@
+export default {
+    data() {
+        return {
+            statusOptions: [
+                { label: '未支付', value: 'NOT_PAID' },
+                { label: '交易中', value: 'PROCESSING' },
+                { label: '已完成', value: 'FINISH' },
+                { label: '已取消', value: 'CANCELLED' }
+            ],
+            payMethodOptions: [
+                { label: '微信', value: 'WEIXIN' },
+                { label: '支付宝', value: 'ALIPAY' }
+            ]
+        };
+    }
+};

+ 77 - 0
src/main/pc-space/src/mixins/phone.js

@@ -0,0 +1,77 @@
+//手机号码相关
+export default {
+    data() {
+        return {
+            phonePattern: /^[1][3,4,5,7,8,9][0-9]{9}$/,
+            isSend: false,
+            msgCode: '',
+            sendNum: 60,
+            timer: null
+        };
+    },
+    methods: {
+        sendMsg(phone) {
+            this.isSend = true;
+            this.setTime(60);
+            this.$http
+                .get('/sms/sendVerify', {
+                    phone: phone
+                })
+                .then(res => {
+                    this.msgCode = res;
+                    this.$toast.success('发送成功');
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$toast(e.error);
+                    }
+                    this.setTime(0);
+                });
+        },
+        setTime(num) {
+            this.sendNum = num;
+            if (this.timer) {
+                clearTimeout(this.timer);
+            }
+
+            if (num <= 0) {
+                this.isSend = false;
+                return;
+            } else {
+                this.timer = setTimeout(() => {
+                    this.setTime(num - 1);
+                }, 1000);
+            }
+        },
+        verifyMsg(phone, code) {
+            return this.$http
+                .get('/sms/verify', {
+                    phone: phone,
+                    code: code
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$toast(e.error);
+                    }
+                    return Promise.reject();
+                });
+        },
+        loginByPhone(phone, psd) {
+            return this.$http
+                .post('/auth/phonePwdLogin', {
+                    phone: phone,
+                    password: psd
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$toast(e.error);
+                    }
+                    return Promise.reject();
+                })
+                .then(res => {
+                    localStorage.setItem('nineToken', res);
+                    return this.$store.dispatch('getUserInfo');
+                });
+        }
+    }
+};

+ 1 - 1
src/main/pc-space/src/plugins/http.js

@@ -4,7 +4,7 @@ import qs from 'qs';
 let baseUrl = 'http://localhost:8080';
 switch (process.env.NODE_ENV) {
     case 'development':
-        baseUrl = 'http://zhirongip.izouma.com';
+        baseUrl = 'https://nft.9space.vip';
         // baseUrl = 'http://192.168.50.190:8080';
         // baseUrl = 'http://localhost:8080';
         // baseUrl = 'http://192.168.50.190:8080';

+ 10 - 2
src/main/pc-space/src/styles/common.less

@@ -1,7 +1,7 @@
 @warn: #00684f;
 @success: #07c160;
 @danger: #ea2d2d;
-@prim: #ff8700;
+@prim: #00ffcb;
 @info: #939599;
 @text0: #181818;
 @text1: #323233;
@@ -129,6 +129,7 @@
     padding: 1px;
     border-radius: @radius;
     overflow: hidden;
+    cursor: pointer;
 
     &::before {
         position: absolute;
@@ -151,11 +152,18 @@
         top: 0;
         background-image: linear-gradient(135deg, rgba(0, 255, 203, 1), rgba(0, 110, 255, 1));
         transform-origin: center center;
-        animation: spin ease-in-out 2s infinite;
+        animation: spin ease-in-out 3s;
+        animation-iteration-count: 0;
     }
 
     * {
         z-index: 3;
         position: relative;
     }
+
+    &:hover {
+        &::after {
+            animation-iteration-count: infinite;
+        }
+    }
 }

+ 14 - 3
src/main/pc-space/src/styles/font.less

@@ -1,4 +1,15 @@
 @font-face {
-    font-family: 'Impact';
-    src: url(https://zhirongip.oss-cn-hangzhou.aliyuncs.com/fonts/impact.ttf);
-}
+    font-family: 'ZhenyanGB';
+    src: url(https://zhirongip.oss-cn-hangzhou.aliyuncs.com/fonts/RuiZiZhenYanTiMianFeiShangYong-2.ttf);
+  }
+  
+  @font-face {
+    font-family: 'OSP';
+    src: url(https://zhirongip.oss-cn-hangzhou.aliyuncs.com/fonts/OSP-DIN.ttf);
+  }
+  
+  @font-face {
+    font-family: 'DIN';
+    src: url(http://zhirongip.oss-cn-hangzhou.aliyuncs.com/fonts/OSP-DIN.ttf);
+  }
+ 

+ 97 - 13
src/main/pc-space/src/views/Casting.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="container">
         <div class="title">游戏数字资产的链上开创者们</div>
-        <div class="tabs">
+        <!-- <div class="tabs">
             <div
                 class="tab"
                 :class="{ active: active === item }"
@@ -11,9 +11,19 @@
             >
                 {{ item }}
             </div>
-        </div>
-        <div class="border"></div>
-        <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
+        </div> -->
+        <el-radio-group v-model="sort" size="normal">
+            <el-radio-button v-for="(item, index) in sortList" :key="index" :label="item.value">
+                <div class="radio-item">
+                    <i class="font_family" :class="[item.icon]"></i>
+                    <span>{{ item.label }}</span>
+                </div>
+            </el-radio-button>
+        </el-radio-group>
+
+        <div class="border" style="margin-top: 30px"></div>
+        <el-input prefix-icon="el-icon-search" placeholder="请输入您想找到的作者名称…" v-model="search" clearable>
+        </el-input>
         <div class="content">
             <img class="imgBox" src="../assets/img/888.jpg" alt="" />
             <img class="img" src="../assets/img/888.jpg" alt="" />
@@ -26,7 +36,7 @@
                 <img class="img1 img2" src="../assets/img/copy_icon@3x.png" alt="" />
             </div>
             <div class="introduce">
-                介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍...
+                介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍
             </div>
             <div class="border"></div>
             <div class="fans">
@@ -40,17 +50,43 @@
     </div>
 </template>
 <script>
+import pageableTable from '../mixins/pageableTable';
 export default {
     data() {
         return {
-            tabs: ['全部', '最新', '人气', '关注'],
-            active: '全部',
-            input: ''
+            sortList: [
+                {
+                    label: '全部',
+                    icon: 'icon-icon-quanbu',
+                    value: 'id,desc'
+                },
+                {
+                    label: '最新',
+                    icon: 'icon-icon-zuixin',
+                    value: 'createdAt,desc'
+                },
+                {
+                    label: '人气',
+                    icon: 'icon-icon-renqi',
+                    value: 'sales,desc'
+                },
+                {
+                    label: '关注',
+                    icon: 'icon-icon-guanzhu',
+                    value: 'followers,desc'
+                }
+            ],
+            search: '',
+            url: '/user/all'
         };
     },
+    mixins: [pageableTable],
     methods: {
         tab(item) {
             this.active = item;
+        },
+        beforeGetData() {
+            return { search: this.search, query: { hasRole: 'ROLE_MINTER' } };
         }
     }
 };
@@ -59,22 +95,30 @@ export default {
 .container {
     padding: 0 200px;
     background: #1a1a1a;
-    /deep/ .el-input__inner {
+    /deep/.el-input {
         background: #1a1a1a;
         width: 280px;
         height: 42px;
-        color: #fff;
         border-radius: 8px;
-        border: 1px solid #898989;
         margin: 30px 0 50px;
+
+        .el-input__inner {
+            border: 1px solid #898989;
+            background-color: transparent;
+            color: #fff;
+            border-radius: 8px;
+            &:focus {
+                border-color: #fff;
+            }
+        }
     }
     .title {
         height: 42px;
         font-size: 32px;
-        font-weight: 400;
         color: #ffffff;
         line-height: 42px;
         padding: 60px 0;
+        font-family: ZhenyanGB;
     }
     .tabs {
         display: flex;
@@ -109,7 +153,9 @@ export default {
     .content {
         width: 276px;
         height: 416px;
+        // height: 416px;
         .line();
+
         margin-bottom: 32px;
         position: relative;
         .imgBox {
@@ -157,12 +203,13 @@ export default {
             }
         }
         .introduce {
-            padding: 10px 16px 16px;
+            margin: 10px 16px 16px;
             height: 60px;
             font-size: 14px;
             font-weight: 400;
             color: #939599;
             line-height: 20px;
+            .ellipsis-line(3);
         }
         .fans {
             display: flex;
@@ -197,4 +244,41 @@ export default {
         }
     }
 }
+
+/deep/.el-radio-group {
+    .el-radio-button__inner {
+        border-color: #949699;
+        background-color: transparent;
+        color: #949699;
+        width: 140px;
+    }
+    .el-radio-button__orig-radio:checked + .el-radio-button__inner {
+        background: linear-gradient(46deg, #00ffcb 0%, #006eff 100%);
+        color: #fff;
+        border-color: #fff;
+    }
+    .el-radio-button {
+        &:last-child {
+            .el-radio-button__inner {
+                border-radius: 0 8px 8px 0;
+            }
+        }
+        &:first-child {
+            .el-radio-button__inner {
+                border-radius: 8px 0 0 8px;
+            }
+        }
+    }
+}
+
+.radio-item {
+    .flex();
+    justify-content: center;
+    font-size: 16px;
+
+    .font_family {
+        font-size: 20px;
+        margin-right: 6px;
+    }
+}
 </style>