页面是WAP页面会员等级购买,TAG切换显示。手机端根据调用相应等级与价格信息
<div class="menu"> <ul> <li id="one1" onclick="tag(‘one‘,1,‘a1‘,‘188‘)">月卡</li> <li id="one2" onclick="tag(‘one‘,2,‘a2‘,‘266‘)">季卡</li> <li id="one3" onclick="tag(‘one‘,3,‘a3‘,‘388‘)">半年卡</li> <li id="one4" onclick="tag(‘one‘,4,‘a4‘,‘520‘)">年卡</li> </ul> </div>
var id=1,price=188,act=1; //设置全局变量 function tag(name,cursel,aid,money){ for(var i=1;i<5;i++) { if(i == cursel) { window.id=cursel; window.price=money; window.act=1; $("#one"+cursel).addClass("off"); $("#con_"+name+‘_‘+cursel).show(); } else { $("#one"+i).removeClass(‘off‘); $("#con_"+name+‘_‘+i).hide(); } } //console.log("{‘id‘: "+aid+",‘price‘: "+money+",‘act‘: ‘1‘}"); //sreturn "{‘id‘: "+aid+",‘price‘: "+money+",‘act‘: ‘1‘}"; } $(function(){ $("#one1").addClass("off"); $("#con_one_1").show(); //console.log("{‘id‘: ‘a1‘,‘price‘: ‘188‘,‘act‘: ‘1‘}"); //return "{‘id‘: ‘1‘,‘price‘: ‘188‘,‘act‘: ‘1‘}"; }) function getProductId() //IOS自动调用 { //console.log(‘{"id": ‘+this.id+‘,"price": ‘+this.price+‘,"act": 1}‘); return ‘{"id": ‘+window.id+‘,"price": ‘+window.price+‘,"act": 1}‘; } function azGetProductId() //安桌自动调用 { var cs = ‘{"id": ‘+window.id+‘,"price": ‘+window.price+‘,"act": 1}‘; window.myObject.setProductId(cs); } </script>
时间: 2024-11-07 06:47:43