6 Star 0 Fork 0

陈建宏 / 教务系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
teadetail.html 2.70 KB
一键复制 编辑 原始数据 按行查看 历史
皮昶旭 提交于 2020-09-29 22:26 . 皮昶旭第二次作业提交
<!-- 这是教师详细信息 -->
<div class="title">
当前位置>>详细信息
</div>
<div class="tab">
<div class="box">
邮箱:<input type="email" placeholder="邮箱" v-model="email"><br>
电话:<input type="text" placeholder="请输入手机号码" v-model="tel"><br>
住址:<input type="text" placeholder="家庭住址" v-model="address"><br>
<button type="button"
style="margin-top:15px;background-color:rgb(236, 69, 69);border:none;padding: 5px 8px;border-radius: 5px;color: #fff;"
@click="detailChange()">确认修改</button>
</div>
</div>
</div>
<!-- 设置baseurl -->
<script src="js/baseUrl.js"></script>
<script>
// var emailReg=new RegExp('^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$')
var obj = new Vue({
el: '.box',
data: {
email: '',
tel: '',
address: ''
},
mounted: function () {
this.getDetail()
},
methods: {
// 信息回显
getDetail: function () {
Ajaxrequest("tea", BaseUrl + '/showTeacherInfo', 'post', null, function (data) {
if (data.code === 0) {
toastr.success(data.msg);
obj.email = data.temail;
obj.tel = data.ttel;
obj.address = data.tadress;
} else {
toastr.warning(data.msg);
}
}, function () {
toastr.error("操作失败,请重试")
})
},
// 修改信息方法
detailChange: function () {
if (this.email == "" || this.tel == "" || this.address == "") {
return false
} else {
var data = {
email: this.email,
tel: this.tel,
adress: this.address
}
Ajaxrequest("tea", BaseUrl + '/teacherUpdateInfo', 'post', JSON.stringify(data),
function (data) {
if (data.code === 0) {
toastr.success(data.msg)
obj.getDetail()
} else {
toastr.warning(data.msg)
}
},
function () {
toastr.error("操作失败,请重试")
})
}
}
}
})
</script>
1
https://gitee.com/deemo101/education-management-system.git
git@gitee.com:deemo101/education-management-system.git
deemo101
education-management-system
教务系统
master

搜索帮助