This commit is contained in:
dragon
2024-12-05 15:10:40 +08:00
parent d5c4817631
commit 01a825a7a6
2 changed files with 107 additions and 45 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

View File

@@ -10,6 +10,10 @@
!this.$store.state.isApp ? 'diamond-tab' : 'diamond-tab crystal-top-app' !this.$store.state.isApp ? 'diamond-tab' : 'diamond-tab crystal-top-app'
" "
> >
<div :class="tab === 0 ? 'active' : ''" @click="cutTab(11)">
<span> {{ $t("diamondLog.All") }}</span>
<span :class="tab === 0 ? 'active' : ''"></span>
</div>
<div :class="tab === 11 ? 'active' : ''" @click="cutTab(11)"> <div :class="tab === 11 ? 'active' : ''" @click="cutTab(11)">
<span> {{ $t("diamondLog.收入記錄") }}</span> <span> {{ $t("diamondLog.收入記錄") }}</span>
<span :class="tab === 11 ? 'active' : ''"></span> <span :class="tab === 11 ? 'active' : ''"></span>
@@ -23,15 +27,20 @@
<span :class="tab === 1 ? 'active' : ''"></span> <span :class="tab === 1 ? 'active' : ''"></span>
</div> </div>
</div> </div>
<div class="dataList">
<img src="@/assets/img/dataList.png" alt="" />
<span>2024-11-23</span>
</div>
<van-index-bar <van-index-bar
:index-list="indexList" :index-list="indexList"
class="diamond-list" class="diamond-list"
:sticky-offset-top="!this.$store.state.isApp ? unApp : isApp" :sticky-offset-top="htmlDomXd"
> >
<!-- :sticky-offset-top="!this.$store.state.isApp ? unApp : isApp" -->
<!-- v-model="loading" --> <!-- v-model="loading" -->
<!-- :finished="finished" -->
<van-list <van-list
style="width: 100%" style="width: 100%"
:finished="finished"
:finished-text="this.$t(`diamondLog.加載中`)" :finished-text="this.$t(`diamondLog.加載中`)"
@load="onLoad" @load="onLoad"
> >
@@ -42,26 +51,26 @@
index="1" index="1"
v-if="thinkTime(index, item)" v-if="thinkTime(index, item)"
> >
<!-- <span class="time">{{ relDate(item.date) }}</span> --> <div class="boxs">
<span> <div>
{{ <span class="time">
tab === 11 {{
? $t("diamondLog.共收入") tab === 11
: tab == 1 ? $t("diamondLog.共收入")
? $t("diamondLog.共獲得價值") : tab == 1
: $t("diamondLog.共支出") ? $t("diamondLog.共獲得價值")
}} : $t("diamondLog.共支出")
</span> }}
<span class="total"> </span>
{{ tab === 1 ? item.totalGiftGoldNumDailySum : item.total }} <span class="total">
</span> {{ tab === 1 ? item.totalGiftGoldNumDailySum : item.total }}
<span>{{ </span>
tab === 11 <img class="img" src="@/assets/img/gold.png" alt="" srcset="" />
? $t("diamondLog.金幣") </div>
: tab == 1 <div>
? $t("diamondLog.金幣的禮物") <span class="time">{{ relDate(item.date) }}</span>
: $t("diamondLog.金幣") </div>
}}</span> </div>
</van-index-anchor> </van-index-anchor>
<div <div
@@ -354,6 +363,8 @@
</div> </div>
</van-list> </van-list>
</van-index-bar> </van-index-bar>
<!-- loadingText -->
<div v-show="finished" class="loadingText">加载中...</div>
</div> </div>
</template> </template>
@@ -368,7 +379,7 @@ export default {
list: [], //數據列錶 list: [], //數據列錶
page: 0, //分頁 page: 0, //分頁
loading: false, //加載中 loading: false, //加載中
finished: false, //是否加載完 finished: true, //是否加載完
indexList: [], //不清楚應該沒啥用 indexList: [], //不清楚應該沒啥用
//點擊tab類型 //點擊tab類型
tab: 11, tab: 11,
@@ -392,6 +403,10 @@ export default {
let htmlDom = document.getElementsByTagName("html")[0]; let htmlDom = document.getElementsByTagName("html")[0];
return (90 / 37.5) * Number(htmlDom.style.fontSize.slice(0, -2)); return (90 / 37.5) * Number(htmlDom.style.fontSize.slice(0, -2));
}, },
htmlDomXd() {
let htmlDom = document.getElementsByTagName("html")[0];
return (116 / 37.5) * Number(htmlDom.style.fontSize.slice(0, -2));
},
}, },
methods: { methods: {
cutTab(tab) { cutTab(tab) {
@@ -399,7 +414,7 @@ export default {
this.page = 0; this.page = 0;
this.list = []; this.list = [];
this.loading = false; this.loading = false;
this.finished = false; this.finished = true;
this.onLoad(); this.onLoad();
}, },
onLoad() { onLoad() {
@@ -418,13 +433,13 @@ export default {
} else { } else {
this.list.push(...res.data.data.billList); this.list.push(...res.data.data.billList);
} }
if (res.data.data.billList.length > 0) { if (res.data.data.billList.length <= 0) {
this.finished = true; // 停止监听到底部事件 this.finished = false;
} }
this.loading = false; this.loading = false;
} else { } else {
Toast(res.data.message); Toast(res.data.message);
this.finished = true; // 如果出错也停止加载,防止死循环 this.finished = false;
} }
}); });
}, },
@@ -454,12 +469,12 @@ export default {
// }, // },
//判斷是否相同時間 //判斷是否相同時間
thinkTime(index, item) { thinkTime(index, item) {
// let { list } = this; let { list } = this;
// if (!index) return true; if (!index) return true;
// if (list[index].date === list[index - 1].date) { if (list[index].date === list[index - 1].date) {
// return false; return false;
// } }
return index == 0 ? true : false; // return index == 0 ? true : false;
}, },
relDate(value, think) { relDate(value, think) {
return formatDate(value, think); return formatDate(value, think);
@@ -474,6 +489,42 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.loadingText{
width: 100%;
text-align: center;
color: #AFB1B3;
font-size: 14px;
margin: 20px auto 20px;
}
.diamond-list {
margin-top: 66px;
}
.dataList {
position: fixed;
top: 90px;
left: 50%;
transform: translateX(-50%);
z-index: 2;
background: #fff;
width: 100%;
height: 26px;
line-height: 26px;
display: flex;
justify-content: center;
img {
display: inline-block;
width: 26px;
height: 26px;
vertical-align: middle;
}
span {
display: inline-block;
vertical-align: middle;
color: #313131;
font-size: 14px;
font-weight: 600;
}
}
.diamond-tab { .diamond-tab {
height: 40px; height: 40px;
position: fixed; position: fixed;
@@ -483,11 +534,16 @@ export default {
width: 100%; width: 100%;
display: flex; display: flex;
z-index: 9999; z-index: 9999;
overflow-x: scroll;
&::-webkit-scrollbar {
display: none;
}
&.crystal-top-app { &.crystal-top-app {
top: 0px; top: 0px;
} }
div { div {
width: 50%; width: 50%;
margin: 0 10px;
font-size: 15px; font-size: 15px;
color: #666; color: #666;
display: flex; display: flex;
@@ -515,15 +571,11 @@ export default {
} }
} }
} }
.diamond-list {
margin-top: 40px;
}
.in-all { .in-all {
font-size: 12px; font-size: 12px;
//#7154EE position: sticky;
top: 116px; /* 吸顶位置距离顶部 50px */
span { span {
color: #666;
font-size: 12px;
&.total { &.total {
color: #ffa936; color: #ffa936;
font-size: 14px; font-size: 14px;
@@ -531,12 +583,25 @@ export default {
font-weight: bold; font-weight: bold;
} }
&.time { &.time {
padding-right: 10px; // padding-right: 10px;
color: #313131;
font-size: 14px;
font-weight: 600;
} }
vertical-align: middle;
}
img {
display: inline-block;
width: 20px;
height: 20px;
vertical-align: middle;
} }
} }
.van-index-anchor { .boxs {
background: #f5f5f5 !important; width: 100%;
display: flex;
justify-content: space-between;
} }
.in-all-detail { .in-all-detail {
width: 345px; width: 345px;
@@ -582,9 +647,6 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
span { span {
// color: #313131;
// font-size: 16px;
// font-weight: 600;
} }
} }
} }