Ver Fonte

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

panhui há 4 anos atrás
pai
commit
d562f92525

+ 126 - 0
src/main/pc-space/src/components/AddressInfo.vue

@@ -0,0 +1,126 @@
+<template>
+    <el-dialog title="新增地址" center :visible.sync="show" width="30%" @close="closeDialog">
+        <div class="content">
+            <el-form :label-position="labelPosition" label-width="107px" :model="sizeForm" ref="form" :rules="rules">
+                <el-form-item label="收货人" prop="name">
+                    <el-input style="width: 300px" v-model="sizeForm.name" placeholder="请输入"></el-input>
+                </el-form-item>
+                <el-form-item label="联系电话" prop="phone">
+                    <el-input style="width: 300px" v-model="sizeForm.phone" placeholder="请输入"></el-input>
+                </el-form-item>
+                <el-form-item label="所在地区" prop="region">
+                    <el-input style="width: 300px" v-model="sizeForm.region" placeholder="请选择"></el-input>
+                </el-form-item>
+                <el-form-item class="block" prop="address" label="详细地址">
+                    <el-input
+                        class="textarea"
+                        type="textarea"
+                        style="width: 300px"
+                        v-model="sizeForm.address"
+                        maxlength="200"
+                        show-word-limit
+                        :autosize="{ minRows: 6, maxRow: 5 }"
+                        placeholder="请填写对接描述,不超过200字"
+                        resize="none"
+                    ></el-input>
+                </el-form-item>
+            </el-form>
+            <div class="btn1">
+                <div class="btn">
+                    <el-button type="primary" @click="onSubmit">确认</el-button>
+                    <div class="btn2" @click="show = false">返回</div>
+                </div>
+            </div>
+        </div>
+    </el-dialog>
+</template>
+<script>
+export default {
+    props: {
+        show: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data() {
+        return {
+            labelPosition: 'right',
+            sizeForm: {
+                name: '',
+                phone: '',
+                address: ''
+            },
+            rules: {
+                name: { required: true, message: '请输入', trigger: 'blur' },
+                address: { required: true, message: '请输入', trigger: 'blur' },
+                phone: { required: true, message: '请输入', trigger: 'blur' },
+                region: { required: true, message: '请选择', trigger: 'blur' }
+            },
+            selectedTabsPage: this.show
+        };
+    },
+    methods: {
+        closeDialog() {
+            this.$emit('close', this.selectedTabsPage);
+        },
+        onSubmit() {},
+        init(row) {
+            console.log(row);
+            this.sizeForm = row;
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+/deep/ .el-dialog {
+    width: 680px !important;
+    height: 534px !important;
+    background: #ffffff;
+    border-radius: 8px;
+    // border-bottom: 0px -1px 0px 0px red;
+    .el-dialog__title {
+        font-size: 16px;
+        font-weight: bold;
+        color: #000000;
+        line-height: 24px;
+        // box-shadow: 0px -1px 0px 0px red;
+    }
+    .el-dialog__header {
+    }
+}
+/deep/ .el-form-item__error {
+    margin-left: 74px !important;
+}
+.content {
+    .btn1 {
+        margin-left: 10px;
+        .btn {
+            display: flex;
+            justify-content: center;
+            margin-top: 60px;
+            .btn2 {
+                width: 130px;
+                height: 36px;
+                background: #c4c7cc;
+                border-radius: 4px;
+                cursor: pointer;
+                color: #ffffff;
+                font-size: 13px;
+                text-align: center;
+                line-height: 36px;
+                margin-left: 20px;
+            }
+        }
+    }
+    /deep/ .el-button {
+        width: 130px;
+        height: 36px;
+        background: linear-gradient(133deg, #00ffcb 0%, #006eff 100%);
+        border-radius: 4px;
+    }
+    /deep/ .el-form-item__label {
+        margin-left: 75px;
+        font-weight: 400;
+    }
+}
+</style>

+ 1 - 58
src/main/pc-space/src/components/LoginInfo.vue

@@ -139,67 +139,10 @@ export default {
             this.isShow = true;
             this.isShow2 = false;
         },
-        // 注册
-        // doRegister() {
-        //     this.$http;
-        //     this.verifyMsg(this.form.phone, this.form.code).then(() => {
-        //         return (
-        //             this.$http
-        //                 .post('/auth/phoneRegister', {
-        //                     phone: this.form.phone,
-        //                     password: this.form.password,
-        //                     code: this.form.code
-        //                 })
-        //                 // })
-        //                 .then(res => {
-        //                     console.log(res);
-        //                     localStorage.setItem('webToken', res);
-        //                     return this.$store.dispatch('getUserInfo');
-        //                 })
-        //                 .then(() => {
-        //                     this.$message.success('注册成功');
-        //                     // this.flag = false;
-        //                     this.Show = false;
-        //                 })
-        //                 .catch(e => {
-        //                     if (e) {
-        //                         this.$message.error(e.error);
-        //                     }
-        //                 })
-        //         );
-        //     });
-        // },
         // 验证码
         send() {
             this.sendMsg(this.form.phone);
         },
-        // 修改密码
-        // passwordFn2() {
-        //     this.verifyMsg(this.form.phone, this.form.code)
-        //         .then(() => {
-        //             this.$http
-        //                 .post('/auth/forgotPassword', {
-        //                     phone: this.form.phone,
-        //                     password: this.form.password,
-        //                     code: this.form.code
-        //                 })
-        //                 // })
-        //                 .then(() => {
-        //                     this.$toast.success('修改成功');
-        //                     this.Show = false;
-        //                 })
-        //                 .catch(e => {
-        //                     if (e) {
-        //                         this.$message.error(e.error);
-        //                     }
-        //                 });
-        //         })
-        //         .catch(e => {
-        //             if (e) {
-        //                 this.$message.error(e.error);
-        //             }
-        //         });
-        // },
         // 密码登录
         check() {
             this.$http
@@ -222,7 +165,7 @@ export default {
             this.check().then(() => {
                 this.$toast.success('登录成功');
                 this.Show = false;
-                this.$EventBus.$emit('loginSuccess')
+                this.$EventBus.$emit('loginSuccess');
             });
         },
         // 验证码登录

+ 3 - 1
src/main/pc-space/src/components/PageHeader.vue

@@ -44,7 +44,7 @@
 </template>
 <script>
 import LoginInfo from '../components/LoginInfo.vue';
-import { mapState } from 'vuex';
+import { mapState, mapMutations } from 'vuex';
 export default {
     components: { LoginInfo },
     data() {
@@ -71,6 +71,7 @@ export default {
         });
     },
     methods: {
+        ...mapMutations(['updateUserInfo']),
         tab(item) {
             this.active = item;
             if (item === '铸造者') {
@@ -89,6 +90,7 @@ export default {
                 this.$router.push('/accountdata');
             } else if (command === 'logout') {
                 localStorage.removeItem('webToken');
+                this.updateUserInfo(null);
                 this.$router.push('/');
             } else if (command === 'supply') {
                 if (this.type) {

+ 33 - 27
src/main/pc-space/src/components/TransactionPhone.vue

@@ -6,15 +6,23 @@
             <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="phone">
-                <el-input style="width: 300px" v-model="ruleForm.phone" placeholder="请输入新的手机号码"></el-input>
+            <el-form-item label="新交易密码" prop="pass">
+                <el-input
+                    style="width: 300px"
+                    type="password"
+                    v-model="ruleForm.pass"
+                    placeholder="请输入新密码"
+                    autocomplete="off"
+                ></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">{{
-                        time === 0 ? '发送验证码' : `重新发送${time}s`
-                    }}</span>
-                </el-input>
+            <el-form-item label="确认新密码" prop="checkPass">
+                <el-input
+                    style="width: 300px"
+                    type="newpassword"
+                    v-model="ruleForm.checkPass"
+                    placeholder="请再次输出新密码"
+                    autocomplete="off"
+                ></el-input>
             </el-form-item>
         </el-form>
         <div class="btn1">
@@ -32,31 +40,32 @@ export default {
         return {
             labelPosition: 'right',
             ruleForm: {
-                phone: '',
-                code: ''
+                pass: '',
+                newpassword: ''
             },
             time: 0,
-            rules: {}
+            rules: {
+                checkPass: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (value !== this.ruleForm.pass) {
+                                callback(new Error('两次密码输入不一致'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    },
+                    { required: true, message: '请再次输入密码', trigger: 'blur' }
+                ]
+            }
         };
     },
     computed: {
         ...mapState(['userInfo'])
     },
     methods: {
-        send() {
-            this.sendCode(this.ruleForm.phone);
-        },
         phoneSend() {
-            // if (!/^1[3-9]\d{9}$/.test(this.ruleForm.phone)) {
-            //     this.$message.error('请输入正确手机号');
-            //     return;
-            // }
-            // this.$http
-            //     .get('/sms/verify', {
-            //         phone: this.ruleForm.phone,
-            //         code: this.ruleForm.code
-            //     })
-            //     .then(() => {
             //         this.$http
             //             .post('/user/changePhone', { phone: this.ruleForm.phone })
             //             .then(() => {
@@ -67,9 +76,6 @@ export default {
             //                 this.$message.error(e.error);
             //             });
             //     })
-            //     .catch(e => {
-            //         this.$message.error(e.error);
-            //     });
             this.$router.push('/transactionsuccess');
         },
         Jump() {

+ 104 - 4
src/main/pc-space/src/views/user/Address.vue

@@ -1,32 +1,63 @@
 <template>
     <div class="container">
+        <div class="top">
+            <div class="text1">已保存3条了条地址,还能保存7条地址</div>
+            <div class="text2" @click="add">新增地址</div>
+        </div>
+        <div class="border"></div>
         <template>
-            <el-table :data="tableData" :border="false" :highlight-current-row="false" style="width: 100%">
+            <el-table
+                class="customer-table"
+                :header-cell-style="{ background: '#1c1e26' }"
+                :data="tableData"
+                :border="false"
+                :highlight-current-row="false"
+                style="width: 100%"
+            >
                 <el-table-column prop="name" label="收货人" width="180"> </el-table-column>
                 <el-table-column prop="phone" label="联系电话" width="180"> </el-table-column>
-                <el-table-column prop="address" label="所在地区" width="220"> </el-table-column>
+                <el-table-column prop="region" label="所在地区" width="220"> </el-table-column>
                 <el-table-column prop="address" label="详情地址" width="220"> </el-table-column>
-                <el-table-column prop="address" label="操作"> </el-table-column>
+                <el-table-column fixed="right" label="操作" width="100">
+                    <template slot-scope="scope">
+                        <el-button @click="handleClick(scope.row)" type="text" size="small">修改</el-button>
+                        <el-button type="text" size="small">删除</el-button>
+                    </template>
+                </el-table-column>
             </el-table>
         </template>
+        <address-info :show="show" @close="show = false" ref="address"></address-info>
     </div>
 </template>
 
 <script>
+import AddressInfo from '../../components/AddressInfo.vue';
 export default {
+    components: { AddressInfo },
     data() {
         return {
+            show: false,
             tableData: [
                 {
                     name: '王小虎',
                     phone: '1774639714',
+                    region: '江苏省南京市建邺区',
                     address: '上海市普陀区金沙江路 1518 弄'
                 }
             ]
         };
     },
     computed: {},
-    methods: {}
+    methods: {
+        handleClick(row) {
+            this.show = true;
+            this.$refs.address.init(row);
+        },
+        add() {
+            this.show = true;
+            this.$forceUpdate();
+        }
+    }
 };
 </script>
 
@@ -40,6 +71,75 @@ export default {
         color: #ffffff;
     }
 }
+
 .container {
+    padding: 45px 16px 0;
+
+    .top {
+        .flex();
+        justify-content: space-between;
+        .text1 {
+            font-size: 14px;
+            font-weight: 400;
+            color: #ffffff;
+            line-height: 25px;
+        }
+        .text2 {
+            width: 106px;
+            height: 42px;
+            border-radius: 8px;
+            border: 1px solid #939599;
+            line-height: 42px;
+            text-align: center;
+            font-size: 14px;
+            color: #939599;
+            cursor: pointer;
+        }
+    }
+    .border {
+        height: 1px;
+        background: #494a4d;
+        border-radius: 1px;
+        margin: 24px 0 34px;
+    }
+}
+</style>
+<style lang="less">
+.customer-table th {
+    border: none !important;
+}
+.customer-table td,
+.customer-table th.is-leaf {
+    border: none;
+}
+// 表格最外边框
+// .el-table--border,
+// .el-table--group {
+//     border: none;
+// }
+// 头部边框
+.customer-table thead tr th.is-leaf {
+    border: 1px solid #ebeef5;
+    border-right: none;
+}
+.customer-table thead tr th:nth-last-of-type(2) {
+    border-right: 1px solid #ebeef5;
+}
+// 表格最外层边框-底部边框
+.el-table--border::after,
+.el-table--group::after {
+    width: 0;
+}
+.customer-table::before {
+    width: 0;
+}
+.customer-table .el-table__fixed-right::before,
+.el-table__fixed::before {
+    width: 0;
 }
+// 表格有滚动时表格头边框
+// .el-table--border th.gutter:last-of-type {
+//     border: 1px solid #ebeef5;
+//     border-left: none;
+// }
 </style>

+ 5 - 3
src/main/pc-space/src/views/user/Give.vue

@@ -4,7 +4,7 @@
             <el-radio-group class="menu" v-model="type" size="normal">
                 <el-radio-button v-for="(item, index) in typeList" :key="index" :label="item.value">
                     <div class="radio-item">
-                        <i class="font_family" :class="[item.icon]"></i>
+                        <!-- <i class="font_family" :class="[item.icon]"></i> -->
                         <span>{{ item.label }}</span>
                     </div>
                 </el-radio-button>
@@ -261,7 +261,7 @@ export default {
     margin: -16px -16px;
     min-height: 800px;
     display: flex;
-    justify-content: space-between;
+    // justify-content: space-between;
     .content {
         margin: 16px;
     }
@@ -303,7 +303,9 @@ export default {
         }
     }
 }
-
+/deep/ .el-empty {
+    margin: 0 auto;
+}
 .search-list {
     display: flex;
     justify-content: space-between;