practice.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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" @tap="handleDetail(item)">查看</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. const handleDetail = item => {
  66. uni.navigateTo({
  67. url:'/pagesMy/practiceRecord'
  68. })
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .scroll-view_H {
  73. white-space: nowrap;
  74. width: 100%;
  75. }
  76. .scroll-view-item_H {
  77. display: inline-block;
  78. height: 100%;
  79. margin-left: 30rpx;
  80. &:first-child{
  81. margin-left: 0;
  82. }
  83. }
  84. .common_page{
  85. padding: 0;
  86. box-sizing: border-box;
  87. .tab{
  88. width: 100%;
  89. height: 102rpx;
  90. background: #FFFFFF;
  91. &-pre{
  92. width: 50%;
  93. height: 102rpx;
  94. position: relative;
  95. font-family: PingFangSC, PingFang SC;
  96. font-weight: 400;
  97. font-size: 32rpx;
  98. color: #676775;
  99. line-height: 48rpx;
  100. &.active{
  101. font-weight: bold;
  102. font-size: 36rpx;
  103. color: #252525;
  104. &::after{
  105. content: '';
  106. width: 42rpx;
  107. height: 6rpx;
  108. background: #B7F358;
  109. border-radius: 3rpx;
  110. position: absolute;
  111. left: 50%;
  112. margin-left: -21rpx;
  113. bottom: 6rpx;
  114. }
  115. }
  116. }
  117. }
  118. .member{
  119. width: 100%;
  120. height: 56rpx;
  121. padding: 0 30rpx;
  122. margin-top: 20rpx;
  123. box-sizing: border-box;
  124. .cl_item{
  125. padding: 0 26rpx;
  126. height: 56rpx;
  127. background: #FFFFFF;
  128. border-radius: 10rpx;
  129. font-family: PingFangSC, PingFang SC;
  130. font-weight: 400;
  131. font-size: 26rpx;
  132. color: #252525;
  133. line-height: 56rpx;
  134. text-align: center;
  135. &.active{
  136. background: #B7F358;
  137. }
  138. }
  139. }
  140. .list{
  141. padding: 0 24rpx;
  142. flex: 1;
  143. overflow-y: auto;
  144. margin-top: 4rpx;
  145. .ysl-box{
  146. margin-top: 20rpx;
  147. padding: 36rpx 24rpx;
  148. position: relative;
  149. background: linear-gradient(45deg, #FFFFFF 80%, #F2FFE8 100%);
  150. &-title{
  151. font-family: PingFang-SC, PingFang-SC;
  152. font-weight: bold;
  153. font-size: 32rpx;
  154. color: #151B29;
  155. line-height: 40rpx;
  156. }
  157. &-tip{
  158. font-family: PingFangSC, PingFang SC;
  159. font-weight: 400;
  160. font-size: 24rpx;
  161. color: #676775;
  162. line-height: 24rpx;
  163. margin-top: 30rpx;
  164. }
  165. &-btn{
  166. width: 118rpx;
  167. height: 64rpx;
  168. background: #B7F358;
  169. border-radius: 45rpx;
  170. font-family: PingFang-SC, PingFang-SC;
  171. font-weight: bold;
  172. font-size: 26rpx;
  173. color: #151B29;
  174. line-height: 64rpx;
  175. text-align: center;
  176. letter-spacing: 2rpx;
  177. position: absolute;
  178. right: 24rpx;
  179. bottom: 40rpx;
  180. }
  181. }
  182. }
  183. .btn{
  184. width: calc(100% - 210rpx);
  185. height: 90rpx;
  186. background: #B7F358;
  187. border-radius: 45rpx;
  188. font-family: PingFang-SC, PingFang-SC;
  189. font-weight: bold;
  190. font-size: 32rpx;
  191. color: #151B29;
  192. line-height: 90rpx;
  193. text-align: center;
  194. letter-spacing: 2rpx;
  195. position: fixed;
  196. left: 105rpx;
  197. bottom: 64rpx;
  198. }
  199. }
  200. </style>