Subversion Repositories SmartDukaan

Rev

Rev 24440 | Rev 25778 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24440 Rev 25737
Line 53... Line 53...
53
	});
53
	});
54
	
54
	
55
	$(".mk_check_plans").live('click', function(){
55
	$(".mk_check_plans").live('click', function(){
56
		var mop = parseFloat($(this).data("mop"));
56
		var mop = parseFloat($(this).data("mop"));
57
		var sellingPrice = $(this).val();
57
		var sellingPrice = $(this).val();
-
 
58
		var itemId = $(this).closest(".input-group").find("input.insuranceamount").attr("itemid");
58
		if(!isNaN(sellingPrice) && parseFloat(sellingPrice) >= mop){
59
		if(!isNaN(sellingPrice) && parseFloat(sellingPrice) >= mop){
59
			price = paeseFloat(sellingPrice);
60
			price = paeseFloat(sellingPrice);
60
		} else {
61
		} else {
61
			price = mop;
62
			price = mop;
62
		}
63
		}
63
		that = this;
64
		that = this;
64
		doGetAjaxRequestHandler(context+"/checkplans?price=" + price, function(response){
65
		doGetAjaxRequestHandler(context+"/checkplans?price=" + price + "&itemId=" + itemId, function(response){
65
			var obj = JSON.parse(response);
66
			var obj = JSON.parse(response);
66
			getInsurancePlansModal(obj);
67
			getInsurancePlansModal(obj);
67
			planCheckedOn = that;
68
			planCheckedOn = that;
68
			return;
69
			return;
69
		});
70
		});
Line 81... Line 82...
81
			var plan = plansList[index];
82
			var plan = plansList[index];
82
			console.log(plan);
83
			console.log(plan);
83
			var template = 
84
			var template = 
84
				`<div class="col-lg-3">
85
				`<div class="col-lg-3">
85
					<div class="thumbnail">
86
					<div class="thumbnail">
86
						<img class="card-img-top" src="${logosmapping.mobile_insurance_providers[plan.provider_id]}" alt="${plan.provider_name}">
87
						<img class="card-img-top" src="${logosmapping.mobile_insurance_providers[plan.providerId]}" alt="${plan.providerName}">
87
			      		<div class="caption" style="padding:9px 0 0">
88
			      		<div class="caption" style="padding:9px 0 0">
-
 
89
						    <div style="margin:0 0 -2px -2px">
88
						    <div style="margin:0 0 -2px -2px"><button class="btn btn-sm btn-default mk_plan_select" data-key="${plan.plan_key}" data-amount="${plan.price}">${plan.price}</button></div>
90
						    	<button class="btn btn-sm btn-default mk_plan_select" style="width:100%" 
-
 
91
						    		data-key="${plan.productId}"
-
 
92
						    		data-amount="${plan.premium}">${plan.premium}
-
 
93
						    	</button>
-
 
94
						    </div>
89
						</div>
95
						</div>
90
					</div>
96
					</div>
91
				</div>`;
97
				</div>`;
92
			templateArr.push(template);
98
			templateArr.push(template);
93
			if(index%4==3 || +index+1==plansList.length) {
99
			if(index%4==3 || +index+1==plansList.length) {