repairDetail.html 4.18 KB
<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>报障详情</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>

<body class="repair-view">
    <div class="aui-content aui-margin-b-15">
        <header class="aui-bar aui-bar-nav" id="header">
            <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
                <span class="aui-iconfont aui-icon-left"></span>
            </a>
            <div class="aui-title">报障详情</div>
        </header>
        <ul>
            <li>
                <label>设备编号</label>
                <span class="aui-pull-right" id="imei"></span>
                <i></i>
            </li>
            <li>
                <label>故障分类</label>
                <span class="aui-pull-right" id="type"></span>
                <i></i>
            </li>
            <li>
                <label>设备所在地址</label>
                <span class="aui-pull-right" id="province-city"></span>
                <i></i>
            </li>
            <li>
                <label>完善详细地址</label>
                <input type="text" placeholder="请填写详细地址" id="address"/>
            </li>
            <li>
                <label>联系电话</label>
                <span class="aui-pull-right" id="phone"></span>
            </li>
            <li>
                <label>问题描述</label>
                <input type="text" placeholder="为了便于定位问题,请详细描述问题" id="content" value="" readonly />
            </li>
            <li>
                <label>处理结果</label>
                <input type="text" placeholder="" value="" id="result" readonly/>
            </li>
        </ul>
    </div>
</body>

</html>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
    var header = $api.byId('header');
    fixStatusBar_API(header);
    apiready = function() {
        api.setStatusBarStyle({
            style: 'dark',
            color: 'rgba(0,0,0,0)'
        });
        api.parseTapmode();
        //参数id  api.pageParam
        //console.log(JSON.stringify(api.pageParam.id));
        //console.log(HOST + '/iot_api/v1/app/issue?id=' + api.pageParam.id);
        $.ajax({
            url: HOST + '/iot_api/v1/app/issue?id=' + api.pageParam.id,
            type: 'GET',
            dataType: 'json',
            headers: {
                'Content-Type': 'application/json;charset=utf-8',
                'token': $api.getStorage('userToken')
            },
            success: function(ret) {
                //console.log(JSON.stringify(ret));
                if (ret) {
                    if (ret.code == 0) {
                        $api.html($api.byId('imei'),ret.data.imei);
                        $api.html($api.byId('type'),ret.data.type);
                        $api.html($api.byId('province-city'),ret.data.province+" "+ret.data.city);
                        $api.val($api.byId('address'),ret.data.address);
                        $api.html($api.byId('phone'),ret.data.phone);
                        $api.val($api.byId('content'),ret.data.content);
                        $api.val($api.byId('result'),ret.data.result);
                    } else {
                        api.toast({
                            msg: ret.msg,
                            duration: 2000,
                            location: 'bottom'
                        });
                    }
                }
            },
            error: function() {
                api.toast({
                    msg: '获取数据失败',
                    duration: 2000,
                    location: 'bottom'
                });
            }
        });
    }
</script>