mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-24 06:42:52 +08:00
Merge branch 'feature/GFRS-453【】贺报功能' into dev
This commit is contained in:
@@ -1,29 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="poster-list-container">
|
<div class="poster-list-container">
|
||||||
<!-- <van-sticky>
|
|
||||||
<van-tabs :line-width="45" v-model="active" @change="tabChange" sticky>
|
|
||||||
<van-tab :name="index" :title="item.name" v-for="(item, index) in posterTypeList" :key="index">-->
|
|
||||||
<!-- <img src="@/assets/images/u10199.png" /> -->
|
|
||||||
<!-- </van-tab>
|
|
||||||
</van-tabs>
|
|
||||||
</van-sticky> -->
|
|
||||||
|
|
||||||
<van-grid class="grid-box" :border="false" :column-num="3" :gutter="10">
|
<van-grid class="grid-box" :border="false" :column-num="3" :gutter="10">
|
||||||
<!-- <van-grid-item v-for="(item, index) in posterList" :key="index">
|
<van-grid-item v-for="(item, index) in posterList" :key="index" @click="previewImg(index)">
|
||||||
<img :src="item.posterNarrowUrl | urlFormat" @click="posterPreview(item.posterId, item.posterType)" />
|
<img :src="item.realUrl" />
|
||||||
<img src="@/assets/images/banner.png" @click="posterPreview(item.posterId)" />
|
|
||||||
</van-grid-item> -->
|
|
||||||
<van-grid-item v-for="(item, index) in 10" :key="index">
|
|
||||||
<img src="@/assets/images/banner.png" @click="posterPreview(item.posterId)" />
|
|
||||||
</van-grid-item>
|
</van-grid-item>
|
||||||
</van-grid>
|
</van-grid>
|
||||||
<!-- <van-pagination v-model="pageNum" :page-count="pageCount" @change="change" class="bottom-btn" style="background-color:#fff" v-if="pageCount - 1" /> -->
|
|
||||||
<!-- <van-pagination v-model="pageNum" :total-items="24" :items-per-page="5" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Sticky, Grid, GridItem, Pagination } from 'vant'
|
import { Sticky, Grid, GridItem, Pagination, ImagePreview } from 'vant'
|
||||||
import { getPosterList } from '@/api/ebiz/poster/poster'
|
import { getPosterList } from '@/api/ebiz/poster/poster'
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
export default {
|
export default {
|
||||||
@@ -36,32 +22,25 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// posterTypeList: [], //贺报类型
|
|
||||||
active: '0',
|
active: '0',
|
||||||
posterType: 'congratulation',
|
posterType: 'hb',
|
||||||
srcUrl: '@/images/u10199.png',
|
srcUrl: '@/images/u10199.png',
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 9,
|
pageSize: 9,
|
||||||
posterList: [], // 贺报列表
|
posterList: [], // 贺报列表
|
||||||
pageCount: 1
|
pageCount: 1,
|
||||||
|
imgUrls: [],
|
||||||
|
show: false,
|
||||||
|
index: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.getPosterTypeList()
|
|
||||||
this.getPosterList()
|
this.getPosterList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取贺报类型
|
onChange(index) {
|
||||||
// async getPosterTypeList() {
|
this.index = index
|
||||||
// let res = await getPosterType({})
|
},
|
||||||
// if (res.result == 0) {
|
|
||||||
// // this.posterTypeList = res.content.paterTypeList
|
|
||||||
// // this.posterType = res.content.paterTypeList[0].code
|
|
||||||
// this.getPosterList()
|
|
||||||
// } else {
|
|
||||||
// this.$toast(res.resultMessage)
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// 贺报列表查询
|
// 贺报列表查询
|
||||||
async getPosterList() {
|
async getPosterList() {
|
||||||
let param = {
|
let param = {
|
||||||
@@ -77,39 +56,24 @@ export default {
|
|||||||
if (res.result == 0) {
|
if (res.result == 0) {
|
||||||
this.pageCount = Math.ceil(res.pageInfo.total / 9)
|
this.pageCount = Math.ceil(res.pageInfo.total / 9)
|
||||||
this.posterList = res.pageInfo.list
|
this.posterList = res.pageInfo.list
|
||||||
|
for (let item of this.posterList) {
|
||||||
|
let url = (config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${item.posterNarrowUrl}`).replace(/\+/g, '%2B')
|
||||||
|
item.realUrl = url
|
||||||
|
this.imgUrls.push(url)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$toast(res.resultMessage)
|
this.$toast(res.resultMessage)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// tabChange(name, title) {
|
|
||||||
// this.posterType = this.posterTypeList[name].code
|
|
||||||
// this.pageNum= 1,
|
|
||||||
// this.posterList=[],
|
|
||||||
// this.pageCount = 1
|
|
||||||
// this.getPosterList()
|
|
||||||
// console.log(name, title)
|
|
||||||
// },
|
|
||||||
change() {
|
change() {
|
||||||
this.getPosterList()
|
this.getPosterList()
|
||||||
console.log(this.pageNum)
|
|
||||||
},
|
},
|
||||||
posterPreview(id) {
|
previewImg(index) {
|
||||||
this.$jump({
|
ImagePreview({
|
||||||
flag: 'h5',
|
images: this.imgUrls,
|
||||||
extra: {
|
startPosition: index
|
||||||
url: location.origin + `/#/congratulation/congratulationPreview?id=${id}`
|
|
||||||
},
|
|
||||||
routerInfo: {
|
|
||||||
path: `/congratulation/congratulationPreview?id=${id}`
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
urlFormat(url) {
|
|
||||||
console.log((config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${url}`).replace(/\+/g, '%2B'))
|
|
||||||
return (config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${url}`).replace(/\+/g, '%2B')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user