浏览代码

上朵微商城修改bug

wangxiaoming 6 年之前
父节点
当前提交
0a402c7228

+ 2 - 1
tooth/channel-clearing.html

@@ -206,7 +206,8 @@
 										
 										var liNote = "";
 										var yhq_str = "";
-										if(dt.data.couponItems.length > 0) {
+										if(dt.data.couponItems!=null && typeof(dt.data.couponItems)!=undefined &&
+											dt.data.couponItems.length > 0 && channelType==0 && channelId ==0) {
 											$("#ul-youhuiquan").show();
 											var str = '';
 											mui.each(dt.data.couponItems, function() {

+ 2 - 1
tooth/clearing.html

@@ -171,7 +171,8 @@
 										
 										var liNote = "";
 										var yhq_str = "";
-										if(dt.data.couponItems.length > 0) {
+										if(dt.data.couponItems!=null && typeof(dt.data.couponItems)!=undefined &&
+											dt.data.couponItems.length > 0 && channelType==0 && channelId ==0) {
 											$("#ul-youhuiquan").show();
 											var str = '';
 											mui.each(dt.data.couponItems, function() {

二进制
tooth/images/product/pro-channel-bo.jpg


二进制
tooth/images/product/pro-channel-et.jpg


二进制
tooth/images/product/pro-channel-qs.jpg


+ 51 - 4
tooth/pro-list-channel.html

@@ -29,8 +29,8 @@
 	<body>
 		<!--内容开始-->
 		<div class="mui-content">
-			<ul class="mui-table-view mui-table-view-striped my-view-no mui-table-view-condensed" style="margin-top: 5px;">
-				<li class="mui-table-view-cell">
+			<ul class="mui-table-view mui-table-view-striped my-view-no mui-table-view-condensed" id="con_product_list" style="margin-top: 5px;">
+				<!--<li class="mui-table-view-cell">
 					<div class="mui-table">
 		                <div class="mui-table-cell mui-col-xs-12">
 		                    <img width="100%" src="images/pro-channel-1.jpg">
@@ -56,10 +56,10 @@
 		                    <h4 class="pro-title">上朵儿童款声波牙刷</h4>
 		                    <p class="pro-desc">柔羽呵护刷毛,专为孩子定制</p>
 		                    <span class="pro-price">¥249.00</span><s class="pro-delete">¥289.00</s>
-		                    <button type="button" class="mui-btn btn-buy-know pro-datail" color="76">立即购买</button>
+		                    <button type="button" class="mui-btn btn-buy-know pro-datail" color="208">立即购买</button>
 		                </div>
 		            </div>
-				</li>
+				</li>-->
 			</ul>
 		</div>
 		<!--内容结束-->
@@ -86,6 +86,53 @@
 			//ready事件
 			mui.ready(function() {
 				$(".loading").hide().css("opacity", "0");//隐藏(正在加载...)
+			
+				$.ajax(base_path + '/wechat/channelAdmin/getProductList?dates=' + new Date().getTime(), {
+					data: {
+						"channelType": channelType,
+						"channelId": channelId
+					},
+					dataType: 'json',
+					xhrFields: {
+						withCredentials: true
+					},
+					crossDomain: true,
+					type: 'get',
+					timeout: 15000,
+					success: function(dt) {
+						if(dt.isRedirect) {
+							location.href = dt.redirectURL;
+						} else {
+							console.log(dt);
+							var str = '';
+							mui.each(dt.data, function(index) {
+								
+								str += '<li class="mui-table-view-cell">'
+									+ '<div class="mui-table">'
+									+ '<div class="mui-table-cell mui-col-xs-12">'
+									+ '<img width="100%" src="'+ this.productIntroduceImg +'">'
+									+ '</div></div>'
+									+ '<div class="mui-table">'
+									+ ' <div class="mui-table-cell mui-col-xs-12">'
+									+ '<h4 class="pro-title">'+ this.productName +'</h4>'
+									+ '<p class="pro-desc">'+ this.productColorDes +'</p>'
+									+ '<span class="pro-price">¥'+ accDiv(this.productDiscount,100) +'</span><s class="pro-delete">¥'+ accDiv(this.productPrice,100) +'</s>'
+									+ '<button type="button" class="mui-btn btn-buy-know pro-datail" color="'+ this.colorId +'" >立即购买</button>'
+									+ ' </div>'
+									+ ' </div>'
+									+ ' </li>'
+							});
+
+							$("#con_product_list").html(str);
+							$(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
+						}
+					},
+					error: function(xhr, type, errorThrown) {
+						console.log(xhr);
+						mui.alert("获取订单列表失败!网络错误");
+					}
+				});
+		
 			});
 			
 			//跳转产品详情

+ 6 - 3
tooth/pro-list.html

@@ -120,11 +120,14 @@
 								} else {
 									if(dt.status) {//判断接口返回状态status
 										var table = document.body.querySelector('.my-table-pull');//table是插入数据li的父级容器
-										mui('#pullrefresh_pro_list').pullRefresh().endPullupToRefresh(dt.data.productColorList.length<pagesize);//endPullupToRefresh(ture)表示没有更多数据了,停止上拉加载
-										mui.each(dt.data.productColorList, function(index) {
+										mui('#pullrefresh_pro_list').pullRefresh().endPullupToRefresh(dt.data.lastPage?false:true);//endPullupToRefresh(ture)表示没有更多数据了,停止上拉加载
+										mui.each(dt.data.list, function(index) {
 											var li = document.createElement('li');//创建li标签
 											li.className='mui-table-view-cell mui-media mui-col-xs-6';//給li标签className
-											li.innerHTML = '<a name="'+this.colorId+'" style="margin-top: 15px;"><img class="mui-media-object" src="'+this.colorImg+'"><div class="pro-name">'+this.productName+'</div><h6 style="margin-top: 5px;">'+this.colorName+'</h6><div class="pro-price" style="margin-top: 10px;">¥'+(this.colorDiscount/100).toFixed(2)+'</div></a>';
+											li.innerHTML = '<a name="'+this.colorId+'" style="margin-top: 15px;">'
+														+'<img class="mui-media-object" src="'+ this.productIntroduceImg +'"><div class="pro-name">'+this.productName+'</div>'
+//														+'<h6 style="margin-top: 5px;">'+this.colorName+'</h6>'
+														+'<div class="pro-price" style="margin-top: 10px;">¥'+ this.productShowPrice +'</div></a>';
 											table.appendChild(li);//将li插入table
 										});	 
 

+ 9 - 3
tooth/register-vip.html

@@ -213,9 +213,15 @@
 				}else{
 					isNeedPhone = 1;
 					$("#js-phone").show();
+					
+					if(countdown == 60) {
+						$(".pull-code").removeAttr("disabled").addClass("active");
+					} else {
+						$(".pull-code").attr("disabled", "disabled").removeClass("active");
+					}
 				}
 				
-				var mobile = /^(13|14|15|17|18)[0-9]{9}$/; //手机号码
+				var mobile = /^(|10|11|12|13|14|15|16|17|18|19)[0-9]{9}$/; //手机号码
 				if(phone.length == 11) {
 					
 					if(mobile.test(phone) && countdown == 60) {
@@ -234,7 +240,7 @@
 			$(document).on('tap', '.pull-code', function() {
 				
 				var th = $(this);
-				var mobile = /^(13|14|15|17|18)[0-9]{9}$/; //手机号码
+				var mobile = /^(|10|11|12|13|14|15|16|17|18|19)[0-9]{9}$/; //手机号码
 				var phone = $("#ipt-phone").val();
 				if(mobile.test(phone)) {
 					settime(th);
@@ -596,7 +602,7 @@
 				var ch_en_num = /^[A-Za-z_\-\u4e00-\u9fa5]{2,10}$/; //简体中文英文(2-10位)
 				var positive_int = /^[0-9]\d*$/; //正整数0-9
 				var code_int = /^[0-9]{4}$/; //正整数0-9,4位数字
-				var mobile = /^(13|14|15|17|18)[0-9]{9}$/; //手机号码
+				var mobile = /^(|10|11|12|13|14|15|16|17|18|19)[0-9]{9}$/; //手机号码
 				var full_date = /^\d{4}(\-|\/|.)\d{1,2}\1\d{1,2}$/; //日期格式 (2016\12\12,2016-12-12,2016.12.12)
 
 				var name = $("#ipt-name").val().trim(),