From 0a76f29d2758fe992583af5069b3a71970b562b0 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 18 Jun 2020 21:23:32 +0800 Subject: [PATCH] quota --- test_mini/app.json | 3 +- test_mini/images/quota.svg | 1 + test_mini/pages/main/main.wxml | 11 ++++++ test_mini/pages/quota/quota.js | 66 +++++++++++++++++++++++++++++++ test_mini/pages/quota/quota.json | 3 ++ test_mini/pages/quota/quota.wxml | 2 + test_mini/pages/quota/quota.wxss | 1 + test_server/analyse/urls.py | 1 + test_server/analyse/views.py | 10 +++++ test_server/quota.dat | Bin 0 -> 1368 bytes 10 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 test_mini/images/quota.svg create mode 100644 test_mini/pages/quota/quota.js create mode 100644 test_mini/pages/quota/quota.json create mode 100644 test_mini/pages/quota/quota.wxml create mode 100644 test_mini/pages/quota/quota.wxss create mode 100644 test_server/quota.dat diff --git a/test_mini/app.json b/test_mini/app.json index 9fc31ef..3a8f7e1 100644 --- a/test_mini/app.json +++ b/test_mini/app.json @@ -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", diff --git a/test_mini/images/quota.svg b/test_mini/images/quota.svg new file mode 100644 index 0000000..44b74be --- /dev/null +++ b/test_mini/images/quota.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test_mini/pages/main/main.wxml b/test_mini/pages/main/main.wxml index 4837c2a..1835961 100644 --- a/test_mini/pages/main/main.wxml +++ b/test_mini/pages/main/main.wxml @@ -16,6 +16,17 @@ + + + + + + 考试名额监控 + + + + + diff --git a/test_mini/pages/quota/quota.js b/test_mini/pages/quota/quota.js new file mode 100644 index 0000000..8af6002 --- /dev/null +++ b/test_mini/pages/quota/quota.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/test_mini/pages/quota/quota.json b/test_mini/pages/quota/quota.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/test_mini/pages/quota/quota.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/test_mini/pages/quota/quota.wxml b/test_mini/pages/quota/quota.wxml new file mode 100644 index 0000000..885d0cf --- /dev/null +++ b/test_mini/pages/quota/quota.wxml @@ -0,0 +1,2 @@ + +pages/quota/quota.wxml diff --git a/test_mini/pages/quota/quota.wxss b/test_mini/pages/quota/quota.wxss new file mode 100644 index 0000000..9afd70a --- /dev/null +++ b/test_mini/pages/quota/quota.wxss @@ -0,0 +1 @@ +/* pages/quota/quota.wxss */ \ No newline at end of file diff --git a/test_server/analyse/urls.py b/test_server/analyse/urls.py index e598c48..04fa966 100644 --- a/test_server/analyse/urls.py +++ b/test_server/analyse/urls.py @@ -6,4 +6,5 @@ from .views import * urlpatterns = [ path('basic/', BasicCount.as_view()), + path('quota/', Quota.as_view()) ] diff --git a/test_server/analyse/views.py b/test_server/analyse/views.py index f3923e5..7d2db71 100644 --- a/test_server/analyse/views.py +++ b/test_server/analyse/views.py @@ -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) diff --git a/test_server/quota.dat b/test_server/quota.dat new file mode 100644 index 0000000000000000000000000000000000000000..442cdb604eb8cce9af80d4491c25c4acea122aee GIT binary patch literal 1368 zcmb`^OK%cU6bJCZQd(PUX??$Iec^+8?*PL?H>TZ~NxM)NvoU4@lirEEP8p0{kf0_8 z6STUpEXuMz7Q`AiMH0UaLuriq6+ClkK^#n6upznU9?snJ`{xI8Ab6BfK@hU(m}+Pb z3_YQNLvdq8BqH$=$xB01B8i9u_9%l`Hnfb9fr0zr^yFaBqqwk^j;qPrF>uX)cPhg> z=LHof4Jmi<*jW9%wfemNwYdG|Nu&I6``c@?`qV6z>a~jbveew%@cTt`WfR-Xl{e=4 z2lLf?N=d-{v>t4f3zRlW@3tzHdNpsBYt8(#=EhqX=8ul+$%nJ4q@hL)*vl)_=aa%x zn1(|k7~yZx9;=BtTn$E*5qwK)tDu)s*w?*$sR{^v((T#s3W3A`V|W<7H&osKWVWP#sDbz_-B98kvb_AdfB*lwCl#WXm? zKOqGOC4M-}wNp!r2zx}H=F{=Sryb>uEmk)n z7-tYp@=dj5tle^|t3?dJ>1+