123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <!DOCTYPE html>
- <html lang="zh-cn">
- <head>
- <meta charset="UTF-8">
- <meta name="format-detection" content="telephone=no"/>
- <meta name="format-detection" content="email=no"/>
- <title>my</title>
- <link rel="stylesheet" href="../css/reset.css">
- <link rel="stylesheet" href="../css/style.css">
- <script src="../script/flexible.js"></script>
- <style>
- html,body{
- height: 100%;
- }
- .my{
- height: 100%;
- background-color: #f7f7f7;
- padding-top: 0.23rem;
- }
- .my_con li{
- height: 1.5rem;
- line-height: 1.5rem;
- color: #212121;
- font-size: .42rem;
- background-color: #fff;
- padding: 0 .3rem;
- border-bottom: 1px solid #efefef;
- }
- .my_con li span:nth-of-type(2){
- color: #b5b5b5;
- font-size: .42rem;
- }
- </style>
- </head>
- <body>
- <div class="my">
- <div class="my_con">
- <ul>
- <li class="clearFix">
- <span class="left">个人资料</span><span class="right">〉</span>
- </li>
- <li class="clearFix">
- <span class="left">修改密码</span><span class="right">〉</span>
- </li>
- <li class="clearFix">
- <span class="left">变电柜维护</span><span class="right">〉</span>
- </li>
- <li class="clearFix">
- <span class="left">添加变电柜</span><span class="right">〉</span>
- </li>
- <li class="clearFix">
- <span class="left">添加街道</span><span class="right">〉</span>
- </li>
- <li class="clearFix">
- <span class="left">注销登录</span><span class="right">〉</span>
- </li>
- </ul>
- </div>
- </div>
- <script src="../script/jqueryMin.js"></script>
- <script src="../script/publicData.js"></script>
- <script type="text/javascript" src="../script/api.js"></script>
- <script>
- apiready=function () {
- getStreet();
- getDistrict();
- $(".my_con").on('click','li',function () {
- switch ($(this).index()){
- case 0:toUserData();
- break;
- case 1:changePW();
- break;
- case 2:toMaintain();
- break;
- case 3:toAdd();
- getStreet();
- break;
- case 4:addStreet();
- getDistrict();
- break;
- case 5:toLogin();
- break;
- }
- })
- function toUserData() {
- api.openWin({
- name: 'userdata',
- url: './userdata.html',
- animation: {
- type: 'push',
- subType: 'from_right',
- duration: 400
- },
- delay:300
- });
- }
- function toMaintain() {
- api.execScript({
- script: 'toFrame(8);'
- });
- }
- function changePW() {
- api.openWin({
- name: 'changePW',
- url: './changePW.html',
- animation: {
- type: 'push',
- subType: 'from_right',
- duration: 400
- },
- delay:300
- });
- }
- function toAdd() {
- api.openWin({
- name: 'addBDG',
- url: './addBDG.html',
- animation: {
- type: 'push',
- subType: 'from_right',
- duration: 400
- },
- reload:true,
- delay:300
- });
- }
- function addStreet() {
- api.openWin({
- name: 'addStreet',
- url: './addStreet.html',
- animation: {
- type: 'push',
- subType: 'from_right',
- duration: 400
- },
- reload:true,
- delay:300
- });
- }
- function getDistrict() {
- api.ajax({
- url: pageUrl+"/index/street/all-guanqu",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {user_id:$api.getStorage("user").id}
- }
- }, function (data, err) {
- var data=JSON.parse(data),districtData=[];
- // alert(JSON.stringify(data))
- for(var i in data){
- districtData[i]={
- id:data[i]['id'],
- text: data[i]['title'],
- status: 'normal'
- }
- }
- $api.setStorage("districtList",districtData);
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- }
- function getStreet() {
- api.ajax({
- url: pageUrl+"/index/street/jiedao",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {user_id:$api.getStorage("user").id}
- }
- }, function (data, err) {
- var data=JSON.parse(data).data,streetData=[],obj={};
- // alert(JSON.stringify(data))
- for(var i in data){
- if(!data[i]["street"]) continue;
- obj={
- id:data[i]["street"]['id'],
- text: data[i]["street"]['title'],
- status: 'normal'
- }
- streetData.push(obj)
- }
- $api.setStorage("streetList",streetData);
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- }
- function toLogin() {
- api.actionSheet({
- title: '确定要注销当前账号吗?',
- cancelTitle: '取消',
- destructiveTitle: '确认',
- style:{
- itemNormalColor:'#fff',
- fontNormalColor:'#4796ff'
- }
- }, function(ret, err) {
- var index = ret.buttonIndex;
- if(index==1){
- $api.rmStorage("user");
- $api.rmStorage("userdata");
- api.openWin({
- name: 'login',
- url: './login.html',
- animation: {
- type: 'movein',
- subType: 'from_right',
- duration: 400
- },
- delay:300
- });
- }
- });
- }
- }
- </script>
- </body>
- </html>
|