开发项目过程中需要在进入首页时弹出红包的功能需求,在捣鼓一番之后完成图如下。
二话不说直接上代码。
wxml代码:
<!-- 红包 -->
<view class="cu-modal {
{modalName=='Image'?'show':''}}">
<view class="cu-dialog">
<view class="bg-imgs" style="background-image: url('https://6861-haoai-hnpmh-1259368460.tcb.qcloud.la/img/index/%E7%BA%A2%E5%8C%85.png?sign=c4bbd4b057995ebb07d31a85860c7d62&t=1560582751');">
<view class="cu-bar justify-end text-white">
<view class="action xx" bindtap="hideModal">
<text class="cuIcon-close"></text>
</view>
</view>
</view>
</view>
</view>
wxss代码:
/* 红包 */
.bg-imgs{
height: 350px;
background-repeat: no-repeat;
background-size: 100% 10