| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <view class="video_question_popup_mask" @touchmove.stop.prevent>
- <view class="video_question_popup_wrapper">
- <view class="video_question_popup_header">
- <text class="video_question_popup_title">试题弹出</text>
- </view>
- <view class="video_question_popup_content">
- <view class="video_question_popup_content_title">{{ question?.codeName }}:{{ question?.questionsName }}
- </view>
- <textarea class="video_question_popup_content_textarea" v-model="answer" placeholder="请输入你的回答"
- placeholder-style="font-weight: 400;font-size: 28rpx;color: #999999;" :auto-height="false"
- maxlength="500" />
- </view>
- <view class="video_question_popup_footer">
- <view class="video_question_popup_footer_confirm_btn" @click="handleSubmit">
- <text class="video_question_popup_footer_confirm_btn_text">确定</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- onLoad,
- onUnload
- } from '@dcloudio/uni-app';
- export default {
- data() {
- return {
- question: null,
- answer: ''
- }
- },
- onLoad() {
- const question = uni.getStorageSync('videoDetailSendQuestion');
- this.question = question ? JSON.parse(question) : null;
- this.answer = '';
- },
- methods: {
- handleSubmit() {
- if (!this.answer.trim()) {
- uni.showToast({
- title: '请输入答案!',
- icon: 'none'
- });
- return;
- }
- // 将提交结果写入临时存储
- uni.setStorageSync('videoDetailQuestionPopupSubmit', this.answer)
- uni.navigateBack()
- }
- },
- onUnload() {
- // 兜底清理
- uni.removeStorageSync('videoDetailSendQuestion')
- }
- }
- </script>
- <style>
- .video_question_popup_mask {
- flex: 1;
- background-color: rgba(0, 0, 0, 0.5);
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .video_question_popup_wrapper {
- width: 702rpx;
- background-color: #ffffff;
- border-radius: 16rpx;
- overflow: hidden;
- }
- .video_question_popup_header {
- width: 702rpx;
- height: 96rpx;
- background-color: #F5F7FA;
- border-radius: 16px 16px 0px 0px;
- }
- .video_question_popup_title {
- font-weight: 500;
- font-size: 32rpx;
- color: #303133;
- margin-left: 40rpx;
- line-height: 96rpx;
- }
- .video_question_popup_content {
- padding: 40rpx;
- height: 504rpx;
- }
- .video_question_popup_content_title {
- display: flex;
- font-weight: 400;
- font-size: 32rpx;
- color: #303133;
- text-align: left;
- }
- .video_question_popup_content_textarea {
- margin-top: 20rpx;
- flex: 1;
- height: 440rpx;
- border: 2rpx solid #E9E9E9;
- border-radius: 8rpx;
- padding: 20rpx 24rpx;
- font-size: 28rpx;
- color: #303133;
- }
- .video_question_popup_footer {
- display: flex;
- flex-direction: row;
- border-top: 2rpx solid #EBEEF5;
- padding: 30rpx 40rpx;
- justify-content: flex-end;
- }
- .video_question_popup_footer_confirm_btn {
- background-color: #2E64FA;
- border-radius: 8rpx;
- flex: 1;
- height: 72rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .video_question_popup_footer_confirm_btn_text {
- font-weight: 500;
- font-size: 28rpx;
- color: #FFFFFF;
- }
- </style>
|