profile.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <style>
  2. .right-content{
  3. padding-top:54px!important; padding-left:0!important; width:970px!important;
  4. }
  5. .CoverPiece{position: absolute; left: 0px; top: 0px; overflow: hidden; width: 182px; filter: alpha(Opacity=0); -moz-opacity: 0; opacity: 0;}
  6. .CoverInput{float: left; height:30px; margin-left: -69px;}
  7. .noIntro{width: 686px; word-wrap:break-word; font-weight: 400; color: #949494; font-size: 13px; text-align: center;}
  8. .interestsImg{}
  9. </style>
  10. <div class="content">
  11. <% include leftBar.html %>
  12. <!-- right content start -->
  13. <div class="right-content myProfile" style="min-height: 700px;">
  14. <div class="pageInfo">My Profile</div>
  15. <div id="tabs-container" style="display: block;">
  16. <% include updateProfile/topBar.html %>
  17. <div class="profile-pic">
  18. <%if(!checkAvatar){%>
  19. <!--<a href="javascript:;">-->
  20. <!--<div class="edit editAvatar" style="display: none;">-->
  21. <!--Edit-->
  22. <!--<div class="CoverPiece" >-->
  23. <!--<input class="CoverInput" type="file" name="file" accept="image/jpg,image/jpeg,image/png">-->
  24. <!--</div>-->
  25. <!--</div>-->
  26. <!--</a>-->
  27. <%}%>
  28. <img src="<%if(checkAvatar){%><%=checkAvatar%><%}else{%><%=userInfo.avatar_img%><%}%>" style="width: 180px; height: 180px;" alt=""/>
  29. <%if(checkAvatar){%>
  30. <div class="pendingApproval" style="display:block;">(pending approval)</div>
  31. <%}%>
  32. </div>
  33. <div class="profile-info">
  34. <ul>
  35. <li>
  36. <%if(anchorInfo.card_auth == 3){%>
  37. <img title="Your identity has been confirmed!" class="authenticationStatus" src="<%=public_path%>/img/u565.png">
  38. <%}else if(anchorInfo.card_auth == 1){%>
  39. <img title="Your identity is under review." class="authenticationStatus" src="<%=public_path%>/img/u566.png">
  40. <%}%>
  41. <div class="name" style="float: left;"><%=userInfo.nick_name%></div>
  42. </li>
  43. <a href="/broadcast/editPassword"><div id="showTbooking" class="Tbooking-btn" style="top:57px;">Change password</div></a>
  44. </ul>
  45. <ul class="section">
  46. <li>Basic Information</li>
  47. <li>
  48. <div class="subject">Profile ID</div>
  49. <div class="info"><%=userInfo.id%></div>
  50. </li>
  51. <li>
  52. <div class="subject">Level</div>
  53. <div class="info">
  54. <div class="userlevel">
  55. <img src="<%=anchorLevelInfo[userInfo.level].icon%>"/>
  56. </div>
  57. </div>
  58. </li>
  59. <li>
  60. <div class="subject">Gender</div>
  61. <div class="info"><%if(anchorInfo.sex == 2){%>male<%}else{%>Female<%}%></div>
  62. </li>
  63. <li>
  64. <div class="subject">Date of birth</div>
  65. <%if(userInfo.birthday){%>
  66. <div class="info"><%=userInfo.birthday%></div>
  67. <%}else{%>
  68. <div class="info">-</div>
  69. <%}%>
  70. </li>
  71. <li>
  72. <div class="subject">Nationality</div>
  73. <%if(userInfo.country){%>
  74. <div class="info"><%=userInfo.country%></div>
  75. <%}else{%>
  76. <div class="info">-</div>
  77. <%}%>
  78. </li>
  79. </ul>
  80. <ul class="section self-Intro">
  81. <li>
  82. <div>Self-Intro</div>
  83. </li>
  84. <li>
  85. <%if(anchorInfo.introduction){%>
  86. <div style="width: 686px; word-wrap:break-word;"><%=anchorInfo.introduction%></div>
  87. <%}else{%>
  88. <div class="noIntro">You did not say anything about yourself.</div>
  89. <%}%>
  90. </li>
  91. </ul>
  92. <ul class="section hobbies" style="margin-bottom: 20px;">
  93. <li>
  94. <div>Hobbies / Interests</div>
  95. <a href="javascript:;"><div class="edit editHobbies">Edit</div></a>
  96. </li>
  97. <%if(anchorInterest.length > 0){%>
  98. <li>
  99. <ul>
  100. <%for(let val of anchorInterest){%>
  101. <li>
  102. <div class="anchorHobbies">
  103. <img style="width: 55px; height: 50px; border: 0px; padding: 0px;" src="<%=public_path%>/img/interests/interests_<%=val%>.png">
  104. </div>
  105. <div><%=interest[val]%></div>
  106. </li>
  107. <%}%>
  108. </ul>
  109. </li>
  110. <%}%>
  111. </ul>
  112. <a href="/broadcast/updateProfile/requestUpdate">
  113. <div class="requestUpdate">Request Update</div>
  114. </a>
  115. </div>
  116. <div class="clear"></div>
  117. </div>
  118. <div class="agency">
  119. Note: If you have any questions, please consult your agency.<br>
  120. Your agency: <%=agency.name%>
  121. </div>
  122. </div>
  123. <!-- right content end -->
  124. </div>
  125. <script>
  126. $(function(){
  127. //显示修改和删除
  128. $('.profile-pic').mouseenter(function(){
  129. $('.editAvatar').stop();
  130. $('.editAvatar').slideDown(300);
  131. })
  132. $('.profile-pic').mouseleave(function(){
  133. $('.editAvatar').stop();
  134. $('.editAvatar').slideUp(300);
  135. })
  136. //修改头像
  137. var change_status = 0;//防止多次点击
  138. window.parent.avatarOriginalImg = '';
  139. $(document).on('change', 'input[name="file"]', function(){
  140. var objUrl = getObjectURL(this.files[0]) ;
  141. var type = this.files[0].type;
  142. if(this.files[0].size > 3 * 1024 * 1024){
  143. myParentAlert('Incorrect format. Only JPG and PNG format allowed. File size must be 3M or less.');
  144. emptiedFile();
  145. return false;
  146. }
  147. window.parent.avatarOriginalImg = this.files[0];
  148. var image = new Image();
  149. image.src = objUrl;
  150. image.onload = function(){
  151. var width = image.width;
  152. var height = image.height;
  153. if(width<768 || height<768){
  154. myParentAlert('PNG and JPG format only, less than 3MB. Size: 768px * 768px to 2400px * 2400px.');
  155. emptiedFile();
  156. return false;
  157. }
  158. if(width>2400 || height>2400){
  159. myParentAlert('PNG and JPG format only, less than 3MB. Size: 768px * 768px to 2400px * 2400px.');
  160. emptiedFile();
  161. return false;
  162. }
  163. var windowHeigth = $(parent).height();
  164. var windowWidth = $(parent).width();
  165. var imgHeigth = '';
  166. var imgWidth = '';
  167. if(windowHeigth < (height+120) || windowWidth < (width+50)){
  168. windowHeigth = parseInt(windowHeigth * 0.6);
  169. windowWidth = parseInt(windowWidth * 0.6);
  170. height = windowHeigth;
  171. width = windowWidth;
  172. imgHeigth = windowHeigth;
  173. imgWidth = windowWidth;
  174. }else{
  175. imgHeigth = height;
  176. imgWidth = width;
  177. }
  178. width = width + 50 + 'px';
  179. height = height + 120 + 'px';
  180. if(change_status){
  181. return false;
  182. }
  183. change_status = 1;
  184. parent.layer.open({
  185. type: 2,
  186. title: '',
  187. closeBtn: 0,
  188. resize: false,
  189. area : [width, height],
  190. content: '/broadcast/profileLayer/editAvatar?blobImg='+objUrl+'&type='+type+'&width='+imgWidth+'&height='+imgHeigth,
  191. end:function(){
  192. change_status = 0;//防止多次点击
  193. var status = Cookies.getJSON('add_success_avatar');
  194. Cookies.remove('add_success_avatar');
  195. if(status && status.status == 1){
  196. window.location.reload();
  197. }
  198. $("input[name='file']").val('');//关闭窗口情况表单数据,解决重复选择同一张图片的问题。
  199. }
  200. });
  201. }
  202. })
  203. //修改名称
  204. $('.editName').on('click', function(){
  205. parent.layer.open({
  206. type: 2,
  207. title: '',
  208. closeBtn: 0,
  209. resize: false,
  210. shadeClose: true,
  211. area : ['556px', '217px'],
  212. content: '/broadcast/profileLayer/editName',
  213. end: function(){
  214. var status = Cookies.getJSON('add_success_name');
  215. Cookies.remove('add_success_name');
  216. if(status && status.status == 1){
  217. window.location.reload();
  218. }
  219. }
  220. });
  221. })
  222. //修改个人简介
  223. $('.editBrief').on('click', function(){
  224. parent.layer.open({
  225. type: 2,
  226. title: '',
  227. closeBtn: 0,
  228. resize: false,
  229. shadeClose: true,
  230. area : ['556px', '266px'],
  231. content: '/broadcast/profileLayer/editBrief',
  232. end: function(){
  233. var status = Cookies.getJSON('add_success_name');
  234. Cookies.remove('add_success_name');
  235. if(status && status.status == 1){
  236. window.location.reload();
  237. }
  238. }
  239. });
  240. })
  241. //修改个人兴趣爱好
  242. $('.editHobbies').on('click', function(){
  243. parent.layer.open({
  244. type: 2,
  245. title: '',
  246. closeBtn: 0,
  247. resize: false,
  248. shadeClose: true,
  249. area : ['556px', '159px'],
  250. content: '/broadcast/profileLayer/editHobbies',
  251. end: function(){
  252. var status = Cookies.getJSON('add_success_hobbies');
  253. Cookies.remove('add_success_hobbies');
  254. if(status && status.status == 1){
  255. window.location.reload();
  256. }
  257. }
  258. });
  259. })
  260. //关闭窗口清空表单数据,解决重复选择同一张图片的问题。
  261. function emptiedFile(){
  262. $("input[name='file']").val('');
  263. }
  264. })
  265. </script>