问星数据小程序

sphRank.vue 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view>
  3. <view class="choiceBox">
  4. <view class="choiceActive choice" @click="goLogin">
  5. {{('日榜 ' + start_time)}}
  6. <view class="sj">
  7. <image mode="widthFix" src="/static/img/sort.png"></image>
  8. </view>
  9. </view>
  10. <view class="choiceActive choice" @click="goLogin">
  11. 全部
  12. <view class="sj">
  13. <image mode="widthFix" src="/static/img/sort.png"></image>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="userListBox">
  18. <view class="userItemBox" v-for="(item,index) in infoList" :key="index" @click="goLogin">
  19. <view class="list_userImg">
  20. <image v-if="index==0" src="/static/img/one.png" mode="widthFix" class="top_img"></image>
  21. <image v-if="index==1" src="/static/img/second.png" mode="widthFix" class="top_img"></image>
  22. <image v-if="index==2" src="/static/img/three.png" mode="widthFix" class="top_img"></image>
  23. <image :src="item.userInfo.head_url" class="userImg" mode="widthFix"></image>
  24. </view>
  25. <view class="list_userInfo">
  26. <view class="userTitleBox">
  27. <view class="userTitle">{{item.userInfo.nickname?item.userInfo.nickname:'-'}}</view>
  28. <view class="auth_div">
  29. <image :src="item.userInfo.auth_icon_url" class="icon" mode="widthFix"></image>
  30. <text>{{item.userInfo.auth_profession}}</text>
  31. </view>
  32. </view>
  33. <view class="userData">
  34. <view class="userDataItem">
  35. <text class="data">{{item.fans_count||item.fans_count==0?$NumberHandle(item.fans_count):'-'}}</text>
  36. <view>预估粉丝数</view>
  37. </view>
  38. <view class="userDataItem">
  39. <text class="data" style="color:#E93269">{{item.like_incr||item.like_incr==0?$NumberHandle(item.like_incr):'-'}}</text>
  40. <view>新增获赞</view>
  41. </view>
  42. <view class="userDataItem">
  43. <text class="data">{{item.comment_incr || item.comment_incr == 0 ?$NumberHandle(item.comment_incr) :'-'}}</text>
  44. <view>新增获评</view>
  45. </view>
  46. <view class="userDataItem">
  47. <text class="data">{{item.like_divided_by_fans || item.like_divided_by_fans == 0 ?(item.like_divided_by_fans+'%') :'-'}}</text>
  48. <view>赞粉比</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <nopermission v-if="!loading"></nopermission>
  55. <tab-bar :current='1'></tab-bar>
  56. <applet-mask v-if="appletMaskFlag" @closeMask='closeMask'></applet-mask>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. appletMaskFlag:false,
  64. page:1,
  65. pagesize:20,
  66. infoList:[],
  67. start_time: this.$getDay(-1,false),
  68. loading:true
  69. }
  70. },
  71. onLoad() {
  72. this.init(1)
  73. },
  74. methods: {
  75. goLogin(){
  76. var sUserAgent = navigator.userAgent.toLowerCase();
  77. if(sUserAgent.indexOf("baidu") > 0 || sUserAgent.indexOf("ucbrowser") > 0 ) {
  78. this.$burialPoint({project_name:'小程序版h5',button_name:'点击打开弹框',key_value:uni.getStorageSync('key')?uni.getStorageSync('key'):'',page_name:'视频号榜单',url_value:window.location.href})
  79. _hmt?_hmt.push(['_trackEvent','小程序版h5', '点击打开弹框', uni.getStorageSync('key'),'']):'';
  80. this.appletMaskFlag = true;
  81. }else{
  82. if (!navigator.userAgent.toLowerCase().match(/micromessenger/i)) {
  83. this.$burialPoint({project_name:'小程序版h5',button_name:'页面按钮直接打开微信',key_value:uni.getStorageSync('key')?uni.getStorageSync('key'):'',page_name:'视频号榜单',url_value:window.location.href})
  84. _hmt?_hmt.push(['_trackEvent','小程序版h5', '页面按钮直接打开微信', uni.getStorageSync('key'),'']):'';
  85. location.href = 'weixin://dl/business/?t=4HtwsBfu3Bj'
  86. }else{
  87. this.$burialPoint({project_name:'小程序版h5',button_name:'微信端-点击打开弹框',key_value:uni.getStorageSync('key')?uni.getStorageSync('key'):'',page_name:'视频号榜单',url_value:window.location.href})
  88. _hmt?_hmt.push(['_trackEvent','小程序版h5', '微信端-点击打开弹框', uni.getStorageSync('key'),'']):'';
  89. this.appletMaskFlag = true;
  90. }
  91. }
  92. },
  93. closeMask(){
  94. this.appletMaskFlag = false
  95. },
  96. init(page){
  97. this.loading = true
  98. uni.showLoading({title: '加载中',})
  99. this.$req(this.$api.goodVideoNumberList, 'get', {
  100. page:page,
  101. // label_id:this.data.authorType.id,
  102. sort: 'like_divided_by_fans',
  103. date:this.start_time,
  104. page_size:this.pagesize,
  105. // type:this.data.cycle
  106. }, (res) => {
  107. this.loading = false
  108. uni.hideLoading()
  109. if(res && res.errno == 0){
  110. this.infoList = res.rst.data
  111. }else{
  112. uni.showToast({
  113. title: res.err,
  114. icon: 'none',
  115. duration: 2000
  116. })
  117. }
  118. },()=>{
  119. this.loading = false
  120. wx.hideLoading()
  121. })
  122. },
  123. }
  124. }
  125. </script>
  126. <style>
  127. page{
  128. background: #F1F1F1;
  129. }
  130. .userListBox .userItemBox{
  131. margin: 20rpx;
  132. height: 212rpx;
  133. background: #fff;
  134. border-radius: 14rpx;
  135. display: flex;
  136. align-items: center;
  137. justify-content: space-between;
  138. padding: 0 12rpx;
  139. }
  140. .userListBox .userItemBox:first-child {
  141. margin-top: 0;
  142. }
  143. .userListBox .userItemBox:last-child {
  144. margin-bottom: 0;
  145. }
  146. .userListBox .userItemBox .list_userImg{
  147. width: 135rpx;
  148. height: 135rpx;
  149. border-radius: 50%;
  150. margin-right: 20rpx;
  151. }
  152. .userListBox .userItemBox .list_userInfo{
  153. flex: 1;
  154. }
  155. .userListBox .userItemBox .list_userInfo .userTitleBox{
  156. display: flex;
  157. align-items: center;
  158. }
  159. .userItemBox .list_userImg {
  160. position: relative;
  161. }
  162. .userItemBox .list_userImg .userImg {
  163. width: 100%;
  164. height: 100%;
  165. border-radius: 50%;
  166. }
  167. .userItemBox .list_userImg .top_img {
  168. width: 50rpx;
  169. height: 80rpx;
  170. position: absolute;
  171. right: 0;
  172. top: 10rpx;
  173. z-index: 2;
  174. }
  175. .userListBox .userItemBox .list_userInfo .userTitleBox .userTitle{
  176. max-width: 200rpx;
  177. color: #000;
  178. font-size: 28rpx;
  179. line-height: 30rpx;
  180. overflow: hidden;
  181. font-weight: bold;
  182. text-overflow:ellipsis; white-space: nowrap;
  183. margin-top: 10rpx;
  184. }
  185. .userListBox .userItemBox .list_userInfo .userTitleBox .auth_div{
  186. flex: 1;
  187. overflow: hidden;
  188. text-overflow:ellipsis;
  189. white-space: nowrap;
  190. margin-left: 10rpx;
  191. max-width: 300rpx;
  192. }
  193. .userListBox .userItemBox .list_userInfo .userTitleBox .auth_div .icon{
  194. width: 34rpx;
  195. height: 34rpx;
  196. vertical-align: middle;
  197. }
  198. .userListBox .userItemBox .list_userInfo .userTitleBox .auth_div text{
  199. color: #89899C;
  200. font-size: 24rpx;
  201. line-height: 34rpx;
  202. vertical-align: middle;
  203. }
  204. .userListBox .userItemBox .list_userInfo .userData{
  205. display: flex;
  206. align-items: center;
  207. justify-content: space-between;
  208. margin-top: 20rpx;
  209. }
  210. .userListBox .userItemBox .list_userInfo .userData .userDataItem{
  211. text-align: center;
  212. }
  213. .userListBox .userItemBox .list_userInfo .userData .userDataItem .data{
  214. color: #000;
  215. font-size: 32rpx;
  216. line-height: 44rpx;
  217. font-weight: 600;
  218. }
  219. .userListBox .userItemBox .list_userInfo .userData .userDataItem view{
  220. color: #89899C;
  221. font-size: 22rpx;
  222. line-height: 36rpx;
  223. margin-top: 6rpx;
  224. }
  225. .choiceBox{
  226. display: flex;
  227. align-items: center;
  228. position: relative;
  229. padding: 32rpx 0 22rpx 28rpx;
  230. }
  231. .choiceBox .choice{
  232. border-radius: 32rpx;
  233. display: inline-block;
  234. padding: 0 20rpx;
  235. height: 64rpx;
  236. font-size: 28rpx;
  237. line-height: 64rpx;
  238. position: relative;
  239. background: #fff;
  240. color: #2562FF;
  241. z-index: 2;
  242. margin-right: 24rpx;
  243. }
  244. .choiceBox .choice .sj{
  245. display: inline-block;
  246. }
  247. .choiceBox .choice .sj image {
  248. width: 20rpx;
  249. height: auto;
  250. }
  251. .choiceBox .choiceActive{
  252. background: #fff;
  253. color: #2562FF;
  254. z-index: 4;
  255. }
  256. </style>