Forráskód Böngészése

新增员工餐厅相关

WinG 2 éve
szülő
commit
10e49a7cde

+ 1 - 0
.cloudbase/container/debug.json

@@ -0,0 +1 @@
+{"containers":[],"config":{}}

+ 3 - 1
app.json

@@ -26,7 +26,9 @@
     "pages/web/web",
     "pages/parse/parse",
     "pages/activity/redpacket/redpacket",
-    "pages/activity/screen/screen"
+    "pages/activity/screen/screen",
+	"pages/canteen/canteen",
+	"pages/canteen/order/order"
   ],
   "subpackages": [
     {

BIN
images/footer/canteen-cz.png


BIN
images/footer/canteen-dc.png


BIN
images/footer/canteen-sm.png


BIN
images/footer/date.png


BIN
images/footer/scan.png


+ 2 - 2
packageUser/pages/user/cash/cash.wxml

@@ -7,9 +7,9 @@
     <!--<navigator url="/packageUser/pages/user/exchange/exchange" >
       <view class="radish-top__btn">兑换佣金</view>
     </navigator>-->
-    <!-- <navigator url="/packageUser/pages/user/buy/buy" >
+    <navigator url="/packageUser/pages/user/buy/buy" >
       <view class="radish-top__btn1">购买佣金</view>
-    </navigator> -->
+    </navigator>
   </view>
   <view class="radish-main">
     <view class="radish-main__title">交易记录</view>

+ 3 - 3
packageUser/pages/user/cash/cash.wxss

@@ -38,12 +38,10 @@
   color: #fff;
 }
 .radish-top__btn1 {
-    position: absolute;
-    top: 210rpx;
+	position: absolute;
     width: 206rpx;
     height: 60rpx;
     border: 2rpx solid #eb4d20;
-    margin: 48rpx auto 0;
     text-align: center;
     line-height: 60rpx;
     border-radius: 45px;
@@ -51,6 +49,8 @@
     color: #fff;
     right: calc(50% - 103rpx);
     background: linear-gradient(to right,#eb712c,#e71f1c);
+    top: 0;
+    left: 0;
 }
 .radish-main {
   background-color: #fff;

+ 20 - 4
packageUser/pages/user/fund/fund.js

@@ -14,9 +14,16 @@ Page({
     lockWithdraw: false,
     has_bank:false,
     min_cash:0,
-    max_cahs:0
+    max_cahs:0,
+	sourceurl:false
   },
   onLoad: function (options) {
+	console.log('source',options);
+	if(options && options['source'] && options['source'] == 'canteen'){
+		this.setData({
+			sourceurl:'/pages/canteen/canteen'
+		})
+	}
     this.getCashTotal()
     this.getCashList()
     this.getBanners()
@@ -153,9 +160,18 @@ Page({
     })
   },
   goRechargeClick () {
-    wx.navigateTo({
-      url: '/packageUser/pages/user/recharge/recharge'
-    })
+	  console.log('sourceurl',this.data.sourceurl);
+	  if(!this.data.sourceurl){
+		  wx.navigateTo({
+		    url: '/packageUser/pages/user/recharge/recharge'
+		  })
+	  }else{
+		  console.log('here');
+		  wx.navigateTo({
+		    url: '/packageUser/pages/user/recharge/recharge?source='+this.data.sourceurl
+		  })
+	  }
+    
   },
   goIdentityClick () {
     var that = this

+ 1 - 1
packageUser/pages/user/fund/fund.wxml

@@ -6,7 +6,7 @@
     <view class="fund__btnAll">
       <view class="fund__btn withdraw" bindtap="getBankInfoAndTip" wx:if="{{cashTotal.available}}">提现</view>
       <view class="fund__btn withdrawNot" wx:if="{{!cashTotal.available}}">暂无提现</view>
-      <!--<view class="fund__btn recharge" bindtap="goRechargeClick">充值</view>-->
+      <view class="fund__btn recharge" bindtap="goRechargeClick">充值</view>
       
       <!-- <view class="fund__btn withdraw" bindtap="toTransfer" wx:if="{{cashTotal.can_transfer}}" disabled="{{cashTotal.available}}">转提货券</view> -->
       <view class="clean"></view>

+ 26 - 4
packageUser/pages/user/recharge/recharge.js

@@ -7,12 +7,19 @@ Page({
   data: {
     price: '',
     cashTotal: 0,
-    lock: false
+    lock: false,
+	source:''
   },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+	  console.log('options',options);
+	  if(options && options['source']){
+		  this.setData({
+			  source:options['source']
+		  })
+	  }
     this.getCashTotal()
   },
   getCashTotal () {
@@ -87,9 +94,24 @@ Page({
             icon: 'success',
             duration: 1000
           })
-          wx.navigateTo({
-            url: '/packageUser/pages/user/fund/fund'
-          })
+		  
+		  console.log('that.data.source',that.data.source)
+		  setTimeout(function(){
+			  if(that.data.source){
+			  			  // wx.navigateTo({
+			  			  //   url: that.data.source
+			  			  // })
+						  wx.navigateBack();
+						  wx.navigateBack();
+			  }else{
+			  			  // wx.navigateTo({
+			  			  //   url: '/packageUser/pages/user/fund/fund'
+			  			  // })
+			  			  wx.navigateBack();
+			  }
+		  },1000)
+		  
+          
         },
         'fail':function(res){
         }

+ 274 - 0
pages/canteen/canteen.js

@@ -0,0 +1,274 @@
+var _request = require('../../utils/request.js')
+var rid
+Page({
+  data: {
+    detail: {},
+	showCancelModal:false,
+	canceltxt:'',
+	cancelnum:1,
+	canceldata:{},
+	cancelitem:{}
+  },
+  onShow:function(){
+	  console.log('onshow == canteen')
+	  this.setData({
+	    detail: {}
+	  })
+	  this.getList()
+  },
+ //  onLoad: function (options) {
+	  
+	// console.log('onload onLoad == canteen',options)
+ //    this.getList()
+ //  },
+  getList () {
+    var that = this
+    var url = 'newapi:food/get-history-info'
+    var params = {
+    }
+    var success = function (res) {
+      var data = res.data.data.list;
+	  for(let i in data){
+		  let hasorder = false;
+		  for(let o in data[i]['details']){
+			  if(data[i]['details'][o]['nums'] > 0) hasorder = true;
+		  }
+		  
+		  let xingqi;
+		  let thedate = data[i]['food_date'];
+		  if(new Date(thedate).getDay() == 0) xingqi = '星期日';
+		  if(new Date(thedate).getDay() == 1) xingqi = '星期一';
+		  if(new Date(thedate).getDay() == 2) xingqi = '星期二';
+		  if(new Date(thedate).getDay() == 3) xingqi = '星期三';
+		  if(new Date(thedate).getDay() == 4) xingqi = '星期四';
+		  if(new Date(thedate).getDay() == 5) xingqi = '星期五';
+		  if(new Date(thedate).getDay() == 6) xingqi = '星期六';
+		  
+		  data[i]['hasorder'] = hasorder;
+		  data[i]['food_day'] = xingqi;
+	  }
+      that.setData({
+        detail: data
+      })
+	  console.log('data',data);
+    }
+    _request.$get(url, params, success)
+  },
+  showCancelm(e){
+	  var that = this
+	  var selectdata = e.currentTarget.dataset.data;
+	  var selectoitem = e.currentTarget.dataset.oitem;
+	  console.log('selectdata',selectdata);
+	  console.log('selectoitem',selectoitem);
+	  let cncan = '';
+	  if(selectoitem.type == 1) cncan = "早餐";
+	  if(selectoitem.type == 2) cncan = "中餐";
+	  if(selectoitem.type == 3) cncan = "晚餐";
+	  
+	  this.setData({
+		  showCancelModal:true,
+		  canceltxt:`确定取消 ${selectdata['food_date']}(${selectdata['food_day']}) [${cncan}] 订单?`,
+		  canceldata:selectdata,
+		  cancelitem:selectoitem,
+		  cancelnum:1
+	  })
+  },
+  hideCancelm(){
+  	  this.setData({
+  		  showCancelModal:false
+  	  })
+  },
+  add: function (e) {
+	  var type = e.target.dataset.max;
+	  if(this.data.cancelnum+1 <= this.data.cancelitem['nums']){
+		  this.setData({
+		    cancelnum:this.data.cancelnum+1
+		  })
+	  }
+    },
+    mius: function (e) {
+		var type = e.target.dataset.max;
+		if(this.data.cancelnum-1 > 0){
+		  this.setData({
+			cancelnum:this.data.cancelnum-1
+		  })
+		}
+    },
+	confirmDel(){
+		var that=this;
+		let cancelnum = this.data.cancelnum;
+		  function isPositiveInteger(input) {
+			  // 使用正则表达式匹配纯数字正整数
+			  var pattern = /^[1-9]\d*$/;
+			  return pattern.test(input);
+		  }
+		  if (!isPositiveInteger(cancelnum)) {
+			wx.showToast({
+			  title: '请输入正整数',
+			  icon: 'error',
+			  duration: 2000
+			});
+			return;
+		  }
+		  if(parseInt(cancelnum) > this.data.cancelitem.nums){
+			wx.showToast({
+			  title: '退餐失败,输入的退餐数量大于订餐数',
+			  icon: 'none',
+			  duration: 2000
+			});
+			return;
+		  }
+		var url = 'newapi:food/unsubcribe-food'
+		var params = {
+		  "date": this.data.canceldata['food_date'],
+		  "nums": parseInt(cancelnum),
+		  "type": parseInt(this.data.cancelitem.type)
+		}
+		var success = function (res) {
+		  console.log('res',res);
+		  if(res.data.code == 0){
+			  wx.showToast({
+			    title: '退餐成功',
+			    icon: 'success',
+			    duration: 2000
+			  });
+			  setTimeout(function(){
+				  that.setData({
+					detail: {},
+					showCancelModal:false
+				  })
+				  that.onShow();
+			  },500)
+			  return;
+		  }else{
+			  wx.showToast({
+			    title: res.data.msg,
+			    icon: 'none',
+			    duration: 2000
+			  });
+		  }
+		  
+		}
+		_request.$post(url, JSON.stringify(params), success)
+	},
+  delOrder(e){
+	  var that = this
+	  var selectdata = e.currentTarget.dataset.data;
+	  var selectoitem = e.currentTarget.dataset.oitem;
+	  console.log('selectdata',selectdata);
+	  console.log('selectoitem',selectoitem);
+	  let cncan = '';
+	  if(selectoitem.type == 1) cncan = "早餐";
+	  if(selectoitem.type == 2) cncan = "中餐";
+	  if(selectoitem.type == 3) cncan = "晚餐";
+	  wx.showModal({
+	    title: `确定取消 ${selectdata['food_date']}(${selectdata['food_day']}) [${cncan}] 订单?`,
+	    content: "1",
+		// editable:true,
+		// placeholderText:`请输入退餐数,已订【${selectoitem.nums}】餐`,
+	    success: function(res) {
+	      if (res.confirm) {
+			  
+	      } else if (res.cancel) {
+			  
+	      }
+	    }
+	  })
+	  
+  },
+  scanCode(){
+	  var that = this;
+	  wx.scanCode({
+	    onlyFromCamera: true,
+	    success (res) {
+			if(res.errMsg == "scanCode:ok"){
+				let link = res.result.split(':')[1];
+				var url = 'newapi:'+link;
+				var params = {
+				}
+				var success = function (res) {
+				  console.log('用餐提醒',res);
+				  if(res.data.code != 0){
+					  wx.showToast({
+					    title: res.data.msg,
+					    icon: 'none',
+					    duration: 2000
+					  });
+					  return;
+				  }
+				  let data = res.data.data;
+				  let can = '';
+				  if(data.type == 1) can = "早餐";
+				  if(data.type == 2) can = "中餐";
+				  if(data.type == 3) can = "晚餐";
+				  wx.showModal({
+				    title: "用餐提醒",
+				    content: `当前用餐日期${data['foodDate']} [${can}] 数量 ${data['nums']},是否确定用餐?`,
+				    success: function(res) {
+				      if (res.confirm) {
+						  var url = 'newapi:food/comfirm-get-food'
+						  var params = {
+							  
+						  }
+						  var success = function (res) {
+							var result = res.data
+							if(result.code == 0){
+								wx.showToast({
+								  title: '成功,用餐愉快',
+								  icon: 'success',
+								  duration: 3000
+								});
+								that.onShow();
+								return;
+							}else{
+								wx.showToast({
+								  title: result.msg,
+								  icon: 'error',
+								  duration: 3000
+								});
+							}
+						  }
+						  _request.$get(url, params, success)
+				      } else if (res.cancel) {
+				  			  
+				      }
+				    }
+				  })
+				}
+				_request.$get(url, params, success)
+			}else{
+				wx.showToast({
+				  title: '扫描失败',
+				  icon: 'error',
+				  duration: 2000
+				});
+			}
+	    }
+	  })
+  },
+  toOrder() {
+    wx.navigateTo({
+      url: '/pages/canteen/order/order'
+    })
+  },
+  toRecharge() {
+    // if(this.data.info.user.tel == ''){//未绑定手机号
+    // 	wx.navigateTo({
+    //   	url: '/packageUser/pages/user/bind/bind'
+    // 	})
+    	
+    // 	wx.showToast({
+    //     title: '请先绑定手机号~',
+    //     icon: 'none',
+    //     duration: 2000
+    //   })
+    	
+    // 	//2020
+    // 	wx.setStorageSync('bindbackurl', '/packageUser/pages/user/fund/fund'); //存入手机绑定后跳转页面
+    // }else{
+    	wx.navigateTo({
+      	url: '/packageUser/pages/user/fund/fund?source=canteen'
+    	})
+    // }
+  },
+})

+ 6 - 0
pages/canteen/canteen.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "员工订餐",
+  "usingComponents": {
+    "format-time": "../../component/formatTime/formatTime"
+  }
+}

+ 76 - 0
pages/canteen/canteen.wxml

@@ -0,0 +1,76 @@
+<view class="bg" style="padding-bottom:20rpx">
+  <view class="topbox">
+	  <!-- <navigator url="/pages/canteen/order/order"  class="add-button">新增订餐</navigator> -->
+	  <view bindtap="toRecharge" class="scan-button">
+	  	  <image src="../../images/footer/canteen-cz.png" class="image"></image>
+	  	  <text class="text">充 值</text>
+	  </view>
+	  <view bindtap="toOrder" class="scan-button">
+	  	  <image src="../../images/footer/canteen-dc.png" class="image"></image>
+	  	  <text class="text">订餐/点餐</text>
+	  </view>
+	  <view bindtap="scanCode" class="scan-button">
+	  	  <image src="../../images/footer/canteen-sm.png" class="image"></image>
+	  	  <text class="text">扫码用餐</text>
+	  </view>
+  </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">
+		  <view class="order-card {{oitem['confirm']?'isuse':''}}" wx:if="{{oitem['nums'] > 0}}">
+			  <view class="title">
+				  <text wx:if="{{oitem['type'] == 1}}">早餐</text>
+				  <text wx:if="{{oitem['type'] == 2}}">中餐</text>
+				  <text wx:if="{{oitem['type'] == 3}}">晚餐</text>
+				<small style="font-size: 30rpx;">x{{oitem['nums']}}</small>
+			  </view>
+			  <view class="info" wx:if="{{oitem['type'] == 1}}">使用时间【07:00-09:00】</view>
+			  <view class="info" wx:if="{{oitem['type'] == 2}}">使用时间【11:50-12:50】</view>
+			  <view class="info" wx:if="{{oitem['type'] == 3}}">使用时间【17:50-18:50】</view>
+			  <view class="num">
+				  状态:未使用
+				  <view class="del" bindtap="showCancelm" data-data="{{item}}" data-oitem="{{oitem}}">退餐</view>
+			  </view>
+		  </view>
+	  </view>
+	  <view wx:if="{{!item['hasorder']}}" style="padding:15rpx;color:#999;font-size:30rpx;text-align:center">当前日期未订餐</view>
+	  <!-- <view class="order-card">
+		  <view class="title">早餐
+			<small style="font-size: 30rpx;">x1</small>
+		  </view>
+		  <view class="info">使用时间:7点-11点</view>
+		  <view class="num">
+			  状态:未使用
+			  <view class="del">退餐</view>
+		  </view>
+	  </view>
+	  <view class="order-card unuse">
+		  <view class="title">早餐</view>
+		  <view class="info">使用时间:7点-11点</view>
+		  <view class="num">数量:1</view>
+	  </view>
+	  <view class="order-card isuse">
+		  <view class="title">早餐</view>
+		  <view class="info">使用时间:7点-11点</view>
+		  <view class="num">数量:1</view>
+	  </view> -->
+	  <view class="modalmask" wx:if="{{showCancelModal}}">
+		  <view class="modal">
+			  <view class="modal-title">退餐提示</view>
+			  <view class="modal-content">{{canceltxt}}</view>
+			  <view class="modal-tool">退餐数量
+				<view class="ctorder-numbox">
+					<view class="cartlist_num">
+						<button bindtap="mius" class="mius">-</button>
+						<input type="number" value="{{cancelnum}}" disabled="true"/>
+						<button bindtap="add" class="add">+</button>
+					</view>
+				</view>
+			  </view>
+			  <view class="modal-cancel" bindtap="hideCancelm">取消</view>
+			  <view class="modal-confirm" bindtap="confirmDel">确定</view>
+		  </view>
+	  </view>
+  </view>
+</view>

+ 201 - 0
pages/canteen/canteen.wxss

@@ -0,0 +1,201 @@
+.bg {
+  position: relative;
+  width: 100%;
+  min-height: 100%;
+  background-color: #ffffff;
+}
+.topbox{
+	padding: 25rpx 0;
+}
+.add-button{
+	margin: 15rpx;
+	    background: #eab86a;
+	    padding: 15rpx;
+	    text-align: center;
+	    color: #fff;
+	    border-radius: 15rpx;
+		width: calc(70% - 30rpx);
+		display: inline-block;
+		vertical-align: middle;
+}
+.scan-button{
+	width: 33%;
+    display: inline-block;
+    text-align: center;
+    font-size: 30rpx;
+    color: #eab86a;
+    vertical-align: middle;
+}
+.scan-button .image{
+	width: 60rpx;
+	height: 60rpx;
+	display: inline-block;
+}
+.scan-button .text{
+	display: block;
+}
+.list-title{
+    font-size: 24rpx;
+    margin: 25rpx;
+    color: #999;
+    text-align: left;
+}
+.order-list{}
+.time-box{
+	background: #eee;
+	    font-size: 28rpx;
+	    padding: 5rpx 25rpx;
+	    color: #666;
+}
+.order-card{
+    margin: 15rpx;
+    padding: 25rpx;
+    background: #eab86a;
+    color: #fff;
+    overflow: hidden;
+    border-radius: 10rpx;
+	position: relative;
+}
+.order-card.unuse{
+	background: #ececec;
+	    color: #999;
+}
+.order-card.unuse::after{
+	content:'失效';
+	font-size: 50rpx;
+	position: absolute;
+	right: 10%;
+	top: 0;
+	transform: rotate(-25deg)translateY(35rpx);
+	padding: 0 30rpx;
+	border: 1px dashed;
+}
+.order-card.isuse{
+	background: #ececec;
+	    color: #999;
+}
+.order-card.isuse::after{
+	content:'已使用';
+	font-size: 50rpx;
+	position: absolute;
+	right: 10%;
+	top: 0;
+	transform: rotate(-25deg)translateY(35rpx);
+	padding: 0 30rpx;
+	border: 1px dashed;
+}
+.order-card .title{
+	    font-size: 40rpx;
+}
+.order-card .info{
+	    float: left;
+	    font-size: 24rpx;	
+}
+.order-card .num{
+	float: right;
+	    font-size: 24rpx;
+}
+.order-card .num .del{
+    margin-left: 10rpx;
+    color: #3F51B5;
+    text-decoration: underline;
+    display: inline;
+}
+
+
+/* 遮罩层样式 */
+.modalmask {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, 0.1); /* 半透明黑色背景 */
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    z-index: 999; /* 确保弹出框位于顶层 */
+}
+
+/* 弹出框样式 */
+.modal {
+    background: #fff;
+    border-radius: 5px;
+    padding: 20px;
+    width: 75%;
+    text-align: center;
+}
+
+/* 弹出框标题样式 */
+.modal-title {
+    font-size: 38rpx;
+    font-weight: bold;
+    margin-bottom: 10px;
+}
+
+/* 弹出框内容样式 */
+.modal-content {
+    font-size: 32rpx;
+    margin-bottom: 20px;
+}
+
+/* 弹出框按钮样式 */
+.modal-cancel, .modal-confirm {
+    display: inline-block;
+    padding: 10px 20px;
+    margin: 0 10px;
+    border: 1px solid #eab86a;
+    border-radius: 5px;
+    background: #eab86a;
+    color: #fff;
+    text-align: center;
+    cursor: pointer;
+	font-size: 30rpx;
+}
+.modal-cancel{
+	border: 1px solid #999;
+	background: #999;
+}
+.modal-tool{
+	overflow: hidden;
+	margin-bottom: 25px;
+}
+.ctorder-numbox{
+	display: inline-block;
+	    vertical-align: middle;
+}
+.cartlist_num{float: right;}
+.cartlist_num button{
+width: 50rpx;
+height: 50rpx;
+line-height: 40rpx;
+text-align: center;
+display: inline-block;
+border: 1px solid #ddd;
+border-radius: 50%;
+}
+.cartlist_num button.mius{
+border:1px solid #eab86a;
+color:#eab86a;
+}
+.cartlist_num button.add{
+
+background: #eab86a;
+color: #FFF;
+border: 0;
+line-height: 45rpx;
+
+
+}
+.cartlist_num input{
+width: 50rpx;
+height: 40rpx;
+
+text-align: center;
+display: inline-block;
+border-left: 0;
+border-right: 0;
+font-size: 40rpx;
+
+margin: 0 10rpx;
+}

+ 436 - 0
pages/canteen/order/order.js

@@ -0,0 +1,436 @@
+var _request = require('../../../utils/request.js')
+var rid;
+Page({
+  data: {
+    detail: {},
+	ordertype:1,
+	today:"",
+	date1:"",
+	date3:"",
+	startdate1:"",
+	enddate1:"",
+	date2:"",
+	startdate2:"",
+	enddate2:"",
+	checkbox:[],
+	num1:1,
+	num2:1,
+	num3:1,
+	orderList:[],
+	orderListMul:[],
+	total:0,
+	checkbox_un:[],
+	preOrderList:[],
+	historyOrderList:[],
+	balance: 0,
+	cashTotal: 0,
+	orderprice:[4,10,10],//单点价格早,中,晚
+	ordersubprice:[2,4,4],//订餐价格早,中,晚
+	checkAll:false//全选
+  },
+  onLoad: function (options) {
+	  
+	console.log('onload onLoad == canteen',options)
+    // this.getRadish()
+	this.getBalanceInfo();
+	this.getOrdrList();
+	
+	// 将当前日期加7天
+	const currentDate = new Date();
+	const futureDate = new Date(currentDate);
+	futureDate.setDate(futureDate.getDate() + 8);
+	const formattedDate = this.formatDate(futureDate);
+	
+	this.setData({
+		today: this.getDateString(0),
+		startdate1: this.getDateString(0),
+		enddate1:this.getDateString(1),
+		startdate2: this.getDateString(0),
+		enddate2:this.getDateString(1),
+		date1:this.getDateString(0),
+		date2:formattedDate,
+	})
+  },
+  getBalanceInfo () {
+    var that = this
+    var url = 'v1/user/cash/balance/info'
+    var params = {
+    }
+    var success = function (res) {
+      var result = res.data.available
+      that.setData({
+        balance: result,
+  		cashTotal: res.data
+      })
+    }
+    _request.$get(url, params, success)
+  },
+  getList () {
+    var that = this
+    var url = 'v1/user/balances'
+    var params = {
+    }
+    var success = function (res) {
+      var data = res.data
+      that.setData({
+        detail: data
+      })
+    }
+    _request.$get(url, params, success)
+  },
+  getDateString(addnum){
+	  let year = new Date().getFullYear() + addnum;
+	  let month = new Date().getMonth() +1;
+	  let day = new Date().getDate();
+	  if(month<10) month = '0'+month;
+	  if(day<10) day = '0'+day;
+	  let times = year +'-'+ month +'-'+ day;
+	  return times;
+  },
+  formatDate(date) {
+    const year = date.getFullYear();
+    const month = String(date.getMonth() + 1).padStart(2, '0'); // Month is 0-indexed
+    const day = String(date.getDate()).padStart(2, '0');
+    return `${year}-${month}-${day}`;
+  },
+  bindDateChange: function(e) {
+	  console.log('picker发送选择改变,携带值为', e.detail.value)
+	  this.setData({
+		date1: e.detail.value,
+		startdate2: e.detail.value
+	  })
+	  this.calcOrder();
+  },
+  bindDateChange2: function(e) {
+  	  console.log('picker发送选择改变,携带值为', e.detail.value)
+  	  this.setData({
+  		date2: e.detail.value
+  	  })
+	  this.calcOrder();
+  },
+  radioChange:function(e){
+	   console.log('radio发生change事件,携带value值为:', e.detail.value);
+	   if(e.detail.value == 0){
+		   this.setData({
+		   	checkbox:[]
+		   });
+	   }
+	   this.setData({
+			ordertype:e.detail.value,
+			total:0
+	   });
+	   this.calcOrder();
+  },
+  getOrdrList:function(e){
+  	var that = this
+  	var url = 'newapi:food/get-info'
+  	var params = {
+  	}
+  	var success = function (res) {
+  	  var data = res.data.data.list;
+	  var hisOrderList = [];
+	  
+	   for (let item in data) {
+		  let thedate = data[item]['food_date'];
+		  let xingqi;
+		  if(new Date(thedate).getDay() == 0) xingqi = '星期日';
+		  if(new Date(thedate).getDay() == 1) xingqi = '星期一';
+		  if(new Date(thedate).getDay() == 2) xingqi = '星期二';
+		  if(new Date(thedate).getDay() == 3) xingqi = '星期三';
+		  if(new Date(thedate).getDay() == 4) xingqi = '星期四';
+		  if(new Date(thedate).getDay() == 5) xingqi = '星期五';
+		  if(new Date(thedate).getDay() == 6) xingqi = '星期六';
+		  data[item]['food_day'] = xingqi;
+		  data[item]['can_break_fast'] = data[item]['break_fast'] ? false : data[item]['can_break_fast'];
+		  data[item]['can_lunch'] = data[item]['lunch'] ? false : data[item]['can_lunch'];
+		  data[item]['can_dinner'] = data[item]['dinner'] ? false : data[item]['can_dinner'];
+		  
+		  if(data[item]['break_fast']) hisOrderList.push(`${data[item]['food_date']},1,1`);
+		  if(data[item]['lunch']) hisOrderList.push(`${data[item]['food_date']},1,2`);
+		  if(data[item]['dinner']) hisOrderList.push(`${data[item]['food_date']},1,3`);
+	   }
+	  
+  	  that.setData({
+  	    preOrderList: data,
+		date1:data[0]['food_date'],
+		date3:data[0]['food_date'],
+		date2:data[data.length - 1]['food_date'],
+		historyOrderList:hisOrderList
+  	  })
+	  console.log('data',data);
+  	}
+  	_request.$get(url, params, success)
+  },
+  checkAllfunc: function(e){
+		console.log('checkAll');//checkAll
+		let nowcheckAll = !this.data.checkAll;
+		let checkarr = [];
+		let preOrderList = this.data.preOrderList;
+		for(let i in preOrderList){
+			if(preOrderList[i]['can_break_fast']){
+				preOrderList[i]['break_fast'] = !preOrderList[i]['break_fast'];
+				checkarr.push(`${preOrderList[i]['food_date']},1,1`);
+			}
+			if(preOrderList[i]['can_lunch']){
+				preOrderList[i]['lunch'] = !preOrderList[i]['lunch'];
+				checkarr.push(`${preOrderList[i]['food_date']},1,2`);
+			}
+			if(preOrderList[i]['can_dinner']){
+				preOrderList[i]['dinner'] = !preOrderList[i]['dinner'];
+				checkarr.push(`${preOrderList[i]['food_date']},1,3`);
+			}
+		}
+		if(!nowcheckAll) checkarr = [];
+		
+		let a = checkarr;
+		let b = this.data.historyOrderList;
+		// 从数组a中筛选出不包含在数组b中的值
+		var resultA = a.filter(itemA => !b.includes(itemA));
+		
+		
+		console.log("数组a中与数组b不同的值: ",resultA);
+		this.setData({
+			checkAll:nowcheckAll,
+			orderListMul:resultA,
+			preOrderList:preOrderList
+		});
+		this.calcOrder();
+  },
+  checkboxChangeList(e){
+	 console.log('checkboxChangeList checkbox发生change事件,携带value值为:', e.detail.value);
+	 console.log('historylist:', this.data.historyOrderList);
+	 
+	 let a = e.detail.value;
+	 let b = this.data.historyOrderList;
+	 // 从数组a中筛选出不包含在数组b中的值
+	 var resultA = a.filter(itemA => !b.includes(itemA));
+	 
+	 
+	 console.log("数组a中与数组b不同的值: ",resultA);
+	 this.setData({
+	 	orderListMul:resultA
+	 });
+	 this.calcOrder();
+  },
+  checkboxChange(e) {
+	console.log('checkboxChange checkbox发生change事件,携带value值为:', e.detail.value);
+	this.setData({
+		checkbox:[e.detail.value]
+	});
+	this.calcOrder();
+  },
+  checkboxChangeUn(e) {
+  	console.log('checkboxUn发生change事件,携带value值为:', e.detail.value);
+  	this.setData({
+  		checkbox_un:e.detail.value
+  	});
+  	this.calcOrder();
+  },
+  calcOrder(){
+	  console.log('calcOrder',this.data.ordertype,this.data.date1,this.data.checkbox);
+	  if(this.data.ordertype == 0){
+		  let orderl = [];
+		  if(this.data.date1 && this.data.checkbox.length>0){
+			  let total = 0;
+			  for(let i in this.data.checkbox){
+				  let val = this.data.checkbox[i];
+				  let num;
+				  let price;
+				  if(val==1){
+					  num = this.data.num1;
+				  }else if(val==2){
+					  num = this.data.num2;
+				  }else{
+					  num = this.data.num3;
+				  }
+				  
+				  price = this.data.orderprice[val-1] * num;
+				  
+				  orderl.push([this.data.date1,val,num,price]);
+				  total += price;
+			  }
+			  
+			  this.setData({
+				  orderList:orderl,
+				  total:total
+			  })
+			  console.log('orderl',orderl);
+		  }else{
+			  this.setData({
+				orderList:[]
+			  })
+		  }
+	  }else{
+		  if(this.data.orderListMul.length>0){
+			  let total=0;
+			  for(let i in this.data.orderListMul){
+				  let val = this.data.orderListMul[i].split(',')[2];
+				  let price;
+				  price = this.data.ordersubprice[val-1] * 1;
+				  total += price;
+			  }
+			  
+			  this.setData({
+				  total:total
+			  })
+		  }else{
+			  this.setData({
+				orderList:[],
+				total:0
+			  })
+		  }
+	  }
+  },
+  getDatesInRange(startDate, endDate) {
+    const dates = [];
+    let currentDate = new Date(startDate);
+  
+    while (currentDate <= endDate) {
+		console.log('1',this.data.checkbox_un.includes("1"));
+		console.log('2',this.data.checkbox_un.includes("2"));
+	  if(this.data.checkbox_un.includes("1") && this.data.checkbox_un.includes("2")){
+		if (currentDate.getDay() !== 0 && currentDate.getDay() !== 6) {
+		  dates.push(new Date(currentDate));
+		}
+	  }else if(this.data.checkbox_un.includes("1") && !this.data.checkbox_un.includes("2")){//剔除周六
+	  	if (currentDate.getDay() !== 6) {
+	  	  dates.push(new Date(currentDate));
+	  	}
+	  }else if(this.data.checkbox_un.includes("2") && !this.data.checkbox_un.includes("1")){//剔除周日
+	  	if (currentDate.getDay() !== 0) {
+	  	  dates.push(new Date(currentDate));
+	  	}
+	  }else{
+		  dates.push(new Date(currentDate));
+	  }
+	  
+      currentDate.setDate(currentDate.getDate() + 1);
+    }
+  
+    return dates;
+  },
+  add: function (e) {
+	  var type = e.target.dataset.type;
+		if(type == 1){
+			this.setData({
+			  num1:this.data.num1+1
+			})
+		}else if(type == 2){
+			this.setData({
+			  num2:this.data.num2+1
+			})
+		}else{
+			this.setData({
+			  num3:this.data.num3+1
+			})
+		}
+		this.calcOrder();
+		
+    },
+    mius: function (e) {
+		var type = e.target.dataset.type;
+		if(type == 1){
+			let num = this.data.num1 - 1 <1?1:this.data.num1-1;
+			this.setData({
+			  num1:num
+			})
+		}else if(type == 2){
+			let num = this.data.num2 - 1 <1?1:this.data.num2-1;
+			this.setData({
+			  num2:num
+			})
+		}else{
+			let num = this.data.num3 - 1 <1?1:this.data.num3-1;
+			this.setData({
+			  num3:num
+			})
+		}
+		this.calcOrder();
+    },
+	changeCount: function (val) {
+	    var count = val.detail.value
+	    var type = val.target.dataset.type;
+		if(type == 1){
+			this.setData({
+			  num1:count
+			})
+		}else if(type == 2){
+			this.setData({
+			  num2:count
+			})
+		}else{
+			this.setData({
+			  num3:count
+			})
+		}
+		this.calcOrder();
+	},
+	toOrder: function(){
+		let paramorder = {
+		  "foodInfoElement": [
+			// {
+			//   "date": "string",
+			//   "nums": 0,
+			//   "type": 0
+			// }
+		  ],
+		  "single": this.data.ordertype == 0 ? true:false
+		}
+		if(this.data.ordertype == 0){
+			console.log('order',this.data.orderList);
+			for(let i in this.data.orderList){
+				let thepar = {
+					"date": this.data.orderList[i][0],
+					"nums": parseInt(this.data.orderList[i][2]),
+					"type": parseInt(this.data.orderList[i][1])
+				}
+				paramorder['foodInfoElement'].push(thepar);
+			}
+		}else{
+			console.log('order',this.data.orderListMul);
+			for(let i in this.data.orderListMul){
+				let thepar = {
+					"date": this.data.orderListMul[i].split(',')[0],
+					"nums": parseInt(this.data.orderListMul[i].split(',')[1]),
+					"type": parseInt(this.data.orderListMul[i].split(',')[2])
+				}
+				paramorder['foodInfoElement'].push(thepar);
+			}
+		}
+		
+		console.log('paramorder',paramorder);
+		
+		if(paramorder['foodInfoElement'].length == 0){
+			wx.showToast({
+			  title: '请先选餐',
+			  icon: 'error',
+			  duration: 2000
+			})
+			return;
+		}
+		
+		var that = this
+		var url = 'newapi:food/order-food'
+		var success = function (res) {
+		  console.log('res',res);
+		  if(res.data.code == 0){
+			  wx.showToast({
+			    title: '已成功下单',
+			    icon: 'success',
+			    duration: 2000
+			  })
+			  setTimeout(function(){
+				  wx.navigateBack()
+			  },1000);
+			  
+		  }else{
+			  wx.showToast({
+			    title: res.data.msg,
+			    icon: 'none',
+			    duration: 2000
+			  })
+		  }
+		}
+		_request.$post(url, JSON.stringify(paramorder), success);
+	}
+})

+ 6 - 0
pages/canteen/order/order.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "下单订餐",
+  "usingComponents": {
+    "format-time": "../../../component/formatTime/formatTime"
+  }
+}

+ 159 - 0
pages/canteen/order/order.wxml

@@ -0,0 +1,159 @@
+<view class="bg">
+	<view class="ctorder-view">
+		<view class="ctorder-title">下单模式</view>
+		<view class="ctorder-radio">
+			<radio-group bindchange="radioChange">
+				<label class="radio">
+					<radio value="1" checked="{{ordertype==1?true:false}}"/>订餐
+				</label>
+				<label class="radio">
+					<radio value="0" checked="{{ordertype==0?true:false}}"/>单点
+				</label>
+			</radio-group>
+			
+		</view>
+	</view>
+	
+	<view class="ctorder-view">
+		<view class="ctorder-title">订餐日期</view>
+		<view class="">
+			<view class="ctorder-datepicker" wx:if="{{ordertype == 0}}">
+			  <picker mode="date" value="{{date1}}" start="{{startdate1}}" end="{{enddate1}}" bindchange="bindDateChange">
+			    <view class="picker">
+					<image src="../../../images/footer/date.png" class="image"></image>
+			      {{date1?date1:"请选择日期"}}
+			    </view>
+			  </picker>
+			</view>
+			
+			
+			<!-- <view class="ctorder-datepicker" style="margin-top:15rpx" wx:if="{{ordertype == 1}}">
+			  <picker mode="date" value="{{date2}}" start="{{startdate2}}" end="{{enddate2}}" bindchange="bindDateChange2">
+			    <view class="picker">
+			      {{date2?date2:"请选择结束日期"}}
+			    </view>
+			  </picker>
+			</view>
+			
+			<view class="ctorder-checkboxun" style="margin-top:15rpx" wx:if="{{ordertype == 1}}">
+				<checkbox-group bindchange="checkboxChangeUn">
+					<label class="checkbox">
+						<checkbox value="1"/>去除周六
+					</label>
+					<label class="checkbox" style="margin-left:15rpx">
+						<checkbox value="2"/>去除周日
+					</label>
+				</checkbox-group>
+			</view> -->
+			
+			<view wx:if="{{ordertype == 1}}">{{date3}} 至 {{date2}}</view>
+		</view>
+		
+	</view>
+	
+	
+	<!-- <view>订餐范围</view>
+	<view class="section">
+	  <view class="section__title">日期选择器</view>
+	  <picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange">
+	    <view class="picker">
+	      当前选择: {{date}}
+	    </view>
+	  </picker>
+	</view> -->
+	
+	<view class="ctorder-view" wx:if="{{ordertype == 0}}">
+	  <view class="ctorder-title">订餐种类</view>
+	  <view class="ctorder-checkbox">
+		  <!-- <checkbox-group bindchange="checkboxChange"> -->
+			<radio-group bindchange="checkboxChange">
+			<label class="checkbox">
+							<radio value="1"/>早餐
+							<!-- <checkbox value="1"/>早餐 -->
+							
+							<view class="ctorder-numbox">
+								<view class="cartlist_num">
+									<button bindtap="mius" class="mius" data-type='1'>-</button>
+									<input type="number" value="{{num1}}" bindinput="changeCount" data-type='1'/>
+									<button bindtap="add" class="add" data-type='1'>+</button>
+								</view>
+							</view>
+			</label>
+			<label class="checkbox">
+							<radio value="2" />午餐
+							<!-- <checkbox value="2" />午餐 -->
+							
+							<view class="ctorder-numbox">
+								<view class="cartlist_num">
+									<button bindtap="mius" class="mius" data-type='2'>-</button>
+									<input type="number" value="{{num2}}" bindinput="changeCount" data-type='2'/>
+									<button bindtap="add" class="add" data-type='2'>+</button>
+								</view>
+							</view>
+			</label>
+			<label class="checkbox">
+						<radio value="3" />晚餐
+						<!-- <checkbox value="3" />晚餐 -->
+						
+						<view class="ctorder-numbox">
+							<view class="cartlist_num">
+								<button bindtap="mius" class="mius" data-type='3'>-</button>
+								<input type="number" value="{{num3}}" bindinput="changeCount" data-type='3'/>
+								<button bindtap="add" class="add" data-type='3'>+</button>
+							</view>
+						</view>
+			</label>
+		  <!-- </checkbox-group> -->
+		  </radio-group>
+	  </view>
+	</view>
+	
+	<view class="ctorder-view" wx:if="{{ordertype == 1}}">
+	  <view class="ctorder-title">订餐列表
+		<checkbox bindtap="checkAllfunc" checked="{{checkAll}}" style="float:right">全选</checkbox>
+	  </view>
+	  <checkbox-group bindchange="checkboxChangeList">
+	  <view class="ctorder-checkbox-list" wx:for="{{preOrderList}}">
+		  <view class="listinfo">{{item['food_date']}}
+			<view>{{item['food_day']}}</view>
+		  </view>
+		  <view class="inlinechekbox">
+			<label class="checkbox">
+				<checkbox value="{{[item['food_date'],1,1]}}" disabled="{{!item['can_break_fast']}}" checked="{{item['break_fast']}}"/>早
+			</label>
+			<label class="checkbox">
+				<checkbox value="{{[item['food_date'],1,2]}}" disabled="{{!item['can_lunch']}}" checked="{{item['lunch']}}"/>中
+			</label>
+			<label class="checkbox">
+				<checkbox value="{{[item['food_date'],1,3]}}" disabled="{{!item['can_dinner']}}" checked="{{item['dinner']}}"/>晚
+			</label>
+		  </view>  
+	  </view>
+	  </checkbox-group>
+	</view>
+	
+	
+	<!-- <view class="ctorder-view" wx:if="{{ordertype == 0}}">
+		<view class="ctorder-title">餐单明细</view>
+		<view class="ctorder-info-list" wx:for="{{orderList}}">
+			<view class="ctorder-info-list-item">{{item[0]}}
+				<text wx:if="{{item[1] == 1}}">早餐</text>
+				<text wx:if="{{item[1] == 2}}">午餐</text>
+				<text wx:if="{{item[1] == 3}}">晚餐</text>
+				x{{item[2]}}
+				<text style="float:right">合计:{{item[3]}}元</text>
+			</view>
+		</view>
+	</view> -->
+	
+	<view class="ctorder-fixedbox">
+		<view class="fb-left">
+			<text>合计支付:{{total}}</text>
+			<text style="font-size:28rpx">账户余额:{{balance / 100}}</text>
+		</view>
+		<view class="fb-right" bindtap="toOrder">
+			下单
+		</view>
+	</view>
+	
+</view>

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

@@ -0,0 +1,158 @@
+.bg {
+  position: relative;
+  width: 100%;
+  min-height: 100%;
+background-color: #efefef;
+    overflow: hidden;
+}
+
+
+/* .wx-radio-input{
+  border-radius:50%;
+  width:20px;
+  height:20px;
+} */
+.wx-radio-input.wx-radio-input-checked{
+  border-color:#eab86a !important;
+  background:#eab86a !important;
+}
+.wx-checkbox-input.wx-checkbox-input-checked{
+  border-color:#eab86a !important;
+  color:#eab86a !important;
+}
+/* .wx-radio-input.wx-radio-input-checked::before{
+  border-radius:50%;
+  width:20px;
+  height:20px;
+  line-height:20px;
+  text-align:center;
+  font-size:15px;
+  color:#fff;
+  background:transparent;
+  transform:translate(-50%, -50%) scale(1);
+  -webkit-transform:translate(-50%, -50%) scale(1);
+} */
+
+.ctorder-view{
+	margin: 15rpx;
+	    background: #FFF;
+	    padding: 15rpx;
+	    overflow: hidden;
+	    margin-bottom: 0;
+	    margin-top: 5rpx;
+}
+.ctorder-title{
+    font-size: 26rpx;
+    margin-bottom: 15rpx;
+    color: #999;
+}
+.ctorder-radio{font-size: 30rpx;}
+.ctorder-radio .radio{margin-right: 40rpx;}
+.ctorder-datepicker{}
+.ctorder-datepicker .picker{
+	border: 1px solid;
+	    padding: 15rpx;
+	    color: #eab86a;
+	    border-radius: 15rpx;
+}
+.picker .image{
+	width: 60rpx;
+	    height: 60rpx;
+	    vertical-align: middle;
+	    margin-top: -10rpx;
+}
+.ctorder-checkbox{}
+.ctorder-checkbox .checkbox{
+	    overflow: hidden;
+	    display: block;
+		margin-bottom: 15rpx;
+}
+.ctorder-numbox{float: right;}
+.cartlist_num{float: right;}
+.cartlist_num button{
+width: 50rpx;
+height: 50rpx;
+line-height: 40rpx;
+text-align: center;
+display: inline-block;
+border: 1px solid #ddd;
+border-radius: 50%;
+}
+.cartlist_num button.mius{
+border:1px solid #eab86a;
+color:#eab86a;
+}
+.cartlist_num button.add{
+
+background: #eab86a;
+color: #FFF;
+border: 0;
+line-height: 45rpx;
+
+
+}
+.cartlist_num input{
+width: 50rpx;
+height: 40rpx;
+
+text-align: center;
+display: inline-block;
+border-left: 0;
+border-right: 0;
+font-size: 40rpx;
+
+margin: 0 10rpx;
+}
+
+.ctorder-info-list{}
+.ctorder-info-list-item{
+	font-size: 24rpx;
+	    color: #333;
+	    background: #eee;
+	    padding: 5rpx 15rpx;
+}
+.ctorder-fixedbox{
+	background: #fff;
+	position: fixed;
+	width: 100%;
+	bottom: 0;
+	left: 0;
+	overflow: hidden;
+}
+.ctorder-fixedbox .fb-left{
+float: left;
+    padding: 10rpx 40rpx;
+    font-size: 34rpx;
+}
+.ctorder-fixedbox .fb-left text{
+	display: block;
+}
+.ctorder-fixedbox .fb-right{
+	overflow: hidden;
+	    float: right;
+	    background: #eab86a;
+	    display: block;
+	    padding: 33rpx 80rpx;
+	    text-align: center;
+	    color: #FFF;
+}
+.inlinechekbox{
+    display: inline-block;
+    float: right;
+    margin-top: 10rpx;
+}
+.inlinechekbox .checkbox{
+	    display: inline-block;
+	    font-size: 24rpx;
+	    margin-right: 10rpx;
+		color: #666;
+}
+.ctorder-checkbox-list{
+	overflow: hidden;
+	padding: 15rpx 0;
+}
+.listinfo{
+    display: inline-block;
+    font-size: 24rpx;
+    color: #333;
+}

+ 4 - 4
pages/cart/cart.wxml

@@ -49,10 +49,10 @@
 			  <view class="time-text">{{seckillruntimearr[index]}}</view>
 			</view>
 			<view class="main_item">
-		      <movable-area style="{{item.package?'height:'+(210+item.package_list.length * 25)+'rpx':''}}">
-		        <movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{item.movex}}" id="{{index}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend" style="{{item.package?'height:'+(210+item.package_list.length * 25)+'rpx':''}}">
+		      <movable-area style="{{item.package?'height:'+(210+item.package_list.length * 40)+'rpx':''}}">
+		        <movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{item.movex}}" id="{{index}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend" style="{{item.package?'height:'+(210+item.package_list.length * 40)+'rpx':''}}">
 		          <view class="main_item_content " >
-		          		  <view class="cartlist_item" style="{{item.package?'height:'+(210+item.package_list.length * 25)+'rpx':''}}">
+		          		  <view class="cartlist_item" style="{{item.package?'height:'+(210+item.package_list.length * 40)+'rpx':''}}">
 						   	  <view class="cartlist_select {{item.IsBuy ? 'active' : ''}}" bindtap="itemselected" data-count="{{item.count}}" data-id='{{item.id}}' data-price="{{item.original_price}}" data-index="{{index}}">
 						   	  	<text class="pay-circle"></text>
 						   	  </view> 
@@ -84,7 +84,7 @@
 		          </view>
 		        </movable-view>
 		      </movable-area>
-		      <view class="delete_btn" data-productIndex="{{index}}" data-id='{{item.id}}' bindtap="delitem" style="{{item.package?'height:'+(210+item.package_list.length * 25)+'rpx;line-height:'+(210+item.package_list.length * 25)+'rpx':''}}">删除</view>
+		      <view class="delete_btn" data-productIndex="{{index}}" data-id='{{item.id}}' bindtap="delitem" style="{{item.package?'height:'+(210+item.package_list.length * 40)+'rpx;line-height:'+(210+item.package_list.length * 40)+'rpx':''}}">删除</view>
 		    </view>
 	    </view>
 	</view>

+ 2 - 2
pages/customservice/customservice.wxml

@@ -25,10 +25,10 @@
   	</view>
   </view>
   
-  <view class="kfqr-dialog">
+  <!-- <view class="kfqr-dialog">
   	<view class="kfqr" bindtap="tokf">
   		<text>跳转客服</text>
   	</view>
-  </view>
+  </view> -->
 </view>
 

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

@@ -555,6 +555,11 @@ console.log('getUserProfile')
       url: '/packageUser/pages/user/address/address'
     })
   },
+  toCanteen () {
+    wx.navigateTo({
+      url: '/pages/canteen/canteen'
+    })
+  },
   toRadish () {
     wx.navigateTo({
       url: '/packageUser/pages/user/radish/radish'

+ 5 - 1
pages/user/all/all.wxml

@@ -57,7 +57,7 @@
         <image class="user-points__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
         <view class="user-points__num">{{integral / 100}}</view>
       </view> -->
-	  <!-- <view class="user-points" bindtap="toCash">
+	  <!-- <view class="user-points" bindtap="toCashList">
 		  <view class="user-points__title">我的收入</view>
 		  <image class="user-points__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
 		  <view class="user-points__num">{{cashbalance / 100}}</view>
@@ -176,6 +176,10 @@
         <view class="user-line__title">收货地址</view>
         <image class="user-line__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
       </view>
+	  <view class="user-line" bindtap="toCanteen" wx:if="{{info['user']['employ']}}">
+	    <view class="user-line__title">员工订餐</view>
+	    <image class="user-line__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>
+	  </view>
       <!--<view class="user-line" bindtap="toSafe" >
         <view class="user-line__title">修改交易密码</view>
         <image class="user-line__right" src="http://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/user/right.png"></image>

+ 2 - 1
project.config.json

@@ -35,7 +35,8 @@
     "showES6CompileOption": false,
     "useCompilerPlugins": false,
     "minifyWXML": true,
-    "useStaticServer": true
+    "useStaticServer": true,
+    "condition": false
   },
   "compileType": "miniprogram",
   "libVersion": "2.13.2",

+ 1 - 1
project.private.config.json

@@ -1,6 +1,6 @@
 {
   "setting": {
-    "urlCheck": false,
+    "urlCheck": true,
     "compileHotReLoad": true
   },
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",

+ 39 - 6
utils/request.js

@@ -1,16 +1,28 @@
 // 新正式(未审批)
-// const apiHost = 'https://fohowapi.hiwavo.com/' 
+const apiHost = 'https://fohowapi.hiwavo.com/' 
 // 测试
-const apiHost = 'https://tfohowapi.hiwavo.com/'
+// const apiHost = 'https://tfohowapi.hiwavo.com/';
 
 
+//新接口
+const apiHostX = 'https://xj.hiwavo.com/';//正式
+
+// const apiHostX = 'https://txj.hiwavo.com/';
+
 function $get (url, params, success, fail) {
   wx.showNavigationBarLoading()
   var session = wx.getStorageSync('lbt_session_key')
   var token = wx.getStorageSync('lbt_token_key')
   // console.log('nowtoken',token);
+  let apih = '';
+  if(url.split(':')[0] == 'newapi'){
+	  apih = apiHostX;
+	  url = url.split(':')[1];
+  }else{
+	  apih = apiHost;
+  }
   wx.request({
-    url: apiHost + url,
+    url: apih + url,
     data: params,
     method: 'GET',
     header: {
@@ -35,8 +47,15 @@ function $post (url, params, success, fail) {
   wx.showNavigationBarLoading()
   var session = wx.getStorageSync('lbt_session_key');
   var token = wx.getStorageSync('lbt_token_key');
+  let apih = '';
+  if(url.split(':')[0] == 'newapi'){
+  	  apih = apiHostX;
+  	  url = url.split(':')[1];
+  }else{
+  	  apih = apiHost;
+  }
   wx.request({
-    url: apiHost + url,
+    url: apih + url,
     data: params,
     method: 'POST',
     header: {
@@ -60,8 +79,15 @@ function $put (url, params, success, fail) {
   wx.showNavigationBarLoading()
   var session = wx.getStorageSync('lbt_session_key');
   var token = wx.getStorageSync('lbt_token_key');
+  let apih = '';
+  if(url.split(':')[0] == 'newapi'){
+  	  apih = apiHostX;
+  	  url = url.split(':')[1];
+  }else{
+  	  apih = apiHost;
+  }
   wx.request({
-    url: apiHost + url,
+    url: apih + url,
     data: params,
     method: 'PUT',
     header: {
@@ -85,8 +111,15 @@ function $del (url, params, success, fail) {
   wx.showNavigationBarLoading()
   var session = wx.getStorageSync('lbt_session_key');
   var token = wx.getStorageSync('lbt_token_key');
+  let apih = '';
+  if(url.split(':')[0] == 'newapi'){
+  	  apih = apiHostX;
+  	  url = url.split(':')[1];
+  }else{
+  	  apih = apiHost;
+  }
   wx.request({
-    url: apiHost + url,
+    url: apih + url,
     data: params,
     method: 'DELETE',
     header: {