189.Vue.js智能扫码点餐系统(二十三)【复习所有请求数据的Api、如果有人在订餐其他人再次进入的时候直接进入点餐页面】2019.03.26

0、知识点

  • 如果有人在订餐其他人再次进入的时候直接进入点餐页面
  • router

1、 如果有人在订餐其他人再次进入的时候直接进入点餐页面

  • Start.vue
getPeopleInfoList(){

                var uid=storage.get('roomid');
                var api=this.api+'api/peopleInfoList?uid='+uid;
                
                this.$http.get(api).then(response => {

                    this.showLoading=false;

                 

				   //如果有用餐人数信息直接跳转到点餐页面
                    if(response.body.result.length>0){
                        
                        this.$router.push({ path: 'home' })  // 跳转到home点餐页面
                    }

                }, response => {
                    // error callback
                });

            }
        }





created(){

            //判断 有没有用餐人数的信息
            this.getPeopleInfoList();
        }

猜你喜欢

转载自blog.csdn.net/youyouwuxin1234/article/details/88829604