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> <template>
<view class="bg"> <view class="bg">
<view class="topImg relative"> <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> </view>
@ -86,7 +86,6 @@
} }
.topImg{ .topImg{
width: 100%; width: 100%;
height: 386rpx;
} }

3
subPackages/homestay/index.vue

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

8
subPackages/line/index.vue

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

4
subPackages/ticket/index.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="bg"> <view class="bg">
<view class="topImg relative"> <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> </view>
@ -107,7 +107,7 @@
} }
.topImg{ .topImg{
width: 100%; width: 100%;
height: 440rpx; // height: 440rpx;
} }

Loading…
Cancel
Save