Browse Source

Revert "修改bug."

This reverts commit 466d489aa46396c2333fc33201a7c554d59986b0.
zhangfufeng 4 months ago
parent
commit
85f87bc58a
2 changed files with 50 additions and 51 deletions
  1. 35 36
      pages/checkout/checkout.js
  2. 15 15
      pages/goods/goods.wxml

+ 35 - 36
pages/checkout/checkout.js

@@ -106,7 +106,7 @@ Page({
     message: '',
     grouponLinkId: 0, //参与的团购
     grouponRulesId: 0, //团购规则ID
-    nurseId: 0, //安心包认证id
+    nurseId: 0, //安心包认证id 
     petinfo: null, //宠物保险内容
     shareId: 0,
     userInfo: {},
@@ -130,7 +130,7 @@ Page({
       userCouponId: that.data.userCouponId,
       grouponRulesId: that.data.grouponRulesId,
 			shareId: that.data.shareId,
-
+	
     }).then(function (res) {
       if (res.errno === 0) {
         that.setData({
@@ -151,7 +151,7 @@ Page({
           couponId: res.data.couponId,
           userCouponId: res.data.userCouponId,
           grouponRulesId: res.data.grouponRulesId,
-          isNeedAppoint: appType == "1" ? true : false, //0需要预约 服务类商品,1保险 2中介 3买约分离次卡res.data.checkedGoodsList[0].goods.type === 0 ||
+          isNeedAppoint: appType == "1" ? true : false, //0需要预约 服务类商品,1保险 2中介 3买约分离次卡res.data.checkedGoodsList[0].goods.type === 0 || 
           isOneAppoint: res.data.checkedGoodsList[0].product.serviceTimes == 1 ? true : false, //1为单次,其余为多次
           popupType: res.data.checkedGoodsList[0].product.serviceTimes == 1 ? 1 : 2,
           bookStartDate: res.data.bookStartDate,
@@ -179,7 +179,7 @@ Page({
 
 
         }
-				if(res.data.addressId==null&&res.data.addressMsg!=null){
+				if(res.data.addressId==null&&res.data.addressMsg!=null){ 
 					wx.showToast({
 						title: res.data.addressMsg,
 						icon:'none'
@@ -191,7 +191,7 @@ Page({
       wx.hideLoading();
     });
   },
-  LimitCanAppointmentDate() { //特殊商品 如果需要限制可预约的时间范围 在次方法中实现
+  LimitCanAppointmentDate() { //特殊商品 如果需要限制可预约的时间范围 在次方法中实现 
     if (this.data.checkedGoodsList[0].goodsId == 1190332) {
       let dates = [];
       this.data.dateList.forEach(item => {
@@ -231,16 +231,16 @@ Page({
     //   console.info(" dateIndex:4")
     //   this.setData({
     //     dateIndex:4
-    //   })
+    //   }) 
     // }else{
     //   if(this.data.dateList[2].id==0) {
 
     //   console.info(" dateIndex:3")
     //     this.setData({
     //       dateIndex:3
-    //     })
+    //     }) 
     //   }
-    // }
+    // } 
   },
   selectAddress() {
     wx.navigateTo({
@@ -322,7 +322,7 @@ Page({
       });
   },
   onReady: function () {
-    // 页面渲染完成
+    // 页面渲染完成 
 
   },
   onShow: function () {
@@ -401,7 +401,7 @@ Page({
     // 页面关闭
     //清空宠物保险的缓存数据
     console.info('checkout onload')
-    //wx.setStorageSync('petinfo'+this.data.cartId, null);
+    //wx.setStorageSync('petinfo'+this.data.cartId, null); 
 
   },
   submitOrder: function () {
@@ -504,7 +504,7 @@ Page({
       petinfo: this.data.petinfo,
       shareId: this.data.shareId,
       recCode: this.data.recCode ? this.data.recCode : this.data.rId, //服务者推荐id(如果填写推荐码 以填写为准)
-      fraId: this.data.fraId, //加盟商id
+      fraId: this.data.fraId, //加盟商id   
       channelId: this.data.channelId, //渠道码
       //预约参数信息
 			orderDate: orderData,
@@ -547,7 +547,7 @@ Page({
           util.redirect('/pages/ucenter/order/order');
           return;
         }
-        // 下单成功,重置couponId
+        // 下单成功,重置couponId 
         wx.setStorageSync('couponId', 0);
         const orderId = res.data.orderId;
         this.setData({
@@ -584,7 +584,7 @@ Page({
 								},
 								'fail': res => {
 									console.log("支付过程失败");
-
+	
 									// wx.redirectTo({
 									//   url: '/pages/checkout/payResult/payResult?status=0&orderId=' + orderId
 									// });
@@ -592,7 +592,7 @@ Page({
 									this.setData({
 										payFailShow: true,
 										remarkDisable: true
-
+	
 									});
 								},
 								'complete': function (res) {
@@ -622,7 +622,7 @@ Page({
 								},
 								'fail': res => {
 									console.log("支付过程失败");
-
+	
 									// wx.redirectTo({
 									//   url: '/pages/checkout/payResult/payResult?status=0&orderId=' + orderId
 									// });
@@ -630,7 +630,7 @@ Page({
 									this.setData({
 										payFailShow: true,
 										remarkDisable: true
-
+	
 									});
 								},
 								'complete': function (res) {
@@ -638,7 +638,7 @@ Page({
 								}
 							});
 						}
-
+          
           } else {
             // 弹出支付失败
             this.setData({
@@ -686,7 +686,7 @@ Page({
     return monthDatas;
   },
 
-  //天数计算
+  //天数计算 
   surplusDay: function (year, month, day) {
     var days = 31;
     var dayDatas = [];
@@ -703,7 +703,7 @@ Page({
       case 12:
         days = 31;
         break;
-        //对于2月份需要判断是否为闰年
+        //对于2月份需要判断是否为闰年 
       case 2:
         if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
           days = 29;
@@ -732,7 +732,7 @@ Page({
     }
     return dayDatas;
   },
-  //时间计算
+  //时间计算 
   surplusHour: function (year, month, day, hour) {
     var date = new Date();
     var year2 = date.getFullYear()
@@ -747,8 +747,8 @@ Page({
     return hours;
   },
 
-  /**
-   * 生命周期函数--监听页面加载
+  /** 
+   * 生命周期函数--监听页面加载 
    */
   onLoad: function (options) {
     this.setData({
@@ -851,7 +851,7 @@ Page({
     })
   },
 
-  //某一列的值改变时触发
+  //某一列的值改变时触发 
   bindMultiPickerColumnChange: function (e) {
     var date = new Date();
     var year1 = date.getFullYear()
@@ -957,11 +957,11 @@ Page({
         var hour = hourStr.substring(0, hourStr.length - 1);
         data.startHour = hour;
         console.log('起始时间' + hour + " day1:" + day1);
-        /*var endhours2 = [];
-        var end = ['09时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '20时'];
-          for (var i = e.detail.value; i < end.length; i++) {
-             endhours2.push(end[i]);
-          }
+        /*var endhours2 = [];  
+        var end = ['09时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '20时']; 
+          for (var i = e.detail.value; i < end.length; i++) { 
+             endhours2.push(end[i]); 
+          }  
         data.multiArray[5] = endhours2; */
         if (e.detail.value > data.multiIndex[5])
           data.multiIndex[5] = e.detail.value;
@@ -978,7 +978,7 @@ Page({
     }
     this.setData(data)
   },
-  //value 改变时触发 change 事件
+  //value 改变时触发 change 事件 
   bindMultiPickerChange: function (e) {
     console.info(e);
     console.info(this.data.multiArray);
@@ -1058,7 +1058,7 @@ Page({
 			timeList:list
 		});
 
-
+   
   },
   timeCheck(e) {
     let index = e.currentTarget.dataset.index;
@@ -1516,12 +1516,11 @@ Page({
       });
 	},
 	getDayTime() {
-
+   
     let params = {
-	  days:30,
+			days:30,
       goodsId: this.data.checkedGoodsList[0].goodsId,
-      serviceDuration:this.data.serviceDuration,
-      productId:this.data.checkedGoodsList[0].product.id,
+			serviceDuration:this.data.serviceDuration
     }
     wx.showLoading({
       title: '加载中',
@@ -1544,7 +1543,7 @@ Page({
 					this.setData({
 						timeList:list
 					});
-
+        
 
         } else {
 
@@ -1579,4 +1578,4 @@ Page({
 
 
 
-});
+});

+ 15 - 15
pages/goods/goods.wxml

@@ -34,12 +34,12 @@
 		</swiper-item>
 	</swiper>
 
-	<!-- 分享
+	<!-- 分享  
 	<view class='goods_name'>
 		<view class='goods_name_left'>{{goods.name}}</view>
-		<view hidden="{{!canShare}}" class="goods_name_right" bindtap="shareFriendOrCircle">
+		<view hidden="{{!canShare}}" class="goods_name_right" bindtap="shareFriendOrCircle"> 
 			<image class="img" src="/static/images/share.png" />
-		</view>
+		</view> 
 	</view>-->
 
 	<view class="share-pop-box" hidden="{{!openShare}}">
@@ -107,9 +107,9 @@
 					</view>
 					<text class="desc sub-color" wx:if="{{goods.brief}}">{{goods.brief}}</text>
 				</view>
-				<!-- <view class="price" wx:else>
+				<!-- <view class="price" wx:else> 
 					<view class="retailPrice">¥<text class="checked-price">{{checkedSpecPrice}}</text><text
-							wx:if="{{goods.type=='2'}}"> 起</text></view>
+							wx:if="{{goods.type=='2'}}"> 起</text></view> 
 					<view class="memberPrice"  wx:if="{{goods.memberPrice!=checkedSpecPrice}}">¥{{goods.memberPrice}}</view>
 					<view class="member-price-tag"  wx:if="{{goods.memberPrice!=checkedSpecPrice}}" bindtap="goMemberCenter">会员价</view>
 				</view> -->
@@ -158,7 +158,7 @@
 					<text class="c">{{item.adminContent}}</text>
 				</view>
 			</view>
-		</view>
+		</view> 
 	</view>-->
 
 	<!-- <view class="goods-attr">
@@ -227,8 +227,8 @@
 
 	</view>
 	<!-- 加购数量 -->
-	<!-- <view class="num-module" wx:if="{{goods.type==4}}">
-		<view class="plus-num">
+	<!-- <view class="num-module" wx:if="{{goods.type==4}}"> 
+		<view class="plus-num"> 
 			<view class="title">购买数量</view>
 			<view class="calc-counter">
 				<view class="minus-btn {{plusNum==0?'disable':''}}" bindtap="minusNum">-</view>
@@ -252,8 +252,8 @@
 					value="{{plusNum}}" />
 				<view class="plus-btn" bindtap="addNum">+</view>
 			</view>
-		</view>
-	</view>
+		</view> 
+	</view>  
 	 -->
 
 
@@ -546,7 +546,7 @@
 
 
 	<!-- 自购&推广 分享进入有shareId不展示自购推广-->
-	<!-- (hasLogin&&userInfo.isDis)||(hasLogin&&shareId==0)
+	<!-- (hasLogin&&userInfo.isDis)||(hasLogin&&shareId==0) 
 	<view class="dis-order-wrapper" wx:if="{{hasLogin&&userInfo.isDis&&referee.self>0}}">
 		<view class="self-order" bindtap="goSelfPay">
 			<view class="buy-type">自购</view>
@@ -561,10 +561,10 @@
 		<view class="c" bindtap="addFast" wx:if="{{!soldout||!hasLogin}}">{{isGroupon?'参加团购':'立即预约'}}</view>
 		<view class="n" wx:if="{{soldout}}">商品已售空</view>
 	</block>-->
-	<block wx:if="{{goods.id==1190746||productList[0].type==0}}">
+	<block wx:if="{{goods.id==1190746||goods.type==0}}">
 		<view class="c" bindtap="addFast" data-type='1' wx:if="{{!soldout||!hasLogin}}">立即预约</view>
 	</block>
-	<view class="dis-order-wrapper" wx:elif="{{productList[0].type==0||productList[0].type==3}}">
+	<view class="dis-order-wrapper" wx:elif="{{goods.type==0||goods.type==3}}">
 		<view class="self-order" data-type='0' bindtap="addFast">
 			<view class="buy-type">先买后约</view>
 		</view>
@@ -572,7 +572,7 @@
 			<view class="buy-type jz-color" style="overflow: hidden;">立即预约</view>
 		</view>
 	</view>
-	<view class="dis-order-wrapper" wx:elif="{{productList[0].type==2}}">
+	<view class="dis-order-wrapper" wx:elif="{{goods.type==2||goods.type==4}}">
 		<view class="self-order" data-type='0' bindtap="addFast">
 			<view class="buy-type">立即购买</view>
 		</view>
@@ -721,4 +721,4 @@
 			</view>
 		</view>
 	</view>
-</van-overlay>
+</van-overlay>