header.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <cover-view class="wrapper">
  3. <cover-view class="header">
  4. <title-header />
  5. </cover-view>
  6. <cover-view class="div info-wrap">
  7. <cover-view class="left">
  8. <!-- 主播信息 -->
  9. <cover-view class="div an-infos" v-if="ownerInfo&&ownerInfo.avatar">
  10. <cover-image mode="aspectFit" :src="ownerInfo.avatar" class="img avtar" />
  11. <cover-view class="div info">
  12. <cover-view><text class="div an-name">{{ownerInfo.nick}}</text></cover-view>
  13. <cover-view><text class="div an-fans">{{ownerInfo.fans}}粉丝</text></cover-view>
  14. </cover-view>
  15. <text class="div attention" @click="attentionBtn">{{ifLike?'已关注':'关注'}}</text>
  16. </cover-view>
  17. <!-- 直播间信息 -->
  18. <cover-view class="room-id-info-wrapper" style="margin:20rpx 0"><text class="div room-id-info" v-if="groupInfo&&groupInfo.groupID">直播间ID:{{groupInfo.groupID}}</text><cover-view style="flex:1"></cover-view></cover-view>
  19. <!-- 区域信息 -->
  20. <!-- 观看人数信息 -->
  21. <cover-view class="room-id-info-wrapper"><text class="div room-id-info" v-if="groupInfo.memberNum">{{groupInfo.memberNum}}人在看</text><cover-view style="flex:1"></cover-view></cover-view>
  22. <!-- 退出直播 end -->
  23. </cover-view>
  24. <cover-view class="right">
  25. <!-- 退出直播 start -->
  26. <cover-view class="right-wrapper">
  27. <cover-image mode="aspectFit" src="@/static/image/live/refresh.png" class="img refresh" @click="refresh"/>
  28. <back class="back" @quitGroup="quitGroup"></back>
  29. </cover-view>
  30. </cover-view>
  31. <!-- 优惠券 -->
  32. <cover-image mode="aspectFit" v-if="showcoupon" src="@/static/image/live/red-pack.png" class="img red-pack" @click="coupon"/>
  33. </cover-view>
  34. </cover-view>
  35. </template>
  36. <script>
  37. import TitleHeader from '../../../TitleHeader'
  38. import back from './back'
  39. export default {
  40. props: {
  41. groupInfo: {},
  42. ownerInfo: {},
  43. showcoupon: {},
  44. ifLike: {}
  45. },
  46. data () {
  47. return {
  48. }
  49. },
  50. methods: {
  51. coupon () {
  52. this.$emit('coupon')
  53. },
  54. quitGroup () {
  55. this.$emit('quitGroup')
  56. },
  57. attentionBtn () {
  58. this.$emit('attention')
  59. },
  60. refresh () {
  61. location.reload()
  62. }
  63. },
  64. components: {
  65. TitleHeader,
  66. back
  67. },
  68. computed: {},
  69. created () {
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .wrapper{flex:1}
  75. .header{
  76. /* #ifndef APP-PLUS-NVUE */
  77. padding-top:var(--status-bar-height);
  78. /* #endif */
  79. background-color: #fff;
  80. }
  81. .back{
  82. }
  83. .refresh{
  84. width: 32px;
  85. height: 32px;
  86. margin-right: 20rpx;
  87. }
  88. .avtar {
  89. width: 72rpx;
  90. height: 72rpx;
  91. border-radius: 36rpx;
  92. overflow: hidden;
  93. }
  94. .info {
  95. flex:1;
  96. color: #000;
  97. padding-left: 10rpx;
  98. /* #ifndef APP-PLUS-NVUE */
  99. max-width: 140rpx;
  100. /* #endif */
  101. }
  102. .attention {
  103. width: 94rpx;
  104. height: 60rpx;
  105. background: rgba(255,255,255,.5);
  106. border-radius: 30rpx;
  107. font-family: PingFangSC-Medium;
  108. font-size:12px;
  109. color: #FFF;
  110. /* #ifndef APP-PLUS-NVUE */
  111. letter-spacing: 0;
  112. /* #endif */
  113. text-align: center;
  114. padding: 0;
  115. line-height: 60rpx;
  116. }
  117. .an-infos {
  118. /* #ifndef APP-PLUS-NVUE */
  119. display: flex;
  120. /* #endif */
  121. /* #ifdef APP-PLUS-NVUE */
  122. flex-direction: row;
  123. /* #endif */
  124. align-items: center;
  125. background: rgba(0, 0, 0, 0.25);
  126. border-radius: 40rpx;
  127. width: 322rpx;
  128. height: 72rpx;
  129. padding: 4rpx;
  130. }
  131. .an-name {
  132. font-family: PingFangSC-Medium;
  133. font-size:12px;
  134. color: #FFFFFF;
  135. /* #ifndef APP-PLUS-NVUE */
  136. letter-spacing: 0;
  137. /* #endif */
  138. text-align: left;
  139. text-overflow: ellipsis;
  140. lines:1;
  141. }
  142. .an-fans {
  143. font-family: PingFangSC-Regular;
  144. font-size:10px;
  145. color: #FFFFFF;
  146. /* #ifndef APP-PLUS-NVUE */
  147. letter-spacing: 0;
  148. /* #endif */
  149. text-align: left;
  150. margin-top: 10rpx;
  151. text-overflow: ellipsis;
  152. overflow: hidden;
  153. /* #ifndef APP-PLUS-NVUE */
  154. white-space: nowrap
  155. /* #endif */
  156. }
  157. .info-wrap {
  158. padding: 92rpx 22rpx;
  159. /* #ifndef APP-PLUS-NVUE */
  160. display: flex;
  161. /* #endif */
  162. /* #ifdef APP-PLUS-NVUE */
  163. flex-direction: row;
  164. /* #endif */
  165. }
  166. .left{
  167. flex:1
  168. }
  169. .right-wrapper{
  170. /* #ifndef APP-PLUS-NVUE */
  171. display: flex;
  172. /* #endif */
  173. /* #ifdef APP-PLUS-NVUE */
  174. flex-direction: row;
  175. /* #endif */
  176. justify-content: flex-end;
  177. }
  178. .right{
  179. }
  180. .room-id-info-wrapper{
  181. /* #ifndef APP-PLUS-NVUE */
  182. display: flex;
  183. /* #endif */
  184. /* #ifdef APP-PLUS-NVUE */
  185. flex-direction: row;
  186. /* #endif */
  187. }
  188. .room-id-info {
  189. /* #ifndef APP-PLUS-NVUE */
  190. display: block;
  191. /* #endif */
  192. background: rgba(0, 0, 0, 0.25);
  193. border-radius: 40rpx;
  194. font-family: PingFangSC-Regular;
  195. font-size:10px;
  196. color: #FFFFFF;
  197. text-align: center;
  198. line-height: 40rpx;
  199. height: 40rpx;
  200. padding:0 20rpx;
  201. }
  202. .red-pack {
  203. /* background-image: linear-gradient(180deg, #FF9C9C 8%, #F37474 100%); */
  204. border-radius: 4rpx;
  205. height: 109rpx;
  206. width: 83rpx;
  207. position: absolute;
  208. right: 24rpx;
  209. top: 270rpx;
  210. z-index: 1000;
  211. }
  212. </style>