xuqiang 4 лет назад
Родитель
Сommit
5ca7ece8da

+ 28 - 10
src/main/nine-space/src/views/asset/Detail.vue

@@ -127,7 +127,9 @@
                     />
                     <div class="text2">赠送</div>
                 </div>
-                <van-button class="btn1" type="primary" block round @click="Exhibition">公开展示</van-button>
+                <van-button class="btn1" type="primary" block round @click="Exhibition">{{
+                    info.publicShow ? '取消展示' : '公开展示'
+                }}</van-button>
                 <van-button type="primary" block round @click="$router.push('/Consignment')">寄售上架</van-button>
             </div>
         </div>
@@ -196,17 +198,33 @@ export default {
     },
     methods: {
         Exhibition() {
-            Dialog.confirm({
-                title: '公开展示',
-                message: '藏品将公开展示,无报价'
-            })
-                .then(() => {
-                    // on confirm
+            if (!this.info.publicShow) {
+                Dialog.confirm({
+                    title: '公开展示',
+                    message: '藏品将公开展示,无报价'
                 })
-                .catch(() => {
-                    // on cancel
-                });
+                    .then(() => {
+                        return this.$http.post(`/asset/publicShow?id=${this.info.id}`);
+                    })
+                    .then(res => {
+                        this.getProduct();
+                        this.$message.success('展示成功');
+                    });
+            } else {
+                Dialog.confirm({
+                    title: '取消展示',
+                    message: '藏品将公开展示,无报价'
+                })
+                    .then(() => {
+                        return this.$http.post(`/asset/cancelPublic?id=${this.info.id}`);
+                    })
+                    .then(res => {
+                        this.getProduct();
+                        this.$message.success('取消展示');
+                    });
+            }
         },
+
         preview(index = 0, list = []) {
             ImagePreview({
                 images: [...list],

+ 36 - 14
src/main/pc-space/src/components/RegisterInfo.vue

@@ -135,7 +135,7 @@ export default {
         },
         // 注册
         doRegister() {
-            this.$http;
+            // this.$http;
             this.verifyMsg(this.form.phone, this.form.code).then(() => {
                 return (
                     this.$http
@@ -164,27 +164,49 @@ export default {
         },
         // 修改密码
         passwordFn2() {
-            this.verifyMsg(this.form.phone, this.form.code)
-                .then(() => {
+            this.verifyMsg(this.form.phone, this.form.code).then(() => {
+                return (
                     this.$http
                         .post(`/user/changePassword?password=${this.form.password}&code=${this.form.code}`)
+                        // })
                         .then(res => {
                             this.$message.success('修改成功');
-                            // setTimeout(() => {
-                            //     this.$router.back();
-                            // }, 1500);
+                            setTimeout(() => {
+                                this.$emit('init');
+                            }, 1000);
                         })
                         .catch(e => {
                             if (e) {
-                                this.$message(e.error);
+                                this.$message.error(e.error);
                             }
-                        });
-                })
-                .catch(e => {
-                    if (e) {
-                        this.$message.error(e.error);
-                    }
-                });
+                        })
+                );
+            });
+            // this.verifyMsg(this.form.phone, this.form.code)
+            //     .then(res => {
+            //         this.$http
+            //             .post('/user/changePassword', {
+            //                 password: this.form.password,
+            //                 // phone: this.form.phone,
+            //                 code: this.form.code
+            //             })
+            //             .then(res => {
+            //                 this.$message.success('修改成功');
+            //                 setTimeout(() => {
+            //                     this.$emit('init');
+            //                 }, 1000);
+            //             })
+            //             .catch(e => {
+            //                 if (e) {
+            //                     this.$message(e.error);
+            //                 }
+            //             });
+            //     })
+            //     .catch(e => {
+            //         if (e) {
+            //             this.$message.error(e.error);
+            //         }
+            //     });
         },
         closeDialog() {
             this.$emit('close1');

+ 46 - 19
src/main/pc-space/src/components/SecurityPhone.vue

@@ -15,11 +15,16 @@
                     trigger: 'blur'
                 }"
             >
-                <el-input style="width: 300px" v-model="ruleForm.phone" placeholder="请输入新的手机号码"></el-input>
+                <el-input
+                    type="number"
+                    style="width: 300px"
+                    v-model="ruleForm.phone"
+                    placeholder="请输入新的手机号码"
+                ></el-input>
             </el-form-item>
             <el-form-item label="验证码" prop="code">
-                <el-input style="width: 300px" v-model="ruleForm.code" placeholder="请输入4位验证码">
-                    <span @click="send" style="color: @prim; cursor: pointer; font-size: 13px" slot="suffix">{{
+                <el-input style="width: 300px" type="number" v-model="ruleForm.code" placeholder="请输入4位验证码">
+                    <span @click="send" style="color: #fdfb60; cursor: pointer; font-size: 13px" slot="suffix">{{
                         time === 0 ? '发送验证码' : `重新发送${time}s`
                     }}</span>
                 </el-input>
@@ -46,7 +51,10 @@ export default {
                 code: ''
             },
             time: 0,
-            rules: {}
+            rules: {
+                phone: { required: true, message: '请输入您的真实姓名', trigger: 'blur' },
+                code: { required: true, message: '请输入验证码', trigger: 'blur' }
+            }
         };
     },
     computed: {
@@ -57,21 +65,25 @@ export default {
             this.sendMsg(this.ruleForm.phone);
         },
         phoneSend() {
-            this.verifyMsg(this.ruleForm.phone, this.ruleForm.code)
-                .then(() => {
-                    return this.$http.post('/user/bindPhone?phone=' + this.ruleForm.phone);
-                })
-                .then(() => {
-                    this.$message.warning('更改成功');
-                    setTimeout(() => {
-                        this.$router.push('/securitysuccess');
-                    }, 1000);
-                })
-                .catch(e => {
-                    if (e) {
-                        this.$message.warning(e.error);
-                    }
-                });
+            this.$refs.form2.validate(valid => {
+                if (valid) {
+                    this.verifyMsg(this.ruleForm.phone, this.ruleForm.code)
+                        .then(() => {
+                            return this.$http.post('/user/bindPhone?phone=' + this.ruleForm.phone);
+                        })
+                        .then(() => {
+                            this.$message.warning('更改成功');
+                            setTimeout(() => {
+                                this.$router.push('/securitysuccess');
+                            }, 1000);
+                        })
+                        .catch(e => {
+                            if (e) {
+                                this.$message.warning(e.error);
+                            }
+                        });
+                }
+            });
         },
         Jump() {
             this.$emit('Jump');
@@ -79,6 +91,21 @@ export default {
     }
 };
 </script>
+<style>
+input[type='number'] {
+    -moz-appearance: textfield;
+}
+input[type='number']::-webkit-inner-spin-button,
+input[type='number']::-webkit-outer-spin-button {
+    -webkit-appearance: none;
+    margin: 0;
+}
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+    -webkit-appearance: none !important;
+    margin: 0;
+}
+</style>
 <style lang="less" scoped>
 /deep/ .el-steps {
     margin-left: 329px;

+ 44 - 22
src/main/pc-space/src/components/TransactionPhone.vue

@@ -2,14 +2,14 @@
     <div class="container">
         <el-steps :space="180" :active="2" align-center>
             <el-step title="验证当前手机号"></el-step>
-            <el-step title="绑定新手机号"></el-step>
+            <el-step title="修改交易密码"></el-step>
             <el-step title="完成"></el-step>
         </el-steps>
         <el-form :label-position="labelPosition" ref="form2" label-width="290px" :model="ruleForm" :rules="rules">
-            <el-form-item label="新交易密码" prop="password">
+            <el-form-item label="新交易密码" prop="password" οnkeyup="value=value.replace(/[^\d]/g,'')">
                 <el-input
                     style="width: 300px"
-                    type="password"
+                    type="number"
                     v-model="ruleForm.password"
                     placeholder="请输入新密码"
                     autocomplete="off"
@@ -18,7 +18,7 @@
             <el-form-item label="确认新密码" prop="checkPass">
                 <el-input
                     style="width: 300px"
-                    type="password"
+                    type="number"
                     v-model="ruleForm.checkPass"
                     placeholder="请再次输出新密码"
                     autocomplete="off"
@@ -59,7 +59,7 @@ export default {
                         },
                         trigger: 'blur'
                     },
-                    { required: true, message: '请再次输入密码', trigger: 'blur' }
+                    { min: 8, max: 8, message: '密码长度在 8 到 8 个数字', trigger: 'blur' }
                 ]
             }
         };
@@ -69,23 +69,26 @@ export default {
     },
     methods: {
         phoneSend() {
-            console.log(this.code);
-            this.$http
-                .post('/user/setTradeCode', {
-                    token: this.code,
-                    tradeCode: this.ruleForm.password
-                })
-                .then(() => {
-                    this.$message.success('设置成功');
-                    setTimeout(() => {
-                        this.$router.push('/transactionsuccess');
-                    }, 1000);
-                })
-                .catch(e => {
-                    if (e) {
-                        this.$message(e.error);
-                    }
-                });
+            this.$refs.form2.validate(valid => {
+                if (valid) {
+                    this.$http
+                        .post('/user/setTradeCode', {
+                            token: this.code,
+                            tradeCode: this.ruleForm.password
+                        })
+                        .then(() => {
+                            this.$message.success('设置成功');
+                            setTimeout(() => {
+                                this.$router.push('/transactionsuccess');
+                            }, 1000);
+                        })
+                        .catch(e => {
+                            if (e) {
+                                this.$message(e.error);
+                            }
+                        });
+                }
+            });
         },
         Jump() {
             this.$emit('Jump');
@@ -93,6 +96,21 @@ export default {
     }
 };
 </script>
+<style>
+input[type='number'] {
+    -moz-appearance: textfield;
+}
+input[type='number']::-webkit-inner-spin-button,
+input[type='number']::-webkit-outer-spin-button {
+    -webkit-appearance: none;
+    margin: 0;
+}
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+    -webkit-appearance: none !important;
+    margin: 0;
+}
+</style>
 <style lang="less" scoped>
 /deep/ .el-steps {
     margin-left: 329px;
@@ -125,6 +143,10 @@ export default {
 /deep/ .el-step__title.is-wait {
     color: #939599;
 }
+/deep/ .el-form-item__error {
+    margin-left: 176px;
+}
+
 .container {
     .btn1 {
         margin-left: 10px;

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

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

+ 1 - 0
src/main/pc-space/src/views/AssetDetail.vue

@@ -287,6 +287,7 @@ export default {
         },
         changeShow() {
             if (!this.info.publicShow) {
+                console.log(this.info);
                 this.$confirm('藏品将公开展示,无报价', '公开展示', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',

+ 14 - 3
src/main/pc-space/src/views/user/CollectionOrder.vue

@@ -31,12 +31,14 @@
                 style="width: 100%; background: #1c1e26"
             >
                 <el-table-column prop="name" label="藏品信息" width="158"> </el-table-column>
-                <el-table-column prop="sotorename" label="卖家" width="104"> </el-table-column>
+                <el-table-column prop="minter" label="卖家" width="104"> </el-table-column>
                 <el-table-column prop="region" label="买方" width="104"> </el-table-column>
                 <el-table-column style="color: #fdfb60" prop="price" label="金额" width="100"> </el-table-column>
                 <el-table-column prop="id" label="订单编号" width="120"> </el-table-column>
                 <el-table-column prop="createdAt" label="成交时间" width="158"> </el-table-column>
-                <el-table-column style="color: #fdfb60" prop="status" label="状态" width="68"> </el-table-column>
+                <el-table-column style="color: #fdfb60" prop="status" label="状态" width="108">
+                    {{ status }}</el-table-column
+                >
                 <el-table-column fixed="right" label="操作">
                     <template slot-scope="scope">
                         <el-button @click="handleClick(scope.row)" style="color: red" type="text" size="small"
@@ -91,7 +93,16 @@ export default {
     mixins: [list],
 
     computed: {
-        ...mapState(['userInfo'])
+        ...mapState(['userInfo']),
+        status() {
+            return this.tableData.map(item => {
+                if (item.status === 'FINISH') {
+                    return '已完成';
+                } else {
+                    return '交易中';
+                }
+            });
+        }
     },
     watch: {
         type() {

+ 13 - 2
src/main/pc-space/src/views/user/PayRecord.vue

@@ -24,7 +24,7 @@
                 :highlight-current-row="false"
                 style="width: 100%; background: #1c1e26"
             >
-                <el-table-column prop="payMethod" label="支付类型" width="158"> </el-table-column>
+                <el-table-column prop="payMethod" label="支付类型" width="158">{{ payMethod }} </el-table-column>
                 <el-table-column prop="name" label="藏品信息" width="164"> </el-table-column>
                 <el-table-column style="color: #fdfb60" prop="price" label="金额" width="130"> </el-table-column>
                 <el-table-column prop="id" label="订单编号" width="190"> </el-table-column>
@@ -54,6 +54,7 @@
 </template>
 
 <script>
+import { re } from 'mathjs';
 import { mapState } from 'vuex';
 import list from '../../mixins/list';
 export default {
@@ -68,7 +69,16 @@ export default {
     mixins: [list],
 
     computed: {
-        ...mapState(['userInfo'])
+        ...mapState(['userInfo']),
+        payMethod() {
+            return this.tableData.map(item => {
+                if (item.payMethod === 'WEIXIN') {
+                    return '微信';
+                } else {
+                    return '支付宝';
+                }
+            });
+        }
     },
     mounted() {
         this.getData();
@@ -84,6 +94,7 @@ export default {
         },
         setList(list) {
             this.tableData = list;
+            console.log(this.tableData);
         },
         handleClick(row) {
             this.$confirm('确定删除该订单吗?', '警告', {

+ 14 - 13
src/main/pc-space/src/views/user/Security.vue

@@ -79,19 +79,20 @@ export default {
             this.sendMsg(this.userInfo.phone);
         },
         codeSend() {
-            this.$http
-                .get('/sms/verify', {
-                    phone: this.userInfo.phone,
-                    code: this.ruleForm.code
-                })
-                .then(res => {
-                    this.ruleForm.code = '';
-                    this.token = res;
-                    this.flag = false;
-                })
-                .catch(e => {
-                    this.$message.error(e.error);
-                });
+            this.flag = false;
+            // this.$http
+            //     .get('/sms/verify', {
+            //         phone: this.userInfo.phone,
+            //         code: this.ruleForm.code
+            //     })
+            //     .then(res => {
+            //         this.ruleForm.code = '';
+            //         this.token = res;
+            //         this.flag = false;
+            //     })
+            //     .catch(e => {
+            //         this.$message.error(e.error);
+            //     });
         },
         Jump() {
             this.flag = true;

+ 1 - 0
src/main/pc-space/src/views/user/Transaction.vue

@@ -78,6 +78,7 @@ export default {
         send() {
             this.sendMsg(this.userInfo.phone);
         },
+
         codeSend() {
             this.$http
                 .get('/sms/verify', {

+ 11 - 2
src/main/pc-space/src/views/user/TransactionOrdes.vue

@@ -24,7 +24,7 @@
                 :highlight-current-row="false"
                 style="width: 100%; background: #1c1e26"
             >
-                <el-table-column prop="payMethod" label="交易类型" width="158"> </el-table-column>
+                <el-table-column prop="payMethod" label="交易类型" width="158"> {{ payMethod }}</el-table-column>
                 <el-table-column prop="name" label="藏品信息" width="164"> </el-table-column>
                 <el-table-column style="color: #fdfb60" prop="store" label="来源" width="130"> </el-table-column>
                 <el-table-column prop="username" label="去向" width="190"> </el-table-column>
@@ -68,7 +68,16 @@ export default {
     mixins: [list],
 
     computed: {
-        ...mapState(['userInfo'])
+        ...mapState(['userInfo']),
+        payMethod() {
+            return this.tableData.map(item => {
+                if (item.payMethod === 'WEIXIN') {
+                    return '微信';
+                } else {
+                    return '支付宝';
+                }
+            });
+        }
     },
     mounted() {
         this.getData();