question.wxml 3.14 KB
<view class="page">
  <view class="app__bgc bgc"></view>
  <view class="app__bg bg"></view>
  <view class="decoration">
    <image class="d1" src="../../image/oss/question/question-c1.png" mode="widthFix" />
  </view>
  <view class="app__content main">
    <view class="top-space"></view>
    <view class="content">
      <!-- 标题 -->
      <view class="tit">· 欢迎来到丸美小课堂 ·</view>
      <!-- 问题 -->
      <view class="question">
        <view data-data="{{item}}" data-index="{{index}}" wx:for="{{questionList}}" wx:key="{{index}}" class="question-item">
          <view class="ques">
            <image class="light" mode="widthFix" src="../../image/oss/question/question-light.png" />
            {{item.question}}
          </view>
          <view class="answer">
            <view bindtap="onSelectAnswerHandler" data-pdata="{{item}}" data-pindex="{{index}}" data-data="{{item2}}" data-index="{{index2}}" wx:for="{{item.answers}}" wx:key="index2" wx:for-index="index2" wx:for-item="item2" class="answer-item {{item2.selected ? 'selected':''}} {{item2.rightAnswer == 1 && hadAnswer ? 'right' :''}} ">
              <view>{{questionNumList[index2]}}.</view>
              <view>{{item2.answer}}</view>
            </view>
          </view>
        </view>
      </view>
      <!-- 提交 -->
      <view bindtap="onSubmitQuestionResultHandler" wx:if="{{questionResult.status != 1}}" class="submit-btn">
        确认提交
      </view>
      <!-- 结果 -->
      <view wx:else class="result">
        <image class="d1" mode="widthFix" src="../../image/oss/question/question-d1.png" />
        <image class="bg" mode="widthFix" src="../../image/oss/question/result-border.png" />
        <image class="d2" mode="widthFix" src="../../image/oss/question/question-d2.png" />
        <view class="cont">
          <view class="space1"></view>
          <view class="tit">测验结果:答对{{questionResult.right}}题,答错{{questionResult.wrong}}题</view>
          <view class="ball">
            <view class="t1">获得</view>
            <view class="score">{{questionResult.elasticValue}}</view>
            <view class="t1">弹力值</view>
          </view>
          <view class="tips">到店购物即可使用,绝不要错过噢~</view>
          <view class="coupon">
            <view wx:for="{{questionResult.coupons}}" wx:key="{{index}}" class="coupon-item {{item.type==4?'coupon-item2':''}}">
              <image wx:if="{{item.type==4}}" class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-2.png" />
              <image wx:else class="ebg" mode="widthFix" src="../../image/oss/coupon/coupon-1.png" />
              <view class="cont">
                <view class="name">{{item.name}}</view>
                <!-- <view class="detail">查看详情</view> -->
                <view class="card-info card-no">劵码:{{item.couponCode}}</view>
                <view class="card-info card-date">有效期:即日起至{{item.endDateStr}}</view>
              </view>
            </view>
          </view>
        </view>
        <view bindtap="onCreateWishHandler" class="create-wish-btn">马上创建心愿单</view>
      </view>
    </view>
  </view>
</view>