{yun:}include file="$wapstyle/member/header.htm"{/yun}
<div id="yunvue" class="none">
  <div class="ms_show"></div>
<div class="ms_showpd">
  <div class="popular_body ">
    <div class="popular_position">
        <div class="popular_position_top">
          <h3>{{show.jobname}}</h3>
          <p>{{show.salary}}</p>
          <span>{{show.comname}}</span>
        </div>
        <div class="popular_position_bottom">
          当前状态：
		<span v-if="show.is_browse==1 || show.is_browse==2">待接受</span>
		<span v-else-if="show.is_browse==3">
			<span v-if="show.over" style="color: #FF4200;">已结束</span>
			<span v-else>同意面试</span>
		</span>
		<span v-else-if="show.is_browse==4">拒绝面试</span>
		<span v-else style="color: #FF4200;">已面试</span>
        </div>
      </div>
    <div class="popular_body_card">
      
      <div class="popular_card_namebox" @click="pageTo(show.com_url)">
        <div class="popular_card_logo"> <img :src="show.com_logo_n" width="100%" height="100%"> </div>
        <div class="popular_card_name">{{show.fname}}
          <span>您好，您的初选已通过，诚挚的邀请您前来面试。</span>
        </div>
      </div>
      <div class="popular_card_line" style="margin-bottom: 0px;"></div>
      <div class="invitecont_list">
         
          <div class="invitecont_list_name">面试时间</div>
          <div class="popular_template_a">{{show.intertime}}</div> 
      </div>
     
      <div class="invitecont_list">
        <div class="invitecont_list_name">面试职位</div>
        <div class="popular_template_a">{{show.jobname}}</div>
      </div>
   
      <div class="invitecont_list">
        <div class="invitecont_list_name">联系人</div>
        <div class="popular_template_a">{{show.linkman}}</div>
      </div>
      <div class="invitecont_list">
        <div class="invitecont_list_name">联系电话</div>
        <div class="popular_template_a">{{show.linktel}}
			<a :href="'tel:'+show.linktel" :data-jobid="show.jobid" onclick="addtellog(this);" class="telicon"> 
            <img src="{yun:}$wap_style{/yun}/images/interview_ipone.png" alt="" width="100%" height="100%"> 
          </a>
		</div>
      </div>
      <div class="invitecont_list">
         
          <div class="invitecont_list_name">面试地址</div>
          <div class=" ">{{show.address}}</div> 

      </div>
      <div class="popular_card_map" v-if="show.staticimg">
        <img :src="show.staticimg" alt="" width="100%" height="100%">
      <input type="hidden" id="map_x" :value="show.x"/>
      <input type="hidden" id="map_y" :value="show.y"/>
      </div>
      <div class="invitecont_list" v-if="show.content">
        
          <div class="invitecont_list_name">备注信息</div>
          <div class=" ">{{show.content}}</div>
        </div> 
     </div>
  </div>
</div>
<div class="popular_tail" v-if="show.is_browse!=3 && show.is_browse!=4 && !show.over">

  <div @click="refuseSheet" class="popular_tail_refuse ">拒绝面试</div>
  <div @click="agree" class="popular_tail_accept" >接受面试</div>
</div>
<van-action-sheet v-model="moreShow" :actions="actionsList" description="请选择拒绝类型" @select="onSelect" cancel-text="取消" @cancel="onCancel"></van-action-sheet>

  <van-popup v-model="refuseShow" position="bottom" round closeable/>
    <div class="invite_no">
      <div class="invite_no_tit"> 拒绝理由</div>
      <div class="invite_no_textarea">
        <textarea class="  " id="remark" v-model="remark" name="remark" placeholder="请填写拒绝理由"></textarea>
      </div>
      <div class="invite_no_bth">
        <input class="" type="button" value="确认"  @click="inviteset(4)"/>
      </div>
    </div>
  </van-popup>

</div>
<script>
    var id = parseInt('{yun:}$smarty.get.id{/yun}');
      new Vue({
        el: '#yunvue',
        data: {
          show: {},
          id: id,
          islook: false,
          browse: 2,
          covers: [],
          moreShow:false,
          actionsList:[{name:'拒绝面试'},{name:'屏蔽企业', subname: '该企业将看不到你的简历'}],

          refuseShow:false,
          remark:''
        },
        computed: {
          count(){

          }
        },
        created() {
         this.inviteshow();
        },
        methods:{
          onCancel() {
            this.moreShow=false;
          },
          onSelect(item){
            if (item.name== '拒绝面试') {
              this.moreShow = false;
              this.refuseShow =  true;
            } else if (item.name == '屏蔽企业') {
              this.black()
            }
          },
          inviteshow:function(){
            showLoading();
            var that = this;
            var paramer = {};
                paramer['id'] = that.id;
            $.post('{yun:}url d=wxapp h=user m=job c=inviteshow{/yun}',paramer,function(data){
              hideLoading();

              that.show = data.data ? data.data : {};
              that.covers =  [{
                latitude: that.show.y,
                longitude: that.show.x,
                iconPath: '/static/image/member/mapdw.png',
                width: '60rpx',
                height: '60rpx',
                callout: {
                  content: that.show.address
                }
              }];
              that.browse = that.show.is_browse;
              $("#yunvue").removeClass('none');
            },'json');
          },
          refuseSheet: function() {
            this.moreShow = true;
          },

          agree: function() {
           showConfirm('面试前一天我们会通知您，祝您面试成功', () => {
              this.inviteset(3);
            })
          },
          inviteset:function(browse){
             let that = this;
              let param = {
                id: that.id,
                browse: browse
              };
              if(browse==4){
                param.remark = that.remark;
              }
              showLoading('处理中...');
              $.post('{yun:}url d=wxapp h=user m=job c=inviteset{/yun}',param,function(data){
                hideLoading();
              that.refuseShow = false;
              if (data.error == 1) {
                showToast('操作成功',2, function() {
                  that.browse = browse;
                  that.inviteshow();
                });
              } else {
                showToast('操作失败');
              }

            },'json');
          },
          black: function() {
            showConfirm('您确定要屏蔽该公司并删除该邀请？', () => {
              this.delfuc('black');
            })
          },
          delInvite:function(e){

             showConfirm('您确定要删除该邀请？', () => {
              this.delfuc('del');
            })

          },
          delfuc:function(type){
              let that = this
              let param = {
                id: that.id,
                type: type
              };
             showLoading('删除中...')

            $.post('{yun:}url d=wxapp h=user m=job c=invitedel{/yun}', param, function(data){
              hideLoading();
              if (data.error == 1) {
                that.browse = 5;
                showToast('删除成功',2, function() {
                  that.list.splice(index, 1);
                });return false;
              } else {
                showToast('删除失败');
              }
            });


          },
          pageTo:function(url){
              window.location.href = url;
          }
        }
      });
      function  addtellog(obj) {
          var jobid = $(obj).attr('data-jobid');
          $.post(wapurl + "?c=ajax&a=addJobTelLog", {
              jobid: jobid,
          }, function (data) {

          });
      }
</script>
</body>
</html>