合并冲突
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
<!-- 1. 插槽优先 -->
|
||||
<slot name="title" v-if="$slots.title"></slot>
|
||||
<!-- 2. 有HTML内容且不为空时使用v-html -->
|
||||
<!-- <view v-else-if="html && html.trim() !== ''" v-html="html"></view> -->
|
||||
<view v-else-if="html && html.trim() !== ''" v-html="html"></view>
|
||||
<!-- 3. 最后显示默认标题 -->
|
||||
<template v-else>{{ title }}</template>
|
||||
</view>
|
||||
<view class="button_div">
|
||||
<view class="button_item" v-for="item in buttonList" :style="item?.style" @click="click_button(item)">
|
||||
{{item?.name || ''}}
|
||||
{{ item?.name || '' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -19,35 +19,32 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
dialogConfiguration: {
|
||||
type: Object,
|
||||
required: false,
|
||||
required: false
|
||||
}
|
||||
});
|
||||
const emit = defineEmits(['button_click'])
|
||||
const emit = defineEmits(['button_click']);
|
||||
|
||||
const title = ref('')
|
||||
const html = ref('')
|
||||
const buttonList = ref([])
|
||||
const PopupRef = ref(null)
|
||||
const title = ref('');
|
||||
const html = ref('');
|
||||
const buttonList = ref([]);
|
||||
const PopupRef = ref(null);
|
||||
// 点击按钮
|
||||
const click_button = (value) => {
|
||||
emit('button_click', value)
|
||||
}
|
||||
emit('button_click', value);
|
||||
};
|
||||
|
||||
const close = () => PopupRef.value?.close()
|
||||
const close = () => PopupRef.value?.close();
|
||||
const open = (dialogConfiguration) => {
|
||||
console.log('dialogConfiguration', dialogConfiguration);
|
||||
// 解构赋值更清晰
|
||||
const {
|
||||
title: t,
|
||||
html: h,
|
||||
buttonList: bl = []
|
||||
} = dialogConfiguration || props.dialogConfiguration || {};
|
||||
const { title: t, html: h, buttonList: bl = [] } = dialogConfiguration || props.dialogConfiguration || {};
|
||||
|
||||
console.log('title', title);
|
||||
title.value = t || '';
|
||||
html.value = h || '';
|
||||
buttonList.value = Array.isArray(bl) ? bl : [];
|
||||
@@ -56,11 +53,11 @@
|
||||
if (PopupRef.value) {
|
||||
PopupRef.value.open('bottom');
|
||||
}
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -68,12 +65,12 @@
|
||||
z-index: 1810;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, .9);
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.popup_div {
|
||||
width: 80%;
|
||||
background-color: #FFFFFF;
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx 34rpx 50rpx 34rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -106,7 +103,5 @@
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -318,6 +318,7 @@
|
||||
});
|
||||
|
||||
const result_click = ({ key }) => {
|
||||
console.log('杀杀杀', key);
|
||||
if (key === 'hand_in_paper') {
|
||||
// 现在交卷
|
||||
hand_in_paper('弹窗确认交卷');
|
||||
@@ -332,13 +333,13 @@
|
||||
console.log('点击交卷', paperData);
|
||||
// 判断是否完成所有题目
|
||||
const completeList = topicList
|
||||
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length : res.my_answer))
|
||||
.filter((res) => !!(Array.isArray(res.my_answer) ? res.my_answer.length>0 : res.my_answer?.anserResult !==''))
|
||||
.map((res) => ({
|
||||
a: res.qnsId,
|
||||
b: res.my_answer,
|
||||
c: !!res.my_answer
|
||||
}));
|
||||
dialogConfiguration.title = '确认现在交卷吗?';
|
||||
|
||||
const style_button_1 = {
|
||||
color: '#FFFFFF',
|
||||
fontSize: '30rpx',
|
||||
@@ -352,10 +353,12 @@
|
||||
borderRadius: '8rpx'
|
||||
};
|
||||
const incompleteNumber = topicList.length - completeList.length;
|
||||
console.log('completeList', completeList);
|
||||
console.log('incompleteNumber', incompleteNumber);
|
||||
if (incompleteNumber === 0) {
|
||||
// 完成
|
||||
dialogConfiguration.type = 'complete';
|
||||
dialogConfiguration.title = '确认现在交卷吗?';
|
||||
dialogConfiguration.html = '';
|
||||
dialogConfiguration.buttonList = [
|
||||
{
|
||||
key: 'hand_in_paper',
|
||||
@@ -369,7 +372,7 @@
|
||||
}
|
||||
];
|
||||
} else {
|
||||
dialogConfiguration.type = 'incomplete'; // 未完成
|
||||
dialogConfiguration.title = '';
|
||||
dialogConfiguration.html = `当前考试进度:<text style="color:#0066FF;font-weight:bold;">${completeList.length}/${topicList.length}</text> 题 还有<text style="color:#0066FF;font-weight:bold;">${incompleteNumber}</text>道题未作答,确认交卷吗?`;
|
||||
dialogConfiguration.buttonList = [
|
||||
{
|
||||
|
||||
@@ -406,10 +406,10 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 进入搜索页
|
||||
const goto_search_page = () => {
|
||||
common.navigateTo('/pages/search/search');
|
||||
common.navigateTo('/pages/search/search?from=index');
|
||||
};
|
||||
// 进入课程详情页
|
||||
const goto_course_detail = (crsId) => {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<view class="main_div max_page">
|
||||
<!-- <nav-bar :is_seat="false"></nav-bar> -->
|
||||
<view class="back_div" @click="common.navigateBack()" v-if="from==='setting'">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
<view class="bg_img">
|
||||
<image src="@/static/images/mascot/bg_1.png" class="img" mode="aspectFit"></image>
|
||||
</view>
|
||||
@@ -88,7 +91,7 @@
|
||||
const swiperCount = computed(() => mascotList.length)
|
||||
let swiperIndex = ref(0); // 当前显示第1个(索引0)
|
||||
const isAnimating = ref(false); // 标记动画是否进行中
|
||||
|
||||
|
||||
const animationfinish = ({
|
||||
detail
|
||||
}) => {
|
||||
@@ -130,7 +133,9 @@
|
||||
common.hideLoading()
|
||||
})
|
||||
}
|
||||
onLoad(() => {
|
||||
const from = ref('')
|
||||
onLoad((e) => {
|
||||
from.value = e.from ?? ''
|
||||
common.loading()
|
||||
queryValidTraMascotInfo().then(({
|
||||
body
|
||||
@@ -153,6 +158,38 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.back_div{
|
||||
position: absolute;
|
||||
top: calc(var(--status-bar-height));
|
||||
left: 20rpx;
|
||||
// margin-right: 10rpx;
|
||||
padding: 10rpx 10rpx 10rpx 20rpx;
|
||||
|
||||
// background-color: red;
|
||||
.back-icon {
|
||||
position: relative;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.back-icon::before,
|
||||
.back-icon::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.back-icon::after {
|
||||
top: 25%;
|
||||
left: 25%;
|
||||
width: 40%;
|
||||
height: 40%;
|
||||
border-top: 4rpx solid #eaeaea;
|
||||
border-left: 4rpx solid #eaeaea;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
.title_div {
|
||||
width: 60vw;
|
||||
|
||||
|
||||
+485
-507
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@
|
||||
placeholderStyle="color:#999999;font-size:26rpx"
|
||||
placeholder="请输入关键字"
|
||||
:focus="true"
|
||||
:maxlength="60"
|
||||
:adjust-position="false"
|
||||
@confirm="search"
|
||||
>
|
||||
@@ -54,6 +55,7 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import common from '@/common/common.js';
|
||||
import { getUserInfo } from '@/common/common.js';
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
// 静态样式配置
|
||||
@@ -65,7 +67,7 @@
|
||||
border: 'none',
|
||||
borderRadius: '6px'
|
||||
};
|
||||
const storageKey = 'history_search_list';
|
||||
let storageKey = 'history_search_list';
|
||||
const asssss = ref(false);
|
||||
const inputValue = ref('');
|
||||
const fromType = ref('');
|
||||
@@ -74,6 +76,8 @@
|
||||
|
||||
onLoad((params) => {
|
||||
fromType.value = params.from || '';
|
||||
const userInfo = getUserInfo();
|
||||
storageKey = `${userInfo.userId}_${fromType.value}_history_search_list`;
|
||||
});
|
||||
onShow(() => {
|
||||
let storageList = common.getValue(storageKey);
|
||||
@@ -92,7 +96,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
const search = (text) => {
|
||||
const search = (text, jump = true) => {
|
||||
inputValue.value = text;
|
||||
const searchValue = text.trim();
|
||||
if (searchValue) {
|
||||
@@ -113,10 +117,14 @@
|
||||
}
|
||||
// 保存到本地存储
|
||||
common.setValue(storageKey, uniqueList);
|
||||
// 导航到搜索结果页,使用encodeURIComponent处理特殊字符
|
||||
common.navigateTo(`/pages/search/result?searchName=${searchValue}&from=${fromType.value}`);
|
||||
if (jump) {
|
||||
common.navigateTo(`/pages/search/result?searchName=${searchValue}&from=${fromType.value}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
search
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -134,7 +142,6 @@
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
//、、xxxxxxx
|
||||
.history_div {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@
|
||||
|
||||
// 去选择百禄
|
||||
const gotoMascot = () => {
|
||||
|
||||
common.navigateTo('/pages/mascot/mascot_select_list')
|
||||
common.navigateTo('/pages/mascot/mascot_select_list?from=setting')
|
||||
|
||||
// common.loading()
|
||||
// queryValidTraMascotInfo().then(({body}) => {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
:activeStyle="{color:'#0066FF',fontSize:'30rpx', fontWeight:'600'}"
|
||||
:lineColor="`url(${LineBg}) 10% 10%`"></uv-tabs>
|
||||
</view>
|
||||
|
||||
|
||||
<swiper class="swiper" :current="tabAct" :indicator-dots="false" @change="swiperChange">
|
||||
<swiper-item>
|
||||
<Content :ref="el => contentRefs[0] = el" :index="tabAct"
|
||||
|
||||
Reference in New Issue
Block a user