Browse Source

头图高度自适应

master
jiazhipeng 2 months ago
parent
commit
dfdcc146ba
  1. 3
      subPackages/food/index.vue
  2. 3
      subPackages/homestay/index.vue
  3. 8
      subPackages/line/index.vue
  4. 4
      subPackages/ticket/index.vue

3
subPackages/food/index.vue

@ -1,7 +1,7 @@
<template>
<view class="bg">
<view class="topImg relative">
<img v-if="headImg" :src="showImg(headImg)" class="topImg" mode="aspectFill">
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image>
</view>
@ -86,7 +86,6 @@
}
.topImg{
width: 100%;
height: 386rpx;
}

3
subPackages/homestay/index.vue

@ -1,6 +1,6 @@
<template>
<view class="bg">
<image :src="headImg" class="topImg" mode="aspectFill"></image>
<image :src="headImg" class="topImg" mode="widthFix"></image>
<view @click="gotoDetailByType(item)" class="item" v-for="(item,index) in list" :key="index">
<image :src="item.headimg" mode="aspectFill" class="image"></image>
@ -64,7 +64,6 @@
.topImg {
width: 100%;
height: 386.67rpx;
}
.item {

8
subPackages/line/index.vue

@ -1,5 +1,8 @@
<template>
<view class="bg">
<view class="topImg relative">
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image>
</view>
<view class="item" v-for="(item,index) in list" :key="index" @click="gotoDetailByType(item)">
<image :src="showImg(item.headimg)" mode="aspectFill "></image>
<view class="content flex-column">
@ -24,12 +27,14 @@
export default {
data() {
return {
headImg:null,
list: [],
finished: false
}
},
onReady() {
this.getList()
this.getHeadImg(2377).then(res => {this.headImg = res})
},
onReachBottom() {
setTimeout(() => {
@ -61,6 +66,9 @@
background-color: rgba(249, 252, 243, 1);
padding-bottom: 100rpx;
}
.topImg{
width: 100%;
}
.item {
margin: 30rpx 26rpx;

4
subPackages/ticket/index.vue

@ -1,7 +1,7 @@
<template>
<view class="bg">
<view class="topImg relative">
<img v-if="headImg" :src="showImg(headImg)" class="topImg" mode="aspectFill">
<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image>
</view>
@ -107,7 +107,7 @@
}
.topImg{
width: 100%;
height: 440rpx;
// height: 440rpx;
}

Loading…
Cancel
Save