xinelu-applet-ui/pagesB/Behaviorpoints/Behaviorpoints.vue
2024-06-25 18:25:50 +08:00

243 lines
6.5 KiB
Vue

<template>
<view class="app">
<view class="background">
<view class="content">
<view class="title">
{{title}}
</view>
<span v-if='region==2'>
<image :src="baseurl+ '/profile/weChatPicture/putongka.png'" v-if='score>=0&&score<800' />
<image :src="baseurl+ '/profile/weChatPicture/yinka.png'" v-if='score>=800&&score<1600' />
<image :src="baseurl+ '/profile/weChatPicture/jinka.png'" v-if='score>=1600&&score<2400' />
<image :src="baseurl+ '/profile/weChatPicture/bojinka.png'" v-if='score>=2400&&score<3000' />
<image :src="baseurl+ '/profile/weChatPicture/zuanshika.png'" v-if='score>=3000' />
</span>
<image :src="require('@/pagesC/images/Behave.png')" mode="" v-if='region!=2'
:style="region!=2?'height:350rpx':''">
</image>
<view class="name" v-if='region!=2'>我的积分
</view>
<view class="number" :style="region!=2?'top:35%;':''">
<span
:style="score>=0&&score<800?'color:#fff':score>=800&&score<1600?'color:#D3BC96':score>=1600&&score<2400?'color:#AD7600':score>=2400&&score<3000?'color:#FAEEDB':score>=3000?'color:#4864ED':''">
{{score?score:0}}
</span>
</view>
<view class="paiming" v-if="hkname=='河口'" @click='lookranking'>
<span
:style="score>=0&&score<800?'color:#fff':score>=800&&score<1600?'color:#D3BC96':score>=1600&&score<2400?'color:#AD7600':score>=2400&&score<3000?'color:#FAEEDB':score>=3000?'color:#4864ED':''">
积分榜排名:第{{scoreranking}}名
</span>
</view>
<view class="flex" v-if="region!=2">
<view class="item" @tap='gointegral'>
积分商城
</view>
<view class="item" @tap="goapplicationRecord">
申请记录
</view>
<view class="item" @tap="goexchange">
兑换记录
</view>
</view>
</view>
<view class="content" style="height: 200rpx;" v-if="region==2">
<view class="flex" style="top:10%">
<view class="item" @tap='gointegral'>
积分商城
</view>
<view class="item" @tap="goapplicationRecord">
申请记录
</view>
<view class="item" @tap="goexchange">
兑换记录
</view>
</view>
<view class="flex" style="top:50%">
<view class="item" @tap="gowxSport">
微信运动
</view>
<view class="item" @tap='gobehavior'>
健康行为
</view>
<view class="item" @tap='goFiveCardPackage'>
五卡套餐
</view>
</view>
</view>
<view class="bottomitem">
<view class="PointsRecord">
积分记录
</view>
<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>
</view>
<u-empty v-else mode="list" icon-size='220' text='暂无积分记录'></u-empty>
</view>
</view>
<u-popup v-model="lookrankingshow" mode="center" border-radius="14">
<view style="padding: 60rpx 60rpx 0;text-align: center;">
{{patientName}}在{{orgName}}
</view>
<view style="padding: 0 60rpx 0;text-align: center;">
健康积分排名榜
</view>
<view style="padding:10rpx 60rpx 60rpx;text-align: center;font-size: 36rpx;">
第{{scoreranking}}名
</view>
</u-popup>
</view>
</template>
<script>
import {
scorelist,
scoretotal,
scoreorder
} from '@/api/pagesB/Behaviorpoints/index.js'
import {
detail,
} from '@/api/pages/homepage/homepage.js'
// import {
// mapActions
// } from "vuex";
export default {
data() {
return {
query: {
identity: uni.getStorageSync('userinfo').cardNo,
pageNum: 1,
pageSize: 10,
},
region: uni.getStorageSync('region'),
list: [],
total: 0,
score: 0,
orgNo: '',
title: '',
hkname: '',
orgName: "",
patientName: "",
scoreranking: 0,
lookrankingshow: false,
};
},
onShow() {
this.list = []
this.query.pageNum = 1
this.info();
this.scoretotalinfo();
},
onReady() { //更改导航栏文字
if (uni.getStorageSync('region') == 2) {
detail(this.query.identity).then(res => {
this.orgName = res.data.orgName
this.hkname = res.data.countyName.split('')[0].split('')[0]
this.orgNo = res.data.orgNo
this.title = this.hkname + '健康信用中心'
this.patientName = uni.getStorageSync('userinfo').patientName
uni.setNavigationBarTitle({
title: this.hkname + '健康信用中心'
});
if (this.hkname == '河口') {
scoreorder(this.query.identity).then(resp => {
this.scoreranking = resp.data
})
}
})
} else {
uni.setNavigationBarTitle({
title: '积分兑换'
});
}
},
methods: {
lookranking() {
this.lookrankingshow = true
},
scoretotalinfo() {
scoretotal(this.query.identity).then(res => {
this.score = res.data
})
},
info() {
scorelist(this.query).then(res => {
this.list = [...this.list, ...res.rows]
this.total = res.total
})
},
gowxSport() {
uni.navigateTo({
url: "/pagesC/wxSport/wxSport"
})
},
goexchange() {
uni.navigateTo({
url: `/pagesB/exchangerecords/exchangerecords`
})
},
gobehavior() {
uni.navigateTo({
url: `/pagesB/behavior/behavior?orgNo=${this.orgNo}`
})
},
//积分页面
// ...mapActions(["integralopenPopup"]),
gointegral() {
// 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();
// }
},
goFiveCardPackage() {
uni.navigateTo({
url: "/pagesB/FiveCardPackage/FiveCardPackage"
})
},
goapplicationRecord() {
uni.navigateTo({
url: '/pagesB/applicationRecord/applicationRecord'
})
},
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.query.pageNum++
this.info();
}
},
onPullDownRefresh() { //下拉刷新
this.query.pageNum = 1;
this.list = []
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
@import './Behaviorpoints.scss'
</style>