WinG пре 2 година
родитељ
комит
c4ca79cbab

+ 0 - 1
app.json

@@ -71,7 +71,6 @@
         "pages/user/invite/material/material",
         "pages/user/identity/identity",
         "pages/user/bindoldsys/bindoldsys",
-        "pages/user/bankinfo/bankinfo",
         "pages/user/recharge/recharge",
         "pages/user/withdraw/withdraw",
         "pages/user/transfer/transfer",

+ 14 - 3
pages/canteen/canteen.js

@@ -7,7 +7,8 @@ Page({
 	canceltxt:'',
 	cancelnum:1,
 	canceldata:{},
-	cancelitem:{}
+	cancelitem:{},
+	oncancel:false
   },
   onShow:function(){
 	  console.log('onshow == canteen')
@@ -70,7 +71,7 @@ Page({
 		  canceltxt:`确定取消 ${selectdata['food_date']}(${selectdata['food_day']}) [${cncan}] 订单?`,
 		  canceldata:selectdata,
 		  cancelitem:selectoitem,
-		  cancelnum:1
+		  cancelnum:selectoitem['nums']
 	  })
   },
   hideCancelm(){
@@ -124,6 +125,9 @@ Page({
 		  "nums": parseInt(cancelnum),
 		  "type": parseInt(this.data.cancelitem.type)
 		}
+		this.setData({
+			oncancel:true
+		})
 		var success = function (res) {
 		  console.log('res',res);
 		  if(res.data.code == 0){
@@ -135,7 +139,8 @@ Page({
 			  setTimeout(function(){
 				  that.setData({
 					detail: {},
-					showCancelModal:false
+					showCancelModal:false,
+					oncancel:false
 				  })
 				  that.onShow();
 			  },500)
@@ -146,6 +151,12 @@ Page({
 			    icon: 'none',
 			    duration: 2000
 			  });
+			  setTimeout(function(){
+				  that.setData({
+				  	oncancel:false
+				  })
+			  },500)
+			  
 		  }
 		  
 		}

+ 3 - 2
pages/canteen/canteen.wxml

@@ -14,7 +14,7 @@
 	  	  <text class="text">扫码用餐</text>
 	  </view>
   </view>
-  <view class="list-title">历史订餐</view>
+  <view class="list-title">当前订餐</view>
   <view class="order-list" wx:for="{{detail}}">
 	  <view class="time-box">{{item.food_date}} ({{item.food_day}})</view>
 	  <view wx:for="{{item['details']}}" wx:for-item="oitem">
@@ -69,7 +69,8 @@
 				</view>
 			  </view>
 			  <view class="modal-cancel" bindtap="hideCancelm">取消</view>
-			  <view class="modal-confirm" bindtap="confirmDel">确定</view>
+			  <view class="modal-confirm" bindtap="confirmDel" wx:if="{{!oncancel}}">确定</view>
+			  <view class="modal-confirm" wx:else>操作中</view>
 		  </view>
 	  </view>
   </view>

+ 33 - 3
pages/canteen/order/order.js

@@ -26,7 +26,11 @@ Page({
 	cashTotal: 0,
 	orderprice:[4,10,10],//单点价格早,中,晚
 	ordersubprice:[2,4,4],//订餐价格早,中,晚
-	checkAll:false//全选
+	checkAll:false,//全选
+	loading:false,//是否执行中
+	can1:true,//单点时早餐是否可选
+	can2:true,//单点时中餐是否可选
+	can3:true//单点时晚餐是否可选
   },
   onLoad: function (options) {
 	  
@@ -94,15 +98,16 @@ Page({
     return `${year}-${month}-${day}`;
   },
   bindDateChange: function(e) {
-	  console.log('picker发送选择改变,携带值为', e.detail.value)
+	  console.log('picker1发送选择改变,携带值为', e.detail.value)
 	  this.setData({
 		date1: e.detail.value,
 		startdate2: e.detail.value
 	  })
+	  this.getSingleRule();
 	  this.calcOrder();
   },
   bindDateChange2: function(e) {
-  	  console.log('picker发送选择改变,携带值为', e.detail.value)
+  	  console.log('picker2发送选择改变,携带值为', e.detail.value)
   	  this.setData({
   		date2: e.detail.value
   	  })
@@ -114,6 +119,7 @@ Page({
 		   this.setData({
 		   	checkbox:[]
 		   });
+		   this.getSingleRule();
 	   }
 	   this.setData({
 			ordertype:e.detail.value,
@@ -121,6 +127,22 @@ Page({
 	   });
 	   this.calcOrder();
   },
+  getSingleRule() {
+    var that = this
+    var url = 'newapi:food/check-date?date='+this.data.date1;
+    var params = {
+    }
+    var success = function (res) {
+	  console.log('res',res)
+	  var data = res.data.data;
+	  that.setData({
+		  can1:data['1'],
+		  can2:data['2'],
+		  can3:data['3'],
+	  })
+    }
+    _request.$get(url, params, success)
+  },
   getOrdrList:function(e){
   	var that = this
   	var url = 'newapi:food/get-info'
@@ -408,6 +430,9 @@ Page({
 			})
 			return;
 		}
+		this.setData({
+			loading:true
+		})
 		
 		var that = this
 		var url = 'newapi:food/order-food'
@@ -429,6 +454,11 @@ Page({
 			    icon: 'none',
 			    duration: 2000
 			  })
+			  setTimeout(function(){
+				  that.setData({
+				  	loading:false
+				  })
+			  },500)
 		  }
 		}
 		_request.$post(url, JSON.stringify(paramorder), success);

+ 7 - 4
pages/canteen/order/order.wxml

@@ -68,7 +68,7 @@
 		  <!-- <checkbox-group bindchange="checkboxChange"> -->
 			<radio-group bindchange="checkboxChange">
 			<label class="checkbox">
-							<radio value="1"/>早餐
+							<radio value="1" disabled="{{!can1}}"/>早餐
 							<!-- <checkbox value="1"/>早餐 -->
 							
 							<view class="ctorder-numbox">
@@ -80,7 +80,7 @@
 							</view>
 			</label>
 			<label class="checkbox">
-							<radio value="2" />午餐
+							<radio value="2" disabled="{{!can2}}"/>午餐
 							<!-- <checkbox value="2" />午餐 -->
 							
 							<view class="ctorder-numbox">
@@ -92,7 +92,7 @@
 							</view>
 			</label>
 			<label class="checkbox">
-						<radio value="3" />晚餐
+						<radio value="3" disabled="{{!can3}}"/>晚餐
 						<!-- <checkbox value="3" />晚餐 -->
 						
 						<view class="ctorder-numbox">
@@ -151,9 +151,12 @@
 			<text>合计支付:{{total}}</text>
 			<text style="font-size:28rpx">账户余额:{{balance / 100}}</text>
 		</view>
-		<view class="fb-right" bindtap="toOrder">
+		<view class="fb-right" bindtap="toOrder" wx:if="{{!loading}}">
 			下单
 		</view>
+		<view class="fb-right" wx:else style="background:#eee">
+			正在下单
+		</view>
 	</view>
 	
 </view>

+ 1 - 0
pages/canteen/order/order.wxss

@@ -45,6 +45,7 @@ background-color: #efefef;
     font-size: 26rpx;
     margin-bottom: 15rpx;
     color: #999;
+	overflow: hidden;
 }
 .ctorder-radio{font-size: 30rpx;}
 .ctorder-radio .radio{margin-right: 40rpx;}

+ 5 - 5
pages/user/all/all.js

@@ -545,11 +545,11 @@ console.log('getUserProfile')
       url: '/packageUser/pages/user/identity/identity'
     })
   },
-  toBankInfo () {
-    wx.navigateTo({
-      url: '/packageUser/pages/user/bankinfo/bankinfo'
-    })
-  },
+  // toBankInfo () {
+  //   wx.navigateTo({
+  //     url: '/packageUser/pages/user/bankinfo/bankinfo'
+  //   })
+  // },
   toAddressList () {
     wx.navigateTo({
       url: '/packageUser/pages/user/address/address'

+ 6 - 4
utils/request.js

@@ -1,13 +1,14 @@
 // 新正式(未审批)
-const apiHost = 'https://fohowapi.hiwavo.com/' 
+const apiHost = 'https://fohowapi.hiwavo.com/';
+const apiHostX = 'https://xj.hiwavo.com/';//正式
+
 // 测试
 // const apiHost = 'https://tfohowapi.hiwavo.com/';
+// const apiHostX = 'https://txj.hiwavo.com/';
+
 
 
-//新接口
-const apiHostX = 'https://xj.hiwavo.com/';//正式
 
-// const apiHostX = 'https://txj.hiwavo.com/';
 
 function $get (url, params, success, fail) {
   wx.showNavigationBarLoading()
@@ -21,6 +22,7 @@ function $get (url, params, success, fail) {
   }else{
 	  apih = apiHost;
   }
+  console.log('apih',apih);
   wx.request({
     url: apih + url,
     data: params,