jiaqingjiayi-xiaochengxu/甲情_甲意/miniprogram/pages/wodepingjia/wodepingjia.js

99 lines
2.0 KiB
JavaScript
Raw Normal View History

2024-12-03 11:59:36 +00:00
import { url } from '../request';
2024-11-10 07:01:22 +00:00
Page({
2024-12-03 11:59:36 +00:00
data: {
current: 0,
businessName:'',
2025-01-21 13:56:53 +00:00
message:[],
2024-12-03 11:59:36 +00:00
items: [
{
title: '全部',
},
{
title: '待评价',
},
],
dingdan:[
{
image:'https://c-ssl.dtstatic.com/uploads/blog/202305/08/20230508112951_78480.thumb.400_0.jpeg'
}
],
2025-01-21 13:56:53 +00:00
2024-12-03 11:59:36 +00:00
},
2025-01-13 13:07:00 +00:00
onShow(){
my.getStorage({
key: 'userInfo',
success: (res) => {
const userInfo = res.data;
this.setData({
id: userInfo.id, // 获取 id
});
2024-12-03 11:59:36 +00:00
2025-01-13 13:07:00 +00:00
if (userInfo) {
my.request({
url: url + '/api/level/list',
method: 'POST',
data: {
2025-01-21 13:56:53 +00:00
id: this.data.id
2025-01-13 13:07:00 +00:00
},
headers: {
'content-type': 'application/json',
},
dataType: 'json',
success: (res) => {
2025-01-21 13:56:53 +00:00
console.log(res,"sadkaskd"),
this.setData({
message:res.data.data
}),
console.log(this.data.message);
2025-01-13 13:07:00 +00:00
},
fail: (error) => {
console.error('请求失败: ', JSON.stringify(error));
my.alert({ content: '请求失败,请稍后重试' });
},
});
} else {
my.alert({
content: '您未登录,请先登录。',
success: () => {
my.navigateTo({
url: '/pages/denglu/denglu',
});
},
});
}
},
});
},
2024-12-03 11:59:36 +00:00
// 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,
});
},
2024-12-10 10:35:22 +00:00
pingjia(){
my.navigateTo({
url:'/pages/pingjia/pingjia'
})
}
2024-11-10 07:01:22 +00:00
});
2024-12-03 11:59:36 +00:00