|
@@ -1,18 +1,15 @@
|
|
|
<!-- 进步积分 -->
|
|
|
<template>
|
|
|
<view class="integral">
|
|
|
- <z-paging
|
|
|
- ref="paging"
|
|
|
- v-model="integralList"
|
|
|
- @query="queryList"
|
|
|
- >
|
|
|
+ <z-paging ref="paging" v-model="integralList" @query="queryList">
|
|
|
<!-- 导航栏 -->
|
|
|
- <u-navbar class="evaluate-intention-bar" back-text="" title="进步积分" :background="background" title-color="#fff" back-icon-color="#fff" slot="top">
|
|
|
+ <u-navbar class="evaluate-intention-bar" back-text="" title="进步积分" :background="background"
|
|
|
+ title-color="#fff" back-icon-color="#fff" slot="top">
|
|
|
</u-navbar>
|
|
|
-
|
|
|
+
|
|
|
<!-- 背景 -->
|
|
|
<view class="integral-bg" slot="top"></view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 内容 -->
|
|
|
<view class="integral-content" style="margin-top: -472rpx;" slot="top">
|
|
|
<view class="integral-content-header">
|
|
@@ -26,9 +23,13 @@
|
|
|
<view></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="integral-content-header-rules" @click="jumpPage('/pages/integralRule/integralRule')">积分规则<u-icon name="arrow-right"/></view>
|
|
|
+ <view class="integral-content-header-rules" @click="jumpPage('/pages/integralRule/integralRule')">
|
|
|
+ 积分规则
|
|
|
+ <u-icon name="arrow-right" />
|
|
|
+ </view>
|
|
|
<view class="integral-content-header-behavior">
|
|
|
- <view class="item" v-for="(item, index) in behaviorList" :key="index">{{ item.count }}<text>个{{ item.type == 1 ? '加' : '减' }}分行为</text></view>
|
|
|
+ <view class="item" v-for="(item, index) in behaviorList" :key="index">
|
|
|
+ {{ item.count }}<text>个{{ item.type == 1 ? '加' : '减' }}分行为</text></view>
|
|
|
<!-- <view class="item">0<text>个减分行为</text></view> -->
|
|
|
</view>
|
|
|
</view>
|
|
@@ -106,7 +107,28 @@
|
|
|
getIntegralTotal() {
|
|
|
this.$u.api.mine.totalCount().then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- this.behaviorList = res.data;
|
|
|
+ let list = []
|
|
|
+ res.data.forEach(item => {
|
|
|
+ if (item.type == 0) {
|
|
|
+ const obj = {
|
|
|
+ type: 1, count: 0, total: 0
|
|
|
+ }
|
|
|
+ if (res.data.length == 1) {
|
|
|
+ list.push(obj)
|
|
|
+ }
|
|
|
+ } else if (item.type == 1) {
|
|
|
+ const obj = {
|
|
|
+ type: 0, count: 0, total: 0
|
|
|
+ }
|
|
|
+ if (res.data.length == 1) {
|
|
|
+ list.push(obj)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (list.length == 1) {
|
|
|
+ list = list.concat(res.data)
|
|
|
+ }
|
|
|
+ this.behaviorList = list
|
|
|
// 计算总分
|
|
|
let total = 0
|
|
|
this.totalCount = res.data.reduce((total, item) => total + item.total, 0)
|
|
@@ -127,7 +149,10 @@
|
|
|
* 积分列表
|
|
|
*/
|
|
|
getintegralList(pageNum, pageSize) {
|
|
|
- this.$u.api.mine.integralList({pageNum, pageSize}).then(res => {
|
|
|
+ this.$u.api.mine.integralList({
|
|
|
+ pageNum,
|
|
|
+ pageSize
|
|
|
+ }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$refs.paging.complete(res.rows);
|
|
|
} else {
|
|
@@ -155,5 +180,5 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-@import './progressiveIntegral.scss';
|
|
|
+ @import './progressiveIntegral.scss';
|
|
|
</style>
|