[toc]
# 3.11 送禮物彈框組件(一) - 布局
## 3.11.1 實現送禮物的彈出層效果
1. 使用popup組件實現彈出層效果
```
<!-- 送禮物彈出層 -->
<uni-popup type="bottom" ref="giftPopup">
</uni-popup>
```
2. 點擊禮物圖標讓送禮物的彈出層效果顯示
```
<view @click="openGift" style="height:80rpx; width: 80rpx;" class="flex mr-1 justify-center rounded-circle align-center bg-warning">
<text class="iconfont"></text>
</view>
//打開送禮物彈出層
openGift(){
this.$refs.giftPopup.open()
},
```
## 3.11.2 實現送禮物布局 - 頭部
```
<!-- 送禮物彈出層 -->
<uni-popup type="bottom" ref="giftPopup">
<view style="width: 750rpx; height: 550rpx;" class="bg-white">
<view style="height: 100rpx;" class="flex justify-between align-center">
<text class="text-main font-md ml-3">禮物</text>
<view style="height:100rpx; width: 100rpx;" class="flex justify-center align-center">
<text class="iconfont"></text>
</view>
</view>
</view>
</uni-popup>
```
## 3.11.3 實現送禮物布局 - 中間
```
<!-- 送禮物彈出層 -->
<uni-popup type="bottom" ref="giftPopup">
<view style="width: 750rpx; height: 550rpx;" class="bg-white">
<view style="height: 100rpx;" class="flex justify-between align-center">
<text class="text-main font-md ml-3">禮物</text>
<view style="height:100rpx; width: 100rpx;" class="flex justify-center align-center">
<text class="iconfont"></text>
</view>
</view>
<swiper class="border-top border-bottom" :indicator-dots="true" style="height: 350rpx;" :duration="500">
<swiper-item>
<view class="flex flex-wrap">
<view v-for="(item,index) in 8" :key="index" style="width: 187.5rpx; height: 175rpx;" class="flex flex-column justify-center align-center">
<image src="../../static/gift/1.png" style="width: 100rpx; height: 100rpx;"></image>
<view class="flex mt-1">
<text class="text-warning font mr-1">雞蛋</text>
<text class="text-secondary font">1</text>
</view>
</view>
</view>
</swiper-item>
</swiper>
<view style="height: 100rpx;"></view>
</view>
</uni-popup>
```
## 3.11.4 實現送禮物布局 - 底部
```
<!-- 送禮物彈出層 -->
<uni-popup type="bottom" ref="giftPopup">
<view style="width: 750rpx; height: 550rpx;" class="bg-white">
<view style="height: 100rpx;" class="flex justify-between align-center">
<text class="text-main font-md ml-3">禮物</text>
<view style="height:100rpx; width: 100rpx;" class="flex justify-center align-center">
<text class="iconfont"></text>
</view>
</view>
<swiper class="border-top border-bottom" :indicator-dots="true" style="height: 350rpx;" :duration="500">
<swiper-item>
<view class="flex flex-wrap">
<view v-for="(item,index) in 8" :key="index" style="width: 187.5rpx; height: 175rpx;" class="flex flex-column justify-center align-center">
<image src="../../static/gift/1.png" style="width: 100rpx; height: 100rpx;"></image>
<view class="flex mt-1">
<text class="text-warning font mr-1">雞蛋</text>
<text class="text-secondary font">1</text>
</view>
</view>
</view>
</swiper-item>
</swiper>
<view style="height: 100rpx;" class="flex align-center justify-end">
<view class="bg-warning flex mr-3 align-center py-2 rounded px-2 justify-center" >
<text class="font">充值</text>
</view>
<view class="bg-main flex mr-3 align-center py-2 rounded px-2 justify-center" >
<text class="font text-white">發送</text>
</view>
</view>
</view>
</uni-popup>
```
- 第一章 項目介紹和準備
- 1.1 課程介紹
- 1.2 環境搭建和項目創建
- 1.3 引入全局樣式
- 1.4 引入圖標庫
- 1.5 底部導航和凸起按鈕配置
- 第二章 首頁開發
- 2.1 首頁開發(一)
- 2.2 首頁開發(二)
- 第三章 直播間(用戶端)開發
- 3.1 基礎布局開發(一)
- 3.2 基礎布局開發(二)
- 3.3 個人信息和觀看情況
- 3.4 接收禮物組件(一) - 布局
- 3.5 接收禮物組件(二) - 自動滾動
- 3.6 接收禮物組件(三) - 自動消失
- 3.7 底部操作條
- 3.8 彈幕組件開發(一) - 輸入框彈出層
- 3.9 彈幕組件開發(二) - 置于底部功能
- 3.10 彈幕組件開發(三) - 發送彈幕
- 3.11 送禮物彈框組件(一) - 布局
- 3.12 送禮物彈框組件(二) - 功能
- 第四章 充值金幣頁開發
- 4.1 充值金幣頁開發(一)
- 4.2 充值金幣頁開發(二)
- 第五章 直播間(主播端)開發
- 5.1 創建直播頁 - 推流組件
- 5.2 創建直播頁 - 布局(一)
- 5.3 創建直播頁 - 布局(二)
- 5.4 創建直播頁 - 鏡頭反轉
- 5.5 創建直播頁 - 切換畫質
- 5.6 創建直播頁 - 美顏和美白
- 5.7 關于退出創建直播頁黑邊問題
- 5.8 主播直播間(一)
- 5.9 主播直播間(二)
- 第六章 個人中心頁面開發
- 6.1 個人中心頁
- 第七章 egg.js基礎
- 第八章 后臺管理系統開發
- 8.1 創建項目和基礎配置
- 第九章 交互和部署上線
- 9.1 登錄注冊交互實現
- 9.2 個人中心交互實現
- 9.3 退出登錄以及初始化用戶信息
- 9.5 權限驗證
- 9.6 首頁交互 - 上拉加載與下拉刷新
- 9.7 創建訂單和微信支付(一)
- 9.8 創建訂單和微信支付(二)
- 9.9 微信支付調試和充值頁交互
- 9.10 直播間交互
- 9.11 socket.io安裝與通訊(一)
- 9.12 socket.io安裝和通訊(二)
- 9.13 加入直播間(一)
- 9.14 加入直播間(二)
- 9.15 加入直播間(三)
- 9.16 離開直播間
- 9.17 直播間實時在線用戶列表
- 9.18 直播間實時彈幕功能
- 9.19 直播間送禮物功能
- 9.20 創建直播功能交互(一)
- 9.21 創建直播功能交互(二)
- 9.22 優化前端部分問題(一)
- 9.23 優化前端部分問題(二)
- 第七章 登錄注冊頁面開發