zhongshujie
2024-12-19 8a27f5724e10e82cc5a30bf7051397da2e697e63
bug优化,答题卡初始化
6个文件已修改
57 ■■■■ 已修改文件
.vscode/settings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/psychologyAnswer/psychologyAnswer.js 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/psychologyAnswer/psychologyAnswer.wxml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/psychologyAnswer/questionList/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/psychologyAnswer/questionList/index.wxml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/psychologyAnswer/testdata/index.js 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/settings.json
@@ -32,7 +32,7 @@
  },
  "editor.tabSize": 2,
  "[wxml]": {
    "editor.defaultFormatter": "wechat.miniprogram.wxml-language-features"
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[css]": {
    "editor.defaultFormatter": "HookyQR.beautify"
packageBookService/pages/psychologyAnswer/psychologyAnswer.js
@@ -494,7 +494,7 @@
  // 初始化函数
  async init(isReset) {
    this.setData({
      loading: false,
      loading: true,
    });
    const questuionName = this.data.questuionName
    const questuionList = pastData.postData.list
@@ -714,25 +714,24 @@
          this.setData({
            questionDataList: newArr,
            scoreDataList: scoreArr,
            loading: false,
          })
        } catch (error) {
          this.setData({
            questionDataList: newArr,
            scoreDataList: scoreArr
            scoreDataList: scoreArr,
            loading: false,
          })
          console.log(error);
        }
        const e = {
          detail: {
            index: 0
          }
        };
        this.changeSwiper(e)
      });
  },
  // 记录模考答题数据
  saveMockData() {
packageBookService/pages/psychologyAnswer/psychologyAnswer.wxml
@@ -4,7 +4,11 @@
  wx:if="{{!loading}}"
  style="background-color:{{isNight ? '#222' : ''}}"
>
  <view class="page-content" style="background-color:{{isNight ? '#222' : ''}}">
  <view
    wx:if="{{!loading}}"
    class="page-content"
    style="background-color:{{isNight ? '#222' : ''}}"
  >
    <question-list
      wx:if="{{!loading}}"
      sliderValue="{{sliderValue}}"
@@ -26,9 +30,10 @@
  <view
    class="page-bottom"
    style="background-color:{{isNight ? '#202020' : ''}}"
    wx:if="{{answerType !== 'errorQuestion' || (answerType == 'errorQuestion' && !loading)}}"
    wx:if="{{!loading}}"
  >
    <question-options
      wx:if="{{!loading}}"
      id="question-options"
      isShowDialog="{{isShowDialog}}"
      isNight="{{isNight}}"
@@ -51,6 +56,7 @@
</view>
<page-container
  wx:if="{{loading}}"
  show="{{showDialog}}"
  duration="{{false}}"
  overlay="{{false}}"
packageBookService/pages/psychologyAnswer/questionList/index.js
@@ -69,9 +69,11 @@
  ready() {
    const query = wx.createSelectorQuery().in(this);
    query.select('#question-title').boundingClientRect((rect) => {
      if (rect) {
      this.setData({
        height: 'calc(100% - 30px - ' + rect.height + 'px)'
      })
      }
    }).exec();
  },
packageBookService/pages/psychologyAnswer/questionList/index.wxml
@@ -72,12 +72,12 @@
            </t-radio>
          </view>
        </t-radio-group>
        <view wx:if="{{item.questionType == 'linkage'}}">
          <!-- 特殊题 -->
        <view wx:if="{{item.questionType == 'linkage'}}">
          <t-radio-group defaultValue="{{item.questionTab}}" disabled="{{submitStatus}}" bind:change="handeleOption" class="radio-group" data-value="{{item.questionTab}}" data-id="{{item.id}}">
            <view wx:if="{{item.optionData}}" wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex">
              <t-radio value="{{contentItem.value}}" icon="none" placement="right" borderless style="background-color: {{isNight ? '#222' : '#fff'}}">
                <view style="font-size: {{sliderValue || 32}}rpx;" class="radio-item {{!submitStatus && item.questionTab == contentItem.value ? 'radio-active' : isNight ? 'night' :''}}">
                <view style="font-size: {{sliderValue || 32}}rpx;" class="radio-item {{!submitStatus && item.questionTab == contentItem.value ? 'radio-active' : isNight ? 'night' :''}} {{item.questionTab == contentItem.value && submitStatus ?  item.isRight ? 'radio-correct' : 'radio-error' :''}}">
                  <!-- 仅文字 -->
                  <view class="text-space">
                    {{contentItem.value}}、{{contentItem.txt}}
@@ -90,7 +90,7 @@
          <t-radio-group defaultValue="{{item.userAnswer}}" disabled="{{submitStatus}}" bind:change="onChangeRadio" class="radio-group" data-value="{{item.userAnswer}}" data-id="{{item.id}}">
            <view wx:for="{{item.optionData[item.questionTab]}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex">
              <t-radio value="{{citem.value}}" icon="none" placement="right" borderless style="background-color: {{isNight ? '#222' : '#fff'}}">
                <view style="font-size: {{sliderValue || 32}}rpx;" class="radio-item {{!submitStatus && item.userAnswer == citem.value ? 'radio-active' : isNight ? 'night' :''}}">
                <view style="font-size: {{sliderValue || 32}}rpx;" class="radio-item {{!submitStatus && item.userAnswer == citem.value ? 'radio-active' : isNight ? 'night' :''}}{{item.userAnswer == citem.value && submitStatus ?  item.isRight ? 'radio-correct' : 'radio-error' :''}}">
                  <!-- 仅文字 -->
                  <view class="text-space">
                    {{citem.value}}、{{citem.txt}}
@@ -110,7 +110,6 @@
                <text>{{contentItem.value}}、</text>
                <text class="check-text-box">{{contentItem.txt}}</text>
              </view>
              <!-- 仅图片 -->
              <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center mh">
                <text style="color:{{ isNight  ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;">{{contentItem.value}}、</text>
packageBookService/pages/psychologyAnswer/testdata/index.js
@@ -1,6 +1,5 @@
var localData = {
  "list": [
    {
  "list": [{
      "name": "测测你的生活品质",
      "title": "请仔细阅读以下问题,凭你的第一感觉回答。请选择与你相符的答案,即使你感到不太确定,也要回答每个问题。",
      "fromType": "json",
@@ -46,7 +45,8 @@
          }
        ]
      ],
      "list": [{
      "list": [
        {
          "analysisCon": "略",
          "id": "0C85D525",
          "optionIndex": 0,
@@ -2503,8 +2503,7 @@
        "index": "",
        "desc": "第4、第5、第8、第10题选“是”得1分,选“否”不得分;其他题目选“否”得1分,选“是”不得分。最后把所得分数相加。"
      }],
      "scoreData": [
        {
      "scoreData": [{
        "name": "得分",
        "dispatch": "",
        "range": "all",
@@ -2541,8 +2540,7 @@
          }
        ]
      ],
      "list": [
        {
      "list": [{
          "analysisCon": "略",
          "optionIndex": 1,
          "id": "0C85D520",
@@ -2704,7 +2702,8 @@
          }
        ]
      }],
      "list": [{
      "list": [
        {
          "analysisCon": "略",
          "id": "3P1E1B001",
          "optionStyle": "Txt",