user-info1.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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="创业帮001"></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" data-clipboard-action="copy" data-clipboard-target="#inviteCode" ref="copy" @click="copyCode">复制</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. const that = this;
  105. this.$nextTick(()=>{
  106. that.copyBtn = new ClipboardJS(this.$refs.copy);
  107. });
  108. this.verificationrealauth();
  109. },
  110. methods: {
  111. async getuserinfo(){
  112. PublicLib.ShowLoading({Message:''});
  113. const Id = PublicLib.getCookieInfo('userId');
  114. const res = await getRequest('api/v1/users/personalinfo',JSON.stringify({Id}));
  115. if(res.status !== '1') return tips('获取创客信息失败!')
  116. PublicLib.HideLoading();
  117. this.userinfo = res.data;
  118. //- this.userinfo.InviteMobile = '111111';
  119. },
  120. giveToast(str){
  121. vant.Toast(str);
  122. },
  123. copyCode(){
  124. const that = this;
  125. const clipboard = that.copyBtn;
  126. clipboard.on('success', function(e) {
  127. that.giveToast('复制成功');
  128. });
  129. clipboard.on('error', function(e) {
  130. that.giveToast('复制失败,请手动选择复制!');
  131. });
  132. },
  133. async verificationrealauth(){
  134. const Id = PublicLib.getCookieInfo('userId');
  135. const userinfo = await getRequest('api/v1/users/personalinfo',JSON.stringify({Id}));
  136. //- 是否实名认证完毕
  137. if(userinfo.data.AuthFlag !== 1) {
  138. this.realauth = true;
  139. }else{
  140. this.realauth = false;
  141. };
  142. },
  143. //- 点击了我的名片
  144. mycard(){
  145. if(this.realauth){
  146. PublicLib.ShowDialog({
  147. Title:'暂未实名认证',
  148. Message:'是否去实名认证?',
  149. ConfirmText:'去实名',
  150. CancelText:'暂不实名',
  151. ConfirmAction:'app.goAuth()',
  152. CanelAction:''
  153. });
  154. return;
  155. }
  156. PublicLib.Goto({Url:'user-myqrcode'});
  157. },
  158. goAuth(){
  159. PublicLib.Goto({Url:'user-realauth'});
  160. },
  161. //- 拨打电话
  162. takephone(phonenum){
  163. PublicLib.PhoneCall(phonenum);
  164. },
  165. goback(){
  166. PublicLib.GoBack({Level:1});
  167. },
  168. //- 上传头像
  169. uploadphoto(){
  170. PublicLib.UploadPhoto({
  171. Quality:1,
  172. PhotoCount:1,
  173. Width:300,
  174. Height:300,
  175. });
  176. },
  177. //- 上传头像到个人资料
  178. async uploadheadhpotofn(HeadPhoto){
  179. const Id = PublicLib.getCookieInfo('userId');
  180. const res = await postRequest('api/v1/users/uploadheadphoto',JSON.stringify({Id,HeadPhoto}));
  181. if(res.status !== '1') return tips('上传头像失败,请重试!');
  182. tips('上传头像成功!');
  183. this.userinfo.HeadPhoto = showHost + HeadPhoto;
  184. }
  185. }
  186. });
  187. </script>
  188. </body>
  189. </html>