import { url } from '../request'; Page({ data: { current: 0, businessName:'', items: [ { title: '全部', }, { title: '待评价', }, ], dingdan:[ { image:'https://c-ssl.dtstatic.com/uploads/blog/202305/08/20230508112951_78480.thumb.400_0.jpeg' } ], }, onShow(){ my.getStorage({ key: 'userInfo', success: (res) => { const userInfo = res.data; this.setData({ id: userInfo.id, // 获取 id }); if (userInfo) { my.request({ url: url + '/api/level/list', method: 'POST', data: { }, headers: { 'content-type': 'application/json', }, dataType: 'json', success: (res) => { console.log(res,"sadkaskd"); }, fail: (error) => { console.error('请求失败: ', JSON.stringify(error)); my.alert({ content: '请求失败,请稍后重试' }); }, }); } else { my.alert({ content: '您未登录,请先登录。', success: () => { my.navigateTo({ url: '/pages/denglu/denglu', }); }, }); } }, }); }, // tab栏 onSwipeChange(e) { this.setData({ current: e.detail.current, }); }, onChange(current) { this.setData({ current, }); }, handleChange(current) { this.setData({ current, }); }, onPlus() { this.alert('plus'); }, alert(content) { my.alert({ title: content, }); }, pingjia(){ my.navigateTo({ url:'/pages/pingjia/pingjia' }) } });