场景下开发-企业注册用户信息修改流程
场景是企业用户注册完后,想更改企业信息
1.企业客户申请流程
2.客户审核流程
企业信息保存,银行卡信息保存,提交审核(待提交,审核中,审核失败,审核成功)
判断 OpenUpdateFlag
3.更新图片根据主键更新
4.企业账户信息修改流程
修改申请()
if(审核中,审核失败){OpenUpdateFlag ==='2'}else{
OpenUpdateFlag ==='1'
}
if(OpenUpdateFlag ==='1'){
企业信息保存,银行卡信息保存(待提交)
1.带有原始企业信息的展示(OpenUpdateFlag && EntCheckStatus)
2.新增企业用户展示(企业信息保存,银行卡信息保存,提交审核)
}
页面展示
企业信息保存,银行卡信息保存,提交审核(待提交,审核中,审核失败,审核成功)
// message.jsp if(OpenUpdateFlag ==='1'){OpenUpdatePage();} /* *允许编辑输入框 * */ function OpenUpdatePage(){ $("input[type='text']").removeAttr('readonly'); $("input[type='button']").removeAttr('disabled'); $("input[type='button']").show(); $("input[type='button']").val('上传文件'); // a[id^="finishUploadDiv"] 选择其 src 属性值以 "https" 开头的每个 <a> 元素。 $('[id^="finishUploadDiv"]').removeClass('uploader_list').addClass('uploader_list_small'); $('[id^="finishUploadDiv"]').removeClass('uploader_finish').addClass('uploader_finish_small1'); $("input[type='submit']").show(); $("span[id$='Tip']").show(); $("textarea").removeAttr('disabled'); }
// bankcard.jsp if(openupdateflag ==='1'){OpenUpdatePage2();} /**允许编辑输入框 */ function OpenUpdatePage2(){ //如果提交资料再审核,则将所有输入框锁定,无法选择图片。 $("input[type='text']").attr('readonly','readonly'); $("input[type='button']").show(); $("#button-ling1").val('上传文件'); $("#finishUploadDiv1").removeClass('uploader_list').addClass('uploader_list_small'); $("#finishUploadDiv1").removeClass('uploader_finish').addClass('uploader_finish_small'); $("input[type='submit']").show(); $("select").removeAttr('disabled'); $("p[id$='Tip']").show(); }
验证插件(formValidator)
//校验 $("#EnterpriseName").formValidator({ onShow: function(){ var value = $("#EnterpriseName").val(); if(!value){ return '请输入企业名称'; }else{ $('#EnterpriseNameTip').attr('class','oncorrect'); return ' '; } // return (value ===''||value ===null)?'请输入企业名称':' '; }, // onShow: " ", onFocus: "请输入企业名称", onCorrect: " ", empty:true }) // function getOnShowMsg(str){ // var value = $("#EnterpriseName").val(); var value = $("#"+str).val(); // console.log($("#"+str).parent('div').siblings('.left1').text()); if(!value){ return '请输入'+$("#"+str).parent('div').siblings('.left1').text(); }else{ $('#'+str+'Tip').attr('class','oncorrect'); return ' '; } // return (value ===''||value ===null)?'请输入企业名称':' '; }
图片上传插件
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
/* *使用方法{template:'<div id="imgdiv"><img id="imgShow" width="120" height="120" /></div>'} * <input type="file" id="up_img" /> *调用代码: * new uploadPreview({ UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow" }); *参数说明: *UpBtn:选择文件控件ID; *DivShow:DIV控件ID; *ImgShow:图片控件ID; *Width:预览宽度; *Height:预览高度; *ImgType:支持文件类型 格式:["jpg","png"]; *callback:选择文件后回调方法; *work:图片预览插件 */ function isNull(value){ if (typeof (value) == "function") { return false; } if (value == undefined || value == null || value == "" || value.length == 0) { return true; } return false; }; var uploadPreview = function(setting){ // setting对象 var _self = this; // 初始化参数 _self.initSetting = { UpBtn: "", DivShow: "", ImgShow: "", Width: 100, Height: 100, ImgType: ["gif", "jpeg", "jpg", "bmp", "png"], ErrMsg: "选择文件错误,图片类型必须是(gif,jpeg,jpg,bmp,png)中的一种", callback: function() { } }; _self.Setting ={ UpBtn: isNull(setting.UpBtn)?_self.initSetting.UpBtn:setting.UpBtn, DivShow: isNull(setting.UpBtn)?_self.initSetting.DivShow:setting.DivShow, ImgShow: isNull(setting.UpBtn)?_self.initSetting.ImgShow:setting.ImgShow, Width: isNull(setting.UpBtn)?_self.initSetting.Width:setting.Width, Height: isNull(setting.UpBtn)?_self.initSetting.Height:setting.Height, ImgType: isNull(setting.UpBtn)?_self.initSetting.ImgType:setting.ImgType, ErrMsg: isNull(setting.UpBtn)?_self.initSetting.ErrMsg:setting.ErrMsg, callback: isNull(setting.UpBtn)?_self.initSetting.callback:setting.callback }; /* *work:或取文本url */ // _self.getObjectURL = function(file) {} _self.getObjectURL = function(file) { var url = null; if (window.createObjectURL != undefined) { url = window.createObjectURL(file); } else if (window.URL != undefined) { url = window.URL.createObjectURL(file); } else if (window.webkitURL != undefined) { url = window.webkitURL.createObjectURL(file); } return url; }; /* *work:绑定事件 */ _self.Bind = function() { document.getElementById(_self.Setting.UpBtn).onchange = function() { if (this.value) { if (!RegExp("\.(" + _self.Setting.ImgType.join("|") + ")$", "i").test(this.value.toLowerCase())) { alert(_self.Setting.ErrMsg); this.value = ""; return false; } if (navigator.userAgent.indexOf("MSIE") > -1) { try { document.getElementById(_self.Setting.ImgShow).src = _self.getObjectURL(this.files[0]); } catch (e) { var div = document.getElementById(_self.Setting.DivShow); this.select(); top.parent.document.body.focus(); var src = document.selection.createRange().text; document.selection.empty(); document.getElementById(_self.Setting.ImgShow).style.display = "none"; div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)"; div.style.width = _self.Setting.Width + "px"; div.style.height = _self.Setting.Height + "px"; div.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = src; } } else { document.getElementById(_self.Setting.ImgShow).src = _self.getObjectURL(this.files[0]); } _self.Setting.callback(); } } }; /* *work:执行事件 */ _self.Bind(); } /* *work:文件上传,本地预览 * @param index */ function fileClick(index) { var settings ={ UpBtn: "theFile"+index, DivShow: "imgdiv"+index, ImgShow: "imgShow"+index,callback:togglecu(index) }; new uploadPreview(settings); $("#theFile"+index).click(); } /* *work:显示按钮 * @param index */ function togglecu(index) { var id_upda = "#button-upda"+index; if ($(id_upda)) { $(id_upda).show(); } }