practice.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="common_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px', 'padding-bottom':pb+'rpx'}">
  3. <cus-header title="申领社会实践记录" bgColor="#FFFFFF"></cus-header>
  4. <div class="tab adf">
  5. <div class="tab-pre adfacjc" :class="{'active':tidx===1}" @tap="changeTab(1)">可申领</div>
  6. <div class="tab-pre adfacjc" :class="{'active':tidx===2}" @tap="changeTab(2)">已申领</div>
  7. </div>
  8. <div class="member">
  9. <scroll-view class="scroll-view_H" scroll-x="true" scroll-with-animation="true" :scroll-left="scrollLeft">
  10. <view class="scroll-view-item_H" :id="'svih_'+index" v-for="(item,index) in memberList" :key="index" @tap="changeMember(item,index)">
  11. <view class="cl_item" :class="{'active':midx===index}">
  12. <text>{{item.name}}</text>
  13. </view>
  14. </view>
  15. </scroll-view>
  16. </div>
  17. <template v-if="tidx===1">
  18. <div class="list">
  19. <up-list @scrolltolower="scrolltolower" style="height: 100%;">
  20. <up-list-item v-for="(item, index) in list" :key="index">
  21. <practice-box></practice-box>
  22. </up-list-item>
  23. </up-list>
  24. </div>
  25. <div class="btn">申领社会实践记录</div>
  26. </template>
  27. <template v-else-if="tidx===2">
  28. <div class="list">
  29. <up-list @scrolltolower="scrolltolower2" style="height: 100%;">
  30. <up-list-item v-for="(item, index) in yslList" :key="index">
  31. <div class="ysl-box">
  32. <div class="ysl-box-title">{{'感恩有你 温暖前行'}}</div>
  33. <div class="ysl-box-tip">申领时间:{{'2025-06-01 ~ 2025-07-01'}}</div>
  34. <div class="ysl-box-tip">申 领 人:{{'张琳琳'}}</div>
  35. <div class="ysl-box-btn">查看</div>
  36. </div>
  37. </up-list-item>
  38. </up-list>
  39. </div>
  40. </template>
  41. </view>
  42. </template>
  43. <script setup name="">
  44. import CusHeader from '@/components/CusHeader/index.vue'
  45. import PracticeBox from '@/components/pages/practiceBox/index.vue'
  46. import { ref } from 'vue'
  47. const pb = ref(184)
  48. const tidx = ref(1)
  49. const midx = ref(0)
  50. const scrollLeft = ref(0)
  51. const memberList = ref([
  52. {id:1,name:'张三'},
  53. {id:2,name:'李四'},
  54. {id:3,name:'龙傲天'}
  55. ])
  56. const list = ref([1,1,1,1,1])
  57. const yslList = ref([1,1,1])
  58. const changeTab = index => {
  59. tidx.value = index;
  60. pb.value = index===1?184:40;
  61. }
  62. const changeMember = (item,index) => {
  63. midx.value = index;
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .scroll-view_H {
  68. white-space: nowrap;
  69. width: 100%;
  70. }
  71. .scroll-view-item_H {
  72. display: inline-block;
  73. height: 100%;
  74. margin-left: 30rpx;
  75. &:first-child{
  76. margin-left: 0;
  77. }
  78. }
  79. .common_page{
  80. padding: 0;
  81. box-sizing: border-box;
  82. .tab{
  83. width: 100%;
  84. height: 102rpx;
  85. background: #FFFFFF;
  86. &-pre{
  87. width: 50%;
  88. height: 102rpx;
  89. position: relative;
  90. font-family: PingFangSC, PingFang SC;
  91. font-weight: 400;
  92. font-size: 32rpx;
  93. color: #676775;
  94. line-height: 48rpx;
  95. &.active{
  96. font-weight: bold;
  97. font-size: 36rpx;
  98. color: #252525;
  99. &::after{
  100. content: '';
  101. width: 42rpx;
  102. height: 6rpx;
  103. background: #B7F358;
  104. border-radius: 3rpx;
  105. position: absolute;
  106. left: 50%;
  107. margin-left: -21rpx;
  108. bottom: 6rpx;
  109. }
  110. }
  111. }
  112. }
  113. .member{
  114. width: 100%;
  115. height: 56rpx;
  116. padding: 0 30rpx;
  117. margin-top: 20rpx;
  118. box-sizing: border-box;
  119. .cl_item{
  120. padding: 0 26rpx;
  121. height: 56rpx;
  122. background: #FFFFFF;
  123. border-radius: 10rpx;
  124. font-family: PingFangSC, PingFang SC;
  125. font-weight: 400;
  126. font-size: 26rpx;
  127. color: #252525;
  128. line-height: 56rpx;
  129. text-align: center;
  130. &.active{
  131. background: #B7F358;
  132. }
  133. }
  134. }
  135. .list{
  136. padding: 0 24rpx;
  137. flex: 1;
  138. overflow-y: auto;
  139. margin-top: 4rpx;
  140. .ysl-box{
  141. margin-top: 20rpx;
  142. padding: 36rpx 24rpx;
  143. position: relative;
  144. background: linear-gradient(45deg, #FFFFFF 80%, #F2FFE8 100%);
  145. &-title{
  146. font-family: PingFang-SC, PingFang-SC;
  147. font-weight: bold;
  148. font-size: 32rpx;
  149. color: #151B29;
  150. line-height: 40rpx;
  151. }
  152. &-tip{
  153. font-family: PingFangSC, PingFang SC;
  154. font-weight: 400;
  155. font-size: 24rpx;
  156. color: #676775;
  157. line-height: 24rpx;
  158. margin-top: 30rpx;
  159. }
  160. &-btn{
  161. width: 118rpx;
  162. height: 64rpx;
  163. background: #B7F358;
  164. border-radius: 45rpx;
  165. font-family: PingFang-SC, PingFang-SC;
  166. font-weight: bold;
  167. font-size: 26rpx;
  168. color: #151B29;
  169. line-height: 64rpx;
  170. text-align: center;
  171. letter-spacing: 2rpx;
  172. position: absolute;
  173. right: 24rpx;
  174. bottom: 40rpx;
  175. }
  176. }
  177. }
  178. .btn{
  179. width: calc(100% - 210rpx);
  180. height: 90rpx;
  181. background: #B7F358;
  182. border-radius: 45rpx;
  183. font-family: PingFang-SC, PingFang-SC;
  184. font-weight: bold;
  185. font-size: 32rpx;
  186. color: #151B29;
  187. line-height: 90rpx;
  188. text-align: center;
  189. letter-spacing: 2rpx;
  190. position: fixed;
  191. left: 105rpx;
  192. bottom: 64rpx;
  193. }
  194. }
  195. </style>