fix:更新封面图不显示问题

This commit is contained in:
caozc
2023-02-26 14:51:14 +08:00
parent cf8fef2c19
commit 30b496edd1

View File

@@ -246,6 +246,36 @@
<a-button @click="backPage" class="btn2">取消</a-button>
</div>
</div>
<!-- 更多背景图 v-model:visible="learnBgMore" -->
<a-modal :closable="sh" centered="true" v-model:visible="learnBgMore" :footer="null" :width="650"
wrapClassName="learnBgMoreModal" :z-index="9999">
<div class="main">
<div class="top">
<div class="topc">封面图</div>
</div>
<div class="imagesBox">
<!-- <div
@click="() => (projectInfo.picUrl = src.value)"
v-for="item in projectPic"
:key="item.code"
class="learnBgItem"
> -->
<div @click="chooseImg2(item)" v-for="item in projectPic" :key="item.code" class="learnBgItem" :style="{
border:
projectInfo.picUrl === item.value
? '3px solid rgba(78, 166, 255, 1)'
: '1px solid #ccc',
'background-image': 'url(' + item.value.split(',')[0] + ')',
}">
<!-- <img class="im" :src="item.source" /> -->
</div>
</div>
<div class="btn">
<button class="samtn btn1" @click="closeLearnBgMore">取消</button>
<button class="samtn btn2" @click="closeLearnBgMore">确定</button>
</div>
</div>
</a-modal>
</div>
</template>
<script setup>
@@ -263,13 +293,16 @@ const route = useRoute();
const router = useRouter();
const store = useStore();
const projectInfo = ref({});
const learnBgMore = ref(false);
const projectPic = ref([]);
const courseSyncFlag = ref(true);
onMounted(() => {
getDetail();
console.log(JSON.stringify(store.state.project_pic));
projectPic.value = store.state.project_pic.map((e) => ({
value: e.dictValue,
label: e.dictName,
code: e.id,
value: e.value,
label: e.name
}));
});
@@ -320,6 +353,24 @@ const errorMsgs = {
boeFlag: "请选择是否BOE实施",
};
//显示更多路径背景弹窗s
const showLearnBgMore = () => {
learnBgMore.value = true;
};
//关闭更多路径背景弹窗
const closeLearnBgMore = () => {
learnBgMore.value = false;
};
const chooseImg2 = (item) => {
// console.log(item);
projectInfo.value.picUrl = item.value;
projectInfo.value.pathBgId = item.code;
projectInfo.value.pathBg = item.value.split(",")[0];
projectInfo.value.mobilePicUrl = item.value.split(",")[1];
};
const createProject = () => {
for (let i in errorMsgs) {
if (projectInfo.value[i] === "" || projectInfo.value[i] === undefined) {