1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- var dd = dialog({contentType:'load', skin:'bk-popup', content:'提交中...'});
- var scroller1 = new IScrollPullUpDown('wrapper',{
- probeType:2,
- bounceTime: 250,
- bounceEasing: 'quadratic',
- mouseWheel:false,
- click:true,
- scrollbars:true,
- fadeScrollbars:true,
- interactiveScrollbars:false
- }, null, null);
- $(function(){
- // 判断是否登录
- checkUserAgent();
-
- var code = window.localStorage.getItem("familyCode");
- var name = window.localStorage.getItem("familyName");
- var imgUrl = window.localStorage.getItem("familyImgUrl");
- var relation = window.localStorage.getItem("familyRelation");
- // 头像为空设置默认头像
- if(imgUrl == undefined || imgUrl == null || imgUrl == ""){
- imgUrl = "../../../images/p-default.png";
- }
- $("#name").html(name);
- $("#imgUrl").attr("src", getImgUrl(imgUrl));
- // 确认提交
- $("#submit").bind("tap", function () {
- var password = $("#password").val();
- if (password.trim() == "") {
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:'密码不能为空'}).show();
- return false;
- }
- dd.show();
- var data = {};
- data.member = code;
- data.password = password;
- data.relation = relation;
- sendPost("patient/family/member_add", data, "json", "post", addFailed, addSuccesss);
- });
- });
- // 禁止拖动
- document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
- // 添加成功
- function addSuccesss (res) {
- if (res.status == 200) {
- dd.close();
- var d3 = dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg}).show();
- setTimeout(function () {
- window.location.href = "family.html";
- }, 1000);
- } else {
- //非200则为失败
- addFailed(res);
- }
- }
- // 添加失败
- function addFailed (res) {
- dd.close();
- if (res && res.msg) {
- var d1 = dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg}).show();
- } else {
- var d2 = dialog({contentType:'tipsbox', skin:'bk-popup' , content:'加载失败'}).show();
- }
- }
|