common.js
2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// 手机端 产品 详情 评价 切换
// if ($(window).scrollTop() <= 0) {
// function setGoodsTab1(name,cursel,n){
// // $('html,body').animate({'scrollTop':0},600);
// for(i=1;i<=n;i++){
// var menu=document.getElementById(name+i);
// var con=document.getElementById("user_"+name+"_"+i);
// menu.className=i==cursel?"on":"";
// con.style.display=i==cursel?"block":"block";
// if(cursel==2 || cursel==3) {
// var htm = $('.product_main').html();
// if ($.trim(htm) == "") {
// $.ajax({
// type: "GET",
// url: "/index.php?m=Mobile&c=goods&a=ajaxdetail&stoid=" + stoid+"&goods_id="+id,//+tab,
// success: function (data) {
// $('.product_main').html(data);
// }
// });
// }
// }
// }
// }
// 用户评论 待评价 已评价 切换
function setGoodsTab(name,cursel,n){
$('html,body').animate({'scrollTop':0},600);
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("user_"+name+"_"+i);
menu.className=i==cursel?"on":"";
con.style.display=i==cursel?"block":"none";
}
//---当点击的是商品详情---
if(cursel==2) {
var htm = $('.product_main').html();
if ($.trim(htm) == "") {
$.ajax({
type: "GET",
url: "/index.php?m=Mobile&c=goods&a=ajaxdetail&stoid=" + stoid+"&goods_id="+id,//+tab,
success: function (data) {
$('.product_main').html(data);
$("#mubiao").html(data);
}
});
}
}
//---当点击的是评价列表---
if(cursel==3) {
ajaxComment(1, 1);
}
}
// 手机端 下单页面 显示 其他选择 js效果
function showCheckoutOther(obj)
{
var otherParent = obj.parentNode;
otherParent.className = (otherParent.className=='checkout_other') ? 'checkout_other2' : 'checkout_other';
var spanzi = obj.getElementsByTagName('span')[0];
spanzi.className= spanzi.className == 'right_arrow_flow' ? 'right_arrow_flow2' : 'right_arrow_flow';
}
function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; }