frame4.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title>个人中心</title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  9. <link rel="stylesheet" type="text/css" href="../../css/style.css" />
  10. <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  11. <link rel="stylesheet" href="../../css/projeck.css">
  12. <style>
  13. .personal_header_color {
  14. width: 100%;
  15. height: 57.5px;
  16. background: #009FE8;
  17. }
  18. .personal_details_message {
  19. display: flex;
  20. align-items: center;
  21. justify-content: space-between;
  22. margin: -34px 14px 0 14px;
  23. background: rgba(255, 255, 255, 1);
  24. box-shadow: 0px 0px 3px 3px rgba(0, 0, 0, 0.05);
  25. border-radius: 2px;
  26. padding: 6px 6px 9px 8px;
  27. }
  28. .left_avatar_personal_info {
  29. display: flex;
  30. align-items: center;
  31. }
  32. .avatar_container img {
  33. width: 55px;
  34. height: 55px;
  35. border-radius: 100%;
  36. box-shadow: 0px 0px 4px 4px rgba(0, 0, 0, 0.1);
  37. }
  38. .details_info {
  39. margin-left: 12px;
  40. }
  41. .details_info .info_header {
  42. display: flex;
  43. align-items: center;
  44. }
  45. .info_header_name {
  46. font-size: 17px;
  47. font-weight: 700;
  48. }
  49. .info_section_footer {
  50. font-size: 13px;
  51. }
  52. .info_header .name {
  53. color: #232627;
  54. font-size: 18px;
  55. font-weight: 500;
  56. }
  57. .info_header .qrcode_img img {
  58. width: 18px;
  59. height: 18px;
  60. margin-left: 5px;
  61. }
  62. .right_handle_arrow img {
  63. width: 14px;
  64. height: 14px
  65. }
  66. .icon_items {
  67. margin: 0 16px 23px 16px;
  68. }
  69. .icon_items ul {
  70. display: flex;
  71. flex-wrap: wrap;
  72. }
  73. .icon_items ul li {
  74. width: 33%;
  75. text-align: center;
  76. }
  77. .icon_items ul li {
  78. display: flex;
  79. flex-flow: column;
  80. justify-content: center;
  81. align-items: center;
  82. padding-top: 23px;
  83. color: #232627;
  84. font-size: 14px;
  85. }
  86. .icon_items ul li div:last-child {
  87. margin-top: 6px;
  88. }
  89. /*.icon_items ul li:last-child {
  90. padding-top: 6px;
  91. }*/
  92. .icon_items ul li img {
  93. width: 43px;
  94. height: 43px;
  95. }
  96. .line {
  97. height: 4px;
  98. background: rgba(0, 159, 232, 1);
  99. margin: 0 14px;
  100. }
  101. .handle_list_item {
  102. margin: 0 15px 0 23px;
  103. }
  104. .handle_list_item ul li {
  105. height: 45px;
  106. display: flex;
  107. align-items: center;
  108. justify-content: space-between;
  109. border-bottom: solid 1px #F5F5F5
  110. }
  111. .handle_list_item ul li:last-child {
  112. border-bottom: none
  113. }
  114. .handle_list_item ul li div:first-child {
  115. display: flex;
  116. align-items: center;
  117. }
  118. .handle_list_item ul li div:first-child span {
  119. display: block;
  120. margin-left: 6px;
  121. }
  122. .handle_list_item ul li div:first-child img {
  123. width: 18px;
  124. height: 18px;
  125. }
  126. .filter_gray_img {
  127. -webkit-filter: grayscale(100%);
  128. -moz-filter: grayscale(100%);
  129. -ms-filter: grayscale(100%);
  130. -o-filter: grayscale(100%);
  131. filter: grayscale(100%);
  132. filter: gray;
  133. }
  134. </style>
  135. </head>
  136. <body style="background-color:#fff;">
  137. <div class="api_layout">
  138. <div class="personal_header_color"></div>
  139. <div class="personal_details_message" onclick="handleOpenPersonalQrCode()">
  140. <div class="left_avatar_personal_info">
  141. <!-- http://jiewei-icon.oss-cn-beijing.aliyuncs.com/icon/default-avatar.png -->
  142. <div class="avatar_container" onclick="openPersonal()"><img id="avatar_img" src="" alt=""></div>
  143. <div class="details_info">
  144. <div class="info_header">
  145. <div class="info_header_name"></div>
  146. <div class="qrcode_img" onclick="handleOpenPersonQrCode()"><img src="../../image/qrCodeImg.png" alt=""></div>
  147. </div>
  148. <div class="info_section_footer"></div>
  149. </div>
  150. </div>
  151. <div class="right_handle_arrow"><img src="../../image/more.png" alt=""></div>
  152. </div>
  153. <div class="icon_items">
  154. <ul>
  155. <li class="message_alert" onclick="openNewsList()">
  156. <div><img src="../../icon/messagealert.png" alt=""></div>
  157. <div>消息提醒</div>
  158. </li>
  159. <li>
  160. <div><img style="filter: grayscale(100%);filter: gray;" src="../../icon/Collection.png" alt=""></div>
  161. <div>收藏</div>
  162. </li>
  163. <li onclick="openExamine()">
  164. <div><img src="../../icon/Workorderapproval.png" alt=""></div>
  165. <div>工单审核</div>
  166. </li>
  167. <li>
  168. <div><img class="filter_gray_img" src="../../icon/Learningintegra.png" alt=""></div>
  169. <div>学习积分</div>
  170. </li>
  171. <li>
  172. <div><img class="filter_gray_img" src="../../icon/Integralmall.png" alt=""></div>
  173. <div>积分商城</div>
  174. </li>
  175. <li>
  176. <div><img class="filter_gray_img" src="../../icon/LearningReport.png" alt=""></div>
  177. <div>学习报表</div>
  178. </li>
  179. <li>
  180. <div><img class="filter_gray_img" src="../../icon/Personalcloudisk.png" alt=""></div>
  181. <div>个人云盘</div>
  182. </li>
  183. <li onclick="handleUserExplain()">
  184. <div><img src="../../icon/Usermanual.png" alt=""></div>
  185. <div>使用手册</div>
  186. </li>
  187. <li onclick="handleServicePhone()">
  188. <div><img src="../../icon/Servicephone.png" alt=""></div>
  189. <div>服务电话</div>
  190. </li>
  191. <li onclick="handleFeedback()">
  192. <div><img src="../../icon/Suggestionfeedback.png" alt=""></div>
  193. <div>建议反馈</div>
  194. </li>
  195. <li onclick="handleDownQrcode()">
  196. <div><img src="../../icon/downQrcode.png" alt=""></div>
  197. <div>下载二维码</div>
  198. </li>
  199. </ul>
  200. </div>
  201. <div class="line"></div>
  202. <div class="handle_list_item">
  203. <ul>
  204. <li onclick="openForget()">
  205. <div>
  206. <img src="../../icon/ChangePassword.png" alt="">
  207. <span>修改密码</span>
  208. </div>
  209. <div class="right_handle_arrow">
  210. <img src="../../image/more.png" alt="">
  211. </div>
  212. </li>
  213. <li>
  214. <div>
  215. <img src="../../icon/Signout.png" alt="">
  216. <span>退出登录</span>
  217. </div>
  218. <div class="right_handle_arrow">
  219. <img src="../../image/more.png" alt="">
  220. </div>
  221. </li>
  222. <li onclick="handleUpdateTitle()">
  223. <div>
  224. <img src="../../icon/Updatelog.png" alt="">
  225. <span>更新日志</span>
  226. </div>
  227. <div class="right_handle_arrow">
  228. <img src="../../image/more.png" alt="">
  229. </div>
  230. </li>
  231. </ul>
  232. </div>
  233. </div>
  234. </body>
  235. </html>
  236. <script type="text/javascript" src="../../script/api.js"></script>
  237. <!-- <script src="../../script/aui-toast.js" charset="utf-8"></script> -->
  238. <!-- <script src="../../script/fastclick.min.js" charset="utf-8"></script> -->
  239. <script src="../../script/config.js" charset="utf-8"></script>
  240. <script type="text/javascript">
  241. var token, uuid, headers, personalName = '',
  242. staff_num = '';
  243. var toast = new auiToast();
  244. apiready = function() {
  245. var info = $api.getStorage('data'),
  246. user = JSON.parse(info).data.user;
  247. token = JSON.parse(info).data.access_token;
  248. uuid = JSON.parse(info).data.user.staff_num;
  249. headers = {
  250. "Authorization": "Bearer " + token
  251. };
  252. newsNum()
  253. // 个人信息
  254. $http.fnReuestData(UrlRouter.userInfoApi, headers, 'post', '', personalCenterInfo);
  255. api.addEventListener({
  256. name: 'userInfo'
  257. }, function(ret, err) {
  258. $http.fnReuestData(UrlRouter.userInfoApi, headers, 'post', '', personalCenterInfo);
  259. });
  260. api.addEventListener({
  261. name: 'myNews'
  262. }, function(ret, err) {
  263. newsNum()
  264. });
  265. };
  266. // 个人信息展示
  267. function personalCenterInfo(ret, err) {
  268. if (ret) {
  269. toast.hide();
  270. if (ret.code === 0) {
  271. var ret = ret.data;
  272. var image = 'http://jiewei-icon.oss-cn-beijing.aliyuncs.com/icon/default-avatar.png';
  273. // var bindPhone = $api.dom('.api_phoneBind_wrap');
  274. var head_img = $api.byId('avatar_img'),
  275. name = $api.dom('.info_header_name'),
  276. api_dep = $api.dom('.info_section_footer');
  277. personalName = ret.name;
  278. staff_num = ret.staff_num;
  279. ret.name == null ? $api.html(name, '无') : $api.html(name, ret.name);
  280. ret.section_fullname == null ? $api.html(api_dep, '无') : $api.html(api_dep, ret.section_fullname);
  281. ret.avatar == null ? head_img.src = image : head_img.src = ret.avatar;
  282. } else if (ret.code === 401) {
  283. api.alert({
  284. title: '提示',
  285. msg: '登录过期,重新登录',
  286. }, function(ret, err) {
  287. var index = ret.buttonIndex;
  288. if (index == 1) {
  289. api.setStatusBarStyle({
  290. color: 'rgba(0,0,0,0)',
  291. style: 'light'
  292. });
  293. api.closeWin({
  294. name: 'index'
  295. });
  296. }
  297. });
  298. }
  299. } else {
  300. toast.hide();
  301. api.toast({
  302. msg: '网络错误',
  303. duration: 2000,
  304. location: 'bottom'
  305. });
  306. }
  307. }
  308. // 打开个人中心二维码
  309. function handleOpenPersonQrCode() {
  310. }
  311. // 打开二维码页面详情
  312. function handleOpenPersonalQrCode() {
  313. let title = `${staff_num}-${personalName}`;
  314. $http.requestData(`${UrlRouter.getPagebyNOAndName}?title=${title}`, 'get', '')
  315. .then(ret => {
  316. if (ret.data.id) {
  317. $event.openWin('browseQrcode_win', '../browseQrcode/browseQrcode_win', {
  318. pageId: ret.data.id,
  319. title: '人员详情'
  320. }, '');
  321. }
  322. })
  323. .catch(err => {
  324. // console.log(JSON.stringify(err));
  325. })
  326. }
  327. function handleUpdateTitle() {
  328. $event.openWin('browseQrcode_win','../browseQrcode/browseQrcode_win',{pageId:'cd7591c847134956b5b2307f4f52e6a8',title:'更新日志'},'');
  329. }
  330. // 修改密码
  331. function openForget() {
  332. $event.openTabLayout('forget', '../forgetBind/forgetPass', '修改密码', '');
  333. }
  334. // 绑定手机号
  335. function openBind() {
  336. $event.openTabLayout('bindPhone', '../forgetBind/bindPhone', '绑定手机号', '');
  337. }
  338. // 下载二维码
  339. function handleDownQrcode() {
  340. $event.openTabLayout('qrcodeShare', '../browseQrcode/qrcodeShare', '二维码下载', '');
  341. }
  342. // 我的审核
  343. function openExamine() {
  344. $event.openWin('examineMy_win','../wordorder/examineMy_win','','');
  345. //$event.openWin('wordorder_win','../wordorder/wordorder_win','','')
  346. //$event.openTabLayout('wordorderDetails', '../wordorder/wordorderDetails', '工单审核', '');
  347. }
  348. // 服务电话
  349. function handleServicePhone() {
  350. api.call({
  351. type: 'tel_prompt',
  352. number: '18152480670'
  353. });
  354. }
  355. // 使用说明
  356. function handleUserExplain() {
  357. $event.openWin('browseQrcode_win','../browseQrcode/browseQrcode_win',{pageId:'156c601a10be43bc8f32e83f0664821b',title:'使用说明'},'');
  358. }
  359. function handleFeedback() {
  360. $event.openWin('browseQrcode_win','../browseQrcode/browseQrcode_win',{pageId:'eeeaada3989343f39decda742082909b',title:'意见反馈'},'');
  361. }
  362. // // 我的审核openExamineDetails
  363. // function openExamineDetails() {
  364. // $event.openTabLayout('wordorderDetails','../wordorder/wordorderDetails','我的审核','');
  365. // }
  366. // //我的工单
  367. // function openMyWordOder() {
  368. // $event.openWin('myWordeOrder_win','../wordorder/myWordeOrder_win','','');
  369. // }
  370. // //我的流程
  371. // function openMyWordOderList() {
  372. // $event.openTabLayout('wordorderProcess','../wordorder/wordOrderProcess','工单流程','');
  373. // }
  374. // // 打开详情
  375. function openPersonal() {
  376. $event.openWin('personal', '../personalData/personal', '', '');
  377. }
  378. // //消息列表
  379. function openNewsList() {
  380. $event.openWin('newsList', '../news/news_win', '', '');
  381. }
  382. // 清除缓存
  383. // function clearCache() {
  384. // $event.openWin('clearCache','clearCache','','');
  385. // }
  386. // 上传头像
  387. var headImg;
  388. function actionSheetFun() {
  389. api.actionSheet({
  390. title: '选择',
  391. cancelTitle: '取消',
  392. buttons: ['相机', '相册']
  393. }, function(ret, err) {
  394. if (ret.buttonIndex != 3) {
  395. var type = 'camera';
  396. if (ret.buttonIndex == 1) {
  397. type = 'camera';
  398. } else {
  399. type = 'album';
  400. }
  401. api.getPicture({
  402. sourceType: type
  403. }, function(ret, err) {
  404. if (ret) {
  405. photoTailoring(ret.data);
  406. headImg = ret.data;
  407. }
  408. });
  409. }
  410. });
  411. }
  412. function uploadUrl(imgUrl) {
  413. var upload_avater = $api.byId('head_img');
  414. upload_avater.style.backgroundImage = 'url(' + imgUrl + ')';
  415. }
  416. function uploadHead(imgUrl) {
  417. toast.loading({
  418. title: "加载中",
  419. duration: 2000
  420. });
  421. api.ajax({
  422. url: urlphp + 'api/user/avatar/upload',
  423. method: 'post',
  424. headers: {
  425. "Authorization": "Bearer " + token,
  426. },
  427. data: {
  428. files: {
  429. avatar: imgUrl
  430. }
  431. }
  432. }, function(ret, err) {
  433. if (ret) {
  434. toast.hide();
  435. if (ret.code === 0) {
  436. api.toast({
  437. msg: '上传成功',
  438. duration: 2000,
  439. location: 'top'
  440. });
  441. } else {
  442. api.toast({
  443. msg: '上传失败',
  444. duration: 2000,
  445. location: 'top'
  446. });
  447. }
  448. } else {
  449. toast.hide();
  450. api.toast({
  451. msg: '网络错误',
  452. duration: 2000,
  453. location: 'top'
  454. });
  455. }
  456. });
  457. }
  458. // 退出
  459. function signOut() {
  460. api.confirm({
  461. title: '提示',
  462. msg: '退出登录?',
  463. buttons: ['确定', '取消']
  464. }, function(ret, err) {
  465. var index = ret.buttonIndex;
  466. if (index == 1) {
  467. api.setStatusBarStyle({
  468. color: 'rgba(0,0,0,0)',
  469. style: 'light'
  470. });
  471. $api.clearStorage();
  472. api.closeWin({
  473. name: 'index'
  474. });
  475. }
  476. });
  477. }
  478. // 照片裁剪
  479. function photoTailoring(imgPath) {
  480. var systemType = api.systemType;
  481. if (systemType == 'ios') {
  482. api.openFrame({
  483. name: 'tailoring',
  484. url: 'tailoring.html',
  485. rect: {
  486. x: 0,
  487. y: 0,
  488. w: api.winWidth,
  489. h: api.winHeight
  490. },
  491. pageParam: {
  492. tailoring: imgPath
  493. },
  494. bounces: false,
  495. bgColor: 'rgba(0,0,0,0)',
  496. vScrollBarEnabled: false,
  497. hScrollBarEnabled: false,
  498. });
  499. } else if (systemType == 'android') {
  500. var imageCrop = api.require('imageCrop');
  501. imageCrop.clipPhoto({
  502. imgPath: imgPath,
  503. height: api.winHeight,
  504. width: api.winWidth
  505. }, function(ret, err) {
  506. if (ret) {
  507. uploadUrl(ret.imgPath);
  508. uploadHead(ret.imgPath);
  509. }
  510. });
  511. }
  512. }
  513. //工单
  514. function openWordOrder() {
  515. // $event.openWin('wordorder_win','../wordorder/wordorder_win','','')
  516. // $event.openTabLayout('wordOrder','wordorder_frame','工单列表','')
  517. }
  518. // 消息总数
  519. function newsNum() {
  520. $http.fnReuestDataNologing(UrlRouter.getNewsNum, headers, 'get', '', function(ret, err) {
  521. if (ret.code === 0) {
  522. if (ret.data.unread_num === 0) {
  523. $api.css($api.dom('.news_num'), 'display:none');
  524. $api.html($api.dom('.news_num'), '');
  525. } else if (ret.data.unread_num > 99 || ret.data.unread_num == 99) {
  526. $api.css($api.dom('.news_num'), 'display:block');
  527. $api.html($api.dom('.news_num'), 99);
  528. } else {
  529. $api.css($api.dom('.news_num'), 'display:block');
  530. $api.html($api.dom('.news_num'), ret.data.unread_num);
  531. }
  532. }
  533. })
  534. }
  535. </script>