修改背景图片获取的方式

This commit is contained in:
wangxiaowei 2024-11-27 15:47:15 +08:00
parent 24f452390f
commit 31a1561161

@ -4,7 +4,7 @@
:back-bg="'rgba(0, 0, 0, 0.2)'" back-icon-color="rgba(256, 256, 256, 1)" :immersive="true"> :back-bg="'rgba(0, 0, 0, 0.2)'" back-icon-color="rgba(256, 256, 256, 1)" :immersive="true">
</u-navbar> </u-navbar>
<view class="content"> <view class="content">
<view class="head"></view> <view class="head" :style="[background]"></view>
<view class="rule bold xl text-center m-b-20" @click="showModel = true"> <view class="rule bold xl text-center m-b-20" @click="showModel = true">
活动规则 活动规则
</view> </view>
@ -106,6 +106,12 @@
} }
}) })
} }
},
computed: {
background() {
const timestamp = Date.now();
return {'background-image': `url(https://zjeloong.oss-cn-hangzhou.aliyuncs.com/activity/panic_buying/panic_bg.jpg?t=${timestamp})`}
}
} }
} }
</script> </script>
@ -119,7 +125,6 @@
} }
.head { .head {
background-image: url(https://zjeloong.oss-cn-hangzhou.aliyuncs.com/activity/panic_buying/panic_bg.jpg?t=1);
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
min-height: 800rpx; min-height: 800rpx;