xinelu-applet-ui/pagesB/Behaviorpoints/Behaviorpoints.vue

149 lines
3.5 KiB
Vue
Raw Normal View History

2023-09-20 14:21:34 +08:00
<template>
<view class="app">
2023-09-20 15:30:34 +08:00
<view class="background">
2023-09-20 17:44:17 +08:00
<view class="content">
2024-01-22 10:50:10 +08:00
<image mode="" :src="require('../images/jifen.png')" v-if='region==2'></image>
<image src="@/static/pagesB/Behave.png" mode="" v-if='region!=2' :style="region!=2?'height:350rpx':''">
</image>
<view class="name" v-if='region!=2'>我的积分
2023-09-20 17:44:17 +08:00
</view>
2024-01-22 10:50:10 +08:00
<view class="number" :style="region!=2?'top:35%':''">{{score?score:0}}
2023-09-20 17:44:17 +08:00
</view>
2024-01-22 10:50:10 +08:00
<view class="PointsMall" @tap='gointegral' :style="region!=2?'bottom:15%':''">
2023-09-20 17:44:17 +08:00
积分商城
</view>
2024-01-22 10:50:10 +08:00
<view class="Exchangerecords" @tap="goexchange" :style="region!=2?'bottom:15%':''">
2023-09-20 17:44:17 +08:00
兑换记录
</view>
2024-01-31 14:45:23 +08:00
<view class="wxSport" @tap="gowxSport" :style="region!=2?'bottom:15%':''">
微信运动
</view>
2023-09-20 14:21:34 +08:00
</view>
2023-09-20 17:44:17 +08:00
<view class="bottomitem">
<view class="PointsRecord">
积分记录
</view>
2023-10-16 11:21:27 +08:00
<view class="" v-if="list&&list.length>0">
<view class="item" v-for="item in list">
<view class="Establishingarchives">
{{item.actName}}
</view>
<view class="integral" v-if="item.score>0">
{{'+'+item.score}}
</view>
<view class="integral integraltwo" v-else>
{{item.score}}
</view>
<view class="timeone">
{{item.scoreDate}}
</view>
</view>
2023-09-20 17:44:17 +08:00
</view>
2023-10-16 11:21:27 +08:00
<u-empty v-else mode="list" icon-size='220' text='暂无积分记录'></u-empty>
2023-09-20 14:21:34 +08:00
</view>
</view>
</view>
</template>
<script>
2023-09-22 15:29:53 +08:00
import {
2023-10-16 11:21:27 +08:00
scorelist,
scoretotal
2023-10-16 10:08:17 +08:00
} from '@/api/pagesB/Behaviorpoints/index.js'
// import {
// mapActions
// } from "vuex";
2023-09-20 14:21:34 +08:00
export default {
data() {
return {
2023-10-16 10:08:17 +08:00
query: {
2023-10-16 11:21:27 +08:00
identity: uni.getStorageSync('userinfo').cardNo,
2023-10-16 10:08:17 +08:00
pageNum: 1,
pageSize: 10,
},
2024-01-22 10:50:10 +08:00
region: uni.getStorageSync('region'),
2023-10-16 11:21:27 +08:00
list: null,
2023-10-16 10:08:17 +08:00
total: 0,
2023-10-16 11:21:27 +08:00
score: 0,
2023-09-20 14:21:34 +08:00
};
},
2023-10-16 10:08:17 +08:00
onLoad() {
this.info();
2023-10-16 11:21:27 +08:00
this.scoretotalinfo();
2023-10-16 10:08:17 +08:00
},
2024-01-22 10:50:10 +08:00
onReady() { //更改导航栏文字
if (uni.getStorageSync('region') == 2) {
uni.setNavigationBarTitle({
2024-02-02 17:17:47 +08:00
title: '东营健康银行'
2024-01-22 10:50:10 +08:00
});
} else {
uni.setNavigationBarTitle({
title: '积分兑换'
});
}
},
2023-09-20 14:21:34 +08:00
methods: {
2023-10-16 11:21:27 +08:00
scoretotalinfo() {
scoretotal(this.query.identity).then(res => {
this.score = res.data
})
},
2023-10-16 10:08:17 +08:00
info() {
2023-10-16 11:21:27 +08:00
scorelist(this.query).then(res => {
2023-10-16 10:08:17 +08:00
this.list = res.rows
this.total = res.total
})
},
2024-01-31 14:45:23 +08:00
gowxSport() {
2024-02-03 10:21:02 +08:00
// uni.navigateTo({
// url: "/pagesC/wxSport/wxSport"
// })
2024-01-31 14:45:23 +08:00
},
2023-09-28 17:06:51 +08:00
goexchange() {
2023-09-27 13:50:42 +08:00
uni.navigateTo({
url: '/pagesB/exchangerecords/exchangerecords'
})
},
2023-09-22 15:29:53 +08:00
//积分页面
2023-10-16 10:08:17 +08:00
// ...mapActions(["integralopenPopup"]),
2023-09-22 15:29:53 +08:00
gointegral() {
2023-09-28 17:06:51 +08:00
// const value = uni.getStorageSync('openid');
// const value2 = uni.getStorageSync('patientId');
// if (value && value2) {
// setTimeout(e => {
// uni.navigateTo({
// url: `/pagesB/healthybeans/healthybeans?integral=${this.appPersonallist.integral}`
// })
// }, 0)
// } else {
uni.navigateTo({
url: '/pagesB/PointsMall/PointsMall'
})
// this.gologin();
// }
2023-09-22 15:29:53 +08:00
},
2023-09-20 14:21:34 +08:00
},
2023-10-16 10:08:17 +08:00
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.query.pageNum++
2023-10-16 11:21:27 +08:00
scorelist(this.query).then(res => {
2023-10-16 10:08:17 +08:00
if (res.rows) {
res.rows.forEach(e => {
this.list.push(e)
})
}
})
}
},
onPullDownRefresh() { //下拉刷新
this.query.pageNum = 1;
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
2023-09-20 14:21:34 +08:00
}
</script>
<style lang="scss">
2023-09-20 14:26:05 +08:00
@import './Behaviorpoints.scss'
2024-01-22 10:50:10 +08:00
</style>