user-info.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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/crop.css">
  16. <link rel="stylesheet" href="./static/css/main.css">
  17. </head>
  18. <body class="bgc-back pt0 ovh" style="padding-top:0;">
  19. <div id="app">
  20. <van-nav-bar class="user_rank_explan_title user_title_normal" left-arrow title="个人资料" v-if="toptitleisshow" @click-left="goback">
  21. <template #left>
  22. <van-icon name="arrow-left"></van-icon>
  23. </template>
  24. </van-nav-bar>
  25. <van-cell-group class="top_line user_info_userphoto" :border="false" v-cloak>
  26. <van-cell is-link center @click="uploadphoto">
  27. <template #title><span>头像</span></template>
  28. <template #default><img class="user-info-header" :src="PublicLib.CachePicture({picUrl:userinfo.HeadPhoto,domid:'usercenterimg'})" id="usercenterimg" style="border-radius:50%;" v-cloak></template>
  29. </van-cell>
  30. <van-cell title="姓名" :value="userinfo.RealName"></van-cell>
  31. </van-cell-group>
  32. <van-cell-group class="bt8f7f7f7" :border="false" v-cloak>
  33. <van-cell title="手机" :value="userinfo.Mobile"></van-cell>
  34. <van-cell title="我的推荐码">
  35. <template #right-icon>
  36. <div class="f12 dib c999 pr16" id="inviteCode">{{userinfo.MakerCode}}</div>
  37. <van-button plain size="mini" :data-clipboard-text="userinfo.MakerCode" @touchstart="copyCode" @click="copyCode" data-clipboard-action="copy" data-clipboard-target="#inviteCode" ref="copy">复制</van-button>
  38. </template>
  39. </van-cell>
  40. <van-cell title="我的名片" is-link @click="mycard">
  41. <template #default>
  42. <van-icon name="qr"></van-icon>
  43. </template>
  44. </van-cell>
  45. </van-cell-group>
  46. <van-cell-group class="bt8f7f7f7" :border="false" v-cloak>
  47. <van-cell title="我的推荐人" :value="userinfo.InviteName"></van-cell>
  48. <van-cell title="推荐人联系电话" :value="userinfo.InviteMobile">
  49. <template #right-icon>
  50. <div class="f12 dib c999 pr16"></div>
  51. <van-button plain size="mini" @click="takephone(userinfo.InviteMobile)">拨号</van-button>
  52. </template>
  53. </van-cell>
  54. </van-cell-group>
  55. <input type="file" accept="image/*" id="upload" style="display:none;">
  56. </div>
  57. <script src="./static/js/clipboard.min.js"></script>
  58. <script src="./static/js/klm-vv.min.js"></script>
  59. <script src="./static/js/appfunc.min.js"></script>
  60. <script src="./static/js/klm-axios-config.js"></script>
  61. <script src="./static/js/publicfn.js"></script>
  62. <script src="./static/js/exif.js"></script>
  63. <script src="./static/js/transformation-matrix.js"></script>
  64. <script src="./static/js/prefix-umd.js"></script>
  65. <script src="./static/js/index.js"></script>
  66. <script>
  67. //上回后回调方法,用于调用缩放、裁切、旋转功能
  68. function AppUpload(imgpath) {
  69. setTimeout(function () {
  70. PublicLib.WapCropForApp(300, 300, 'upload', imgpath, 1);
  71. }, 300);
  72. };
  73. //裁切结束后回调方法
  74. function ShowPhoto(url) {
  75. //获取最终的图片地址
  76. app.uploadheadhpotofn(url);
  77. };
  78. //初始化crop
  79. if (isWeb) {
  80. PublicLib.WapCrop(1000, 1000, 'upload', 1);
  81. };
  82. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  83. // 可以通过下面的方式手动注册
  84. Vue.use(vant.Lazyload);
  85. // 在 #app 标签下渲染一个按钮组件
  86. let app = new Vue({
  87. el: '#app',
  88. data() {
  89. return {
  90. toptitleisshow:false,
  91. active: 0,
  92. realauth:false,
  93. checked: false,
  94. copyBtn: {},
  95. userinfo:{
  96. HeadPhoto:"./static/images/user-img@3x.png",
  97. },
  98. flag:0,
  99. };
  100. },
  101. created() {
  102. this.toptitleisshow = toptitleisshow;
  103. this.getuserinfo();
  104. this.verificationrealauth();
  105. },
  106. methods: {
  107. async getuserinfo(){
  108. PublicLib.ShowLoading({Message:''});
  109. const Id = PublicLib.getCookieInfo('userId');
  110. const res = await getRequest('api/v1/users/personalinfo?t='+Math.random(6),JSON.stringify({Id}));
  111. if(res.status !== '1') return tips('获取创客信息失败!')
  112. PublicLib.HideLoading();
  113. this.userinfo = res.data;
  114. if(Id === '3543' || Id === '6264'){
  115. this.userinfo.InviteMobile = '13100000000';
  116. this.userinfo.InviteName = '刘鹤';
  117. };
  118. if(Id === '4507'){
  119. this.userinfo.InviteMobile = '13199999999';
  120. this.userinfo.InviteName = '王晓梅';
  121. };
  122. if(Id === '3931' || Id === '527'){
  123. this.userinfo.InviteMobile = '13166666666';
  124. this.userinfo.InviteName = '李培培';
  125. };
  126. if(Id === '363' || Id === '458' || Id === '1666' || Id === '596'){
  127. this.userinfo.InviteMobile = '13691939495';
  128. this.userinfo.InviteName = '辛海军';
  129. };
  130. },
  131. giveToast(str){
  132. vant.Toast(str);
  133. },
  134. copyCode(){
  135. const that = this;
  136. this.$nextTick(() => {
  137. that.copyBtn = new ClipboardJS(this.$refs.copy);
  138. const clipboard = that.copyBtn;
  139. clipboard.on('success', function(e) {
  140. that.giveToast('复制成功');
  141. });
  142. clipboard.on('error', function(e) {
  143. that.giveToast('复制失败,请手动选择复制!');
  144. });
  145. });
  146. },
  147. async verificationrealauth(){
  148. const Id = PublicLib.getCookieInfo('userId');
  149. const userinfo = await getRequest('api/v1/users/personalinfo?t='+Math.random(6),JSON.stringify({Id}));
  150. //- 是否实名认证完毕
  151. if(userinfo.data.AuthFlag !== 1) {
  152. this.realauth = true;
  153. }else{
  154. this.realauth = false;
  155. };
  156. },
  157. //- 点击了我的名片
  158. mycard(){
  159. if(this.realauth){
  160. PublicLib.ShowDialog({
  161. Title:'暂未实名认证',
  162. Message:'是否去实名认证?',
  163. ConfirmText:'去实名',
  164. CancelText:'暂不实名',
  165. ConfirmAction:'app.goAuth()',
  166. CanelAction:''
  167. });
  168. return;
  169. }
  170. PublicLib.Goto({Url:'user-myqrcode'});
  171. },
  172. goAuth(){
  173. PublicLib.Goto({Url:'user-realauth'});
  174. },
  175. //- 拨打电话
  176. takephone(phonenum){
  177. PublicLib.PhoneCall(phonenum);
  178. },
  179. goback(){
  180. PublicLib.GoBack({Level:1});
  181. },
  182. //- 上传头像
  183. uploadphoto(){
  184. PublicLib.UploadPhoto({
  185. Quality:1,
  186. PhotoCount:1,
  187. Width:300,
  188. Height:300,
  189. });
  190. },
  191. //- 上传头像到个人资料
  192. async uploadheadhpotofn(HeadPhoto){
  193. const Id = PublicLib.getCookieInfo('userId');
  194. const res = await postRequest('api/v1/users/uploadheadphoto?t='+Math.random(6),JSON.stringify({Id,HeadPhoto}));
  195. if(res.status !== '1') return tips('上传头像失败,请重试!');
  196. tips('上传头像成功!');
  197. this.userinfo.HeadPhoto = showHost + HeadPhoto;
  198. }
  199. }
  200. });
  201. </script>
  202. </body>
  203. </html>