Online ordering and delivery system based on WeChat applet

Contents Chapter
1 Introduction 1
1.1 Research background 1
1.2 Research purpose and significance 1
1.2.1 Research purpose 1
1.2.2 Research significance 2
1.3 Analysis of domestic and foreign research status 2
1.3.1 Foreign research status 2
1.3.2 Domestic research status 3
1.4 Research Content and Method 3
1.4.1 Research Content 3
1.4.2 Research Method 4
1.4.3 Technical Roadmap 4
Chapter 2 System Analysis 6
2.1 Feasibility Analysis 6
2.1.1 Technical Feasibility 6
2.1.2 Economic Feasibility 7
2.1 .3 Social Feasibility 7
2.2 Demand Analysis 7
2.2.1 System Functional Requirement Analysis 7
2.2.2 System Non-functional Requirement Analysis 8
2.3 System Business Process Analysis 9
2.4 System Data Process Analysis 11
2.5 Chapter Summary 14
Chapter 3 System Design 15
3.1 System overall design 15
3.2 System function structure design 15
3.2.1 Client function structure design 15
3.2.2 Administrator function structure design 18
3.3 Database overall design 21
3.3.1 Database ER diagram design 21
3.3.2 Database table design 22
3.4 Code design 24
3.4.1 Business logic design 24
3.4.2 Presentation layer design 24
3.4.3 Project difficulties and solutions 24
3.4.4 Typical code fragments and design process 24
3.5 Input and output design 27
3.5.1 Input design 27
3.5. 2 Output Design 27
3.6 Chapter Summary 27
Chapter 4 System Implementation and Testing 28
4.1 System Development Environment 28
4.2 Related Technologies 28
4.2.1 JAVA Language 28
4.2.2 MySQL Database 29
4.2.3 Vue.js Framework 29
4.2.4 SSM Framework 29
4.2.5 Tomcat server 30
4.3 Client function module 30
4.4 Administrator function interface 40
4.5 System test 44
4.5.1 System test purpose 44
4.5.2 System test method 45
4.5.3 Test case 45
4.6 Summary of this chapter 45 Conclusion
47
Acknowledgments 48
References 49
1.4 Research content and methods
1.4.1 Research content
The design of this online ordering system mainly includes two parts: user function module and administrator function module. Among them, the main function modules of the user part include registration and login, information management, order management, and evaluation management. The functions of the administrator part mainly include system management, order management and dish management.
(1) User function module: including functions such as adding table numbers, modifying table numbers, adding notes, adding dishes, deleting dishes, querying dishes, paying for member discounts, and paying for ordinary users; user information management functions include viewing historical orders, viewing personal Information and modification of personal information and other functions; login management functions include functions such as registering an account, logging in to an account, and logging out of an account; evaluation management functions include functions such as adding comments, deleting comments, and adding additional comments.
(2) Administrator part: including modules such as dish management, system management and order management. In the dish management module, the administrator can replace the dish carousel, add new dishes, delete expired dishes, and modify the unit price of dishes, dish material descriptions, dish inventory and other related information; in the system management module, the administrator can Perform information review and user management for newly registered users, and at the same time modify the administrator's login password and other functions; in the order management module, the administrator reviews the order submitted by the user, and at the same time can view the user's order details and user evaluation details.

//app.js
App({
    
    
  //创建towxml对象,供小程序页面使用
  globalData: {
    
    
    tmplIds: {
    
    
      quhao: 'txbpCYdX_pjw0PXsOJrbCKixdHtJSUr4uyhQQEzAz_4', //取号的模板,记得把这里换成你自己的
    },
    vipInfo: {
    
    },
    openid: null,
    baseUrl: 'http://localhost:8080/diancan' //本地调试
    // baseUrl: 'http://192.168.31.171:8080/diancan' //真机调试,这里的ip地址一定是你电脑的ip
  },
  onLaunch: function () {
    
    
    //云开发初始化
    wx.cloud.init({
    
    
      env: 'study-gas4x', //这里一定要换成你自己的云开发环境id
      traceUser: true,
    })
    this.getOpenid();
  },
  // 获取用户openid
  getOpenid: function () {
    
    
    var app = this;
    var openidStor = wx.getStorageSync('openid');
    // if (openidStor) {
    
    
    //   console.log('本地获取openid:' + openidStor);
    //   app.globalData.openid = openidStor;
    //   app._getMyUserInfo();
    // } else {
    
    
    wx.cloud.callFunction({
    
    
      name: 'getOpenid',
      success(res) {
    
    
        console.log('云函数获取openid成功', res.result.openid)
        var openid = res.result.openid;
        wx.setStorageSync('openid', openid)
        app.globalData.openid = openid;
        app._getMyUserInfo();
      },
      fail(res) {
    
    
        console.log('云函数获取失败', res)
      }
    })
    // }
  },
  //获取自己后台的user信息
  _getMyUserInfo() {
    
    
    let app = this
    wx.request({
    
    
      url: app.globalData.baseUrl + '/user/getUserInfo',
      data: {
    
    
        openid: app.globalData.openid
      },
      success: function (res) {
    
    
        console.log("Java后台返回的用户信息", res.data)
        if (res && res.data && res.data.data) {
    
    
          app._updateVipInfo(res.data.data)
        }
      }
    })
  },
  //更新会员信息
  _updateVipInfo(data) {
    
    
    let app = this
    app.globalData.vipInfo = data;
    console.log("===app.globalData===", app.globalData.vipInfo)
  },
  _checkOpenid() {
    
    
    let app = this
    let openid = this.globalData.openid;
    if (!openid) {
    
    
      app.getOpenid();
      wx.showLoading({
    
    
        title: 'openid不能为空,请重新登录',
      })
      return null;
    } else {
    
    
      return openid;
    }
  },
  //获取今天是本月第几周
  _getWeek: function () {
    
    
    // 将字符串转为标准时间格式
    let date = new Date();
    let month = date.getMonth() + 1;
    let week = this.getWeekFromDate(date);
    if (week === 0) {
    
     //第0周归于上月的最后一周
      month = date.getMonth();
      let dateLast = new Date();
      let dayLast = new Date(dateLast.getFullYear(), dateLast.getMonth(), 0).getDate();
      let timestamp = new Date(new Date().getFullYear(), new Date().getMonth() - 1, dayLast);
      week = this.getWeekFromDate(new Date(timestamp));
    }
    let time = month + "月第" + week + "周";
    return time;
  },

  getWeekFromDate: function (date) {
    
    
    // 将字符串转为标准时间格式
    let w = date.getDay(); //周几
    if (w === 0) {
    
    
      w = 7;
    }
    let week = Math.ceil((date.getDate() + 6 - w) / 7) - 1;
    return week;
  },
  // 获取当前时间
  _getCurrentTime(times) {
    
    
    var d = new Date();
    if (times) {
    
    
      d = new Date(times);
    }
    var month = d.getMonth() + 1;
    var date = d.getDate();
    var day = d.getDay();
    var hours = d.getHours();
    var minutes = d.getMinutes();
    var seconds = d.getSeconds();
    var ms = d.getMilliseconds();

    var curDateTime = d.getFullYear() + '年';
    if (month > 9)
      curDateTime += month + '月';
    else
      curDateTime += month + '月';

    if (date > 9)
      curDateTime = curDateTime + date + "日";
    else
      curDateTime = curDateTime + date + "日";
    if (hours > 9)
      curDateTime = curDateTime + hours + "时";
    else
      curDateTime = curDateTime + hours + "时";
    if (minutes > 9)
      curDateTime = curDateTime + minutes + "分";
    else
      curDateTime = curDateTime + minutes + "分";
    return curDateTime;
  }
})

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/sheziqiong/article/details/131825148