card.html 22.5 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
{php define('MUI', true);}
{template 'common/header'}
{if $do == 'receive_card'}
<div class="mui-content membership-card-receive">
	{if !empty($setting['grant']) && ($setting['grant']['credit1'] || $setting['grant']['credit2'] || !empty($coupon))}
	<div class="mui-bg-warning mui-text-center tips">
		领卡赠送:
		{if $setting['grant']['credit2'] > 0}
			¥<span class="mui-big">{$setting['grant']['credit2']}</span>
		{/if}
		{if $setting['grant']['credit1'] > 0}
			+ <span class="mui-big">{$setting['grant']['credit1']}</span>积分
		{/if}
		{if !empty($coupon)}
			{$coupon['title']}
		{/if}
	</div>
	{/if}
	<div class="card-panel" style="background-image: url(
			{if empty($setting['background']['image'])}
			{php echo tomedia('images/global/card/1.png')}
			{elseif $setting['background']['background'] == 'system'}
			{php echo tomedia('images/global/card/' . $setting['background']['image'] . '.png')}
			{else}
			{php echo tomedia($setting['background']['image']);}
			{/if}
		);">
		<div class="card-logo mui-text-center">
			{if !empty($setting['logo'])}<img src="{php echo tomedia($setting['logo'])}" class="mui-img-rounded"/>{/if}
		</div>
		<div class="card-info">
			<div class="mui-text-center">
				<span class="vip" style="color: #fff;">VIP</span>
				<span class="card-rank" style="color: #fff;">{$_W['member']['groupname']}</span>
			</div>
			{if !$setting['format_type']}
			<div class="card-no mui-text-right" style="color:{if !empty($setting['color']['number'])}{$setting['color']['number']}{/if}">会员卡号:<span style="color: #fff;">{$setting['format']}</span></div>
			{/if}
		</div>
	</div>
	<form class="tab-content clearfix js-ajax-form" action="{url 'mc/card/receive_card'}" method="post" enctype="multipart/form-data">
	<div class="mui-input-group">
		<div class="mui-input-row">
			<label>
				姓名<span title="必填项" style="color:red">*</span>
			</label>
			{php echo tpl_app_fans_form('realname', $member_info['realname'], '姓名');}
		</div>
		<div class="mui-input-row">
			<label>
				手机<span title="必填项" style="color:red">*</span>
			</label>
			{php echo tpl_app_fans_form('mobile', $member_info['mobile'], '手机号码');}
		</div>
		{loop $setting['fields'] $item}
			{if $item['bind'] != 'realname' &&  $item['bind'] != 'mobile'}
			<div class="mui-input-row">
				<label>
					{$item['title']} {if $item['require'] == 1}<span title="必填项" style="color:red">*</span>{else} &nbsp;{/if}
				</label>
				{if $item['bind'] == 'reside' || $item['bind'] == 'resideprovince' || $item['bind'] == 'residecity' || $item['bind'] == 'residedist'}
					{php echo tpl_app_fans_form('reside', array('province' => $member_info['resideprovince'],'city' => $member_info['residecity'],'district' => $member_info['residedist']));}
				{elseif $item['bind'] == 'birth' || $item['bind'] == 'birthyear' || $item['bind'] == 'birthmonth' || $item['bind'] == 'birthday'}
					{php echo tpl_app_fans_form('birth', array('year' => $member_info['birthyear'], 'month' => $member_info['birthmonth'], 'day' => $member_info['birthday']))}
				{else}
					{php echo tpl_app_fans_form($item['bind'],$member_info[$item['bind']],$item['title'])}
				{/if}
			</div>
			{/if}
		{/loop}
	</div>
	<div class="mui-content-padded">
		<input type="hidden" name="token" value="{$_W['token']}" />
		<button class="mui-btn mui-btn-success mui-btn-block" id="receive-card" type="submit" name="submit" value="提交">领取</button>
	</div>
	</form>
</div>
{/if}
<!-- 我的会员卡 -->
{if $do == 'mycard'}
	{if empty($mcard['status'])}
	<div class="alert alert-warning" role="alert">
		您的会员卡已被禁用,如有疑问,请联系{$_W['account']['name']}。
	</div>
	{else}
	<div class="mui-content membership-card-home mc-we7-home">
		<div class="card-panel" style="background-image:url(
			{if empty($setting['background']['image'])}
			{php echo tomedia('images/global/card/1.png')}
			{elseif $setting['background']['background'] == 'system'}
			{php echo tomedia('images/global/card/' . $setting['background']['image'] . '.png')}
			{else}
			{php echo tomedia($setting['background']['image']);}
			{/if}
		)">
			<a href="javascript:;">
				<div class="card-logo mui-text-center">
					{if !empty($setting['logo'])}<img src="{php echo tomedia($setting['logo'])}" class="mui-img-rounded"/>{/if}
				</div>
				<div class="card-info">
					<div class="mui-text-center">
						<span class="vip" style="color:#fff;">VIP</span>
						<span class="card-rank" style="color: #fff;">{$_W['member']['groupname']}</span>
					</div>
					<div class="card-no mui-text-right">会员卡号:<span style="color: #fff;">{$mcard['cardsn']}</span></div>
				</div>
			</a>
		</div>
		<div class="mui-table mui-table-inline mui-mt15 nav-action">
			<div class="mui-table-cell">
				<a href="{php echo url('entry', array('m' => 'recharge', 'do' => 'pay'));}" class="mui-block">
					<img src="resource/images/sum-recharge.png" alt="" class="mui-mr5"/>充值
				</a>
			</div>
			<div class="mui-table-cell">
				<a href="{php echo url('mc/bond/consume') . 'wxref=mp.weixin.qq.com#wechat_redirect'}">
					<img src="resource/images/scan-pay.png" alt=""/>付款
				</a>
			</div>
		</div>
		<ul class="mui-table-view mui-table-view-chevron">
			<li class="mui-table-view-cell">
				<a href="{php echo url('entry', array('m' => 'recharge', 'do' => 'pay'));}" class="mui-navigate-right">
					我的余额
					<span class="mui-pull-right">{$_W['member']['credit2']}</span>
				</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/bond/credits', array('credittype' => 'credit1', 'type' => 'record', 'period' => '1'))}" class="mui-navigate-right">
					我的积分
					<span class="mui-pull-right">{$_W['member']['credit1']}</span>
				</a>
			</li>
			{if $setting['nums_status'] == 1}
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/recharge_record', array('type' => 'nums'))}" class="mui-navigate-right">
					{$setting['nums_text']}
					<span class="mui-pull-right">{$mcard['nums']}次</span>
				</a>
			</li>
			{/if}
			{if $setting['times_status'] == 1}
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/recharge_record', array('type' => 'times'))}" class="mui-navigate-right">
					{$setting['times_text']}
					<span class="mui-pull-right">{if $mcard['endtime'] < time()}已过期{else}{php echo date('Y-m-d', $mcard['endtime']);}{/if}</span>
				</a>
			</li>
			{/if}
			<li class="mui-table-view-cell">
				<a href="{php echo url('activity/coupon/mine')}" class="mui-navigate-right">
					我的卡券
					<span class="mui-pull-right">{$total}张</span>
				</a>
			</li>
		</ul>
		<ul class="mui-table-view mui-table-view-chevron">
			{if !empty($setting['sign_status'])}
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/sign_display') . 'wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">
					签到
				</a>
			</li>
			{/if}
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/notice') . 'wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">
					消息
				</a>
			</li>
		</ul>
		<ul class="mui-table-view mui-table-view-chevron">
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/personal_info') . 'wxref=mp.weixin.qq.com#wechat_redirect';}" class="mui-navigate-right">
					个人信息
				</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/bond/credits', array('credittype' => 'credit2', 'type' => 'record', 'period' => '1'))}" class="mui-navigate-right">
					账单
				</a>
			</li>
		</ul>
	</div>
	{/if}
{/if}

{if $do == 'add_recharge'}
<div class="mui-content membership-card-add-times">
	<div class="mui-section mui-text-center">
		请选择您要增加的{if $type == 'nums'}次数{elseif $type == 'times'}时间{/if}
	</div>
	<div class="mui-row mui-mr5 mui-ml5">
		{php $i = 0;}
		{loop $setting $nums}
		<div class="mui-col-xs-4 mui-pa5 mui-mt5">
			<div class="mui-thumbnail mui-text-center mui-text-info {if $i == '0'}selected{/if}" data-nums="{if $type == 'nums'}{$nums['num']}{elseif $type == 'times'}{$nums['time']}{/if}" data-recharge="{$nums['recharge']}">
				<div class="mui-big">{if $type == 'nums'}{php echo $nums['num'] . '次'}{elseif $type == 'times'}{php echo $nums['time'] . '天'}{/if}</div>
				<div class="mui-small">{$nums['recharge']}元</div>
				<div class="selected-status"></div>
			</div>
		</div>
		{php $i++;}
		{/loop}
	</div>
	<ul class="mui-table-view">
		<li class="mui-table-view-cell">
			实际增加的{if $type == 'nums'}次数{elseif $type == 'times'}时间{/if} <span class="mui-pull-right add-nums"></span>
		</li>
		<li class="mui-table-view-cell">
			需要支付的金额 <span class="mui-pull-right mui-text-success mui-big add-pay"></span>
		</li>
	</ul>
	<div class="mui-content-padded">
		<a class="mui-btn mui-btn-success mui-btn-block dopay" href="javascript:;">确认支付</a>
	</div>
</div>
<script>
$(function(){
	$('.mui-thumbnail').click(function(){
		$('.mui-thumbnail').removeClass('selected');
		$(this).addClass('selected');
		var type = '{$type}';
		var addnums = $(this).data('nums');
		var addpay = $(this).data('recharge');
		var status = '<div class="selected-status"></div>';
		
		if (type == 'nums') {
			$('.add-nums').text(addnums + '次');
			url = "{php echo url('entry', array('m' => 'recharge', 'do' => 'pay', 'type' => 'card_nums'), true)}&fee=" + addpay;
		} else if(type == 'times') {
			$('.add-nums').text(addnums + '天');
			url = "{php echo url('entry', array('m' => 'recharge', 'do' => 'pay', 'type' => 'card_times'), true)}&fee=" + addpay;
		}
		$('.add-pay').text(addpay + '元');
		$('.dopay').attr('href', url);
	})
	$('.mui-thumbnail:first').click();
})
</script>
{/if}

{if $do == 'recharge_record'}
<!-- 查看剩余次数或天数 -->
<div class="mui-content membership-card-times">
	<div class="mui-section">
		<div class="mui-text-success mui-text-center times">{if $type == 'nums'}{$card['nums']}{elseif $type == 'times'}{php echo date('Y-m-d', $card['endtime'])}{/if}</div>
		<div class="mui-text-center mui-text-muted">{if $type == 'nums'}{$setting['nums_text']}{elseif $type == 'times'}{$setting['times_text']}{/if}</div>
		{if $type == 'nums'}
		<a class="mui-btn mui-btn-success mui-btn-outlined mui-btn-block" href="{php echo url('mc/card/add_recharge', array('type' => 'nums'));}">立即充值</a>
		{elseif $type == 'times'}
		<a class="mui-btn mui-btn-success mui-btn-outlined mui-btn-block" href="{php echo url('mc/card/add_recharge', array('type' => 'times'));}">立即充值</a>
		{/if}
	</div>
	<ul class="mui-table-view">
		<li class="mui-table-view-cell">
			<div class="mui-row">
				<div class="mui-col-xs-3">
					<a href="#times-date">
						<span class="date-filter">{$period_date}</span>
						<span class="mui-text-muted"><i class="fa fa-angle-down"></i></span>
					</a>
				</div>
			</div>
		</li>
		{loop $data $da}
		<li class="mui-table-view-cell">
			<div class="mui-row">
				<div class="mui-col-xs-6">
					{if $type == 'nums'}
						{if $da['model'] == '1'}
						次数充值
						{else}
						次数消费
						{/if}
					{else}
						{if $da['model'] == '1'}
						服务延长
						{else}
						服务减少
						{/if}
					{/if}
					<span class="mui-block mui-text-muted mui-small"> <span class="mui-ml5 mui-rmb">{$da['fee']}</span></span>
				</div>
				<div class="mui-col-xs-6 mui-text-right">
					<span class="mui-big">{if $da['model'] == '1'}+{else}-{/if}{$da['tag']}{if $type == 'nums'}次{elseif $type == 'times'}天{/if}</span>
					<span class="mui-block mui-text-muted mui-small">{php echo date('Y-m-d', $da['addtime'])}</span>
				</div>
			</div>
		</li>
		{/loop}
	</ul>
	<div id="times-date" class="mui-popover mui-popover-top">
		<ul class="mui-table-view">
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/recharge_record', array('period' => '1', 'type' => $type));}">{php echo date('Y.m', strtotime('now'))}</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/recharge_record', array('period' => '-1', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 1 month'))}</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/recharge_record', array('period' => '-2', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 2 month'))}</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/recharge_record', array('period' => '-3', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 3 month'))}</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/recharge_record', array('period' => '-4', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 4 month'))}</a>
			</li>
		</ul>
	</div>
</div>

{/if}

{if $do == 'sign_display'}
<!--签到界面-->
<div class="mui-content membership-card-sign mui-text-center">
	<div class="mui-table mui-table-inline nav-action">
		<div class="mui-table-cell">
			<a href="{php echo url('mc/card/sign_record', array('period' => '1'))}" class="mui-block">
				<img src="resource/images/icon-sign.png" alt="" />
				签到记录
			</a>
		</div>
		<div class="mui-table-cell">
			<a href="{php echo url('mc/card/sign_strategy')}" class="mui-block">
				<img src="resource/images/icon-integral-strategy.png" alt="" />
				积分攻略
			</a>
		</div>
	</div>
	<div class="sign-table">
		<div class="mui-bg-white sign-table-con mui-clearfix">
			{php for ($i = 1; $i <= $current_month_days; $i++) {}
				{if $i == $sign_set['first_group_day']}
				<div class="sign-table-cell {if $i <= $total}active{/if}">
					<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
					+{$sign_set['first_group_num']}
				</div>
				{elseif $i == $sign_set['second_group_day']}
				<div class="sign-table-cell {if $i <= $total}active{/if}">
					<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
					+{$sign_set['second_group_num']}
					</div>
				{elseif $i == $sign_set['third_group_day']}
				<div class="sign-table-cell {if $i <= $total}active{/if}">
					<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
					+{$sign_set['third_group_num']}
					</div>
				{elseif $i == $current_month_days}
				<div class="sign-table-cell {if $i <= $total}active{/if}">
					<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
					+{$sign_set['full_sign_num']}
					</div>
				{else}
				<div class="sign-table-cell {if $i <= $total}active{/if}">
					<span><img src="resource/images/icon-signed.png" alt="" class="{if $i > $total}gray-img{/if}"/></span>
					+{$sign_set['everydaynum']}
				</div>
				{/if}
			{php }}
		</div>
	</div>
	<div class="sign-record">今日已签到<span class="mui-big">+{$today_sign_credit}</span>积分</div>
	<div class="mui-text-muted sign-tips mui-mt10">明日可得 <span>+{$tomorrow_sign_credit}</span>积分</div>
</div>
<script>
	$(function() {
		today_signed = "{$today_signed['id']}";
		if (!today_signed) {
			util.toast('签到成功');
		}
	})
</script>
{/if}

{if $do == 'sign_record'}
<!--签到记录-->
<div class="mui-content">
	<div class="mui-content-padded">
		<a href="#sign-date"  class="mui-text-muted">
			<span>{if $_GPC['period'] <= 0}{php echo date('Y.m', strtotime($_GPC['period'] . 'month'))}{else}查看全部{/if}</span>
			<span><i class="fa fa-angle-down"></i></span>
		</a>
	</div>
	<div class="credits-display">
	<ul class="mui-table-view js-card-sign">
		{if !empty($data)}
		{loop $data $da}
		<li class="mui-table-view-cell">
			<div class="mui-row">
				<div class="mui-col-xs-6">
					{$da['addtime']}
					<span class="mui-block mui-text-muted mui-small">签到送积分</span>
				</div>
				<div class="mui-col-xs-6 mui-text-right mui-big">
					+{$da['credit']}
				</div>
			</div>
		</li>
		{/loop}
		{else}
		<li class="mui-table-view-cell">
			<div class="mui-row">无签到记录</div>
		</li>
		{/if}
	</ul>
	</div>
	<div id="sign-date" class="mui-popover mui-popover-top">
		<ul class="mui-table-view">
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/sign_record', array('period' => '1'))}">查看全部</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/sign_record', array('period' => '0'))}">{php echo date('Y.m', strtotime('today'))}</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/sign_record', array('period' => '-1'))}">{php echo date('Y.m', strtotime('-1month'))}</a>
			</li>
			<li class="mui-table-view-cell">
				<a href="{php echo url('mc/card/sign_record', array('period' => '-2'))}">{php echo date('Y.m', strtotime('-2month'))}</a>
			</li>
		</ul>
	</div>
</div>
<script>
require(['mui.pullrefresh'], function(mui) {
	mui.init();
	mui.ready(function() {
		var page = 2;
		var pagetotal = {$pagenums} + 1;
		if (page < pagetotal) {
			//循环初始化所有下拉刷新,上拉加载。
			mui.each(document.querySelectorAll('.credits-display'), function(index, pullRefreshEl) {
				mui(pullRefreshEl).pullToRefresh({
					up: {
						callback: function() {
							var self = this;
							setTimeout(function() {
								$('.mui-pull-bottom-tips').hide();
								var ul = self.element.querySelector('.js-card-sign');
								ul.appendChild(createFragment(ul, index, 5));
								if (pagetotal <= page) {
									$('.mui-pull-bottom-tips').hide();
									self.endPullUpToRefresh(true);
								} else {
									self.endPullUpToRefresh(false);
								}
							}, 1000);
						}
					}
				});
			});

			var createFragment = function(ul, index, count, reverse) {
				var length = ul.querySelectorAll('li').length;
				var fragment = document.createDocumentFragment();
				var li;
				var url = "{php echo url('mc/card/sign_record', array('period' => $_GPC['period']), true)}";
				mui.post(url, {'page' : page}, function(data){
					data = $.parseJSON(data);
					if (data.message.errno == '1') {
						return false;
					}
					for (var i in data.message.message) {
						var href = "{php echo url('mc/bond/credits', array('type' => 'recorddetail', 'credittype' => $_GPC['credittype']),true)}";
						li = document.createElement('li');
						li.className = 'mui-table-view-cell';
						li.innerHTML = '<div class="mui-row"><div class="mui-col-xs-6">' + data.message.message[i].addtime + '<span class="mui-block mui-text-muted mui-small">签到送积分</span></div><div class="mui-col-xs-6 mui-text-right mui-big">+' +data.message.message[i].credit + '</div></div>';
						ul.appendChild(li, ul.firstChild);
					}
					$('.mui-pull-bottom-tips').show();
				});
				page++;
				return fragment;
			};
		}
	});
});
</script>
{/if}

{if $do == 'sign_strategy'}
<div class="mui-content membership-card-integral-strategy">
	<div class="logo mui-text-center">
		<img src="{if $_W['setting']['copyright']['flogo']}{php echo tomedia($_W['setting']['copyright']['flogo']);}{else}resource/images/MicroEngine.ico{/if}"/>
	</div>
	<div class="mui-big mui-text-info mui-text-center">积分攻略</div>
	<div class="mui-content-padded">
		{$content}
	</div>
</div>
{/if}

{if $do == 'notice'}
<div class="mui-content">
	<div class="mui-content-padded">
		<div id="segmentedControl" class="mui-segmented-control mui-segmented-control-info">
			<a class="mui-control-item mui-active" href="#broadcast">广播</a>
			<a class="mui-control-item" href="#system-message">系统消息</a>
		</div>
	</div>
	<div id="broadcast" class="mui-control-content mui-active">
		<ul class="mui-table-view mui-table-view-chevron">
			{if !empty($data)}
			{loop $data $da}
			{if $da['type'] == '1'}
			<li class="mui-table-view-cell mui-media js-read" data-isnew="{$da['is_new']}" data-id="{$da['id']}">
				<a href="javascript:;" class="mui-navigate-right">
					<img class="mui-media-object mui-pull-left" src="{php echo tomedia($da['thumb']);}">
					<div class="mui-media-body">
						<p class="mui-ellipsis">{$da['title']}</p>
						<div class="mui-small mui-text-muted">{php echo date('Y-m-d H:i', $da['addtime']);}</div>
					</div>
				</a>
				<div style="display:none;" class="js-content">
					<p>
						{$da['content']}
					</p>
				</div>
			</li>
			{/if}
			{/loop}
			{else}
			<li class="mui-table-view-cell mui-media"><i class="fa fa-info-circle"></i> 暂无消息</li>
			{/if}
		</ul>
	</div>
	<div id="system-message" class="mui-control-content">
		<ul class="mui-table-view mui-table-view-chevron">
			<li class="mui-table-view-cell mui-media">暂无消息</li>
		</ul>
	</div>
</div>
<script>
	$(document).on('click', '.mui-control-item', function() {
		$('.mui-backdrop').remove();
	})	
	$('.js-read').click(function(){
		$(this).find('.js-content').toggle();
		//设置为已读
		if($(this).data('isnew')) {
			var id = $(this).data('id');
			$.post("{php echo url('mc/card/notice')}", {'id':id}, function(data){
				if(data != 0) {
					$('.nav-group .notice-count em').html(data);
				} else {
					$('.nav-group .notice-count em').remove();
				}
			});
			return false;
		}
	});
</script>
{/if}

{if $do == 'personal_info'}
<form class="tab-content clearfix js-ajax-form {if $_W['container'] !== 'wechat'}profile-form{/if}" action="{url 'mc/profile/editprofile'}" method="post" enctype="multipart/form-data">
<div class="mui-content">
	<ul class="mui-table-view mui-table-view-chevron">
		<li class="mui-table-view-cell">
			<a href="{php echo url('mc/bond/mobile', array('op' => 'index'))}" class="mui-navigate-right">
			手机
				<span class="mui-pull-right"><span class="mui-mr10">{if empty($_W['member']['mobile'])}请绑定手机号{else}{$_W['member']['mobile']}{/if}</span></span>
			</a>
		</li>
	</ul>
	<div class="mui-input-group mui-mt15">
		{loop $mc_fields $fields}
		<div class="mui-input-row">
			<label>{php echo $fields['title']}</label>
			{if $fields['bind'] == 'birth'}
				{php echo tpl_app_fans_form('birth', array('year' => $profile['birthyear'], 'month' => $profile['birthmonth'], 'day' => $profile['birthday']), $fields['title']);}
			{else if $fields['bind'] == 'reside'}
				{php echo tpl_app_fans_form('reside', array('province' => $profile['resideprovince'], 'city' => $profile['residecity'], 'district' => $profile['residedist']), $fields['title']);}
			{else}
				{php echo tpl_app_fans_form($fields['bind'], $profile[$fields['bind']], $fields['title']);}
			{/if}
		</div>
		{/loop}
	</div>
	<div class="mui-content-padded">
		<div class="mui-text-center mui-mt15 mui-mb15">
		开卡时间:{php echo date('Y-m-d', $mcard['createtime']);}
		</div>
		<button class="mui-btn mui-btn-success mui-btn-block" type="submit" value="提交" name="submit">保存</button>
		<input type="hidden" name="token" value="{$_W['token']}" />
	</div>
</div>
</form>
{/if}
{template 'common/footer'}