define(['zepto', 'medtap'], function($, medtap) {
	var main = {
		id:medtap.getRequest('id'),
		portType:getEnvironment(),
		init: function() {
			main.getUserAttentionWechat();
		},
		bind: function() {

		},
		//获取用户的关注状态
		getUserAttentionWechat: function() {
			medtap._ajax({
				url: '/wechat/user/getWechatUser',
				type: 'get',
				portType:main.portType,
				data: {

				},
				success: function(res) {
					var info = res.content.wechatUser;
					if(info.subscribe == 0 || info.subscribe == 9){
						//显示关注引导
						$('.button_box').hide();
						$('.YD').show();
						$('#download').unbind().bind('click',function(){
							window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=cn.medtap.onco'
						})
					}else{
						$('.button_box').show();
						$('.go_detail').unbind().bind('click',function(){
							window.location.href = '../pages/isVip-3.0.html';
						});
						$('.go_order').unbind().bind('click',function(){
							window.location.href = 'https://review-formal.iplusmed.com/wxPayDev/UserInfo/pages/memberDetail.html?id=' + main.id;
						})
						
					}
				}
			})
		}
	}
	main.init();
})