| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- mui.init();
- mui.init({
- beforeback: function() {
- var list = plus.webview.currentWebview().opener();
- //refresh是A页面自定义事件
- mui.fire(list, 'refresh');
- //返回true,继续页面关闭逻辑
- return true;
- }
- });
- //初始化单页的区域滚动
- mui('.mui-scroll-wrapper').scroll();
- mui.plusReady(function() {
- mui.ajax(huayi.config.callcenter_url + '/UserAccount/GetNowUser', {
- data: {
- token: localStorage.getItem("token"),
- },
- dataType: 'json', //服务器返回json格式数据
- async: false,
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
- var RoleCode = data.data.role.F_RoleCode;
- $("#UserId").val(data.data.user.F_UserId)
- $(".F_UserName").val(data.data.user.F_UserName);
-
- if (localStorage.getItem("F_See", data.data.user.F_See)=="3") {
- $(".F_UserName").attr("disabled","disabled");
- }
- $(".rolname").val(data.data.user.F_UserCode);
- $(".password").val(data.data.user.F_Password);
- if(!data.data.FileUrl[0]) {
- $(".feedback .image-item").css("background-image", "url(../img/3.png)")
- } else {
- $(".feedback .image-item").css("background-image", "url(" + data.data.FileUrl[0].F_Url + ")")
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- });
- })
- $('#xgPassword').on('tap', function() {
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + '/UserAccount/ResetPwd',
- async: true,
- data: {
- usercode: $('.rolname').val(), //账号
- pwd: $('.password').val(), //密码
- token: localStorage.getItem("token")
- },
- success: function(data) {
- if(data.state == "success") {
- mui.toast('修改成功!');
- setTimeout(function () {
- plus.runtime.restart();
- },1500)
- } else {
- mui.toast(data.message);
- }
- }
- });
- })
|