frame4.html 23 KB

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