fix: 配置局域网 API 地址用于真机调试
This commit is contained in:
1 parent
60cac4155a
commit
5db15538ad
5 files changed
+5
-5
No files matched your search
@@ -1,2 +1,2 @@
|
||||
const API = 'http://localhost:3001';
|
||||
const API = getApp().globalData.apiBaseUrl;
|
||||
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})}});
|
||||
Reference in new issue
Block a user