index.html 27.6 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 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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835
<script type="text/javascript" src="__PUBLIC__/js/rem_new.js"></script>
<!DOCTYPE html >
<html>
<head>
	<head>
		<meta charset="UTF-8">
		<title>会员中心</title>

		<include file="public/header" />
		<link rel="stylesheet" href="__STATIC__/css/user_index.css?v=__CSSVERSION__">
		<link rel="stylesheet" href="__STATIC__/css/public.css?v=__CSSVERSION__">
		<link rel="stylesheet" type="text/css" href="__STATIC__/swiper/css/swiper.min.css"/>
		<script type="text/javascript" src="__STATIC__/swiper/js/swiper.min.js"></script>
		<!--<script type="text/javascript" src="__STATIC__/js/my_msg.js"></script>-->
		<include file="public/my_msg"/>

		<style>

			.code {
				background: rgba(0, 0, 0, 0) url(__STATIC__/images/index/rect.png) no-repeat scroll center center / cover ;
				height: 200px;	margin: 20px auto;width: 200px;}
			.code img {height: 90%;margin: 5% auto;width: 90%;}
			.userhead {
				border-radius: 50%;
				position: absolute;
				right: -10px;
				top:0;
				width:20px ;
				height: 20px;
				padding:3px;
				background:#ea5551 url(__STATIC__/images/user/userhead.png)  no-repeat scroll center center / 18px 13.2px;
				border:2px solid #fff;
			}
			.rel{
				position: relative;
			}

			.erpapp{width:100%; height:50px; background-color:#ca3043;}
			.erpapp img{height:30px; width:30px;border-radius: 30px;margin: 10px;display: inline-block;vertical-align: top;}
			.erptext{color:#fff;line-height: 50px;width: 50%;display: inline-block;height: 50px;}
			.openapp{background-color: #fff;color: #c93145;border-radius: 5px;display: inline-block;margin: 12px;vertical-align:top;
				height: 25px;width: 70px;text-align: center;line-height: 25px;margin-right: 0;margin-left: 0; float: right;margin-right: 20px;}

			#ni_ka_show{margin-bottom: 0.05rem; padding: 0 0.12rem; height:0.28rem;
				background-color: #333; font-size: 0.15rem; border-radius: 0.3rem;}
			#ni_ka_show img{ width: 0.2rem; height: 0.17rem;  margin-right: 0.01rem;position: relative;top: -0.02rem;}
			.fs022{color: #333}

			/*修改 left,width   20170327*/
			.qq_content{width: 70%;background-color: #fff}
			.qq_content li {
				border-bottom: 1px solid #f0f2f5;
				height: 45px;
				line-height: 45px;
				font-size: 16px;
				color: #666;
				width: 100%;
				text-align:center;
				overflow: hidden;
			}

				/*---等级卡的名称--*/
			.dj_user_name{
                display: inline-block;; max-width: 1.8rem;
			}
			.xc-goods-frame4{
				padding-top: 0.2rem;
			}
			.qq_ny_close{ width:0.3rem; height: 0.3rem; border: 1px solid #fff; color: #fff; text-align: center; line-height: 0.3rem; margin-top: 0.1rem; font-size: 0.25rem}
             .xc-swiper-left{
                 border-top: 0.01rem solid ;border-right: 0.01rem solid ;transform: rotate(225deg);
                 display:inline-block;width: 0.2rem;height: 0.2rem;border-color:#000;margin-top: 0.3rem;margin-left: 0.06rem;
             }
              .xc-swiper-right{
                  width: 0.2rem;height: 0.2rem;border-color:#000;margin-top: 0.3rem;
                  margin-right: 0.02rem;
              }
			.floor_body2{
				width: 100%;
			}
			.floor_body2 ul li{
				display: inline-block;
				width: 47%;
			}
			.birthday-frame{
				width: 100%;
				height: 80px;
			}
			.birthday-frame img{
				width: 95%;
				height: 100%;
				border-radius: 10px 10px 0px 0px;
			}
			.mp_swiper{
				border-bottom: 0.1rem solid #f2f2f2;
			}



			.my_pri .mp_title img.loading{width: 0.3rem;height: 0.3rem;margin-right: 10px;}

        </style>

<body style="background: #eee;">

<!--<div id="all_div">-->
<if condition="$ylpres">
	<div class=" erpapp">
		<img  src="{$ylpres['appIcon']}">
		<span class="cut erptext" style="">{$ylpres['appName']}欢迎你</span>
		<span class="openapp" onclick="javascript:window.location.href='{$ylpres.downLoadUrl}'">打开APP</span>
	</div>
</if>

<div id="tbh5v0">
	<div class="user_com background">
		<div class="member-top">
			<!-- 会员顶部 -->
			<div class="com_tops">
				<!--<img class="b_img" src="__WEBPUBLIC__//miniapp/images/user_index_powder.jpg">-->
				<?php
						use think\Db;
						$stoid=I('stoid');
						$ad= Db::query("select * from wxd_ad where pid=401 and enabled = 1 and start_time <= " . time() ." and end_time >= " . time() . " and store_id=".$stoid);
						if(empty($ad)){
						   echo '<img class="b_img" src="__WEBPUBLIC__//miniapp/images/user_index_powder.jpg">';
						}else{
						   echo "<img class='b_img' src='".getimg($ad[0][ad_code],'/template/mobile/new/static/images/userbg.jpg')."'  border='0'/>";
				           echo "<div class='box asb' style='background-color: rgba(9,9,9,0.15);border-radius: 0.1rem'></div>";
						}
				?>

				<div class="box">
					<div style="width: 88%;margin: auto">
						<div class="fir_lev flex jc_sb">
							<div class="one flex ai_center" style="width: 90%">

								<a href="{:U('Mobile/User/userinfo',array('stoid'=>$Think.request.stoid))}">
									<div><img class="b_circle" src="{$user.head_pic}"></div>
								</a>

								<div class="username">
									<p class="flex"  style="font-size: 0.25rem;">
										<span class="dj_user_name ellipsis-1">{$user.nickname}&nbsp;</span>
										<span id="ni_ka_show"class="flex ai_center" style="display: none">
												  <img src="__STATIC__/images/weixin/vip_hg0.png"/><font id="cur_ka_name" style="color:#e6be76;margin-left: 0.05rem"></font>
											  </span></p>
									<a href="{:U('Mobile/user/gorw_up_details',['stoid'=>$Think.request.stoid,'id'=>$collocation.id,'goods_id'=>I('id')])}">
										<div class="flex"id="grow_up" style="font-size: 0.2rem;margin-top: 0.03rem; display:none">

											<p class="xc_grow_up_val fc flex ai_center jc_center">成长值</p>
											<font id="cz_val_txt" class="fc"></font><font id="bili" class="dn fc"> / </font><font id="czf_val"class="fc"></font>

										</div>
									</a>
								</div>

							</div>

							<div class="two">
								<img src="__WEBPUBLIC__//miniapp/images/qrcode1.png" id="openwx">
							</div>
						</div>

						<div class="sec_lev flex ai_center jc_sb fs02" style="width: 97%;">
							<div class="item" onClick="javascript:window.location.href='{:U('Mobile/User/money',array('stoid'=>$Think.request.stoid))}'" >
								<div>{$liudong_money}</div>
								<div style="margin-top: 0.15rem;">余额</div>
							</div>
							<if condition="$pm_erpid">
								<div class="item" onClick="javascript:window.location.href='{:U('Mobile/User/money_1',array('stoid'=>$Think.request.stoid))}'">
									<div id="ycVIPSum" ><img src="__STATIC__/images/category/loader.gif" class="f_load" width="20" />&nbsp;</div>
									<div style="margin-top: 0.15rem;">预存款</div>
								</div>
							</if>
							<div class="item" onClick="javascript:window.location.href='{:U('Mobile/User/points',array('stoid'=>$Think.request.stoid))}'" >
								<div id="fIntegral"><img src="__STATIC__/images/category/loader.gif" class="f_load" width="20" />&nbsp;</div>
								<div style="margin-top: 0.15rem;">积分</div>
							</div>
							<div class="item" onClick="javascript:window.location.href='{:U('Mobile/User/coupon',array('stoid'=>$Think.request.stoid))}'" >
								<div id="fqnum" ><img src="__STATIC__/images/category/loader.gif" class="f_load" width="20" />&nbsp;</div>
								<div style="margin-top: 0.15rem;">优惠券</div>
							</div>

						</div>
					</div>
				</div>
			</div>

			<if condition="$cardvip">
				<div class="add_member flex jc_center ai_center "
					 onclick="go_card(this)"
					 href="{:U('Mobile/User/vipcard',array('stoid'=>$Think.request.stoid))}"
					 style="background: url('__STATIC__/images/user_card/crad_ba.jpg')no-repeat;background-size:100% 100%; ">
					<div class="flex frame fc jc_sb">
						<div class="flex ai_center" style="height: 0.35rem">
							<img src="__STATIC__/images/user_card/user_vip.png" >
							<div style="white-space:nowrap;color: #f6d4b1">加入会员|预计可省3031元</div>
						</div>
						<div class="opening ">立即开通</div>
					</div>
				</div>
		   </if>


			<if condition="$card_out">
				<div class="add_member flex jc_center ai_center "
					 onclick="go_card(this)"
					 href="{:U('Mobile/User/cardinfo',array('stoid'=>$Think.request.stoid))}"
					 style="background: url('__STATIC__/images/user_card/crad_ba.jpg')no-repeat;background-size:100% 100%; ">
					<div class="flex frame fc jc_sb">
						<div class="flex ai_center" style="height: 0.35rem">
							<img src="__STATIC__/images/user_card/user_vip.png" >
							<div style="white-space:nowrap;color: #f6d4b1">加入会员|预计可省3031元</div>
						</div>
						<div class="opening ">立即续费</div>

					</div>
				</div>
			</if>

		</div>


		<div class="xc-after-sale rel">
			<div class="xc-after-sale-left flex  ai_center jc_sb">

				<div class="t_c xc-sh rel" url="{:U('/Mobile/User/order_list',array('type'=>'WAITPAY','stoid'=>$Think.request.stoid))}"
					 onclick="go_order(this)">

					<img class="xc-no-money" src="__WEBPUBLIC__/miniapp/images/daifuk.png"></img>
					<div class=" xc-word-color fs022">待付款</div>
					<if condition="$wait_pay gt 0">
						<text class="order-num abs fs11" >{$wait_pay}</text>
					</if>

				</div>

				<div class="t_c xc-sh rel" url="{:U('/Mobile/User/order_list',array('type'=>'WAITRECEIVE','stoid'=>$Think.request.stoid))}"
					 onclick="go_order(this)">

					<img class="xc-await" src="__WEBPUBLIC__/miniapp/images/shouhuo.png"></img>
					<div class="xc-word-color fs022">待收货</div>
					<if condition="$wait_receive gt 0">
						<text class="order-num abs fs11" >{$wait_receive}</text>
					</if>

				</div>

				<div class="t_c  xc-sh rel"  url="{:U('/Mobile/User/order_list',array('type'=>'WAITCCOMMENT','stoid'=>$Think.request.stoid))}"
					 onclick="go_order(this)">

					<img class="xc-no-money" src="__WEBPUBLIC__/miniapp/images/dpr1.png"></img>
					<div class="xc-word-color fs022">待评论</div>
					<if condition="$pj_num gt 0">
						<div class="order-num abs fs015 flex jc_center ai_center" >{$pj_num}</div>
					</if>

				</div>

				<div class="t_c xc-sh rel"  url="/index.php/mobile/User/return_goods_list/stoid/{$Think.request.stoid}"
					 onclick="go_order(this)" >

					<img class="xc-no-money" src="__WEBPUBLIC__/miniapp/images/shouh1.png"></img>
					<div class="xc-word-color fs022">售后/退款</div>

				</div>

				<div class="xc-after-sale-right ">
					<div class=" xc-order t_c rel" onclick="go_order(this)"  url="{:U('Mobile/User/order_list',array('stoid'=>$Think.request.stoid))}" >
						<div class='xc-hump abs'></div>
						<img class="xc-no-money " src="__WEBPUBLIC__/miniapp/images/dindan.png" style="margin-top: 0rem;height: 0.4rem;"></img>
						<div class="xc-word-color fs022">我的订单</div>
					</div>
				</div>

			</div>

		</div>

		<!-- 我的权益 -->
		<if condition="$isBool">
	    	<div class="my_pri">
			<div class="mp_title flex jc_sb" onclick="go_order(this)" url="{:U('Mobile/User/gorw_up',array('stoid'=>$Think.request.stoid))}">
				<div  class="flex jc_sb"style="width:100%;margin: 0 auto;">
					<div class="mp_left fs025"><img src="__STATIC__/images/weixin/medal.png" />我的权益</div>
					<div class="mp_right fs025 rel dn">
						<text>更多</text>
						<div class="bg_rights abs xc-more"></div>
					</div>
					<div class="flex ai_center sto_loding_div">
						<img class="loading" src="__STATIC__/images/category/loader.gif"  width="20" />
					</div>
				</div>
			</div>
			<!-- 滑动模块 -->
			<div class="mp_swiper dn">
				<div  class="xc-swiper-left "onclick="go_prev_sw()" ></div>
				<div class="swiper-container">
					<div class="swiper-wrapper" id="qy_sw" style="height: 0.85rem"></div>
				</div>

				<div class="bg_rights xc-swiper-right " onclick="go_next_sw()"></div>

			</div>

		</div>
		</if>
	</div>
</div>



<!-- 许程 工具与服务 -->
<div class="xc-tool-service">
    <a href="{:U('Mobile/Yyservice/service_items_list',['stoid'=>$Think.request.stoid,'id'=>$collocation.id,'goods_id'=>I('id')])}">
		<div class="xc-tool-service-title flex ai_center">
			<img class="xc-tool-service-img" src="__WEBPUBLIC__/miniapp/images/gj.png"></img>
			<span class="fs025 xc-tool-service-word" onclick="test()">工具与服务</span>
		</div>
    </a>


	<div class="xc-project-frame">
		<!-- 跳转页面 -->
		<div style="line-height: 0.7rem">
			<volist name="usertool" id="list">
				 <if condition='empty($swith_usertool) || !in_array($list.id,$swith_usertool)'>
							<if condition="$list['type'] eq 1">	<a href="{:U($list['url'],array('stoid'=>$Think.request.stoid))}"></if>
				        	<if condition="$list['type'] eq 4">	<a href="__WXD_LB_URL__{$list['url']}?stoid={$Think.request.stoid}&userid={$user.user_id}"></if>
							<if condition="$list['type'] eq 2">	<a href="javascrpt:" onclick="{$list['url']}"></if>

					        <if condition="$list['type'] eq 3">
								 <div class="item t_c"  id="{$list['url']}">
								      <img src="<if condition="$list['icotype'] eq 1">__WEBPUBLIC__<else/>__STATIC__</if>{$list.icoimg}"  class="xc-center-img"/>
					                  <div class="fs022">{$list.name}</div>
	                            </div>
							<else/>
								   <div class="item t_c" <if condition="$list.name eq '我的权益' and $list.id eq 5">style='display:none'  id="quanyi_tool"</if> >
								        <img src="<if condition="$list['icotype'] eq 1">__WEBPUBLIC__<else/>__STATIC__</if>{$list.icoimg}"  class="xc-center-img"/>
				                     	<div class="fs022">{$list.name}</div>
		                           </div>
							 </if>
			            	<if condition="$list['type'] neq 3"></a></if>
					</if>
			</volist>


		</div>
	</div>
</div>

<!-- 推荐商品 -->
<div class="xc-recommend-goods flex  jc_center ai_center">
	<div class="flex ai_center">

		<img style="width: 0.4rem;height: 0.1rem;" src="__STATIC__/images/weixin/left-d.png">
	</div>
	<text class="fs025 xc-recommend">为你推荐</text>

	<div class="flex ai_center" style="margin-left: 0.05rem">
		<img style="width: 0.4rem;height: 0.1rem;transform:rotate(180deg);" src="__STATIC__/images/weixin/left-d.png">
	</div>
</div>

<div class="xc-goods-frame4">
<div class="floor_body2">
	<div id="J_ItemList">
		<ul class="product single_item info">
		</ul>
		<a href="javascript:;" class="get_more" style="text-align:center; display:block;">
			<img src='__STATIC__/images/category/loader.gif' width="12" height="12"> </a>
	</div>
	<div class="xc-goods-frame4" id="getmore" style="font-size:.24rem;text-align: center;color:#888;padding:.25rem .24rem .4rem;">
		<a href="javascript:void(0)" onClick="getGoodsList()">点击加载更多</a>
	</div>
</div>
	</div>

<input type="hidden" id="hidstoid" name="hidstoid" value="{$Think.request.stoid}">

<!--二维码弹窗-->
<div id="ferweimap" class="layermbox dn">
	<div class="laymshade"></div>
	<div class="layermmain">
		<div class="section">
			<div class="layermchild" style="width:300px;">
				<div class="layermcont">
					<div class="code">
						<img id="suberwm" src="" style="width: 100%">
					</div>
					<p class="codeTxt">长按识别二维码进行关注</p>
				</div>
			</div>
		</div>
	</div>
</div>

<!--弹窗 20170414二维码-->
<div class="layercode layermbox layermbox0_1 dn">
	<div class="laymshade"></div>
	<div class="layermmain">
		<div class="ewmbox">
			<div class="vip_info">
				<img class="img" src="{$user.head_pic}" style="width: 30%; margin: 10px 0 10px 30px;border-radius: 4px" />
				<div class="ml20">
					<p>{$user.nickname}
						<if condition="$user['sex'] eq 1 ">
							<img class="pic_n" src="__STATIC__/images/user/man.png"/>
						</if>
						<if condition="$user['sex'] eq 2 ">
							<img class="pic_n" src="__STATIC__/images/user/wum.png"/>
						</if>
					</p>
					<p class="address" style="padding-top: 10px;font-size: 14px;color: #999999;">{$user.address}</p>
				</div>
			</div>
			<div class="codeImg">
				<img class="small" src="{$user.head_pic}" style="border-radius:4px ; border: 4px solid #fff;"/>
				<img src="/index.php?m=Home&c=Index&a=qr_code&data=^{$user.mobile}|{:date('Y-m-d H:i:s')}" />
			</div>
			<p class="txt">扫一扫上面的二维码图案,即可消费</p>
		</div>
	</div>
</div>

</div>
<include file="public/footer_nav"/>
</body>

<!----QQ客服--->
<div id="nyf_qqkefu" style="display: none;">
	<div class="cover-layer" onclick="close_qq()"></div>
	<div class="p_fixed  flex jc_center ai_center t0 l0 n_w100 n_h100" style="z-index: 666666;flex-direction: column">
    	<ul id="qq_content" class="qq_content" ></ul>
		<div class="b_circle qq_ny_close"  onclick="close_qq()"></div>
	</div>
</div>

<script type="text/javascript">
	/*生日活动 birthday_activities*/
	var actId="";
	var actType="";
	var giftbagid="";


	$(function () {
		var stoid="{$Think.request.stoid}";
		var user_id="{$user.user_id}";
		$.ajax({
			type: "get",
			url:" /index.php?m=Mobile&c=Userapi&a=birthday_activities&user_id=" +user_id + "&stro_id="+stoid,
			dataType: 'json',
			success: function (data) {

				if(data.code==0){

					var html= "<div class=\"birthday-frame t_c\"  onclick=\"click_birthday()\">\n" +
							"<img onerror=this.src='__STATIC__/images/weixin/banner-img.jpg'  src="+data.actImg+" >"+
							"</div>"

					$('.xc-tool-service').before(html);
					actId=data.actId;
					actType=data.actType;
					giftbagid=data.giftbagid;
					console.log(data,data.actId,data.giftbagid);
				}

			}
		})
	})
	/*点击到生日页面*/
	function click_birthday() {
		var user_id="{$user.user_id}";
		window.location.href = "__WXD_LB_URL__GiftPackage/BirthdayGift?actId="+actId+"&actType="+actType+"&giftBagId="+giftbagid+"&storeId={$Think.request.stoid}&userId="+user_id;
	}

    /*点击移动轮播框*/
	function isWeiXin(){
		var ua = window.navigator.userAgent.toLowerCase();
		if(ua.match(/MicroMessenger/i) == 'micromessenger'){
			return true;
		}else{
			return true;
		}
	}

	var getstoid = $("#hidstoid").val();

	function setnum(vsum, qnum, integ) {
		//$("#fVIPSum").text(yesum);
		$("#ycVIPSum").text(vsum);
		$("#ycVIPSum").removeClass('dn');
		$("#fqnum").text(qnum);
		$("#fqnum").removeClass('dn');
		$("#fIntegral").text(integ);
		$("#fIntegral").removeClass('dn');
	}

	//打开二维码
	$("#openwx").click(function () {
		$(".layercode").show();
	})
	//点击二维码,关闭二维码弹窗
	$(".layercode").click(function(){
		$(".layercode").hide();
	});

	function go_order(ob) {
		var url=$(ob).attr("url"); window.location.href=url;
	}

</script>
</html>

<include file="public/wx_share"/>
<input id="isBool" type="hidden" value="{$isBool}">

<script type="text/javascript">
	var stoid="{$Think.request.stoid}";
	var user_id="{$tpshop_config['user_id']}";
	var gradeId=0;
	var gradeEndDate="";
	var need_money=0;
	var page=1;
	var qy_list=null;

    var acept_index=0;
	var sw_len=0;
    var swiper=null;

	/*--程序初始化入口--*/
	$(function () {

        var url2= "/index.php?m=Mobile&c=Index&a=issub&stoid="+getstoid;

        $(".layermbox").hide();
        if (!isWeiXin())
        {
            $(".layermbox").hide();
        }else{
            $.ajax({
                type: "post",
                url: url2,
                dataType:'json',
                success: function (data) {
                    if(data.code ==1 ){
                        if(data.url==''){
                            layer.open({content:'未生成关注二维码',time:2});
                        }else{
                            $('#suberwm').attr('src',data.url);
                            $("#ferweimap").fadeIn(2);
                        }
                    }else{
                        $("#ferweimap").fadeOut(2);
                    }
                },
                error:function(XMLHttpRequest, textStatus, errorThrown){
                    $("#ferweimap").hide();
                }
            });
        }

        $.ajax({
            url: "/index.php?m=Mobile&c=Api&a=getindnum&stoid=" + getstoid,
            data: {},
            type: "post",
            dataType: "json",
            success: function(data) {
                layer.closeAll();
                if (data.code == 1) {
                    $(".f_load").remove();
                    setnum(data.vsum, data.qnum, data.integ);
                } else {
                    layer.open({
                        content: data.msg,
                        time: 1
                    });
                }
            },
            error: function() {
                layer.closeAll();
                layer.open({
                    content: '网络繁忙,请重试',
                    time: 1
                });
            }
        });

		var cz_val=0,backClass=null,
				need_money=0,g_qy_list=null,GradeName='',cur_g_num=0,cur_g_num=0;

        $("#all_div").fadeIn(300);
        $.ajax({
            type: "get",
            url: "/index.php?m=Mobile&c=Userapi&a=get_qy_user&stoid=<?php echo getMobileStoId()?>",
            success: function (res) {
                var data=res.data.qy_user;
                cz_val=data.GradeSum;
                gradeId=data.GradeId;
                gradeEndDate=data.GradeEndDate;
                GradeName=data.GradeName;
                var full_cz=0;

                if(gradeId){
                    $("#cz_val_txt").text(cz_val);
                    $("#cur_ka_name").text(GradeName);
                    $(".item.qy_item").fadeIn(3);
                    $("#ni_ka_show").fadeIn(3);
                    $("#grow_up").fadeIn(3);
                    $("#quanyi_tool").fadeIn(3);
                }else{
                    $("#cur_ka_name").hide();
                    $(".my_pri").fadeOut(3);
                }

                backClass=res.data.backClass;
                full_cz=backClass[backClass.length-1].BuyGradeSum;
                for(var i in backClass){
                    var im=backClass[i];
                    if(cz_val<im.BuyGradeSum && need_money==0){  need_money=im.BuyGradeSum;   }
                }

                //--成长值的设置--
                if(cz_val<full_cz){
                    $("#czf_val").text(need_money);  $("#bili").show();
                }

                qy_list=res.data.qy_list
                g_qy_list=res.data.g_qy_list;
                for(var i in qy_list){
                    var item=qy_list[i];var FromId=check_is_has_qy(item,g_qy_list);
                    qy_list[i].ishas=0;
                    if(FromId){
                        qy_list[i].ishas=1; qy_list[i].FromId=FromId;
                    }
                }
                qy_list.sort(function(a,b){
                    return b.ishas-a.ishas
                })
                //4个4个一组
                var arr = new Array();
                for(var i=0;i< qy_list.length;i+=4){
                    arr.push(qy_list.slice(i,i+4));
                }
                sw_len=arr.length;
                var html="";
                for(var j in arr){
                    var c_arr=arr[j];
                    var htm='<div class="swiper-slide">';
                    for(var m in c_arr){
                        var item=c_arr[m];

                        var t_index=parseInt(j*4)+parseInt(m);

                        htm+= '<div class="item"  no="'+item.PrivilegeType+'" img="'+item.PrivilegeImageUrl+'" ' +
                            'onclick="go_url(this)" title="'+item.PrivilegeName+'"  ind="'+t_index+'"><div>';

                        if(item.ishas)

                            htm+= ' <div style="height:0.5rem"><img src="'+item.PrivilegeICOUrl+'" /></div>';

                        else
                            htm+= '<div style="height:0.5rem"><img class="img_gray" src="'+item.PrivilegeICOUrl+'" /></div>';

                        htm+= '</div><div style="margin-top: 0.04rem;">'+item.PrivilegeName+'</div></div>'
                    }
                    htm+='</div>';
                    html+=htm;
                }

                $("#qy_sw").html(html);
                $(".mp_swiper").removeClass("dn");
                $(".mp_right ").removeClass("dn");
                $(".sto_loding_div").remove();

                swiper = new Swiper('.swiper-container',{
                    on:{
                        slideChange: function () {
                            acept_index=this.activeIndex;
                        },
                    }
                });

            }
        });

		$("#getmore").hide();
		getGoodsList();

	})

	//判断会员是后有改服务项目
	function check_is_has_qy(item,g_qy_list){
		for(var i in g_qy_list){
			var iter=g_qy_list[i];
			if(iter.FormId==item.Id)  return g_qy_list[i].FormId;
		}
		return false;
	}
	/*----同步调用----*/
	function async_get(url,data,func,err,async) {
	    if(async==undefined || async==null) async=false;
		$.ajax({
			url:  url, data: data, type: "get",
			dataType: "json",  async:async,
			success: function(res) {
				if(res.code==0){ func(res); }
			}
		});
	}

	function getGoodsList() {
		$('.get_more').show();
		$('#getmore').hide();
		$.ajax({
			type: "get",
			url: "/index.php?m=Mobile&c=Index&a=ajaxGetMore&p=" + page + "&stoid=<?php echo getMobileStoId()?>",
			success: function (data) {
				/*console.log("y有什么鬼",data);*/
				$('.get_more').hide();
				if (data) {
					$("#J_ItemList>ul").append(data);
					page++;
				} else {
					$('#getmore').remove();
				}
			},
			error:function(XMLHttpRequest, textStatus, errorThrown){
				$("#ferweimap").hide();
			}
		});
	}

	///滑动到底部事件
	$(document).unbind("scroll");
	$(document).bind("scroll", function (event) {
		if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
			if($("#getmore:visible").length>0){
				getGoodsList();
			}
		}
	});

	/*---点击跳转----*/
	function go_url(ob) {
		var no=$(ob).attr('no');
		var ind=$(ob).attr('ind');
		var img=$(ob).attr('img');
		var title=$(ob).attr('title');

        var item=qy_list[ind];

		if(item.ishas==undefined || !item.ishas){
			/*my_msg("当前会员暂无此权益",0);*/
			show_pop_text("温馨提示","当前会员暂无此权益");
			return false;
		}

		var url=$(ob).attr('img');
		switch (no) {
			case "01":
				window.location.href= "/mobile/user/coupon_list/user_coupon?stoid="+stoid+"&gradeId="+gradeId+"&FormId="+item.Id+"&img="+img+"&title="+title;
				break;
			case "02":
				window.location.href= "/mobile/user/fuwu?stoid="+stoid+"&gradeId="+gradeId+"&FormId="+item.Id+"&title="+title;
				break;
			case "03":
				getApp().goto("/pages/user/user_spsy/user_spsy");
				break;
			case "10":
				async_get("{$mini_host}/api/weshop/users/grade/vipprivilegelist/other/get",
						{storeId:stoid, formId:item.Id,userId:user_id,gradeId:gradeId},
						function(res) {
							show_pop_text(res.data.PrivilegeName,res.data.Remark)
						}
				)
				break;
		}
	}

	//跳到等级卡
	function go_card(ob) {
       var href=$(ob).attr("href");
       window.location.href=href;
    }


    var qqlist="{$tpshop_config['qqlist']}";
    //联系客服

	$("#user_showQQList").click(function () {
		/*--qq客服--*/

        <if condition="$is_chat eq 1">
        window.location.href="/mchat/mbchat/index?stoid={$Think.request.stoid}";
        <else/>
        if (qqlist != undefined && qqlist!="" && $("#qq_content").html()=="") {
            var list = qqlist.split(",");
            var htm = "";
            for (var i = 0; i < list.length; i++) {
                htm += "<li><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=" + list[i] + "&site=qq&menu=yes'>客服"
                    + (i + 1) + "</a></li>"
            }
            $("#qq_content").html(htm);
        }
        $("#nyf_qqkefu").show();
        </if>
    })




    function close_qq() { $("#nyf_qqkefu").hide();  }


    /*--按钮事件--*/
    function go_next_sw() {
        if(acept_index==sw_len-1) {
             return false
        }
        acept_index++;
        swiper.slideTo(acept_index,800);
    }
    function go_prev_sw() {
        if(acept_index==0) {
            return false
        }
        acept_index--;
        swiper.slideTo(acept_index,800);
    }

</script>
<include file="public/popup"/>