| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <!-- 积分明细 -->
- <template>
- <view class="pointsDetails">
- <view class="top-text-box">
- <view class="img-box">
- <img class="img-view" :src="imagesUrl('commonality/icon_wd_jlf@1x.png')">
- <view class="img-text">{{maxNum}}</view>
- </view>
- <view class="text-box">积分可以在兑换机扫码兑换丰富礼品</view>
- </view>
- <view class="top-button-box">
- <view :class="checkIndex == 4?'check-button':''" @click="checkButton(4)">全部收支</view>
- <view :class="checkIndex == 1?'check-button':''" @click="checkButton(1)">已获取</view>
- <view :class="checkIndex == 2?'check-button':''" @click="checkButton(2)">已消耗</view>
- </view>
- <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
- <view class="for-big-box" v-for="(item,index) in dataList" :key="index">
- <img class="left-img" :src="imagesUrl('commonality/icon_wd_jlf@1x.png')"/>
- <!-- <view class="center-box" v-if="item.data1 == 1">
- <view>{{item.changeInfo}}</view>
- <view>{{item.data3}}</view>
- </view> -->
- <view class="center-box-1">
- <view>{{item.changeInfo}}</view>
- </view>
- <view class="right-box">
- <view :class="item.scoreChange>0?'up-color':''">{{item.scoreChange>0?'+'+item.scoreChange:item.scoreChange}}</view>
- <view>{{item.createTime}}</view>
- </view>
- </view>
- <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
- <view class="get-data-null-p" v-if="!getDataType && textShowType">- 上划加载更多 -</view>
- </scroll-view>
- </view>
- </template>
- <script>
- import { creditMainGetUserReward } from '@/pages_basics/api/index.js'
- export default {
- data() {
- return {
- total: 0,
- dataList: [
- {
- data1:'1',
- data2:'礼品兑换消耗积分',
- data3:'(矿泉水)',
- data4:'-10',
- data5:'2026-03-06 15:29',
- },
- {
- data1:'2',
- data2:'完成课程学习获取积分',
- data3:'',
- data4:'+10',
- data5:'2026-03-06 15:29',
- },
- ],
- getDataType: false,
- // 查询参数
- checkIndex:4,
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- maxNum:0,
- textShowType:false,
- }
- },
- onLoad(option){
- console.log('option',option)
- this.$set(this,'maxNum',option.q?option.q:0);
- this.getList()
- },
- onShow(){
- },
- methods:{
- checkButton(type){
- if(this.checkIndex!=type){
- this.$set(this,'checkIndex',type);
- this.$set(this,'total',0);
- this.$set(this,'dataList',[]);
- this.$set(this,'getDataType',false);
- this.$set(this.queryParams,'page',1);
- this.getList();
- }
- },
- //滚动加载事件
- scrollGet() {
- let self = this;
- if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- } else {
- this.queryParams.page += 1;
- this.$nextTick(() => {
- this.getList();
- })
- }
- },
- //获取实验室列表
- async getList() {
- let self = this;
- let obj = JSON.parse(JSON.stringify(this.queryParams));
- if(this.checkIndex == 4){
- obj.bonusType = '';
- }else{
- obj.bonusType = this.checkIndex
- }
- const {
- data
- } = await creditMainGetUserReward(obj);
- if (data.code == 200) {
- if(self.queryParams.page == 1){
- this.dataList = data.data.records;
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }else{
- this.dataList = [...this.dataList, ...data.data.records]
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- this.$set(this,'textShowType',true);
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- .pointsDetails{
- height:100%;
- width:100%
- overflow: hidden;
- display: flex;
- flex-direction: column;
- .top-text-box{
- background-color: #fff;
- height:230rpx;
- .img-box{
- display: flex;
- margin: 40rpx 0 0 300rpx;
- .img-view{
- width:60rpx;
- height:56rpx;
- }
- .img-text{
- line-height:56rpx;
- height:56rpx;
- flex:1;
- font-size:46rpx;
- margin-left:20rpx;
- }
- }
- .text-box{
- background-color: #FDECD5;
- color:#333;
- text-align: center;
- font-size:28rpx;
- width:540rpx;
- height:60rpx;
- line-height:60rpx;
- border-radius:30rpx;
- margin: 30rpx auto 0
- }
- }
- .top-button-box{
- height:100rpx;
- display: flex;
- view{
- width: 180rpx;
- background-color: #D7D7D7;
- color:#333;
- text-align: center;
- height:60rpx;
- line-height:60rpx;
- margin:20rpx 0 0 20rpx;
- border-radius:10rpx;
- }
- .check-button{
- background-color:#06D0D0;
- color:#fff;
- }
- }
-
- .for-max-box {
- flex: 1;
- overflow-y scroll;
- .null-img {
- display block;
- width: 276rpx;
- height: 321rpx;
- position absolute;
- top: 200rpx;
- left: 274rpx;
- }
- .for-big-box:nth-child(1) {
- border-top: none;
- }
- .for-big-box{
- background: #fff;
- border-top:1rpx solid #dedede;
- display: flex;
- .left-img{
- width:30rpx;
- height:28rpx;
- margin:61rpx 30rpx 61rpx 40rpx;
- }
- .center-box{
- flex:1;
- padding: 40rpx 0;
- view{
- height:35rpx;
- line-height:35rpx;
- font-size:28rpx;
- font-weight:700;
- }
- view:nth-child(1){
-
- }
- view:nth-child(2){
- color:#A1988D;
- }
- }
- .center-box-1{
- flex:1;
- padding: 40rpx 0;
- view{
- height:70rpx;
- line-height:70rpx;
- font-size:28rpx;
- font-weight:700;
- }
- }
- .right-box{
- // width:250rpx;
- width:288rpx;
- view:nth-child(1){
- padding-right:30rpx;
- text-align: right;
- color:#666;
- line-height:60rpx;
- height:60rpx;
- margin-top:20rpx;
- font-weight:700;
- }
- view:nth-child(2){
- font-size:26rpx;
- color:#A1988D;
- line-height:60rpx;
- height:60rpx;
- }
- .up-color{
- color: #d9001d !important;;
- }
- }
- }
- }
- .get-data-null-p{
- text-align: center;
- height:80rpx;
- line-height:80rpx;
- color:#999;
- }
- }
- </style>
|