{yun:}include file="$wapstyle/member/cheader.htm"{/yun}
|
<div id="yunvue">
|
<div v-bind:class="{show: islook}" class="none">
|
<!-- 页面主体部分 -->
|
<div class="dredge_body">
|
<!-- 页面图片表头 -->
|
<div class="dredge_body_title" v-if="config.sy_help_open == 1">
|
<img onclick="navigateTo('index.php?c=friendhelp')" src="{yun:}$wap_style{/yun}/images/dredge_invite.png" alt="">
|
</div>
|
<!-- tab切换 -->
|
<div class="dredge_body_tab">
|
<div class="dredge_body_tab_tetle">
|
<ul>
|
<li @click="tab" data-tab="4" :class="rating==4 ? 'pitch_on' : ''" v-if="tab4">单份购买
|
</li>
|
<li @click="tab" data-tab="1" :class="rating==1 ? 'pitch_on' : ''" v-if="tab1">套餐会员
|
</li>
|
<li @click="tab" data-tab="2" :class="rating==2 ? 'pitch_on' : ''" v-if="tab2">时间会员
|
</li>
|
<li @click="tab" data-tab="3" :class="rating==3 ? 'pitch_on' : ''" v-if="tab3">增值包
|
</li>
|
</ul>
|
</div>
|
<div class="dredge_body_tab_body" v-show="rating == 1">
|
<ul>
|
<li v-for="(item,tkey) in rating_1" :key="tkey">
|
<div class="dredge_body_tab_body_box" :data-cid="item.id" data-server="vip" @click="chooseServer">
|
<div class="dredge_body_tab_body_left">
|
<div class="tab_body_left_number">
|
<div class="vip_box_left_money_price">
|
<i>¥</i>
|
<i class="tab_body_left_number_monye">{{item.yh_price ? item.yh_price :
|
item.service_price}}</i>
|
</div>
|
<div v-if="item.yh_price" class="vip_box_left_money_yj">原价:<i>{{item.service_price}}</i></div>
|
</div>
|
<div class="tab_body_left_text">
|
<div class="tab_body_left_text_top">
|
<div class="left_text_top_vip">{{item.name}}</div>
|
<div class="left_text_top_time">(有效期:{{item.service_time}})</div>
|
</div>
|
<div class="tab_body_left_text_bom" @click.stop="setMoreShow(item.id)">
|
<div class="left_text_bom_particular">详细信息</div>
|
<div class="left_text_bom_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_examine.png" alt="">
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="dredge_body_tab_body_right">
|
<img v-if="item.id!=cid" src="{yun:}$wap_style{/yun}/images/dredge_To_confirm.png" alt="">
|
<img v-if="item.id==cid" src="{yun:}$wap_style{/yun}/images/dredge_affirm.png" alt="">
|
</div>
|
</div>
|
<!-- 详细信息 -->
|
<div class="dredge_body_tab_body_close" v-show="showMore == item.id">
|
<div class="dredge_close_title">
|
<div class="dredge_close_line"></div>
|
<div class="dredge_close_titlename">简历资源</div>
|
</div>
|
<div class="dredge_close_body">
|
<ul>
|
<li>面试邀请<i class="dredge_close_body_number">{{item.interview}}</i>份</li>
|
<li>简历下载<i class="dredge_close_body_number">{{item.resume}}</i>份</li>
|
</ul>
|
</div>
|
<div class="dredge_close_title">
|
<div class="dredge_close_line"></div>
|
<div class="dredge_close_titlename">职位资源</div>
|
</div>
|
<div class="dredge_close_body">
|
<ul>
|
<li>职位发布<i class="dredge_close_body_number">{{item.job_num}}</i>份</li>
|
<li>职位推荐<i class="dredge_close_body_number">{{item.rec_num}}</i>天</li>
|
<li>职位刷新<i class="dredge_close_body_number">{{item.breakjob_num}}</i>次</li>
|
<li>职位置顶<i class="dredge_close_body_number">{{item.top_num}}</i>天</li>
|
<li>职位紧急<i class="dredge_close_body_number">{{item.urgent_num}}</i>天</li>
|
</ul>
|
</div>
|
<div class="dredge_close_title">
|
<div class="dredge_close_line"></div>
|
<div class="dredge_close_titlename">其他资源</div>
|
</div>
|
<div class="dredge_close_body">
|
<ul>
|
<li>招聘会预定<i class="dredge_close_body_number">{{item.zph_num}}</i>场</li>
|
<li v-if="item.sons_num">招聘子账户<i class="dredge_close_body_number">{{item.sons_num}}</i>个</li>
|
<li v-if="item.chat_num">{{config.sy_chat_name}}<i class="dredge_close_body_number">{{item.chat_num}}</i>个</li>
|
<li v-if="item.spview_num">视频面试<i class="dredge_close_body_number">{{item.spview_num}}</i>次</li>
|
</ul>
|
</div>
|
<div class="dredge_close_explain">
|
<i class="dredge_close_explain_title">套餐说明:</i>{{item.explains}}
|
</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
<div class="dredge_body_tab_body" v-show="rating == 2">
|
<ul>
|
<li v-for="(item,skey) in rating_2" :key="skey">
|
<div class="dredge_body_tab_body_box" :data-cid="item.id" data-server="vip" @click="chooseServer">
|
<div class="dredge_body_tab_body_left">
|
<div class="tab_body_left_number">
|
<div class="vip_box_left_money_price">
|
<i>¥</i>
|
<i class="tab_body_left_number_monye">{{item.yh_price ? item.yh_price : item.service_price}}</i>
|
</div>
|
<div v-if="item.yh_price" class="vip_box_left_money_yj">原价:<i>{{item.service_price}}</i></div>
|
</div>
|
<div class="tab_body_left_text">
|
<div class="tab_body_left_text_top">
|
<div class="left_text_top_vip">{{item.name}}</div>
|
<div class="left_text_top_time">(有效期:{{item.service_time}})</div>
|
</div>
|
<div class="tab_body_left_text_bom" @click.stop="setMoreShow(item.id)">
|
<div class="left_text_bom_particular">详细信息</div>
|
<div class="left_text_bom_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_examine.png" alt="">
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="dredge_body_tab_body_right">
|
<img v-if="item.id!=cid" src="{yun:}$wap_style{/yun}/images/dredge_To_confirm.png" alt="">
|
<img v-if="item.id==cid" src="{yun:}$wap_style{/yun}/images/dredge_affirm.png" alt="">
|
</div>
|
</div>
|
<!-- 详细信息 -->
|
<div class="dredge_body_tab_body_close" v-show="showMore == item.id">
|
<div class="dredge_close_title">
|
<div class="dredge_close_line"></div>
|
<div class="dredge_close_titlename">简历资源</div>
|
</div>
|
<div class="dredge_close_body">
|
<ul>
|
<li>有效期内面试邀请 + 简历下载不限次数</li>
|
<li v-if="item.interview_resume">单日限制<i class="dredge_close_body_number">{{item.interview_resume}}</i></li>
|
</ul>
|
</div>
|
<div class="dredge_close_title">
|
<div class="dredge_close_line"></div>
|
<div class="dredge_close_titlename">职位资源</div>
|
</div>
|
<div class="dredge_close_body">
|
<ul>
|
<li>有效期内职位发布 + 刷新职位不限次数</li>
|
<li v-if="item.job_breakjob">单日限制<i class="dredge_close_body_number">{{item.job_breakjob}}</i></li>
|
<li>职位推荐<i class="dredge_close_body_number">{{item.rec_num}}</i>天</li>
|
<li>职位置顶<i class="dredge_close_body_number">{{item.top_num}}</i>天</li>
|
<li>职位紧急<i class="dredge_close_body_number">{{item.urgent_num}}</i>天</li>
|
</ul>
|
</div>
|
<div class="dredge_close_title">
|
<div class="dredge_close_line"></div>
|
<div class="dredge_close_titlename">其他资源</div>
|
</div>
|
<div class="dredge_close_body">
|
<ul>
|
<li>有效期内招聘会报名预定不限次数</li>
|
<li v-if="item.zph_num > 0">单日限制<i class="dredge_close_body_number">{{item.zph_num}}</i>场</li>
|
<li>有效期内视频面试不限次数</li>
|
<li v-if="item.spview_num > 0">单日限制<i class="dredge_close_body_number">{{item.spview_num}}</i>次</li>
|
<li>有效期内{{config.sy_chat_name}}不限次数</li>
|
<li v-if="item.chat_num > 0">单日限制<i class="dredge_close_body_number">{{item.chat_num}}</i>个</li>
|
<li v-if="item.sons_num">招聘子账户<i class="dredge_close_body_number">{{item.sons_num}}</i>个</li>
|
</ul>
|
</div>
|
<div class="dredge_close_explain">
|
<i class="dredge_close_explain_title">套餐说明:</i>{{item.explains}}
|
</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
<div class="dredge_body_tab_body" v-show="rating == 3">
|
<ul>
|
<li v-for="(item,akey) in add" :key="akey">
|
<div class="zzb_tit" :data-sid="item.id" @click="chooseServer">
|
<span class="zzb_tit_name">{{item.name}}</span>
|
<span class="zzb_tit_zk" v-if="statis.zk">{{statis.zk_n}}折</span>
|
<span class="zzb_tit_zkxq">详细信息</span>
|
<span class="zzb_tit_zkicon"><img src="{yun:}$wap_style{/yun}/images/hylook.png" alt=""></span>
|
</div>
|
<!-- 详细信息 -->
|
<div class="dredge_body_tab_body_close" v-show="(sid > 0 && sid==item.id) || (sid == 0 && akey == 0)">
|
<div class="dredge_close_body">
|
<div v-for="(dv,dekey) in item.detail" :key="dekey">
|
<div :data-cid="dv.id" data-server="pack" @click.stop="chooseServer" class="zzb_xzbox">
|
<span class="zzb_xz">
|
<img v-if="dv.id==cid" src="{yun:}$wap_style{/yun}/images/dredge_affirm.png" alt="">
|
<img v-else src="{yun:}$wap_style{/yun}/images/hywxz.png" alt="">
|
</span>
|
<span v-if="dv.interview" class="zzb_name">
|
面试邀请<i class="zzb_n">{{dv.interview}}</i>份
|
</span>
|
<span v-if="dv.resume" class="zzb_name">
|
简历下载<i class="zzb_n">{{dv.resume}}</i>份
|
</span>
|
<span v-if="dv.job_num" class="zzb_name">
|
发布职位<i class="zzb_n">{{dv.job_num}}</i>份
|
</span>
|
<span v-if="dv.breakjob_num" class="zzb_name">
|
刷新职位<i class="zzb_n">{{dv.breakjob_num}}</i>次
|
</span>
|
<span v-if="dv.zph_num" class="zzb_name">
|
招聘会报名<i class="zzb_n">{{dv.zph_num}}</i>场
|
</span>
|
<span v-if="dv.top_num" class="zzb_name">
|
职位置顶<i class="zzb_n">{{dv.top_num}}</i>天
|
</span>
|
<span v-if="dv.urgent_num" class="zzb_name">
|
职位紧急<i class="zzb_n">{{dv.urgent_num}}</i>天
|
</span>
|
<span v-if="dv.rec_num" class="zzb_name">
|
职位推荐<i class="zzb_n">{{dv.rec_num}}</i>天
|
</span>
|
<span v-if="dv.chat_num" class="zzb_name">
|
{{config.sy_chat_name}}<i class="zzb_n">{{dv.chat_num}}</i>个
|
</span>
|
<div class="">
|
<span v-if="dv.spview_num" class="zzb_name">
|
视频面试<i class="zzb_n">{{dv.spview_num}}</i>次
|
</span>
|
<span v-if="dv.yh_price_n" class="zzb_zk">原价{{dv.service_price_n}}</span>
|
<span class="zzb_jg">{{dv.yh_price_n ? dv.yh_price_n : dv.service_price_n}}</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
<div class="dredge_body_tab_body" v-show="rating == 4">
|
<div v-if="isDay">
|
<div class="buy_texttime">服务时长</div>
|
<div class="wraprowlast">
|
<div id="1" @click="chooseDay" :class="cd == '1' ? 'buy_card': ''" class="buy_cardtwo">1天</div>
|
<div id="3" @click="chooseDay" :class="cd == '3' ? 'buy_card': ''" class="buy_cardtwo">3天</div>
|
<div id="7" @click="chooseDay" :class="cd == '7' ? 'buy_card': ''" class="buy_cardtwo">7天</div>
|
<div id="15" @click="chooseDay" :class="cd == '15' ? 'buy_card': ''" class="buy_cardtwo">15天</div>
|
<div :class="cd == '0' ? 'buy_card': ''" class="buy_cardtwo">
|
<input @focus="zdyDay" maxlength="3" v-model="zdyDays" type="number" value="" placeholder="自定义推广天数" class="zzb_cont_day_zdy" />
|
</div>
|
</div>
|
</div>
|
<div v-if="canUseIntegral">
|
<!--充足积分情况-->
|
<div class="zzb_cont_single" v-if="!jfmodel_fk">
|
<div class="zzb_cont_single_p">当前拥有
|
<span class="zzb_cont_single_p_n">{{statis.integral}}</span>
|
{{config.integral_pricename}},
|
购买此服务将扣除您
|
<span class="zzb_cont_single_p_n">{{order_integral}}</span>
|
{{config.integral_pricename}}
|
</div>
|
<div class="zzb_cont_single_tip">套餐购买更优惠,升级会员享受专属特权</div>
|
</div>
|
<!--不足积分情况-->
|
<div class="zzb_cont_single" v-else>
|
<div class="zzb_cont_single_p">当前拥有
|
<span class="zzb_cont_single_p_n">{{statis.integral}}</span>
|
{{config.integral_pricename}},
|
购买此服务将扣除您
|
<span class="zzb_cont_single_p_n">{{order_integral}}</span>
|
{{config.integral_pricename}}
|
</div>
|
<div class="deduction_text">
|
<text class="dksl">充值{{config.integral_pricename}}:</text>
|
<input maxlength="6" type="number" v-model="price_int" class="yun_purchase_text" />
|
</div>
|
</div>
|
</div>
|
<!--钱情况-->
|
<div v-else class="zzb_cont_single">
|
<div class="zzb_cont_single_p">{{single_msg}}需支付<span class="zzb_cont_single_p_n">{{order_price}}</span>元</div>
|
</div>
|
</div>
|
</div>
|
<!-- 会员专属权益 -->
|
<div class="dredge_body_equity" v-show="rating < 3">
|
<div class="dredge_body_equity_box">
|
<div class="dredge_body_equity_tetle">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_title.png" alt="" />
|
</div>
|
</div>
|
<div class="dredge_body_equity_boon">
|
<ul>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_service.png" alt="" />
|
</div>
|
<div class="equity_boon_name">专属客服</div>
|
</li>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_identifying.png" alt="" />
|
</div>
|
<div class="equity_boon_name">身份标识</div>
|
</li>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_refresh.png" alt="" />
|
</div>
|
<div class="equity_boon_name">职位刷新</div>
|
</li>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_top.png" alt="" />
|
</div>
|
<div class="equity_boon_name">置顶推广</div>
|
</li>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_video.png" alt="" />
|
</div>
|
<div class="equity_boon_name">视频面试</div>
|
</li>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_resume.png" alt="" />
|
</div>
|
<div class="equity_boon_name">优质简历</div>
|
</li>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_chat.png" alt="" />
|
</div>
|
<div class="equity_boon_name">在线直聊</div>
|
</li>
|
<li>
|
<div class="equity_boon_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_discount.png" alt="" />
|
</div>
|
<div class="equity_boon_name">专享折扣</div>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<!-- 优惠券 -->
|
<div class="dredge_body_discounts" v-if="config.com_integral_online!='3' && config.fktype && (config.fktype.fkwx || config.fktype.fkal)">
|
<div class="dredge_body_discounts_left">
|
<div class="discounts_left_icon">
|
<img src="{yun:}$wap_style{/yun}/images/icom_discount_coupon.png" alt="">
|
</div>
|
<div class="discounts_left_name">优惠券</div>
|
</div>
|
<div class="dredge_body_discounts_right" @click="couponShow">
|
<div class="discounts_right_name">{{coupon_name}}</div>
|
<div class="discounts_right_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_add.png" alt="">
|
</div>
|
</div>
|
</div>
|
<van-popup v-model="iscoupon" round position="bottom">
|
<div class="yhq_tckbox">
|
<div class="yhq_tckbox_tit"> 选择优惠券</div>
|
<div class="yhq_xz_list" v-show="yhqIsUse">
|
<div v-if="kycount" class="yhq_xz_listall">
|
<div v-for="(item,kykey) in kyyhq" :key="kykey">
|
<div @click="chooseCoupon" :data-id="item.id" class="yhq_xz_l" :class="couponid == item.id ? 'yhq_xz_l_cur' : ''">
|
{{item.coupon_name}}
|
<span v-if="item.coupon_scope > 0">.满{{item.coupon_scope}}元可用</span>
|
<div class="yhq_xz">
|
<!--<img src="/static/image/yun_wap_u_yz.png" class="app_gm_xz"/>-->
|
</div>
|
</div>
|
</div>
|
<div @click="chooseCoupon" :data-id="0" class="yhq_xz_l" :class="couponid == '0' ? 'yhq_xz_l_cur' : ''">不使用优惠券
|
<div class="yhq_xz"></div>
|
</div>
|
</div>
|
<div v-else class="yhq_noshow">
|
<div class="yhq_no">
|
<div class="yhq_no_p">很遗憾</div>
|
<div class="yhq_no_pp">暂无可使用的优惠券</div>
|
</div>
|
</div>
|
</div>
|
<div class="yhq_xz_bthbox">
|
<div class="yhq_xz_bthbox_c">
|
<button @click="couponOk" class="yhq_xz_bth">确定</button>
|
</div>
|
</div>
|
</div>
|
<div class="yhq_tckbox_bg"></div>
|
</van-popup>
|
<div class="bodyfavourable" v-show="!dkdivshow && config.fktype && (config.fktype.fkwx || config.fktype.fkal)">
|
<div class="cardfavourable">
|
<div class="yhj">{{config.integral_pricename}}抵扣</div>
|
<div class="rowlast">
|
<span class="jf">您当前有</span>
|
<span class="slground">{{statis.integral}}</span>
|
<span class="jf">{{config.integral_pricename}}(1元={{config.integral_proportion + config.integral_pricename}})</span>
|
</div>
|
<div class="slither" @click="candk">
|
<van-switch v-model="dkshow" active-color="#e4b46b" inactive-color="#dcdee0" :disabled="isdk" @change="dkChange" size="26" />
|
</div>
|
<div class="deduction_text" v-show="dkshow">
|
<span class="dksl">抵扣数量:</span>
|
<div class="deduction_textinput"> <input type="number" cursor-spacing="200px" v-model="integral_dk" placeholder="请输入抵扣数量"></div>
|
</div>
|
</div>
|
</div>
|
<!-- 支付方式 -->
|
<div class="dredge_body_pay" v-if="ptshow && gmtype=='price'">
|
<div v-if="config.fktype && (config.fktype.fkwx || config.fktype.fkal)">
|
<div class="dredge_body_wx" v-if="config.fktype && config.fktype.fkwx" @click="fkcheck" data-fktype="fkwx">
|
<div class="dredge_body_wx_box">
|
<div class="wx_box_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_wx.png" alt="">
|
</div>
|
<div class="wx_box_name">{{config.fktype.fkwx}}</div>
|
</div>
|
<div class="dredge_body_wx_icon">
|
<img v-if="fktype!='fkwx'" src="{yun:}$wap_style{/yun}/images/dredge_To_confirm.png" alt="">
|
<img v-if="fktype=='fkwx'" src="{yun:}$wap_style{/yun}/images/dredge_affirm.png" alt="">
|
</div>
|
</div>
|
<div class="dredge_body_zfb" v-if="config.fktype && config.fktype.fkal" @click="fkcheck" data-fktype="fkal">
|
<div class="dredge_body_wx_box">
|
<div class="wx_box_icon">
|
<img src="{yun:}$wap_style{/yun}/images/dredge_zfb.png" alt="">
|
</div>
|
<div class="wx_box_name">{{config.fktype.fkal}}</div>
|
</div>
|
<div class="dredge_body_wx_icon">
|
<img v-if="fktype!='fkal'" src="{yun:}$wap_style{/yun}/images/dredge_To_confirm.png" alt="">
|
<img v-if="fktype=='fkal'" src="{yun:}$wap_style{/yun}/images/dredge_affirm.png" alt="">
|
</div>
|
</div>
|
</div>
|
<div class="gb_tip" v-else>
|
网站已关闭支付接口,请联系管理员
|
</div>
|
</div>
|
<div style="height:50px;"></div>
|
<!-- 支付 -->
|
<div class="dredge_bod_buy" v-if="config.fktype && (config.fktype.fkal || config.fktype.fkwx)">
|
<div class="dredge_bod_buy_number" v-if="gmtype=='price'">
|
<div class="buy_number_left">应付金额:</div>
|
<div class="buy_number_center">¥</div>
|
<div class="buy_number_right">{{order_price}}</div>
|
</div>
|
<div class="dredge_bod_buy_text" v-if="gmtype=='price'" @click="getOrder">立即购买</div>
|
<div class="dredge_bod_buy_number" v-if="gmtype=='integral'">
|
<div class="buy_number_left">支付{{config.integral_pricename}}:</div>
|
<div class="buy_number_center"></div>
|
<div class="buy_number_right">{{order_integral}}</div>
|
</div>
|
<div class="dredge_bod_buy_text" v-if="gmtype=='integral'" @click="integralgm">立即购买</div>
|
<div class="dredge_bod_buy_number" v-if="gmtype=='coupon'">
|
<div class="buy_number_left">优惠券支付:</div>
|
<div class="buy_number_center">¥</div>
|
<div class="buy_number_right">{{order_price}}</div>
|
</div>
|
<div class="dredge_bod_buy_text" v-if="gmtype=='coupon'" @click="coupongm">立即购买</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script>
|
var zphjobid = '';
|
var yunvue = new Vue({
|
el: '#yunvue',
|
data() {
|
return {
|
islook: false,
|
server: '', //选中的购买服务
|
oserver: '', //携带的单项服务
|
sigle_show: false, //单项服务是否显示
|
singleid: '',
|
single_price: 0, //单项购买价格
|
single_integral: 0, // 单项购买积分
|
jfmodel_fk: true, // 积分模式下,单项服务购买积分不够是否需要充值积分
|
single_msg: '', //单项购买的服务名称
|
statis: {},
|
add: [], //增值服务数据
|
rating_1: [], //套餐会员数据
|
rating_2: [], //时间会员数据
|
config: {},
|
rating: 1,
|
cid: 0, //选中的服务id
|
sid: 0, //仅用于增值服务,用于展开多条信息
|
|
showMore: 0, // 更多信息
|
|
dkdivshow: true, //抵扣积分DIV显示隐藏
|
dkshow: false, //抵扣积分INPUT显示隐藏
|
ptshow: true, //支付方式显示隐藏
|
gmtype: 'price', //积分支付和金额支付控制显示(分别有price金额支付/integral完全积分支付/coupon完全优惠券支付)
|
server_price: 0, //选中服务的原始金额
|
single_id: 0, //服务id,包含选中的服务id和单独购买的传参id
|
order_price: 0, //付款金额
|
jfdk_price: 0, // 积分抵扣金额
|
order_integral: 0, //支付积分,在此页面仅有显示作用
|
price_int: 0, //充值积分数,积分模式下,所需服务积分大于持有积分时用到,同时还有最低充值积分制约
|
fktype: '', //支付方式
|
integral_dk: '', //抵扣积分
|
bid: '',
|
isDay: false,
|
cd: '1',
|
days: '1',
|
isdk: true,
|
zdyDays: '',
|
iscoupon: false,
|
yhqIsUse: true,
|
kyyhq: [],
|
couponid: '0',
|
coupon_name: '请选择',
|
coupon_price: 0, //优惠券金额
|
tab1: false,
|
tab2: false,
|
tab3: false,
|
tab4: false,
|
firsttab: 1,
|
serviceId: 0
|
};
|
},
|
created() {
|
let that = this;
|
let server = getUrlKey('server');
|
if (server) {
|
let oserver = server;
|
|
if (oserver == 'autojob' || oserver == 'jobtop' || oserver == 'jobrec' || oserver == 'joburgent') {
|
that.isDay = true;
|
}
|
if (oserver == 'zph' || oserver == 'zphnet') {
|
zphjobid = localStorageGet('zphjobid');
|
}
|
that.oserver = oserver;
|
}
|
let id = getUrlKey('id')
|
if (id) {
|
that.single_id = that.singleid = id;
|
}
|
let bid = getUrlKey('bid')
|
if (bid) {
|
that.bid = bid;
|
}
|
let serviceId = getUrlKey('serviceId')
|
if (serviceId) {
|
that.serviceId = serviceId;
|
}
|
that.getServer();
|
},
|
watch: {
|
zdyDays: function(value) {
|
debounce(this.setCkDays);
|
},
|
price_int: function(value) {
|
debounce(this.setPI);
|
},
|
integral_dk: {
|
handler(val) {
|
debounce(this.setjfdk);
|
},
|
deep: true
|
}
|
},
|
computed: {
|
kycount() {
|
return (this.kyyhq.length > 0)
|
},
|
tcmCount() {
|
return (this.rating_1.length > 0)
|
},
|
sjmCount() {
|
return (this.rating_2.length > 0)
|
},
|
addCount() {
|
return (this.add.length > 0)
|
},
|
canUseIntegral(){
|
return this.com_integral_online == '3' && this.config.sy_only_price.indexOf(that.server) == -1 ? true : false
|
}
|
},
|
methods: {
|
getTab: function() {
|
let config = this.config,
|
statis = this.statis;
|
|
if (statis.notOvertime == '1' && config.com_integral_online != '4' && statis.rating_type != '2' && this.addCount && this.oserver != 'autojob') {
|
this.tab3 = true;
|
this.firsttab = 3;
|
}
|
if ((config.com_vip_type == '1' || config.com_vip_type == '0') && this.sjmCount && this.oserver !=
|
'autojob') {
|
this.tab2 = true;
|
this.firsttab = 2;
|
}
|
if ((config.com_vip_type == '2' || config.com_vip_type == '0') && this.tcmCount && this.oserver !=
|
'autojob') {
|
this.tab1 = true;
|
this.firsttab = 1;
|
}
|
if (statis.notOvertime == '1' && this.sigle_show) {
|
this.tab4 = true;
|
this.firsttab = 4;
|
}
|
|
if (this.serviceId > 0) {
|
this.tab(3);
|
} else {
|
this.tab(this.firsttab);
|
}
|
},
|
getServer() {
|
let that = this,
|
param = {
|
server: that.oserver,
|
id: that.single_id
|
};
|
if (that.oserver == 'zph') {
|
param.bid = that.bid;
|
}
|
|
showLoading();
|
$.post('{yun:}url d=wxapp h=com m=fk c=server{/yun}', param, function(data) {
|
console.info(data);
|
hideLoading();
|
if (data) {
|
|
let res = data.data;
|
that.rating_1 = res.rating_1;
|
that.rating_2 = res.rating_2;
|
that.add = res.add;
|
res.statis.integral = parseInt(res.statis.integral);
|
that.statis = res.statis;
|
that.single_price = res.single_price;
|
that.single_integral = parseInt(res.single_integral);
|
that.single_msg = res.single_msg;
|
let config = res.config;
|
that.config = config;
|
|
that.sigle_show = res.sigle_show == '1' ? true : false;
|
that.getTab();
|
that.islook = true;
|
}
|
}, 'json')
|
},
|
defalutfktype: function() {
|
|
var that = this;
|
|
if (that.ptshow && that.gmtype == 'price' && that.fktype == '') {
|
|
if (that.config.fktype) {
|
|
if (that.config.fktype.fkwx) {
|
|
that.fktype = 'fkwx';
|
|
} else if (that.config.fktype.fkal) {
|
|
that.fktype = 'fkal';
|
|
}
|
}
|
}
|
|
},
|
//切换上方导航
|
tab: function(e) {
|
let that = this,
|
config = that.config,
|
tab = 1;
|
let com_integral_online = config.com_integral_online,
|
integral_min = parseInt(config.integral_min_recharge),
|
pro = parseFloat(config.integral_proportion);
|
if (isNaN(e)) {
|
tab = e.target.dataset.tab;
|
} else {
|
tab = e;
|
}
|
|
if (tab != that.rating) {
|
that.cid = 0;
|
that.sid = 0;
|
that.integral_dk = '';
|
that.jfdk_price = 0;
|
if (tab == 4) {
|
that.server = that.oserver;
|
that.single_id = that.singleid;
|
that.server_price = that.order_price = that.single_price;
|
|
if (com_integral_online == '3' && this.config.sy_only_price.indexOf(that.server) == -1) {
|
// 积分模式下,若自身积分数大于等于服务积分数,则为积分支付,否则金额支付差价。
|
// 并且没有被强制金额消费项目包含在内
|
var integral_cha = that.accSub(that.single_integral, that.statis.integral);
|
that.order_integral = that.single_integral;
|
if (integral_cha <= 0) {
|
that.jfmodel_fk = false;
|
that.gmtype = 'integral';
|
} else {
|
that.jfmodel_fk = true;
|
integral_cha = integral_cha > integral_min ? integral_cha : integral_min;
|
that.price_int = integral_cha;
|
that.order_price = that.accDiv(integral_cha, pro);
|
that.gmtype = 'price';
|
}
|
|
} else {
|
that.gmtype = 'price';
|
}
|
that.isdk = false;
|
} else {
|
that.server = '';
|
that.order_price = 0;
|
that.isdk = true;
|
that.gmtype = 'price';
|
}
|
|
that.dkdivshow = true;
|
that.dkshow = false;
|
|
// 积分抵扣
|
//会员套餐消费模式-强制金额消费
|
if (config.member_meal == '1') {
|
// 套餐消费模式为抵扣消费、积分消费
|
if ((tab == 3 || tab == 4) && config.com_integral_online == '1' && that.statis.integral > 0) {
|
that.dkdivshow = false;
|
}
|
} else {
|
if (config.com_integral_online == '1' && that.statis.integral > 0) {
|
that.dkdivshow = false;
|
}
|
}
|
|
that.rating = tab;
|
that.couponid = '';
|
that.coupon_price = 0;
|
that.coupon_name = '请选择';
|
that.integral_dk = '';
|
|
that.ptshow = true;
|
that.fktype = '';
|
} else {
|
if (tab == 1 && config.member_meal != '1' && config.com_integral_online == '1' && that.statis.integral > 0) {
|
that.dkdivshow = false;
|
}
|
}
|
|
if (com_integral_online == 2) {
|
that.dkdivshow = true;
|
}
|
|
if (tab == 1 || tab == 2) {
|
that.dkdivshow = config.sy_only_price.indexOf('vip') >= 0 ? true : false;
|
} else if (tab == 3) {
|
that.dkdivshow = config.sy_only_price.indexOf('pack') >= 0 ? true : false;
|
}
|
|
if (that.serviceId > 0 && tab == 3) {
|
that.sid = that.serviceId;
|
that.serviceId = 0;
|
}
|
that.defalutfktype();
|
},
|
//显示选中的套餐详细
|
chooseServer: function(e) {
|
let that = this,
|
dataset = e.currentTarget.dataset;
|
let cid = dataset.cid,
|
sid = dataset.sid,
|
tt = dataset.server;
|
|
if (cid != that.showMore) {
|
that.showMore = 0;
|
}
|
|
let rating = that.rating;
|
var com_integral_online = that.config.com_integral_online;
|
var integral_min = parseInt(that.config.integral_min_recharge);
|
var pro = parseFloat(that.config.integral_proportion);
|
|
that.integral_dk = '';
|
that.jfdk_price = 0;
|
that.couponid = '';
|
that.coupon_price = 0;
|
that.coupon_name = '请选择';
|
|
that.ptshow = true;
|
|
let meal = tt == 'vip' ? this.config.meal_vip : this.config.meal_pack;
|
//选中服务
|
if (cid && cid != 'undefined') {
|
if (cid != this.cid) {
|
this.cid = cid;
|
}
|
let info = that.getChooseInfo(cid);
|
|
that.server_price = info.yh_price ? parseFloat(info.yh_price) : parseFloat(info.service_price);
|
|
if (com_integral_online == '3' && this.config.sy_only_price.indexOf(tt) == -1) {
|
// 积分模式下,若自身积分数大于等于服务积分数,则为积分支付,否则金额支付差价。
|
// 并且没有被强制金额消费项目包含在内
|
var integral_need = parseInt(that.accMul(that.server_price, pro));
|
var integral_cha = that.accSub(integral_need, that.statis.integral);
|
if (integral_cha <= 0) {
|
that.order_integral = integral_need;
|
that.gmtype = 'integral';
|
} else {
|
integral_cha = integral_cha > integral_min ? integral_cha : integral_min;
|
that.price_int = integral_cha;
|
that.order_price = that.accDiv(integral_cha, pro);
|
that.gmtype = 'price';
|
}
|
} else {
|
that.order_price = that.server_price;
|
that.gmtype = 'price';
|
if (meal == 1) {
|
this.dkdivshow = true;
|
} else if (that.statis.integral > 0) {
|
this.dkdivshow = false;
|
}
|
}
|
|
that.single_id = cid;
|
that.server = dataset.server;
|
that.isdk = false;
|
|
if (com_integral_online == 2) {
|
that.dkdivshow = true;
|
}
|
|
}
|
//仅用作增值套餐展开信息
|
if (sid && sid != 'undefined') {
|
if (sid != this.sid) {
|
this.sid = sid;
|
}
|
}
|
},
|
setMoreShow: function(id) {
|
var that = this;
|
that.showMore = that.showMore == id ? 0 : id;
|
},
|
//根据服务id获取服务信息
|
getChooseInfo: function(id) {
|
var that = this;
|
let data = {};
|
if (that.rating == 1 || that.rating == 2) {
|
let info = that.rating == 1 ? that.rating_1 : that.rating_2;
|
for (var i = 0; i < info.length; i++) {
|
if (info[i].id == id) {
|
data = info[i];
|
break;
|
}
|
}
|
}
|
if (that.rating == 3) {
|
|
let add = that.add;
|
for (var i = 0; i < add.length; i++) {
|
if (add[i].detail) {
|
for (var j = 0; j < add[i].detail.length; j++) {
|
if (add[i].detail[j].id == id) {
|
data = add[i].detail[j];
|
break;
|
}
|
}
|
}
|
}
|
}
|
return data;
|
},
|
//选择支付方式
|
fkcheck: function(e) {
|
this.fktype = e.currentTarget.dataset.fktype;
|
},
|
//显示与隐藏抵扣积分输入框
|
dkChange: function(switched) {
|
let pro = parseInt(this.config.integral_proportion),
|
order_price = this.order_price;
|
|
if (this.integral_dk > 0) {
|
var price = parseFloat(this.accDiv(this.integral_dk, pro));
|
this.order_price = parseFloat(this.accAdd(order_price, price));
|
|
this.integral_dk = '';
|
this.jfdk_price = 0;
|
// 隐藏时,将相关参数值设为默认值
|
this.ptshow = true;
|
this.gmtype = 'price';
|
this.order_integral = 0;
|
}
|
if (switched) {
|
this.dkshow = true;
|
} else {
|
this.dkshow = false;
|
}
|
},
|
setjfdk: function() {
|
let dknum = parseInt(this.integral_dk ? this.integral_dk : 0),
|
server_price = parseFloat(this.server_price),
|
integral = parseInt(this.statis.integral),
|
pro = parseFloat(this.config.integral_proportion),
|
order_price = 0,
|
coupon_price = this.coupon_price,
|
integral_dk = '';
|
if (parseInt(this.days) > 0) {
|
server_price = parseFloat(server_price * parseInt(this.days));
|
}
|
if (server_price == 0) {
|
this.integral_dk = '';
|
return showModal('请先选择购买服务!');
|
}
|
if (coupon_price > 0) {
|
server_price = parseFloat(this.accSub(server_price, this.coupon_price)); // 扣除优惠金额
|
}
|
|
var integral_need = parseInt(this.accMul(server_price, pro));
|
if (dknum > 0) {
|
if (integral >= integral_need) { // 拥有积分充足
|
|
if (dknum >= integral_need) { // 输入抵扣积分超过购买积分
|
|
// 抵扣积分变更最大所需积分
|
integral_dk = integral_need;
|
order_price = 0; // 抵扣积分后所需金额
|
|
} else {
|
integral_dk = dknum;
|
order_price = this.accSub(server_price, this.accDiv(dknum, pro)); // 抵扣积分后所需金额
|
}
|
|
} else { // 拥有积分不充足
|
|
if (dknum >= integral) { // 抵扣所有积分
|
integral_dk = integral;
|
|
order_price = this.accSub(server_price, this.accDiv(integral, pro)); // 抵扣积分后所需金额
|
} else {
|
integral_dk = dknum;
|
order_price = this.accSub(server_price, this.accDiv(dknum, pro)); // 抵扣积分后所需金额
|
}
|
}
|
} else {
|
order_price = server_price;
|
}
|
this.integral_dk = integral_dk;
|
if (parseFloat(order_price) > 0) {
|
this.ptshow = true;
|
this.gmtype = 'price';
|
} else {
|
this.ptshow = false;
|
this.gmtype = 'integral';
|
this.order_integral = integral_need;
|
}
|
this.order_price = order_price;
|
this.jfdk_price = this.accSub(server_price, order_price);
|
},
|
//单项购买,积分模式下输入充值积分检查,需要大于系统最低充值积分数和服务所需积分数
|
setPI: function() {
|
var price_int = this.price_int;
|
var pro = parseFloat(this.config.integral_proportion);
|
var integral_cha = this.accSub(price_int, this.statis.integral);
|
var integral_min = parseInt(this.config.integral_min_recharge);
|
|
integral_cha = integral_cha > integral_min ? integral_cha : integral_min; //最低充值积分
|
|
price_int = integral_cha > price_int ? integral_cha : price_int;
|
this.order_price = this.accDiv(price_int, pro);
|
this.price_int = price_int;
|
},
|
getOrder() {
|
let that = this;
|
if (that.fktype == '') {
|
return showModal('请选择支付方式');
|
} else if (that.server == '') {
|
return showModal('请选择购买服务');
|
}
|
let paytype = '';
|
if (that.fktype == 'fkwx') {
|
paytype = 'wxpay'
|
} else if (that.fktype == 'fkal') {
|
paytype = 'alipay'
|
}
|
let param = {
|
paytype: paytype,
|
server: that.server,
|
dkjf: that.integral_dk,
|
price_int: that.price_int,
|
coupon_id: that.couponid,
|
};
|
|
let single_id = that.single_id;
|
let server = that.server;
|
if (server == 'issuejob' || server == 'invite' || server == 'createson' || server == 'spview') {
|
|
|
} else if (server == 'sxjob') {
|
|
param.sxjobid = single_id;
|
|
} else if (server == 'jobtop') {
|
|
if (parseInt(that.days) < 1) {
|
return showModal('请选择服务时长');
|
} else {
|
param.days = that.days;
|
}
|
param.zdjobid = single_id;
|
|
} else if (server == 'jobrec') {
|
|
if (parseInt(that.days) < 1) {
|
return showModal('请选择服务时长');
|
} else {
|
param.days = that.days;
|
}
|
param.recjobid = single_id;
|
|
} else if (server == 'joburgent') {
|
|
if (parseInt(that.days) < 1) {
|
return showModal('请选择服务时长');
|
} else {
|
param.days = that.days;
|
}
|
param.ujobid = single_id;
|
|
} else if (server == 'sxpart') {
|
|
param.sxpartid = single_id;
|
|
} else if (server == 'partrec') {
|
|
if (parseInt(that.days) < 1) {
|
return showModal('请选择服务时长');
|
} else {
|
param.days = that.days;
|
}
|
param.recpartid = single_id;
|
|
} else if (server == 'sxltjob') {
|
|
param.sxltjobid = single_id;
|
|
} else if (server == 'downresume') {
|
|
param.eid = single_id;
|
|
} else if (server == 'zph') {
|
param.zid = single_id;
|
param.bid = that.bid;
|
|
} else if (server == 'vip') {
|
|
param.ratingid = single_id;
|
|
} else if (server == 'pack') {
|
|
param.tcid = single_id;
|
|
} else if (server == 'autojob') {
|
|
if (parseInt(that.days) < 1) {
|
return showModal('请选择服务时长');
|
} else {
|
param.days = that.days;
|
}
|
param.jobautoids = single_id;
|
|
} else if (server == 'chat') {
|
|
param.chatid = single_id;
|
} else if (server == 'zphnet') {
|
|
param.zid = single_id;
|
}
|
|
showLoading('提交中');
|
$.post('index.php?c=getOrder', param, function(data) {
|
hideLoading();
|
window.localStorage.setItem("needRefresh", 1);
|
|
if (data.error == '0') { // 下单成功
|
wxpayShow = true;
|
showToast(data.msg, 2, function() {
|
location.href = data.url;
|
});
|
return false;
|
} else {
|
showToast(data.msg, 2, function() {
|
location.reload(true);
|
});
|
return false;
|
}
|
}, 'json')
|
},
|
/* 积分支付购买 */
|
integralgm() {
|
var that = this;
|
var server = that.server;
|
var days = that.days;
|
var single_id = that.single_id;
|
var coupon_id = that.couponid;
|
|
var param = {};
|
var pData = {
|
server: server,
|
coupon_id: coupon_id
|
};
|
if (server == 'issuejob' || server == 'invite' || server == 'createson' || server == 'spview') {
|
|
} else if (server == 'jobtop') {
|
pData.zdjobid = single_id;
|
pData.days = days;
|
} else if (server == 'jobrec') {
|
pData.recjobid = single_id;
|
pData.days = days;
|
} else if (server == 'joburgent') {
|
pData.ujobid = single_id;
|
pData.days = days;
|
} else if (server == 'sxjob') {
|
pData.sxjobid = single_id;
|
} else if (server == 'sxpart') {
|
pData.sxpartid = single_id;
|
} else if (server == 'downresume') {
|
pData.eid = single_id;
|
} else if (server == 'zph') {
|
var bid = that.bid;
|
pData.zid = single_id;
|
pData.bid = bid;
|
pData.jobid = zphjobid;
|
} else if (server == 'vip') {
|
pData.ratingid = single_id;
|
} else if (server == 'pack') {
|
pData.tcid = single_id;
|
} else if (server == 'autojob') {
|
pData.jobautoids = single_id;
|
pData.days = days;
|
} else if (server == 'chat') {
|
pData.chatid = single_id;
|
} else if (server == 'zphnet') {
|
pData.zid = single_id;
|
pData.jobid = zphjobid;
|
}
|
Object.assign(param, pData);
|
|
showLoading();
|
$.post('{yun:}url d=wxapp h=com m=fk c=dkzf{/yun}', param, function(data) {
|
hideLoading();
|
window.localStorage.setItem("needRefresh", 1);
|
if (data) {
|
if (data.error == '0') { // 成功
|
wxpayShow = true;
|
showModal(data.msg, function() {
|
history.go(-1);
|
});
|
} else {
|
showModal(data.msg);
|
}
|
}
|
}, 'json')
|
},
|
/* 优惠券购买 */
|
coupongm() {
|
var that = this;
|
var server = that.server;
|
var days = that.days;
|
var single_id = that.single_id;
|
var coupon_id = that.couponid
|
var param = {};
|
var pData = {
|
server: server,
|
coupon_id: coupon_id
|
};
|
if (server == 'issuejob' || server == 'invite' || server == 'createson' || server == 'spview') {
|
|
} else if (server == 'jobtop') {
|
pData.zdjobid = single_id;
|
pData.days = days;
|
} else if (server == 'jobrec') {
|
pData.recjobid = single_id;
|
pData.days = days;
|
} else if (server == 'joburgent') {
|
pData.ujobid = single_id;
|
pData.days = days;
|
} else if (server == 'sxjob') {
|
pData.sxjobid = single_id;
|
} else if (server == 'sxpart') {
|
pData.sxpartid = single_id;
|
} else if (server == 'downresume') {
|
pData.eid = single_id;
|
} else if (server == 'zph') {
|
var bid = that.bid;
|
pData.zid = single_id;
|
pData.bid = bid;
|
pData.jobid = zphjobid;
|
} else if (server == 'vip') {
|
pData.ratingid = single_id;
|
} else if (server == 'pack') {
|
pData.tcid = single_id;
|
} else if (server == 'autojob') {
|
pData.jobautoids = single_id;
|
pData.days = days;
|
} else if (server == 'chat') {
|
pData.chatid = single_id;
|
} else if (server == 'zphnet') {
|
pData.zid = single_id;
|
pData.jobid = zphjobid;
|
}
|
Object.assign(param, pData);
|
|
showLoading();
|
$.post('{yun:}url d=wxapp h=com m=fk c=coupongm{/yun}', param, function(data) {
|
hideLoading();
|
window.localStorage.setItem("needRefresh", 1);
|
if (data) {
|
if (data.error == '0') { // 成功
|
wxpayShow = true;
|
showModal(data.msg, function() {
|
history.go(-1);
|
});
|
} else {
|
showModal(data.msg);
|
}
|
}
|
}, 'json')
|
},
|
chooseCoupon: function(e) {
|
this.couponid = e.currentTarget.dataset.id;
|
},
|
couponShow() {
|
let that = this;
|
if (that.server == '') {
|
return showModal('请选择购买服务');
|
}
|
let param = {
|
price: that.order_price
|
};
|
|
showLoading();
|
$.post('{yun:}url d=wxapp h=com m=fk c=getCouponList{/yun}', param, function(data) {
|
hideLoading();
|
if (data) {
|
that.iscoupon = true;
|
let res = data.data;
|
if (res.ky && res.ky.length > 0) {
|
that.kyyhq = res.ky;
|
}
|
}
|
}, 'json')
|
},
|
|
couponOk: function() {
|
let that = this,
|
server_price = parseFloat(this.server_price),
|
|
couponid = this.couponid;
|
|
if (parseInt(couponid) > 0) {
|
for (let i in this.kyyhq) {
|
if (couponid == this.kyyhq[i].id) {
|
|
this.coupon_name = this.kyyhq[i].coupon_name;
|
this.coupon_price = this.kyyhq[i].coupon_amount;
|
|
let oPrice = that.accSub(this.server_price, this.kyyhq[i].coupon_amount);
|
if (parseFloat(oPrice) <= 0) {
|
|
this.dkdivshow = true;
|
this.order_price = server_price;
|
this.ptshow = false;
|
this.gmtype = 'coupon';
|
this.order_price = server_price;
|
} else {
|
// 如果有积分抵扣,使用积分抵扣后价格
|
if (this.jfdk_price > 0) {
|
var afterdkprice = this.accSub(this.server_price, this.jfdk_price);
|
var price = that.accSub(afterdkprice, this.kyyhq[i].coupon_amount);
|
} else {
|
var price = oPrice;
|
}
|
|
if (parseFloat(price) <= 0) {
|
|
this.ptshow = false;
|
this.order_integral = that.integral_dk;
|
this.gmtype = 'integral';
|
} else {
|
|
this.order_price = price;
|
this.ptshow = true;
|
this.gmtype = 'price';
|
}
|
break
|
}
|
|
}
|
}
|
} else {
|
this.coupon_name = "不使用优惠券";
|
this.coupon_price = 0;
|
this.ptshow = true;
|
this.gmtype = 'price';
|
// 如果有积分抵扣,重新处理
|
if (this.integral_dk > 0) {
|
this.setjfdk();
|
} else {
|
this.order_price = this.server_price;
|
}
|
}
|
this.iscoupon = false;
|
},
|
chooseDay: function(e) {
|
let that = this,
|
id = e.target.id,
|
com_integral_online = that.config.com_integral_online,
|
|
pro = parseFloat(that.config.integral_proportion);
|
this.cd = id;
|
this.days = id;
|
this.zdyDays = '';
|
var order_price = this.accMul(this.single_price, parseInt(id));
|
this.integral_dk = '';
|
this.jfdk_price = 0;
|
|
var integral_min = parseInt(that.config.integral_min_recharge);
|
|
if (com_integral_online == '3') { //积分模式,判断自身积分与所需积分大小,根据情况切换积分付款还是金额付款
|
var integral_need = that.accMul(order_price, pro);
|
var integral_cha = that.accSub(integral_need, that.statis.integral);
|
that.order_integral = integral_need;
|
if (integral_cha <= 0) {
|
that.jfmodel_fk = false;
|
that.gmtype = 'integral';
|
} else {
|
integral_cha = integral_cha > integral_min ? integral_cha : integral_min; //最低充值积分
|
that.order_price = that.accDiv(integral_cha, pro);
|
that.price_int = integral_cha;
|
that.jfmodel_fk = true;
|
that.gmtype = 'price';
|
}
|
} else {
|
that.order_price = order_price;
|
that.gmtype = 'price';
|
}
|
|
if (this.dkshow == true) {
|
this.dkshow = false;
|
}
|
this.isdk = false;
|
},
|
zdyDay: function() {
|
this.cd = '0';
|
this.days = '0';
|
this.zdyDays = '';
|
this.integral_dk = '';
|
this.jfdk_price = 0;
|
this.jfmodel_fk = false;
|
if (this.dkshow == true) {
|
this.dkshow = false;
|
}
|
this.order_integral = 0
|
this.order_price = 0;
|
this.isdk = true;
|
},
|
setCkDays: function() {
|
var com_integral_online = this.config.com_integral_online,
|
pro = parseFloat(this.config.integral_proportion);
|
|
var integral_min = parseInt(this.config.integral_min_recharge);
|
var order_price = this.accMul(this.single_price, this.zdyDays);
|
if (com_integral_online == '3') { //积分模式,判断自身积分与所需积分大小,根据情况切换积分付款还是金额付款
|
|
var integral_need = this.accMul(order_price, pro);
|
var integral_cha = this.accSub(integral_need, this.statis.integral);
|
|
if (integral_cha <= 0) {
|
this.jfmodel_fk = false;
|
this.gmtype = 'integral';
|
} else {
|
integral_cha = integral_cha > integral_min ? integral_cha : integral_min; //最低充值积分
|
this.price_int = integral_cha;
|
this.order_price = this.accDiv(integral_cha, pro);
|
this.jfmodel_fk = true;
|
this.gmtype = 'price';
|
}
|
this.order_integral = integral_need;
|
} else {
|
this.order_price = order_price;
|
this.gmtype = 'price';
|
}
|
this.days = this.zdyDays;
|
this.isdk = false;
|
},
|
candk: function() {
|
if (this.isdk) {
|
return showModal('请选择要购买的服务');
|
}
|
return true;
|
},
|
//减
|
accSub: function(arg1, arg2) {
|
return this.accAdd(arg1, -arg2);
|
},
|
//除
|
accDiv: function(arg1, arg2) {
|
var t1 = 0,
|
t2 = 0,
|
r1, r2;
|
try {
|
t1 = arg1.toString().split(".")[1].length
|
} catch (e) {}
|
try {
|
t2 = arg2.toString().split(".")[1].length
|
} catch (e) {}
|
|
r1 = Number(arg1.toString().replace(".", ""));
|
r2 = Number(arg2.toString().replace(".", ""));
|
return (r1 / r2) * Math.pow(10, t2 - t1);
|
|
},
|
//加
|
accAdd: function(arg1, arg2) {
|
if (isNaN(arg1)) {
|
arg1 = 0;
|
}
|
if (isNaN(arg2)) {
|
arg2 = 0;
|
}
|
arg1 = Number(arg1);
|
arg2 = Number(arg2);
|
var r1, r2, m, c;
|
try {
|
r1 = arg1.toString().split(".")[1].length;
|
} catch (e) {
|
r1 = 0;
|
}
|
try {
|
r2 = arg2.toString().split(".")[1].length;
|
} catch (e) {
|
r2 = 0;
|
}
|
c = Math.abs(r1 - r2);
|
m = Math.pow(10, Math.max(r1, r2));
|
if (c > 0) {
|
var cm = Math.pow(10, c);
|
if (r1 > r2) {
|
arg1 = Number(arg1.toString().replace(".", ""));
|
arg2 = Number(arg2.toString().replace(".", "")) * cm;
|
} else {
|
arg1 = Number(arg1.toString().replace(".", "")) * cm;
|
arg2 = Number(arg2.toString().replace(".", ""));
|
}
|
} else {
|
arg1 = Number(arg1.toString().replace(".", ""));
|
arg2 = Number(arg2.toString().replace(".", ""));
|
}
|
return (arg1 + arg2) / m;
|
},
|
//乘
|
accMul: function(arg1, arg2) {
|
var m = 0,
|
s1 = arg1.toString(),
|
s2 = arg2.toString();
|
try {
|
m += s1.split(".")[1].length
|
} catch (e) {}
|
try {
|
m += s2.split(".")[1].length
|
} catch (e) {}
|
|
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
|
}
|
}
|
});
|
</script>
|
</body>
|
|
</html>
|