Feat:咨询观看量,点赞数显示调整
This commit is contained in:
@@ -59,7 +59,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 点赞数显示
|
// 点赞数显示
|
||||||
cLikeCount: function () {
|
cLikeCount: function () {
|
||||||
return this.data.like_count === 0 ? "" : this.data.like_count > 99 ? `99+` : this.data.like_count;
|
return this.data.like_count === 0 ? "" : this.$formatCount(this.data.like_count);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -75,6 +75,18 @@ const force2Decimal = function change2Decimal(value) {
|
|||||||
return forceToDecimal(value, 2)
|
return forceToDecimal(value, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formatCount = function(value) {
|
||||||
|
if (!value) return 0;
|
||||||
|
const num = parseFloat(value);
|
||||||
|
if (isNaN(num)) return 0;
|
||||||
|
if (num >= 10000) {
|
||||||
|
let val = num / 10000;
|
||||||
|
val = parseFloat(val.toFixed(1));
|
||||||
|
return val + '万';
|
||||||
|
}
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
const toast = (title = '', position = 'center', success = function() {}) => {
|
const toast = (title = '', position = 'center', success = function() {}) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title,
|
title,
|
||||||
@@ -88,6 +100,7 @@ const toast = (title = '', position = 'center', success = function() {}) => {
|
|||||||
|
|
||||||
Vue.prototype.$force2Decimal = force2Decimal
|
Vue.prototype.$force2Decimal = force2Decimal
|
||||||
Vue.prototype.$forceToDecimal = forceToDecimal
|
Vue.prototype.$forceToDecimal = forceToDecimal
|
||||||
|
Vue.prototype.$formatCount = formatCount
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt v12-font-28">{{ item.pv }}</text>
|
<text class="seeNum-txt v12-font-28">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.hasZan ? 'on' : ''"
|
:class="item.hasZan ? 'on' : ''"
|
||||||
class="seeNum-txt v12-font-28 v12-ml-1"
|
class="seeNum-txt v12-font-28 v12-ml-1"
|
||||||
>{{ item.zan }}</text
|
>{{ $formatCount(item.zan) }}</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt v12-font-28">{{ item.pv }}</text>
|
<text class="seeNum-txt v12-font-28">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
<view class="acea-row row-left row-middle">
|
<view class="acea-row row-left row-middle">
|
||||||
<view class="see-num-box acea-row row-middle" style="margin-right: 20rpx;">
|
<view class="see-num-box acea-row row-middle" style="margin-right: 20rpx;">
|
||||||
<image :src="webUrl+'/20230304131559277594.png'" class="eye-icon" mode=""></image>
|
<image :src="webUrl+'/20230304131559277594.png'" class="eye-icon" mode=""></image>
|
||||||
<text class="see-num-text">{{item.pv||0}}</text>
|
<text class="see-num-text">{{$formatCount(item.pv||0)}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="zan-num-box acea-row row-middle">
|
<view class="zan-num-box acea-row row-middle">
|
||||||
<img class="zan-icon" :src="webUrl+'/20230304133322439350.png'" />
|
<img class="zan-icon" :src="webUrl+'/20230304133322439350.png'" />
|
||||||
<text class="zan-num-text">{{item.zan||0}}</text>
|
<text class="zan-num-text">{{$formatCount(item.zan||0)}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -273,7 +273,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text>
|
>{{ $formatCount(item.zan) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -272,7 +272,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -291,7 +291,7 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text>
|
>{{ $formatCount(item.zan) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex" @click="infoClick(item)">
|
<view class="flex" @click="infoClick(item)">
|
||||||
<!-- <image
|
<!-- <image
|
||||||
@@ -299,7 +299,7 @@
|
|||||||
class="icon"
|
class="icon"
|
||||||
/> -->
|
/> -->
|
||||||
<u-icon name="chat" size="24"></u-icon>
|
<u-icon name="chat" size="24"></u-icon>
|
||||||
<text class="seeNum-txt">{{ item.replyCount || 0 }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.replyCount || 0) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)">
|
<view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)">
|
||||||
<image
|
<image
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image :src="webUrl + '/20230803152147141807.png'" class="icon" />
|
<image :src="webUrl + '/20230803152147141807.png'" class="icon" />
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -68,12 +68,12 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text
|
>{{ $formatCount(item.zan) }}</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<u-icon name="chat" size="24"></u-icon>
|
<u-icon name="chat" size="24"></u-icon>
|
||||||
<text class="seeNum-txt">{{ item.replyCount || comments.length }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.replyCount || comments.length) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -33,18 +33,18 @@
|
|||||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230547221591.png'"
|
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230547221591.png'"
|
||||||
v-if="item['hasLike']"/>
|
v-if="item['hasLike']"/>
|
||||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230552152511.png'" v-else/>
|
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230552152511.png'" v-else/>
|
||||||
<cover-view class="one-t tc">{{ item['likeCount'] }}</cover-view>
|
<cover-view class="one-t tc">{{ $formatCount(item['likeCount']) }}</cover-view>
|
||||||
</cover-view>
|
</cover-view>
|
||||||
<cover-view class="flex flex-col ai-center" style="width:78rpx;margin-right: 16rpx;"
|
<cover-view class="flex flex-col ai-center" style="width:78rpx;margin-right: 16rpx;"
|
||||||
@click="changeFav(item)">
|
@click="changeFav(item)">
|
||||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230535491918.png'"
|
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230535491918.png'"
|
||||||
v-if="item['hasFavorite']"/>
|
v-if="item['hasFavorite']"/>
|
||||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230541207016.png'" v-else/>
|
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230541207016.png'" v-else/>
|
||||||
<cover-view class="one-t tc">{{ item['favoriteCount'] }}</cover-view>
|
<cover-view class="one-t tc">{{ $formatCount(item['favoriteCount']) }}</cover-view>
|
||||||
</cover-view>
|
</cover-view>
|
||||||
<cover-view class="flex flex-col ai-center" style="width:78rpx" @click="showDialog=true">
|
<cover-view class="flex flex-col ai-center" style="width:78rpx" @click="showDialog=true">
|
||||||
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230529202260.png'"/>
|
<cover-image style="width: 60rpx;height: 60rpx" :src="webUrl+'/20240113230529202260.png'"/>
|
||||||
<cover-view class="one-t tc">{{ item['replyCount'] }}</cover-view>
|
<cover-view class="one-t tc">{{ $formatCount(item['replyCount']) }}</cover-view>
|
||||||
</cover-view>
|
</cover-view>
|
||||||
</cover-view>
|
</cover-view>
|
||||||
</cover-view>
|
</cover-view>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
@close="dialogClose" @open="dialogOpen">
|
@close="dialogClose" @open="dialogOpen">
|
||||||
<view style="z-index: 100">
|
<view style="z-index: 100">
|
||||||
<cover-view class="tc" style="padding: 20rpx 0 40rpx;font-size: 28rpx">{{
|
<cover-view class="tc" style="padding: 20rpx 0 40rpx;font-size: 28rpx">{{
|
||||||
list[current]['replyCount']
|
$formatCount(list[current]['replyCount'])
|
||||||
}}条评论
|
}}条评论
|
||||||
</cover-view>
|
</cover-view>
|
||||||
<scroll-view style="max-height: 740rpx" scroll-y @scrolltolower="fetchReply">
|
<scroll-view style="max-height: 740rpx" scroll-y @scrolltolower="fetchReply">
|
||||||
|
|||||||
@@ -64,11 +64,11 @@
|
|||||||
<view class="zan-box flex flex-0 ai-end" @click="zanInn">
|
<view class="zan-box flex flex-0 ai-end" @click="zanInn">
|
||||||
<template v-if="isLike">
|
<template v-if="isLike">
|
||||||
<image :src="webUrl + '/icon/icon-like.png'" class="img" />
|
<image :src="webUrl + '/icon/icon-like.png'" class="img" />
|
||||||
<text class="on">{{ inn.zan }}</text>
|
<text class="on">{{ $formatCount(inn.zan) }}</text>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<image :src="webUrl + '/icon/icon-like.png'" class="img" />
|
<image :src="webUrl + '/icon/icon-like.png'" class="img" />
|
||||||
<text>{{ inn.zan }}</text>
|
<text>{{ $formatCount(inn.zan) }}</text>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex flex-0 ai-end favorite-box" @click="doneFavorite">
|
<view class="flex flex-0 ai-end favorite-box" @click="doneFavorite">
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text>{{ favoriteCount }}</text>
|
<text>{{ $formatCount(favoriteCount) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image :src="webUrl + '/20230803152147141807.png'" class="icon" />
|
<image :src="webUrl + '/20230803152147141807.png'" class="icon" />
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -68,12 +68,12 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text
|
>{{ $formatCount(item.zan) }}</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<u-icon name="chat" size="24"></u-icon>
|
<u-icon name="chat" size="24"></u-icon>
|
||||||
<text class="seeNum-txt">{{ item.replyCount || comments.length }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.replyCount || comments.length) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -227,7 +227,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text>
|
>{{ $formatCount(item.zan) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -173,7 +173,7 @@
|
|||||||
:src="webUrl + '/20230803152147141807.png'"
|
:src="webUrl + '/20230803152147141807.png'"
|
||||||
class="icon"
|
class="icon"
|
||||||
/>
|
/>
|
||||||
<text class="seeNum-txt">{{ item.pv }}</text>
|
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<image
|
<image
|
||||||
@@ -192,7 +192,7 @@
|
|||||||
v-show="item.zan > 0"
|
v-show="item.zan > 0"
|
||||||
:class="item.zanVo ? 'on' : ''"
|
:class="item.zanVo ? 'on' : ''"
|
||||||
class="seeNum-txt"
|
class="seeNum-txt"
|
||||||
>{{ item.zan }}</text>
|
>{{ $formatCount(item.zan) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -211,7 +211,7 @@
|
|||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
class="icon-heart"
|
class="icon-heart"
|
||||||
/>
|
/>
|
||||||
<text>{{ item['favoriteCount'] }}</text>
|
<text>{{ $formatCount(item['favoriteCount']) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user