Browse Source

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

panhui 4 years ago
parent
commit
d7316c15ed

+ 15 - 0
src/main/nine-space/src/components/order/OrderInfo.vue

@@ -61,6 +61,21 @@ export default {
             this.$emit('delFn');
         },
         del() {
+            // this.Dialog.confirm({
+            //     title: '确定删除吗?',
+            //     message: '删除此记录将消失'
+            // }).then(() => {
+            //     this.$http
+            //         .post('/order/hide/', {
+            //             id: this.info.id
+            //         })
+            //         .then(() => {
+            //             this.$toast.success('删除成功');
+            //             setTimeout(() => {
+            //                 this.delInit();
+            //             }, 1000);
+            //         });
+            // });
             this.$http
                 .post('/order/hide/', {
                     id: this.info.id

+ 30 - 7
src/main/pc-space/src/components/PageHeader.vue

@@ -37,7 +37,12 @@
                                 >{{ userInfo.username }}
                             </el-dropdown-item>
                             <div class="border"></div>
-                            <el-dropdown-item command="supply" style="word-break: keep-all">去认证 </el-dropdown-item>
+                            <el-dropdown-item
+                                v-if="userInfo.authStatus != 'SUCCESS'"
+                                command="supply"
+                                style="word-break: keep-all"
+                                >去认证
+                            </el-dropdown-item>
                             <el-dropdown-item command="edit" style="word-break: keep-all">编辑资料 </el-dropdown-item>
                             <div class="border"></div>
                             <el-dropdown-item command="logout">退出登录 </el-dropdown-item>
@@ -125,8 +130,9 @@ export default {
             this.lists = list.filter(item => {
                 return item.userId === this.userInfo.id;
             });
+            console.log(this.lists);
             this.org = this.lists[0].org;
-            // console.log(this.lists);
+            console.log(this.lists[0].org);
             console.log(this.org);
         },
         Login() {
@@ -156,14 +162,31 @@ export default {
                 this.updateUserInfo(null);
                 this.$router.push('/');
             } else if (command === 'supply') {
+                // this.setList();
+                // this.$router.go(0);
                 if (this.userInfo.authStatus === 'NOT_AUTH') {
                     this.$router.push('/authentication');
                 } else {
-                    if (this.userInfo.authStatus !== 'NOT_AUTH' && this.org == false) {
-                        this.$router.push('/userauthentication');
-                    } else {
-                        this.$router.push('/enterpriseauthentication');
-                    }
+                    this.$nextTick(() => {
+                        if (this.userInfo.authStatus !== 'NOT_AUTH' && this.org == false) {
+                            console.log(this.lists[0]);
+                            console.log(this.org);
+                            console.log('个人');
+                            this.$router.push('/userauthentication');
+                        }
+                        //  else {
+                        //     console.log(this.lists[0]);
+                        //     console.log(this.org);
+                        //     console.log('企业');
+                        //     this.$router.push('/enterpriseauthentication');
+                        // }
+                        if (this.userInfo.authStatus !== 'NOT_AUTH' && this.org == true) {
+                            console.log(this.lists[0]);
+                            console.log(this.org);
+                            console.log('企业');
+                            this.$router.push('/enterpriseauthentication');
+                        }
+                    });
                 }
             }
         },

+ 1 - 1
src/main/pc-space/src/mixins/pageableTable.js

@@ -92,7 +92,7 @@ export default {
                 })
                 .catch(e => {
                     this.fetchingData = false;
-                    this.$message.error(e.error);
+                    // this.$message.error(e.error);
                 });
         },
         changeSort(prop, order) {

+ 1 - 0
src/main/pc-space/src/router/index.js

@@ -266,6 +266,7 @@ router.beforeEach((to, from, next) => {
                     MessageBox.confirm('用户未登录,是否立即登录', '提示', {
                         confirmButtonText: '立即登录'
                     }).then(() => {
+                        console.log(222);
                         eventBus.$emit('login');
                     });
                     next(false);

+ 4 - 4
src/main/pc-space/src/views/AssetDetail.vue

@@ -344,17 +344,14 @@ export default {
             );
         },
         handleClose2() {
-            console.log(111);
             this.show3 = false;
             this.getDetail();
         },
         handleClose() {
-            console.log(111);
             this.show4 = false;
             this.getDetail();
         },
         Whisper() {
-            console.log(111);
             if (!this.init2.once) {
                 this.show2 = true;
                 this.$http
@@ -383,7 +380,6 @@ export default {
             }
         },
         openedFn() {
-            console.log(111);
             this.show2 = false;
             this.show3 = true;
             if (!this.init2.once) {
@@ -1147,6 +1143,10 @@ export default {
     .line();
     /deep/.el-image {
         display: block;
+        width: 458px !important;
+        height: 458px !important;
+        border-radius: 8px !important;
+        margin-left: 1px;
         img {
             display: block;
         }

+ 238 - 4
src/main/pc-space/src/views/CollectionDetail.vue

@@ -100,7 +100,35 @@
                         >立即购买</el-button
                     >
                 </div>
+                <div class="init">
+                    <div class="name">类型</div>
+                    <div class="name name1">悄悄话<span>(灰色表示已使用)</span></div>
+                    <div class="name name2">持有特权<span>(灰色表示已使用)</span></div>
+                </div>
+                <div class="init1">
+                    <div class="name">{{ info.category || '暂无' }}</div>
+                    <div class="bor"></div>
+                    <div class="box" v-if="init2 != ''">
+                        <div v-if="init2">
+                            <img @click="Whisper" v-if="init2.opened" class="img" :src="init2.icon[2]" alt="" />
+                            <img @click="Whisper" v-else class="img" :src="init2.icon[0]" alt="" />
+                        </div>
+                        <div class="del" v-else>铸造者未设置</div>
+                    </div>
 
+                    <div class="bor"></div>
+                    <!-- <div v-if="init"> -->
+                    <div class="iconBox" v-if="init.length > 0">
+                        <div v-for="(item, index) in init" :key="index">
+                            <div @click.stop="privilegeFn(item)">
+                                <img v-if="item.opened" class="img2" :src="item.icon[2]" alt="" />
+                                <img v-if="!item.opened" class="img2" :src="item.icon[3]" alt="" />
+                            </div>
+                        </div>
+                    </div>
+                    <div class="del" v-else>铸造者未设置</div>
+                    <!-- </div> -->
+                </div>
                 <div v-if="properties.length > 0">
                     <div class="time">
                         <div class="time1">商品特性</div>
@@ -171,7 +199,59 @@
             <collection-info v-for="(item, index) in relateds" :key="item.id" :info.sync="relateds[index]">
             </collection-info>
         </div>
-
+        <!-- 悄悄话 -->
+        <el-dialog append-to-body class="abb" :visible.sync="show2" title="提示">
+            <img
+                @click="openedFn"
+                class="imgBox"
+                src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-11-12-16-13-07DtWLMcPy.png"
+                alt=""
+            />
+            <div class="Whisper1">点击图标打开悄悄话,(隐藏内容,只能开启一次)</div>
+        </el-dialog>
+        <!-- 悄悄话 -->
+        <el-dialog append-to-body v-if="init2" :visible.sync="show3" :before-close="handleClose2">
+            <div class="title2">
+                <img class="img" v-if="init2.icon" :src="init2.icon[1]" alt="" />
+                <div class="title3">悄悄话</div>
+            </div>
+            <div class="border"></div>
+            <div class="name">藏有创作者填写的隐藏内容,持有者才能打开</div>
+            <div class="name1">
+                说明:<span>{{ init2.remark || '暂无' }}</span>
+            </div>
+            <div v-if="init2.openTime" class="timename"><span class="time">开启时间:</span>{{ init2.openTime }}</div>
+        </el-dialog>
+        <!-- 其余三个 -->
+        <el-dialog append-to-body :visible.sync="show4" :before-close="handleClose">
+            <div class="title2">
+                <div class="title3">{{ list2.name }}</div>
+            </div>
+            <div class="border"></div>
+            <div class="name">{{ list2.description }}</div>
+            <div class="name1" v-if="list2.type != 'code'">
+                <img class="qrcodeImg" v-if="list2.type == 'qrcode'" :src="list2.detail" alt="" />
+                <div class="qrcode1" v-if="list2.type == 'qrcode'">扫描二维码进行票务核销</div>
+                说明:<span>{{ list2.remark || '暂无' }}</span>
+            </div>
+            <div v-if="list2.type == 'code'">
+                <div class="copy">
+                    <div class="id">
+                        {{ list2.id }}
+                    </div>
+                    <img class="copyImg" @click="copy" src="../assets/user/copy_icon@3x (1).png" alt="" />
+                </div>
+                <span class="span">说明:</span> <span>{{ list2.remark || '暂无' }}</span>
+                <div class="border"></div>
+                <div class="code">每次交易都会产生校验码</div>
+            </div>
+            <div v-if="list2.openTime">
+                <div v-if="list2.type == 'qrcode'" class="timename">
+                    <span class="time">截止时间:</span>{{ list2.openTime }}
+                </div>
+                <div v-else class="timename"><span class="time">打开时间:</span>{{ list2.openTime }}</div>
+            </div>
+        </el-dialog>
         <submit ref="sub"></submit>
     </div>
 </template>
@@ -189,13 +269,20 @@ export default {
     data() {
         return {
             tableData: [],
+            show: false,
+            show2: false,
+            show3: false,
+            show4: false,
             info: {},
             blindBoxItems: [],
             swiperOptions: {},
             activeNames: ['2', '3'],
             relateds: [],
             boxOptions: { slidesPerView: 4, spaceBetween: 24, autoplay: true },
-            loading: true
+            loading: true,
+            init2: [],
+            init: [],
+            list2: []
         };
     },
     computed: {
@@ -224,6 +311,65 @@ export default {
         }
     },
     methods: {
+        copy() {
+            this.$copyText(this.list2.id).then(
+                e => {
+                    this.$message.success('复制成功');
+                },
+                e => {
+                    this.$message.warning('复制失败');
+                }
+            );
+        },
+        handleClose2() {
+            this.show3 = false;
+            this.getDetail();
+        },
+        handleClose() {
+            this.show4 = false;
+            this.getDetail();
+        },
+        Whisper() {
+            if (!this.init2.once) {
+                this.show2 = true;
+                this.$http
+                    .post('/asset/usePrivilege', {
+                        assetId: this.info.id,
+                        privilegeId: this.init2.id
+                    })
+                    .then(res => {
+                        console.log(res);
+                    });
+            }
+        },
+        privilegeFn(init) {
+            this.list2 = init;
+            if (!init.once) {
+                this.show4 = true;
+                this.$http
+                    .post('/asset/usePrivilege', {
+                        assetId: this.info.id,
+                        privilegeId: init.id
+                    })
+                    .then(res => {
+                        console.log(res);
+                    });
+            }
+        },
+        openedFn() {
+            this.show2 = false;
+            this.show3 = true;
+            if (!this.init2.once) {
+                this.$http
+                    .post('/asset/usePrivilege', {
+                        assetId: this.info.id,
+                        privilegeId: this.init2.id
+                    })
+                    .then(res => {
+                        console.log(res);
+                    });
+            }
+        },
         getDetail() {
             this.$http
                 .get('/collection/get/' + this.$route.query.id)
@@ -232,6 +378,16 @@ export default {
                     this.loading = false;
                     this.getTime(res.startTime);
                     this.getRelated(res.ownerId);
+                    if (res.privileges) {
+                        this.init2 = res.privileges.find(item => {
+                            return item.name === '悄悄话';
+                        });
+                    }
+                    if (res.privileges) {
+                        this.init = res.privileges.filter(item => {
+                            return item.name !== '悄悄话';
+                        });
+                    }
                     if (res.type === 'BLIND_BOX') {
                         return this.$http.post(
                             '/blindBoxItem/all',
@@ -318,12 +474,10 @@ export default {
     background: #1a1a1a;
     .top {
         display: flex;
-
         .top-left {
             width: 460px;
             flex-shrink: 0;
         }
-
         .top-info {
             flex-grow: 1;
             margin-left: 30px;
@@ -513,6 +667,86 @@ export default {
                 border-radius: 8px;
             }
         }
+        .init {
+            background: #1c1e26;
+            border-radius: 8px 8px 0px 0px;
+            display: flex;
+            align-items: center;
+            .name {
+                font-size: 18px;
+                font-weight: bold;
+                color: #ffffff;
+                line-height: 28px;
+                margin: 0 !important;
+                padding-left: 16px;
+                width: 130px;
+                &.name1 {
+                    width: 220px;
+                }
+                &.name2 {
+                    width: 313px;
+                }
+            }
+            span {
+                font-size: 14px;
+                font-weight: 400;
+                color: #939599;
+                line-height: 24px;
+            }
+            .img {
+                width: 24px;
+                height: 24px;
+                cursor: pointer;
+            }
+        }
+        .init1 {
+            display: flex;
+            align-items: center;
+            height: 102px;
+            background: #1f2230;
+            border-radius: 0px 0px 8px 8px;
+            .name {
+                font-size: 14px;
+                font-weight: 400;
+                color: #ffffff;
+                line-height: 24px;
+                padding-left: 16px;
+            }
+            .bor {
+                width: 1px;
+                height: 62px;
+                background: #494a4d;
+                border-radius: 1px;
+            }
+            .box {
+                width: 220px;
+            }
+            .del {
+                font-size: 14px;
+                width: 220px;
+                font-weight: 400;
+                color: #939599;
+                line-height: 24px;
+                padding-left: 16px;
+            }
+            .img {
+                width: 24px;
+                height: 24px;
+                padding-left: 16px;
+                cursor: pointer;
+            }
+            .iconBox {
+                margin-left: -34px;
+                display: flex;
+                align-items: center;
+                .img2 {
+                    width: 24px;
+                    height: 24px;
+                    padding-left: 50px;
+                    cursor: pointer;
+                }
+            }
+        }
         .card {
             // width: 590px;
             height: 112px;

+ 3 - 1
src/main/pc-space/src/views/Send.vue

@@ -111,6 +111,7 @@ export default {
             info: [],
             checked: true,
             id: 103,
+            idOrder: 1034,
             form: { password: '' },
             status: '',
             gas: 0,
@@ -153,7 +154,7 @@ export default {
             }
         },
         payUrl() {
-            return resolveUrl(this.$baseUrl, '9th/payOrder/weixin_pc?id=' + this.info.id);
+            return resolveUrl(this.$baseUrl, '9th/payOrder/weixin_pc?id=' + this.idOrder);
         }
         // payUrl() {
         //     return resolveUrl(
@@ -178,6 +179,7 @@ export default {
                         })
                         .then(res => {
                             this.status = res.status;
+                            this.idOrder = res.id;
                             // console.log(res);
                         })
                         .catch(e => {

+ 54 - 18
src/main/pc-space/src/views/Submit.vue

@@ -28,12 +28,13 @@
                         </el-radio-group>
                     </div>
                 </div>
-
-                <div class="qrcode">
-                    <vue-qrcode :value="payUrl" :options="{ width: 140, margin: 1 }" class="code"></vue-qrcode>
+                <div v-if="status == 'NOT_PAID'">
+                    <div class="qrcode">
+                        <vue-qrcode :value="payUrl" :options="{ width: 140, margin: 1 }" class="code"></vue-qrcode>
+                    </div>
+                    <div class="qrcode-text">二维码有效时常为5分钟,请尽快支付</div>
+                    <!-- <div class="qrcode-text">手机微信扫描二维码下单</div> -->
                 </div>
-                <!-- <div class="qrcode-text">二维码有效时常为5分钟,请尽快支付</div> -->
-                <div class="qrcode-text">手机微信扫描二维码下单</div>
             </div>
 
             <div class="tips">
@@ -47,9 +48,9 @@
             </div>
         </div>
 
-        <!-- <span slot="footer" class="dialog-footer">
+        <span slot="footer" class="dialog-footer">
             <el-button type="primary" class="pay" @click="submit">确认</el-button>
-        </span> -->
+        </span>
     </el-dialog>
 </template>
 
@@ -82,32 +83,67 @@ export default {
             ],
             loading: true,
             info: {},
-            gas: 0
+            gas: 0,
+            id: 0,
+            status: ''
         };
     },
     computed: {
-        payUrl() {
-            return resolveUrl('https://nfttest.9space.vip/wx/payOrder/weixin_pc?id=' + this.info.id);
-        },
         // payUrl() {
-        //     return resolveUrl(this.$baseUrl, '9th/payOrder/weixin_pc?id=' + this.info.id);
+        //     return resolveUrl('https://nfttest.9space.vip/wx/payOrder/weixin_pc?id=' + this.info.id);
         // },
+        payUrl() {
+            return resolveUrl(this.$baseUrl, 'https://nfttest.9space.vip/payOrder/weixin_pc?id=' + this.id);
+        },
+        // https://nfttest.9space.vip/wx/redirect?redirectUrl=https://nfttest.9space.vip/payOrder/weixin_pc?id=2006
         money() {
             if (this.info.price) {
                 return add(this.info.price, this.gas);
             } else {
                 return 0;
             }
+            // add(this.info.price, this.gas)
+            // if (this.info.price) {
+            //     return this.info.price.reduce((prev, cur) => {
+            //         var r1, r2, m;
+            //         try {
+            //             r1 = prev.toString().split('.')[1].length;
+            //         } catch (e) {
+            //             r1 = 0;
+            //         }
+            //         try {
+            //             r2 = cur.money.toString().split('.')[1].length;
+            //         } catch (e) {
+            //             r2 = 0;
+            //         }
+            //         m = Math.pow(10, Math.max(r1, r2));
+            //         return (prev * m + cur.money * m) / m;
+            //     }, 0);
+            // } else {
+            //     return 0;
+            // }
         }
     },
     methods: {
         submit() {
-            console.log(this.payUrl);
-            console.log(this.info.id);
-            console.log(this.$baseUrl);
-            if (this.payMethods === 'DCEP') {
-                this.wait();
-            }
+            // console.log(this.payUrl);
+            // console.log(this.info.id);
+            // console.log(this.$baseUrl);
+            // if (this.payMethods === 'DCEP') {
+            //     this.wait();
+            // }
+            this.$http
+                .post('/order/create?collectionId=' + this.$route.query.id + '&qty=1')
+                .then(res => {
+                    // console.log(res);
+                    this.id = res.id;
+                    this.status = res.status;
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$toast(e.error);
+                    }
+                });
         },
         init(info) {
             this.checkLogin()

+ 29 - 4
src/main/pc-space/src/views/user/EnterpriseAuthentication.vue

@@ -176,10 +176,30 @@ export default {
         },
         Jump2() {
             let status = 'NOT_AUTH';
-            this.updateUser({ authStatus: status }).then(res => {
-                // console.log(res);
-                this.$router.push('/accountdata');
-            });
+            this.$http
+                .post(
+                    '/user/save',
+                    {
+                        ...this.$store.state.userInfo,
+                        authStatus: status
+                    },
+                    {
+                        body: 'json'
+                    }
+                )
+                .then(() => {
+                    this.$store.dispatch('getUserInfo');
+                    this.$router.push('/authentication');
+                })
+                .then(() => {
+                    return Promise.resolve();
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$message.error(e.error);
+                    }
+                    return Promise.reject();
+                });
         },
         onSubmit() {
             this.$refs.form.validate(valid => {
@@ -203,6 +223,11 @@ export default {
                 })
                 .then(res => {
                     this.$store.dispatch('getUserInfo', res);
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$message.success(e.error);
+                    }
                 });
         }
     }

+ 29 - 4
src/main/pc-space/src/views/user/UserAuthentication.vue

@@ -119,10 +119,30 @@ export default {
         },
         Jump2() {
             let status = 'NOT_AUTH';
-            this.updateUser({ authStatus: status }).then(res => {
-                // console.log(res);
-                this.$router.push('/accountdata');
-            });
+            this.$http
+                .post(
+                    '/user/save',
+                    {
+                        ...this.$store.state.userInfo,
+                        authStatus: status
+                    },
+                    {
+                        body: 'json'
+                    }
+                )
+                .then(() => {
+                    this.$store.dispatch('getUserInfo');
+                    this.$router.push('/authentication');
+                })
+                .then(() => {
+                    return Promise.resolve();
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$message.error(e.error);
+                    }
+                    return Promise.reject();
+                });
         },
         onSubmit() {
             this.$refs.form.validate(valid => {
@@ -149,6 +169,11 @@ export default {
                 })
                 .then(res => {
                     this.$store.dispatch('getUserInfo', res);
+                })
+                .catch(e => {
+                    if (e) {
+                        this.$message.success(e.error);
+                    }
                 });
         }
     }