mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 19:46:43 +08:00
格式化代码, 海报默认显示产品
This commit is contained in:
@@ -2,32 +2,22 @@
|
||||
<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-tab :name="index" :title="item.name" v-for="(item, index) in posterTypeList" :key="index"> </van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
|
||||
<van-grid :border="false" :column-num="3" :class="pageCount - 1 ? 'pb40' : ''">
|
||||
<van-grid-item v-for="(item, index) in posterList" :key="index">
|
||||
<img :src="item.posterNarrowUrl | urlFormat" @click="posterPreview(item.posterId, item.posterType)" />
|
||||
<!-- <img src="@/assets/images/banner.png" @click="posterPreview(item.posterId)" /> -->
|
||||
</van-grid-item>
|
||||
</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" :page-count="pageCount" @change="change" class="bottom-btn" style="background-color:#fff" v-if="pageCount - 1" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Tab, Tabs, Sticky, Grid, GridItem, Pagination } from 'vant'
|
||||
import { getPosterType, getAppPosterList, getPosterList } from '@/api/ebiz/poster/poster'
|
||||
import { getPosterType, getAppPosterList } from '@/api/ebiz/poster/poster'
|
||||
import config from '@/config'
|
||||
export default {
|
||||
name: 'posterList',
|
||||
@@ -37,12 +27,12 @@ export default {
|
||||
[Sticky.name]: Sticky,
|
||||
[Grid.name]: Grid,
|
||||
[GridItem.name]: GridItem,
|
||||
[Pagination.name]: Pagination,
|
||||
[Pagination.name]: Pagination
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
posterTypeList: [], //海报类型
|
||||
active: '0',
|
||||
active: 3,
|
||||
posterType: '',
|
||||
srcUrl: '@/images/u10199.png',
|
||||
pageNum: 1,
|
||||
@@ -60,7 +50,7 @@ export default {
|
||||
let res = await getPosterType({})
|
||||
if (res.result == 0) {
|
||||
this.posterTypeList = res.content.paterTypeList
|
||||
this.posterType = res.content.paterTypeList[0].code
|
||||
this.posterType = this.posterTypeList[3].code
|
||||
this.getPosterList()
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
@@ -76,7 +66,6 @@ export default {
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
|
||||
console.log(param)
|
||||
let res = await getAppPosterList(param)
|
||||
if (res.result == 0) {
|
||||
this.pageCount = Math.ceil(res.pageInfo.total / 9)
|
||||
@@ -85,17 +74,13 @@ export default {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
},
|
||||
tabChange(name, title) {
|
||||
tabChange(name) {
|
||||
this.posterType = this.posterTypeList[name].code
|
||||
this.pageNum= 1,
|
||||
this.posterList=[],
|
||||
this.pageCount = 1
|
||||
;(this.pageNum = 1), (this.posterList = []), (this.pageCount = 1)
|
||||
this.getPosterList()
|
||||
console.log(name, title)
|
||||
},
|
||||
change() {
|
||||
this.getPosterList()
|
||||
console.log(this.pageNum)
|
||||
},
|
||||
posterPreview(id, posterType) {
|
||||
this.$jump({
|
||||
@@ -111,7 +96,6 @@ console.log(this.pageNum)
|
||||
},
|
||||
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')
|
||||
}
|
||||
}
|
||||
@@ -123,15 +107,15 @@ console.log(this.pageNum)
|
||||
width: 100%;
|
||||
}
|
||||
.poster-list-container >>> .van-pagination__item--active {
|
||||
background-color: #E9332E
|
||||
background-color: #e9332e;
|
||||
}
|
||||
.poster-list-container >>> .van-pagination__item {
|
||||
color: #E9332E
|
||||
color: #e9332e;
|
||||
}
|
||||
.poster-list-container >>> .van-pagination__item--active {
|
||||
color: #fff
|
||||
color: #fff;
|
||||
}
|
||||
.poster-list-container >>> .van-pagination__item--disabled {
|
||||
color: #7d7e80
|
||||
color: #7d7e80;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user