|
|
@ -63,28 +63,35 @@ |
|
|
|
<hr style="height:1px;border:none;border-top:1px solid #EEE;margin: 10px 0 5px 0;"/> |
|
|
|
<div> |
|
|
|
<div style="display: flex"> |
|
|
|
<p style="flex: 1">昵称 :{{.User.NickName}}</p> |
|
|
|
<p><a href="javascript:void(0)" style="text-decoration: none" id="editBtn">修改资料</a></p> |
|
|
|
<p style="flex: 1">昵称 :${form.nickName}</p> |
|
|
|
<p><a href="javascript:void(0)" style="text-decoration: none" @click="dialogFormVisible = true">修改资料</a></p> |
|
|
|
</div> |
|
|
|
<p>邮箱 :{{.User.Email}}</p> |
|
|
|
<p>手机 :{{.User.Mobile}}</p> |
|
|
|
<p>简介 :{{.User.DescInfo}}</p> |
|
|
|
<p>邮箱 :${form.email}</p> |
|
|
|
<p>手机 :${form.mobile}</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <el-dialog title="编辑个人信息" :visible.sync="dialogFormVisible">--> |
|
|
|
<!-- <el-form :model="form">--> |
|
|
|
<!-- <el-form-item label="活动名称" :label-width="150px">--> |
|
|
|
<!-- <el-input v-model="form.nickName"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- </el-form>--> |
|
|
|
<!-- <div slot="footer" class="dialog-footer">--> |
|
|
|
<!-- <el-button @click="dialogFormVisible = false">取 消</el-button>--> |
|
|
|
<!-- <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </el-dialog>--> |
|
|
|
<el-dialog title="编辑个人信息" :visible.sync="dialogFormVisible" width="500px"> |
|
|
|
<div> |
|
|
|
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> |
|
|
|
<el-form-item label="昵称" prop="nickName"> |
|
|
|
<el-input v-model="form.nickName"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="邮箱" prop="email"> |
|
|
|
<el-input v-model="form.email"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="手机号" prop="mobile"> |
|
|
|
<el-input v-model="form.mobile"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogFormVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveHandler">确 定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</body> |
|
|
|
<script> |
|
|
@ -98,15 +105,45 @@ |
|
|
|
nickName: '', |
|
|
|
email: '', |
|
|
|
mobile: '' |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
nickName: [ |
|
|
|
{required: true, message: '请输入昵称', trigger: 'blur'}, |
|
|
|
{min: 3, max: 50, message: '长度在 3 到 50 个字符', trigger: 'blur'} |
|
|
|
], |
|
|
|
email: [ |
|
|
|
{required: true, message: '请输入邮箱', trigger: 'blur'}, |
|
|
|
], |
|
|
|
mobile: [ |
|
|
|
{required: true, message: '请输入手机号码', trigger: 'blur'}, |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
console.log({{.User}}) |
|
|
|
this.imageUrl = {{.HeadImg}} |
|
|
|
this.form.nickName = {{.User.NickName}} |
|
|
|
this.form.email = {{.User.Email}} |
|
|
|
this.form.mobile = {{.User.Mobile}} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
editBtn(){ |
|
|
|
|
|
|
|
saveHandler(){ |
|
|
|
const _this = this |
|
|
|
this.$refs['ruleForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
$.post('/api/user/edit', _this.form, |
|
|
|
function (data) { |
|
|
|
if (data.Status == 0) { |
|
|
|
_this.$message.success('修改成功') |
|
|
|
_this.dialogFormVisible = false |
|
|
|
} else if (data.Status == 401) { |
|
|
|
window.location.href = "/login" |
|
|
|
} else { |
|
|
|
_this.$message.error('服务器异常') |
|
|
|
} |
|
|
|
}, 'json') |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleAvatarSuccess(res, file){ |
|
|
|
if(res.Status === 0){ |
|
|
@ -124,17 +161,5 @@ |
|
|
|
function refresh() { |
|
|
|
window.location.href = window.location.href |
|
|
|
} |
|
|
|
$(function () { |
|
|
|
$("#editBtn").click(function () { |
|
|
|
layer.open({ |
|
|
|
type: 2, |
|
|
|
title: '修改个人资料', |
|
|
|
shadeClose: true, |
|
|
|
shade: 0.5, |
|
|
|
area: ['450px', '415px'], |
|
|
|
content: '/iframe/user.html' //iframe的url |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
</script> |
|
|
|
</html> |