File size: 4,408 Bytes
3b8d454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
$(function(){
	tabFlagMap["shop"] = false;
	tabFuncMap.shop = function(){
		var index = 1;
		$.each(shopoddsdata,function(key,map){
			
			var gate = gatetable[map.ID];
			if(gate){
				var tr = $("<tr align='center'></tr>");
				$("#shopTable tbody").append(tr);
				var shopItemTd = $("<td style='text-align:right;'></td>");
				var shopPriceTd = $("<td style='text-align:left;'></td>");
				var shopName = $("<td><span style='color:brown;font-size:2rem;'>"+gate.NAME+"</span></td>").append("<span style='display:none;'>"+gate.PY+"</span>");
				var ticket = gate["门票"];
				var ticketRefresh = gate["刷新票"];
				var discover = gate["发现"];
				var unlock = gate["解锁"];
				if(discover > 0) {
					shopName.append("<br>发现:").append(findMapTips(discover));
				}
				if(unlock > 0) {
					shopName.append("<br>解锁:").append(findMapTips(unlock));
				}
				if(ticket > 0) {
					shopName.append("<br>门票:").append(findMapTips(ticket));
				}
				if(ticketRefresh > 0) {
					shopName.append("<br>刷新票:").append(findMapTips(ticketRefresh));
				}
				tr.append($("<td>"+map.INDEX+"</td>"));
				tr.append(shopName);
				tr.append(shopItemTd);
				tr.append(shopPriceTd);
				for(var i=1;i<=10;i++){
					var shopOdds = map["商品"+i];
					var shopItem = shopitemdata[map["商品"+i].split(":")[0]];
					var shopItemDiv = $("<div></div>");//需要空白占位
					shopItemTd.append(shopItemDiv);
					var shopPriceDiv = $("<div></div>");//需要空白占位
					shopPriceTd.append(shopPriceDiv);
					shadow(shopItemDiv,shopPriceDiv);

					if(shopOdds){
						if(shopItem){
							//区分是道具还是随机数据
							if(shopItem['道具ID']>0){
								var item = findMapTips(shopItem['道具ID']);
								shopItemDiv.append(item);
								if(item.html() == ""){
									shopItemDiv.append("商品数据缺失:"+map["商品"+i]);
								}
							}else{
								var item = shopItem.NAME;
								shopItemDiv.append(item);
							}
							//区分是金钱购买还是道具换购
							
							if(shopItem["货币类型"] == "0"){
								var price = shopItem["价格"];
								if(price< 10000){
									
								}else if(price < 100000000){
									price = price / 10000;
									price += "万";
								}else{
									price = price / 100000000;
									price += "亿";
								}
								shopPriceDiv.append("&nbsp;=&nbsp;<span><img src='../images/BagIcon.png' width='18'>"+price+"</span>");
							}else{
								var item = findMapTips(shopItem["货币类型"]).prepend("&nbsp;=&nbsp;");
								shopPriceDiv.append(item.append(" × "+shopItem["价格"]).append(""));
								if(item.html() == ""){
									shopPriceDiv.append("货币数据缺失:"+map["商品"+i]);
								}
							}
						}
					}
					
				}
				
				
			}

		});
		/*shopTable*/
		$('#shopTable').dataTable( {
			"pagingType":   "full_numbers",
			"language": {
				 "lengthMenu": "每页 _MENU_ 条记录",
				 "zeroRecords": "没有找到商品,一定是你没充值VIP!",
				 "info": "第 _PAGE_ 页 ( 总共 _PAGES_ 页 )",
				 "infoEmpty": "空荡荡的没有商品",
				 "infoFiltered": "(从 _MAX_ 条商品过滤)",
				 "search":       "搜索(可用<font color='red'>商店名称</font>首字母):",
				 "paginate": {
					"first":      "首页<font color=red>(W)</font>",
					"last":       "末页<font color=red>(S)</font>",
					"next":       "下一页<font color=red>(D)</font>",
					"previous":   "上一页<font color=red>(A)</font>"
					},
			},
			// 默认按照索引排序,且隐藏索引列
			"order": [[ 0, "asc" ]],
			"columnDefs": [ 
			  {
				"targets": [ 0 ],
				"visible": false,
				"searchable": false
			  },
			]
		  });
		$('#shopTable th:nth(0)').css("text-align","center");
		$('#shopTable th:nth(1)').css("text-align","right");
		$('#shopTable th:nth(2)').css("text-align","left");
		
	}
});
//悬停阴影
function shadow(item,price){
	//
	item.mouseenter(function(){
		item.css("background-color","#E6E6E6");
		price.css("background-color","#E6E6E6");
	});
	item.mouseleave(function(){
		item.css("background-color","");
		price.css("background-color","");
	});
	//
	price.mouseenter(function(){
		item.css("background-color","#E6E6E6");
		price.css("background-color","#E6E6E6");
	});
	price.mouseleave(function(){
		item.css("background-color","");
		price.css("background-color","");
	});
}