{yun:}include file="$wapstyle/member/header.htm"{/yun}
<div id="yunvue">
	<div class="mission_body">
        <div class="mission_body_card">
            <ul>
                <li>
                    <div class="task_subject_box">
                         <div class="task_subject_icon">
                             <img src="{yun:}$wap_style{/yun}/images/vip_sign_in.png" alt="" width="100%" height="100%">
                         </div>
                         <div class="task_subject_init">
                             <div class="subject_init_top">完成签到</div>
                             <div class="subject_init_bom">+{{integral_signin}}{{integral_pricename}}</div>
                         </div>
                    </div>
                    <div class="task_subject_box_btn_accomplish" v-if="tasklist.signin">已签到</div>
                    <div class="task_subject_box_btn" v-else @click="sign">立即签到</div>     
                </li>
                <li>
                    <div class="task_subject_box">
                         <div class="task_subject_icon">
                             <img src="{yun:}$wap_style{/yun}/images/vip_register.png" alt="" width="100%" height="100%">
                         </div>
                         <div class="task_subject_init">
                             <div class="subject_init_top">邀请好友注册</div>
                             <div class="subject_init_bom">+{{integral_invite_reg}}{{integral_pricename}}</div>
                         </div>
                    </div>
                    <div class="task_subject_box_btn" @click="getInviteRegHb()">立即邀请</div>
                </li>                
                <li>
                    <div class="task_subject_box">
                         <div class="task_subject_icon">
                             <img src="{yun:}$wap_style{/yun}/images/task_iphpne.png" alt="" width="100%" height="100%">
                         </div>
                         <div class="task_subject_init">
                             <div class="subject_init_top">认证手机号</div>
                             <div class="subject_init_bom">+{{integral_mobliecert}}{{integral_pricename}}</div>
                         </div>
                    </div>
                  	<div class="task_subject_box_btn_accomplish" v-if="tasklist.phoneChecked">已认证</div>
                    <div class="task_subject_box_btn" v-else onclick="navigateTo('index.php?c=bindingbox&type=moblie')">立即认证</div>     
                </li>                
                <li>
                    <div class="task_subject_box">
                         <div class="task_subject_icon">
                             <img src="{yun:}$wap_style{/yun}/images/task_authentication.png" alt="" width="100%" height="100%">
                         </div>
                         <div class="task_subject_init">
                             <div class="subject_init_top">上传身份验证</div>
                             <div class="subject_init_bom">+{{integral_identity}}{{integral_pricename}}</div>
                         </div>
                    </div>
                   <div class="task_subject_box_btn_accomplish" v-if="tasklist.identification">已认证</div>
                   <div class="task_subject_box_btn" v-else onclick="navigateTo('index.php?c=idcard')">立即认证</div>     
                </li>
                <li>
                <div class="task_subject_box">
                     <div class="task_subject_icon">
                         <img src="{yun:}$wap_style{/yun}/images/task_streamer.png" alt="" width="100%" height="100%">
                     </div>
                     <div class="task_subject_init">
                         <div class="subject_init_top">上传头像</div>
                         <div class="subject_init_bom">+{{integral_avatar}}{{integral_pricename}}</div>
                     </div>
                </div>
                <div class="task_subject_box_btn_accomplish" v-if="tasklist.photo">已上传</div>
                   <div class="task_subject_box_btn" v-else onclick="navigateTo('index.php?c=photo')">立即上传</div>  
              </li>
              <li>
                 <div class="task_subject_box">
                      <div class="task_subject_icon">
                          <img src="{yun:}$wap_style{/yun}/images/vip_datum.png" alt="" width="100%" height="100%">
                      </div>
                      <div class="task_subject_init">
                          <div class="subject_init_top">完善基本资料</div>
                          <div class="subject_init_bom">+{{integral_userinfo}}{{integral_pricename}}</div>
                      </div>
                 </div>
                 <div class="task_subject_box_btn_accomplish" v-if="tasklist.baseInfo">已完善</div>
                   <div class="task_subject_box_btn" v-else onclick="navigateTo('index.php?c=info')">立即完善</div>  
               </li>
               <li>
                    <div class="task_subject_box">
                         <div class="task_subject_icon">
                             <img src="{yun:}$wap_style{/yun}/images/task_issue .png" alt="" width="100%" height="100%">
                         </div>
                         <div class="task_subject_init">
                             <div class="subject_init_top">发布简历</div>
                             <div class="subject_init_bom">+{{integral_add_resume}}{{integral_pricename}}</div>
                         </div>
                    </div>
                     <div class="task_subject_box_btn_accomplish" v-if="tasklist.expectnum !=0">已发布</div>
                   <div class="task_subject_box_btn" v-else onclick="navigateTo('index.php?c=addresume')">发布简历</div>  
                </li>
                <li>
                <div class="task_subject_box">
                     <div class="task_subject_icon">
                         <img src="{yun:}$wap_style{/yun}/images/task_falst_logoin.png" alt="" width="100%" height="100%">
                     </div>
                     <div class="task_subject_init">
                         <div class="subject_init_top">每天首次登录</div>
                         <div class="subject_init_bom">+{{integral_login}}{{integral_pricename}}</div>
                     </div>
                </div>
                <div class="task_subject_box_btn_accomplish">已登录</div>
              </li>
              <li>
                <div class="task_subject_box">
                     <div class="task_subject_icon">
                         <img src="{yun:}$wap_style{/yun}/images/task_ mailbox .png" alt="" width="100%" height="100%">
                     </div>
                     <div class="task_subject_init">
                         <div class="subject_init_top">认证邮箱</div>
                         <div class="subject_init_bom">+{{integral_emailcert}}{{integral_pricename}}</div>
                     </div>
                </div>
               <div class="task_subject_box_btn_accomplish" v-if="tasklist.emailChecked">已认证</div>
                   <div class="task_subject_box_btn" v-else onclick="navigateTo('index.php?c=bindingbox&type=email')">立即认证</div>  
              </li>
            <li>
                <div class="task_subject_box">
                     <div class="task_subject_icon">
                         <img src="{yun:}$wap_style{/yun}/images/task_issue .png" alt="" width="100%" height="100%">
                     </div>
                     <div class="task_subject_init">
                         <div class="subject_init_top">发布问题</div>
                         <div class="subject_init_bom">+{{integral_question}}{{integral_pricename}}</div>
                     </div>
                </div>
               
                   <div class="task_subject_box_btn" v-if="tasklist.question" onclick="navigateTo('{yun:}url m=wap c=ask a=addquestion {/yun}')">发布问题</div>  
                   <div class="task_subject_box_btn_accomplish" v-else>今日已发布</div>
            </li>
    
              <li>
                <div class="task_subject_box">
                     <div class="task_subject_icon">
                         <img src="{yun:}$wap_style{/yun}/images/task_answer.png" alt="" width="100%" height="100%">
                     </div>
                     <div class="task_subject_init">
                         <div class="subject_init_top">回答问题</div>
                         <div class="subject_init_bom">+{{integral_answer}}{{integral_pricename}}</div>
                     </div>
                </div>
                <div class="task_subject_box_btn" v-if="tasklist.answer" onclick="navigateTo('{yun:}url m=ask{/yun}#last-question')">回答问题</div>  
                <div class="task_subject_box_btn_accomplish" v-else>今日已回答</div>
                   
              </li>
              <li>
                <div class="task_subject_box">
                     <div class="task_subject_icon">
                         <img src="{yun:}$wap_style{/yun}/images/task_reply.png" alt="" width="100%" height="100%">
                     </div>
                     <div class="task_subject_init">
                         <div class="subject_init_top">评论回复</div>
                         <div class="subject_init_bom">+{{integral_answerpl}}{{integral_pricename}}</div>
                     </div>
                </div>
                <div class="task_subject_box_btn" v-if="tasklist.answerpl" onclick="navigateTo('{yun:}url m=ask{/yun}#last-question')">评论回答</div>  
                <div class="task_subject_box_btn_accomplish" v-else>今日已评论</div>
                   
              </li>
            </ul>
        </div>
    </div>
	<!--  邀请注册海报  -->
    <van-popup v-model="inviteRegHbShow" round closeable :style="{height:'90%',width:'90%',background:'none'}">
        <div class="hb_tc">
            <img :src="inviteRegHb" style="max-width: 100%;">
            <div class="hb_tc_bth">
                <div @click="getInviteRegHb()" class="hb_tc_hyz">换一张</div>
                <div class="hb_tc_bchb"> <span class="hb_tc_bchb_c" @click="inviteRegHbTipShow=!inviteRegHbTipShow" v-if="inviteRegHbTipShow"> <i class="hb_tc_bchbicon"></i>长按图片保存 </span></div>
            </div>
        </div>
    </van-popup>
</div>
<script> 
	var wapurl = "{yun:}url m=wap{/yun}";
    var invite_reg_hbids = [];
	new Vue({
        el: '#yunvue',
        data: {
          integral_pricename: '',
            tasklist: [],

            integral_signin: 0,
            integral_invite_reg: 0,
            integral_avatar: 0,
            integral_mobliecert: 0,
            integral_identity: 0,
            integral_add_resume: 0,
            integral_userinfo: 0,
            integral_login: 0,
            integral_emailcert: 0,
            integral_question:0,
            integral_answer:0,
            integral_answerpl:0,
            expectnum:0,
			inviteRegHbTipShow: true,
			inviteRegHbShow: false,
			inviteRegHbNext: 0,
			inviteRegHb: '',
        },
        computed: {
          count(){
           
          }
        },
        created() {   
         this.getIntegralTask();
        },
        methods:{
          getIntegralTask:function(){
            showLoading();
            var that = this;
            $.post('{yun:}url d=wxapp h=user m=finance c=getIntegralTask{/yun}',{rand:Math.random()},function(data){
              	hideLoading();      
              	
	            if (data.error == 1) {
					var list = data.data;
					that.integral_pricename = list.integral_pricename;

					that.tasklist = list.task;
					that.integral_signin = list.integral_signin;
					that.integral_invite_reg = list.integral_invite_reg;
					that.integral_avatar = list.integral_avatar;
					that.integral_mobliecert = list.integral_mobliecert;						
					that.integral_userinfo = list.integral_userinfo;
					that.integral_login = list.integral_login;
					that.integral_emailcert = list.integral_emailcert;					
					that.integral_identity = list.integral_identity;
					that.integral_add_resume = list.integral_add_resume;
					that.integral_question = list.integral_question;
					that.integral_answer = list.integral_answer;
					that.integral_answerpl = list.integral_answerpl;
					that.expectnum = list.expectnum;
				}
               
            },'json');
          },     
          sign:function(){
          	showLoading('签到中...');
            var that = this;
            $.post('{yun:}url d=wxapp h=user m=index c=sign{/yun}',{rand:Math.random()},function(data){
              	hideLoading();      
              	if (data.error == 1) {
					window.localStorage.setItem("needRefresh", 1);
					showToast(data.msg,2, function() {
						that.getIntegralTask();
					});
				} else {
					showToast(data.msg);
				}
               
            },'json');
          },
		  getInviteRegHbList: function() {
                let lr = false;
                $.ajax({
                    type: 'post',
                    url: wapurl + '?c=ajax&a=getInviteRegHbList',
                    async: false,
                    dataType: 'json',
                    success: function(res){
                        if(res && res.list && res.list.length > 0){
                            res.list.forEach(item => {
                                invite_reg_hbids.push(item.id);
                            })

                            lr = true;
                        }
                    }
                })
                return lr;
            },
            getInviteRegHb: function() {
                let that = this;
                var hbNum = invite_reg_hbids.length;
                var hb = that.inviteRegHbNext;

                if(hbNum == 0){
                    var lr = that.getInviteRegHbList();
                    if(!lr){
                        showToast("功能无法使用，请联系网站客服", 2);
                        return false;
                    }
                    hbNum = invite_reg_hbids.length; // 重新分配海报数量
                }

                showLoading('生成中...');
                const src = wapurl + '?c=ajax&a=getInviteRegHb&hb=' + invite_reg_hbids[hb];
                if (hb < (parseInt(hbNum) - 1)) {
                    var next = hb + 1;
                } else {
                    var next = 0;
                }

                var hbImg = new Image();
                hbImg.src = src;

                hbImg.onload = function(){
                    hideLoading();
                    that.inviteRegHbNext = next;
                    that.inviteRegHb = hbImg.src;
                    that.inviteRegHbShow = true;
                }
            },
          pageTo:function(url){
			  window.localStorage.setItem("needRefresh", 1);
              window.location.href = url;
          }
        } 
      });
</script>
</body>
</html>