基本成型

This commit is contained in:
JACKYMYPERSON
2025-09-27 17:24:52 +08:00
parent 578d49826b
commit eae49c76bd
502 changed files with 15238 additions and 708 deletions

View File

@@ -1,6 +1,10 @@
import envConfig from "../../env";
Component({
data: {
processedCardsData: [] as any[]
processedCardsData: [] as any[],
refresherTriggered: false,
url:""
},
lifetimes: {
attached() {
@@ -11,6 +15,10 @@ Component({
}).catch(err => {
wx.showToast({ title: '加载失败', icon: 'none' });
});
const apiBaseUrl = `${envConfig.apiBaseUrl}`;
this.setData({
url:apiBaseUrl
})
},
},
methods: {
@@ -119,13 +127,47 @@ Component({
icon: 'success',
duration: 2000
});
},
goToDetail(e: { currentTarget: { dataset: { id: any; }; }; }) {
},
goToDetail(e: { currentTarget: { dataset: { id: any; }; }; }) {
const id = e.currentTarget.dataset.id;
console.log(id)
wx.navigateTo({
url: `/pages/articledetail/articledetail?id=${id}`,
});
}
},
onRefresherPulling() {
console.log("正在下拉...");
},
onRefresherRestore() {
console.log("刷新完成,已恢复原位");
},
onRefresherRefresh() {
console.log("用户文评刷新")
this.setData({
refresherTriggered: true
});
const app = getApp();
setTimeout(()=>{
app.fetchRawCardData().then(cards => {
this.setData({ processedCardsData: cards });
this.setData({
refresherTriggered: false
});
}).catch(err => {
wx.showToast({ title: '加载失败', icon: 'none' });
this.setData({
refresherTriggered: false
});
});
},2000)
}
}
});