优化页面
This commit is contained in:
@@ -67,6 +67,10 @@
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
class="scroll"
|
||||
refresher-enabled="true"
|
||||
refresher-threshold="40"
|
||||
@refresherrefresh="onRefresherRefresh"
|
||||
:refresher-triggered="triggered"
|
||||
>
|
||||
<uni-card v-for="(items,index) in coinNumlist" :key="index">
|
||||
<view class="contentcard">
|
||||
@@ -81,7 +85,6 @@
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -96,13 +99,8 @@ export default {
|
||||
return {
|
||||
title: "Hello",
|
||||
item: {},
|
||||
coinNumlist: [{
|
||||
winnerAnchorId: 1,
|
||||
anchorIdA: 1,
|
||||
anchorIdB: 2,
|
||||
anchorCoinA: 2,
|
||||
anchorCoinB: 3,
|
||||
}],
|
||||
coinNumlist: [],
|
||||
triggered: false,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -112,14 +110,20 @@ export default {
|
||||
eventChannel.on("itemDetail", (data) => {
|
||||
this.item = data.item; // 将接收到的数据赋值给item
|
||||
console.log("接收到的数据:", this.item);
|
||||
// this.getCoinNum(this.item)
|
||||
this.getCoinNum(this.item)
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 下拉刷新
|
||||
onRefresherRefresh(){
|
||||
this.triggered = true;
|
||||
this.coinNumlist = [];
|
||||
this.getCoinNum(this.item)
|
||||
},
|
||||
// 获取具体金币数量
|
||||
getCoinNum(item) {
|
||||
const res = request({
|
||||
url: "user/pkRecordDetail",
|
||||
url: "pk/fetchDetailPkDataWithId",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: item.id,
|
||||
@@ -128,6 +132,7 @@ export default {
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.coinNumlist = res.data;
|
||||
this.triggered = false;
|
||||
}else{
|
||||
console.log("获取金币数量失败")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user