myPage.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>我的</title>
  6. <link rel="stylesheet" href="../css/main.css" />
  7. <link rel="stylesheet" href="../font/iconfont.css" />
  8. <link rel="stylesheet" href="../css/head.css">
  9. <script src="../js/flexible.js"></script>
  10. <script src="../js/api.js"></script>
  11. <script src="../js/checkLanguage.js"></script>
  12. </head>
  13. <body>
  14. <div >
  15. <div class="my-bg ub ub-ac plr25">
  16. <div class="ub-f1 ub ub-ac" id="upUserInfo">
  17. <div class="dx-boyhead mr20"><img src="../images/dx-boyhead.png" alt=""></div>
  18. <div class="ub-f1 fz30 c81">
  19. <p class="fz30 c3d" id="uName"></p>
  20. <div class="ub ub-ac pt10 dsib" id="datum">
  21. <p class="fz24 c81 word-break mr10 dsib" id="company"></p>
  22. <span class="true-icon remind3" id="auth"></span>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="ub bb ub-ac plr25 ptb10 bgff">
  28. <i class="dx-my-icon dx-icon-love"></i>
  29. <p class="fz30 c3d ml10 list1"></p>
  30. </div>
  31. <ul class="service-list bgff bb fnList">
  32. <li class="ub ub-ac">
  33. <a href="javascript:;" class="ub ub-ac ub-ver ub-f1 ptb20 hid">
  34. <i class="icon-list dx-icon-shop"></i>
  35. <span class="fz22 list2"></span>
  36. </a>
  37. <a href="javascript:;" class="ub ub-ac ub-ver ub-f1 ptb20">
  38. <i class="icon-list dx-icon-route"></i>
  39. <span class="fz22 list3"></span>
  40. </a>
  41. <a href="javascript:;" class="ub ub-ac ub-ver ub-f1 ptb20">
  42. <i class="icon-list dx-icon-business"></i>
  43. <span class="fz22 list4"></span>
  44. </a>
  45. <a href="javascript:;" class="ub ub-ac ub-ver ub-f1 ptb20">
  46. <i class="icon-list dx-icon-panter"></i>
  47. <span class="fz22 list5"></span>
  48. </a>
  49. </li>
  50. </ul>
  51. <ul class="mt20 navList">
  52. <li>
  53. <a href="javascript:;" class="ub bb ub-ac plr25 ptb20 bgff">
  54. <i class="dx-my-icon dx-icon-order"></i>
  55. <b class="fz30 c3d ml10 ub-f1 list6"></b>
  56. <i class="iconfont icon-jiantou cbc"></i>
  57. </a>
  58. </li>
  59. <li>
  60. <a href="javascript:;" class="ub bb ub-ac plr25 ptb20 bgff">
  61. <i class="dx-my-icon dx-icon-price"></i>
  62. <b class="fz30 c3d ml10 ub-f1 list7"></b>
  63. <i class="iconfont icon-jiantou cbc"></i>
  64. </a>
  65. </li>
  66. <li>
  67. <a href="javascript:;" class="ub bb ub-ac plr25 ptb20 bgff">
  68. <i class="dx-my-icon dx-icon-shopmanger"></i>
  69. <b class="fz30 c3d ml10 ub-f1 list8"></b>
  70. <i class="iconfont icon-jiantou cbc"></i>
  71. </a>
  72. </li>
  73. <li>
  74. <a href="javascript:;" class="ub bb ub-ac plr25 ptb20 bgff">
  75. <i class="dx-my-icon dx-icon-money"></i>
  76. <b class="fz30 c3d ml10 ub-f1 list9"></b>
  77. <i class="iconfont icon-jiantou cbc"></i>
  78. </a>
  79. </li>
  80. <li>
  81. <a href="javascript:;" class="ub bb ub-ac plr25 ptb20 bgff">
  82. <i class="dx-my-icon dx-icon-setting"></i>
  83. <b class="fz30 c3d ml10 ub-f1 list10"></b>
  84. <i class="iconfont icon-jiantou cbc"></i>
  85. </a>
  86. </li>
  87. <!--<li>-->
  88. <!--<a href="javascript:;" class="ub bb ub-ac plr25 ptb20 bgff">-->
  89. <!--<i class="dx-my-icon dx-icon-pay"></i>-->
  90. <!--<b class="fz30 c3d ml10 ub-f1">申请付费服务</b>-->
  91. <!--<i class="iconfont icon-jiantou cbc"></i>-->
  92. <!--</a>-->
  93. <!--</li>-->
  94. </ul>
  95. <ul class="mt20 un-fnList">
  96. <li>
  97. <a href="javascript:;" class="ub bb ub-ac plr25 ptb20 bgff">
  98. <i class="dx-my-icon dx-icon-loan"></i>
  99. <b class="fz30 c3d ml10 ub-f1 list11"></b>
  100. </a>
  101. </li>
  102. </ul>
  103. </div>
  104. <script type="text/javascript">
  105. try {
  106. var text=languages.myPage;
  107. $api.dom(".list1").innerText=text.list1;
  108. $api.dom(".list2").innerText=text.list2;
  109. $api.dom(".list3").innerText=text.list3;
  110. $api.dom(".list4").innerText=text.list4;
  111. $api.dom(".list5").innerText=text.list5;
  112. $api.dom(".list6").innerText=text.list6;
  113. $api.dom(".list7").innerText=text.list7;
  114. $api.dom(".list8").innerText=text.list8;
  115. $api.dom(".list9").innerText=text.list9;
  116. $api.dom(".list10").innerText=text.list10;
  117. $api.dom(".list11").innerText=text.list11;
  118. $api.dom(".remind3").innerText=text.remind3;
  119. }catch (e){
  120. alert(languages.all.list5)
  121. }
  122. </script>
  123. <script src="../js/publicData.js"></script>
  124. <script>
  125. var companyLen=0;
  126. apiready=function () {
  127. var fnList= $api.dom(".fnList"),
  128. upUserInfo= $api.dom( "#upUserInfo"),
  129. unFnList= $api.dom(".un-fnList"),
  130. navList= $api.dom( ".navList"),
  131. datum= $api.dom( "#datum"),
  132. fnLi=$api.domAll(fnList,"a"),
  133. unFnLi=$api.domAll(unFnList,"li"),
  134. navLi=$api.domAll(navList,"li");
  135. var navArr=["orderPage","issuePage","myShop","myBalance","accountSettings","paidService","unMyShop"];
  136. var fnArr=["unMyShop","paidService","myShop"];
  137. isOpened();
  138. updateInfo();
  139. datum.onclick=function (e) {
  140. e.stopPropagation();
  141. if(companyLen){
  142. api.openWin({
  143. name: 'enterpriseData',
  144. url: 'enterpriseData.html',
  145. pageParam: {name: 'pageparamname'}
  146. });
  147. }else {
  148. api.openWin({
  149. name: 'informationed1',
  150. url: 'informationed1.html',
  151. reload:true,
  152. pageParam: {name: 'pageparamname'}
  153. });
  154. }
  155. }
  156. upUserInfo.onclick=function () {
  157. api.openWin({
  158. name: 'userData',
  159. url: 'userData.html',
  160. pageParam: {name: 'pageparamname'}
  161. });
  162. }
  163. for(var fnNum=0,fnLen=fnLi.length;fnNum<fnLen;fnNum++){
  164. !function (i) {
  165. fnLi[i].onclick=function () {
  166. if(i>=1){
  167. try {
  168. api.execScript({
  169. name: 'paidService',
  170. script: 'toServiceFrame('+(i-1)+');'
  171. });
  172. }catch (e){}
  173. api.openWin({
  174. name: fnArr[1],
  175. url: fnArr[1]+'.html',
  176. pageParam: {index: (i-1)}
  177. });
  178. api.sendEvent({
  179. name: 'isOpened',
  180. extra: {key1: 'value'}
  181. });
  182. }else {
  183. if($api.getStorage("serviceStatus")["shop"]=="1"){
  184. api.openWin({
  185. name: fnArr[2],
  186. url: fnArr[2]+'.html',
  187. pageParam: {index: 2}
  188. });
  189. }else {
  190. api.openWin({
  191. name: fnArr[0],
  192. url: fnArr[0]+'.html',
  193. pageParam: {index: 0}
  194. });
  195. }
  196. }
  197. }
  198. }(fnNum)
  199. }
  200. for(var unFnNum=0,unFnLen=unFnLi.length;unFnNum<unFnLen;unFnNum++){
  201. !function (i) {
  202. unFnLi[i].onclick=function () {
  203. api.toast({
  204. msg: '开发中',
  205. duration: 2000,
  206. location: 'bottom'
  207. });
  208. }
  209. }(unFnNum)
  210. }
  211. for(var navNum=0,navLen=navLi.length;navNum<navLen;navNum++){
  212. !function (i) {
  213. navLi[i].onclick=function () {
  214. if(i==0){
  215. var jsfun1 = 'toFrame(0);';
  216. api.execScript({
  217. name: 'root',
  218. script: jsfun1
  219. });
  220. }else if(i==1){
  221. var jsfun2 = 'toFrame(1);';
  222. api.execScript({
  223. name: 'root',
  224. script: jsfun2
  225. });
  226. }else {
  227. if(i==5){
  228. try {
  229. api.execScript({
  230. name: 'paidService',
  231. script: 'toServiceFrame(0);'
  232. });
  233. }catch (e){}
  234. api.sendEvent({
  235. name: 'isOpened',
  236. extra: {key1: 'value'}
  237. });
  238. }
  239. if(i==2){
  240. // if($api.getStorage("serviceStatus")["shop"]=="1"){
  241. api.openWin({
  242. name: navArr[2],
  243. url: navArr[2]+'.html',
  244. pageParam: {index: 2}
  245. });
  246. // }else {
  247. // api.openWin({
  248. // name: navArr[6],
  249. // url: navArr[6]+'.html',
  250. // pageParam: {index: 2}
  251. // });
  252. // }
  253. }else {
  254. api.openWin({
  255. name: navArr[i],
  256. url: navArr[i]+'.html',
  257. pageParam: {index: 0}
  258. });
  259. }
  260. }
  261. }
  262. }(navNum)
  263. }
  264. api.addEventListener({
  265. name:'isOpened'
  266. }, function(ret, err){
  267. isOpened()
  268. });
  269. api.addEventListener({
  270. name: 'updateInfo'
  271. }, function (ret, err) {
  272. updateInfo();
  273. });
  274. }
  275. function isOpened() {
  276. var shopIcon= $api.dom( ".dx-icon-shop"),
  277. routeIcon= $api.dom( ".dx-icon-route"),
  278. businessIcon= $api.dom( ".dx-icon-business"),
  279. panterIcon= $api.dom( ".dx-icon-panter");
  280. var status=$api.getStorage('serviceStatus');
  281. var serviceList=[{"name":"shop","ele":shopIcon},{"name":"recommend","ele":routeIcon},{"name":"assurance","ele":businessIcon},{"name":"partner","ele":panterIcon}];
  282. for(var i=0;i<serviceList.length;i++){
  283. if(status[serviceList[i]['name']]=="1"){
  284. serviceList[i]["ele"].style.backgroundPosition="center bottom";
  285. }else {
  286. serviceList[i]["ele"].style.backgroundPosition="0 0";
  287. }
  288. }
  289. }
  290. function updateInfo() {
  291. var authentication= $api.dom("#auth"),company= $api.dom( "#company"),uName= $api.dom( "#uName"),dx_boyhead= $api.dom(".dx-boyhead");
  292. var userInfo=$api.getStorage("user"),bl=false;
  293. if(userInfo['user_singel']&&userInfo['user_singel']['headimage']) {
  294. dx_boyhead.getElementsByTagName('img')[0].setAttribute("src",pageImg+userInfo['user_singel']['headimage']);
  295. }else {
  296. dx_boyhead.getElementsByTagName('img')[0].setAttribute("src","../images/dx-boyhead.png");
  297. }
  298. if(userInfo['user_singel']&&userInfo['user_singel']['nikename']){
  299. uName.innerText=userInfo['user_singel']['nikename'];
  300. }else {
  301. uName.innerText=languages.myPage.remind1;
  302. }
  303. if(userInfo['company']&&userInfo['company'].length){
  304. companyLen=userInfo['company'].length;
  305. for(var i in userInfo['company']){
  306. if(bl) continue;
  307. if(userInfo['company'][i]['isVerify']==1){
  308. authentication.className="false-icon";
  309. authentication.innerText=languages.myPage.remind2;
  310. company.innerText=userInfo['company'][i]['companyName'];
  311. bl=true;
  312. }else {
  313. authentication.className="true-icon";
  314. authentication.innerText=languages.myPage.remind3;
  315. company.innerText=userInfo['company'][i]['companyName'];
  316. }
  317. }
  318. }else {
  319. companyLen=0;
  320. authentication.className="true-icon";
  321. company.innerText=languages.myPage.remind4;
  322. authentication.innerText=languages.myPage.remind3;
  323. }
  324. isOpened();
  325. }
  326. </script>
  327. </body>
  328. </html>