PreBackPopup.vue 2.26 KB
<template>
  <view class="exam-submit-popup-wrapper">
    <view class="content-box">
        <view class="text-box">
            退出将消耗1次跳过机会
        </view>
        <view class="sub-text">
            剩余次数2次,是否确认退出?
        </view>
    </view>
    <view class="button-group">
      <view class="cancel-button" @click="handleCancel">
        取消
      </view>
      <view class="confirm-button" @click="handleConfirm">
        {{ confirmText }}
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'ExamSubmitPopup',
  props: {
    confirmText: {
      type: String,
      default: '确认'
    }
  },
  methods: {
    handleCancel() {
      this.$emit('cancel')
    },
    handleConfirm() {
      this.$emit('confirm')
    },
  }
}
</script>

<style lang="scss" scoped>
.exam-submit-popup-wrapper {
  position: relative;
  width: 100%;
  min-height: toRpx(400);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: toRpx(48);
}

.content-box {
  width: toRpx(720);
  height: toRpx(156);
  border-radius: toRpx(16);
  background: #FDECE9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: toRpx(24);
}

.text-box {
  font-size: toRpx(40);
  color: #333;
  text-align: center;
  font-weight: 500;
  line-height: toRpx(60);
}

.sub-text {
  color: #999;
  text-align: center;
  font-size: toRpx(28);
  font-style: normal;
  font-weight: 400;
  line-height: toRpx(48);
}

.button-group {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: toRpx(16);
  margin-top: toRpx(48);
}

.cancel-button {
  width: toRpx(344);
  height: toRpx(80);
  border-radius: toRpx(64);
  background: #f0f1f5;
  color: #1a1a1a;
  font-size: toRpx(28);
  font-weight: 400;
  font-family: "HarmonyOSSansSC";
  text-align: center;
  line-height: toRpx(80);
}

.confirm-button {
  width: toRpx(360);
  height: toRpx(80);
  border-radius: toRpx(48);
  border: toRpx(2) solid #979797;
  background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
  color: #ffffff;
  font-size: toRpx(28);
  font-weight: 500;
  font-family: "HarmonyOSSansSC";
  text-align: center;
  line-height: toRpx(80);

  &:active {
    opacity: 0.8;
  }
}
</style>