This commit is contained in:
caoqianming 2020-06-18 21:23:32 +08:00
parent 50922a541e
commit 0a76f29d27
10 changed files with 97 additions and 1 deletions

View File

@ -21,7 +21,8 @@
"pages/workscope/index",
"pages/yati/index",
"pages/article/index",
"pages/article/detail"
"pages/article/detail",
"pages/quota/quota"
],
"window": {
"backgroundTextStyle": "light",

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1592478369068" class="icon" viewBox="0 0 1084 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2111" xmlns:xlink="http://www.w3.org/1999/xlink" width="67.75" height="64"><defs><style type="text/css"></style></defs><path d="M686.08 689.935059l8.914824 8.975059a30.117647 30.117647 0 1 1-42.586353 42.586353L592.112941 681.140706a30.117647 30.117647 0 0 1 23.009883-51.380706l1.807058-0.060235h170.767059a30.117647 30.117647 0 0 1 0 60.235294h-101.616941z m30.479059-169.502118l-8.975059-8.975059a30.117647 30.117647 0 0 1 42.586353-42.586353l60.416 60.416a30.117647 30.117647 0 0 1-23.070118 51.320471l-1.807059 0.060235H615.002353a30.117647 30.117647 0 1 1 0-60.235294h101.616941z m-175.766588-51.501176a30.72 30.72 0 0 1-0.542118 0c-82.100706 0-157.214118 77.101176-184.139294 192.271059a30.117647 30.117647 0 0 1-58.669177-13.733648c23.190588-99.087059 78.305882-177.573647 148.901647-214.979764a137.878588 137.878588 0 1 1 94.448942 36.442353z m-1.084236-60.235294a77.643294 77.643294 0 1 0 0-155.226353 77.643294 77.643294 0 0 0 0 155.226353z m5.180236 563.380705a481.882353 481.882353 0 1 1 0-963.764705 481.882353 481.882353 0 0 1 0 963.764705z m0-60.235294a421.647059 421.647059 0 1 0 0-843.294117 421.647059 421.647059 0 0 0 0 843.294117z" fill="#379AF6" p-id="2112"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -16,6 +16,17 @@
</swiper-item>
</block>
</swiper>
<view class="weui-cells weui-cells_after-title">
<navigator url="/pages/quota/quota" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
<view class="weui-cell__hd">
<image src="/images/quota.svg" style="margin-right: 16px;vertical-align: middle;width:20px; height: 20px;"></image>
</view>
<view class="weui-cell__bd">考试名额监控</view>
<view class="weui-cell__ft weui-cell__ft_in-access" style="color:red" >
<!-- <span wx:if="{{to_read}}">{{to_read}}条未读</span> -->
</view>
</navigator>
</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-grids">
<a class="weui-grid" bindtap="goLianxi">

View File

@ -0,0 +1,66 @@
// pages/quota/quota.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,2 @@
<!--pages/quota/quota.wxml-->
<text>pages/quota/quota.wxml</text>

View File

@ -0,0 +1 @@
/* pages/quota/quota.wxss */

View File

@ -6,4 +6,5 @@ from .views import *
urlpatterns = [
path('basic/', BasicCount.as_view()),
path('quota/', Quota.as_view())
]

View File

@ -6,6 +6,7 @@ from crm.models import Consumer
from examtest.models import ExamTest
from question.models import Question
import pickle
# Create your views here.
class BasicCount(APIView):
@ -19,3 +20,12 @@ class BasicCount(APIView):
ret['test_count'] = ExamTest.objects.filter(is_delete=False).count()
ret['question_count'] = Question.objects.filter(is_delete=False).count()
return Response(ret)
class Quota(APIView):
'''
获取考试名额
'''
def get(self, request, format=None):
with open('quota.dat','rb') as f:
data = pickle.load(f)
return Response(data)

BIN
test_server/quota.dat Normal file

Binary file not shown.