jiaqingjiayi-xiaochengxu/甲情_甲意/miniprogram/pages/wodepingjia/wodepingjia.js
2025-01-21 21:56:53 +08:00

99 lines
2.0 KiB
JavaScript

import { url } from '../request';
Page({
data: {
current: 0,
businessName:'',
message:[],
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: {
id: this.data.id
},
headers: {
'content-type': 'application/json',
},
dataType: 'json',
success: (res) => {
console.log(res,"sadkaskd"),
this.setData({
message:res.data.data
}),
console.log(this.data.message);
},
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'
})
}
});