帧视界壹通告,付费看视频的微信小程序
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.

345 lines
7.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year 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. style="height: 360rpx;"
  54. :duration="500">
  55. <swiper-item v-for="(item, index) in actorList"
  56. style="background-color: #fff;height: 360rpx;"
  57. @click="toActor(item)"
  58. :key="index">
  59. <view class="swiper-item">
  60. <image
  61. class="logo"
  62. :src="item.image"
  63. mode="aspectFill" />
  64. <view class="swiper-item-content">
  65. <view class="left">
  66. <view class="title">
  67. {{ item.name }}
  68. </view>
  69. <view class="info-from">
  70. <text class="text-ellipsis"
  71. style="width: 220rpx;">发布人:{{ item.userId }}</text>
  72. <text style="margin-left: 20rpx;">{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}</text>
  73. </view>
  74. </view>
  75. <view class="right">
  76. 查看
  77. </view>
  78. </view>
  79. </view>
  80. </swiper-item>
  81. </swiper>
  82. </view>
  83. </view>
  84. <view class="box">
  85. <view class="box-line">
  86. <view class="title">
  87. 动态帖子
  88. </view>
  89. <view class="more"
  90. @click="$utils.navigateTo('/publish/postList')">
  91. 查看全部
  92. <uv-icon
  93. size="26rpx"
  94. name="arrow-right"></uv-icon>
  95. </view>
  96. </view>
  97. <postList :list="trends"/>
  98. </view>
  99. <tabber :select="0"/>
  100. <showPrivacyAgreement
  101. ref="showPrivacy">
  102. </showPrivacyAgreement>
  103. </view>
  104. </template>
  105. <script>
  106. import tabber from '@/components/base/tabbar.vue'
  107. import postList from '@/components/post/postList.vue'
  108. import showPrivacyAgreement from '@/components/config/showPrivacyAgreement.vue'
  109. export default {
  110. components : {
  111. tabber,
  112. postList,
  113. showPrivacyAgreement,
  114. },
  115. data() {
  116. return {
  117. banner : [],
  118. actorList : [],
  119. postList : [],
  120. trends : [],
  121. queryParams: {
  122. pageNo: 1,
  123. pageSize: 10
  124. },
  125. total : 0,
  126. }
  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.queryParams.pageNo = 1
  141. this.indexGetTrendsPage()
  142. this.getData()
  143. },
  144. onShow() {
  145. this.getData()
  146. this.queryParams.pageNo = 1
  147. this.indexGetTrendsPage(res => {
  148. this.trends = res.result.records
  149. })
  150. },
  151. methods: {
  152. getData(){
  153. this.$api('indexGetBanner', res => {
  154. if(res.code == 200){
  155. this.banner = res.result
  156. }
  157. })
  158. this.$api('indexGetActorList', res => {
  159. if(res.code == 200){
  160. this.actorList = res.result
  161. }
  162. })
  163. },
  164. search(){
  165. this.indexGetTrendsPage()
  166. },
  167. indexGetTrendsPage(fn){
  168. this.$api('indexGetTrendsPage',
  169. this.queryParams, res => {
  170. uni.stopPullDownRefresh()
  171. if(res.code == 200){
  172. fn && fn(res)
  173. if(!fn){
  174. this.trends = res.result.records
  175. }
  176. this.total = res.result.total
  177. }
  178. })
  179. },
  180. bannerClick(index){
  181. let item = this.banner[index]
  182. if(item.toUrl){
  183. return uni.navigateTo({
  184. url: item.toUrl
  185. })
  186. }
  187. if(item.type == 0){//帖子
  188. uni.navigateTo({
  189. url: '/pages/publish/postDetail?id=' +
  190. item.trendsId
  191. })
  192. }else if(item.type == 1){//名片
  193. uni.navigateTo({
  194. url: '/pages/publish/actorDetail?id=' +
  195. item.collectionId
  196. })
  197. }else if(item.type == 2){//作品
  198. uni.navigateTo({
  199. url: '/pages_mine/publish/worksDetail?id=' +
  200. item.masterpieceId
  201. })
  202. }
  203. },
  204. toActor(item){
  205. uni.navigateTo({
  206. url: '/pages/publish/actorDetail?id=' + item.id
  207. })
  208. },
  209. }
  210. }
  211. </script>
  212. <style scoped lang="scss">
  213. .content{
  214. padding-bottom: 150rpx;
  215. .top{
  216. background-image: $uni-linear-gradient-bg-color;
  217. padding: 0 20rpx;
  218. padding-top: calc(var(--status-bar-height) + 20rpx);
  219. .title{
  220. display: flex;
  221. color: #fff;
  222. justify-content: space-between;
  223. margin-bottom: 30rpx;
  224. margin-top: 30rpx;
  225. font-size: 30rpx;
  226. &>view{
  227. display: flex;
  228. justify-content: center;
  229. align-items: center;
  230. }
  231. }
  232. .search{
  233. background-color: #fff;
  234. height: 70rpx;
  235. width: 100%;
  236. margin: 20rpx 0;
  237. display: flex;
  238. justify-content: center;
  239. align-items: center;
  240. font-size: 28rpx;
  241. border-radius: 10rpx;
  242. .icon{
  243. margin: 0 20rpx;
  244. }
  245. input{
  246. }
  247. .text{
  248. margin-left: auto;
  249. margin-right: 20rpx;
  250. }
  251. }
  252. }
  253. .box{
  254. padding: 20rpx;
  255. .box-line{
  256. display: flex;
  257. justify-content: space-between;
  258. align-items: center;
  259. margin-bottom: 20rpx;
  260. .title{
  261. position: relative;
  262. &::after{
  263. content: '';
  264. position: absolute;
  265. display: block;
  266. bottom: 0;
  267. left: 20rpx;
  268. width: 20rpx;
  269. height: 12rpx;
  270. background-color: $uni-linear-gradient-color;
  271. }
  272. }
  273. .more{
  274. display: flex;
  275. font-size: 24rpx;
  276. color: #777;
  277. }
  278. }
  279. .ACTORS{
  280. .swiper-item{
  281. display: flex;
  282. justify-content: center;
  283. align-items: center;
  284. flex-direction: column;
  285. width: 100%;
  286. position: relative;
  287. image{
  288. width: 100%;
  289. height: 360rpx;
  290. }
  291. .swiper-item-content{
  292. position: absolute;
  293. bottom: 0;
  294. left: 0;
  295. z-index: 99;
  296. display: flex;
  297. background-color: #00000055;
  298. color: #fff;
  299. padding: 20rpx;
  300. width: 100%;
  301. box-sizing: border-box;
  302. .left{
  303. .title{
  304. font-weight: 900;
  305. font-size: 30rpx;
  306. }
  307. .info-from{
  308. font-size: 26rpx;
  309. display: flex;
  310. }
  311. }
  312. .right{
  313. background: $uni-linear-gradient-color;
  314. color: #fff;
  315. padding: 0 40rpx;
  316. font-size: 28rpx;
  317. margin-left: auto;
  318. border-radius: 15rpx;
  319. height: 60rpx;
  320. display: flex;
  321. justify-content: center;
  322. align-items: center;
  323. flex-shrink: 0;
  324. }
  325. }
  326. }
  327. }
  328. }
  329. }
  330. </style>