Commit d94b736b by libai

测试

parent d671580b
Showing with 55 additions and 2 deletions
......@@ -170,8 +170,10 @@ $(function(){
var year=0
var month=0
var day=0
var faceGoT=null
var dHeight=$(document).height()
$(".revise-face").on("click",function(){
localStorage.face=0
layer.open({
type: 2,
title: false,
......@@ -180,7 +182,39 @@ $(function(){
area: ["10rem", "12rem"],
content:'upload/index.html?v=20220630',
// content:'upload/index.html',
})
})
clearInterval(faceGoT)
faceGoT=setInterval(function(){
if(localStorage.face!=0){
$(".myRoom-face").attr("src",localStorage.face)
clearInterval(faceGoT)
$.ajax({
url:$ip+'user/updateUserData',
data:{
uid:localStorage.uid,
token:localStorage.token,
faceimg:localStorage.face,
pageID:localStorage.canvasCode,
// nickName:$(".login-more-top-p1").text()
},
type:'post',
success:function(data){
//console.log('修改頭像姓名',data)
if(data.code!=1){
layer.msg(data.msg);
}
if(data.code==1){
layer.closeAll()
layer.msg("修改成功")
sessionStorage.faceGo=0
setTimeout(function(){
window.location.reload()
},1000)
}
}
})
}
},500)
})
$.ajax({
url:$ip+'room/enterRoom',
......
......@@ -200,7 +200,26 @@
<script type="text/javascript">
//做个下简易的验证 大小 格式
var lastTouchEnd = 0 //更新手指弹起的时间
document.documentElement.addEventListener("touchstart", function (event) {
//多根手指同时按下屏幕,禁止默认行为
if (event.touches.length > 1) {
event.preventDefault();
}
});
document.documentElement.addEventListener("touchend", function (event) {
var now = (new Date()).getTime();
if (now - lastTouchEnd <= 300) {
//当两次手指弹起的时间小于300毫秒,认为双击屏幕行为
event.preventDefault();
}else{ // 否则重新手指弹起的时间
lastTouchEnd = now;
}
}, false);
//阻止双指放大页面
document.documentElement.addEventListener("gesturestart", function (event) {
event.preventDefault();
});
$(".close").unbind("click").on("click",function(){
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment