card1.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="">
  3. <view class="ads">
  4. <image
  5. src="https://music.nanyue6688.com/obsfile/e47815d1738640a09655b12efa4f59a9-%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210705182001.png">
  6. </image>
  7. </view>
  8. <view class="">
  9. <view v-for="(item, index) in activityList" :key="index" class="container" @click="navWithParm(item.id)">
  10. <view class="flex align-center">
  11. <view style="margin: 30upx 0 10upx 20upx;">
  12. <image :src="item.cover" style="width: 234upx;height: 188upx;border-radius: 16upx;"></image>
  13. </view>
  14. <view class="padding-lr-sm">
  15. <view class="flex">
  16. <view style="width: 80%">
  17. <view class="text-lg text-bold">{{item.name}}</view>
  18. <view class="text-sm margin-tb-xs">{{item.beginTime.split(' ')[0]}} -
  19. {{item.endTime.split(' ')[0]}}
  20. </view>
  21. <view class="text-sm text-cut-2" style="width: 330upx;height: 70upx;">
  22. {{item.description}}
  23. </view>
  24. </view>
  25. <view style="margin-top: 10upx;" v-if="item.activityStatus == 0">
  26. <image src="/static/icon/ing.png" style="width: 85upx;height: 73upx;"></image>
  27. </view>
  28. <view style="margin-top: 10upx;" v-if="item.activityStatus == 1">
  29. <image src="/static/icon/ing.png" style="width: 100upx;height: 86upx;"></image>
  30. </view>
  31. <view style="margin-top: 10upx;" v-if="item.activityStatus == 2">
  32. <image src="/static/icon/finish.png" style="width: 100upx;height: 86upx;"></image>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="flex justify-end padding-right-sm">
  38. <block v-for="(item, index) in item.tags.split(',')" :key="index">
  39. <view class="tag">{{item}}</view>
  40. </block>
  41. </view>
  42. <view class="flex align-center justify-end text-sm" style="padding: 20upx 30upx 30upx ;">
  43. <text class="cuIcon-hotfill text-orange"></text>
  44. <view class="padding-left-xs">已有{{item.applyNum}}人报名</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. activityList: [],
  55. }
  56. },
  57. created() {
  58. this.getActivityList()
  59. },
  60. methods: {
  61. getActivityList() {
  62. this.$api.activity.yyzs_list().then(res => {
  63. this.activityList = res.data.records
  64. })
  65. },
  66. navWithParm(id) {
  67. let url = 'https://music.nanyue6688.com/vote-h5/#/pages/index/guide?id=' + id
  68. uni.reLaunch({
  69. url: "/pages/webview/webview?url=" + url
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .ads {
  77. margin: 20rpx;
  78. image {
  79. width: 100%;
  80. height: 360rpx;
  81. border-radius: 20rpx;
  82. }
  83. }
  84. .container {
  85. margin: 20upx;
  86. background-color: #FFFFFF;
  87. border-radius: 20upx;
  88. }
  89. </style>