help.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view style="position: relative;">
  3. <u-navbar title="助学活动" background="{ background: '#ffffff',opacity:0.4; }"></u-navbar>
  4. <view style="width: 100%;position: fixed;top: 0;z-index: 300;"><image src="/static/bg_help.jpg" style="width: 100%;" mode="widthFix"></image></view>
  5. <view style="padding: 20rpx;" :style="'margin-top:' + imgHeight + 'px'">
  6. <view class="activity_box" v-for="(item, index) in list" :key="index">
  7. <view class="box_title" style="display: flex;align-items: center;justify-content: space-between;">
  8. <view>{{ item.activityName }}</view>
  9. <view><u-icon name="info-circle" color="#2F4379" size="28" @click="openActivesList(item)"></u-icon></view>
  10. </view>
  11. <view @click="jumpPagesDetail(item)"><image :src="$method.splitImgHost(item.activityLogo)" style="width: 100%;height: 330rpx;"></image></view>
  12. <u-row>
  13. <u-col span="6">
  14. <view class="box_title">{{ $method.timestampToTime(item.startTime) }}至{{ $method.timestampToTime(item.endTime) }}</view>
  15. </u-col>
  16. <u-col span="6" text-align="right">
  17. <view style="padding: 8rpx;"><view class="boxbtn" :class="item.useStatus === 'yes' ? 'boxbtnYes':''" @click="uploadActives(item)">{{item.useStatus === 'no' ? '立即参加' : '已参加'}} </view></view>
  18. </u-col>
  19. </u-row>
  20. </view>
  21. </view>
  22. <u-popup v-model="show" mode="bottom" border-radius="14">
  23. <header style="text-align: center;margin-top: 10rpx;color: #2F4379;font-size: 30rpx;font-weight: bold;">参与活动课程列表</header>
  24. <view style="padding: 24rpx;">
  25. <view v-for="(item,index) in activeSList" :key="index" style="padding: 12rpx;display: flex;margin-bottom: 8rpx;border-radius: 32rpx;box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145,156,178,0.1);background-color: #fff;" @click="jumpPages(item)">
  26. <image style="width:278rpx;height:134rpx;margin-right: 23rpx;" :src="$method.splitImgHost(item.coverUrl)" mode=""></image>
  27. <view style="font-size: 30rpx;color: #2f4379;font-weight: 500;">
  28. {{item.courseName}}
  29. </view>
  30. </view>
  31. </view>
  32. </u-popup>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. list: [],
  40. imgHeight: 0,
  41. activeSList: [],
  42. show: false
  43. };
  44. },
  45. onLoad(option) {
  46. this.getAtionlist();
  47. },
  48. onShow() {
  49. let w = uni.getSystemInfoSync().windowWidth;
  50. this.imgHeight = w / (750 / 375) - 68;
  51. },
  52. methods: {
  53. getAtionlist() {
  54. this.$api.configurationlist().then(res => {
  55. this.list = res.data.rows;
  56. });
  57. },
  58. uploadActives(item) {
  59. if(item.useStatus === "yes"){
  60. uni.showToast({
  61. title:'已参加过该活动',
  62. icon:'none'
  63. })
  64. return
  65. }
  66. this.$api.configurationreceive({configurationId:item.id}).then(res => {
  67. if(res.data.code === 200){
  68. uni.showToast({
  69. title:'参加成功',
  70. icon:'success'
  71. })
  72. this.getAtionlist();
  73. }
  74. })
  75. },
  76. openActivesList(option) {
  77. console.log(option)
  78. this.activeSList = option.courseList
  79. this.show = true
  80. },
  81. jumpPages(option){
  82. this.$navTo.togo('/pages2/course/detail', {
  83. id: option.courseId
  84. });
  85. return;
  86. },
  87. jumpPagesDetail(option){
  88. this.$navTo.togo('/pages2/wd/helpDetail', {
  89. id: option.id
  90. });
  91. return;
  92. },
  93. }
  94. };
  95. </script>
  96. <style>
  97. .u-border-bottom:after,
  98. .u-border-left:after,
  99. .u-border-right:after,
  100. .u-border-top-bottom:after,
  101. .u-border-top:after,
  102. .u-border:after {
  103. border: none !important;
  104. }
  105. </style>
  106. <style scope>
  107. .boxbtn {
  108. width: 132rpx;
  109. height: 40rpx;
  110. background: rgba(249, 96, 10, 0.6);
  111. border-radius: 20rpx;
  112. font-size: 24rpx;
  113. color: #ffffff;
  114. float: right;
  115. text-align: center;
  116. line-height: 40rpx;
  117. }
  118. .boxbtnYes{
  119. background-color: #eee!important;
  120. color: #838383!important;
  121. }
  122. .box_title {
  123. font-size: 24rpx;
  124. font-family: PingFang SC;
  125. font-weight: 500;
  126. color: #2f4379;
  127. padding: 15rpx;
  128. }
  129. .activity_box {
  130. width: 100%;
  131. height: 466rpx;
  132. background: #ffffff;
  133. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  134. border-radius: 32rpx;
  135. position: relative;
  136. margin-bottom: 20rpx;
  137. }
  138. page {
  139. background: #ffffff;
  140. }
  141. </style>