safe-setting.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. (function() {
  2. Vue.component('safe-setting', {
  3. template: `<div>
  4. <ul class="safe-setting" v-if="!modifyJudge">
  5. <li class="set-psw m0 c-border-tb clearfix">
  6. <div class="fl li-txt">
  7. <h3 class="m0 mtb10">登录密码</h3>
  8. <p class="m0 c-888 c-f14">建议您定期更换密码,设置安全性更高的密码可以使账户更安全</p>
  9. </div>
  10. <div class="fr operate"><span class="btn" @click="modifyPsw">修改</span></>
  11. </li>
  12. <li class="safe-phone m0 c-border-b clearfix">
  13. <div class="fl li-txt">
  14. <h3 class="m0 mtb10">安全手机&emsp;{{info}}</h3>
  15. <p class="m0 c-888 c-f14">安全手机可用与登录账号,重置密码或其他安全验证</p>
  16. </div>
  17. <div class="fr operate"><span class="btn" @click="modifyPhone">更换</span></>
  18. </li>
  19. </ul>
  20. <div class="modify plr30" v-if="ismdiPsw">
  21. <h3 class="pt40 pb20 pl30 mb50 c-f16 c-border-b">修改密码</h3>
  22. <div class="psw-form pt30">
  23. <h4 class="m0 mb20">原密码</h4>
  24. <p class="form-group">
  25. <input class="fl form-control" placeholder="请输入原密码" />
  26. </p>
  27. <h4 class="m0 mb20">新密码</h4>
  28. <p class="form-group">
  29. <input class="fl form-control" placeholder="请输入6-20位登录密码" />
  30. </p>
  31. <p class="form-group">
  32. <input class="fl form-control" placeholder="请再次输入登录密码" />
  33. </p>
  34. </div>
  35. <div class="operate-btn pt40">
  36. <span class="btn" @click="savePsw()">确&emsp;定</span>
  37. <span class="btn btn-cancel" @click="cancel()">取&emsp;消</span>
  38. </div>
  39. </div>
  40. <div class="modify plr30" v-if="ismdiPhone">
  41. <h3 class="pt40 pb20 pl30 mb50 c-f16 c-border-b">更换手机号码</h3>
  42. <div class="mdiphone-form pt30">
  43. <div class="clearfix">
  44. <div v-for="step in indexArr" :key="step" class="fl step" :class="{'set-active': activeIndex >= step}">
  45. <div class="clearfix">
  46. <p v-if="step > 1" class="fl clearfix">
  47. <em class="fl"></em>
  48. </p>
  49. <span class="fl">{{step}}</span>
  50. <p v-if="step < 3" class="fl">
  51. <em class="fl"></em>
  52. </p>
  53. </div>
  54. <label class="mt20" :class="setClass(step)">{{setTxt(step)}}</label>
  55. </div>
  56. </div>
  57. <div class="mdi-detail-form txt-center pt50">
  58. <div class="container-fluid" v-if="activeIndex == 1">
  59. <h3 class="c-f14 mb40">已绑定的手机号:{{handlePhone(info)}}</h3>
  60. <p class="form-group clearfix">
  61. <label class="fl form-label">验证码</label>
  62. <input class="fl form-control" placeholder="短信验证码" />
  63. <span class="c-0ad8c8 send">发送验证码</span>
  64. </p>
  65. <p class="c-888">若您的手机号码无法使用,请尝试&nbsp;<span class="c-37a6ed">账号申诉</span></p>
  66. </div>
  67. <div class="container-fluid pt50" v-if="activeIndex == 2">
  68. <p class="form-group clearfix">
  69. <label class="fl form-label">手机号码</label>
  70. <input class="fl form-control" placeholder="输入新的手机号码" />
  71. </p>
  72. <p class="form-group clearfix">
  73. <label class="fl form-label">验证码</label>
  74. <input class="fl form-control" placeholder="短信验证码" />
  75. <span class="c-0ad8c8 send">发送验证码</span>
  76. </p>
  77. </div>
  78. <div class="step3 container-fluid" v-if="activeIndex == 3">
  79. <h3 class="success">手机号码更换成功</h3>
  80. <p class="c-909090">下次请使用新号码登录</p>
  81. </div>
  82. </div>
  83. <div>
  84. <span class="btn" v-if="activeIndex != 3" @click="next()">下一步</span>
  85. <span class="btn" v-if="activeIndex == 3" @click="cancel()">返回</span>
  86. </div>
  87. </div>
  88. </div>
  89. </div>`,
  90. props: [],
  91. data: function() {
  92. return {
  93. info: null,
  94. modifyJudge: false,
  95. ismdiPsw: false,
  96. ismdiPhone: false,
  97. indexArr: [1, 2, 3],
  98. activeIndex: 1
  99. }
  100. },
  101. methods: {
  102. modifyPsw: function() {
  103. this.modifyJudge = true
  104. this.ismdiPsw = true
  105. },
  106. modifyPhone: function() {
  107. this.modifyJudge = true
  108. this.ismdiPhone = true
  109. },
  110. savePsw: function() {},
  111. cancel: function() {
  112. this.modifyJudge = false
  113. this.ismdiPsw = false
  114. this.ismdiPhone = false
  115. this.activeIndex = 1
  116. },
  117. // 更换手机号
  118. setTxt: function(index) {
  119. var str = ''
  120. switch(+index) {
  121. case 1: str = '验证身份';break
  122. case 2: str = '修改手机号码';break
  123. case 3: str = '完成更换';break
  124. }
  125. return str
  126. },
  127. setClass: function(index) {
  128. var str = ''
  129. switch(+index) {
  130. case 1: str = '';break
  131. case 2: str = 'txt-center';break
  132. case 3: str = 'txt-right';break
  133. }
  134. return str
  135. },
  136. handlePhone: function(phone) {
  137. if(!phone) {
  138. return ''
  139. }
  140. return phone.substr(0,3) + '****' + phone.substr(7, 4)
  141. },
  142. next: function() {
  143. this.activeIndex++
  144. }
  145. }
  146. })
  147. })()