Commit c521dab4 authored by youjie's avatar youjie

no message

parent c32497e7
<template> <template>
<div class="block-item"> <div class="block-item">
<!-- transition-prev="scale" <q-carousel
transition-next="scale" --> animated
<!-- transition-prev="slide-right" v-model="slide"
transition-next="slide-left" --> infinite
<q-carousel v-model="slide" :autoplay="autoplay"
transition-prev="slide-right" transition-prev="slide-right"
transition-next="slide-left" transition-next="slide-left"
swipeable animated ref="carousel">
control-color="white" infinite height="100%"
class="my-bg-grey text-black shadow-1 no-shadow"
control-type="regular"
:arrows="day.details.length>0?true:false"
control-text-color="primary"
ref="carousel"
navigation
>
<template v-for="(x, i) in day.details"> <template v-for="(x, i) in day.details">
<q-carousel-slide :name="i" class="column no-wrap"> <q-carousel-slide :name="i" class="column no-wrap">
<div class="bg-white row"> <div class="bg-white row">
...@@ -35,7 +27,7 @@ ...@@ -35,7 +27,7 @@
:src="x.img" :src="x.img"
:ratio=" 16/9 " :ratio=" 16/9 "
style="width: 100%" style="width: 100%"
@click="showPreview(day.details,i)" @click="showImageHandler(x.img)"
> >
<template v-slot:error> <template v-slot:error>
<div <div
...@@ -105,16 +97,16 @@ ...@@ -105,16 +97,16 @@
<template v-if="day.details.length>1"> <template v-if="day.details.length>1">
<q-carousel-control <q-carousel-control
position="top-right" position="top-right"
:offset="[10,188]" :offset="[10,168]"
class="q-gutter-xs" class="q-gutter-xs"
> >
<q-btn <q-btn
push round dense color="primary" text-color="while" icon="arrow_left" push round dense color="primary" text-color="while" icon="arrow_left"
@click="$refs.carousel.previous()" @click="carousel.previous()"
/> />
<q-btn <q-btn
push round dense color="primary" text-color="while" icon="arrow_right" push round dense color="primary" text-color="while" icon="arrow_right"
@click="$refs.carousel.next()" @click="carousel.next()"
/> />
</q-carousel-control> </q-carousel-control>
</template> </template>
...@@ -141,9 +133,12 @@ ...@@ -141,9 +133,12 @@
setup(props) { setup(props) {
const $router = useRouter() const $router = useRouter()
const { t } = useI18n() const { t } = useI18n()
const carousel = ref(null)
const $q = useQuasar() const $q = useQuasar()
let {ctx:that, proxy} = getCurrentInstance() let {ctx:that, proxy} = getCurrentInstance()
const data= reactive({ const data= reactive({
slide: 0,
autoplay: 0,
showImagePriview:false, showImagePriview:false,
currentImage:'', currentImage:'',
images:[], images:[],
...@@ -160,18 +155,6 @@ ...@@ -160,18 +155,6 @@
data.currentImage = url data.currentImage = url
data.showImagePriview = true data.showImagePriview = true
}, },
showPreview(imgs, index = 0) {
let timgs = [];
imgs.forEach((x) => {
timgs.push(x.img);
});
that.$viewerApi({
options: {
initialViewIndex: index,
},
images: timgs,
});
},
getHotelSuffix() { getHotelSuffix() {
let suffix = ""; let suffix = "";
if (props.day.jiu2.length > 1) { if (props.day.jiu2.length > 1) {
...@@ -204,11 +187,15 @@ ...@@ -204,11 +187,15 @@
return { return {
...toRefs(data), ...toRefs(data),
...methods, ...methods,
carousel,
} }
} }
}) })
</script> </script>
<style scoped> <style scoped>
.q-carousel{
height: auto !important;
}
.q-carousel__slide{ .q-carousel__slide{
padding: 0 !important; padding: 0 !important;
} }
......
...@@ -525,18 +525,6 @@ export default defineComponent({ ...@@ -525,18 +525,6 @@ export default defineComponent({
data.currentImage = url data.currentImage = url
data.showImagePriview = true data.showImagePriview = true
}, },
showPreview(imgs, index = 0) {
let timgs = [];
imgs.forEach((x) => {
timgs.push(x.img);
});
that.$viewerApi({
options: {
initialViewIndex: index,
},
images: timgs,
});
},
getHotelSuffix() { getHotelSuffix() {
let suffix = ""; let suffix = "";
if (props.day.jiu2.length > 1) { if (props.day.jiu2.length > 1) {
......
...@@ -437,18 +437,6 @@ export default defineComponent({ ...@@ -437,18 +437,6 @@ export default defineComponent({
data.currentImage = url data.currentImage = url
data.showImagePriview = true data.showImagePriview = true
}, },
showPreview(imgs, index = 0) {
let timgs = [];
imgs.forEach((x) => {
timgs.push(x.img);
});
that.$viewerApi({
options: {
initialViewIndex: index,
},
images: timgs,
});
},
getHotelSuffix() { getHotelSuffix() {
let suffix = ""; let suffix = "";
if (props.day.jiu2.length > 1) { if (props.day.jiu2.length > 1) {
......
...@@ -186,18 +186,7 @@ export default defineComponent({ ...@@ -186,18 +186,7 @@ export default defineComponent({
data.currentImage = url data.currentImage = url
data.showImagePriview = true data.showImagePriview = true
}, },
showPreview(imgs, index = 0) {
let timgs = [];
imgs.forEach((x) => {
timgs.push(x.img);
});
that.$viewerApi({
options: {
initialViewIndex: index,
},
images: timgs,
});
},
getHotelSuffix() { getHotelSuffix() {
let suffix = ""; let suffix = "";
if (props.day.jiu2.length > 1) { if (props.day.jiu2.length > 1) {
......
...@@ -356,18 +356,7 @@ export default defineComponent({ ...@@ -356,18 +356,7 @@ export default defineComponent({
data.currentImage = url data.currentImage = url
data.showImagePriview = true data.showImagePriview = true
}, },
showPreview(imgs, index = 0) {
let timgs = [];
imgs.forEach((x) => {
timgs.push(x.img);
});
that.$viewerApi({
options: {
initialViewIndex: index,
},
images: timgs,
});
},
getHotelSuffix() { getHotelSuffix() {
let suffix = ""; let suffix = "";
if (props.day.jiu2.length > 1) { if (props.day.jiu2.length > 1) {
......
...@@ -268,18 +268,7 @@ export default defineComponent({ ...@@ -268,18 +268,7 @@ export default defineComponent({
data.currentImage = url data.currentImage = url
data.showImagePriview = true data.showImagePriview = true
}, },
showPreview(imgs, index = 0) {
let timgs = [];
imgs.forEach((x) => {
timgs.push(x.img);
});
that.$viewerApi({
options: {
initialViewIndex: index,
},
images: timgs,
});
},
getHotelSuffix() { getHotelSuffix() {
let suffix = ""; let suffix = "";
if (props.day.jiu2.length > 1) { if (props.day.jiu2.length > 1) {
......
<template> <template>
<q-table data="days" :columns="cols" flat class="q-mt-md" hide-pagination> <q-table :rows="days" :columns="cols" flat class="q-mt-md" hide-pagination>
<template v-slot:body-cell-day="props"> <template v-slot:body-cell-day="props">
<q-td :props="props"> <q-td :props="props">
<div class="text-h6">{{ props.row.dayNum }}</div> <div class="text-h6">{{ props.row.dayNum }}</div>
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
:ratio="16 / 9" :ratio="16 / 9"
spinner-color="grey" spinner-color="grey"
spinner-size="20px" spinner-size="20px"
@click="showPreview(y.childItem.imaArray,zi)" @click="showImageHandler(y.childItem.imaArray)"
/> />
</q-responsive> </q-responsive>
</template> </template>
...@@ -312,14 +312,18 @@ ...@@ -312,14 +312,18 @@
</q-timeline> </q-timeline>
</div> </div>
</div> </div>
<q-dialog class="no-padding" v-model="showImagePriview" persistent>
<image-preview :current="currentImage" :images="images"></image-preview>
</q-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
import ImagePreview from "../../common/ImagePreview.vue";
import { date,useQuasar } from "quasar"; import { date,useQuasar } from "quasar";
import { reactive, toRefs, defineComponent,ref,watch, getCurrentInstance } from 'vue'; import { reactive, toRefs, defineComponent,ref,watch, getCurrentInstance } from 'vue';
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
export default defineComponent({ export default defineComponent({
components: { }, components: { ImagePreview },
props: ['days'], props: ['days'],
setup(props) { setup(props) {
const { t } = useI18n() const { t } = useI18n()
...@@ -327,6 +331,8 @@ export default defineComponent({ ...@@ -327,6 +331,8 @@ export default defineComponent({
let {ctx:that, proxy} = getCurrentInstance() let {ctx:that, proxy} = getCurrentInstance()
const data= reactive({ const data= reactive({
currentImage:'',
showImagePriview: false,
d: props.days, d: props.days,
}) })
watch(() => props.days,(n,o) => { watch(() => props.days,(n,o) => {
...@@ -377,17 +383,9 @@ export default defineComponent({ ...@@ -377,17 +383,9 @@ export default defineComponent({
}); });
return txt; return txt;
}, },
showPreview(imgs, index = 0) { showImageHandler(url: string) {
let timgs = []; data.currentImage = url
imgs.forEach((x) => { data.showImagePriview = true
timgs.push(x.url);
});
// data.$viewerApi({
// options: {
// initialViewIndex: index,
// },
// images: timgs,
// });
}, },
} }
......
...@@ -420,7 +420,9 @@ export default defineComponent({ ...@@ -420,7 +420,9 @@ export default defineComponent({
nextTick(() => { nextTick(() => {
data.navs.forEach((x, index) => { data.navs.forEach((x, index) => {
const el = navstext.value[index] const el = navstext.value[index]
x.top = el.getBoundingClientRect().top + data.currentHeight - 60 if(el){
x.top = el.getBoundingClientRect().top + data.currentHeight - 60
}
}) })
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment