<view class="fir_view">

  <!-- 登录图 -->
  <view>
    <view class="logins flex-center2 ali-c flex" style="padding-top: 120rpx;">
	  <image mode="widthFix"  bindtap="go_index" class="login_img_back" src="{{imghots}}/miniapp/images/loginbg.jpg"></image>
      <view class="middle_view">
         <image bindtap="go_index" class="login_img" src="{{store_logo}}" binderror="bind_bnerr" lazy-load="true" data-errorimg="store_logo"></image>
	        <view>{{store.store_name}}</view>
      </view>
    </view>
  </view>

  <!-- 登录按钮 -->
  <view>
    <view class="phones">

		<view bindtap="" class="user-name flex-vertical fs24 jc-center">
			<checkbox-group bindchange="isAgree">
				<checkbox value="true"/>
			</checkbox-group>
		  <view class="user-name-txt">我已阅读同意 <text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view>
		</view>

	 <!-- 授权获取基础信息 -->
	 <block wx:if="{{canIUseGetUserProfile}}">
	 		  <button hidden="{{user}}"  class="getPhoneNumber" bindtap="bindGetUserInfo">
	 			<view class="flex flex-center ali-c">
	 			  <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
	 			  <view>微信账号快捷登录</view>
	 			</view>
	 		  </button>
	 </block>

	 <block wx:else>
		  <!-- 授权获取基础信息 -->
		  <button hidden="{{user}}"  class="getPhoneNumber" open-type="getUserInfo" bindgetuserinfo="bindUserInfo">
		  		<view class="flex flex-center ali-c">
		  			   <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
		  			   <view>微信账号快捷登录</view>
		  		</view>
		  </button>
	  </block>

	  <!-- 点击显示绑定手机的对话框 -->
	  <button  hidden="{{!user}}" class="getPhoneNumber" bindtap="show_bind_mobile">
		  <view  class="flex flex-center2 ali-c" >
			<image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
			<view>微信账号快捷登录</view>
		  </view>
	  </button>
    </view>

    <view wx:if="{{show_no}}" class="userlongin flex-center2 flex fs30 jc_sb" style="margin: 0 130rpx; ">
      <view bindtap="cancle_bind">暂不登录</view>
    </view>

  </view>

</view>


<view wx:if="{{show_bind}}">
	<view class="cover-layer" bindtap="close_pop" style="z-index:2222"></view>
	<view class="p_content">
		<view class="p_title flex ali-c fs34">
			登录手机号，同步会员信息以及订单记录
		</view>
		<view class="flex btn_view">
			<view bindtap="close_pop_back" style="height: 100%; line-height:normal;" class="txt-center f2 flex ali-c flex-center2 fs36 b_right">暂不授权</view>
			<button  disabled="{{sub}}" style="height: 100%;" class="g_mobile f2 flex ali-c flex-center2 fs36 txt-red" open-type="getPhoneNumber" bindgetphonenumber="getphone">立即授权</button>
		 </view>
    </view>
</view>
<warn id="warn"></warn>



<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
<view class="container" wx:if="show_profile.js">

	<!-- 头像,昵称,多个卡 -->
	<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 class="fs32">
						<view class="ellipsis-1 Nickname">{{user.nickname}}
						</view>
					</view>
				</view>
			</view>

		</view>
	</view>

	<view class="user-container">
		<view class="Bbottom">

			<!-- 如果需要接骚人信息 -->
			<view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}">
				<view class="user-name-txt">推荐人:</view>
				<input bindinput="getReferee" bindblur="" value="{{user['fromuser_id']?user['fromuser_id']:''}}"  data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>

				<block wx:if="{{!user['fromuser_id']}}">
					<view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view>
					<view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view>
				</block>
			</view>

			<!-- 如果需要接姓名信息 -->
			<view  class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.name_state}}">
				<view class="user-name-txt">姓名:</view>
				<input bindinput="getName" bindblur=""  value="{{user['vipname']?user['vipname']:''}}"  data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>
				<block wx:if="{{!user['vipname']}}">
					<view class="c-red pdl20 fs24" wx:if="{{reg_info.name && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view>
					<view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view>
				</block>
			</view>

			<view class="user-name flex-vertical" data-type="sex" wx:if="{{reg_info.sex_state }}">
				<view>性别:</view>
				<view class="flex f1 pdl20 jc_fe">
					<view class="flex-center {{isGender==1?'Gendercheck':'Gender'}}" data-sex="1" bindtap="getGender">
						<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'}} mgl20" data-sex="2" bindtap="getGender">
						<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>
				</view>

				<block wx:if="{{!user['sex']}}">
					<view class="c-red pdl20 fs24" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</view>
					<view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view>
				</block>
			</view>

			<view class="user-name flex-vertical" data-type="birthday" wx:if="{{reg_info.birthday_state}}" style="justify-content: space-between;">
				<view class="shrink0">出生日期:</view>
				<view class="flex fs28 Birth pdl20 jc_fe">
					<view class="user-txt-right pdl20 flex ai-center">
						<checkbox-group bindchange="isLunar">
							<label class="flex ai-center">
								<checkbox value="{{isLunar}}" checked="{{isLunar}}"/>农历
							</label>
						</checkbox-group>
						<picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
							<view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view>
						</picker>


					</view>
				</view>

				<block wx:if="{{!user['birthday']}}">
					<view class="c-red pdl20 fs24 shrink0" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</view>
					<view class="c-red pdl20 fs24 shrink0" wx:elif="{{reg_info.birthday && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</view>
				</block>
			</view>


			<view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.idcard_state}}">
				<view class="user-name-txt shrink0">身份证:</view>
				<input bindinput="getId" bindblur="IdentityIDCard" value="{{user.idcard}}"  class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码"></input>
				<block wx:if="{{!user.idcard}}">
					<view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</view>
					<view class="c-red pdl20 fs24" wx:elif="{{reg_info.idcard && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</view>
				</block>
			</view>


			<view class="user-name flex-vertical" data-type="mobile" wx:if="{{reg_info.address_state}}">
				<view class="user-name-txt">地址:</view>
				<input bindinput="getAddress" bindblur="" value="{{user.address?user.address:''}}"  data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />
				<block wx:if="{{!user.address}}">
					<view class="c-red pdl20 fs24" wx:if="{{reg_info.address && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</view>
					<view class="c-red pdl20 fs24" wx:elif="{{reg_info.address && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</view>
				</block>
			</view>


			<!-- 选择门店 -->
			<view bindtap="onclickstore" class="user-name flex-vertical" data-type="email"  wx:if="{{reg_info.pick_state}}">
				<view class="user-name-txt">所属门店:</view>
				<view class="user-txt-right f1 flex ai_c jc_fe">
					<view class="one-line">{{stoname?stoname:'请选择门店'}}</view>
					<view class="angle">∟</view>
				</view>

				<block wx:if="{{!user.pickup_id}}">
					<view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view>
					<view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view>
				</block>
			</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>


			<view bindtap="" class="user-name flex-vertical fs24">
				<checkbox-group bindchange="isAgree">
					<checkbox value="true"/>
				</checkbox-group>
				<view class="user-name-txt">我已阅读同意 <text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view>
			</view>

		</view>
	</view>

	<!-- 保存按钮 -->
	<view class="confirm">
		<view class="fs30 confirmtext" bindtap="save">保存</view>
		<view class="star fs24 t-c pdt10 c9" wx:if="{{couponInfo}}">保存成功即可获得一张{{couponInfo}}</view>
	</view>

	<!--弹出层内容，其中的“我知道”中绑定让弹出层消失的函数：bindtap="hide"-->
	<view class="tc_view" hidden='{{tc_hide}}' bindtap='hide_tc'>
		<view class="modal-box" hidden="{{flag}}" bindtap="hide"></view>
		<view class="modal-body">
			<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="m_ta">
					<canvas class="g_img" canvas-id="qrcode" />
				</view>
				<view class="s_sao">扫一扫上面的二维码图案，即可消费</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="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>
