test mini

This commit is contained in:
caoqianming 2020-09-21 08:54:15 +08:00
parent 3c49d1b729
commit b7b13e1732
21 changed files with 122 additions and 97 deletions

View File

@ -15,6 +15,7 @@
.txlabel{
color:#fff;
background-color: rgb(216, 140, 0);
padding: 2px
border-radius: 2px;
padding: 1px 4px;
}

View File

@ -12,7 +12,8 @@ Page({
isright:false,
answerP:false,
tmtotal:0,
moShi:'看题模式'
moShi:'看题模式',
domain:getApp().globalData.mediahost,
},
radioChange: function (e) {
var that = this
@ -175,7 +176,7 @@ Page({
for (let key in currentTm.options) {
let option = {}
option.key = key
option.value = key + ':' + currentTm.options[key]
option.value = currentTm.options[key].toString()
if (currentTm.user_answer && this.data.moShi == '看题模式') {
if (key == currentTm.user_answer || currentTm.user_answer.indexOf(key) != -1) {
option.checked = true

View File

@ -1,4 +1,6 @@
{
"usingComponents": {},
"usingComponents": {
"parser": "/components/parser/parser"
},
"navigationBarTitleText": "错题集"
}

View File

@ -1,10 +1,10 @@
<view class="head">
<view style="width:50%">
题量: {{tm_index+1}}/{{tmtotal}}
<span style="margin-left:10px">题量: {{tm_index+1}}/{{tmtotal}}</span>
</view>
<view style="width:50%;text-align:right" bindtap="changeM">
<span style="font-weight:bold;">{{moShi}}</span>
(点击切换)
<span style="margin-right:10px"><span style="font-weight:bold;">{{moShi}}</span>
(点击切换)</span>
</view>
</view>
<scroll-view scroll-y="true" style="height: {{scrollHeight}}px;">
@ -13,14 +13,17 @@
<span class="txlabel">{{currentTm.type}}</span>
<span style="color:gray"> {{currentTm.questioncat_name}}</span>
</view>
<view class="weui-article__title">{{currentTm.name}}</view>
<view class="weui-article__title">
<parser html="{{currentTm.name}}" domain="{{domain}}" selectable/>
</view>
<view wx:if="{{currentTm.img}}" style="text-align:center"><image src="{{currentTm.img}}" mode="aspectFit"></image></view>
</view>
<view class="weui-cells weui-cells_radio">
<radio-group class="radio-group" bindchange="radioChange" wx:if="{{(currentTm.type=='单选' ||currentTm.type=='判断')}}">
<label class="weui-cell weui-cell_active weui-check__label" wx:for="{{options}}" wx:key="key">
<view class="weui-cell__bd">
<view>{{item.value}}</view>
<view style="float:left;width:10%">{{item.key}}:</view>
<view style="float:left;width:90%"><parser html="{{item.value}}" domain="{{domain}}" selectable /></view>
</view>
<view class="weui-cell__ft">
<radio class="weui-check" value="{{item.key}}" checked="{{item.checked}}" />
@ -34,7 +37,8 @@
<label class="weui-cell weui-cell_active weui-check__label" wx:for="{{options}}" wx:key="key">
<view class="weui-cell__bd">
<view>{{item.value}}</view>
<view style="float:left;width:10%">{{item.key}}:</view>
<view style="float:left;width:90%"><parser html="{{item.value}}" domain="{{domain}}" selectable /></view>
</view>
<view class="weui-cell__hd">
<checkbox class="weui-check" value="{{item.key}}" checked="{{item.checked}}"/>

View File

@ -17,6 +17,7 @@
.txlabel{
color:#fff;
background-color: rgb(216, 140, 0);
padding: 2px
border-radius: 2px;
padding: 1px 4px;
}

View File

@ -7,7 +7,8 @@ Page({
*/
data: {
questioncatData: [],
isLoad: true
isLoad: true,
workscopeName:''
},
/**
@ -16,13 +17,15 @@ Page({
onLoad: function () {
if (getApp().globalData.userinfo.workscope) {
this.setData({
workscopeId: getApp().globalData.userinfo.workscope
workscopeId: getApp().globalData.userinfo.workscope,
workscopeName:getApp().globalData.userinfo.workscope_name
})
} else {
wx.switchTab({
url: '/pages/main/main',
})
}
},
/**

View File

@ -1,9 +1,10 @@
<!--pages/lianxi/index.wxml-->
<view class="page">
<view class="page__bd">
<view class="weui-panel__hd">当前工作类别题库子类</view>
<view class="weui-panel__bd">
<view style="height:10px"></view>
<view style="color:steelblue;font-weight:bold;text-align:center">{{workscopeName}}</view>
<block wx:for="{{questioncatData}}" wx:key="unique">
<view class="weui-panel weui-panel_access">
<view class="weui-panel__bd">
<view class="weui-media-box weui-media-box_appmsg">
<view class="weui-media-box__hd">
<image class="weui-media-box__thumb" src="/images/fushe.svg" alt></image>
@ -28,7 +29,9 @@
</view>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>

View File

@ -1 +1,6 @@
/* pages/lianxi/index.wxss */
.weui-panel {
margin-left:8px;
margin-right:8px;
border-radius: 8px;
}

View File

@ -15,6 +15,7 @@
.txlabel{
color:#fff;
background-color: rgb(216, 140, 0);
padding: 2px
border-radius: 2px;
padding: 1px 4px;
}

View File

@ -41,7 +41,7 @@
<view class="weui-cell__hd">
<image src="/images/qtest.svg" style="margin-right: 16px;vertical-align: middle;width:20px; height: 20px;"></image>
</view>
<view class="weui-cell__bd">铅当量检测</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>

View File

@ -1,54 +1,49 @@
<view class="page">
<view class="weui-form">
<view class="weui-form__text-area">
<h2 class="weui-form__title">铅当量检测</h2>
<view class="weui-form__desc">我司开展铅当量检测业务,如有需要,请留下您的信息,我们工作人员将及时与您联系。</view>
<view >
<view class="weui-form__text-area" style="margin-top:20px;padding: 0 18px;">
<h2 class="weui-form__title">个人防护用品检测(铅当量)</h2>
<view class="weui-form__desc">中科辐射学堂和国家建材工业安防工程产品质量监督检验中心推出个人防护用品合格检测限每个核技术利用单位在10月31日之前免费检测一套个人防护用品,如有需要请提交您的申请。</view>
</view>
<view>
<view class="weui-cells__title">基本信息</view>
<view class="weui-cells weui-cells_form">
<view class="weui-cell weui-cell_active">
<view class="weui-cell__hd"><label class="weui-label">姓名</label></view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="填写您的姓名" placeholder-class="weui-input__placeholder" bindinput="nameInput"/>
</view>
</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__hd">
<label class="weui-label">手机号</label>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="填写您的联系方式" placeholder-class="weui-input__placeholder" type="number" bindinput="phoneInput"/>
</view>
</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__hd">
<label class="weui-label">邮寄地址</label>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="填写您的邮寄地址" placeholder-class="weui-input__placeholder" bindinput="addressInput"/>
</view>
<view>
<view class="weui-cells__title">基本信息</view>
<view class="weui-cells weui-cells_form">
<view class="weui-cell weui-cell_active">
<view class="weui-cell__hd"><label class="weui-label">姓名</label></view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="填写您的姓名" placeholder-class="weui-input__placeholder" bindinput="nameInput" />
</view>
</view>
<view class="weui-cells__title">检测内容</view>
<view class="weui-cells weui-cells_checkbox">
<checkbox-group bindchange="checkboxChange">
<label class="weui-cell weui-cell_active weui-check__label" wx:for="{{items}}" wx:key="name">
<view class="weui-cell__hd">
<checkbox
class="weui-check"
value="{{item.name}}"
checked="{{item.checked}}"
/>
<i class="weui-icon-checked"></i>
</view>
<view class="weui-cell__bd">
<view>{{item.value}}</view>
</view>
</label>
</checkbox-group>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__hd">
<label class="weui-label">手机号</label>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="填写您的联系方式" placeholder-class="weui-input__placeholder" type="number" bindinput="phoneInput" />
</view>
</view>
</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__hd">
<label class="weui-label">邮寄地址</label>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="填写您的邮寄地址" placeholder-class="weui-input__placeholder" bindinput="addressInput" />
</view>
</view>
</view>
<view class="weui-cells__title">检测内容</view>
<view class="weui-cells weui-cells_checkbox">
<checkbox-group bindchange="checkboxChange">
<label class="weui-cell weui-cell_active weui-check__label" wx:for="{{items}}" wx:key="name">
<view class="weui-cell__hd">
<checkbox class="weui-check" value="{{item.name}}" checked="{{item.checked}}" />
<i class="weui-icon-checked"></i>
</view>
<view class="weui-cell__bd">
<view>{{item.value}}</view>
</view>
</label>
</checkbox-group>
</view>
</view>
<view class="weui-form__tips-area">
<!-- <view class="weui-form__tips">
表单页提示,居中对齐
@ -70,6 +65,5 @@
<view class="weui-footer__text">Copyright © 2008-2019 weui.io</view>
</view>
</view> -->
</view>
</view>
</view>

View File

@ -9,6 +9,7 @@ Page({
data: {
is_right: false,
answerP: false,
domain:getApp().globalData.mediahost,
},
radioChange: function (e) {
var that = this
@ -138,7 +139,7 @@ Page({
for (let key in tm_current.options) {
let option = {}
option.key = key
option.value = key + ':' + tm_current.options[key]
option.value = tm_current.options[key].toString()
if (tm_current.user_answer) {
if (key == tm_current.user_answer || tm_current.user_answer.indexOf(key) != -1) {
option.checked = true

View File

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {
"parser": "/components/parser/parser"
}
}

View File

@ -7,14 +7,17 @@
<span class="txlabel">{{tm_current.type}}</span>
<span style="color:gray"> {{tm_current.questioncat_name}}</span>
</view>
<view class="weui-article__title">{{tm_current.name}}</view>
<view class="weui-article__title">
<parser html="{{tm_current.name}}" domain="{{domain}}" selectable/>
</view>
<view wx:if="{{tm_current.img}}" style="text-align:center"><image src="{{tm_current.img}}" mode="aspectFit"></image></view>
</view>
<view class="weui-cells weui-cells_radio">
<radio-group class="radio-group" bindchange="radioChange" wx:if="{{(tm_current.type=='单选' ||tm_current.type=='判断')}}">
<label class="weui-cell weui-cell_active weui-check__label" wx:for="{{options}}" wx:key="key">
<view class="weui-cell__bd">
<view>{{item.value}}</view>
<view style="float:left;width:10%">{{item.key}}:</view>
<view style="float:left;width:90%"><parser html="{{item.value}}" domain="{{domain}}" selectable /></view>
</view>
<view class="weui-cell__ft">
<radio class="weui-check" value="{{item.key}}" checked="{{item.checked}}" />
@ -28,7 +31,8 @@
<label class="weui-cell weui-cell_active weui-check__label" wx:for="{{options}}" wx:key="key">
<view class="weui-cell__bd">
<view>{{item.value}}</view>
<view style="float:left;width:10%">{{item.key}}:</view>
<view style="float:left;width:90%"><parser html="{{item.value}}" domain="{{domain}}" selectable /></view>
</view>
<view class="weui-cell__hd">
<checkbox class="weui-check" value="{{item.key}}" checked="{{item.checked}}"/>

View File

@ -11,6 +11,7 @@
.txlabel{
color:#fff;
background-color: rgb(216, 140, 0);
padding: 2px
border-radius: 2px;
padding: 1px 4px;
}

View File

@ -15,6 +15,7 @@
.txlabel{
color:#fff;
background-color: rgb(216, 140, 0);
padding: 2px
border-radius: 2px;
padding: 1px 4px;
}

View File

@ -17,6 +17,7 @@
.txlabel{
color:#fff;
background-color: rgb(216, 140, 0);
padding: 2px
border-radius: 2px;
padding: 1px 4px;
}

View File

@ -10,7 +10,8 @@ Page({
query:{
page:1,
limit:10
}
},
workscopeName:''
},
/**
@ -20,7 +21,8 @@ Page({
if (getApp().globalData.userinfo.workscope) {
this.setData({
workscopeId: getApp().globalData.userinfo.workscope
workscopeId: getApp().globalData.userinfo.workscope,
workscopeName:getApp().globalData.userinfo.workscope_name
})
} else {
wx.switchTab({

View File

@ -1,28 +1,21 @@
<!--pages/lianxi/index.wxml-->
<view class="page">
<view class="page__bd">
<view class="weui-panel__hd">当前工作类别押题卷
<span style="color:red" wx:if="{{count==0}}">(暂无)</span>
</view>
<view class="weui-panel__bd">
<view style="height:10px"></view>
<view style="color:steelblue;font-weight:bold;text-align:center">{{workscopeName}}</view>
<block wx:for="{{paperData}}" wx:key="unique">
<view class="weui-panel weui-panel_access">
<view class="weui-panel__bd">
<view class="weui-media-box weui-media-box_appmsg">
<view class="weui-media-box__bd">
<h4 class="weui-media-box__title">{{item.name}}</h4>
<view class="weui-media-box__desc">
<span style="color:orange;font-weight:bold">{{item.workscope_name}}</span>
<!-- --共
<span style="color:darkblue;font-weight:bold">{{item.tmtotal}}</span>
道/已答
<span style="color:darkblue;font-weight:bold">{{item.ydtmtotal}}</span>
道 -->
</view>
<view class="weui-media-box__desc">
<a class="weui-btn weui-btn_mini weui-btn_primary" bindtap="startYati" id="{{item.id}}" >选择</a>
</view>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>

View File

@ -1 +1,6 @@
/* pages/yati/index.wxss */
.weui-panel {
margin-left:8px;
margin-right:8px;
border-radius: 8px;
}

View File

@ -83,7 +83,7 @@ class QuestioncatViewSet(ModelViewSet):
"""
工作类别下的全部分类
"""
queryset = WorkScope.objects.get(id=request.query_params.get('id')).questioncat.all().order_by('type')
queryset = WorkScope.objects.get(id=request.query_params.get('id')).questioncat.all().order_by('pk')
serializer = QuestioncatSerializer(instance=queryset,many=True)
return Response(serializer.data)