GLM-5-w4a8-mtp-QuaRot:终极Ascend NPU大模型量化部署指南
2026/5/30 9:28:05
随着生活节奏加快,家庭聚餐或个性化饮食需求增长,传统餐饮服务难以满足灵活、私密的用餐场景。微信小程序凭借高普及率、即用即走的特性,成为连接私房菜厨师与消费者的理想平台。
用户端:
厨师端:
社会价值:
该系统通过整合资源与技术创新,填补市场空白,兼具商业价值与社会效益。
前端技术
后端技术
云服务
用户系统
订单系统
地图与定位
前端优化
后端优化
数据安全
防攻击
自动化测试
持续集成
// app.js App({ onLaunch: function() { wx.login({ success: res => { wx.request({ url: 'https://yourdomain.com/api/login', data: { code: res.code }, success: (res) => { wx.setStorageSync('token', res.data.token) } }) } }) } })// pages/menu/menu.js Page({ data: { dishes: [], selected: [] }, onLoad() { wx.request({ url: 'https://yourdomain.com/api/dishes', success: (res) => { this.setData({ dishes: res.data }) } }) }, handleSelect(e) { const { id } = e.currentTarget.dataset this.setData({ selected: [...this.data.selected, id] }) } })// pages/order/order.js Page({ submitOrder() { wx.request({ url: 'https://yourdomain.com/api/orders', method: 'POST', header: { 'Authorization': wx.getStorageSync('token') }, data: { dishes: this.data.selected }, success: (res) => { wx.requestPayment({ timeStamp: res.data.timeStamp, nonceStr: res.data.nonceStr, package: res.data.package, signType: 'MD5', paySign: res.data.paySign, success: () => { wx.navigateTo({ url: '/pages/success/success' }) } }) } }) } })// pages/chef/chef.js Page({ data: { orders: [] }, onLoad() { this.fetchOrders() }, fetchOrders() { wx.request({ url: 'https://yourdomain.com/api/orders', header: { 'Authorization': wx.getStorageSync('token') }, success: (res) => { this.setData({ orders: res.data }) } }) }, acceptOrder(e) { const { id } = e.currentTarget.dataset wx.request({ url: `https://yourdomain.com/api/orders/${id}/accept`, method: 'PUT', header: { 'Authorization': wx.getStorageSync('token') }, success: () => { this.fetchOrders() } }) } })// pages/location/location.js Page({ getLocation() { wx.getLocation({ type: 'gcj02', success: (res) => { wx.request({ url: 'https://yourdomain.com/api/location', method: 'POST', data: { latitude: res.latitude, longitude: res.longitude }, header: { 'Authorization': wx.getStorageSync('token') } }) } }) } })// 用户模型 const userSchema = new Schema({ openid: { type: String, required: true, unique: true }, nickname: String, avatar: String, phone: String }) // 菜品模型 const dishSchema = new Schema({ name: { type: String, required: true }, price: { type: Number, required: true }, description: String, image: String, chef: { type: Schema.Types.ObjectId, ref: 'User' } }) // 订单模型 const orderSchema = new Schema({ user: { type: Schema.Types.ObjectId, ref: 'User' }, dishes: [{ type: Schema.Types.ObjectId, ref: 'Dish' }], status: { type: String, enum: ['pending', 'accepted', 'cooking', 'delivering', 'completed'], default: 'pending' }, address: Object, totalPrice: Number, createdAt: { type: Date, default: Date.now } })// 获取菜品列表 router.get('/api/dishes', async (ctx) => { const dishes = await Dish.find() ctx.body = dishes }) // 创建订单 router.post('/api/orders', auth, async (ctx) => { const { dishes } = ctx.request.body const totalPrice = await calculateTotalPrice(dishes) const order = await Order.create({ user: ctx.state.user.id, dishes, totalPrice }) ctx.body = order }) // 厨师接单 router.put('/api/orders/:id/accept', auth, async (ctx) => { const order = await Order.findByIdAndUpdate( ctx.params.id, { status: 'accepted', chef: ctx.state.user.id }, { new: true } ) ctx.body = order })