<style scoped>
.comp-classpage input,.comp-classpage textarea,.comp-classpage select,.comp-classpage button{padding:0;}
hr {margin: 0;border: 0.17rem solid #e6e6e9;}
body {background-color: #f4f4f6;}
.comp-classpage{background-color: #e6e6e9;height:100%;height: 100vh;}
.UserInfo-List {list-style: none;background-color: #FFFFFF;margin: 0;padding: 0.4rem 3%;padding-bottom: 0;}
.UserInfo-Item{width:100%;height: 3rem;border-bottom: 1px solid #f4f4f6;}
.UserInfo-Item:last-child{border-bottom: none;}
.UserInfo-Item-Left{float: left;width:30%;height: 100%;line-height: 3rem;}
.UserInfo-Item-Right{float: left;width:70%;height: 100%;line-height: 3rem;text-align: right;color:#b3b3b3;}
.UserInfo-Item-Right img{width:2.8rem;height:2.8rem;float: right;border: none;}
.UserInfo-UserLogo {border-radius: 100%;}
.UserInfo-Cursor{background-image: url(https://release-sup8-images.oss-cn-shanghai.aliyuncs.com/h5_shop/arrow.png);background-repeat: no-repeat;background-position-x:right;background-position-y: center;background-size: 0.6rem 1.2rem;}
.UserInfo-RightAlign{padding-right:1rem;}
/** 模态对话框阴影层样式 */
.UpdateUserInfo-Modal{width: 100%;height: 100%;z-index: 3;position: absolute;margin: 0;padding: 0;top: 0;bottom: 0;left: 0;right: 0;display: none;background: #000;filter:alpha(Opacity=50);-moz-opacity:0.5;opacity: 0.5;}
/** 修改昵称 Begin  */
.UpdateNickname-Div{width: 94%;background-color: #FFFFFF;border-radius:0.5rem 0.5rem 0.5rem 0.5rem;z-index: 4;position: absolute;display: none;top:50%;margin-top:-10rem;left:50%;margin-left:-47%;}
.UpdateNickname-Head{color:#c03546;width:100%;height: 2rem;line-height: 2rem;text-align: center;font-size: 1rem;font-weight: bold;padding: 0;margin-top: 2rem;}
.UpdateNickname-Center{width:100%;height: 3rem;line-height: 3rem;text-align: center;padding: 0;margin-top: 1rem;}
.UpdateNickname-Center input{border:1px solid #c03546;height: 2.5rem;font-size:1rem;padding: 0rem 0.5rem 0rem 0.5rem;width: 94%;box-sizing: border-box;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;border-radius:0.3rem 0.3rem 0.3rem 0.3rem;color:#b3b3b3;outline: none;}
.UpdateNickname-Bottomm{width: 94%;height: 3rem;line-height: 3rem;text-align: center;padding: 0;margin: 0 auto;margin-top: 1rem;margin-bottom: 2rem;}
.UpdateNickname-ConfirmBtn{width:46%;height: 2.5rem;background-color: #c03546;color: #FFFFFF;font-weight: bold;border:1px solid #c03546;float: left;letter-spacing:0.2rem;border-radius: 0;outline:0;appearance:none;
-moz-appearance:none; /* Firefox */
-webkit-appearance:none;}
.UpdateNickname-CancelBtn{width:46%;height: 2.5rem;background-color: #FFFFFF;color: #c03546;font-weight: bold;border:1px solid #c03546;float: right;letter-spacing:0.2rem;border-radius: 0;outline:0;appearance:none;
-moz-appearance:none; /* Firefox */
-webkit-appearance:none; }
/** 修改昵称 End  */
/** 修改手机号 Begin  */
.UpdateMobile-Div{width: 94%;background-color: #FFFFFF;border-radius:0.5rem 0.5rem 0.5rem 0.5rem;z-index: 4;position: absolute;display: none;top:50%;margin-top:-10rem;left:50%;margin-left:-47%;}
.UpdateMobile-Head{color:#c03546;width:100%;height: 2rem;line-height: 2rem;text-align: center;font-size: 1rem;font-weight: bold;padding: 0;margin-top: 2rem;}
.UpdateMobile-Center{width:100%;height: 3rem;line-height: 3rem;text-align: center;padding: 0;margin-top: 1rem;}
.UpdateMobile-Center-Div1{border:1px solid #c03546;height: 2.6rem;font-size:1rem;padding: 0rem 0.5rem 0rem 0.5rem;width: 94%;box-sizing: border-box;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;border-radius:0.3rem 0.3rem 0.3rem 0.3rem;margin: 0 auto;}
.UpdateMobile-Center-Div1-LeftLable{width:23%;float: left;height: 2.5rem;line-height: 2.5rem;text-align: right;}
.UpdateMobile-Center-Div1-RightInput{width:75%;float: left;height: 2.5rem;line-height: 2.5rem;vertical-align:middle;}
.UpdateMobile-Center-Div1-RightInput input{width:100%;height: 2rem;line-height: 2rem;text-align: left;border:none;outline: none;font-size:1rem;color: #c03546;}
.UpdateMobile-Center-Div2{border:1px solid #c03546;height: 2.6rem;font-size:1rem;padding: 0rem 0.5rem 0rem 0.5rem;width: 94%;box-sizing: border-box;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;border-radius:0.3rem 0.3rem 0.3rem 0.3rem;margin: 0 auto;}
.UpdateMobile-Center-Div2-LeftLable{width:23%;float: left;height: 2.5rem;line-height: 2.5rem;text-align: right;}
.UpdateMobile-Center-Div2-RightInput{width:36%;float: left;height: 2.5rem;line-height: 2.5rem;vertical-align:middle;}
.UpdateMobile-Center-Div2-RightInput input{width:100%;height: 2rem;line-height: 2rem;text-align: left;border:none;outline: none;font-size:1rem;color: #c03546;}
.UpdateMobile-Center-Div2-Separate{width:0.06rem;float: left;height: 1.5rem;background-color: #c03546;margin-top: 0.55rem;margin-left: 0.1rem;}
.UpdateMobile-Center-Div2-RightLable{width:36%;float: left;height: 2.5rem;line-height: 2.5rem;background-image: url(https://release-sup8-images.oss-cn-shanghai.aliyuncs.com/h5_shop/arrow_red.png);background-repeat: no-repeat;background-position-x:right;background-position-y: 54%;background-size: 0.5rem 30%;color: #c03546;text-align: right;padding-right: 0.6rem;}
.UpdateMobile-Bottomm{width: 94%;height: 3rem;line-height: 3rem;text-align: center;padding: 0;margin: 0 auto;margin-top: 1.6rem;margin-bottom: 1.6rem;}
.UpdateMobile-ConfirmBtn{width:46%;height: 2.5rem;background-color: #c03546;color: #FFFFFF;font-weight: bold;border:1px solid #c03546;float: left;letter-spacing:0.2rem;border-radius: 0;outline: 0;appearance:none;
-moz-appearance:none; /* Firefox */
-webkit-appearance:none; }
.UpdateMobile-CancelBtn{width:46%;height: 2.5rem;background-color: #FFFFFF;color: #c03546;font-weight: bold;border:1px solid #c03546;float: right;letter-spacing:0.2rem;border-radius: 0;outline: 0;appearance:none;
-moz-appearance:none; /* Firefox */
-webkit-appearance:none; }
/** 修改手机号 End  */
/** 修改密码 Begin  */
.UpdatePwd-Div{width: 94%;background-color: #FFFFFF;border-radius:0.5rem 0.5rem 0.5rem 0.5rem;z-index: 4;position: absolute; display: none;top:50%;margin-top:-10rem;left:50%;margin-left:-47%;}
.UpdatePwd-Head{color:#c03546;width:100%;height: 2rem;line-height: 2rem;text-align: center;font-size: 1rem;font-weight: bold;padding: 0;margin-top: 2rem;}
.UpdatePwd-Center{width:100%;height: 3rem;line-height: 3rem;text-align: center;padding: 0;margin-top: 1rem;}
.UpdatePwd-Center input{border:1px solid #c03546;height: 2.5rem;font-size:1rem;padding: 0rem 0.5rem 0rem 0.5rem;width: 94%;box-sizing: border-box;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;border-radius:0.3rem 0.3rem 0.3rem 0.3rem;color:#b3b3b3;outline: none;}
.UpdatePwd-Bottomm{width: 94%;height: 3rem;line-height: 3rem;text-align: center;padding: 0;margin: 0 auto;margin-top:1.6rem;margin-bottom: 1.6rem;}
.UpdatePwd-ConfirmBtn{width:46%;height: 2.5rem;background-color: #c03546;color: #FFFFFF;font-weight: bold;border:1px solid #c03546;float: left;letter-spacing:0.2rem;border-radius: 0;outline: 0;appearance:none;
-moz-appearance:none; /* Firefox */
-webkit-appearance:none; }
.UpdatePwd-CancelBtn{width:46%;height: 2.5rem;background-color: #FFFFFF;color: #c03546;font-weight: bold;border:1px solid #c03546;float: right;letter-spacing:0.2rem;border-radius: 0;outline: 0;appearance:none;
-moz-appearance:none; /* Firefox */
-webkit-appearance:none; }
/** 修改密码 End  */
</style>
<template>
<div class="container comp-classpage jfBaseSize" v-cloak v-bind:style="vh?'height:100vh':'height: 100%;'">
    <hr />
    <div id="JFComp-UserInfo" class="JFComp-UserInfo">
        <ul class="UserInfo-List">
            <li class="UserInfo-Item">
                <div class="UserInfo-Item-Left">头&nbsp;&nbsp;&nbsp;像</div>
                <div class="UserInfo-Item-Right">
                    <img class="UserInfo-UserLogo" v-bind:src="headimgurl" />
                </div>
            </li>
            <li class="UserInfo-Item" v-on:click="UpdateNickname()">
                <div class="UserInfo-Item-Left">昵&nbsp;&nbsp;&nbsp;称</div>
                <div class="UserInfo-Item-Right UserInfo-Cursor">
                    <span class="UserInfo-RightAlign">
                         {{loginUserInfo.PetName}}
                    </span>
                </div>
            </li>
            <li class="UserInfo-Item" v-on:click="UpdateMobile()">
                <div class="UserInfo-Item-Left">手机号</div>
                <div class="UserInfo-Item-Right UserInfo-Cursor">
                    <span class="UserInfo-RightAlign">
                        {{loginUserInfo.Phone}}
                    </span>
                </div>
            </li>
            <li class="UserInfo-Item" v-on:click="UpdatePwd()">
                <div class="UserInfo-Item-Left">密&nbsp;&nbsp;&nbsp;码</div>
                <div class="UserInfo-Item-Right">
                    <span class="UserInfo-RightAlign">******</span>
                </div>
            </li>
      </ul>
    </div>
    <!-- 模态对话框阴影层 !-->
    <div class="UpdateUserInfo-Modal"></div>
    <!-- 修改昵称 !-->
    <div class="UpdateNickname-Div">
        <div  class="UpdateNickname-Head">修改昵称</div>
        <div class="UpdateNickname-Center">
            <input type="text" class="ChangeNickname" v-bind:value="loginUserInfo.PetName" placeholder="请输入昵称" maxlength="10" />
        </div>
        <div class="UpdateNickname-Bottomm">
            <input type="button" value="确定" class="UpdateNickname-ConfirmBtn" v-on:click="saveNickname()"/>
            <input type="button" value="取消" class="UpdateNickname-CancelBtn" v-on:click="showUpdateNickname(false)"/>
        </div>
    </div>
    <!-- 修改手机号码 !-->
    <div class="UpdateMobile-Div">
        <div  class="UpdateMobile-Head">修改手机号</div>
        <div class="UpdateMobile-Center">
            <div class="UpdateMobile-Center-Div1">
                <div class="UpdateMobile-Center-Div1-LeftLable">手机号&nbsp;</div>
                <div class="UpdateMobile-Center-Div1-RightInput">
                    <input type="text" class="UpdateMobile" v-bind:value="loginUserInfo.Phone" placeholder="请输入手机号码" maxlength="11" />
                </div>
            </div>
        </div>
        <div class="UpdateMobile-Center" style="margin-top:0.5rem">
            <div class="UpdateMobile-Center-Div2">
                <div class="UpdateMobile-Center-Div2-LeftLable">验证码&nbsp;</div>
                <div class="UpdateMobile-Center-Div2-RightInput">
                    <input type="text" class="UpdateVCode" value="" placeholder="请输入验证码" maxlength="6" />
                </div>
                <div class="UpdateMobile-Center-Div2-Separate"></div>
                <div class="UpdateMobile-Center-Div2-RightLable UpdateMobile-GetVCodeBtn" v-on:click="UpdateMobileSendCode()">获取验证码</div>
            </div>
        </div>
        <div class="UpdateMobile-Bottomm">
            <input type="button" value="确定" class="UpdateMobile-ConfirmBtn" v-on:click="saveMobile()"/>
            <input type="button" value="取消" class="UpdateMobile-CancelBtn" v-on:click="showUpdateMobile(false)"/>
        </div>
    </div>
    <!-- 修改密码 !-->
    <div class="UpdatePwd-Div">
        <div  class="UpdatePwd-Head">修改密码</div>
        <div class="UpdateMobile-Center">
            <div class="UpdateMobile-Center-Div1">
                <div class="UpdateMobile-Center-Div1-LeftLable">手机号&nbsp;</div>
                <div class="UpdateMobile-Center-Div1-RightInput">
                    <input type="text" class="ChangeMobile" v-bind:value="loginUserInfo.Phone" placeholder="请输入手机号码" maxlength="11" readonly="readonly" />
                </div>
            </div>
        </div>
        <div class="UpdateMobile-Center" style="margin-top:0.5rem">
            <div class="UpdateMobile-Center-Div2">
                <div class="UpdateMobile-Center-Div2-LeftLable">验证码&nbsp;</div>
                <div class="UpdateMobile-Center-Div2-RightInput">
                    <input type="text" class="ChangeVCode" value="" placeholder="请输入验证码" maxlength="6" />
                </div>
                <div class="UpdateMobile-Center-Div2-Separate"></div>
                <div class="UpdateMobile-Center-Div2-RightLable UpdatePwd-GetVCodeBtn" v-on:click="UpdatePwdSendCode()">获取验证码</div>
            </div>
        </div>
        <div class="UpdateMobile-Center" style="margin-top:0.5rem">
            <div class="UpdateMobile-Center-Div1">
                <div class="UpdateMobile-Center-Div1-LeftLable">新密码&nbsp;</div>
                <div class="UpdateMobile-Center-Div1-RightInput">
                    <input type="password" class="ChangePwd" value="" placeholder="请输入新密码" maxlength="30" />
                </div>
            </div>
        </div>
        <div class="UpdatePwd-Bottomm">
            <input type="button" value="确定" class="UpdatePwd-ConfirmBtn" v-on:click="savePwd()"/>
            <input type="button" value="取消" class="UpdatePwd-CancelBtn" v-on:click="showUpdatePwd(false)"/>
        </div>
    </div>
</div>
</template>
<script> 
	import $ from 'jquery'
	import JfApiHelper from "../assets/js/JfapiHelper.js";
	import MintUI from 'mint-ui';

	export default {
		name: 'JfCompUserInfo',
		props: ["cfg", "comp"],
		data() {
			var that = this;

			//修改手机号码倒计时
			setTimeout(function () {
				that.UpdateMobileSwitchTime()
			}, 1000);

			//修改密码倒计时
			setTimeout(function () {
				that.UpdatePwdSwitchTime()
			}, 1000);

			//从缓存中得到登录信息
			var loginUserInfo = null;
			var tempLoginInfo = localStorage.getItem("loginInfo");
			if ($.trim(tempLoginInfo) != "") {
				loginUserInfo = eval('(' + tempLoginInfo + ')');
            }
            var headimgurl="";
            var wxUserInfo=this.sup8.context.wxUser;
            if(wxUserInfo)
            {
                headimgurl=wxUserInfo.headimgurl;
            }
            else
            {
                headimgurl=loginUserInfo.UserLogo;
            }
			return {
                headimgurl:headimgurl,
				loginUserInfo: loginUserInfo,
				//修改手机号码获得间隔秒数
				OldUpdateMobileTime: 0,
				//修改手机号码倒计时对象
				UpdateMobileTimerObj: null,
				//修改密码获得间隔秒数
				OldUpdatePwdTime: 0,
				//修改密码倒计时对象
				UpdatePwdTimerObj: null,
				Disenable: true,
				vh:false,
			};
		},
		methods: {
			//倒计时功能
			UpdateMobileSwitchTime() {
				var that = this;
				if (that.OldUpdateMobileTime <= 0) {
					clearTimeout(that.UpdateMobileTimerObj);
					that.OldUpdateMobileTime = 0;
					var getVCodeBtn = $(".UpdateMobile-GetVCodeBtn");
					getVCodeBtn.html("获取验证码");
					that.Disenable = false;
					return;
				}
				that.OldUpdateMobileTime--;
				var getVCodeBtn = $(".UpdateMobile-GetVCodeBtn");
				getVCodeBtn.html("已发送(" + that.OldUpdateMobileTime + ")"); 
				that.Disenable = true;
				that.UpdateMobileTimerObj = setTimeout(function () {
					that.UpdateMobileSwitchTime()
				}, 1000);
			},
			//修改手机号码获取发送验证码
			UpdateMobileSendCode() {
				var that = this;
				if (that.Disenable) {
					return false;
				}
				var updateMobileObj = $(".UpdateMobile");//手机号
				var reg = /^(((134|135|136|137|138|139|150|151|152|154|157|158|159|182|183|184|187|188|147|178|179|198)[0-9]{8})|((1703)[0-9]{7})|((1705)[0-9]{7})|((1706)[0-9]{7})|((130|131|132|145|155|156|166|175|176|185|186)[0-9]{8})|((1704)[0-9]{7})|((1707)[0-9]{7})|((1708)[0-9]{7})|((1709)[0-9]{7})|((171[0-9])[0-9]{7})|((133|149|153|173|177|180|181|189|199|191)[0-9]{8})|((1700)[0-9]{7})|((1701)[0-9]{7})|((1702)[0-9]{7}))$/;
				if (!reg.test(updateMobileObj.val())) {
					MintUI.Toast('手机号填写不正确！');
					updateMobileObj.select();
					return false;
				}
				//发送验证码
				var getVCodeBtn = $(".UpdateMobile-GetVCodeBtn");
				var url = "/integral/SendVCode";
				var dataParams = {
					EnterpriseNo: that.loginUserInfo.EnterpriseNo,
					Mobile: updateMobileObj.val(),
					Type: 3,
					LanguageType: "zh-cn"
				};
				var cbBeforeSend = function () {
					//getVCodeBtn.html('正在获取...');
				};
				var cbComplete = function () {
					//getVCodeBtn.html('获取验证码');
				};
				var cbSuccess = function (resultData) {
					if ((resultData || "") != "") {
						if ((typeof resultData).toLowerCase() == "string") {
							resultData = eval('(' + resultData + ')');
						}
						if (resultData.flag && (resultData.errorCode || "") == "0") {
							// 倒计时
							that.OldUpdateMobileTime = 61;
							that.UpdateMobileSwitchTime();
						}
						else {
							MintUI.Toast(resultData.msg);
						}
					}
				};
				var cbError = function (jqXHR, textStatus, errorThrown) {
					MintUI.Toast(jqXHR.responseText);
				};
				//请求后端
				JfApiHelper.CommonCallService(url, dataParams, cbSuccess, cbError, cbBeforeSend, cbComplete);
			},
			//修改昵称
			UpdateNickname() {
				//显示修改昵称
				var that = this;
				that.showUpdateNickname(true);
			},
			//修改手机号码
			UpdateMobile() {
				//显示修改手机号
				var that = this;
				that.showUpdateMobile(true);
			},
			//修改密码
			UpdatePwd() {
				//显示修改密码
				var that = this;
				that.showUpdatePwd(true);
			},
			//显示隐藏修改昵称界面
			showUpdateNickname(isDisplay) {
				var modalObj = $(".UpdateUserInfo-Modal");
				var windowObj = $(".UpdateNickname-Div");
				if (isDisplay) {
					//显示
					modalObj.show();
					windowObj.show();
				}
				else {
					//隐藏
					modalObj.hide();
					windowObj.hide();
				}
			},
			//保存昵称
			saveNickname() {
				var that = this;
				var confirmBtn = $(".UpdateNickname-ConfirmBtn");
				var changeNicknameObj = $(".ChangeNickname");
				if ($.trim(changeNicknameObj.val()) == "") {
					MintUI.Toast('请输入昵称！');
					return false;
				}
				var tempNickName = $.trim(changeNicknameObj.val());
				//判断是否登录
				if (!JfApiHelper.CheckLogin(this.$parent)) {
					return false;
				}
				//更新昵称
				var url = "/integral/UpdateNickName";
				var dataParams = {
					EnterpriseNo: that.loginUserInfo.EnterpriseNo,
					NickName: tempNickName,
					OpenId: that.loginUserInfo.OpenId,
					UserToken: that.loginUserInfo.UserToken,
					LanguageType: "zh-cn"
				};
				var cbBeforeSend = function () {
					confirmBtn.val("请稍等...");
				};
				var cbComplete = function () {
					confirmBtn.val("确定");
				};
				var cbSuccess = function (resultData) {
					if ((resultData || "") != "") {
						if ((typeof resultData).toLowerCase() == "string") {
							resultData = eval('(' + resultData + ')');
						}
						if (resultData.flag && (resultData.errorCode || "") == "0") {
							//更新用户json变量中的数据
							that.loginUserInfo.PetName = tempNickName;
							MintUI.Toast('更新成功！');
							//关闭当前窗体
							that.showUpdateNickname(false);
						}
						else {
							MintUI.Toast(resultData.msg);
						}
					}
				};
				var cbError = function (jqXHR, textStatus, errorThrown) {
					MintUI.Toast(jqXHR.responseText);
				};
				//请求后端
				JfApiHelper.CommonCallService(url, dataParams, cbSuccess, cbError, cbBeforeSend, cbComplete);
			},
			//显示隐藏修改手机号界面
			showUpdateMobile(isDisplay) {
				var modalObj = $(".UpdateUserInfo-Modal");
				var windowObj = $(".UpdateMobile-Div");
				if (isDisplay) {
					//显示
					modalObj.show();
					windowObj.show();
				}
				else {
					this.OldUpdateMobileTime=-1;
					//隐藏
					modalObj.hide();
					windowObj.hide();
				}
			},
			//倒计时功能
			UpdatePwdSwitchTime() {
				var that = this;
				if (that.OldUpdatePwdTime <= 0) {
					clearTimeout(that.UpdatePwdTimerObj);
					that.OldUpdatePwdTime = 0;
					var getVCodeBtn = $(".UpdatePwd-GetVCodeBtn");
					getVCodeBtn.html("获取验证码");
					that.Disenable = false;
					return;
				}
				that.OldUpdatePwdTime--;
				var getVCodeBtn = $(".UpdatePwd-GetVCodeBtn");
				getVCodeBtn.html("已发送(" + that.OldUpdatePwdTime + ")");
				that.Disenable = true;
				that.UpdatePwdTimerObj = setTimeout(function () {
					that.UpdatePwdSwitchTime()
				}, 1000);
			},
			//修改密码获取发送验证码
			UpdatePwdSendCode() {
				var that = this;
				if (that.Disenable) {
					return false;
				}
				var changeMobileObj = $(".ChangeMobile");//手机号
				var reg = /^(((134|135|136|137|138|139|150|151|152|154|157|158|159|182|183|184|187|188|147|178|179|198)[0-9]{8})|((1703)[0-9]{7})|((1705)[0-9]{7})|((1706)[0-9]{7})|((130|131|132|145|155|156|166|175|176|185|186)[0-9]{8})|((1704)[0-9]{7})|((1707)[0-9]{7})|((1708)[0-9]{7})|((1709)[0-9]{7})|((171[0-9])[0-9]{7})|((133|149|153|173|177|180|181|189|199|191)[0-9]{8})|((1700)[0-9]{7})|((1701)[0-9]{7})|((1702)[0-9]{7}))$/;
				if (!reg.test(changeMobileObj.val())) {
					MintUI.Toast('手机号填写不正确！');
					changeMobileObj.select();
					return false;
				}
				//发送验证码
				var getVCodeBtn = $(".UpdatePwd-GetVCodeBtn");
				var url = "/integral/SendVCode";
				var dataParams = {
					EnterpriseNo: that.loginUserInfo.EnterpriseNo,
					Mobile: changeMobileObj.val(),
					Type: 2,
					LanguageType: "zh-cn"
				};
				var cbBeforeSend = function () {
					//getVCodeBtn.html('正在获取...');
				};
				var cbComplete = function () {
					//getVCodeBtn.html('获取验证码');
				};
				var cbSuccess = function (resultData) {
					if ((resultData || "") != "") {
						if ((typeof resultData).toLowerCase() == "string") {
							resultData = eval('(' + resultData + ')');
						}
						if (resultData.flag && (resultData.errorCode || "") == "0") {
							// 倒计时
							that.OldUpdatePwdTime = 61;
							that.UpdatePwdSwitchTime();
						}
						else {
							MintUI.Toast(resultData.msg);
						}
					}
				};
				var cbError = function (jqXHR, textStatus, errorThrown) {
					MintUI.Toast(jqXHR.responseText);
				};
				//请求后端
				JfApiHelper.CommonCallService(url, dataParams, cbSuccess, cbError, cbBeforeSend, cbComplete);
			},
			//保存手机号
			saveMobile() {
				var that = this;
				var confirmBtn = $(".UpdateMobile-ConfirmBtn");
				var updateMobileObj = $(".UpdateMobile");
				var UpdateVCodeObj = $(".UpdateVCode");
				if ($.trim(updateMobileObj.val()) == "") {
					MintUI.Toast('请输入手机号！');
					return false;
				}
				if ($.trim(UpdateVCodeObj.val()) == "") {
					MintUI.Toast('请输入验证码！');
					return false;
				}
				//判断是否登录
				if (!JfApiHelper.CheckLogin(this.$parent)) {
					return false;
				}
				//更新手机号码
				var url = "/integral/UpdateMobile";
				var dataParams = {
					UserToken: that.loginUserInfo.UserToken,
					EnterpriseNo: that.loginUserInfo.EnterpriseNo,
					Mobile: $.trim(updateMobileObj.val()),
					OpenId: that.loginUserInfo.OpenId,
					LanguageType: "zh-cn",
					VerifyCode: $.trim(UpdateVCodeObj.val())
				};
				var cbBeforeSend = function () {
					confirmBtn.val("请稍等...");
				};
				var cbComplete = function () {
					confirmBtn.val("确定");
				};
				var cbSuccess = function (resultData) {
					if ((resultData || "") != "") {
						if ((typeof resultData).toLowerCase() == "string") {
							resultData = eval('(' + resultData + ')');
						}
						if (resultData.flag && (resultData.errorCode || "") == "0") {
							//更新用户json变量中的数据
							that.loginUserInfo.Phone = $.trim(updateMobileObj.val());
							MintUI.Toast('更新成功！');
							//关闭当前窗体
							that.showUpdateMobile(false);
						}
						else {
							MintUI.Toast(resultData.msg);
						}
					}
				};
				var cbError = function (jqXHR, textStatus, errorThrown) {
					MintUI.Toast(jqXHR.responseText);
				};
				//请求后端
				JfApiHelper.CommonCallService(url, dataParams, cbSuccess, cbError, cbBeforeSend, cbComplete);
			},
			//显示隐藏修改昵称界面
			showUpdatePwd(isDisplay) {
				
				var modalObj = $(".UpdateUserInfo-Modal");
				var windowObj = $(".UpdatePwd-Div");
				if (isDisplay) {
					//显示
					modalObj.show();
					windowObj.show();
				}
				else {
					this.OldUpdatePwdTime=-1;
					//隐藏
					modalObj.hide();
					windowObj.hide();
				}
			},
			//保存密码
			savePwd() {
				var that = this;
				var confirmBtn = $(".UpdatePwd-ConfirmBtn");
				var changeMobileObj = $(".ChangeMobile");
				var ChangeVCodeObj = $(".ChangeVCode");
				var ChangePwdObj = $(".ChangePwd");
				if ($.trim(changeMobileObj.val()) == "") {
					MintUI.Toast('请输入手机号！');
					return false;
				}
				if ($.trim(ChangeVCodeObj.val()) == "") {
					MintUI.Toast('请输入验证码！');
					return false;
				}
				if (ChangePwdObj.val() == "") {
					MintUI.Toast('请输入密码！');
					return false;
				}
				//判断是否登录
				if (!JfApiHelper.CheckLogin(this.$parent)) {
					return false;
				}
				//更新手机号码
				var url = "/integral/UpdatePwd";
				var dataParams = {
					MemberPwd: ChangePwdObj.val(),
					UserToken: that.loginUserInfo.UserToken,
					EnterpriseNo: that.loginUserInfo.EnterpriseNo,
					Mobile: $.trim(changeMobileObj.val()),
					OpenId: that.loginUserInfo.OpenId,
					LanguageType: "zh-cn",
					VerifyCode: $.trim(ChangeVCodeObj.val())
				};
				var cbBeforeSend = function () {
					confirmBtn.val("请稍等...");
				};
				var cbComplete = function () {
					confirmBtn.val("确定");
				};
				var cbSuccess = function (resultData) {
					if ((resultData || "") != "") {
						if ((typeof resultData).toLowerCase() == "string") {
							resultData = eval('(' + resultData + ')');
						}
						if (resultData.flag && (resultData.errorCode || "") == "0") {
							MintUI.Toast('更新成功！');
							//关闭当前窗体
							that.showUpdatePwd(false);
						}
						else {
							MintUI.Toast(resultData.msg);
						}
					}
				};
				var cbError = function (jqXHR, textStatus, errorThrown) {
					MintUI.Toast(jqXHR.responseText);
				};
				//请求后端
				JfApiHelper.CommonCallService(url, dataParams, cbSuccess, cbError, cbBeforeSend, cbComplete);
			}
		},
		created() {
			var that = this;
		},
		mounted: function () { 
			var that=this;
			var isDesign = location.pathname.indexOf('design');
			if (!(isDesign>-1)) {
				that.$set(that,'vh',true);
			}else{
				that.$set(that,'vh',false);
			}
		}
	}
</script>
