<div class="formDetailInfo appPageWrap">
    <div class="formDetailTitle" style="margin-bottom: 30px;">
        <a class="pretitle hand" ng-click="cancel()">产品中心</a>
        <span ng-if="!infoId"> > 新建产品</span>
        <span ng-if="infoId"> > 修改产品</span>
    </div>

    <div class="clear"></div>

    <div class="circlewrap" ng-show="isLog || !infoId">
        <span class="active">
            <span class="circle">1</span>
            <span class="circlelabel" ng-if="!infoId"> 新建产品</span>
            <span class="circlelabel" ng-if="infoId"> 修改产品</span>
        </span>
        <span class="circleline"></span>
        <span ng-class="{'active':stepflag>1}" class="hand"> <!--ng-click="changeStep()"-->
            <span class="circle">2</span>
            <span class="circlelabel">嵌入SDK</span>
        </span>
        <!-- <span class="circleline"></span>
        <span ng-class="{'active':stepflag>2}">
            <span class="circle">3</span>
            <span class="circlelabel">数据调试</span>
        </span> -->
    </div>

    <div ng-show="stepflag==1">
        <div class="formDetailItem">
            <div class="iptlabel must">产品名称:</div>
            <input type="text" class="iptform" ng-model="name" ng-blur="exixtName()" placeholder="请输入应用名称">
            <em class="error" ng-if="tip.name.status">{{tip.name.txt}}</em>
        </div>
        <div class="formDetailItem">
            <div class="iptlabel must">平台:</div>
            <div class="radioWrap" ng-show="!id">
                <div class="radiolabel" ng-click="platform='iOS'">
                    <span class="radio" ng-class="{'active':platform=='iOS'}"></span>
                    iOS
                </div>
                <div class="radiolabel" ng-click="platform='Android'">
                    <span class="radio" ng-class="{'active':platform=='Android'}"></span>
                    Android
                </div>
                <div class="radiolabel" ng-click="platform='H5'">
                    <span class="radio" ng-class="{'active':platform=='H5'}"></span>
                    H5
                </div>
                <!-- <div class="radiolabel" ng-click="platform='web'">
                    <span class="radio" ng-class="{'active':platform=='web'}"></span>
                    web
                </div> -->
            </div>
            <div class="radioWrap" ng-show="id">
                <span class="label">{{platform}}</span>
            </div>
        </div>
        <div class="formDetailItem" ng-show="platform=='iOS'">
            <div class="iptlabel must">apple_appid:</div>
            <input type="text" class="iptform" ng-model="bundleid" ng-blur="existBundleid()" placeholder="请输入apple_appid">
            <em class="error" ng-if="tip.bundleid.status">{{tip.bundleid.txt}}</em>
            <div class="iptwrap desc">例:https://itunes.apple.com/cn/app/xxxxx/id1032170871
    则apple_appid为1032170871,如果apple_appid暂时无法获取，请输入任意9-10位的数字，待应用上线后，请修改</div>
        </div>
        <div class="formDetailItem">
            <div class="iptlabel must">产品类别:</div>
            <input type="text" class="iptform" ng-model="appGenreName" ng-disabled="true" ng-if="id && !tagType">
            <select-list meau-info="typeList" meau-id="appGenre" meau-data="appGenreInit"  keyid="categoryid" ng-show="!tagType && !id"></select-list>
            <div class="radioWrap" ng-show="id && tagType=='game'">
                <span class="label">游戏</span>
            </div>
            <div class="radioWrap" ng-show="id && tagType=='app'">
                <span class="label">应用</span>
            </div>
            <div class="radioWrap" ng-show="id && tagType=='test'">
                <span class="label">测试</span>
            </div>
            <div class="radioWrap" ng-show="!id">
                <div class="radiolabel" ng-click="tagType='game'">
                    <span class="radio" ng-class="{'active':tagType=='game'}"></span>
                    游戏
                </div>
                <div class="radiolabel" ng-click="tagType='app'">
                    <span class="radio" ng-class="{'active':tagType=='app'}"></span>
                    应用
                </div>
                <div class="radiolabel" ng-click="tagType='test'">
                    <span class="radio" ng-class="{'active':tagType=='test'}"></span>
                    测试
                </div>
            </div>
            <div class="tagWrap datawrap" ng-show="tagType=='game'">
                <span class="ml10 mt10">类型：</span>
                <select-more-list style="width:160px;margin-top:-5px;" meau-info="tagList.game[0].child" meau-id="typeIds"
                meau-name="typeinit" keyid="itemCode" keyname="itemValue" meau-data="typeinitIds"
                meau-red="typenull" meau-dis="id"></select-more-list>
                <span class="ml10" ng-show="(themeinitIds && id) || !id">题材：</span>
                <select-more-list style="width:160px;margin-top:-5px;" meau-info="tagList.game[1].child" meau-id="themeIds"
                meau-name="themeinit" keyid="itemCode" keyname="itemValue" meau-data="themeinitIds"
                 meau-red="themenull" meau-dis="id" ng-show="(themeinitIds && id) || !id"></select-more-list>
                <span class="ml10" ng-show="(styleinitIds && id) || !id">美术风格：</span>
                <select-more-list style="width:160px;margin-top:-5px;" meau-info="tagList.game[2].child" meau-id="styleIds"
                 meau-name="styleinit" keyid="itemCode" keyname="itemValue" meau-data="styleinitIds"
                 meau-red="stylenull" meau-dis="id" ng-show="(styleinitIds && id) || !id"></select-more-list>
            </div>
            <div class="tagWrap datawrap" ng-show="tagType=='app'">
                <select-list style="width:160px;" meau-info="tagList.app" meau-id="firstId"
                meau-name="firstinit" keyid="itemCode" keyname="itemValue" meau-data="firstinitId"
                 meau-red="firstnull" meau-dis="id"></select-list>
                <select-list style="width:160px;" ng-if="firstId" meau-info="secondList" meau-id="secondId"
                meau-name="secondinit" keyid="itemCode" keyname="itemValue" meau-data="secondinitId"
                meau-red="secondnull" meau-dis="id"></select-list>
            </div>
            <div class="iptwrap desc" style="display:block;">
                产品类别选择后将不能再做修改，请谨慎填写。
            </div>
        </div>
        <div class="formDetailItem" ng-show="showGame">
            <div class="iptlabel must">游戏类别:</div>
            <input type="text" class="iptform" ng-model="gameGenreName" ng-disabled="true" ng-if="id && appTagList.length==0">
            <select-list meau-info="gameList" meau-id="gameGenre" meau-data="gameGenreInit" keyid="categoryid" ng-show="!tagType && !id"></select-list>
        </div>
        <div class="formDetailItem">
            <div class="iptlabel must">下载地址:</div>
            <input type="text" class="iptform" ng-model="url" placeholder="请输入下载地址">
            <em class="error" ng-if="tip.url.status">{{tip.url.txt}}</em>
        </div>
        <div class="formsaveBtnWrap clearfix">
            <div class="btn5" ng-click="save()">
                <span ng-if="!id">立即创建</span>
                <span ng-if="id">保存</span>
            </div>
            <div class="btn6" ng-click="cancel()">取消</div>
        </div>
    </div>

    <div ng-show="stepflag==2">
        <div class="appsdk">
            <div class="appTitle">产品名称：</div>
            <div class="appText">{{name}}</div>
        </div>
        <div class="appsdk">
            <div class="appTitle">您的APPKEY：</div>
            <div class="appText appid">
                <span id="appidCopy">{{appkey}}</span>
                <button class="sdkAppid" data-clipboard-action="copy" data-clipboard-target="#appidCopy">复制</button>
            </div>
        </div>
        <div class="appsdk idenText">
            <div class="appTitle">&nbsp;</div>
            <div class="appText iden">(APPKEY是应用的唯一标识，用来集成到SDK中。)</div>
        </div>
        <div class="appsdk">
            <a href="http://doc.trackingio.com/sdkwen-dang.html" target="_blank"><div class="sdkButton" ng-click="downloadsdk()">查看集成文档并下载SDK</div></a>
        </div>
        <div class="useSdk">
            <p class="userTitle">使用流程：</p>
            <p class="userText">
              1.下载SDK<span class="circleline"></span>
              2.集成SDK
              <!-- <span class="circleline"></span> -->
              <!-- 3.数据调试 -->
            </p>
        </div>
        <!-- <p class="userText error" style="padding-left: 38px; margin-top: 20px">数据调试结束后上报的数据才进入正常的数据统计。</p> -->
        <div class="btn3 stepBtn" ng-click="nextStep()">
            完成
        </div>
    </div>

    <div ng-show="stepflag == 3">
        <div class="btn6 sdkLast" ng-click="changeStep()" style="width: 120px;">上一步</div>
        <div class="btn3 sdkSave" ng-click="finisStep()" style="width: 130px;" ng-if="hasZeroEvt==0">
            完成调试，保存新建
        </div>
        <div class="btn2 big dis sdkSave" style="width: 150px;" ng-if="hasZeroEvt>0">完成调试，保存新建</div>

        <div class="clearfix">
            <div class="btn10 mr10" ng-click="queryLogInfo()" style="float: right;">
                <span class="f5IconGray"></span>数据刷新
            </div>
            <span style="float: right;" class="error lh32" ng-if="(platform=='H5' && hasZeroEvt==1) || hasZeroEvt==2">我们还没有接收到来自您的任何数据，请继续进行集成工作。</span>
        </div>
        <div class="applogWrap clearfix">
            <div class="logTestWrap mr10">
                <div class="logTestTitle">LogTest</div>
                <div class="logTestCont">
                    <div class="appsdk">
                        <div class="appTitle">您的APPKEY：</div>
                        <div class="appText appid">
                            <span>{{appkey}}</span>
                        </div>
                    </div>
                    <dl class="tipsList">
                        <dt>说明</dt>
                        <dd>1.打开集成好的客户端，SDK将自动帮助收集数据。</dd>
                        <dd>2.在任意平台有数据量产生后，您可随时完成调试，进入正式数据报表。</dd>
                        <dd>3.一个APP最多显示1W条测试数据，且保留最近7天数据。</dd>
                    </dl>
                    <div class="appEvtWrap hm-scroll">
                        <div class="appEvtItem" ng-repeat="test in testInfos track by $index">
                            <span>{{test.eventNameAlias}}</span>
                            <em>{{test.eventNumber}}</em>
                        </div>
                    </div>
                </div>
            </div>
            <div class="logTestWrap">
                <div class="logTestTitle">日志
                    <select-list meau-info="deviceList" meau-id="deviceId" meau-data="deviceInit" style="float:right;width:230px;" ng-show="logInfos.length>0"></select-list>
                </div>
                <div class="logTestCont">
                    <dl class="tipsList" ng-if="logInfos.length==0">
                        <dt>已经集成，依然查阅不到任何数据？请仔细检查下述事项： </dt>
                        <dd>1.仔细检查APPKEY是否填写正确，是否多输入了空格等字符。</dd>
                        <dd>2.检查您的测试设备是否网络正常。</dd>
                    </dl>
                    <ul class="chainWrap hm-scroll">
                        <li ng-repeat="log in logInfos | filter:{'deviceId':deviceTxt} track by $index">
                            <i></i>
                            <span>{{log.xcontext._deviceid}}</span>
                            <h6 ng-click="lookEvents(log)" stop-event>{{log.eventName}}</h6>
                            <em>{{log.xwhen}}</em>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="chartWrap clearfix">
            <div class="chartWrapItem nothborder" ng-if="platform!='H5'">
                <div class="chartModule">
                    <span>调试设备列表</span>
                </div>
                <div class="tableList">
                    <table>
                        <tr>
                            <th>平台</th>
                            <th>设备ID</th>
                            <!-- <th>分包渠道</th> -->
                            <th>最后测试时间</th>
                            <th>测试日志总数</th>
                        </tr>
                        <tr ng-repeat="total in totalInfos track by $index">
                            <td>
                                <b class="platformIcon" ng-class="getPlatClass(total.os)"></b>
                            </td>
                            <td>{{total.deviceId}}</td>
                            <!-- <td>
                                <span ng-if="total.packetChannel!='_default_' && total.packetChannel!='unknown'">{{total.packetChannel}}</span>
                            </td> -->
                            <td>{{total.latestTime}}</td>
                            <td>{{total.number}}</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="leftTipsSlider" ng-class="{'sliderLog':logFlag>0}" stop-event>
        <div class="slideHeader" ng-show="logFlag==1">
            日志详情
            <div class="whiteClose" ng-click="hideDetails()"></div>
        </div>
        <div class="slideHeader" ng-show="logFlag==2">
            <div class="backLog left" ng-click="logFlag=1">返回</div>
            事件属性
            <div class="whiteClose" ng-click="hideDetails()"></div>
        </div>
        <div class="tableList hm-scroll" style="max-height: 90%;overflow-y: auto;">
            <table ng-show="logFlag==1">
                <tr ng-repeat="event in eventDetails track  by $index">
                    <td>{{event.name}}</td>
                    <td ng-if="!event.isevent">
                        <span ng-if="event.second">
                            {{curEvtLogInfo.xcontext[event.key]}}
                        </span>
                        <span ng-if="!event.second">
                            <span ng-if="!event.value">{{curEvtLogInfo[event.key]}}</span>
                            <span ng-if="event.value">{{event.value}}</span>
                        </span>
                    </td>

                    <td class="ckEvt" ng-click="lookParams()" ng-if="event.isevent">{{curEvtLogInfo[event.key]}}</td>
                </tr>
            </table>
            <table ng-show="logFlag==2">
                <tr ng-repeat="param in paramsList track by $index">
                    <td>{{param.name}}</td>
                    <td>{{param.value}}</td>
                </tr>
            </table>
        </div>
    </div>
</div>
