Jelajahi Sumber

Merge branch 'master' of http://git.iamberry.com/liujiankang/static

wangxiang 7 tahun lalu
induk
melakukan
380f651ed9

+ 8 - 7
aiberle/clearing.html

@@ -172,6 +172,7 @@ var yhq_id='';			mui.ready(function() {
 										$("#pro-count").text(dt.data.cartItems.length);
 									} else {
 										mui.alert(dt.message);
+										location.href = "shopping-cart.html?dates=" + new Date().getTime(); // 前往购物车
 									}
 								}
 							},
@@ -297,7 +298,7 @@ var yhq_id='';			mui.ready(function() {
 							location.href = 'pay-win.html?orderId=' + dt.data.orderId + "&dates=" + new Date().getTime();
 							return;
 						};
-
+						var orderId=dt.data.orderId;
 						if(dt.status) {
 							var str = dt.data.info;
 							var obj = JSON.parse("{" + str + "}");
@@ -306,7 +307,7 @@ var yhq_id='';			mui.ready(function() {
 								if(res.err_msg == 'get_brand_wcpay_request:ok') {
 									$.ajax(base_path + '/wechat/order/checkOrderPaySuccess?dates=' + new Date().getTime(), {
 												data: {
-													"orderId": dt.data.orderId
+													"orderId": orderId
 												},
 												dataType: 'json',
 												xhrFields: {
@@ -320,9 +321,9 @@ var yhq_id='';			mui.ready(function() {
 														location.href = dataobj.redirectURL;
 													} else {
 														if(dataobj.status == true) { // 支付成功
-															location.href = "pay-win.html?orderId=" + dataobj.data + "&dates=" + new Date().getTime();
+															location.href = "pay-win.html?orderId=" + orderId + "&dates=" + new Date().getTime();
 														} else {
-															location.href = "order-details.html?orderId=" + dataobj.data + "&dates=" + new Date().getTime(); // 前往订单详情
+															location.href = "order-details.html?orderId=" + orderId + "&dates=" + new Date().getTime(); // 前往订单详情
 														}
 													}
 												},
@@ -348,15 +349,15 @@ var yhq_id='';			mui.ready(function() {
 //									});
 								} else {
 									isPay = true;
-									mui.alert("对不起,支付失败!请稍后重试!" + dt.data.orderId + "支付失败!", function() {
-										location.href = "order-details.html?orderId=" + dt.data.orderId + "&dates=" + new Date().getTime(); // 前往订单详情
+									mui.alert("对不起,支付失败!请稍后重试!" + orderId + "支付失败!", function() {
+										location.href = "order-details.html?orderId=" + orderId + "&dates=" + new Date().getTime(); // 前往订单详情
 									});
 								}
 							});
 						} else {
 							isPay = true;
 							mui.alert(dt.message);
-							location.href = "order-details.html?orderId=" + dt.data.orderId + "&dates=" + new Date().getTime(); // 前往订单详情
+							location.href = "order-details.html?orderId=" + orderId + "&dates=" + new Date().getTime(); // 前往订单详情
 						}
 					},
 					error: function(xhr, type, errorThrown) {

+ 4 - 3
aiberle/coupon_list.html

@@ -66,9 +66,9 @@
 		<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
 		<script>
 			//屏蔽分享
-			document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
-				WeixinJSBridge.call('hideOptionMenu');
-			});
+//			document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
+//				WeixinJSBridge.call('hideOptionMenu');
+//			});
 		</script>
 	</head>
 	<body>
@@ -132,6 +132,7 @@
 					crossDomain: true,
                     timeout:15000,
                     success:function(dt){
+                    	console.log(dt);
                     	if(dt.isRedirect) {
                     		location.href = dt.redirectURL;
                 		} else {

+ 2 - 0
aiberle/css/main.css

@@ -98,6 +98,8 @@ p{color: #999;font-size: 12px;}
 .details-title{padding: 14px 0 0 0;text-align: left;}
 .details-title .icon-liwu{font-size: 16px;margin-right: 5px;color: #ff4b4b;}
 .pro-price{color: #ff3b3b;text-align: left;padding: 0 0 5px 0;}
+.fixed-cart{position: fixed;right: 10px;bottom:80px;line-height: 50px;text-align: center; border-radius: 50%;background-color:rgba(0,0,0,.1);width: 50px;height:50px;}
+.my-badge-danger{position: absolute;top: 6px;right: 4px;background-color: #f00;color: #fff;display: none;}
 .mui-table-view.mui-grid-view .mui-col-xs-5 .mui-media-object{width: 90%;padding-top: 3%;}
 .my-picker{position: fixed;bottom: 0;padding-top: 0;max-height: 500px; left: 0;width: 100%;z-index: 999; background-color: #fff; -webkit-transform: translateY(100%);transform: translateY(100%); -webkit-transition: .5s;transition: .5s;}
 .my-picker.active{-webkit-transform: translateY(0%);transform: translateY(0%);}

+ 1 - 0
aiberle/index.html

@@ -416,6 +416,7 @@
 				$(".autocompleter-list").empty().css("height", "auto");
 				$('.autocompleter-hint').removeClass('autocompleter-hint-show').empty();
 				$(".icon-caidan").show();
+				$('#search').blur();
 			});
 			//打开菜单
 			$(document).on('tap', '.icon-caidan', function() {

+ 2 - 2
aiberle/my-center.html

@@ -44,9 +44,9 @@
 				<img width="100%" src="images/top-1.png" />
 				<div style="position: absolute;left: 0; top: 45%;-webkit-transform: translateY(-50%);width: 100%;text-align: center;">
 					<div class="user-head">
-						<img id="headDiv" src="" />
+						<img id="headDiv" src="images/tx-1.jpg" />
 					</div>
-					<div id="userNickname"></div>
+					<div id="userNickname">微信用户</div>
 				</div>
 			</div>
 			<div style="padding:0;background: #fff;margin-bottom: 8px;">

+ 11 - 10
aiberle/order-details.html

@@ -149,9 +149,9 @@
 									mui(this.salesUserGiftList).each(function(index) {
 	                                    var txt_gift = this;
 	                                    if (index == 0) {
-	                                        a += '<h6>赠品:' + txt_gift.giftName + '&nbsp;&nbsp;&nbsp;&nbsp;数量:' + txt_gift.userGiftCount*num + '</h6>';
+	                                        a += '<h6>赠品:' + txt_gift.giftName + '&nbsp;&nbsp;&nbsp;&nbsp;数量:' + txt_gift.userGiftCount + '</h6>';
 	                                    } else {
-	                                        a += '<h6>&nbsp;&nbsp;&nbsp;&nbsp;' + txt_gift.giftName + '&nbsp;&nbsp;&nbsp;&nbsp;数量:' + txt_gift.userGiftCount*num + '</h6>';
+	                                        a += '<h6>&nbsp;&nbsp;&nbsp;&nbsp;' + txt_gift.giftName + '&nbsp;&nbsp;&nbsp;&nbsp;数量:' + txt_gift.userGiftCount + '</h6>';
 	                                    }
 	                                });
 	                                str += a
@@ -173,6 +173,7 @@
 									}
 								} 
 								var payHtml = '<button type="button" class="mui-btn my-btn-request go_pay"  style="margin-right: 20px;">立即支付</button>';
+								var cancelOrderHtml = '<button type="button" class="mui-btn my-btn-request go_cancel"  style="margin-right: 20px;">取消订单</button>';
 								var aftermarketHtml = '<button type="button" class="mui-btn my-btn-request go_aftermarket" style="margin-right: 20px;">我要售后</button>';
 								var cancelHtml = '<button type="button" class="mui-btn my-btn-request go_cancel" style="margin-right: 20px;">取消申请</button>';
 								var confirmHtml = '<button type="button" class="mui-btn my-btn-request go_confirm" style="margin-right: 20px;">确认收货</button>';
@@ -185,7 +186,7 @@
 										break;
 									case 1 : 
 										statusName = "待支付";
-										operationHtml += payHtml;
+										operationHtml += payHtml + cancelOrderHtml;
 										break;
 									case 2 : 
 										statusName = "已支付";
@@ -320,14 +321,16 @@
 			 */
 			mui('body').on('tap', '.go_cancel', function() {
 				var newStatus;
-				if(status == 3){  //申请退款的
-					newStatus = 3
+				if(status == 1){//取消订单
+					newStatus = 1;
+				}else if(status == 3){  //申请退款的
+					newStatus = 3;
 				}else if(status == 6){  //申请退货的
-					newStatus = 5
+					newStatus = 5;
 				}else if(status == 7){ //退货中 的
-					newStatus = 6
+					newStatus = 6;
 				}else if(status == 11){
-					newStatus = 8
+					newStatus = 8;
 				}
 				if(status != null){
 					updateOrderStatus(orderId,newStatus,"");
@@ -335,8 +338,6 @@
 			});
 			
 			
-			
-			
 			/*修改订单状态*/
 			function updateOrderStatus(orderId, status, remark) {
 				var msg = "";

+ 3 - 3
aiberle/order-list.html

@@ -249,15 +249,15 @@
                              var orderDesc = '<button type="button" class="my-order-btn" onclick="order_details(\'' + txt_order.salesOrderid + '\')">订单详情</button>';
                             if (txt_order.salesStatus == 1) {
                                 if(txt_order.salesAdminRemark > 0) {
-                                    SetRemainTime("setName" + index, index, this.salesAdminRemark);
-                                    a += '<h6><span class="my-btn-orange" id="testid' + index + '"></span>分钟后,订单失效</h6>';
+                                    //SetRemainTime("setName" + index, index, this.salesAdminRemark);
+                                    //a += '<h6><span class="my-btn-orange" id="testid' + index + '"></span>分钟后,订单失效</h6>';
                                 }
                                 a += '<li class="mui-table-view-cell mui-media mui-col-xs-7 mui-text-right"><button type="button" class="my-order-btn" onclick="goOrderPay(\'' + txt_order.salesOrderid + '\')">立即支付</button>';
                                 a += orderDesc;
                                 a += '</li>';
                             } else if (txt_order.salesStatus == 2) {
                             	a += ali;
-                                a += '<button type="button" class="my-order-btn" onclick="warnSend(\'' + txt_order.salesOrderid + '\',\'' + txt_order.salesStatus + '\')">提醒发货</button>';
+                                //a += '<button type="button" class="my-order-btn" onclick="warnSend(\'' + txt_order.salesOrderid + '\',\'' + txt_order.salesStatus + '\')">提醒发货</button>';
                             	a += orderDesc;
                             	a += ali2;
                             } else if (txt_order.salesStatus == 5) {

+ 51 - 2
aiberle/pro-details.html

@@ -16,7 +16,11 @@
 		<footer class="mui-bar mui-bar-tab">
 			<ul class="mui-table-view mui-table-view-striped mui-table-view-condensed my-grid-view-no">
 				<li class="mui-table-view-cell">
-					<div class="mui-table"><div class="mui-table-cell mui-col-xs-4 table-middle add-gouwuche ico-gouwuche"><span class="iconfont icon-gouwuche"></span></div><div class="mui-table-cell mui-col-xs-8 table-middle div-btn-buy-know">立即购买</div></div>
+					<div class="mui-table">
+						<div class="mui-table-cell mui-col-xs-4 table-middle go-index"><img style="width: 60%;vertical-align: middle;" src="images/logo.png" /></div>
+						<div class="mui-table-cell mui-col-xs-4 table-middle add-gouwuche" style="background-color: #ccc;color: #fff;font-size: 18px;">加入购物车</div>
+						<div class="mui-table-cell mui-col-xs-4 table-middle div-btn-buy-know">立即购买</div>
+					</div>
 				</li>
 			</ul>
 		</footer>
@@ -80,6 +84,10 @@
 		        </li>-->
 		   </ul>
 		</div>
+		<div class="fixed-cart">
+			<span class="iconfont icon-gouwuche"></span>
+			<span class="mui-badge my-badge-danger">0</span>
+		</div>
 		<!-- 加载ing -->
 		<div class="loading covers">
 			<div class="loading-bj"></div>
@@ -163,6 +171,7 @@
 		                						+zen+'</br>'	
 		                						+'<a><img class="mui-media-object" src="'+ productInfo.productIntroduceImg +'"></a>';
 								table.appendChild(li);
+								getCartNumber();//获取购物车数量
 								fenxiang();
 								$(".loading").hide().css("opacity", "0");
 							} else {
@@ -213,6 +222,7 @@
 								} else {
 									if(dt.status) {
 										th.parent().attr("cartid", dt.data);
+										getCartNumber()
 										console.log("增加数量成功!");
 									} else {
 										mui.alert("增加数量失败!");
@@ -260,6 +270,7 @@
 							} else {
 								if(dt.status) {
 									console.log("减少数量数量成功!");
+									getCartNumber()
 								} else {
 									mui.alert("减少数量数量失败!");
 								}
@@ -317,7 +328,7 @@
 								if(count > 0) {
 									$(".my-btn-buy-know").removeAttr("disabled"); //激活结算按钮
 								}
-								if(th.hasClass("ico-gouwuche")) {
+								if(th.hasClass("add-gouwuche")) {
 									$(".my-btn-buy-know").attr("cart", "cart");
 								}
 								mui(".mui-numbox").numbox(); //激活加减按钮组合
@@ -370,6 +381,44 @@
 					}
 				}
 			});
+			$(document).on('tap', '.go-index', function() {
+				location.href='index.html';
+			});	
+			$(document).on('tap', '.fixed-cart', function() {
+				location.href='shopping-cart.html';
+			});
+			//获取购物车数量
+			function getCartNumber(){
+				$.ajax(base_path + '/wechat/cart/getCartNumByCartOpenId?dates=' + new Date().getTime(), {
+						data: {},
+						dataType: 'json',
+						xhrFields: {
+							withCredentials: true
+						},
+						crossDomain: true,
+						type: 'get', 
+						timeout: 15000,
+						success: function(dt) {
+							if(dt.isRedirect) {
+								location.href = dt.redirectURL;
+							} else {
+								if(dt.status) {
+									if(dt.data>0){
+										$(".fixed-cart .my-badge-danger").text(dt.data).show();
+									}else{
+										$(".fixed-cart .my-badge-danger").text(dt.data).hide();
+									}
+								} else {
+									mui.alert("获取购物车数量失败!");
+								}
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(xhr);
+							mui.alert("获取购物车数量失败!网络错误");
+						}
+					});
+			}
 			//分享			
 			function fenxiang(){
 				var src = location.href;

+ 2 - 2
aiberle/pro-list.html

@@ -20,7 +20,7 @@
 				<a class="mui-control-item" href="#item3">电动牙刷</a>-->
 			</div>
 		</header>
-		<!--<footer class="mui-bar mui-bar-tab">
+		<footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
 			<a class="mui-tab-item">
 				<span class="iconfont icon-shouye"></span>
 				<span class="mui-tab-label">首页</span>
@@ -37,7 +37,7 @@
 				<span class="iconfont icon-wode"></span>
 				<span class="mui-tab-label">我的</span>
 			</a>
-		</footer>-->
+		</footer>
 		<div class="mui-content">
 			<!--<div class="index-title">
 				<strong>选购</strong>

+ 1 - 0
aiberle/shopping-cart.html

@@ -233,6 +233,7 @@
 											$(".gwc_null,#footer-bar-tab").show();
 										}
 										calculator();
+										mui.toast("删除成功");
 									} else {
 										alert(dt.message);
 									}