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

176 lines
4.2 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-03-08 09:37:34 +08:00
<view class="title" v-if="region==2">
{{title}}
</view>
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-03-08 09:37:34 +08:00
<view class="flex" :style="region==2?'bottom:5%':''">
<view class="item" @tap='gointegral'>
积分商城
</view>
<view class="item" @tap="goexchange">
兑换记录
</view>
2023-09-20 17:44:17 +08:00
</view>
2024-03-08 09:37:34 +08:00
<view class="flex" v-if="region==2" :style="region==2?'bottom:-10%':''">
<view class="item" @tap="gowxSport">
微信运动
</view>
<view class="item" @tap='gobehavior'>
健康行为
</view>
2024-01-31 14:45:23 +08:00
</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'
2024-03-08 09:37:34 +08:00
import {
detail,
} from '@/api/pages/homepage/homepage.js'
2023-10-16 10:08:17 +08:00
// import {
// mapActions
// } from "vuex";
2023-09-20 14:21:34 +08:00
export default {
data() {
return {
2024-03-08 09:37:34 +08:00
noticebarlist: [
'给自己开一个健康储蓄账户',
],
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,
2024-03-08 09:37:34 +08:00
title: '',
orgNo: '',
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) {
2024-03-08 09:37:34 +08:00
detail(this.query.identity).then(res => {
2024-03-13 09:15:38 +08:00
let name = res.data.countyName.split('区')[0].split('县')
this.title = '东营健康银行' + name + '分行'
2024-03-08 09:37:34 +08:00
this.orgNo = res.data.orgNo
uni.setNavigationBarTitle({
2024-03-13 09:15:38 +08:00
title: '东营健康银行' + name + '分行'
2024-03-08 09:37:34 +08:00
});
})
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() {
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({
2024-03-08 09:37:34 +08:00
url: `/pagesB/exchangerecords/exchangerecords`
})
},
gobehavior() {
uni.navigateTo({
url: `/pagesB/behavior/behavior?orgNo=${this.orgNo}`
2023-09-27 13:50:42 +08:00
})
},
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>