<!-- 判断隐私是不是显示 -->
<privacy_pop id="privacy_pop" bind:agree_pri="agree_pri"></privacy_pop>
<!-- <import src="../../tabbar/tabbar.wxml" />
<template is="tabBar" data="{{tabBar}}" /> -->
<wxs src="filter.wxs" module="util"></wxs>
<com_top_nav title="会员中心"></com_top_nav>



<block wx:if="{{pshow}}">
  <!-- 显示自定义模板 -->
  <block wx:if="{{isTemplate}}">
    <block wx:for="{{template_arr}}" wx:key="{{index}}">
      <view>
        <!--广告组合-->
        <block wx:if="{{item.ename=='advertising'}}">
          <advertising object="{{item.content}}"></advertising>
        </block>
        <!--辅助空白-->
        <block wx:if="{{item.ename=='white'}}">
          <assist object="{{item.content}}"></assist>
        </block>
        <!-- 会员信息 -->
        <block wx:if="{{item.ename=='userinfo'}}">
          <diy_user_info object="{{item.content}}" byquan="{{byquan}}" yuer="{{yuer}}" udata="{{udata}}" qy_data="{{qy_data}}" pulscardname="{{pulscardname}}" rfmName="{{rfmName}}"></diy_user_info>
        </block>
        <!-- 我的订单 -->
        <block wx:if="{{item.ename=='order'}}">
          <diy_user_order object="{{item.content}}" toji="{{toji}}"></diy_user_order>
        </block>
        <!-- 我的权益 -->
        <block wx:if="{{item.ename=='my_rights'}}">
          <diy_user_my_rights object="{{item.content}}" qy_data="{{qy_data}}" b_gift="{{b_gift}}"></diy_user_my_rights>
        </block>
        <!-- 工具与服务 -->
        <block wx:if="{{item.ename=='tools_services'}}">
          <diy_user_tools_services object="{{item.content}}" is_dengji="{{is_dengji}}" qy_data="{{qy_data}}" enableMeiye="{{enableMeiye}}" f_user_tool="{{user_tool}}" c_list="{{c_list}}"></diy_user_tools_services>
        </block>

      </view>
    </block>

    <!-- 显示推荐 -->
    <view style='width:100%;height:73rpx;' wx:if="{{is_show_recommend}}">
      <view class="xc-recommend-goods flex-center">

        <view class="circle xc-small">
        </view>
        <view class="circle xc-zhong">
        </view>
        <view class="circle xc-big">
        </view>
        <view class="three-level-word xc-recommend">为你推荐</view>
        <view class="circle xc-big">
        </view>
        <view class="circle xc-zhong">
        </view>
        <view class="circle xc-small" style='margin-left:15rpx;'>
          <!-- </view> -->
        </view>
      </view>
    </view>
    <!-- 显示商品 -->
    <!-- 好物推荐 -->
    <block wx:if="{{is_show_recommend}}">
      <goods_recommend id="goods_recommend"></goods_recommend>
    </block>

    <!-- 技术支持 -->
    <view class="logo-container t-c">
      <view class="flex ai_c fs24 jc-center pdv30 white">
        <image src="{{iurl + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image>提供技术支持
      </view>
    </view>
  </block>

  <block wx:else>
    <view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}">
      <view class="xc-user">
        <view class="xc-head rel">
          <image class="xc-background" src="{{iurl}}{{ad_img?ad_img:'/miniapp/images/user_index_powder.jpg'}}">
            <view class="flex-space-between  abs xc-user-frame">
              <view class="xc-user-left  flex" wx:if="{{userInfo}}">
                <view style="position:relative;">
                  <image class="xc-user-img  circle" bindtap="go_info" src="{{userInfo.head_pic?userInfo.head_pic:defaultAvatar}}"></image>
                  <block wx:if="{{pulscardname && sys_switch.rank_switch > 0 }}">
                    <view data-url="/pages/user/plus/plus" catchtap="goto" class="flex-center plusMax">
                      <image class="fuls" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
                      <view>{{pulscardname}}</view>
                    </view>
                  </block>
                </view>

                <view class="xc-uesr-name">
                  <view class="flex ai-center">
                    <text class="ellipsis-1" style="max-width: 290rpx;display: inline-block">{{userInfo.nickname}}</text>
                    <view class="hvip" wx:if='{{GradeName && is_init}}'>
                      <image class="vip-mem" src="{{iurl}}/miniapp/images/vip_hg0.png"></image>{{GradeName}}
                    </view>
                  </view>




                  <view class="flex fs24 xc-grow-ups" style="margin-left:8rpx;margin-top:6rpx" wx:if="{{is_init && gradeId}}" bindtap='jump'>
                    <block wx:if="{{cz_val<full_cz_val}}">
                      {{" "}}
                      <text class="grow-up-val" style="background:{{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};">{{rfmName}}</text>
                      <view style='margin-left:5rpx; '>{{cz_val}} / {{need_money}}</view>
                    </block>
                    <block wx:else>
                      {{" "}}
                      <text class="grow-up-val" style="background:{{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};">{{rfmName}}</text> {{cz_val}}
                    </block>
                  </view>
                </view>

              </view>

              <view class="xc-user-left  flex" wx:else bindtap="gobindtel">
                <image class="xc-user-img  circle" src="{{userInfo.head_pic?userInfo.head_pic:defaultAvatar}}"></image>
                <view class="xc-uesr-name">请点击注册</view>
              </view>


            </view>
            <view wx:if="{{userInfo}}" class="xc-qrcode-frame abs ">
              <!-- {{iurl}}/miniapp -->
              <image bindtap='show_tc' class=" xc-qrcode " style="border: 5rpx solid {{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};background: {{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};" src="{{iurl}}/miniapp/images/qrcode1.png"></image>
              <view style="font-size:12px;color: #fff;">会员卡</view>
            </view>
            <view class="flex-vertical abs xc-grow-frame rel" style="display: none">
              <view class="xc-grow-up">{{rfmName}}</view>

              <view class="xc-line-not rel">
                <image class="xc-bj-img abs" src="{{iurl}}/miniapp/images/baijing.png"></image>
                <image class="xc-zs-img abs" src="{{iurl}}/miniapp/images/zhuangshi.png"></image>
                <view class="xc-line-Yes abs" style="width:{{length}}rpx;"></view>
              </view>

              <view class="xc-grow-val">0/0</view>
            </view>
            <view class="flex-equality  abs xc-assets">
              <view class="t-c typefont" bindtap='balance'>{{yuer?yuer:0}}
                <view class='numfont'>余额</view>
              </view>
              <!-- 是否关闭 -->
              <block wx:if="{{!is_close_chuzhi}}">
                <view class="t-c typefont" bindtap='deposit'>{{udata.Balance?udata.Balance:0}}
                  <view class='numfont'>储值款</view>
                </view>
              </block>

              <view class="t-c typefont" bindtap='integral'>{{udata.Integral?udata.Integral:0}}
                <view class='numfont'>积分</view>
              </view>

              <view class="t-c typefont" bindtap='coupon'>{{udata.CashCount+byquan?udata.CashCount+byquan:0}}
                <view class='numfont'>优惠券</view>
              </view>
            </view>
          </image>

        </view>
        <block wx:if="{{is_no_plus}}">
          <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2 && show_buy_plus }}">
            <view class="xc-add-member flex-center-around ">
              <view class="flex jc-center ai-center">
                <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
                <view class="member fs28 "> 加入plus会员预计可省3031元</view>
              </view>
              <view class="xc-opening-button t-c" data-url="/pages/user/plus/plus" bindtap="goto">
                <view class="xc-opening fs28">立即开通</view>
              </view>
            </view>
          </view>

          <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==3 && show_buy_plus}}">
            <view class="xc-add-member flex-center-around ">
              <view class="flex jc-center ai-center">
                <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
                <view class="member fs28 "> 加入plus会员预计可省3031元</view>
              </view>
              <view class="xc-opening-button t-c" data-url="/packageE/pages/user/cardinfo/cardinfo" bindtap="goto">
                <view class="xc-opening fs28">立即续费</view>
              </view>
            </view>
          </view>
        </block>

      </view>
      <view class="xc-after-sale rel">
        <!-- 顶上的一栏 -->
        <view class="xc-equity-title flex-level">
          <view class="xc-title-frame flex ai-center">
            <view class="flex-vertical xc-title-content" bindtap="go_order" data-url="/pages/user/order_list/order_list">
              <image class="xc-title-img" src="{{iurl}}/miniapp/images/hdindan.png" style="width: 50rpx; height: 55rpx;margin-right: 5rpx"></image>
              <view class="three-level-word">我的订单</view>
            </view>
            <!-- 物流信息提醒 -->
            <view class="fs26 c-5 pdl60" wx:if="{{countDadaOrder && countDadaOrder != 0}}" bindtap="go_order" data-url="/pages/user/order_list/order_list?index=1"><text class="iconfont icon-dingwei"></text>您有<text class="c-red">{{countDadaOrder}}</text>个同城配送订单</view>
          </view>
          <view class="three-level-word  xc-more-frame flex-vertical" bindtap="go_order" data-url="/pages/user/order_list/order_list">
            <view class="three-level-word xc-more">更多</view>
            <view class="bg_right xc-more-click bcolor"></view>
          </view>
        </view>
        <!-- 内容的一栏 -->
        <view class="xc-after-sale-left flex-center-around">
          <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=1">
            <image class="xc-no-money" src="{{iurl}}/miniapp/images/daifuk.png"></image>
            <view class=" xc-word-color four-level-word">待付款</view>
            <text class="order-num" hidden='{{toji.wait_pay>0?"":"true"}}'>{{toji.wait_pay}}</text>
          </view>

          <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=2">
            <image class="xc-send" src="{{iurl}}/miniapp/images/dfahuo.png?v=1"></image>
            <view class="xc-word-color four-level-word">待发货</view>
            <text class="order-num" hidden='{{toji.wait_send>0?"":"true"}}'>{{toji.wait_send}}</text>
          </view>

          <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=3">
            <image class="xc-await" src="{{iurl}}/miniapp/images/shouhuo1.png"></image>
            <view class="xc-word-color four-level-word">待收货</view>
            <text class="order-num" hidden='{{toji.wait_receive>0?"":"true"}}'>{{toji.wait_receive}}</text>
          </view>
          <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=4">
            <image class="xc-no-money" src="{{iurl}}/miniapp/images/dpr1.png"></image>
            <view class="xc-word-color four-level-word">待评论</view>
            <text class="order-num" hidden='{{toji.wait_pj>0?"":"true"}}'>{{toji.wait_pj}}</text>
          </view>
          <view class="t-c margin-auto rel" style='margin-left:30rpx;' bindtap="go_order" data-url="/packageF/pages/user/return_goods_list/return_goods_list">
            <image class="xc-no-money" src="{{iurl}}/miniapp/images/shouh1.png"></image>
            <view style='height:36rpx;'> </view>
            <view class="xc-word-color four-level-word abs">售后/退款</view>
            <!--<text class="order-num" hidden='{{toji.wait_return>0>0?"":"true"}}' style="right: -20rpx">{{toji.wait_return}}</text>-->
          </view>

        </view>
        <view style="clear: both"></view>

      </view>

      <!-- 我的权益 -->
      <view class="xc-my-equity-frame" wx:if="{{is_init }}">
        <view class="xc-equity-title flex-level" bindtap="go_qy">
          <view class="xc-title-frame flex-space-between">
            <view class="flex-vertical xc-title-content">
              <image class="xc-title-img" src="{{iurl}}/miniapp/images/medal.png"></image>
              <view class="three-level-word">我的权益</view>
            </view>
          </view>
          <view wx:if="{{is_grad_get}}" class="three-level-word  xc-more-frame flex-vertical">
            <view class="three-level-word xc-more">更多</view>
            <view class="bg_right xc-more-click bcolor"></view>
          </view>
          <view wx:else class="three-level-word  xc-more-frame flex-vertical" style="justify-content: flex-end">
            <image style="width: 40rpx; height: 40rpx; margin-right: 20rpx" src="{{iurl}}/miniapp/images/loader.gif"></image>
          </view>
        </view>

        <block wx:if="{{is_grad_get}}">
          <block wx:if="{{qy_list && gradeId}}">
            <view class="xc-specific-more-frame flex-vertical" wx:if="{{qy_list}}">

              <view bindtap="click_pre">
                <view class="bg_left xc-left bcolor"></view>
              </view>

              <swiper current="{{sw_index}}" style='width:82.7%; height:108rpx' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}">

                <swiper-item wx:for="{{qy_list}}" wx:for-item="aitem" wx:for-index="pidx">
                  <view class="flex xc-middle">

                    <view class="xc-center-frame t-c" wx:for="{{aitem}}" data-img="{{item.PrivilegeImageUrl}}" data-no="{{item.PrivilegeType}}" data-ind="{{index}}" data-find="{{pidx}}" bindtap="go_qy_url">
                      <!-- <text>qy_list.privilegeICOUrl</text> -->
                      <image class="xc-center-img  {{item.ishas==1?'':'img_gray'}}" src="{{item.PrivilegeICOUrl}}"></image>
                      <view class="four-level-word">{{item.PrivilegeName}}</view>
                    </view>
                  </view>
                </swiper-item>

              </swiper>

              <view bindtap="click_next">
                <view class="bg_right xc-right bcolor mt"></view>
              </view>
            </view>
          </block>
          <view wx:else style="text-align: center">
            未找到数据
          </view>
        </block>




      </view>
      <!-- 生日营销 is_banner-->
      <block wx:if="{{is_banner}}">
        <view class="t-c banner-frame" bindtap="clike_banne">
          <image class="banner-img" src="{{actImg==''?iurl+'/miniapp/images/user/banner-img.jpg':iurl+actImg}}">
          </image>
        </view>
      </block>

      <!-- 工具与服务 -->
      <view class="xc-tool-service">
        <view class="xc-tool-service-title flex-vertical">
          <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image>
          <view class="three-level-word xc-tool-service-word">工具与服务</view>
        </view>
        <view class="xc-project-frame">
          <!-- 跳转页面 -->
          <view class="center_v" style="display: flex;flex-wrap: wrap;align-items: center;">
            <!-- 循环使用自定义菜单，显示和掩藏 -->
            <block wx:for="{{user_tool}}">
              <!-- 判断系统配置中有没有把菜单关闭 -->
              <block wx:if="{{!util.is_close(item.name,c_list,tool_map)}}">
                <!-- 有链接地址的时候 -->
                <block wx:if="{{item.new_weappurl}}">
                  <block wx:if="{{item.name=='PLUS会员'}}">
                    <view class="item t-c" data-url="{{item.new_weappurl}}" bindtap="goto" wx:if="{{is_dengji==1}}">
                      <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">PLUS会员</view>
                    </view>
                  </block>
                  <block wx:elif="{{item.name=='助力活动'}}">
                    <view class="item t-c" data-url="/pages/user/assistance/assistance" bindtap="goto_nav" wx:if="{{is_assistance==1}}">
                      <image class="xc-center-img" src="{{iurl}}/miniapp/images/friendhelp/icon-zl.png"></image>
                      <view class="four-level-word">助力活动</view>
                    </view>
                  </block>
                  <block wx:elif="{{item.name=='我的权益'}}">
                    <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}">
                      <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">我的权益</view>
                    </view>
                  </block>
                  <block wx:elif="{{item.name=='套盒商品'}}">
                    <view class="item t-c" data-url="{{item.new_weappurl}}" bindtap="goto" wx:if="{{enableMeiye}}">
                      <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">套盒商品</view>
                    </view>
                  </block>

                  <block wx:elif="{{item.name=='瘦身日记'}}">
                    <view wx:if="{{has_rj>0}}" class="item t-c" data-url="{{item.new_weappurl}}" bindtap="goto_nav">
                      <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">{{item.name}}</view>
                    </view>
                  </block>
                  <!-- 线增我的美顾的显示 -->
                  <block wx:elif="{{item.name=='我的美顾'}}">
                    <view wx:if="{{sh_meigu}}" class="item t-c" data-url="{{item.new_weappurl}}" bindtap="goto_nav">
                      <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">{{item.name}}</view>
                    </view>
                  </block>
                  <block wx:else>
                    <view class="item t-c" data-url="{{item.new_weappurl}}" bindtap="goto_nav">
                      <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">{{item.name}}</view>
                    </view>
                  </block>
                </block>
                <!-- 没有链接地址的时候 -->
                <block wx:else>
                  <block wx:if="{{item.name=='联系客服'}}">
                    <!-- <button class="item t-c" wx:if="{{sys_switch.weapp_customertype==1}}" bindtap="click_contact" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
                      <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">联系客服</view>
                    </button>

                    <view class="item t-c" bindtap="con_weixin" wx:elif="{{sys_switch.weapp_customertype==2}}">
                      <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">联系客服</view>
                    </view>

                    <view class="item t-c" bindtap="contactService" wx:else>
                      <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">联系客服</view>
                    </view> -->

                    <view class="item t-c" bindtap="openCS">
                      <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
                      <view class="fs26">联系客服</view>
                    </view>

                  </block>
                  <block wx:elif="{{item.name=='收入卡包'}}">
                    <view class="item t-c" bindtap="addcard" wx:if="{{add_card_data}}">
                      <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
                      <view class="four-level-word">收入卡包</view>
                    </view>
                  </block>
                </block>
              </block>
            </block>
          </view>

        </view>
      </view>

      <!-- 显示推荐 -->
      <view style='width:100%;height:73rpx;' wx:if="{{is_show_recommend}}">
        <view class="xc-recommend-goods flex-center">

          <view class="circle xc-small">
          </view>
          <view class="circle xc-zhong">
          </view>
          <view class="circle xc-big">
          </view>
          <view class="three-level-word xc-recommend">为你推荐</view>
          <view class="circle xc-big">
          </view>
          <view class="circle xc-zhong">
          </view>
          <view class="circle xc-small" style='margin-left:15rpx;'>
            <!-- </view> -->
          </view>
        </view>
      </view>
      <!-- 显示商品 -->
      <!-- 好物推荐 -->
      <block wx:if="{{is_show_recommend}}">
        <goods_recommend id="goods_recommend"></goods_recommend>
      </block>

      <!-- 技术支持 -->
      <view class="logo-container t-c">
        <view class="flex ai_c fs24 jc-center pdv30 white">
          <image src="{{iurl + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image>提供技术支持
        </view>
      </view>


    </view>

    <!--弹出层内容，其中的“我知道”中绑定让弹出层消失的函数：bindtap="hide"-->
    <view class="tc_view" hidden='{{tc_hide}}' bindtap='hide_tc'>
      <view class="modal-box" hidden="{{flag}}" bindtap="hide" catchtouchmove="true"></view>
      <view class="modal-body {{show_erm_u?'':'low'}}  " catchtouchmove="true">
        <view class="modal-content">
          <view class="flex">
            <image src="{{userInfo.head_pic}}" class="hd_img"></image>
            <view class="ctent_txt">
              <view class='txt1'>{{userInfo.nickname}}
                <image wx:if="{{userInfo.sex==2}}" class="arrow-right" style="width: 35rpx; height:35rpx; top: 5rpx" src="{{iurl}}/miniapp/images/user/wum.png"></image>
                <image wx:else class="arrow-right fu" style="width: 35rpx; height:35rpx;top:5rpx" src="{{iurl}}/miniapp/images/user/man.png"></image>
              </view>
              <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view>
            </view>
          </view>


          <block wx:if="{{show_erm_u}}">
            <view class="canvas_box">
              <!--<image class='g_img' src='https://mshop.yolipai.net//index.php?m=Home&c=Index&a=qr_code&data={{userInfo.mobile}}'></image>-->
              <canvas class="g_img" canvas-id="qrcode" />
            </view>
          </block>

          <view style=" position: relative;top: -25rpx;">
            <view wx:if="{{show_erm_u}}" catchtap="hide_u_ewm" class="fs24 flex ai-center jc-center" style="width: 100%;color: #898989;line-height: normal; ">
              点击隐藏<text class="icon_yan icon-yanjing_yincang_o fs36"></text>
            </view>
            <view wx:else catchtap="show_u_ewm" class="fs24 flex ai-center jc-center" style="width: 100%;color: #898989; line-height: normal; ">
              点击显示<text class="icon_yan icon-yanjing_xianshi_o fs36"></text>
            </view>
          </view>

          <view style="width: 100%;display: flex;justify-content: center; margin-top: 8rpx;" >
            <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>

    <pop_txt id="pop_txt"></pop_txt>
    <include src="../../../components/com_servicer/com_servicer.wxml" />

  </block>

</block>