2024-12-18 15:46:27 +08:00
|
|
|
<script setup>
|
|
|
|
/**
|
2025-03-04 09:03:08 +08:00
|
|
|
* 榴莲果变动明细
|
2024-12-18 15:46:27 +08:00
|
|
|
*/
|
|
|
|
import {
|
|
|
|
ref,
|
|
|
|
reactive,
|
|
|
|
computed,
|
|
|
|
} from 'vue'
|
|
|
|
import {
|
|
|
|
onLoad,
|
|
|
|
onReachBottom,
|
|
|
|
onPullDownRefresh
|
|
|
|
} from '@dcloudio/uni-app'
|
|
|
|
import {
|
|
|
|
useStore
|
|
|
|
} from 'vuex'
|
|
|
|
// 顶部
|
|
|
|
import apex from '/components/header/apex'
|
2025-01-05 15:43:14 +08:00
|
|
|
import api from '@/api/index.js';
|
2024-12-18 15:46:27 +08:00
|
|
|
// 工具库
|
|
|
|
import util from '@/common/js/util.js'
|
|
|
|
const store = useStore()
|
|
|
|
//积分变动记录
|
|
|
|
const scrollLog = reactive({
|
|
|
|
data: [],
|
|
|
|
pageNum: 1,
|
2025-01-05 15:43:14 +08:00
|
|
|
pageSize: 20,
|
2024-12-18 15:46:27 +08:00
|
|
|
total: 0,
|
|
|
|
})
|
2025-01-02 01:01:23 +08:00
|
|
|
// 榴莲树id
|
|
|
|
const id = ref('')
|
2024-12-18 15:46:27 +08:00
|
|
|
// 用户信息
|
|
|
|
const userinfo = computed(() => {
|
|
|
|
let result = store.state.userinfo
|
|
|
|
return result
|
|
|
|
})
|
|
|
|
|
2025-01-02 01:01:23 +08:00
|
|
|
onLoad((option) => {
|
|
|
|
if (option.id) id.value = option.id
|
2024-12-18 15:46:27 +08:00
|
|
|
// 获取列表
|
|
|
|
getList()
|
|
|
|
})
|
|
|
|
|
|
|
|
onPullDownRefresh(() => {
|
|
|
|
// 刷新列表
|
|
|
|
refreshList()
|
|
|
|
})
|
|
|
|
|
|
|
|
onReachBottom(() => {
|
|
|
|
// 获取更多列表
|
|
|
|
getMoreList()
|
|
|
|
})
|
|
|
|
|
|
|
|
// 刷新列表
|
|
|
|
function refreshList() {
|
|
|
|
scrollLog.homePageSize = 1
|
|
|
|
getList()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取更多列表
|
|
|
|
function getMoreList() {
|
|
|
|
if (scrollLog.total <= scrollLog.data.length) return
|
|
|
|
scrollLog.pageNum++
|
|
|
|
getList()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 积分变动明细
|
|
|
|
function getList() {
|
2025-01-05 15:43:14 +08:00
|
|
|
api.durian.getLog({
|
2024-12-18 15:46:27 +08:00
|
|
|
query: {
|
2025-01-05 15:43:14 +08:00
|
|
|
durianTreeInfoId: id.value,
|
2024-12-18 15:46:27 +08:00
|
|
|
pageNum: scrollLog.pageNum,
|
|
|
|
pageSize: scrollLog.pageSize,
|
|
|
|
}
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.code == 200) {
|
|
|
|
// 第一页
|
|
|
|
if (scrollLog.pageNum == 1) scrollLog.data.length = 0
|
|
|
|
// 合并
|
|
|
|
scrollLog.data.push(...rs.rows)
|
|
|
|
// 总数
|
|
|
|
scrollLog.total = rs.total
|
|
|
|
return
|
|
|
|
}
|
|
|
|
util.alert({
|
|
|
|
content: rs.msg,
|
|
|
|
showCancel: false,
|
|
|
|
})
|
|
|
|
}).finally(() => {
|
|
|
|
// 停止下拉刷新
|
|
|
|
uni.stopPullDownRefresh()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<view class="app">
|
|
|
|
<view class="list">
|
|
|
|
<view class="li" v-for="(item,index) in scrollLog.data" :key="index">
|
|
|
|
<view class="item rows ptb30 plr20 bfff">
|
|
|
|
<view class="col oh f1">
|
2025-01-05 15:43:14 +08:00
|
|
|
<view class="c333 f36">榴莲果树产出</view>
|
2024-12-18 15:46:27 +08:00
|
|
|
<view class="mt20 c666 f28">{{item.createTime}}</view>
|
|
|
|
</view>
|
|
|
|
<view class="change fs0 c333 f36" v-if="Number(item.scroll) != 0">
|
|
|
|
<text v-if="Number(item.scroll) > 0">+</text>
|
2025-01-05 15:43:14 +08:00
|
|
|
<text>{{item.releaseCount}}</text>
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
2025-02-19 18:02:15 +08:00
|
|
|
|
|
|
|
<!-- 暂无更多 -->
|
|
|
|
<view class="nomore mtb50" v-if="!scrollLog.data[0]">暂无明细~</view>
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
2025-01-05 15:43:14 +08:00
|
|
|
|
|
|
|
<!-- 填充 -->
|
|
|
|
<view class="fill"></view>
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
//
|
|
|
|
</style>
|