Authored by tmq

Merge branch 'develop' of git.dev.yoho.cn:web/yohood into develop

... ... @@ -149,35 +149,35 @@ define('channel', function(require, exports) {
//使用瀑布流布局
setLayout();
if ($('.share').size() > 0) {
//微信分享鼠标事件
$('.yohoo-share-button-wx').on('mouseover', function() {
$('.wx-qrcode-dialog').show();
}).on('mouseout', function() {
$('.wx-qrcode-dialog').hide();
});
shareUrl = $(".share").attr("data-link");
shareCover = $(".share").attr("cover-url");
detailTitle = $('.detail-title').find('h2');
detailSubtitle = $('.detail-title').find('h3');
//分享
share.init({
shareUrl: shareUrl,
img: shareCover,
sinaText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '@YOHO!潮流志' + shareUrl,
fbTextFunction: function() {
return {
des: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
name: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
caption: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
url: location.href
}
},
tweetText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: '【YO’HOOD 2016】' + detailTitle.text() + ' ' + detailSubtitle.text() + shareUrl,
});
}
// if ($('.share').size() > 0) {
// //微信分享鼠标事件
// $('.yohoo-share-button-wx').on('mouseover', function() {
// $('.wx-qrcode-dialog').show();
// }).on('mouseout', function() {
// $('.wx-qrcode-dialog').hide();
// });
// shareUrl = $(".share").attr("data-link");
// shareCover = $(".share").attr("cover-url");
// detailTitle = $('.detail-title').find('h2');
// detailSubtitle = $('.detail-title').find('h3');
// //分享
// share.init({
// shareUrl: shareUrl,
// img: shareCover,
// sinaText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '@YOHO!潮流志' + shareUrl,
// fbTextFunction: function() {
// return {
// des: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
// name: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
// caption: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
// url: location.href
// }
// },
// tweetText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
// qqText: '【YO’HOOD 2016】' + detailTitle.text() + ' ' + detailSubtitle.text() + shareUrl,
// });
// }
// 表单验证
if ($('#index-form').length > 0) {
... ... @@ -765,6 +765,7 @@ define('channel', function(require, exports) {
$('.detail-slide-ctrl-tabs').slider();
$('.detail-slide-big-ctrl').on('click', 'a', function() {
console.log(detailSwiper.activeLoopIndex);
$('.detail-slide-ctrl-tabs').slider('slideTo', detailSwiper.activeLoopIndex);
});
$('.detail-slide-ctrl-tabs').on('click', 'li', function() {
... ...
... ... @@ -376,22 +376,22 @@ define('yohood', function(require, exports) {
//截取字符串
function cutString(str, len) {
//length属性读出来的汉字长度为1
if(str.length*2 <= len) {
if (str.length * 2 <= len) {
return str;
}
var strlen = 0;
var s = "";
for(var i = 0;i < str.length; i++) {
for (var i = 0; i < str.length; i++) {
s = s + str.charAt(i);
if (str.charCodeAt(i) > 128) {
strlen = strlen + 2;
if(strlen >= len){
return s.substring(0,s.length-1) + "...";
if (strlen >= len) {
return s.substring(0, s.length - 1) + "...";
}
} else {
strlen = strlen + 1;
if(strlen >= len){
return s.substring(0,s.length-2) + "...";
if (strlen >= len) {
return s.substring(0, s.length - 2) + "...";
}
}
}
... ... @@ -418,12 +418,12 @@ define('yohood', function(require, exports) {
$.each(brands, function(k, v) {
html += '<li><a href="javascript:;" target="_blank" title="' + v.name + '"><div class="img-box" brand_id="' + v.id + '">' +
'<img class="grey-brand-logo" width="145" height="97" src="' + common.getImages(v.logo, 'source', 'blogimg', 'primary') + '" alt="" alt="' + v.name + '"></div>' +
'<p>' + cutString(v.name,20) + '</p></a></li>';
'<p>' + cutString(v.name, 20) + '</p></a></li>';
});
$(".brand-content").html(template.replace('{li}', html));
} else {
$(".brand-content").html("");
$(".brand-content").html(noSearchTemplate.replace('{brand}', tools.escapeHTML(brand).replace(/\"/g,"“").replace(/\'/g,"‘")));
$(".brand-content").html(noSearchTemplate.replace('{brand}', tools.escapeHTML(brand).replace(/\"/g, "“").replace(/\'/g, "‘")));
}
}
});
... ... @@ -464,7 +464,7 @@ define('yohood', function(require, exports) {
$('body').on('click', '.brand-close-btn', function() {
$('.overlay').trigger('click');
});
if($(".search-btn").size()) {
if ($(".search-btn").size()) {
$(".search-btn").click();
}
};
... ... @@ -479,12 +479,13 @@ define('yohood', function(require, exports) {
nowIndex;
if ($('.share').size() > 0) {
//微信分享鼠标时间
//微信分享鼠标事件
$('.yohoo-share-button-wx').on('mouseover', function() {
$('.wx-qrcode-dialog').show();
}).on('mouseout', function() {
$('.wx-qrcode-dialog').hide();
});
shareUrl = $(".share").attr("data-link");
shareCover = $(".share").attr("cover-url");
detailTitle = $('.detail-title').find('h2');
... ... @@ -493,19 +494,20 @@ define('yohood', function(require, exports) {
share.init({
shareUrl: shareUrl,
img: shareCover,
sinaText: '【YOHOOD 2015】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '@YOHO潮流志',
sinaText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '@YOHO!潮流志' + shareUrl,
fbTextFunction: function() {
return {
des: '【YOHOOD 2015】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
name: '【YOHOOD 2015】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
caption: '【YOHOOD 2015】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
des: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
name: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
caption: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
url: location.href
}
},
tweetText: '【YOHOOD 2015】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: '【YOHOOD 2015】' + detailTitle.text() + ' ' + detailSubtitle.text() + '#YOHOOD 2015'
tweetText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: '【YO’HOOD 2016】' + detailTitle.text() + ' ' + detailSubtitle.text() + shareUrl,
});
}
//详情页图片滚动
if ($('.detail-slide').size() > 0) {
//slide大图上的左右箭头显示
... ... @@ -532,7 +534,8 @@ define('yohood', function(require, exports) {
slideClass: 'box',
loop: true,
slidesPerView: 'auto',
slideElement: 'li'
slideElement: 'li',
loopedSlides: $(".detail-slide-ctrl-tabs").find(".box").size()
});
$('.slide-big-ctrl-prev,.slide-shadow-prev').bind('click', function(e) {
... ... @@ -550,11 +553,51 @@ define('yohood', function(require, exports) {
$('.detail-slide-ctrl-tabs').on('click', 'li', function() {
detailSwiper.swipeTo($(this).index());
});
({
detialImgZoom: $('.detail-slide-body').find('.box').each(function() {
$(this).imgZoom({
imgTag: 'pic-tip',
});
}),
init: function() {
$(".img-zoom-ctrl-prev").on("click", function(event) {
event.preventDefault();
$('.slide-big-ctrl-prev').click();
$(".detail-slide-body .swiper-slide-active").find("img").click();
});
$(".img-zoom-ctrl-next").on("click", function(event) {
event.preventDefault();
$('.slide-big-ctrl-next').click();
$(".detail-slide-body .swiper-slide-active").find("img").click();
});
}
//侧栏推荐切换
clearInterval(timer);
}).init();
function postSwitch() {
}
/**
* 详情页面侧边栏 最新信息 切换
*/
({
/**
* setIimeout编号 以便清除
* @type {Number}
*/
setTimeoutNum: 0,
/**
* 自动切换时间
* @type {Number}
*/
autoSwitchTime: 5000,
/**
* 自动切换标签
* @return {Undefined}
*/
autoSwitch: function() {
$('.side-related-tab').find('a').each(function(i) {
if ($(this).hasClass('current')) {
$(this).removeClass('current');
... ... @@ -563,24 +606,36 @@ define('yohood', function(require, exports) {
$('.side-related-list').hide().eq(i).show();
}
});
}
timer = setInterval(function() {
postSwitch();
}, 5000);
this.setTimeoutNum = setTimeout(this.autoSwitch, this.autoSwitchTime);
},
init: function() {
var that = this;
// 鼠标移入 停止自动切换 移出 开始自动切换
$('.side-related-post').on('mouseenter', function() {
clearInterval(timer);
clearTimeout(that.setTimeoutNum);
}).on('mouseleave', function() {
timer = setInterval(function() {
postSwitch();
}, 5000);
})
that.autoSwitch();
});
// 点击标签 切换信息
$('.side-related-tab').on('click', 'a', function() {
nowIndex = $(this).index();
if ($(this).hasClass('current')) return;
nowIndex = $(this).index(".side-related-tab a");
if ($(this).hasClass('current')) {
return;
}
$(this).addClass('current').siblings().removeClass('current');
$('.side-related-list').hide().eq(nowIndex).show();
});
// 开始自动切换
this.autoSwitch();
}
}).init();
//分享按钮位置
var shareOffsetTop = $(".share").offset().top;
$(window).scroll(function() {
... ... @@ -656,22 +711,22 @@ define('yohood', function(require, exports) {
//截取字符串
function cutString(str, len) {
//length属性读出来的汉字长度为1
if(str.length*2 <= len) {
if (str.length * 2 <= len) {
return str;
}
var strlen = 0;
var s = "";
for(var i = 0;i < str.length; i++) {
for (var i = 0; i < str.length; i++) {
s = s + str.charAt(i);
if (str.charCodeAt(i) > 128) {
strlen = strlen + 2;
if(strlen >= len){
return s.substring(0,s.length-1) + "...";
if (strlen >= len) {
return s.substring(0, s.length - 1) + "...";
}
} else {
strlen = strlen + 1;
if(strlen >= len){
return s.substring(0,s.length-2) + "...";
if (strlen >= len) {
return s.substring(0, s.length - 2) + "...";
}
}
}
... ... @@ -680,15 +735,16 @@ define('yohood', function(require, exports) {
var recom = '';
var hotVideo = '';
var lastNews = '';
var template = function(topic, img, url, isVideo, isTitleStyle, title, imgStyle,create_time) {
var template = function(topic, img, url, isVideo, isTitleStyle, title, imgStyle, create_time) {
var playIcon = '';
var titleStyle = '';
function getLocalTime(nS) {
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' ');
}
var d = getLocalTime(create_time);
var type='<span class="item-time"><?php $en = array("01"=>"January","02"=>"February","03"=>"March","04"=>"April","05"=>"May","06"=>"June","07"=>"July","08"=>"August","09"=>"September","10"=>"October","11"=>"November","12"=>"December");$m=date("m", '+create_time+');echo $en[$m]?>&nbsp;&nbsp;&nbsp;<?php ECHO $m=date("d.Y", '+create_time+')?></span>';
var title = $('<p>' + cutString(title,60) + '</p>').text();
var type = '<span class="item-time"><?php $en = array("01"=>"January","02"=>"February","03"=>"March","04"=>"April","05"=>"May","06"=>"June","07"=>"July","08"=>"August","09"=>"September","10"=>"October","11"=>"November","12"=>"December");$m=date("m", ' + create_time + ');echo $en[$m]?>&nbsp;&nbsp;&nbsp;<?php ECHO $m=date("d.Y", ' + create_time + ')?></span>';
var title = $('<p>' + cutString(title, 60) + '</p>').text();
var html = '<div class="layout-item clearfix">' +
'<div class="image-box">' +
'<a href="' + url + '" target="_blank" title="' + title + '">' +
... ... @@ -858,44 +914,37 @@ define('yohood', function(require, exports) {
return this.optional(element) || (mobile.test(value));
}, "请正确填写您的手机号");
$(".content-header a").bind("click", function(e)
{
$(".content-header a").bind("click", function(e) {
var href = $(this).attr("href");
var isNotEmpty = false;
//判断表单数据是否为空
$.each($("input[type=text]"), function(i, obj)
{
if($.trim($(obj).val()) != '')
{
$.each($("input[type=text]"), function(i, obj) {
if ($.trim($(obj).val()) != '') {
isNotEmpty = true;
return;
}
});
if(isNotEmpty) {
$(this).attr("href","javascript:void(0)");
if(window.confirm('切换后已填信息将被清空,是否切换?'))
{
if (isNotEmpty) {
$(this).attr("href", "javascript:void(0)");
if (window.confirm('切换后已填信息将被清空,是否切换?')) {
window.location.href = href;
}
else
{
} else {
$(this).attr("href", href);
return false;
}
}
});
$(".apply-operate span").bind("click", function()
{
$(".apply-operate span").bind("click", function() {
window.location.href = $(this).attr("href");
});
// 弹窗关闭
$('.dialog-w').click(function () {
$('.dialog-w').click(function() {
$('.dialog-w').hide();
window.location.reload();
});
$('.dia-content').click(function (e) {
$('.dia-content').click(function(e) {
$('.dialog-w').hide();
window.location.reload();
e.stopPropagation();
... ... @@ -914,16 +963,16 @@ define('yohood', function(require, exports) {
uploader: '/onlinereg/uploadfile',
width: 120,
dataType: 'json',
onSelect: function (file) {
onSelect: function(file) {
if (file.size * 1 > (1024*1024*10)) {
if (file.size * 1 > (1024 * 1024 * 10)) {
$('.upload-tips').addClass('error');
$("#upload-file").uploadify('cancel');
}
},
onUploadSuccess : function(file, data, response) {
onUploadSuccess: function(file, data, response) {
//console.log(file);
data = json.parse(data);
$('.has-upload span').html(file.name + '<b class="del-file"></b>');
... ... @@ -936,7 +985,7 @@ define('yohood', function(require, exports) {
}
});
$(document).on('click', '.del-file', function () {
$(document).on('click', '.del-file', function() {
$('#file-url').val('');
... ... @@ -945,25 +994,20 @@ define('yohood', function(require, exports) {
});
// 验证码刷新
$('.pic-code-text').click(function () {
$('.pic-code-text').click(function() {
var src = $(this).attr('src');
$(this).attr('src', src + '?1');
});
function getFormData (callback) {
function getFormData(callback) {
var $formBox;
if($('#exhibitor-form').length> 0)
{
if ($('#exhibitor-form').length > 0) {
$formBox = $('#exhibitor-form');
}
else if($('#media-form').length> 0)
{
} else if ($('#media-form').length > 0) {
$formBox = $('#media-form');
}
else if($('#sponsor-form').length> 0)
{
} else if ($('#sponsor-form').length > 0) {
$formBox = $('#sponsor-form');
}
var name = $formBox.find('input[name="name"]').val(),
... ... @@ -994,15 +1038,15 @@ define('yohood', function(require, exports) {
name: name,
is_enter_yohobuy: is_enter_yohobuy,
brand_reg_type: brand_reg_type,
profession:profession,
product_type:product_type,
company:company,
country:country,
sex:sex,
city:city,
mobile:mobile,
profession: profession,
product_type: product_type,
company: company,
country: country,
sex: sex,
city: city,
mobile: mobile,
contact: contact,
introduction:introduction,
introduction: introduction,
telphone: telphone,
email: email,
relation: relation,
... ... @@ -1010,14 +1054,14 @@ define('yohood', function(require, exports) {
is_3c: is_3c,
website: website,
files: files,
zipcode:zipcode,
zipcode: zipcode,
code: code,
type: type
};
callback(resData);
}
function vCode (callback) {
function vCode(callback) {
$.ajax({
type: 'post',
dataType: 'json',
... ... @@ -1025,7 +1069,7 @@ define('yohood', function(require, exports) {
data: {
code: $('.pic-code').val()
},
success: function (d) {
success: function(d) {
if (d.code === 200) {
... ... @@ -1040,7 +1084,7 @@ define('yohood', function(require, exports) {
}
});
}
$('.pic-code').keyup(function () {
$('.pic-code').keyup(function() {
if ($(this).val().length === 4) {
vCode();
}
... ... @@ -1048,7 +1092,7 @@ define('yohood', function(require, exports) {
// 表单验证
if ($('#exhibitor-form').length > 0) {
$('.submit-w-btn').bind('click', function(){
$('.submit-w-btn').bind('click', function() {
var exhibitorForm = $('#exhibitor-form').validate({
focusInvalid: false,
... ... @@ -1059,76 +1103,76 @@ define('yohood', function(require, exports) {
contact: {
required: true
},
is_enter_yohobuy:{
is_enter_yohobuy: {
required: true
},
brand_reg_type:{
brand_reg_type: {
required: true
},
relation:{
relation: {
required: true
},
is_3c :{
is_3c: {
required: true,
},
telphone: {
required: true,
isPhone:true
isPhone: true
},
place: {
required: true
},
email:{
email:true
email: {
email: true
},
code:{
required:true,
minlength:4,
maxlength:4
code: {
required: true,
minlength: 4,
maxlength: 4
},
website:{
url:true
website: {
url: true
}
},
messages: {
name: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
contact: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
is_enter_yohobuy:{
is_enter_yohobuy: {
required: '必选'
},
brand_reg_type:{
brand_reg_type: {
required: '必选'
},
relation:{
relation: {
required: '必选'
},
is_3c: {
required: '必选'
},
telphone: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填',
isPhone: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid telphone': '联系电话不正确'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填',
isPhone: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid telphone' : '联系电话不正确'
},
place: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
email: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid email address': '邮箱格式不正确',
code:{
email: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid email address' : '邮箱格式不正确',
code: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter enter a verification code' : "必须输入验证码",
minlength: $(".submit-w-btn").attr('lang') == 'en' ? 'Verification code length 4' : "验证码长度4位",
maxlength: $(".submit-w-btn").attr('lang') == 'en' ? 'Verification code length 4' : "验证码长度4位"
},
website:{
url:$(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid link':"必须是有效链接"
website: {
url: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid link' : "必须是有效链接"
}
},
submitHandler: function(form){
submitHandler: function(form) {
getFormData(function (data) {
getFormData(function(data) {
$.ajax({
type: 'post',
dataType: 'json',
... ... @@ -1136,8 +1180,8 @@ define('yohood', function(require, exports) {
data: {
name: data.name,
company: data.company,
is_enter_yohobuy:data.is_enter_yohobuy,
brand_reg_type:data.brand_reg_type,
is_enter_yohobuy: data.is_enter_yohobuy,
brand_reg_type: data.brand_reg_type,
contact: data.contact,
telphone: data.telphone,
email: data.email,
... ... @@ -1149,16 +1193,15 @@ define('yohood', function(require, exports) {
code: data.code,
type: data.type
},
success: function (d) {
success: function(d) {
if (d.code === 200) {
$('.dialog-w').fadeIn();
setTimeout(function () {
setTimeout(function() {
$('.dialog-w').fadeOut();
window.location.reload();
}, 2000);
}
else {
} else {
alert(d.message);
}
}
... ... @@ -1178,7 +1221,7 @@ define('yohood', function(require, exports) {
//媒体登记
if ($('#media-form').length > 0) {
$('.submit-w-btn').bind('click', function(){
$('.submit-w-btn').bind('click', function() {
var mediaForm = $('#media-form').validate({
focusInvalid: false,
... ... @@ -1186,115 +1229,115 @@ define('yohood', function(require, exports) {
name: {
required: true
},
profession:{
required:true
profession: {
required: true
},
sex:{
required:true
sex: {
required: true
},
company:{
required:true
company: {
required: true
},
introduction: {
required: true,
maxlength: 200
},
mobile: {
required:true,
isMobile:true
required: true,
isMobile: true
},
telphone:{
telphone: {
required: true,
isPhone:true
isPhone: true
},
place: {
required: true
},
city:{
city: {
required: true
},
email:{
email: {
required: true,
email:true
email: true
},
code:{
required:true,
minlength:4,
maxlength:4
code: {
required: true,
minlength: 4,
maxlength: 4
},
website:{
required:true,
url:true
website: {
required: true,
url: true
},
zipcode:{
required:true
zipcode: {
required: true
}
},
messages: {
name: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
profession:{
required:$(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
profession: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
sex:{
required:$(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
sex: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
company:{
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
company: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
introduction: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填',
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填',
maxlength: '最多输入200个字符'
},
mobile: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填',
isMobile: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid mobile': '手机号码不正确'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填',
isMobile: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid mobile' : '手机号码不正确'
},
telphone:{
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填',
isPhone: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid telphone': '联系电话不正确'
telphone: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填',
isPhone: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid telphone' : '联系电话不正确'
},
place: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
city:{
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
city: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
email: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填',
email: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid email address': '邮箱格式不正确'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填',
email: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid email address' : '邮箱格式不正确'
},
code:{
code: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter enter a verification code' : "必须输入验证码",
minlength: $(".submit-w-btn").attr('lang') == 'en' ? 'Verification code length 4' : "验证码长度4位",
maxlength: $(".submit-w-btn").attr('lang') == 'en' ? 'Verification code length 4' : "验证码长度4位"
},
website:{
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填',
url: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid link':"必须是有效链接"
website: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填',
url: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid link' : "必须是有效链接"
},
zipcode:{
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
zipcode: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
}
},
submitHandler: function(form){
submitHandler: function(form) {
getFormData(function (data) {
getFormData(function(data) {
$.ajax({
type: 'post',
dataType: 'json',
url: '/onlinereg/setseller',
data: {
name: data.name,
profession:data.profession,
sex:data.sex,
profession: data.profession,
sex: data.sex,
company: data.company,
introduction:data.introduction,
city:data.city,
introduction: data.introduction,
city: data.city,
contact: data.contact,
telphone: data.telphone,
mobile:data.mobile,
mobile: data.mobile,
email: data.email,
relation: data.relation,
place: data.place,
... ... @@ -1302,19 +1345,18 @@ define('yohood', function(require, exports) {
website: data.website,
files: data.files,
code: data.code,
zipcode:data.zipcode,
zipcode: data.zipcode,
type: data.type
},
success: function (d) {
success: function(d) {
if (d.code === 200) {
$('.dialog-w').fadeIn();
setTimeout(function () {
setTimeout(function() {
$('.dialog-w').fadeOut();
window.location.reload();
}, 2000);
}
else {
} else {
alert("失败");
}
}
... ... @@ -1333,67 +1375,66 @@ define('yohood', function(require, exports) {
//赞助商
if ($('#sponsor-form').length > 0) {
$('.submit-w-btn').bind('click', function()
{
$('.submit-w-btn').bind('click', function() {
var sponsorForm = $('#sponsor-form').validate({
focusInvalid: false,
rules: {
name: {
required: true
},
is_enter_yohobuy:{
is_enter_yohobuy: {
required: true
},
telphone: {
required: true,
isPhone:true
isPhone: true
},
email:{
email:true
email: {
email: true
},
code:{
required:true,
minlength:4,
maxlength:4
code: {
required: true,
minlength: 4,
maxlength: 4
},
website:{
url:true
website: {
url: true
}
},
messages: {
name: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填'
},
is_enter_yohobuy:{
is_enter_yohobuy: {
required: '必选'
},
telphone: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field': '必填',
isPhone: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid telphone': '联系号码不正确'
required: $(".submit-w-btn").attr('lang') == 'en' ? 'This is a required field' : '必填',
isPhone: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid telphone' : '联系号码不正确'
},
email: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid email address': '邮箱格式不正确',
code:{
email: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid email address' : '邮箱格式不正确',
code: {
required: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter enter a verification code' : "必须输入验证码",
minlength: $(".submit-w-btn").attr('lang') == 'en' ? 'Verification code length 4' : "验证码长度4位",
maxlength: $(".submit-w-btn").attr('lang') == 'en' ? 'Verification code length 4' : "验证码长度4位"
},
website:{
url: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid link':"必须是有效链接"
website: {
url: $(".submit-w-btn").attr('lang') == 'en' ? 'Please enter a valid link' : "必须是有效链接"
}
},
submitHandler: function(form){
submitHandler: function(form) {
getFormData(function (data) {
getFormData(function(data) {
$.ajax({
type: 'post',
dataType: 'json',
url: '/onlinereg/setseller',
data: {
name: data.name,
is_enter_yohobuy:data.is_enter_yohobuy,
product_type:data.product_type,
is_enter_yohobuy: data.is_enter_yohobuy,
product_type: data.product_type,
company: data.company,
country:data.country,
country: data.country,
contact: data.contact,
telphone: data.telphone,
email: data.email,
... ... @@ -1403,16 +1444,15 @@ define('yohood', function(require, exports) {
code: data.code,
type: data.type
},
success: function (d) {
success: function(d) {
if (d.code === 200) {
$('.dialog-w').fadeIn();
setTimeout(function () {
setTimeout(function() {
$('.dialog-w').fadeOut();
window.location.reload();
}, 2000);
}
else {
} else {
alert("失败");
}
}
... ... @@ -1429,44 +1469,44 @@ define('yohood', function(require, exports) {
}
$('#sponsor-form').find('input').keyup(function () {
$('#sponsor-form').find('input').keyup(function() {
// console.log(sponsorForm.form());
// console.log(sponsorForm.form());
// if(sponsorForm.form()) {
// if(sponsorForm.form()) {
vCode(function (data) {
vCode(function(data) {
if (data.code == 200) {
$('.submit-w-btn').removeAttr('disabled').removeClass('dis');
}
});
// }
// }
});
$('#media-form').find('input').keyup(function () {
$('#media-form').find('input').keyup(function() {
//if(mediaForm.form()) {
//if(mediaForm.form()) {
vCode(function (data) {
vCode(function(data) {
if (data.code == 200) {
$('.submit-w-btn').removeAttr('disabled').removeClass('dis');
}
});
// }
// }
});
$('#exhibitor-form').find('input').keyup(function () {
$('#exhibitor-form').find('input').keyup(function() {
// if(true){//exhibitorForm.form()) {
vCode(function (data) {
// if(true){//exhibitorForm.form()) {
vCode(function(data) {
if (data.code == 200) {
$('.submit-w-btn').removeAttr('disabled').removeClass('dis');
}
});
// }
// }
});
}
... ...
... ... @@ -180,6 +180,17 @@
</li>
</ul>
</div>
<!-- 点击图片显示大图 start -->
<div class="detial-img-zoom">
<div class="img-zoom ">
<img src="">
<a href="javascript:;" class="close-btn"></a>
<a href="javascript:;" class="img-zoom-ctrl-prev iconfont">&#xe600;</a>
<a href="javascript:;" class="img-zoom-ctrl-next iconfont">&#xe602;</a>
</div>
<div class="overlay"></div>
</div>
<!-- 点击图片显示大图 end -->
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<script type="text/javascript">
... ... @@ -189,7 +200,6 @@
})
seajs.use(['jquery', 'channel'], function($, channel) {
channel.common();
channel.detail();
})
</script>
<?php $this->_endblock();?>
\ No newline at end of file
... ...