帧视界壹通告,付费看视频的微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

312 lines
6.2 KiB

11 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="title">
  5. <view class="">
  6. 首页
  7. </view>
  8. </view>
  9. <view class="search">
  10. <!-- <view class="icon">
  11. <uv-icon
  12. size="40rpx"
  13. name="search"></uv-icon>
  14. </view>
  15. <input type="text" placeholder="请输入搜索关键字..."
  16. v-model="queryParams.title"/>
  17. <view class="text"
  18. @click="search">
  19. 搜索
  20. </view> -->
  21. <!-- @change -->
  22. <uv-search
  23. bgColor="#fff"
  24. @search="search"
  25. @custom="search"
  26. placeholder="请输入搜索关键字..."
  27. v-model="queryParams.title"></uv-search>
  28. </view>
  29. <view class="swipe">
  30. <uv-swiper
  31. :list="banner"
  32. @click="bannerClick"
  33. keyName="image"
  34. height="320rpx"></uv-swiper>
  35. </view>
  36. </view>
  37. <view class="box">
  38. <view class="box-line">
  39. <view class="title">
  40. 认证演员
  41. </view>
  42. <view class="more"
  43. @click="$utils.navigateTo('/publish/actorList')">
  44. 查看全部
  45. <uv-icon
  46. size="26rpx"
  47. name="arrow-right"></uv-icon>
  48. </view>
  49. </view>
  50. <view class="ACTORS">
  51. <swiper class="swiper-box"
  52. :autoplay="true"
  53. :duration="500">
  54. <swiper-item v-for="(item, index) in actorList"
  55. style="background-color: #fff;"
  56. :key="index">
  57. <view class="swiper-item">
  58. <image
  59. class="logo"
  60. :src="item.logo"
  61. mode="aspectFill" />
  62. <view class="swiper-item-content">
  63. <view class="left">
  64. <view class="title">
  65. {{ item.name }}
  66. </view>
  67. <view class="info-from">
  68. <text class="text-ellipsis"
  69. style="width: 220rpx;">发布人:{{ item.userId }}</text>
  70. <text style="margin-left: 20rpx;">{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}</text>
  71. </view>
  72. </view>
  73. <view class="right">
  74. 查看
  75. </view>
  76. </view>
  77. </view>
  78. </swiper-item>
  79. </swiper>
  80. </view>
  81. </view>
  82. <view class="box">
  83. <view class="box-line">
  84. <view class="title">
  85. 动态帖子
  86. </view>
  87. <view class="more"
  88. @click="$utils.navigateTo('/publish/postList')">
  89. 查看全部
  90. <uv-icon
  91. size="26rpx"
  92. name="arrow-right"></uv-icon>
  93. </view>
  94. </view>
  95. <postList :list="trends"/>
  96. </view>
  97. <tabber :select="0"/>
  98. <showPrivacyAgreement
  99. ref="showPrivacy">
  100. </showPrivacyAgreement>
  101. </view>
  102. </template>
  103. <script>
  104. import tabber from '@/components/base/tabbar.vue'
  105. import postList from '@/components/post/postList.vue'
  106. import showPrivacyAgreement from '@/components/config/showPrivacyAgreement.vue'
  107. export default {
  108. components : {
  109. tabber,
  110. postList,
  111. showPrivacyAgreement,
  112. },
  113. data() {
  114. return {
  115. banner : [],
  116. actorList : [],
  117. postList : [],
  118. trends : [],
  119. queryParams: {
  120. pageNo: 1,
  121. pageSize: 10
  122. },
  123. total : 0,
  124. }
  125. },
  126. computed : {
  127. },
  128. //滚动到屏幕底部
  129. onReachBottom() {
  130. console.log("======首页滑动到底部触发====")
  131. let total = this.queryParams.pageNo * this.queryParams.pageSize
  132. if(total < this.total){
  133. this.queryParams.pageNo += 1
  134. this.indexGetTrendsPage(res => {
  135. this.trends.push(...res.result.records)
  136. })
  137. }
  138. },
  139. onPullDownRefresh(){
  140. this.indexGetTrendsPage()
  141. this.getData()
  142. },
  143. onShow() {
  144. this.getData()
  145. this.queryParams.pageNo = 1
  146. this.indexGetTrendsPage(res => {
  147. this.trends = res.result.records
  148. })
  149. },
  150. methods: {
  151. getData(){
  152. this.$api('indexGetBanner', res => {
  153. if(res.code == 200){
  154. this.banner = res.result
  155. }
  156. })
  157. this.$api('indexGetActorList', res => {
  158. if(res.code == 200){
  159. this.actorList = res.result
  160. }
  161. })
  162. },
  163. search(){
  164. this.indexGetTrendsPage()
  165. },
  166. indexGetTrendsPage(fn){
  167. this.$api('indexGetTrendsPage',
  168. this.queryParams, res => {
  169. uni.stopPullDownRefresh()
  170. if(res.code == 200){
  171. fn && fn(res)
  172. // this.trends = res.result.records
  173. this.total = res.result.total
  174. }
  175. })
  176. },
  177. bannerClick(index){
  178. if(this.banner[index].toUrl){
  179. uni.navigateTo({
  180. url: this.banner[index].toUrl
  181. })
  182. }
  183. }
  184. }
  185. }
  186. </script>
  187. <style scoped lang="scss">
  188. .content{
  189. padding-bottom: 150rpx;
  190. .top{
  191. background-image: $uni-linear-gradient-bg-color;
  192. padding: 0 20rpx;
  193. padding-top: calc(var(--status-bar-height) + 20rpx);
  194. .title{
  195. display: flex;
  196. color: #fff;
  197. justify-content: space-between;
  198. margin-bottom: 30rpx;
  199. margin-top: 30rpx;
  200. font-size: 30rpx;
  201. &>view{
  202. display: flex;
  203. justify-content: center;
  204. align-items: center;
  205. }
  206. }
  207. .search{
  208. background-color: #fff;
  209. height: 70rpx;
  210. width: 100%;
  211. margin: 20rpx 0;
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. font-size: 28rpx;
  216. border-radius: 10rpx;
  217. .icon{
  218. margin: 0 20rpx;
  219. }
  220. input{
  221. }
  222. .text{
  223. margin-left: auto;
  224. margin-right: 20rpx;
  225. }
  226. }
  227. }
  228. .box{
  229. padding: 20rpx;
  230. .box-line{
  231. display: flex;
  232. justify-content: space-between;
  233. align-items: center;
  234. margin-bottom: 20rpx;
  235. .title{
  236. position: relative;
  237. &::after{
  238. content: '';
  239. position: absolute;
  240. display: block;
  241. bottom: 0;
  242. left: 20rpx;
  243. width: 20rpx;
  244. height: 12rpx;
  245. background-color: $uni-linear-gradient-color;
  246. }
  247. }
  248. .more{
  249. display: flex;
  250. font-size: 24rpx;
  251. color: #777;
  252. }
  253. }
  254. .ACTORS{
  255. .swiper-item{
  256. display: flex;
  257. justify-content: center;
  258. align-items: center;
  259. flex-direction: column;
  260. width: 100%;
  261. image{
  262. width: 100%;
  263. height: 180rpx;
  264. }
  265. .swiper-item-content{
  266. margin-top: 15rpx;
  267. display: flex;
  268. width: 80%;
  269. .left{
  270. .title{
  271. font-weight: 900;
  272. font-size: 30rpx;
  273. }
  274. .info-from{
  275. font-size: 26rpx;
  276. color: #777;
  277. display: flex;
  278. }
  279. }
  280. .right{
  281. background: $uni-linear-gradient-color;
  282. color: #fff;
  283. padding: 0 40rpx;
  284. font-size: 28rpx;
  285. margin-left: auto;
  286. border-radius: 15rpx;
  287. height: 60rpx;
  288. display: flex;
  289. justify-content: center;
  290. align-items: center;
  291. flex-shrink: 0;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. }
  298. </style>