''
liukangdong
2024-05-28 125924f74e3cb309e4a49de304a09e5edc8d75b6
''
已修改3个文件
125 ■■■■ 文件已修改
h5/api/staff.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/answer/answer.vue 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/staffLogin/login.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/api/staff.js
@@ -4,6 +4,7 @@
export const loginPost = (data) => {
  return http({
    url: 'visitsAdmin/cloudService/web/member/accountLogin',
    method: 'post',
    data
  })
}
h5/pages/answer/answer.vue
@@ -6,24 +6,13 @@
    </view>
    <view class="box_list">
      <view class="box_list_answer" v-if="list && list.length > 0">
        <!--    判断   -->
        <!--                 <template v-if="list[i].type === 0">
                    <view class="box_list_answer_item" v-for="(item, index) in list[i].options" :key="index" @click="select(index)">
                        <image src="@/static/video_error@2x.png" v-if="success && problemIndex === index" />
                        <image src="@/static/video@2x.png" v-else-if="!String(problemIndex) || problemIndex !== index" />
                        <image src="@/static/video_sel@2x.png" v-else-if="problemIndex === index" />
                        <text style="color: rgba(237, 69, 69, 1)" v-if="success && problemIndex === index">{{item.code}}</text>
                        <text v-else-if="!String(problemIndex) || problemIndex !== index">{{item.code}}</text>
                        <text style="color: rgba(2, 94, 239, 1)" v-else-if="problemIndex === index">{{item.code}}</text>
                    </view>
                </template> -->
        <!--    单选   -->
        <!--    单选/判断   -->
        <view v-for="(item, index) in list" :key="index" class="list_item">
          <template v-if="item.type == 1">
            <view class="box_list_answer_name">
              {{ index + 1 }}、{{ item.title
              }}<text style="color: #ed4545">*</text>
            </view>
          <template v-if="item.type == 1 || item.type == 0">
            <view
              class="box_list_answer_item"
              v-for="(line, lIndex) in item.options"
@@ -84,14 +73,95 @@
            </view>
            <view
              class="box_list_answer_tips"
              v-if="item.selAnswer && item.answer !== item.selAnswer && status != '0'"
              v-if="
                item.selAnswer &&
                item.answer !== item.selAnswer &&
                status != '0'
              "
            >
              <image src="@/static/ic_wrong@2x.png" />
              <text>回答错误</text>
            </view>
            <view
              class="box_list_answer_tips"
              v-if="item.selAnswer && item.answer === item.selAnswer && status != '0'"
              v-if="
                item.selAnswer &&
                item.answer === item.selAnswer &&
                status != '0'
              "
            >
              <image src="@/static/meeting/icon/ic_choose_sel@2x.png" />
              <text>回答正确</text>
            </view>
          </template>
          <template v-if="item.type == 2">
            <view
              class="box_list_answer_item"
              v-for="(line, lIndex) in item.options"
              :key="lIndex"
              @click="changeBox(index, lIndex)"
            >
              <image src="@/static/checkbox@2x.png" v-if="!line.checked" />
              <image
                src="@/static/checkbo1x_sel@2x.png"
                v-if="line.checked || (item.selAnswer === item.answer && line.checked)"
              />
              <image
                src="@/static/checkbox_wrong@2x.png"
                v-if="
                  line.checked &&
                  item.selAnswer !== item.answer &&
                  status == '2'
                "
              />
              <text v-if="!item.selAnswer || item.selAnswer !== line.code"
                ><text class="mr24">{{ line.code }}</text>
                {{ line.value }}</text
              >
              <text
                v-if="
                  (item.selAnswer &&
                    item.answer === item.selAnswer &&
                    item.selAnswer == line.code) ||
                  item.selAnswer == line.code
                "
                style="color: rgba(2, 94, 239, 1)"
                ><text class="mr24" style="color: rgba(2, 94, 239, 1)">{{
                  line.code
                }}</text>
                {{ line.value }}</text
              >
              <text
                v-if="
                  item.selAnswer &&
                  item.answer !== item.selAnswer &&
                  status == '2'
                "
                style="color: rgba(237, 69, 69, 1)"
                ><text class="mr24" style="color: rgba(237, 69, 69, 1)">{{
                  line.code
                }}</text>
                {{ line.value }}</text
              >
            </view>
            <view
              class="box_list_answer_tips"
              v-if="
                item.selAnswer &&
                item.answer !== item.selAnswer &&
                status != '0'
              "
            >
              <image src="@/static/ic_wrong@2x.png" />
              <text>回答错误</text>
            </view>
            <view
              class="box_list_answer_tips"
              v-if="
                item.selAnswer &&
                item.answer === item.selAnswer &&
                status != '0'
              "
            >
              <image src="@/static/meeting/icon/ic_choose_sel@2x.png" />
              <text>回答正确</text>
@@ -186,16 +256,21 @@
            res.data.forEach(item => {
              // 判断
              if (item.type === 0) {
                item.options = [{ code: '正确', value: '正确' }, { code: '错误', value: '错误' }]
                item.options = [{ code: '正确' }, { code: '错误' }]
              }
              // 单选/多选
              if (item.type === 1 || item.type === 2) {
                item.options = JSON.parse(item.options)
              }
              if (item.type === 2) {
                item.options.forEach(i => {
                  i.checked = false
                })
              }
              item.status = '0'
              item.selAnswer = null
            })
            console.log('options', res.data)
            console.log(res.data)
            this.list = res.data
          }
          // res.param.problemsDOList.forEach(item => {
@@ -213,6 +288,18 @@
        }
      })
      // this.problemIndex = index
    },
    changeBox(index, jeck) {
      this.list.forEach((item, i) => {
        if (index === i) {
          item.options.forEach((item2, j) => {
            if(j === jeck){
              item2.checked = !item2.checked
            }
          })
          item.selAnswer = item.options.filter(a => a.checked).map(b => b.code).sort().join(',')
        }
      })
    },
    sort(arr) {
      arr.sort(function (a, b) {
@@ -354,7 +441,7 @@
      }
    }
    .list_item {
      margin-bottom: 24rpx;
      margin-bottom: 46rpx;
    }
    .box_list_answer_item {
      width: 100%;
h5/pages/staffLogin/login.vue
@@ -9,7 +9,6 @@
        <input
          v-model="form.account"
          maxlength="18"
          type="number"
          placeholder="账号"
        />
      </view>