<import src="../../../../utils/regions/regions.wxml"></import>


<view class="container">
<view class="topbcolor"></view>
    <form bindsubmit="submitAddress">
           
        <view class="item">
            <view class="item-name">收货人</view>
            <input maxlength="10" class="item-input" name="consignee" value="{{address.consignee}}" placeholder="请填写收货人姓名" placeholder-style="color: rgb(199, 199, 199)"></input>
        </view>
        <view class="item">
            <view class="item-name">手机号码</view>
            <input type="number" class="item-input" name="mobile" value="{{address.mobile}}"  placeholder="请填写收货人手机号" placeholder-style="color: rgb(199, 199, 199)"></input>
        </view>
        <view bindtap="openRegionsModal" class="item" data-id="0">
            <view class="item-name">所在地区</view>
            <view class="item-input{{address.more_address==null?'address':''}}">{{address.more_address==null?'省市区县，乡镇等':address.more_address}}</view>
            <view class="item-img">
                <image class="arrow" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>
            </view>
       </view>
        <view class="detailed">
            <view class="detailed_item-name">详细地址</view>
            <textarea  wx:if="{{!disabled}}" class="detailed_item-input" name="address" disabled="{{disabled}}" data-dis="{{disabled}}"
            value="{{address.address}}" placeholder="街道 楼牌号等" placeholder-style="color: rgb(199, 199, 199)"></textarea>
        </view>
        <view class="item item_default">
            <view class="item-name">设为默认地址</view>
            <switch checked="{{address.is_default==1?true:false}}" class="item-switch" 
            color="{{address.is_default==1?'rgb(239,22,51)':is_op_co==false?'white':'rgb(239,22,51)'}}" name="is_default" type="switch" bindchange="bind_is_op_co"/>
        </view>
        <view class="address-btns">
            <button bindtap="deleteAddress" wx:if="{{address.mobile!=null}}" class="delete-btn">删除地址</button>
            <button class="submit-btn" formType="submit">提交地址</button>
        </view>
    </form>
</view>

<template is="regions" data="{{regions:regions}}"></template>
<warn id="warn"></warn>
