attention.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <view class="contain">
  3. <view class="select-head">
  4. <u-navbar bgColor="transparent" leftIconColor="#fff" :titleStyle="{color:'#fff'}" :fixed="false" leftIconSize="48" :autoBack="true">
  5. <view slot="center" class="navbar-center" style="width: 700rpx;margin-left: 70rpx">
  6. <u-tabs
  7. :list="list1"
  8. lineWidth="126rpx"
  9. @click="changeTab"
  10. lineHeight="0"
  11. lineColor="#DC3C23"
  12. :scrollable="false"
  13. :activeStyle="{color:'#fff',fontSize:'34rpx'}"
  14. :inactiveStyle="{color:'#fff',fontSize:'34rpx'}
  15. "></u-tabs>
  16. </view>
  17. </u-navbar>
  18. <!-- <view class="match-head-tab" v-if="list1Index == 0">
  19. <u-tabs
  20. :list="list2"
  21. lineWidth="126rpx"
  22. @click="changeTab2"
  23. lineHeight="2"
  24. lineColor="#DC3C23"
  25. :scrollable="false"
  26. :activeStyle="{color:'#DC3C23',fontSize:'32rpx'}"
  27. :inactiveStyle="{color:'#fff',fontSize:'32rpx'}
  28. "></u-tabs>
  29. </view> -->
  30. </view>
  31. <view class="main">
  32. <view>
  33. <view class="list-item flex-start" v-for="(item,index) in list" :key="index">
  34. <!-- actives:item!==2 -->
  35. <div class="avatar-box">
  36. <image :src="item.avatar || '/static/image/common/teams_avatar_ico@2x.png'" mode="aspectFill" class="avatar"></image>
  37. <img v-if="item.is_live == 0" class="img" src="/static/image/match/live.png" alt="">
  38. <img v-if="item.is_live == 1" class="img" src="/static/image/match/live-actives.png" alt="">
  39. </div>
  40. <view class="list-item-content c9 size24">
  41. <view class="mg-tp6">
  42. <text>{{ $t('live.lab37') }}: {{item.attention}}</text>
  43. <view class="size28 c3">{{item.user_nickname}}</view>
  44. </view>
  45. <view class="flexcenter flex-col align-start">
  46. <!-- <view class="flexcenter flex-col align-start"> -->
  47. <!-- <view class="paid size28" v-if="list1Index == 0 || item.is_attention == 0" @click="setAttention(1,item)">
  48. Paid attention to
  49. </view> -->
  50. <!-- <text v-if="item.is_attention == 1">Number of fans: 44</text> -->
  51. <!-- <view class="guanzhu-box" @click="setAttention(item)">
  52. <image src="/static/image/match/guanzhu.png" mode="widthFix" class="guanzhu-icon mg-rt12"></image>
  53. <text class="size28 cfff">follow</text>
  54. </view> -->
  55. <view class="Followed" @click="setAttention(item)">
  56. <!-- Followed -->
  57. {{ $t('live.lab38') }}
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <u-empty
  63. v-if="list && list.length == 0"
  64. mode="data"
  65. width="474"
  66. height="312"
  67. textSize="28"
  68. marginTop="100"
  69. :text="$t('common.nodata')"
  70. icon="/static/image/common/nodata.png"
  71. >
  72. </u-empty>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. list1Index:0,
  82. list1:[
  83. {
  84. name: this.$t('live.title4'),
  85. },
  86. // {
  87. // name: this.$t('live.title5'),
  88. // },
  89. ],
  90. type:2,
  91. list:[]
  92. };
  93. },
  94. onReady() {
  95. this.getList()
  96. },
  97. computed:{
  98. info() {
  99. return this.$store.state.info
  100. }
  101. },
  102. methods:{
  103. changeTab(e) {
  104. this.list1Index = e.index
  105. return
  106. if(e.index == 1) {
  107. this.watchlistList()
  108. }else {
  109. this.getList()
  110. }
  111. },
  112. changeTab2(e) {
  113. this.type = e.index
  114. this.getList()
  115. },
  116. getList() {
  117. let index = this.list1Index;
  118. uni.showLoading({
  119. title:this.$t('common.lab')
  120. })
  121. uni.$u.http.get('api/User/attentionList',{params:{type: 0}}).then(res=>{
  122. this.list = res.data || []
  123. uni.hideLoading()
  124. }).catch(res=>{})
  125. },
  126. watchlistList() {
  127. let index = this.list1Index;
  128. uni.showLoading({
  129. title:this.$t('common.lab')
  130. })
  131. uni.$u.http.get('api/Live_streaming/getUserReserveLiveList',{params:{type:0,uid:this.info.id}}).then(res=>{
  132. this.list = res.data || []
  133. uni.hideLoading()
  134. }).catch(res=>{})
  135. },
  136. /* type == 1取消 2关注 */
  137. setAttention(item){
  138. uni.showLoading({
  139. title: this.$t('common.lab'),
  140. });
  141. uni.$u.http.post('/api/Member/attention',{id:item.followed_id}).then(res=>{
  142. uni.hideLoading();
  143. this.getList()
  144. }).catch(res=>{})
  145. }
  146. }
  147. }
  148. </script>
  149. <style lang="scss">
  150. page {
  151. background-color: #F3F3F7;
  152. }
  153. .contain{
  154. min-height: 100vh;
  155. background-color: #F3F3F7;
  156. }
  157. .navbar-center{
  158. width: 520rpx;
  159. }
  160. .select-head {
  161. position: sticky;
  162. top: 0;
  163. z-index: 99;
  164. background-color: $color1;
  165. .select-tab {
  166. padding: 0 28rpx;
  167. margin-top: 20rpx;
  168. }
  169. }
  170. .match-head-tab {
  171. padding: 0 52rpx;
  172. // margin-top: 49rpx;
  173. }
  174. .main{
  175. padding: 24rpx 28rpx;
  176. .list-item{
  177. margin-bottom: 24rpx;
  178. padding: 24rpx 28rpx;
  179. background-color: #fff;
  180. border-radius: 12rpx;
  181. .avatar-box {
  182. position: relative;
  183. margin-right: 20rpx;
  184. width: 96rpx;
  185. .img {
  186. position: absolute;
  187. bottom: 0;
  188. left: 50%;
  189. transform: translateX(-50%);
  190. width: 77%;
  191. }
  192. }
  193. .avatar{
  194. display: block;
  195. width: 96rpx;
  196. height: 96rpx;
  197. border-radius: 200rpx;
  198. }
  199. .live{
  200. position: relative;
  201. &:before{
  202. content: url(@/static/image/match/live.png);
  203. width: 74rpx;
  204. height: 28rpx;
  205. position: absolute;
  206. bottom: -12rpx;
  207. margin-left: -50%;
  208. left: 50%;
  209. }
  210. }
  211. .actives{
  212. &:before{
  213. content: url(@/static/image/match/live-actives.png);
  214. width: 74rpx;
  215. height: 28rpx;
  216. position: absolute;
  217. bottom: -12rpx;
  218. margin-left: -50%;
  219. left: 50%;
  220. }
  221. }
  222. .list-item-content{
  223. flex: 1;
  224. display: flex;
  225. justify-content: space-between;
  226. .paid{
  227. padding: 8rpx 15rpx;
  228. border-radius: 12rpx;
  229. border: 2rpx solid #ccc;
  230. }
  231. .guanzhu-box{
  232. display: flex;
  233. justify-content: center;
  234. align-items: center;
  235. background: url(@/static/image/match/right-bg.png)center center/ 100% 100% no-repeat;
  236. width: 180rpx;
  237. height: 59.54rpx;
  238. .guanzhu-icon{
  239. width: 28.82rpx;
  240. height: 25.39rpx;
  241. }
  242. }
  243. .Followed {
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. width: 180rpx;
  248. height: 59.54rpx;
  249. color: #fff;
  250. background-color: #ccc;
  251. border-radius: 8rpx;
  252. }
  253. }
  254. }
  255. }
  256. </style>