增加应用当天下载次数展示

pull/26/merge
isummer 2 years ago
parent 2224ce27c7
commit 7aa0471ba9
  1. 42
      fir_client/src/components/apps/FirAppInfosBase.vue
  2. 5
      fir_client/src/components/apps/FirApps.vue
  3. 5
      fir_ser/admin/utils/serializer.py
  4. 8
      fir_ser/api/utils/serializer.py

@ -13,28 +13,32 @@
class="bundleid short"
>&nbsp;{{ appinfos.preview_url }}</span>
</el-tooltip>
<el-popover
placement="right"
width="288">
<div style="text-align: center; margin: 0">
<vue-qr ref="qr"
:correctLevel="qrinfo.correctLevel" :logoCornerRadius="qrinfo.logoCornerRadius"
:logoScale="qrinfo.logoScale"
:logoSrc="icon_url"
:margin="qrinfo.margin" :size="266"
:text="appinfos.preview_url">
</vue-qr>
<el-button size="small" type="primary" @click="save_qr()">保存本地</el-button>
</div>
<span slot="reference" class="short ng-scope">下载码</span>
</el-popover>
<el-tooltip content="点击查看下载码">
<el-popover
placement="right"
width="288">
<div style="text-align: center; margin: 0">
<vue-qr ref="qr"
:correctLevel="qrinfo.correctLevel" :logoCornerRadius="qrinfo.logoCornerRadius"
:logoScale="qrinfo.logoScale"
:logoSrc="icon_url"
:margin="qrinfo.margin" :size="266"
:text="appinfos.preview_url">
</vue-qr>
<el-button size="small" type="primary" @click="save_qr()">保存本地</el-button>
</div>
<span slot="reference" class="short ng-scope">下载码</span>
</el-popover>
</el-tooltip>
<span>{{ master_release.release_type |getapptype }}</span>
<el-tooltip content="下载量" placement="top">
<span><i class="el-icon-cloudy"/><b class="short">{{ appinfos.count_hits }}</b></span>
<el-tooltip placement="top">
<div slot="content">总下载次数{{ appinfos.count_hits }}<br/>当天下载次数{{ appinfos.today_hits_count }}</div>
<span><i class="el-icon-cloudy"/><b class="short">{{
appinfos.count_hits
}} &nbsp;|&nbsp; {{ appinfos.today_hits_count }} </b></span>
</el-tooltip>
<span class="bundleid ng-binding">BundleID<b class="ng-binding">
<el-tooltip content="复制到剪切板" placement="top">

@ -491,7 +491,10 @@
<div class=" app-animator">
<div class="card app card-ios">
<i class="down-icon el-icon-cloudy"> {{ r.count_hits }}</i>
<el-tooltip>
<div slot="content">总下载次数{{ r.count_hits }}<br/>当天下载次数{{ r.today_hits_count }}</div>
<i class="down-icon el-icon-cloudy"> {{ r.count_hits }} &nbsp;|&nbsp; {{ r.today_hits_count }}</i>
</el-tooltip>
<i v-if="r.type === 1" class="type-icon iconfont icon-ios"/>
<i v-if="r.type === 0" class="type-icon iconfont icon-android2"/>

@ -136,11 +136,6 @@ class AdminAppsSerializer(AppsSerializer):
def get_release_count(self, obj):
return models.AppReleaseInfo.objects.filter(app_id=obj).count()
today_hits_count = serializers.SerializerMethodField()
def get_today_hits_count(self, obj):
return get_app_today_download_times([obj.app_id])
def update(self, instance, validated_data):
return super(AdminAppsSerializer, self).update(instance, validated_data)

@ -12,7 +12,7 @@ from api.utils.modelutils import get_user_domain_name, get_app_domain_name, get_
from common.base.baseutils import get_choices_dict, WeixinLoginUid
from common.cache.storage import AdPicShowCache
from common.core.sysconfig import Config, UserConfig
from common.utils.caches import get_user_free_download_times, get_user_cert_auth_status
from common.utils.caches import get_user_free_download_times, get_user_cert_auth_status, get_app_today_download_times
from common.utils.storage import Storage
from common.utils.token import make_token
@ -216,12 +216,16 @@ class AppsSerializer(serializers.ModelSerializer):
else:
return {}
today_hits_count = serializers.SerializerMethodField()
def get_today_hits_count(self, obj):
return get_app_today_download_times([obj.app_id])
class AppsListSerializer(AppsSerializer):
class Meta:
model = models.Apps
fields = ["app_id", "bundle_id", "issupersign", "name", "preview_url", "short", "type", "master_release",
"has_combo", "count_hits"]
"has_combo", "count_hits", "today_hits_count"]
def get_master_release(self, obj):
master_release_obj = get_app_master_obj_from_context(self, obj)

Loading…
Cancel
Save