Commit 811d28c5 authored by zhoujun's avatar zhoujun

Merge branch 'test' of http://gitlab.cccwangluo.com/zhoujun/uc_card into test

parents f7f09f2f 7bb9a9f1
...@@ -202,13 +202,10 @@ ccwl.handleBindOrangeCode = function(params,type){ ...@@ -202,13 +202,10 @@ ccwl.handleBindOrangeCode = function(params,type){
},function (res){ },function (res){
if(type==="ald"){ if(type==="ald"){
$('.dialog-confirm .toast-msg').text(res.message); $('.dialog-confirm .toast-msg').text(res.message);
$('.dialog-confirm .btn').attr('href','/wx/index'); $('.dialog-confirm .btn').attr('href','/');
$('.dialog-confirm').fadeIn(); $('.dialog-confirm').fadeIn();
return false; return false;
}else{ }else{
$('.icon-orange .fs-normal').text(res.data.bind_code);
$('.icon-orange').append('<a href="/ald_gift">领取礼包</a>');
$('.dialog-orange,.bind-orange').fadeOut();
ccwl.showToast({ ccwl.showToast({
msg: res.message, msg: res.message,
}) })
......
This diff is collapsed.
...@@ -575,12 +575,23 @@ textarea { ...@@ -575,12 +575,23 @@ textarea {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: scroll; overflow: scroll;
background: rgba(0, 0, 0, 0.7) url("../images/save_img_bg.png") no-repeat center;
background-size: 100% auto;
} }
.dialog-img img { .dialog-img .dialog-img-content {
position: absolute; position: absolute;
width: 90%; width: 90%;
left: 5%; left: 5%;
top: 1rem; top: 1rem;
padding-top: 2.5rem;
}
.dialog-img .dialog-img-content .img-scroll {
height: 13.5rem;
overflow: scroll;
width: 100%;
}
.dialog-img .dialog-img-content img {
width: 100%;
} }
.fixed { .fixed {
position: fixed; position: fixed;
......
...@@ -533,11 +533,22 @@ ...@@ -533,11 +533,22 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: scroll; overflow: scroll;
img{ background: rgba(0,0,0,.7) url("../images/save_img_bg.png") no-repeat center;
background-size: 100% auto;
.dialog-img-content{
.pa(); .pa();
width: 90%; width: 90%;
left: 5%; left: 5%;
top: 1rem; top: 1rem;
padding-top: 2.5rem;
.img-scroll{
height: 13.5rem;
overflow: scroll;
width: 100%;
}
img{
width: 100%;
}
} }
} }
.fixed{ .fixed{
......
...@@ -22,6 +22,9 @@ card.ajax = function (data, callback) { ...@@ -22,6 +22,9 @@ card.ajax = function (data, callback) {
if(res.error == 1019){ if(res.error == 1019){
location.href="/login"; location.href="/login";
return false; return false;
}else if(res.error == 4003 ){
location.href = "/bind/ald/code"
return false;
} }
callback(res); callback(res);
} }
...@@ -43,6 +46,7 @@ card.handleGetServer = function (receive){ ...@@ -43,6 +46,7 @@ card.handleGetServer = function (receive){
userId:res.data.userId userId:res.data.userId
} }
card.handleGetRoleList(params); card.handleGetRoleList(params);
$('.dialog-server').fadeIn();
}) })
} }
......
var card={relationRole:{},clickFlag:!0,bindInfo:{}};card.ajax=function(e,t){e.data._token=$('meta[name="token"]').attr("value"),$.ajax({type:e.type?e.type:"GET",url:location.origin+e.url,dataType:"json",data:e.data,error:function(e){try{var t=e.responseText;alert(t.message)}catch(e){alert("系统开小差~~")}},success:function(e){return 1019==e.error?(location.href="/login",!1):4003==e.error?(location.href="/bind/ald/code",!1):void t(e)}}),setTimeout(function(){card.clickFlag=!0},1e3)},card.handleGetServer=function(e){this.ajax({url:"/ald_bind_info",type:"get",data:{}},function(e){card.bindInfo=e.data;var t={serverId:e.data.serverId,userId:e.data.userId};card.handleGetRoleList(t),$(".dialog-server").fadeIn()})},card.handleGetRoleList=function(e){this.ajax({url:"/get_role_list",type:"POST",data:e},function(e){var t=e.data,a="",r=[];card.relationRole=t;for(var o in t)r.push({id:o,name:t[o].name});a='<option value="-1">请选择</option>',$(r).each(function(e,t){a+='<option value="'+t.id+'">'+t.name+"</option>"}),$(".server-select").html(a)})},card.bindRole=function(e){this.ajax({url:"/bind/ald/role",type:"POST",data:e},function(t){0===t.error?($(".dialog").hide(),location.href="/card/html?roleId="+e.roleId+"&serverId="+e.serverId):alert(t.msg)})};var initRoleList=function(e){var t=card.relationRole[e].list,a='<option value="-1">请选择</option>';$(t).each(function(e,t){a+='<option value="'+t.roleId+'">'+t.roleName+"</option>"}),$(".role-select").html(a)};$(function(){$(".btn-card-bind-role").click(function(){var e=$(".server-select option:selected").val(),t=$(".server-select option:selected").text(),a=$(".role-select option:selected").val();if(roleName=$(".role-select option:selected").text(),!e||"-1"==e)return alert("请选择服务器"),!1;if(!a||"-1"==a)return alert("请选择角色"),!1;var r={roleId:a,serverId:e,serverName:t,roleName:roleName};card.clickFlag&&card.bindRole(r)}),$(".server-select").change(function(){var e=$(this).val();initRoleList(e)})});
\ No newline at end of file
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
@if($userImgStatus == -1) <img src="/static/postcard/images/img_add.jpg" class="img img-add" alt=""> <input type="file" id="file"> @endif @if($userImgStatus == -1) <img src="/static/postcard/images/img_add.jpg" class="img img-add" alt=""> <input type="file" id="file"> @endif
@if($userImgStatus == 0) <img src="/static/postcard/images/img_sh.jpg" class="img img-sh" alt=""> @endif @if($userImgStatus == 0) <img src="/static/postcard/images/img_sh.jpg" class="img img-sh" alt=""> @endif
@if($userImgStatus == 1) <img src="{{ $userImg }}" class="img img-sh" alt=""> @endif @if($userImgStatus == 1) <img src="{{ $userImg }}" class="img img-sh" alt=""> @endif
@if($userImgStatus == 2) <img src="" class="img img-sh" alt=""> @endif @if($userImgStatus == 2) <img src="/static/postcard/images/sh_fail.jpg" class="img img-sh" alt=""> <input type="file" id="file"> @endif
</div> </div>
<div class="bottom-container"> <div class="bottom-container">
<!--分享--> <!--分享-->
...@@ -125,7 +125,11 @@ ...@@ -125,7 +125,11 @@
</div> </div>
<div class="dialog dialog-img hide"> <div class="dialog dialog-img hide">
<img src="" alt=""> <div class="dialog-img-content">
<div class="img-scroll">
<img src="" alt="">
</div>
</div>
</div> </div>
<div class="loading hide"> <div class="loading hide">
<span></span> <span></span>
...@@ -156,7 +160,7 @@ ...@@ -156,7 +160,7 @@
renderHtml('#wq2','{{ $armsExciting }}'); renderHtml('#wq2','{{ $armsExciting }}');
renderHtml('#wq3','{{ $armsScore }}'); renderHtml('#wq3','{{ $armsScore }}');
// 上传图片 // 上传图片
$('#file').change(function(e){ $(document).on('change','#file',function(e){
var formData = new FormData(); var formData = new FormData();
var file = $("#file")[0].files[0]; var file = $("#file")[0].files[0];
var acceptFileTypes = /^image\/(gif|jpe?g|png)$/i; var acceptFileTypes = /^image\/(gif|jpe?g|png)$/i;
...@@ -182,7 +186,7 @@ ...@@ -182,7 +186,7 @@
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
$('.img-add').hide(); $('.img-add').hide();
$('.img-sh').show(); $('.ggsk-container').html('<img src="/static/postcard/images/img_sh.jpg" class="img img-sh" alt=""><input type="file" id="file">');
}, },
error: function(data) { error: function(data) {
...@@ -202,8 +206,8 @@ ...@@ -202,8 +206,8 @@
}).then(canvas => { }).then(canvas => {
var image = canvas.toDataURL('image/jpeg', 1.0); var image = canvas.toDataURL('image/jpeg', 1.0);
var img = '<img src="'+image+'">'; var img = '<img src="'+image+'">';
$('.dialog').append(img); $('.dialog-img-content .img-scroll').html(img);
$('.dialog').show(); $('.dialog-img').show();
$('.loading').hide(); $('.loading').hide();
}); });
$('.postcard-container').addClass('fixed'); $('.postcard-container').addClass('fixed');
...@@ -221,7 +225,30 @@ ...@@ -221,7 +225,30 @@
$(this).fadeOut(); $(this).fadeOut();
$('.btn-save,.btn-share').show(); $('.btn-save,.btn-share').show();
$('.postcard-container').removeClass('fixed'); $('.postcard-container').removeClass('fixed');
}) });
function wxShare(){
var data = res.response.sign;
var appId = data.appId;
var timestamp = data.timestamp;
var nonceStr = data.nonceStr;
var signature = data.signature;
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: appId, // 必填,公众号的唯一标识
timestamp: timestamp, // 必填,生成签名的时间戳
nonceStr: nonceStr, // 必填,生成签名的随机串
signature: signature, // 必填,签名,见附录1
jsApiList: ['updateAppMessageShareData', 'onMenuShareAppMessage', 'hideMenuItems']// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,
// config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,
// 则须把相关接口放在ready函数中调用来确保正确执行。
// 对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
});
}
}); });
</script> </script>
</body> </body>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</div> </div>
<a href="javascript:" class="btn-start"></a> <a href="javascript:" class="btn-start"></a>
<div class="dialog hide"> <div class="dialog dialog-server hide">
<div class="content"> <div class="content">
<a href="javascript:" class="close"></a> <a href="javascript:" class="close"></a>
<ul> <ul>
...@@ -54,9 +54,8 @@ ...@@ -54,9 +54,8 @@
$('.dialog').fadeOut(); $('.dialog').fadeOut();
}); });
$('.btn-start').click(function (){ $('.btn-start').click(function (){
$('.dialog').fadeIn(); card.handleGetServer();
}); });
card.handleGetServer();
}) })
</script> </script>
</body> </body>
......
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 to comment