<view class="selectwifi_bg"></view>
<view class="selectwifi">
    <view class="selectwifi_title">选择WI-FI</view>
    <view class="selectwifi_text">此设备只支持使用2.4GHz Wi-Fi连接使用</view>
    <mptoptips msg="{{error}}" type="error" show="{{error}}"></mptoptips>
    <view class="selectwifi_form">
        <mpform id="wifiform" rules="{{rules}}" models="{{wifiData}}" >
            <view class="row">
                <!-- <input class="row_input" name="wifi" placeholder="请输入Wi-Fi名称" /> -->
                <input bindinput="formInputChange" data-field="wifi" class="row_input" type="text" value="{{wifiData[0].value}}" placeholder="请输入Wi-Fi名称" />
                <view class="row_button {{isSelected ? 'selected' : ''}}" bind:tap="getWifi">选择Wi-Fi</view>
            </view>
            <view class="row">
                <!-- <input class="row_input" name="password" type="{{eyes ? 'text' : 'password'}}" placeholder="请输入密码" /> -->
                <input bindinput="formInputChange" bind:focus="inputfocus" bind:blur="inputBlur" data-field="password" class="row_input {{focus}}" type="{{eyes ? 'text' : 'password'}}" value="{{wifiData[1].value}}" placeholder="请输入密码" />
                <view class="row_icon img_box" bind:tap="changeEyes">
                    <image mode="widthFix" lazy-load="true" src="{{eyes ? '/assets/images/xian/icon_eyes.png' : '/assets/images/xian/icon_close.png'}}" />
                </view>
            </view>
            <view class="row_tip">Wi-Fi密码输入错误是最常见的失败原因之一, 请仔细检查Wi-Fi密码。</view>
            <view class="row_btn">
                <button type="primary" class="submit-btn" bindtap="submitForm">下一步</button>
            </view>
        </mpform>
    </view>
</view>
<!-- <mphalfScreenDialog show="{{showwifiDialog}}" closabled="{{false}}" bindclose="onClosSelectWifi">
    <view slot="title">{{i18n.t('hsd_2')}}</view>
    <view slot="desc">{{i18n.t('hsd_3')}}</view>
    <button slot="footer" type="default" class="weui-btn">operation one</button>
    <button slot="footer" type="primary" class="weui-btn">operation two</button>
</mphalfScreenDialog> -->
<page-container show="{{showwifiDialog}}" duration="300" round="{{true}}" custom-style="border-radius: 16rpx 16rpx 0rpx 0rpx;" position="bottom">
    <view class="wifi_dialog">
        <view class="dialog_title" slot="title">选择Wi-Fi</view>
        <view class="dialog_text">可添加设备的<text>Wi-Fi(2.4G) </text></view>
        <view class="dialog_list">
            <view class="dialog_item" ty:for="{{wifiList}}" ty:key="index" bindtap="selectWifiItem" data-index="{{index}}">
                <view class="dialog_item_name">{{item.SSID}}</view>
                <view class="dialog_item_icon img_box {{item.selected ? 'selected' : ''}}">
                    <image mode="widthFix" lazy-load="true" src="/assets/images/xian/icon_wifi.png" />
                </view>
            </view>
        </view>
    </view>
</page-container>