user-setting.html 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>设置-创业帮</title>
  6. <meta name="keywords" content="设置-创业帮">
  7. <meta name="description" content="设置-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="设置-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back pt0 ovh" style="padding-top:0;">
  18. <div id="app" v-cloak>
  19. <van-nav-bar class="user_rank_explan_title user_title_normal" left-arrow title="设置" v-if="toptitleisshow" @click-left="goback">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <van-cell-group class="bt8f7f7f7" :border="false" v-cloak>
  23. <van-cell title="实名认证" value="" is-link @click="realauthfn"></van-cell>
  24. <van-cell title="变更结算卡" value="" is-link @click="verfifcationbtn('changeCheckcard')"></van-cell>
  25. </van-cell-group>
  26. <van-cell-group class="bt8f7f7f7" :border="false" v-cloak>
  27. <van-cell title="设置支付密码" value="" is-link @click="setpaypwd" v-if="!ispaypassword"></van-cell>
  28. <van-cell title="修改支付密码" value="" is-link @click="changepaypwd" v-if="ispaypassword"></van-cell>
  29. <van-cell title="忘记支付密码" value="" is-link @click="verfifcationbtn('forgetpaypwd')" v-if="ispaypassword"></van-cell>
  30. </van-cell-group>
  31. <van-cell-group class="bt8f7f7f7" :border="false" v-cloak>
  32. <van-cell title="修改登录手机号" value="" is-link @click="verfifcationbtn('changephone')"></van-cell>
  33. <van-cell title="修改登录密码" value="" is-link @click="changepwd"></van-cell>
  34. <van-cell title="手势密码" value="" is-link>
  35. <template #right-icon>
  36. <van-switch v-model="checked" size="24" @click="gesture"></van-switch>
  37. </template>
  38. </van-cell>
  39. </van-cell-group>
  40. <van-cell-group class="bt8f7f7f7" :border="false" v-cloak>
  41. <van-cell title="清理缓存" value="" is-link @click="cleardataisshow = true"></van-cell>
  42. <van-cell title="关于创业帮" value="" is-link @click="about"></van-cell>
  43. <van-cell title="注销账号" value="" is-link @click="cancelaccount"></van-cell>
  44. </van-cell-group>
  45. <div class="bt8f7f7f7">
  46. <van-button class="nb" color="#ff502a" plain block @click="dialogisshow = true">安全退出</van-button>
  47. </div>
  48. <van-dialog style="border-radius:4px;" v-model="dialogisshow" title="确定退出登录?" confirm-button-color="#ff502a" show-cancel-button @confirm="gologin" @cancel="dialogisshow = false"> </van-dialog>
  49. <van-dialog style="border-radius:4px;" v-model="cleardataisshow" title="清理缓存" confirm-button-color="#ff502a" width="70%" message="是否清理缓存,清理缓存之后将重新登录" show-cancel-button @confirm="cleardata" @cancel="cleardataisshow = false"> </van-dialog>
  50. <van-dialog style="border-radius:4px;" v-model="closegestureisshow" title="关闭手势密码" confirm-button-color="#ff502a" width="70%" message="是否关闭手势密码" show-cancel-button @confirm="closegesture" @cancel="unclosegesture"> </van-dialog>
  51. </div>
  52. <script src="./static/js/klm-vv.min.js"></script>
  53. <script src="./static/js/appfunc.min.js"></script>
  54. <script src="./static/js/klm-axios-config.js"></script>
  55. <script src="./static/js/publicfn.js"></script>
  56. <script>
  57. function OnStart(){
  58. app.passwordischeck();
  59. app.verificationrealauth();
  60. app.verificationpaypassword();
  61. };
  62. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  63. // 可以通过下面的方式手动注册
  64. Vue.use(vant.Lazyload);
  65. // 在 #app 标签下渲染一个按钮组件
  66. let app = new Vue({
  67. el: '#app',
  68. data() {
  69. return {
  70. toptitleisshow:false,
  71. active: 0,
  72. curversion: '',
  73. version: '',
  74. checked: false,
  75. closegestureisshow:false,
  76. dialogisshow:false,
  77. cleardataisshow:false,
  78. realauth:false,
  79. ispaypassword:true,
  80. };
  81. },
  82. created() {
  83. this.toptitleisshow = toptitleisshow;
  84. this.passwordischeck();
  85. this.verificationrealauth();
  86. this.verificationpaypassword();
  87. },
  88. methods: {
  89. setpaypwd(){
  90. if(this.realauth){
  91. PublicLib.ShowDialog({
  92. Title:'暂未实名认证',
  93. Message:'是否去实名认证?',
  94. ConfirmText:'去实名',
  95. CancelText:'暂不实名',
  96. ConfirmAction:'app.goAuth()',
  97. CanelAction:''
  98. });
  99. return;
  100. }
  101. PublicLib.Goto({Url:'user-setpaypwd-1'})
  102. },
  103. passwordischeck(){
  104. if(PublicLib.getCookieInfo('step') === '2') {
  105. this.checked = true;
  106. }else{
  107. this.checked = false;
  108. }
  109. },
  110. clearDot(str) {
  111. str = str.replace(/\./g, "");
  112. return str;
  113. },
  114. //- //- 确认退出
  115. gologin(){
  116. PublicLib.putCookieInfo('isloginout','loginout');
  117. const id = PublicLib.getCookieInfo('userId');
  118. postRequest('api/v1/users/logout',JSON.stringify({UserId:id}));
  119. PublicLib.putCookieInfo('passwordxx', '');
  120. PublicLib.putCookieInfo('chooseType', '');
  121. PublicLib.putCookieInfo('step', 'close');
  122. PublicLib.putCookieInfo('userId', '');
  123. PublicLib.putCookieInfo('isloginout','');
  124. if(PublicLib.getCookieInfo('isfirstlogin') === 'true'){
  125. PublicLib.putCookieInfo('isfirstlogin', '');
  126. PublicLib.Goto({Url:'user-login'});
  127. }else{
  128. PublicLib.GoBack({Level:-1});
  129. };
  130. },
  131. async verificationrealauth(){
  132. const Id = PublicLib.getCookieInfo('userId');
  133. const userinfo = await getRequest('api/v1/users/personalinfo?t='+Math.random(6),JSON.stringify({Id}));
  134. //- 是否实名认证完毕
  135. if(userinfo.data.AuthFlag !== 1) {
  136. this.realauth = true;
  137. }else{
  138. this.realauth = false;
  139. };
  140. },
  141. async verificationpaypassword(){
  142. const Id = PublicLib.getCookieInfo('userId');
  143. const res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
  144. //- 是否设置支付密码
  145. if(res.status !== '1') {
  146. this.ispaypassword = false;
  147. }else{
  148. this.ispaypassword = true;
  149. };
  150. },
  151. //- 实名认证
  152. realauthfn(){
  153. PublicLib.Goto({Url:'user-realauth-finish'});
  154. },
  155. verfifcationbtn(type){
  156. if((this.realauth && type === 'changeCheckcard') || (this.realauth && type === 'forgetpaypwd')){
  157. PublicLib.ShowDialog({
  158. Title:'暂未实名认证',
  159. Message:'是否去实名认证?',
  160. ConfirmText:'去实名',
  161. CancelText:'暂不实名',
  162. ConfirmAction:'app.goAuth()',
  163. CanelAction:''
  164. });
  165. return;
  166. }
  167. PublicLib.putCookieInfo("settingto",type);
  168. PublicLib.Goto({Url:'user-verification'});
  169. },
  170. goAuth(){
  171. PublicLib.Goto({Url:'user-realauth'});
  172. },
  173. //- 手势密码
  174. gesture(){
  175. if(this.checked){
  176. this.closegestureisshow = true;
  177. }else{
  178. PublicLib.putCookieInfo('issetting', 1);
  179. PublicLib.Goto({Url:'gesture-setpassword'});
  180. }
  181. },
  182. //- 关闭手势密码
  183. closegesture(){
  184. PublicLib.putCookieInfo('passwordxx', '');
  185. PublicLib.putCookieInfo('chooseType', '');
  186. PublicLib.putCookieInfo('step', 'close');
  187. },
  188. //- 取消关闭手势密码
  189. unclosegesture(){
  190. this.closegestureisshow = false;
  191. this.checked = true;
  192. },
  193. goback(){
  194. PublicLib.GoBack({Level:1});
  195. },
  196. //- 修改支付密码
  197. changepaypwd(){
  198. if(this.realauth){
  199. PublicLib.ShowDialog({
  200. Title:'暂未实名认证',
  201. Message:'是否去实名认证?',
  202. ConfirmText:'去实名',
  203. CancelText:'暂不实名',
  204. ConfirmAction:'app.goAuth()',
  205. CanelAction:''
  206. });
  207. return;
  208. }
  209. PublicLib.Goto({Url:'user-changepaypwd-1'});
  210. },
  211. //- 修改登录密码
  212. changepwd(){
  213. PublicLib.Goto({Url:'user-changepwd'});
  214. },
  215. //- 清理缓存
  216. cleardata(){
  217. this.gologin();
  218. PublicLib.ClearAppCache();
  219. },
  220. //- 关于
  221. about(){
  222. PublicLib.Goto({Url:'user-about'});
  223. },
  224. //- 注销账号
  225. cancelaccount(){
  226. PublicLib.Goto({Url:'user-cancellation'});
  227. },
  228. }
  229. });
  230. </script>
  231. </body>
  232. </html>