소스 검색

弹框bug

xuqiang 4 년 전
부모
커밋
a2f6c46769

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 107 - 748
src/main/pc-space/package-lock.json


+ 1 - 1
src/main/pc-space/package.json

@@ -15,7 +15,7 @@
         "vue": "^2.6.11",
         "vue-clipboard2": "^0.3.3",
         "vue-router": "^3.2.0",
-        "vue-social-share": "^0.0.3",
+        "vue-social-share": "0.0.3",
         "vuex": "^3.4.0"
     },
     "devDependencies": {

+ 81 - 78
src/main/pc-space/src/components/LoginInfo.vue

@@ -73,15 +73,21 @@
                 </div>
             </div>
         </el-dialog>
-        <list-info :isShow="isShow" :isShow2="isShow2" @close1="isShow2 = false" ref="public"></list-info>
+        <register-info
+            :isShow="isShow"
+            :isShow2="isShow2"
+            @init="init"
+            @close1="isShow2 = false"
+            @refreash="refreash"
+        ></register-info>
     </div>
 </template>
 <script>
 import phone from '../mixins/phone';
-import listInfo from '../components/listInfo.vue';
+import RegisterInfo from './RegisterInfo.vue';
 export default {
     mixins: [phone],
-    components: { listInfo },
+    components: { RegisterInfo },
     props: {
         Show: {
             type: Boolean,
@@ -94,25 +100,9 @@ export default {
             isShow: false,
             isShow2: false,
             phoneLogin: false,
-            rules: {
-                password: [{ min: 8, max: 16, message: '密码长度在 8 到 16 个字符', trigger: 'blur' }],
-                password2: [
-                    {
-                        validator: (rule, value, callback) => {
-                            if (value !== this.form.password) {
-                                callback(new Error('两次密码输入不一致'));
-                            } else {
-                                callback();
-                            }
-                        },
-                        trigger: 'blur'
-                    },
-                    { required: true, message: '请再次输入密码', trigger: 'blur' }
-                ]
-            },
+            rules: {},
             form: {},
-            time: 0,
-            checked: false
+            time: 0
         };
     },
     computed: {
@@ -130,73 +120,86 @@ export default {
             this.isShow = true;
             this.isShow2 = true;
         },
+        refreash() {
+            this.Show = false;
+            this.isShow = false;
+        },
+        init() {
+            this.isShow = false;
+            this.Show = true;
+            this.phoneLogin = false;
+        },
+        handleClose() {
+            this.Show = false;
+            this.phoneLogin = false;
+        },
         // 忘记密码
         passwordFn() {
             this.Show = false;
-            // this.isShow = true;
-            // this.isShow2 = false;
+            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);
-                            }
-                        })
-                );
-            });
-        },
+        // 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);
-                    }
-                });
-        },
+        // 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

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

@@ -19,7 +19,7 @@
                 <div class="login login1">中文</div>
             </div>
         </div>
-        <login-info :Show="show" @close="show = false" ref="public"></login-info>
+        <login-info :Show="show" @close="show = false"></login-info>
     </div>
 </template>
 <script>

+ 6 - 18
src/main/pc-space/src/components/listInfo.vue → src/main/pc-space/src/components/RegisterInfo.vue

@@ -56,17 +56,13 @@
             </template>
             <div class="sub-btn" style="width: 300px" v-if="isShow2">
                 <div class="btn1" @click="doRegister">立即注册</div>
-                <el-button style="background: #f2f3f5; color: #292c33" type="info" class="btn-block" @click="bbb"
+                <el-button style="background: #f2f3f5; color: #292c33" type="info" class="btn-block" @click="Login"
                     >已有账号,立即登录</el-button
                 >
             </div>
             <div class="sub-btn" style="width: 300px" v-else>
                 <el-button type="primary" class="btn-block" @click="passwordFn2">确定</el-button>
-                <el-button
-                    style="background: #f2f3f5; color: #292c33"
-                    type="info"
-                    class="btn-block"
-                    @click="flag = false"
+                <el-button style="background: #f2f3f5; color: #292c33" type="info" class="btn-block" @click="Login"
                     >想起密码,立即登录</el-button
                 >
             </div>
@@ -89,9 +85,6 @@ export default {
     },
     data() {
         return {
-            show: false,
-            phoneLogin: false,
-            flag: false,
             rules: {
                 password: [{ min: 8, max: 16, message: '密码长度在 8 到 16 个字符', trigger: 'blur' }],
                 password2: [
@@ -123,8 +116,7 @@ export default {
         }
     },
     methods: {
-        bbb() {
-            console.log(222);
+        Login() {
             this.$emit('init');
         },
         // 注册
@@ -146,8 +138,7 @@ export default {
                         })
                         .then(() => {
                             this.$message.success('注册成功');
-                            // this.flag = false;
-                            this.dialogVisible = false;
+                            this.$emit('init');
                         })
                         .catch(e => {
                             if (e) {
@@ -162,9 +153,7 @@ export default {
             this.sendMsg(this.form.phone);
         },
         handleClose() {
-            console.log(222);
-            this.isShow = false;
-            this.isSho2 = false;
+            this.$emit('refreash');
         },
         // 修改密码
         passwordFn2() {
@@ -176,10 +165,9 @@ export default {
                             password: this.form.password,
                             code: this.form.code
                         })
-                        // })
                         .then(() => {
                             this.$toast.success('修改成功');
-                            this.dialogVisible = false;
+                            this.$emit('init');
                         })
                         .catch(e => {
                             if (e) {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.