agreement.page.js 1.18 KB
/**
 * 服务协议
 * @author: zxr
 * @date: 2016/10/27
 */
var $ = require('yoho-jquery');
var appVersion = $('input[name="app_version"]').val();

require('../common');
var yoho = require('../yoho-app');


$('.pitch').on('click', function() {
    if ($('.pitch').hasClass('select')) {
        $(this).removeClass('select');
        $(this).html('');
    } else {
        $(this).addClass('select');
        $(this).html('');
    }
});

$('.submit-btn').on('click', function() {
    if ($('.pitch').hasClass('select')) {
        if (appVersion === '1') {
            $(this).attr('href', '//m.yohobuy.com/passport/reg/password?openby:yohobuy={"action":"go.productDetail","params":{"selected":"Y"}}');
        } else {
            $(this).attr('href', '//m.yohobuy.com/passport/reg/password' + window.location.search + '&selected=Y');
        }
    } else {
        if (appVersion === '1') {
            $(this).attr('href', '//m.yohobuy.com/passport/reg/password?openby:yohobuy={"action":"go.productDetail","params":{"selected":"N"}}');
        } else {
            $(this).attr('href', '//m.yohobuy.com/passport/reg/password' + window.location.search + '&selected=N');
        }
    }
});