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

370 lines
6.9 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. <template>
  2. <view class="competition">
  3. <navbar
  4. leftClick
  5. bgColor="transparent"
  6. @leftClick="$utils.navigateBack"
  7. title="比赛评选"/>
  8. <image :src="competitionBanner" mode="aspectFill"
  9. style="position: absolute;z-index: -1;
  10. width: 100%;
  11. height: 560rpx;
  12. top: 0;
  13. "
  14. ></image>
  15. <view class="top">
  16. <!-- <view class="left">
  17. <view class="title">
  18. 比赛评选排行
  19. </view>
  20. <view class="">
  21. 参与活动 领取奖励
  22. </view>
  23. </view>
  24. <view class="right">
  25. <image src="../static/competition/1.png" mode=""></image>
  26. </view> -->
  27. </view>
  28. <view class="box">
  29. <view class="head">
  30. <view class="ranking">
  31. 排行
  32. </view>
  33. <view class="content">
  34. 作品
  35. </view>
  36. <view class="give-like">
  37. 点赞
  38. </view>
  39. </view>
  40. <view class="empty"
  41. v-if="!list.length">
  42. <image src="../static/competition/k.png" mode=""></image>
  43. <view class="">
  44. 暂无作品发布第一个作品吧 ~
  45. </view>
  46. </view>
  47. <view class="list"
  48. v-else>
  49. <view class="item"
  50. v-for="(item, index) in list"
  51. @click="toUrl(item)"
  52. :key="index">
  53. <view class="ranking">
  54. {{ index + 1 }}
  55. </view>
  56. <view class="content">
  57. <view class="image">
  58. <image :src="item.image" mode=""></image>
  59. </view>
  60. <view class="text">
  61. <view class="title">
  62. {{ item.title }}
  63. </view>
  64. <view class="actor">
  65. <view class="headImage">
  66. <image :src="item.userImage" mode=""></image>
  67. </view>
  68. <view class="username text-ellipsis">
  69. 发布人{{ item.userId }}
  70. </view>
  71. </view>
  72. <view class="createTime">
  73. 发布时间{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
  74. </view>
  75. </view>
  76. </view>
  77. <view class="give-like">
  78. <view class="num">
  79. <uv-icon
  80. size="30rpx"
  81. name="thumb-up"></uv-icon>
  82. {{ item.num }}
  83. </view>
  84. <view :class="{btn : true, a : item.thumbsUp}"
  85. @click.stop="thumbUp(item)">
  86. 投票
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="submit"
  93. @click="$utils.navigateTo('/pages_mine/publish/addWorks')"
  94. >
  95. 发布作品
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. import { mapState } from 'vuex'
  101. export default {
  102. data() {
  103. return {
  104. list : [],
  105. total : 0,
  106. queryParams: {
  107. pageNo: 1,
  108. pageSize: 10
  109. },
  110. }
  111. },
  112. computed : {
  113. ...mapState(['competitionBanner']),
  114. },
  115. onLoad() {
  116. // this.$route.query的参数
  117. },
  118. onShow() {
  119. this.queryParams.pageNo = 1
  120. this.getList(res => {
  121. this.list = res.result.records
  122. })
  123. },
  124. //滚动到屏幕底部
  125. onReachBottom() {
  126. let total = this.queryParams.pageNo * this.queryParams.pageSize
  127. if(total < this.total){
  128. this.queryParams.pageNo += 1
  129. this.getList(res => {
  130. this.list.push(...res.result.records)
  131. })
  132. }
  133. },
  134. onPullDownRefresh(){
  135. this.queryParams.pageNo = 1
  136. this.getList(res => {
  137. this.list = res.result.records
  138. })
  139. },
  140. methods: {
  141. // 点赞
  142. thumbUp(item){
  143. this.$api('infoLike', {
  144. type : 0,
  145. id : item.id,
  146. }, res => {
  147. if(res.code == 200){
  148. this.queryParams.pageNo = 1
  149. this.getList(res => {
  150. this.list = res.result.records
  151. })
  152. uni.showToast({
  153. title: res.message
  154. })
  155. }
  156. })
  157. },
  158. getList(fn){
  159. this.$api('indexGetGetWorkPage', {
  160. ...this.queryParams
  161. }, res => {
  162. uni.stopPullDownRefresh()
  163. if(res.code == 200){
  164. fn && fn(res)
  165. this.total = res.result.total
  166. }
  167. })
  168. },
  169. toUrl(item){
  170. this.$utils.navigateTo
  171. ('/pages_mine/publish/worksDetail?id=' + item.id)
  172. },
  173. }
  174. }
  175. </script>
  176. <style scoped lang="scss">
  177. .competition{
  178. position: relative;
  179. // background: linear-gradient(#cfd4ff, #f7f7f7);
  180. .top{
  181. width: 100%;
  182. height: 400rpx;
  183. display: flex;
  184. box-sizing: border-box;
  185. padding: 0 30rpx;
  186. justify-content: space-between;
  187. .left{
  188. padding-top: 40rpx;
  189. font-size: 28rpx;
  190. .title{
  191. font-size: 50rpx;
  192. font-weight: 900;
  193. color: #5a24f3;
  194. padding-bottom: 20rpx;
  195. }
  196. }
  197. .right{
  198. image{
  199. width: 300rpx;
  200. height: 300rpx;
  201. margin-top: -50rpx;
  202. }
  203. }
  204. }
  205. .box{
  206. background-color: #fff;
  207. min-height: 100rpx;
  208. margin: 0 30rpx;
  209. margin-top: -150rpx;
  210. border-radius: 20rpx;
  211. .head,
  212. .item{
  213. display: flex;
  214. padding: 20rpx 10rpx;
  215. .content{
  216. flex: 1;
  217. }
  218. .give-like,
  219. .ranking{
  220. width: 120rpx;
  221. display: flex;
  222. justify-content: center;
  223. align-items: center;
  224. flex-direction: column;
  225. }
  226. }
  227. .head{
  228. font-size: 28rpx;
  229. color: #999;
  230. }
  231. .empty{
  232. display: flex;
  233. flex-direction: column;
  234. justify-content: center;
  235. align-items: center;
  236. padding: 100rpx 0;
  237. color: #999;
  238. }
  239. .list{
  240. padding-bottom: 180rpx;
  241. .item{
  242. font-size: 20rpx;
  243. &:nth-child(1){
  244. .ranking{
  245. color: red;
  246. }
  247. }
  248. &:nth-child(2){
  249. .ranking{
  250. color: #FFA200;
  251. }
  252. }
  253. &:nth-child(3){
  254. .ranking{
  255. color: #4739EA;
  256. }
  257. }
  258. .ranking{
  259. font-size: 40rpx;
  260. font-weight: 900;
  261. font-style: italic;
  262. }
  263. .content{
  264. display: flex;
  265. image{
  266. width: 100%;
  267. height: 100%;
  268. }
  269. .image{
  270. width: 200rpx;
  271. height: 150rpx;
  272. background-color: #999;
  273. overflow: hidden;
  274. margin-right: 20rpx;
  275. border-radius: 20rpx;
  276. flex-shrink: 0;
  277. }
  278. .text{
  279. .title{
  280. font-size: 30rpx;
  281. font-weight: 900;
  282. display: -webkit-box;
  283. -webkit-box-orient:
  284. vertical; -webkit-line-clamp: 2;
  285. overflow: hidden;
  286. height: 80rpx;
  287. }
  288. .actor{
  289. display: flex;
  290. .headImage{
  291. width: 30rpx;
  292. height: 30rpx;
  293. overflow: hidden;
  294. border-radius: 20rpx;
  295. background-color: #999;
  296. margin-right: 5rpx;
  297. }
  298. .username{
  299. overflow: hidden;
  300. text-overflow:ellipsis;
  301. white-space: nowrap;
  302. width: 180rpx;
  303. }
  304. }
  305. .createTime{
  306. overflow: hidden;
  307. text-overflow:ellipsis;
  308. white-space: nowrap;
  309. width: 220rpx;
  310. margin-top: 10rpx;
  311. }
  312. }
  313. }
  314. .give-like{
  315. display: flex;
  316. flex-direction: column;
  317. justify-content: center;
  318. align-items: center;
  319. .num{
  320. display: flex;
  321. }
  322. .btn{
  323. border: 1px solid #4739EA;
  324. margin-top: 10rpx;
  325. padding: 8rpx 16rpx;
  326. border-radius: 15rpx;
  327. color: #4739EA;
  328. &.a{
  329. color: #999;
  330. border: 1px solid #999;
  331. }
  332. }
  333. }
  334. }
  335. }
  336. }
  337. .submit{
  338. position: fixed;
  339. bottom: 0;
  340. left: 0;
  341. margin: 0 50rpx;
  342. margin-bottom: 50rpx;
  343. background: $uni-linear-gradient-btn-color;
  344. color: #fff;
  345. width: 650rpx;
  346. height: 80rpx;
  347. display: flex;
  348. justify-content: center;
  349. align-items: center;
  350. font-size: 28rpx;
  351. border-radius: 20rpx;
  352. }
  353. }
  354. </style>