qingcheng-xiaochengxu/pages/jiedan/jiedan.js
2025-05-15 21:01:14 +08:00

117 lines
2.0 KiB
JavaScript

import {url} from '../../request'
const { checkLogin } = require('../../utils/logcheck');
Page({
data: {
list:[],
show:false,
picture:[{
image:'/image/20250407154233.jpg'
},
{
image:'/image/20250407154300.png'
},
{
image:'/image/20250407154310.png'
}
],
selectedIndex: 0,
},
xiangqing(e){
const item = e.currentTarget.dataset.item;
const id = item.id
console.log(item);
wx.navigateTo({
url: `/pages/xiangqing/xiangqing?id=${id}`,
})
},
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
checkLogin();
const that = this
wx.getStorage({
key: "logmessage",
success(res) {
const userinfo = res.data.Authorization
wx.request({
url: url + '/project/query/card',
method: 'POST',
data: {
},
header: {
'content-type': 'application/json',
'Authorization': userinfo
},
success(res) {
console.log('查询成功', res);
if(res.data.code==1){
that.setData({
list:res.data.data
})
}else{
wx.showToast({
title: res.data.message,
icon:'error',
duration:2000
})
}
},
fail(err) {
console.error('请求失败', err);
}
});
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})