<wxs src="../../utils/tools.wxs" module="tools" />
<view class="card" style="background: {{type==0?'#f9f9f9':'#fff'}};">
  <view id="saveArea">
    <view class="card-box">
      <view class="top">
        <view class="nameAndScore">
          <view class="name">{{info.businessCard.name}}</view>
          <view class="score"><text>口碑指数</text>{{tools.toFix(info.totalAverage)}}</view>
        </view>
        <view class="positionAndTags">
          <view style="padding-top: 10rpx;">
            <view class="position" bindtap="handleDialogDetail" data-title="职位" data-info="{{info.businessCard.office}}">{{info.businessCard.office||'暂无职位信息'}}</view>
            <view class="company" bindtap="handleDialogDetail" data-title="公司名称" data-info="{{info.businessCard.companyName}}">{{info.businessCard.companyName||'暂无公司信息'}}</view>
          </view>

          <view class="tagsAndStar">
            <!-- <view class="tagItem" wx:for="{{labelOptions}}" wx:key="index" data-item="{{item}}" wx:if="{{index<2}}">
              {{item.content}}
              <view class="numTag">x{{item.contentCount}}</view>
            </view> -->
            <star score="{{info.totalAverage}}" starType="cStars_half" size="34rpx" />
            <view class="tags">
              <view class="tagItem" wx:if="{{labelOptions}}">
                {{labelOptions[0].content}}
                <view class="numTag">x{{labelOptions[0].contentCount}}</view>
              </view>
              <view class="moreTag" bindtap="handleSearch">...</view>
            </view>
          </view>
        </view>
      </view>
      <view class="bottom">
        <image class="icon_phone" src="/assets/images/card/icon_phone.png"></image><text bindtap="phoneCall">{{phone}}</text>
        <image class="icon_email" src="/assets/images/card/icon_email.png"></image>
        <text>{{info.businessCard.email||'暂未添加邮箱'}}</text>
        <text class="btn_copy" bindtap="handleCopy" data-email="{{info.businessCard.email}}">复制</text>
        <view class="introduce">
          {{info.businessCard.introduction||'暂未添加自我介绍'}}
        </view>
      </view>

    </view>
    <view class="card-info-box" wx:if="{{type==0}}">
      <view class="title">名片信息<view class="btn_edit" bindtap="handleEdit" wx:if="{{!isEdit}}">
          <image class="icon_edit" src="/assets/images/card/icon_edit.png" />编辑
        </view>
      </view>
      <view class="item"><text>公司：</text><input disabled="{{!isEdit}}" model:value="{{companyName}}" placeholder="您所在的公司" /></view>
      <view class="item"><text>职位：</text><input disabled="{{!isEdit}}" model:value="{{office}}" placeholder="您的职位信息" /></view>
      <view class="item"><text>邮箱：</text><input disabled="{{!isEdit}}" model:value="{{email}}" placeholder="您的邮箱" /></view>
      <view class="item"><text>自我介绍：</text><input disabled="{{!isEdit}}" model:value="{{introduction}}" maxlength="20" placeholder="20字以内" /></view>
      <view class="item btnItem" wx:if="{{isEdit}}">
        <btn plain width="150rpx" height="60rpx" bindtap="handleCancelEdit">退出编辑</btn>
        <btn width="150rpx" height="60rpx" style="margin-left: 28rpx;" bindtap="handleSave">保存</btn>
      </view>
    </view>
  </view>


  <view class="otherLayout" wx:if="{{type!=0}}">
    <!-- <view class="welcome">
      <image class="icon_quote" src="/assets/images/card/icon_quote.png"></image>
      <image class="icon_quote quote_end" src="/assets/images/card/icon_quote.png"></image>
      HI，很高兴认识你，这是我的与评口碑名片，想了解更多信息就点击下方按钮进入查看吧~
    </view> -->
    <btn type="primary" plain width="572rpx" height="90rpx" fontSize="32rpx" bindtap="handleSaveContract" style="margin-top:20rpx;margin-bottom: 20rpx;">保存至通讯录</btn>
    <btn type="primary" width="572rpx" height="90rpx" fontSize="32rpx" bindtap="handleDetail">查看更多口碑评价</btn>
    <image class="icon_logo" src="/assets/images/card/icon_logo.png"></image>
    <image class="icon_slogan" src="/assets/images/card/icon_slogan.png"></image>

    <view class="description">与评™是<text bindtap="showExplain">全国人力资源信息数据验证平台 </text>
      <image class="icon_q" src="/assets/images/card/icon_q.png"></image> 授权并监管的一款个人综合社交评价工具，根据国家《中华人民共和国网络安全法》《互联网信息服务管理办法》等条例规定，所有基础数据存储、隐私安全保障、用户行为数据溯源均由全国人力资源信息数据验证平台提供相应接口及支撑，国家监管确保与评不向第三方提供原始数据信息。
    </view>
  </view>
  <!-- <canvas class='canvas card' width="253px" height="253px" canvas-id='cardQr'></canvas> -->
  <!-- <painter class="painter-cmp" palette="{{cardPainter}}" bind:imgOK="onImgOK" /> -->
  <view class="btns" wx:if="{{type==0}}">
    <!-- <btn type="primary" plain width="211rpx" height="88rpx" fontSize="30rpx" bindtap="handleEdit">{{isEdit?'保存':'编辑'}}</btn> -->
    <button class="shareBtn" open-type="share">
      分享我的名片
    </button>
  </view>

  <view class="explain-box" wx:if="{{dialogExplain}}">
    <view class="explain">
      <view class="title">全国人力资源信息数据验证平台</view>
      <view class="content">
        全国人力资源信息数据验证平台”是由中国防伪行业协会“全国产品防伪溯源验证公共平台”建立的国家数据平台。中国防伪行业协会的业务指导部门为国家市场监督管理总局，党建工作机构为中央和国家机关工作委员会。
      </view>
      <btn width="505rpx" height="80rpx" fontSize="28rpx" bindtap="closeExplain">我已了解</btn>
    </view>
  </view>

  <view class="explain-box" wx:if="{{dialogDetail}}">
    <view class="explain" style="width: 100%;">
      <view class="title">{{detailTitle}}</view>
      <view class="content">
        {{detailInfo}}
      </view>
      <btn fontSize="28rpx" bindtap="closeDetail">关闭</btn>
    </view>
  </view>
</view>