<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
<view class="container">

  <!-- 头像,昵称,多个卡 --> 
  <view class="head flex-space-between">
    <view class="flex-center">

      <view class="flex-center">
        <image class="Headportrait" src="{{user.head_pic}}"></image>
      </view>

      <view class="flex-center vipmax">
        <view>
          <view>
            <view class="ellipsis-2 Nickname" style="font-size: 31rpx">
              <view style="float:left;">{{user.nickname}}</view>
              <button bindtap="getUserProfile" style="margin-left:10rpx;float:left;width: 50rpx;height:50rpx;font-size:20rpx;background:rgba(217, 81, 99, 0.9);" class="flex-center fs30 confirmtext"><text class="iconfont icon-tongbu"></text></button>
            </view>
          </view>

          <view class="flex fs22 vip">
            <block wx:if="{{isBool && gradename}}">
              <navigator url="/packageG/pages/user/userqy/userqy">
                <view class="flex-center AncrownMax">
                  <image class="Ancrown" src="{{iurl}}/miniapp/images/userqy/user_userqy_huang.png"></image>
                  <view>{{gradename}}</view>
                </view>
              </navigator>
            </block>
            <block wx:if="{{pulscardname && rank_switch > 0 }}">
              <navigator url="/pages/user/plus/plus">
                <view class="flex-center plusMax">
                  <image class="fuls" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
                  <view>{{pulscardname}}</view>
                </view>
              </navigator>
            </block>
          </view>

          
        </view>
      </view>
    </view>
    <view class="flex ai_and">
      <view class="flex-level ai_and" style="background-image:url({{iurl}}/miniapp/images/userinfo/userinfo/code.png);width:170rpx;height:140rpx;margin-top: 80rpx;background-size:100%;" bindtap="show_tc">
        <view class="fs26 code" style="color:rgb(255,255,255);margin-left:9rpx;margin-top: 100rpx;">我的二维码</view>
      </view>
    </view>
  </view>

  <view class="user-container">
    <view class="Bbottom">
      <view bindtap="changeAvatar" class="user-head flex-vertical-between">
        <view class="user-txt">卡号</view>
        <view class="user-txt-right">{{user.erpvipno}}
        </view>
      </view>
      <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="nickname">
        <view>是否启用消费密码</view>
        <view class="flex-center" bindtap="isstcsp">
          <view class="flex-center cmleft">
            <block wx:if="{{isstcsp}}">
              <icon size="20" type="success" color="rgb(212,2,31)"></icon>
            </block>
            <block wx:else>
              <icon size="20" type="success" color="rgb(0, 0, 0, 0.4)"></icon>
            </block>
            <view class="Mleft">启用密码消费</view>
          </view>
        </view>

      </view>
      <!-- 是否显示密码 -->
      <view class="flex-vertical-between user-name" wx:if="{{isstcsp==1}}">
        <view class="user-txt">消费密码</view>
        <view class="flex">
          <block wx:if="{{ispwhid}}">
            <input bindblur="lose_focus" class="fs28 hion user-txt-right" value="{{consumption}}" password="true" type="number"/>
          </block>
          <block wx:else>
            <input bindblur="lose_focus" focus="{{set_isstcsp?true:false}}"  class="fs28 hion user-txt-right" value="{{consumption}}"  type="number"/>
          </block>

          <block wx:if="{{ispwhid}}">
            <image class="eye" src="{{iurl}}/miniapp/images/userinfo/userinfo/Eye.png" bindtap="ispwhid"></image>
          </block>
          <block wx:else>
            <image class="eye" src="{{iurl}}/miniapp/images/userinfo/open_eye.png" bindtap="ispwhid"></image>
          </block>

        </view>
      </view>


      <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="sex">
        <view>性别</view>
        <view class="flex">
          <view class="flex-center {{isGender==1?'Gendercheck':'Gender'}}" data-sex="1" bindtap="isGender">
            <block wx:if="{{isGender==1}}">
              <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/malealready.png"></image>
            </block>
            <block wx:else>
              <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/malenot.png"></image>
            </block>
            <view class="fs24">男</view>
          </view>
          <view class="flex-center {{isGender==2?'Gendercheck':'Gender'}}" data-sex="2" bindtap="isGender">
            <block wx:if="{{isGender==2}}">
              <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/femalealready.png"></image>
            </block>
            <block wx:else>
              <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/femalenot.png"></image>
            </block>
            <view class="fs26">女</view>
          </view>

          <block wx:if="{{!user.sex}}">
            <text class="lb_txt"  wx:if="{{reg_info.sex && reg_info.sex_state && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</text>
            <text class="lb_txt"  wx:if="{{reg_info.sex && reg_info.sex_state && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</text>
          </block>

        </view>

      </view>

      <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="sex">
        <view>出生日期</view>
        <view class="flex flex-vertical-between fs28 Birth">
          <view class="flex" bindtap="iscalendar">
			  
			  <!-- <block wx:if="user.birthday==null&&user.birthday==''"> -->
			  
            <block wx:if="{{iscalendar}}">
              <view class="flex-center">
                <icon size="20" type="success" color="rgb(212,2,31)"></icon>
              </view>
            </block>
            <block wx:else>
              <icon size="20" type="success" color="rgb(0, 0, 0, 0.4)"></icon>
            </block>
			
			<!-- </block> -->
			
			
            <view class="flex-center">
              <view class="Mleft">农历</view>
            </view>
          </view>
          <view class="user-txt-right flex ai_c">
            <!-- 填充数据的时候要判断是否已经有出生日期，有值的话就不可修改 -->
            <block wx:if="{{user.birthday==''||user.birthday==null}}">				
              <picker bindchange='bindChange' value="{{datet}}" mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
				  {{datet?datet:"请选择时间"}}
              </picker>
            </block>
            <block wx:else>
              <view>{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}</view>
            </block>

            <block wx:if="{{!user.birthday}}">
              <text class="lb_txt"  wx:if="{{reg_info.birthday && reg_info.birthday_state && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</text>
              <text class="lb_txt"  wx:if="{{reg_info.birthday && reg_info.birthday_state && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</text>
            </block>

          </view>
        </view>
      </view>
    </view>
    <view class="Bbottom">
      <view bindtap="editUserInfo1" class="user-name mt flex-vertical-between" data-type="nickname">
        <view class="user-name-txt">姓名</view>
        <view class="flex ai_c">
            <input maxlength="10" bindblur="user_name" class="user-txt-right t-r" placeholder="*姓名" value='{{user.vipname}}' />
            <block wx:if="{{!user.vipname}}">
            <text class="lb_txt"  wx:if="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</text>
            <text class="lb_txt"  wx:if="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</text>
          </block>
        </view>
      </view>

      <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="nickname">
        <view class="user-name-txt">身份证</view>
        <view class="flex ai_c">
          <input bindblur="identity_card" class="user-txt-right t-r" value="{{user.idcard}}" placeholder="*身份证" />
          <block wx:if="{{!user.idcard}}">
            <text class="lb_txt"  wx:if="{{reg_info.idcard && reg_info.idcard_state  && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</text>
            <text class="lb_txt"  wx:if="{{reg_info.idcard && reg_info.idcard_state  && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</text>
          </block>
        </view>

      </view>
      <view data-url="/packageB/pages/user/Change_phone/Change_phone" bindtap="go_phone" class="user-name flex-vertical-between" data-type="mobile">
        <view class="user-name-txt">更换手机</view>
        <view class="flex-center user-txt-right">
          <view class="flex">{{phone}}</view>
          <view class="angle">∟</view>
        </view>
      </view>

      <view class="user-name flex-vertical-between" data-type="mobile">
        <view class="user-name-txt">地址</view>
        <!-- <block wx:if="{{user.address.length>0}}">
          <view>{{user.address}}</view>
        </block>
        <block wx:else> -->
        <view class="flex ai_c">
            <input bindblur="address" maxlength="30" value="{{user.address}}" class="user-txt-right" placeholder="*地址" style="text-align:right" />
            <block wx:if="{{!user.address}}">
             <text class="lb_txt"  wx:if="{{reg_info.address && reg_info.address_state && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</text>
             <text class="lb_txt"  wx:if="{{reg_info.address && reg_info.address_state && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</text>
            </block>
        </view>

      </view>

      <!-- 选择门店 -->
      <view bindtap="onclickstore" class="user-name flex-vertical-between" data-type="email">
        <view class="user-name-txt">所属门店</view>
        <view class="flex-center user-txt-right">
          <view class="one-line">{{stoname}}</view>
          <view class="flex ai_c">
            <view class="angle">∟</view>
            <block wx:if="{{!user.pickup_id}}">
              <text class="lb_txt"  wx:if="{{reg_info.pick && reg_info.pick_state && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</text>
              <text class="lb_txt"  wx:if="{{reg_info.pick && reg_info.pick_state && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</text>
            </block>
          </view>

        </view>
      </view>

      <!-- 美容顾问 -->
      <view bindtap="go_get_guide" class="user-name flex-vertical-between" data-type="email">
        <view class="user-name-txt">{{guide_title}}</view>
        <view class="flex-center user-txt-right">
          <view class="one-line">{{user.staffName?user.staffName:"*选择顾问"}}</view>
          <view class="angle">∟</view>
        </view>
      </view>

      <view wx:if="{{user.staffTel}}" class="user-name flex-vertical-between">
        <view class="user-name-txt">{{guide_title}}电话</view>
        <view class="flex-center user-txt-right">
          <view class="one-line">{{user.staffTel}}</view>
        </view>

      </view>



    </view>
    <!-- 我的兴趣 -->
    <view wx:if="{{ isBool==1 && is_lable_set==1}}" class="padding Bbottom">
    <!-- 我的兴趣 -->
    <view wx:if="{{is_lable_set!=null && is_lable_set==1}}" class="Bbottom">
      <view class="interest fs28">
        <view class="flex-vertical-between" bindtap="goto" data-url="/packageE/pages/user/labels/labels">
          <view class="fs30">我的兴趣</view>
          <view class="angle">∟</view>
        </view>
        <!-- 选中的标签 -->
        <view class="lables">
          <block wx:if="{{check_label.length>0}}">
            <view class="lable" wx:for="{{check_label}}" wx:for-item="label">
              <view class="ellipsis-1">{{label}}</view>
            </view>
          </block>
          <!-- 添加标签按钮 -->
          <view class="add_lable ib ellipsis-1" bindtap="goto" data-url="/packageE/pages/user/labels/labels">
            <text class="plus">+</text>
            <text>标签</text>
          </view>
        </view>
      </view>
    </view>
    </view>

    <navigator bindtap="goto" class="user-name mt flex-vertical-between" data-url="/packageF/pages/user/address_list/address_list">
      <view class="user-name-txt">收货地址</view>
      <view class="flex-center user-txt-right">
        <view class="angle">∟</view>
      </view>
    </navigator>

    <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="email">
      <view class="user-name-txt">绑定时间</view>
      <view class="user-txt-right one-line">{{user.reg_time?filters.replace_time2(user.reg_time):""}}</view>
    </view>

</view>
<!-- 确认修改按钮 -->
<view class="flex-center confirm">
  <view class="flex-center fs30 confirmtext" bindtap="confirm_revision">
    <view>确认修改</view>
  </view>
</view>

<!--弹出层内容，其中的“我知道”中绑定让弹出层消失的函数：bindtap="hide"-->
<view class="tc_view" hidden='{{tc_hide}}' bindtap='hide_tc'>
  <view catchtouchmove="true" class="modal-box" hidden="{{flag}}" bindtap="hide"></view>
  <view class="modal-body" catchtouchmove="true">
    <view class="modal-content">
      <view class="flex">
        <image src="{{user.head_pic}}" class="hd_img"></image>
        <view class="ctent_txt">
          <view class='txt1'>{{user.nickname}}
            <image wx:if="{{user.sex==2}}" class="arrow-right" src="{{iurl}}/miniapp/images/user/wum.png"></image>
            <image wx:else class="arrow-right" src="{{iurl}}/miniapp/images/user/man.png"></image>
          </view>
          <view class='txt2' wx:if="{{user.address}}">{{user.address}}</view>
        </view>
      </view> 
      <view class="canvas_box">
        <canvas class="g_img" canvas-id="qrcode" />
      </view>
      <view style="width: 100%;display: flex;justify-content: center;">
      <canvas class="barcode" style="width: 100%;height: 140rpx;" canvas-id="barcode" />
    </view>
    <view wx:if="{{showvipcode}}"  class="fs24" style="width: 100%;color: #898989;display: flex;text-align: center;align-content: center;justify-content: center;">
            {{brcode}}
      </view>
      <view wx:else catchtap="showtext" class="fs24" style="width: 100%;color: #898989;display: flex;text-align: center;align-content: center;justify-content: center;">
        点击可查看条形数据
      </view>
    </view>
  </view>
</view>

<!-- 选择门店的弹框，1.1版最新的 -->
<block wx:if="{{store==1}}">
  <view class="mongolia-layer" bindtap="onclickstore"></view>
  <view class="popup-frame">
    <block wx:if="{{sort_store==0}}">
      <!-- 头部 标题 -->
      <view class="popup-top flex-space-between">
        <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text>
        <view>
          <view>
            <icon bindtap="onclickstore" class="modal-closes" color="black" size="22" type="cancel"></icon>
          </view>
          <view class="felx choose_more" bindtap="more_store"  wx:if="{{is_show_sto_cat>0}}">
            <text class="fs26 red-co">{{choice_sort_store==0?'更多门店':'返回'}}</text>
            <view class="bg_rights"></view>
          </view>
        </view>
      </view>

      <view class="searchbar flex-vertical-between storeListpadd">
        <input class="inputstore fs28" placeholder="输入要搜索的门店" value="{{keyword}}" placeholder-class="fs28" maxlength="16" bindinput="input_store" bindconfirm="searchfn" />
        <view class="search flex-center" bindtap="searchfn">
          <view class="fs28">搜索</view>
        </view>
      </view>

      <!-- 门店列表，最外层的门店列表，一开始 -->
      <view class="store-list">
        <!--如果还没有点击更多门店的时候  -->
        <block wx:if="{{choice_sort_store==0}}">			
          <!-- 需要for循环 -->
          <block wx:if="{{is_show_sto_cat==1}}">
            <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
              <view class="store flex-vertical">
                <!-- 需要点击事件 -->
                <block wx:if="{{index==fir_pick_index}}">
                  <view class="circle white xc-hook fs20 red-b">Г</view>
                </block>
                <block wx:else>
                  <view class="circle  xc-hooks"></view>
                </block>
                <view class="address-frame xc-ash">
                  <view class="flex-vertical-between butttem5">
                    <view class="flex xc-ash">
                      <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
                    </view>
                    <view>
                      <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
                        距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view>
                    </view>
                  </view>
                  <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
                </view>
              </view>
            </view>
          </block>
          <block wx:else>
            <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
              <view class="store flex-vertical">
                <!-- 需要点击事件 -->
                <block wx:if="{{index==fir_pick_index}}">
                  <view class="circle white xc-hook fs20 red-b">Г</view>
                </block>
                <block wx:else>
                  <view class="circle  xc-hooks"></view>
                </block>

                <view class="address-frame xc-ash">
                  <view class="flex-vertical-between ">
                    <view class="flex xc-ash">
                      <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
                    </view>
                    <view>
                      <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
                      </view>
                    </view>
                  </view>
                  <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
                </view>
              </view>
            </view>
          </block>
        </block>
        <block wx:else>
          <!-- 如果是点击选择门店分类后显示分类下的门店  -->
          <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store">
            <view class="store flex-vertical">
              <!-- 需要点击事件 -->
              <block wx:if="{{index==sec_pick_index}}">
                <view class="circle white xc-hook fs20 red-b">Г</view>
              </block>
              <block wx:else>
                <view class="circle  xc-hooks"></view>
              </block>

              <view class="address-frame xc-ash">
                <view class="flex-vertical-between ">
                  <view class="flex xc-ash">
                    <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>
                  </view>
                  <view>
                    <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> 距离：{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view>
                  </view>
                </view>
                <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
              </view>
            </view>
          </view>
        </block>

      </view>

      <!-- 门店列表底部 -->
      <view class="store-bottom-frame">
        <view class="store-bottom flex-center">
          <view class="determine red-b fs30 white t-c" bindtap="sure_pick" data-openindstore="{{open_ind_store}}">确定</view>
          <!-- <view class="default  t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}">设为默认</view> -->
        </view>
      </view>

    </block>


    <block wx:else>
      <view class="popup-top flex-space-between">
        <text class="fs32 nearby_store">门店分类选择</text>
        <view>
          <view>
            <icon bindtap="onclickstore" class="modal-closes" color="black" size="22" type="cancel"></icon>
          </view>
        </view>
      </view>
      <view class="sort_store_list">

        <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">
          <view class="sort-store flex-vertical-between">
            <view class="fs30" di>{{item.name}}</view>
            <view class="black_rights-frame">
              <view class="black_rights"></view>
            </view>
          </view>
        </view>

      </view>
    </block>
  </view>
</block>
</view>
<warn id="warn"></warn>