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

248 lines
6.7 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-13 14:41:18 +08:00
<view class="title">
{{title}}
</view>
2024-06-25 18:25:50 +08:00
<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':''">
2024-01-22 10:50:10 +08:00
</image>
<view class="name" v-if='region!=2'>我的积分
2023-09-20 17:44:17 +08:00
</view>
2024-03-13 14:02:58 +08:00
<view class="number" :style="region!=2?'top:35%;':''">
<span
2024-03-13 14:41:18 +08:00
: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':''">
2024-03-13 14:02:58 +08:00
{{score?score:0}}
</span>
2023-09-20 17:44:17 +08:00
</view>
2024-06-26 10:36:59 +08:00
<view class="paiming" v-if="hkname=='河口'&&scoreranking" @click='lookranking'>
2024-05-31 17:27:27 +08:00
<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':''">
2024-06-04 09:42:02 +08:00
积分榜排名{{scoreranking}}
2024-05-31 17:27:27 +08:00
</span>
</view>
2024-03-13 14:02:58 +08:00
<view class="flex" v-if="region!=2">
2024-03-08 09:37:34 +08:00
<view class="item" @tap='gointegral'>
积分商城
</view>
2024-03-18 14:53:52 +08:00
<view class="item" @tap="goapplicationRecord">
申请记录
</view>
2024-03-08 09:37:34 +08:00
<view class="item" @tap="goexchange">
兑换记录
</view>
2023-09-20 17:44:17 +08:00
</view>
2024-03-13 14:02:58 +08:00
</view>
<view class="content" style="height: 200rpx;" v-if="region==2">
<view class="flex" style="top:10%">
<view class="item" @tap='gointegral'>
积分商城
</view>
2024-03-18 14:53:52 +08:00
<view class="item" @tap="goapplicationRecord">
申请记录
</view>
2024-03-13 14:02:58 +08:00
<view class="item" @tap="goexchange">
兑换记录
</view>
2024-03-18 14:53:52 +08:00
</view>
<view class="flex" style="top:50%">
2024-03-08 09:37:34 +08:00
<view class="item" @tap="gowxSport">
微信运动
</view>
<view class="item" @tap='gobehavior'>
健康行为
</view>
2024-03-13 14:41:18 +08:00
<view class="item" @tap='goFiveCardPackage'>
五卡套餐
2024-03-13 14:02:58 +08:00
</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>
2024-06-04 11:34:44 +08:00
<u-popup v-model="lookrankingshow" mode="center" border-radius="14">
2024-06-04 10:25:09 +08:00
<view style="padding: 60rpx 60rpx 0;text-align: center;">
{{patientName}}{{orgName}}
</view>
<view style="padding: 0 60rpx 0;text-align: center;">
健康积分排名榜
</view>
2024-06-04 11:34:44 +08:00
<view style="padding:10rpx 60rpx 60rpx;text-align: center;font-size: 36rpx;">
2024-06-04 10:25:09 +08:00
{{scoreranking}}
2024-06-04 09:42:02 +08:00
</view>
</u-popup>
2023-09-20 14:21:34 +08:00
</view>
</template>
<script>
2023-09-22 15:29:53 +08:00
import {
2023-10-16 11:21:27 +08:00
scorelist,
2024-05-31 17:27:27 +08:00
scoretotal,
scoreorder
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'
2024-06-26 10:36:59 +08:00
import baseurl from '@/api/baseurl.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-06-26 10:36:59 +08:00
baseurl: '',
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'),
2024-03-13 09:34:25 +08:00
list: [],
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
orgNo: '',
2024-03-13 14:41:18 +08:00
title: '',
2024-05-31 17:27:27 +08:00
hkname: '',
2024-06-04 09:42:02 +08:00
orgName: "",
patientName: "",
2024-06-26 10:36:59 +08:00
scoreranking: undefined,
2024-06-04 09:42:02 +08:00
lookrankingshow: false,
2023-09-20 14:21:34 +08:00
};
},
2024-03-13 09:34:25 +08:00
onShow() {
this.list = []
this.query.pageNum = 1
2023-10-16 10:08:17 +08:00
this.info();
2023-10-16 11:21:27 +08:00
this.scoretotalinfo();
2023-10-16 10:08:17 +08:00
},
2024-06-26 10:36:59 +08:00
onLoad() {
this.baseurl = baseurl
},
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-06-04 09:42:02 +08:00
this.orgName = res.data.orgName
2024-05-31 17:27:27 +08:00
this.hkname = res.data.countyName.split('区')[0].split('县')[0]
2024-03-08 09:37:34 +08:00
this.orgNo = res.data.orgNo
2024-05-31 17:27:27 +08:00
this.title = this.hkname + '健康信用中心'
2024-06-04 09:42:02 +08:00
this.patientName = uni.getStorageSync('userinfo').patientName
2024-03-08 09:37:34 +08:00
uni.setNavigationBarTitle({
2024-05-31 17:27:27 +08:00
title: this.hkname + '健康信用中心'
2024-03-08 09:37:34 +08:00
});
2024-05-31 17:27:27 +08:00
if (this.hkname == '河口') {
scoreorder(this.query.identity).then(resp => {
this.scoreranking = resp.data
})
}
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: {
2024-06-04 09:42:02 +08:00
lookranking() {
this.lookrankingshow = true
},
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 => {
2024-03-13 09:34:25 +08:00
this.list = [...this.list, ...res.rows]
2023-10-16 10:08:17 +08:00
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
},
2024-03-13 14:41:18 +08:00
goFiveCardPackage() {
uni.navigateTo({
url: "/pagesB/FiveCardPackage/FiveCardPackage"
})
},
2024-03-18 14:53:52 +08:00
goapplicationRecord() {
uni.navigateTo({
url: '/pagesB/applicationRecord/applicationRecord'
})
},
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++
2024-03-13 09:34:25 +08:00
this.info();
2023-10-16 10:08:17 +08:00
}
},
onPullDownRefresh() { //下拉刷新
this.query.pageNum = 1;
2024-03-13 09:34:25 +08:00
this.list = []
2023-10-16 10:08:17 +08:00
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>