panhui 4 anos atrás
pai
commit
dede654f1a

+ 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';

+ 4 - 3
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;
@@ -123,7 +123,7 @@
     }
 }
 
-.line(@bg:#1c1e26,@radius:6px,@color1:rgba(0, 255, 203, 1),@color2:rgba(0, 110, 255, 1)) {
+.line(@bg:#1c1e26,@infinite:true,@radius:6px,@color1:rgba(0, 255, 203, 1),@color2:rgba(0, 110, 255, 1)) {
     background-image: linear-gradient(135deg, @color1, @color2);
     position: relative;
     padding: 1px;
@@ -151,7 +151,8 @@
         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: if(@infinite, infinite, 0);
     }
 
     * {

+ 12 - 8
src/main/pc-space/src/views/Casting.vue

@@ -12,6 +12,12 @@
                 {{ item }}
             </div>
         </div>
+        <el-radio-group v-model="active" size="normal">
+            <el-radio-button v-for="(item, index) in tabs" :key="index" :label="item">
+                {{ item }}
+            </el-radio-button>
+        </el-radio-group>
+
         <div class="border"></div>
         <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
         <div class="content">
@@ -26,7 +32,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">
@@ -109,17 +115,14 @@ export default {
     }
     .content {
         width: 276px;
-        height: 416px;
-        background: #1c1e26;
+        // height: 416px;
+        .line(@infinite:false);
 
         margin-bottom: 32px;
-        border: 1px solid;
-        border-image: linear-gradient(135deg, rgba(0, 255, 203, 1), rgba(0, 110, 255, 1)) 1 1;
-        position: relative;
         .imgBox {
             height: 160px;
             width: 100%;
-            // border-radius: 8px 8px 0px 0px;
+            border-radius: 8px 8px 0px 0px;
         }
         .img {
             padding: 5px;
@@ -161,12 +164,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;