myActivities.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="myActivities">
  3. <div class="actItem" v-for="item in activityList" @click="toDetail(item)">
  4. <div class="actTop">
  5. <img :src="item.annexArray[0]" class="actImg">
  6. <div class="actRight">
  7. <span class="actTitle">{{ item.activityName }}</span>
  8. <span class="actTime2">报名时间:{{ item.startAndEndTime }}</span>
  9. <span class="actTime2">报名人数:{{item.registrationNumbers}}</span>
  10. </div>
  11. </div>
  12. <div class="actTime">
  13. <span class="time">开始时间:<span style="color: #666666">{{item.activityStartTime}}</span></span>
  14. <span :class="item.statusName==='活动结束'?'yjs':'dks'">{{item.statusName}}</span>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { getUserPower, getUserLocalStorageInfo, activityList, homeActivityClickCollect,getByCodes} from "@/js_sdk/http";
  21. export default {
  22. name: "myActivities",
  23. onShow(){
  24. },
  25. mounted(){
  26. this.getList()
  27. },
  28. data(){
  29. return{
  30. activityList:[
  31. {name:'互联网私募如何入门?',time:'2021-1-21 13:00',type:'待开始'},
  32. {name:'公募基金中的大数据挖掘',time:'2021-1-21 13:00',type:'待开始'},
  33. {name:'年度小艾杯篮球赛开始啦',time:'2021-1-21 13:00',type:'已结束'},
  34. ],
  35. search: {
  36. // companyId: getUserLocalStorageInfo().userId,
  37. pageNum: 1,
  38. pageSize: 10
  39. },
  40. }
  41. },
  42. methods:{
  43. clickColl(index) {
  44. if (this.activityList[index].collectorsStatus==='2'){
  45. this.activityList[index].collectorsStatus='1'
  46. }else{
  47. this.activityList[index].collectorsStatus='2'
  48. }
  49. homeActivityClickCollect({
  50. id: this.activityList[index].id,
  51. createdBy: getUserLocalStorageInfo().userId,
  52. collectorsStatus: this.activityList[index].collectorsStatus
  53. }).then(res => {
  54. });
  55. },
  56. getList(){
  57. this.activityList = []
  58. activityList(this.search).then(res=>{
  59. if (res.errno == 0){
  60. res.data.rows.forEach(item=>{
  61. const json = this.getItemJson(item)
  62. this.activityList.push(json)
  63. })
  64. }
  65. // console.log(res)
  66. })
  67. },
  68. getItemJson(item) {
  69. item.startAndEndTime = item.registrationStartTime + '~' + item.registrationEndTime
  70. return item
  71. },
  72. baoming(item) {
  73. if (item.statusName === '报名中') {
  74. if (getUserLocalStorageInfo().userType == 3) {
  75. uni.showModal({
  76. title: "提示",
  77. cancelText: "暂不",
  78. confirmText: "去切换",
  79. content: "您还不是企业用户,请切换登录身份后再进行相关操作。",
  80. success: function (res) {
  81. if (res.confirm) {
  82. uni.navigateTo({
  83. url: "/pages/login2/login",
  84. success: function (e) {
  85. // uni.$emit('userType', 'OK')
  86. },
  87. });
  88. } else if (res.cancel) {
  89. console.log("用户点击取消");
  90. }
  91. },
  92. });
  93. }else{
  94. console.log(2222)
  95. uni.navigateTo({
  96. url:'/pages/subPackages/parkActivity/activeApplication?activityId=' + item.id
  97. })
  98. }
  99. }
  100. },
  101. toDetail(item){
  102. uni.navigateTo({
  103. url:"/pages/subPackages/minePages/registrationDetails?activityId=" + item.id + '&url=' + item.annexArray[0],
  104. })
  105. }
  106. },
  107. }
  108. </script>
  109. <style lang="scss">
  110. .myActivities{
  111. padding: 24rpx 32rpx;
  112. .actItem{
  113. padding: 32rpx 0 22rpx 0;
  114. background: white;
  115. border-radius: 16rpx;
  116. margin-bottom: 24rpx;
  117. .actTop{
  118. display: flex;
  119. align-items: center;
  120. padding: 0 24rpx;
  121. box-sizing: border-box;
  122. .actImg{
  123. width: 200rpx;
  124. height: 144rpx;
  125. }
  126. }
  127. .actRight{
  128. display: flex;
  129. flex-direction: column;
  130. margin-left: 16rpx;
  131. .actTitle{
  132. color:#18172A;
  133. font-size: 32rpx;
  134. margin-bottom: 20rpx;
  135. width: 380rpx;
  136. overflow: hidden;
  137. text-overflow: ellipsis;
  138. white-space: nowrap;
  139. }
  140. .actTime2{
  141. font-size: 24rpx;
  142. color: #888888;
  143. margin: 4rpx 0;
  144. }
  145. }
  146. .actTime{
  147. margin-top: 24rpx;
  148. padding: 24rpx 32rpx 0 32rpx;
  149. display: flex;
  150. justify-content: space-between;
  151. border-top: 1px solid #E8EDF5;
  152. align-items: center;
  153. .time{
  154. color: #222222;
  155. font-size: 28rpx;
  156. }
  157. .yjs{
  158. background: rgba(163, 169, 177, 0.20);
  159. color: #888888;
  160. font-size: 28rpx;
  161. border-radius: 4rpx;
  162. width: 112rpx;
  163. height: 48rpx;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. }
  168. .dks{
  169. background: rgba(3, 101, 249, 0.20);
  170. color: rgba(3, 101, 249, 1);
  171. font-size: 28rpx;
  172. border-radius: 4rpx;
  173. width: 112rpx;
  174. height: 48rpx;
  175. display: flex;
  176. align-items: center;
  177. justify-content: center;
  178. }
  179. }
  180. }
  181. }
  182. </style>