fix: 对齐服务分类和订单视觉结构

This commit is contained in:
que01 committed 2026-09-19 10:46:30 +08:00
1 parent 662649a08f
commit 13ead2d426
5 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -1,2 +1,2 @@
const API = 'http://localhost:3001';
Page({data:{loading:true,services:[]},onLoad(){wx.request({url:API+'/public/services',success:res=>this.setData({services:res.data,loading:false}),fail:()=>this.setData({loading:false})})},book(e){wx.navigateTo({url:'/pages/booking/index?serviceId='+e.currentTarget.dataset.id})}});
Page({data:{loading:true,services:[],filtered:[],category:'package'},onLoad(){wx.request({url:API+'/public/services',success:res=>this.setData({services:res.data,filtered:res.data.filter(x=>x.priceAmount!==null),loading:false}),fail:()=>this.setData({loading:false})})},switchCategory(e){const category=e.currentTarget.dataset.category;const filtered=category==='package'?this.data.services.filter(x=>x.priceAmount!==null):this.data.services.filter(x=>x.priceAmount===null);this.setData({category,filtered})},book(e){wx.navigateTo({url:'/pages/booking/index?serviceId='+e.currentTarget.dataset.id})}});