Browse Source

上朵30元包邮

wangxiaoming 6 years ago
parent
commit
9c1da7d78b
3 changed files with 116 additions and 11 deletions
  1. 48 5
      tooth/channel-clearing.html
  2. 49 5
      tooth/clearing.html
  3. 19 1
      tooth/order-details.html

+ 48 - 5
tooth/channel-clearing.html

@@ -19,6 +19,9 @@
 			// 屏蔽分享
 			window.hiddenAllWechatMenu = true;
 		</script>
+		<style>
+			.mui-table-view-cell>a:not(.mui-btn) {margin-left: -12px;}
+		</style>
 	</head>
 
 	<body>
@@ -84,12 +87,30 @@
 				<ul class="mui-table-view mui-table-view-striped my-grid-view-no mui-table-view-condensed shopping-cart-list">
 
 				</ul>
+				<div class="mui-content-padded mui-text-right">合计:<span class="pro-price">¥<span class="count_price">0.0</span></span>
+				</div>
+				
 				<ul class="mui-table-view">
 					<li class="mui-table-view-cell" id="ul-youhuiquan" style="padding-left:7px;display: none;">
 						<a class="mui-navigate-right btn-youhuiquan">
 							优惠券<span class="mui-pull-right cl-red">未选择优惠券</span>
 						</a>
 					</li>
+					
+					<li class="mui-table-view-cell " id="" style="padding-left:7px;">
+						<a class=" ">
+							总价<span class="mui-pull-right cl-red ">¥<span class="all_price"></span></span>
+						</a>
+					</li>
+					
+					<li class="mui-table-view-cell" id="" style="padding-left:7px;    ">
+						<a class=" " >
+							邮费 <span style="    font-size: 12px;color: #8f8f94;">(总价满30元包邮)</span><span class="mui-pull-right cl-red">
+								¥<span class="sales_postage"></span>
+							</span>
+						</a>
+					</li>
+					
 					<li>
 						<div class="mui-input-row">
 							<label class="lbl-remarks">订单备注</label>
@@ -97,8 +118,6 @@
 						</div>
 					</li>
 				</ul>
-				<div class="mui-content-padded mui-text-right">合计:<span class="pro-price">¥<span class="count_price">0.0</span></span>
-				</div>
 			</div>
 			
 			<div class="buy-footer1">
@@ -275,9 +294,15 @@
 										}else{
 											wechatAddr.status = false;
 										}
-										$("#selfAddressName").html(dt.data.channelName);
-										$(".count_price,.pay_price").text((dt.data.payTotal / 100).toFixed(2));
+										$(".count_price,.pay_price,.all_price").text(accDiv(dt.data.payTotal,100));
+										if(accDiv(dt.data.payTotal,100) < 30){
+											$(".sales_postage").text(10);
+										}else{
+											$(".sales_postage").text(0);
+										}
 										$("#pro-count").text(proCount);
+										
+										$("#selfAddressName").html(dt.data.channelName);
 										$(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
 									} else {
 										mui.alert("获取数据失败!", function() {
@@ -388,12 +413,30 @@
 					if(price <= 0) {
 						price = 0.0; //判断商品价格减去现金券价格若<0 则显示0
 					}
+					$(".all_price").text(price);
+					var postage = 0;
+					if(price<30){
+						$(".sales_postage").text(10);
+						postage = 10;
+					}else{
+						$(".sales_postage").text(0);
+					}
+					price = parseFloat(price + postage);
 					$(".pay_price").text(price);
 				} else {
 					yhq_id = '';
 					$(".btn-youhuiquan").removeAttr("couponid");
 					$(".btn-youhuiquan span").text("不使用现金券");
-					$(".pay_price").text($(".count_price").text());
+					
+					$(".all_price").text($(".count_price").text());
+					var salesPostage = $(".count_price").text();
+					if(salesPostage < 30 ){
+						$(".sales_postage").text(10);
+						salesPostage += 10;
+					}else{
+						$(".sales_postage").text(0);
+					}
+					$(".pay_price").text(parseFloat(salesPostage));
 				}
 				$(".my-picker").removeClass("active"); //隐藏弹窗
 				$(".mui-backdrop").remove(); //移除遮罩层

+ 49 - 5
tooth/clearing.html

@@ -14,6 +14,9 @@
 			// 屏蔽分享
 			window.hiddenAllWechatMenu = true;
 		</script>
+		<style>
+			.mui-table-view-cell>a:not(.mui-btn) {margin-left: -12px;}
+		</style>
 	</head>
 
 	<body>
@@ -48,12 +51,31 @@
 				<ul class="mui-table-view mui-table-view-striped my-grid-view-no mui-table-view-condensed shopping-cart-list">
 
 				</ul>
+				
+				<div class="mui-content-padded mui-text-right">合计:<span class="pro-price">¥<span class="count_price">0.0</span></span>
+				</div>
+				
 				<ul class="mui-table-view">
 					<li class="mui-table-view-cell" id="ul-youhuiquan" style="padding-left:7px;display: none;">
 						<a class="mui-navigate-right btn-youhuiquan">
 							优惠券<span class="mui-pull-right cl-red">未选择优惠券</span>
 						</a>
 					</li>
+					
+					<li class="mui-table-view-cell " id="" style="padding-left:7px;">
+						<a class=" ">
+							总价<span class="mui-pull-right cl-red ">¥<span class="all_price"></span></span>
+						</a>
+					</li>
+					
+					<li class="mui-table-view-cell" id="" style="padding-left:7px;    ">
+						<a class=" " >
+							邮费 <span style="    font-size: 12px;color: #8f8f94;">(总价满30元包邮)</span><span class="mui-pull-right cl-red">
+								¥<span class="sales_postage"></span>
+							</span>
+						</a>
+					</li>
+					
 					<li>
 						<div class="mui-input-row">
 							<label class="lbl-remarks">订单备注</label>
@@ -61,8 +83,7 @@
 						</div>
 					</li>
 				</ul>
-				<div class="mui-content-padded mui-text-right">合计:<span class="pro-price">¥<span class="count_price">0.0</span></span>
-				</div>
+				
 			</div>
 
 			<div class="buy-footer1">
@@ -124,7 +145,7 @@
 				location.href = 'channel-clearing.html?channelType='+channelType+'&channelId='+channelId; //跳转结算页面
 			}
 			
-			//var wechatAddr = new Object();
+			var wechatAddr = new Object();
 			
 			
 			mui.ready(function() {
@@ -227,7 +248,12 @@
 										}else{
 											wechatAddr.status = false;
 										}
-										$(".count_price,.pay_price").text((dt.data.payTotal / 100).toFixed(2));
+										$(".count_price,.pay_price,.all_price").text(accDiv(dt.data.payTotal,100));
+										if(accDiv(dt.data.payTotal,100) < 30){
+											$(".sales_postage").text(10);
+										}else{
+											$(".sales_postage").text(0);
+										}
 										$("#pro-count").text(proCount);
 										$(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
 									} else {
@@ -339,12 +365,30 @@
 					if(price <= 0) {
 						price = 0.0; //判断商品价格减去现金券价格若<0 则显示0
 					}
+					$(".all_price").text(price);
+					var postage = 0;
+					if(price<30){
+						$(".sales_postage").text(10);
+						postage = 10;
+					}else{
+						$(".sales_postage").text(0);
+					}
+					price = parseFloat(price + postage);
 					$(".pay_price").text(price);
 				} else {
 					yhq_id = '';
 					$(".btn-youhuiquan").removeAttr("couponid");
 					$(".btn-youhuiquan span").text("不使用现金券");
-					$(".pay_price").text($(".count_price").text());
+					
+					$(".all_price").text($(".count_price").text());
+					var salesPostage = $(".count_price").text();
+					if(salesPostage < 30 ){
+						$(".sales_postage").text(10);
+						salesPostage += 10;
+					}else{
+						$(".sales_postage").text(0);
+					}
+					$(".pay_price").text(parseFloat(salesPostage));
 				}
 				$(".my-picker").removeClass("active"); //隐藏弹窗
 				$(".mui-backdrop").remove(); //移除遮罩层

+ 19 - 1
tooth/order-details.html

@@ -14,6 +14,9 @@
 			// 屏蔽分享
 			window.hiddenAllWechatMenu = true;
 		</script>
+		<style>
+			.mui-table-view-cell>a:not(.mui-btn) {margin-left: -12px;}
+		</style>
 	</head>
 
 	<body>
@@ -76,6 +79,11 @@
 							抵扣金额<span class="mui-pull-right">-¥<span id="couponReduce">0.00</span></span>
 						</a>
 					</li>
+					<li class="mui-table-view-cell" style="padding-left:7px;" id="">
+						<a class="btn-youhuiquan">
+							邮费<span class="mui-pull-right">¥<span id="salesPostage">0.00</span></span>
+						</a>
+					</li>
 				</ul>
 				<div class="mui-content-padded mui-text-right">实付:<span class="pro-price">¥<span id="salesYetAmount">0.00</span></span></div>
 			</div>
@@ -162,9 +170,17 @@
 							if(order.salesPostNum != null && order.salesPostNum != "" && typeof(order.salesPostNum) != "undefined"){
 								$("#salesPostNum").val(order.salesPostNum);
 							}
+							var isPostage = 0;
+							if(order.salesPostage == null || typeof(order.salesPostage)=="undefined"){
+								$("#salesPostage").html(0);
+							}else{
+								isPostage = order.salesPostage
+								$("#salesPostage").html(accDiv(order.salesPostage,100));
+							}
+							
 							
 							// if(order.couponReduce != null && order.couponReduce != "" && typeof(order.couponReduce) != "undefined"){
-								var newCouponReduce = order.salesAmount - order.salesYetAmount;
+								var newCouponReduce = order.salesAmount - order.salesYetAmount + isPostage;
 								if(newCouponReduce <= 0){
 									newCouponReduce = 0;
 									$("#isCouponReduce").hide();
@@ -176,6 +192,8 @@
 // 								$("#isCouponReduce").hide();
 // 							}
 							$("#salesYetAmount").html(accDiv(order.salesYetAmount,100));
+							
+							
 							var str = "";
 							mui.each(order.orderItemList, function(index) {
 								str += '<div class="mui-table"><div class="mui-table-cell mui-col-xs-5"><img class="mui-media-object wh-100" src="'+ this.itemProductPic +'"></div><div class="mui-table-cell table-middle mui-col-xs-7" style="line-height:2.5">'+ this.itemProductName +'<h6>颜色:'+ this.productColor +'<span class="center">数量:'+ this.itemNum +'</span></h6><div>¥'+ accDiv(this.itemProductDiscount,100) +'</div></div></div>';