|
@@ -0,0 +1,761 @@
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html lang="zh-CN">
|
|
|
|
+
|
|
|
|
+<head>
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
+ <meta name="viewport"
|
|
|
|
+ content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
|
|
+ <title>VIP订阅续费</title>
|
|
|
|
+ <meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
|
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
|
|
+ <script src="/vipsubscribe/js/rem.js?v={{Msg "seo" "version"}}"></script>
|
|
|
|
+ <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/weui.min.css?v={{Msg "seo" "version"}}"/>
|
|
|
|
+ <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base2.css?v={{Msg "seo" "version"}}"/>
|
|
|
|
+ <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
|
|
|
|
+ <link rel="stylesheet" href="/vipsubscribe/css/vip_renew.css?v={{Msg "seo" "version"}}">
|
|
|
|
+</head>
|
|
|
|
+
|
|
|
|
+<body class="no-touch">
|
|
|
|
+<div class="vip-renew">
|
|
|
|
+ <ul class="vip-body">
|
|
|
|
+ <li class="body-item area">
|
|
|
|
+ <a class="item-container" href="/front/vipsubscribe/toChooseArea">
|
|
|
|
+ <div class="item">
|
|
|
|
+ <span class="item-l">
|
|
|
|
+ <span class="item-label">区域</span>
|
|
|
|
+ </span>
|
|
|
|
+ <span class="item-r">
|
|
|
|
+ <span class="selected-area-name ellipsis">河南省、河南省、河南省、河南省、河南省、河南省、河南省、河南省、河南省</span>
|
|
|
|
+ <span class="iconfont icon-arrow"></span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sub-item text selected-area">2个省、2个市(分布在2个省内)</div>
|
|
|
|
+ </a>
|
|
|
|
+ </li>
|
|
|
|
+ <li class="body-item industry">
|
|
|
|
+ <a class="item-container" href="/front/vipsubscribe/toChooseIndustry">
|
|
|
|
+ <div class="item">
|
|
|
|
+ <span class="item-l">
|
|
|
|
+ <span class="item-label">采购单位行业</span>
|
|
|
|
+ </span>
|
|
|
|
+ <span class="item-r">
|
|
|
|
+ <span class="selected-industry-name industry-text ellipsis">绿化、财政、出版广电、出版广电、出版广电</span>
|
|
|
|
+ <span class="iconfont icon-arrow"></span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sub-item text selected-industry-count">3个行业</div>
|
|
|
|
+ </a>
|
|
|
|
+ </li>
|
|
|
|
+ <li class="body-item select_cycle">
|
|
|
|
+ <a class="item-container" href="javascript:;">
|
|
|
|
+ <div class="item">
|
|
|
|
+ <span class="item-l">
|
|
|
|
+ <span class="item-label">延长订阅周期</span>
|
|
|
|
+ </span>
|
|
|
|
+ <span class="item-r">
|
|
|
|
+ <span class="buy-cycle text ellipsis">6个月</span>
|
|
|
|
+ <span class="iconfont icon-arrow"></span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sub-item text">
|
|
|
|
+ <span class="sub-l">有效日期:</span>
|
|
|
|
+ <span class="sub-r">
|
|
|
|
+ <span class="ellipsis">
|
|
|
|
+ (<span class="month">3个月</span>)<span class="duration">2019年8月1日-2019年8月7日</span>
|
|
|
|
+ </span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </a>
|
|
|
|
+ </li>
|
|
|
|
+ <li class="body-item pay-mode">
|
|
|
|
+ <a class="item-container" href="javascript:;">
|
|
|
|
+ <div class="item">
|
|
|
|
+ <span class="item-l">
|
|
|
|
+ <span class="leading"></span>
|
|
|
|
+ <span class="item-label">支付方式</span>
|
|
|
|
+ </span>
|
|
|
|
+ <span class="item-r">
|
|
|
|
+ <span class="pay-mode-text">微信支付</span>
|
|
|
|
+ <span class="iconfont icon-arrow"></span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </a>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ <div class="vip-footer renew">
|
|
|
|
+ <div class="footer-preview-container">
|
|
|
|
+ <div class="clause-box">
|
|
|
|
+ <span class="checkbox"></span>
|
|
|
|
+ <span class="clause-read">我已阅读,理解并接受<a href="/front/staticPage/wx-serviceterms.html">《剑鱼标讯线上购买与服务条款》</a></span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="price-preview">
|
|
|
|
+ <span class="preview-label">需补差价:</span>
|
|
|
|
+ <span class="preview-content">
|
|
|
|
+ <span class="billing-list-btn">计费清单</span>
|
|
|
|
+ <span class="billing-price">¥366.50</span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="footer-button-group">
|
|
|
|
+ <!--<button class="button-l reset">取消</button>-->
|
|
|
|
+ <button class="button-r confirm" disabled>确认支付</button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+<!-- 计费清单picker -->
|
|
|
|
+<div class="billing-list-container" style="display: none;">
|
|
|
|
+ <div class="weui-mask weui-animate-fade-in"></div>
|
|
|
|
+ <div class="weui-half-screen-dialog weui-picker weui-animate-slide-up">
|
|
|
|
+ <div class="weui-half-screen-dialog__hd">
|
|
|
|
+ <div class="dialog_hd__l"></div>
|
|
|
|
+ <div class="dialog_hd__title">计算标准</div>
|
|
|
|
+ <div class="dialog_hd__close iconfont icon-guanbi"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="weui-half-screen-dialog__bd">
|
|
|
|
+ <div class="vip_prise_table">
|
|
|
|
+ <table class="monthly">
|
|
|
|
+ <div class="table_title">
|
|
|
|
+ <div class="line"></div>
|
|
|
|
+ <div class="title">VIP订阅价格</div>
|
|
|
|
+ <div class="line"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <tr>
|
|
|
|
+ <td colspan="2">按月购买</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>5.8元 月/市/行业</td>
|
|
|
|
+ <td>18元 月/市/全行业</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>11.8元 月/省/行业</td>
|
|
|
|
+ <td>38元 月/省/全行业</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>118元 月/全国/行业</td>
|
|
|
|
+ <td>388元 月/全国/全行业</td>
|
|
|
|
+ </tr>
|
|
|
|
+ </table>
|
|
|
|
+ <table class="yearly">
|
|
|
|
+ <tr>
|
|
|
|
+ <td colspan="2">按年购买</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>58元 年/市/行业</td>
|
|
|
|
+ <td>180元 年/市/全行业</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>118元 年/省/行业</td>
|
|
|
|
+ <td>380元 年/省/全行业</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>1180元 年/全国/行业</td>
|
|
|
|
+ <td>3880元 年/全国/全行业</td>
|
|
|
|
+ </tr>
|
|
|
|
+ </table>
|
|
|
|
+ <div class="tips">
|
|
|
|
+ <dt>购买须知:</dt>
|
|
|
|
+ <dd>套餐周期内,不支持套餐降级,续费可降级;</dd>
|
|
|
|
+ <dd>用户最多购买/续费3年套餐;</dd>
|
|
|
|
+ <dd>支持套餐升级,补差价(按月进行补差价,不足一个月按一个月计算)。</dd>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="weui-half-screen-dialog__ft"></div>
|
|
|
|
+ </div>
|
|
|
|
+</div>
|
|
|
|
+<!-- 选择订阅周期picker -->
|
|
|
|
+<div class="js_dialog time_cycle" id="time_cycle" style="display: none;">
|
|
|
|
+ <div class="weui-mask"></div>
|
|
|
|
+ <div class="box">
|
|
|
|
+ <div class="box_hd">
|
|
|
|
+ <h3>订阅周期</h3>
|
|
|
|
+ <span class="cancel">取消</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="box_bd">
|
|
|
|
+ <div class="tips profit_tips">已选择10个月,建议“按年订阅”更换算哦~</div>
|
|
|
|
+ <div class="computed_price">¥58.0</div>
|
|
|
|
+ <div class="bd_select">
|
|
|
|
+ <div class="weui-cells weui-cells_checkbox choose-form">
|
|
|
|
+ <label class="weui-cell weui-check__label monthly_label" for="monthly">
|
|
|
|
+ <div class="weui-cell__hd">
|
|
|
|
+ <input type="radio" class="weui-check monthly" name="time" value="month" id="monthly"
|
|
|
|
+ checked/>
|
|
|
|
+ <i class="weui-icon-checked"></i>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="weui-cell__bd">
|
|
|
|
+ <p>按月订阅</p>
|
|
|
|
+ </div>
|
|
|
|
+ </label>
|
|
|
|
+ <div class="number_box active" id="number_box_month" data-numbox-step="1" data-numbox-min="1"
|
|
|
|
+ data-numbox-max="12">
|
|
|
|
+ <button class="weui-btn weui-btn_plain-default" type="button" disabled>
|
|
|
|
+ <div class="jy_icon decrease"></div>
|
|
|
|
+ </button>
|
|
|
|
+ <span class="month_number">1</span>
|
|
|
|
+ <button class="weui-btn weui-btn_plain-default add" type="button">
|
|
|
|
+ <div class="jy_icon increase"></div>
|
|
|
|
+ </button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="weui-cells weui-cells_checkbox choose-form">
|
|
|
|
+ <label class="weui-cell weui-check__label yearly_label" for="yearly">
|
|
|
|
+ <div class="weui-cell__hd">
|
|
|
|
+ <input type="radio" class="weui-check yearly" name="time" value="year" id="yearly"/>
|
|
|
|
+ <i class="weui-icon-checked"></i>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="weui-cell__bd">
|
|
|
|
+ <p>按年订阅</p>
|
|
|
|
+ </div>
|
|
|
|
+ </label>
|
|
|
|
+ <div class="number_box" id="number_box_year" style="border: 0;">
|
|
|
|
+ <span class="year_number" data-id="1">1年</span>
|
|
|
|
+ <span class="year_number" data-id="2">2年</span>
|
|
|
|
+ <span class="year_number" data-id="3">3年</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-btn">
|
|
|
|
+ <button class="btn enter" id="enter_period">确认</button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</div>
|
|
|
|
+<!-- 选择支付方式 -->
|
|
|
|
+<div class="js_dialog pay_way" id="pay_way" style="display: none;">
|
|
|
|
+ <div class="weui-mask"></div>
|
|
|
|
+ <div class="box">
|
|
|
|
+ <div class="box_hd">
|
|
|
|
+ <span></span>
|
|
|
|
+ <h3>支付方式</h3>
|
|
|
|
+ <span class="cancel">取消</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="box_bd">
|
|
|
|
+ <div class="weui-cells weui-cells_checkbox choose-form">
|
|
|
|
+ <label class="weui-cell weui-check__label wx_label" for="wx">
|
|
|
|
+ <div class="weui-cell__bd read">
|
|
|
|
+ <i class="icon-wx"></i>
|
|
|
|
+ <p>微信支付</p>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="weui-cell__hd">
|
|
|
|
+ <input type="radio" class="weui-check" name="way" value="微信支付" id="wx" checked/>
|
|
|
|
+ <i class="weui-icon-checked"></i>
|
|
|
|
+ </div>
|
|
|
|
+ </label>
|
|
|
|
+ <label class="weui-cell weui-check__label zfb_label" for="zfb">
|
|
|
|
+ <div class="weui-cell__bd read">
|
|
|
|
+ <i class="icon-zfb"></i>
|
|
|
|
+ <p>支付宝支付</p>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="weui-cell__hd">
|
|
|
|
+ <input type="radio" class="weui-check" name="way" value="支付宝支付" id="zfb"/>
|
|
|
|
+ <i class="weui-icon-checked"></i>
|
|
|
|
+ </div>
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</div>
|
|
|
|
+<script src="/vipsubscribe/js/jquery-2.1.4.js?v={{Msg "seo" "version"}}"></script>
|
|
|
|
+<script src="/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
|
+<script src="/vipsubscribe/js/common.js?v={{Msg "seo" "version"}}"></script>
|
|
|
|
+{{include "/common/weixin.html"}}
|
|
|
|
+<script>
|
|
|
|
+ $(window).bind("pageshow", function (event) {
|
|
|
|
+ if (event.originalEvent.persisted) {
|
|
|
|
+ window.location.reload();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ try {
|
|
|
|
+ var signature = {{.T.signature}};
|
|
|
|
+ var isConfigSuccess = true;
|
|
|
|
+ var id = {{.T._id}}
|
|
|
|
+ if (signature && signature.length == 4) {
|
|
|
|
+ wx.config({
|
|
|
|
+ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
|
+ appId: signature[0], // 必填,公众号的唯一标识
|
|
|
|
+ timestamp: signature[1], // 必填,生成签名的时间戳
|
|
|
|
+ nonceStr: signature[2], // 必填,生成签名的随机串
|
|
|
|
+ signature: signature[3],// 必填,签名,见附录1
|
|
|
|
+ jsApiList: ['chooseWXPay', 'hideAllNonBaseMenuItem'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
|
|
|
+ });
|
|
|
|
+ wx.ready(function () {
|
|
|
|
+ if (!isConfigSuccess) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ wx.hideAllNonBaseMenuItem();
|
|
|
|
+ });
|
|
|
|
+ wx.error(function (res) {
|
|
|
|
+ //config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
|
|
|
+ //alert(res);
|
|
|
|
+ isConfigSuccess = false;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //调用微信支付接口
|
|
|
|
+ function onBridgeReady(res, ordercode) {
|
|
|
|
+ WeixinJSBridge.invoke('getBrandWCPayRequest', {
|
|
|
|
+ "appId": res["appId"],
|
|
|
|
+ "timeStamp": res["timestamp"],
|
|
|
|
+ "nonceStr": res["nonceStr"],
|
|
|
|
+ "package": res["prepayId"],
|
|
|
|
+ "signType": res["signType"],
|
|
|
|
+ "paySign": res["sign"]
|
|
|
|
+ },
|
|
|
|
+ function (r) {
|
|
|
|
+ if (r.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ clearSessionStorage();
|
|
|
|
+ window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode=" + ordercode);
|
|
|
|
+ }, 500)
|
|
|
|
+ } else if (r.err_msg == "get_brand_wcpay_request:cancel") {
|
|
|
|
+ console.log("支付已取消")
|
|
|
|
+ } else {
|
|
|
|
+ weui.toast("系统异常,请稍微再试", {
|
|
|
|
+ duration: 2000,
|
|
|
|
+ className: 'custom-toast',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //微信支付end
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var purchase = {
|
|
|
|
+ areaSelect: {"一个省": ["一个市"]},//已选择地区 {"一个省":["一个市"]}计算价格临时变量
|
|
|
|
+ industrySelect: ["一个行业"],// 已选择行业 一个行业(计算价格临时变量)
|
|
|
|
+ timeSelect: [1, 2],//已选择时间 timeSelect[0]时长 timeSelect[1] 1:年 2:月
|
|
|
|
+ timeValue: "一个月",
|
|
|
|
+ endTime: "",
|
|
|
|
+ price: {}, //价格
|
|
|
|
+ payWay: "wx_js",
|
|
|
|
+ initData: function () {
|
|
|
|
+ //已选择
|
|
|
|
+ try {
|
|
|
|
+ if (sessionStorage.getItem("vipSubSelectArea")) {
|
|
|
|
+ this.areaSelect = JSON.parse(sessionStorage.getItem("vipSubSelectArea"));
|
|
|
|
+ }
|
|
|
|
+ if (sessionStorage.getItem("vipSubSelectIndustry")) {
|
|
|
|
+ this.industrySelect = JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
|
|
|
|
+ }
|
|
|
|
+ if (sessionStorage.getItem("endTime")) {
|
|
|
|
+ this.endTime = parseInt(sessionStorage.getItem("endTime"))
|
|
|
|
+ }
|
|
|
|
+ //即将到期 回显已购买
|
|
|
|
+ if (!sessionStorage.getItem("vipSubSelectArea") || !sessionStorage.getItem("vipSubSelectIndustry")) {
|
|
|
|
+ $DoPost("/subscribepay/vipsubscribe/getSubBuyMsg", {}, function (r) {
|
|
|
|
+ if (r.success) {
|
|
|
|
+ if (!$.isEmptyObject(r.data.area)) {
|
|
|
|
+ purchase.areaSelect = r.data.area
|
|
|
|
+ } else {
|
|
|
|
+ purchase.areaSelect = {"全国": []}
|
|
|
|
+ }
|
|
|
|
+ if (r.data.industry.length != 0) {
|
|
|
|
+ purchase.industrySelect = r.data.industry
|
|
|
|
+ } else {
|
|
|
|
+ purchase.industrySelect = ["全部行业"]
|
|
|
|
+ }
|
|
|
|
+ if (r.data.endTime) {
|
|
|
|
+ purchase.endTime = r.data.endTime;
|
|
|
|
+ }
|
|
|
|
+ sessionStorage.setItem("vipSubSelectArea", JSON.stringify(purchase.areaSelect));
|
|
|
|
+ sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
|
|
|
|
+ sessionStorage.setItem("endTime", JSON.stringify(purchase.endTime))
|
|
|
|
+ }
|
|
|
|
+ }, false)
|
|
|
|
+ }
|
|
|
|
+ if (sessionStorage.getItem("vipSubSelectTime")) {
|
|
|
|
+ this.timeSelect = JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //加载价格
|
|
|
|
+ $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
|
|
|
|
+ if (r) {
|
|
|
|
+ purchase.price = r;
|
|
|
|
+ }
|
|
|
|
+ }, false)
|
|
|
|
+
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log(e)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ showArea: function () {
|
|
|
|
+ var cityArr = [];//城市
|
|
|
|
+ var provinceArr = [];//省份
|
|
|
|
+ var cityProvinceCount = 0;
|
|
|
|
+ var data = this.areaSelect;
|
|
|
|
+ for (var i in data) {
|
|
|
|
+ var citys = data[i];
|
|
|
|
+ if (citys.length > 0) {
|
|
|
|
+ cityArr = cityArr.concat(citys);
|
|
|
|
+ cityProvinceCount++;
|
|
|
|
+ } else {
|
|
|
|
+ provinceArr.push(i)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["全国"] && !this.areaSelect["一个省"]) { //选择有行业信息 且不是全国
|
|
|
|
+ var tipTxt = "";
|
|
|
|
+ if (provinceArr.length > 0) tipTxt += provinceArr.length + " 个省";
|
|
|
|
+ if (cityArr.length > 0) {
|
|
|
|
+ if (provinceArr.length > 0) tipTxt += "、";
|
|
|
|
+ tipTxt += cityArr.length + " 个市(分布在" + cityProvinceCount + "个省内)";
|
|
|
|
+ }
|
|
|
|
+ $(".selected-area").text(tipTxt);
|
|
|
|
+ //$(".add_tips.area").text(tipTxt).css("display", "");
|
|
|
|
+ } else if (!$.isEmptyObject(this.areaSelect) && this.areaSelect["全国"]) {
|
|
|
|
+ $(".selected-area").text("全国");
|
|
|
|
+ } else {
|
|
|
|
+ $(".selected-area").text("");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ showPrice: function () {
|
|
|
|
+ $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass / 100);
|
|
|
|
+ $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass / 100);
|
|
|
|
+ $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass / 100);
|
|
|
|
+ $('.monthly span:eq(3)').text(purchase.price.month.oneProvince_allBuyerClass / 100);
|
|
|
|
+ $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass / 100);
|
|
|
|
+ $('.monthly span:eq(5)').text(purchase.price.month.allProvince_allBuyerClass / 100);
|
|
|
|
+
|
|
|
|
+ $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass / 100);
|
|
|
|
+ $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass / 100);
|
|
|
|
+ $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass / 100);
|
|
|
|
+ $('.yearly span:eq(3)').text(purchase.price.year.oneProvince_allBuyerClass / 100);
|
|
|
|
+ $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass / 100);
|
|
|
|
+ $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
|
|
|
|
+ },
|
|
|
|
+ showIndustry: function () {
|
|
|
|
+ var data = this.industrySelect;
|
|
|
|
+ if (this.industrySelect.length > 0 && this.industrySelect[0] != "全部行业" && this.industrySelect[0] != "一个行业") { //选择有行业信息
|
|
|
|
+ var tipTxt = "";
|
|
|
|
+ $(".selected-industry-count").text(tipTxt + this.industrySelect.length + " 个行业");
|
|
|
|
+ } else if (this.industrySelect.length > 0 && this.industrySelect[0] == "全部行业") {
|
|
|
|
+ $(".selected-industry-count").text("全部行业");
|
|
|
|
+ } else {
|
|
|
|
+ $(".selected-industry-count").text("");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ showTime: function () {
|
|
|
|
+ var tmp = this.timeSelect[0];
|
|
|
|
+ if (this.timeSelect[1] == 1) {
|
|
|
|
+ tmp += "年";
|
|
|
|
+ $("#yearly").prop('checked', true);
|
|
|
|
+ $('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').addClass("active");
|
|
|
|
+ //$(".number_box:eq(1)").addClass("active");
|
|
|
|
+ } else {
|
|
|
|
+ tmp += "个月";
|
|
|
|
+ $("#monthly").prop('checked', true);
|
|
|
|
+ $(".number_box:eq(0)").addClass("active");
|
|
|
|
+ $("#number_box_month .month_number").text(this.timeSelect[0]);
|
|
|
|
+ if (this.timeSelect[0] >= 10) {
|
|
|
|
+ $('.profit_tips').text("已选择" + this.timeSelect[0] + "个月,建议“按年订阅”").show();
|
|
|
|
+ }
|
|
|
|
+ if (this.timeSelect[0] == 1) {
|
|
|
|
+ $('#number_box_month button:eq(0)').attr("disabled", "disabled");
|
|
|
|
+ } else {
|
|
|
|
+ $('#number_box_month button:eq(0)').removeAttr("disabled");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.timeValue = tmp;
|
|
|
|
+ this.flushSelectTime();
|
|
|
|
+ },
|
|
|
|
+ flushPrice: function (time, flag) {
|
|
|
|
+ var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
|
|
|
|
+ if (flag === 1) {
|
|
|
|
+ $('.billing-price').text('¥' + price);
|
|
|
|
+ } else if (flag === 2) {
|
|
|
|
+ $('.computed_price').html('¥' + price);
|
|
|
|
+ } else {
|
|
|
|
+ $('.billing-price').text('¥' + price);
|
|
|
|
+ $('.computed_price').html('¥' + price);
|
|
|
|
+ }
|
|
|
|
+ }, flushSelectTime() {
|
|
|
|
+ $(".select_cycle .month").text(this.timeValue);
|
|
|
|
+ if (this.endTime) {
|
|
|
|
+ var time1 = new Date(this.endTime * 1000).pattern('yyyy年MM月dd日');
|
|
|
|
+ var time = getVipEndDate(this.timeSelect[1], this.timeSelect[0], this.endTime);
|
|
|
|
+ var time2 = new Date(time * 1000).pattern('yyyy年MM月dd日');
|
|
|
|
+ $(".select_cycle .duration").text(time1 + "-" + time2);
|
|
|
|
+ $(".select_cycle .duration").show();
|
|
|
|
+ } else {
|
|
|
|
+ $(".select_cycle .duration").hide();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $(function () {
|
|
|
|
+ purchase.initData();
|
|
|
|
+ purchase.showArea();
|
|
|
|
+ purchase.showIndustry();
|
|
|
|
+ purchase.showPrice();
|
|
|
|
+ purchase.showTime();
|
|
|
|
+ purchase.flushPrice(purchase.timeSelect);
|
|
|
|
+ var time_limit;//定义一个周期变量
|
|
|
|
+ /*------ 关闭弹窗事件 点击取消或遮罩层 -----*/
|
|
|
|
+ $('.weui-mask').click(hideDialog);
|
|
|
|
+ $('.cancel').click(hideDialog);
|
|
|
|
+
|
|
|
|
+ /* ----- 订阅周期、支付方式弹窗弹出事件 -------*/
|
|
|
|
+ // 选择订阅周期
|
|
|
|
+ $('.select_cycle a').click(function (e) {
|
|
|
|
+ $('#time_cycle').show(200);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /* ----- 选择完支付方式、订阅周期 回显到页面 -------*/
|
|
|
|
+ $('.vip-body .pay-mode').on('click', function () {
|
|
|
|
+ pickerShow('#pay_way', true)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ $('#pay_way input:radio[name="way"]').click(function () {
|
|
|
|
+ var checkValue = $('input:radio[name="way"]:checked').val();
|
|
|
|
+ pickerShow('#pay_way', false)
|
|
|
|
+ $('.vip-body .pay-mode .pay-mode-text').text(checkValue);
|
|
|
|
+ if (checkValue === "微信支付") {
|
|
|
|
+ purchase.payWay = "wx_app"
|
|
|
|
+ } else {
|
|
|
|
+ purchase.payWay = "ali_app"
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 对订阅时间选择的input绑定点击事件
|
|
|
|
+ $('#time_cycle input:radio[name="time"]').on('click', function (e) {
|
|
|
|
+ // 解除确认按钮的锁定
|
|
|
|
+ $('#time_cycle .form-btn button').removeAttr('disabled');
|
|
|
|
+ if ($(e.target).hasClass('monthly')) {
|
|
|
|
+ // 按月订阅
|
|
|
|
+ $('#number_box_month').addClass('active');
|
|
|
|
+ $('#number_box_year span').removeClass('active');
|
|
|
|
+ } else {
|
|
|
|
+ // 按年订阅
|
|
|
|
+ $('#number_box_month').removeClass('active');
|
|
|
|
+ // $('#number_box_year span:eq(0)').addClass('active').siblings().removeClass('active');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ /* --------控制月份number_box的事件 点击加减号触发的事件------- */
|
|
|
|
+ $('#number_box_month').on('click', 'button', function (e) {
|
|
|
|
+ // 点击加减号让input radio选中
|
|
|
|
+ $('#monthly').prop('checked', true);
|
|
|
|
+ $('#yearly').prop('checked', false);
|
|
|
|
+ $('.number_box span').removeClass('active');
|
|
|
|
+ $('#number_box_month').addClass('active');
|
|
|
|
+
|
|
|
|
+ var $number = $('#number_box_month span.month_number');
|
|
|
|
+ var $monthlyInput = $('#monthly');
|
|
|
|
+ // 未整理的data数组,里面的值都是字符串
|
|
|
|
+ var preData = e.delegateTarget.dataset;
|
|
|
|
+ var currentNum = parseInt($number.text());
|
|
|
|
+ var data = {};
|
|
|
|
+ // 把字符串转换成数字
|
|
|
|
+ for (var i in preData) {
|
|
|
|
+ data[i] = preData[i] - 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!$monthlyInput.prop('checked')) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 判断是点击的是+ 还是-
|
|
|
|
+ if ($(e.target).hasClass('add')) {
|
|
|
|
+ if (currentNum == 11) { //12个月自动跳转1年
|
|
|
|
+ $("#number_box_year .year_number:eq(0)").trigger("click");
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 点的+
|
|
|
|
+ currentNum = currentNum >= data.numboxMax ? data.numboxMax : currentNum + data
|
|
|
|
+ .numboxStep;
|
|
|
|
+ } else {
|
|
|
|
+ // 点的-
|
|
|
|
+ currentNum = currentNum <= data.numboxMin ? data.numboxMin : currentNum - data
|
|
|
|
+ .numboxStep;
|
|
|
|
+ }
|
|
|
|
+ $number.text(currentNum);
|
|
|
|
+ purchase.timeSelect_tmp = [Number(currentNum), 2];
|
|
|
|
+ purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
|
+ //var price = (5.8 * currentNum).toFixed(1);
|
|
|
|
+ //$('.computed_price').html('¥' + price)
|
|
|
|
+ var firstButton = $('#number_box_month button:first');
|
|
|
|
+ var lastButton = $('#number_box_month button:last');
|
|
|
|
+ if (currentNum >= 10) {
|
|
|
|
+ $('.profit_tips').text("已选择" + currentNum + "个月,建议“按年订阅”").show();
|
|
|
|
+ } else {
|
|
|
|
+ $('.profit_tips').hide();
|
|
|
|
+ }
|
|
|
|
+ // 如果为操作后的结果为1,则锁定减号按钮
|
|
|
|
+ if (currentNum === data.numboxMin) {
|
|
|
|
+ firstButton.attr('disabled', true)
|
|
|
|
+ } else {
|
|
|
|
+ firstButton.removeAttr('disabled')
|
|
|
|
+ }
|
|
|
|
+ // 如果为操作后的结果为12,则锁定加号按钮
|
|
|
|
+ if (currentNum === data.numboxMax) {
|
|
|
|
+ lastButton.attr('disabled', true)
|
|
|
|
+ } else {
|
|
|
|
+ lastButton.removeAttr('disabled')
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ /* -------- 控制年份number_box的事件 点击1年 2年 3年触发的事件------- */
|
|
|
|
+ $('#number_box_year').on('click', 'span', function (e) {
|
|
|
|
+ console.log(e.target.dataset.id);
|
|
|
|
+ $('#number_box_month').removeClass('active');
|
|
|
|
+ var id = e.target.dataset.id;
|
|
|
|
+ $('.profit_tips').hide();
|
|
|
|
+ $(this).addClass('active').siblings().removeClass('active');
|
|
|
|
+ $('#yearly').prop('checked', true);
|
|
|
|
+ $("#monthly").prop('checked', false);
|
|
|
|
+
|
|
|
|
+ // 渲染结果 保留一位小数
|
|
|
|
+ //var result = (Number(id) * 58).toFixed(1);
|
|
|
|
+ //$('.computed_price').html('¥' + result)
|
|
|
|
+ purchase.timeSelect_tmp = [Number(id), 1]
|
|
|
|
+ purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ /* -------- 选择按月订阅 radio触发的事件------- */
|
|
|
|
+ $('#monthly').on('change', function (e) {
|
|
|
|
+ var isChecked = $(this).is(':checked');
|
|
|
|
+ var val = $('.month_number').text();
|
|
|
|
+ if (val >= 10) {
|
|
|
|
+ $('.profit_tips').show()
|
|
|
|
+ }
|
|
|
|
+ if (!isChecked) {
|
|
|
|
+ $('#number_box_month button').attr('disabled', true)
|
|
|
|
+ }
|
|
|
|
+ //var result = (Number(val) * 5.8).toFixed(1);
|
|
|
|
+ //$('.computed_price').html('¥' + result);
|
|
|
|
+ purchase.timeSelect_tmp = [Number(val), 2];
|
|
|
|
+ purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ //计价清单
|
|
|
|
+ $('.billing-list-btn').on('click', function () {
|
|
|
|
+ pickerShow('.billing-list-container', true)
|
|
|
|
+ })
|
|
|
|
+ // 计算标准隐藏
|
|
|
|
+ $('.billing-list-container .dialog_hd__close').on('click', function () {
|
|
|
|
+ pickerShow('.billing-list-container', false)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ $('.checkbox').on('click', function () {
|
|
|
|
+ $(this).toggleClass('checked')
|
|
|
|
+ var state = $(this).hasClass('checked');
|
|
|
|
+ $('.vip-footer.renew .confirm').prop('disabled', !state)
|
|
|
|
+ sessionStorage.setItem("vipSub_read", state);
|
|
|
|
+ });
|
|
|
|
+ //是否点击已读
|
|
|
|
+ if (sessionStorage.getItem("vipSub_read") === "true") {
|
|
|
|
+ $('.checkbox').addClass("checked");
|
|
|
|
+ $('.vip-footer.renew .confirm').prop('disabled', false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* -------- 选择按年订阅 radio触发的事件------- */
|
|
|
|
+ $('#yearly').on('change', function (e) {
|
|
|
|
+ $('.profit_tips').hide();
|
|
|
|
+ // console.log($(this).is(':checked'))
|
|
|
|
+ var isChecked = $(this).is(':checked');
|
|
|
|
+ // 按年订阅默认选择1年
|
|
|
|
+ var val = 1;
|
|
|
|
+ //$('.computed_price').html('¥' + Number(val) * 58)
|
|
|
|
+ if (isChecked) {
|
|
|
|
+ $('#number_box_year span:eq(0)').addClass('active').siblings().removeClass('active')
|
|
|
|
+ }
|
|
|
|
+ purchase.timeSelect_tmp = [Number(val), 1];
|
|
|
|
+ purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 确认订阅周期
|
|
|
|
+ $('#enter_period').on('click', function () {
|
|
|
|
+ var val;
|
|
|
|
+ $('input[name="time"]').each(function (i, v) {
|
|
|
|
+ var isChecked = $(v).is(':checked');
|
|
|
|
+ if ($(v).is(':checked') === true && $('.year_number').hasClass('active')) {
|
|
|
|
+ val = $('.active').html();
|
|
|
|
+ purchase.timeSelect_tmp = [parseInt(val[0]), 1];
|
|
|
|
+ $('#time_cycle').hide(function () {
|
|
|
|
+ purchase.timeValue = val;
|
|
|
|
+ purchase.flushSelectTime()
|
|
|
|
+ });
|
|
|
|
+ } else if ($(v).is(':checked') === true) {
|
|
|
|
+ val = $('.month_number').html();
|
|
|
|
+ purchase.timeSelect_tmp = [parseInt(val), 2];
|
|
|
|
+ $('#time_cycle').hide(function () {
|
|
|
|
+ purchase.timeValue = val + "个月";
|
|
|
|
+ purchase.flushSelectTime()
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ purchase.timeSelect = purchase.timeSelect_tmp;
|
|
|
|
+ purchase.flushPrice(purchase.timeSelect, 1);
|
|
|
|
+ sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));
|
|
|
|
+ });
|
|
|
|
+ $('.vip-footer.renew .confirm').click(function () {
|
|
|
|
+ $('.vip-footer.renew .confirm').attr("disabled", "disabled");
|
|
|
|
+ //支付请求
|
|
|
|
+ var area = purchase.areaSelect;
|
|
|
|
+ var industry = purchase.industrySelect;
|
|
|
|
+ if (area["全国"]) {
|
|
|
|
+ area = {};
|
|
|
|
+ }
|
|
|
|
+ if (industry.length === 1 && industry[0] === "全部行业") {
|
|
|
|
+ industry = [];
|
|
|
|
+ }
|
|
|
|
+ //付费用户
|
|
|
|
+ var param = {
|
|
|
|
+ "area": JSON.stringify(area),
|
|
|
|
+ "industry": industry.join(","),
|
|
|
|
+ "time": purchase.timeValue.trim(),
|
|
|
|
+ "payWay": purchase.payWay,
|
|
|
|
+ "orderType": 5,
|
|
|
|
+ };
|
|
|
|
+ $DoPost("/subscribepay/vipsubscribe/createOrder", param, function (r) {
|
|
|
|
+ if (r.success) {
|
|
|
|
+ onBridgeReady(JSON.parse(r.data.res), r.data.code);
|
|
|
|
+ }
|
|
|
|
+ }, false);
|
|
|
|
+ $('.vip-footer.renew .confirm').removeAttr("disabled");
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 隐藏dialog选择框
|
|
|
|
+ function hideDialog() {
|
|
|
|
+ $('#pay_way').hide(200);
|
|
|
|
+ $('#time_cycle').hide(200);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function clearSessionStorage() {
|
|
|
|
+ sessionStorage.removeItem("vipSubSelectArea");
|
|
|
|
+ sessionStorage.removeItem("vipSubSelectIndustry");
|
|
|
|
+ sessionStorage.removeItem("vipSubSelectTime");
|
|
|
|
+ sessionStorage.removeItem("vipSub_read");
|
|
|
|
+ sessionStorage.removeItem("historypushDataCache");
|
|
|
|
+ sessionStorage.removeItem("endTime");
|
|
|
|
+ sessionStorage.To_introducePage = 2;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function pickerShow(selector, f) {
|
|
|
|
+ if (f) {
|
|
|
|
+ // 添加进场动画,并显示
|
|
|
|
+ $(selector).find('.weui-mask').removeClass('weui-animate-fade-out').addClass('weui-animate-fade-in')
|
|
|
|
+ $(selector).find('.weui-picker').removeClass('weui-animate-slide-down').addClass('weui-animate-slide-up')
|
|
|
|
+ $(selector).show(300);
|
|
|
|
+ } else {
|
|
|
|
+ // 添加离场动画,并隐藏
|
|
|
|
+ $(selector).find('.weui-mask').removeClass('weui-animate-fade-in').addClass('weui-animate-fade-out')
|
|
|
|
+ $(selector).find('.weui-picker').removeClass('weui-animate-slide-up').addClass('weui-animate-slide-down')
|
|
|
|
+ $(selector).hide(300);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+</script>
|
|
|
|
+</body>
|
|
|
|
+
|
|
|
|
+</html>
|