<!--pages/my/index.wxml-->

<navigator title="我的" />

<view class="pageWrapper">
  <view class="userInfo">
    <avatar text="{{ user.nickName }}" />
    <view class="info">
      <view class="nickName"> {{ user.nickName }} </view>
      <view class="tenement"> {{ tenement.name }} </view>
      <view class="integration"> 积分： {{ integral }} </view>
    </view>
  </view>
  <view style="margin-bottom: 20rpx;border-radius: 16rpx; overflow: hidden;">
    <van-grid column-num="3"   >
      
      <van-grid-item 
        bind:click="jumpToLaw" 
        use-slot
      >
        <van-image 
          width="140rpx" 
          height="140rpx" 
          style="margin-top: 20rpx;"
          src="/assets/images/law.png" 
        />
        <view style="margin-top: 20rpx;font-size: 34rpx;"> 法律援助 </view>
      </van-grid-item>
      <van-grid-item 
        bind:click="jumpToFinance" 
        use-slot
      >
      <van-image 
      style="margin-top: 20rpx;"
        width="140rpx" 
        height="140rpx" 
        src="/assets/images/finance.png" 
      />
      <view  style="margin-top: 20rpx;font-size: 34rpx;"> 财税援助 </view>
      </van-grid-item>
      <van-grid-item 
        bind:click="jumpToEncyclopedia" 
        use-slot
      >
        <van-image 
          width="140rpx" 
          height="140rpx" 
          style="margin-top: 20rpx;"
          src="/assets/images/baike.png" 
        />
        <view style="margin-top: 20rpx;font-size: 34rpx;"> 电力百科 </view>
      </van-grid-item>
    </van-grid>
  </view>
  <view style="margin-bottom: 20rpx;border-radius: 16rpx; overflow: hidden;">
    <van-cell 
      title="积分兑换" 
      value="" 
      is-link 
      bind:tap="jumpToIntegral" 
      icon="diamond-o" 
    />
    <van-cell 
      title="我的优惠券" 
      value="" 
      is-link 
      bind:tap="jumpToDiscountCoupon" 
      icon="label-o" 
    />
  </view>
  <view style="border-radius: 16rpx; overflow: hidden;">
  <!-- <button open-type="contact" class="connect"> 联系客服 </button> -->
    <van-cell title="联系客服" value="" is-link bind:tap="connect" icon="service-o" />
    <van-cell icon="qr" wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
    <van-cell icon="friends-o" wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember">
      <view slot="title">
        <view  class="cellWrapper">        
          <view class="text"> 成员管理 </view>
          <dot wx:if="{{dot > 0}}" number="{{dot}}" />
        </view>
      </view>
    </van-cell>
    <van-cell title="发票抬头" icon="notes-o" value="" is-link bind:tap="jumpToUpdateInvoice">
    </van-cell>
    <van-cell title="绑定企业" icon="exchange" value="" is-link bind:tap="bindTenement" />
    <van-cell title="常见问题" icon="question-o" value="" is-link bind:tap="jumpToQuestions" />
    <van-cell title="工作台" icon="records-o" wx:if="{{user.workStatus}}" value="" is-link bind:tap="jumpToWorkBench" />
    <van-cell title="退出登录" icon="revoke" value="" is-link bind:tap="logout" />
  </view>

  <van-dialog id="van-dialog" />
</view>

<van-dialog
  title="提示"
  message="将进入咨询客服页面"
  show="{{ connectShow }}"
  custom-class="my-custom-class"
  show-cancel-button
  use-confirm-button-slot="{{true}}"
  use-cancel-button-slot="{{true}}"
>
  <button slot="cancel-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindCancelConnect"> 取消 </button>
  <button open-type="contact" slot="confirm-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindConnect"> 确认 </button>
</van-dialog>

