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