文章目录
前言
最近在写学校的项目,涉及做个答题界面,网上逛了一圈感觉都很复杂,我小小的项目也不大需要那些花活,所以自己半写半改整了个极简风的答题界面。咱大学牲写代码主打一个支离破碎,欢迎各位大佬指点。
1.wxml(前端界面渲染)
<block wx:for="{
{questions}}">
<view class='naire'>
<view class='question'>{
{
index+1}}. {
{
item.question}}</view>
<!--view class='border' /-->
<radio-group class='radio-group' name='answer' bindchange='radioChange' data-question-id='{
{item.id}}'>
<label class='radio'>
<radio value="A" color='#fcbe39' />{
{
item.answers.a}}
</label>
<label class='radio'>
<radio value="B" color='#fcbe39' />{
{
item.answers.b}}
</label>
<label class='radio'>
<radio value="C" color='#fcbe39' />{
{
item.answers.c}}
</label>