鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
4.4 KiB

  1. <template>
  2. <view class="page__view highlight">
  3. <!-- 搜索栏 -->
  4. <view :class="['flex', 'search', isFocusSearch ? 'is-focus' : '']" >
  5. <uv-search
  6. v-model="keyword"
  7. placeholder="请输入"
  8. color="#181818"
  9. bgColor="transparent"
  10. :showAction="isFocusSearch"
  11. @custom="search"
  12. @search="search"
  13. @focus="isFocusSearch = true"
  14. @blur="isFocusSearch = false"
  15. >
  16. <template #prefix>
  17. <image class="search-icon" src="@/static/image/icon-search-dark.png" mode="widthFix"></image>
  18. </template>
  19. </uv-search>
  20. </view>
  21. <view class="archives">
  22. <userCard @switchMember="jumpToChooseMember" @addRecord="onAdd"></userCard>
  23. </view>
  24. <view class="list" v-if="memberInfo">
  25. <recordsView :list="list"></recordsView>
  26. </view>
  27. <view class="flex" v-else>
  28. <button class="btn btn-choose" @click="jumpToChooseMember">请先选择人员</button>
  29. </view>
  30. <record-form-popup ref="recordFormPopup" @submitted="getData"></record-form-popup>
  31. <tabber select="growing" />
  32. </view>
  33. </template>
  34. <script>
  35. import { mapState } from 'vuex'
  36. import mixinsList from '@/mixins/list.js'
  37. import tabber from '@/components/base/tabbar.vue'
  38. import userCard from '@/components/growing/userCard.vue'
  39. import recordsView from '@/components/growing/recordsView.vue'
  40. import recordFormPopup from '@/pages_order/comment/recordFormPopup.vue'
  41. export default {
  42. mixins: [mixinsList],
  43. components: {
  44. userCard,
  45. recordsView,
  46. recordFormPopup,
  47. tabber,
  48. },
  49. data() {
  50. return {
  51. keyword: '',
  52. isFocusSearch: false,
  53. // todo
  54. mixinsListApi: '',
  55. }
  56. },
  57. computed: {
  58. ...mapState(['memberInfo']),
  59. },
  60. methods: {
  61. // todo: delete
  62. getData() {
  63. this.list = [
  64. {
  65. id: '001',
  66. name: '新疆天山行7/9日丨醉美伊犁&吐鲁番双套餐',
  67. image: [
  68. '/static/image/temp-38.png',
  69. '/static/image/temp-39.png',
  70. '/static/image/temp-40.png',
  71. ],
  72. createTime: '2025-07-12',
  73. },
  74. {
  75. id: '002',
  76. name: '仙踪新昌·韩妃江古道|邂逅“江南小桂林”',
  77. image: [
  78. '/static/image/temp-41.png',
  79. '/static/image/temp-42.png',
  80. '/static/image/temp-43.png',
  81. ],
  82. createTime: '2025-06-18',
  83. },
  84. {
  85. id: '003',
  86. name: '山水石窟·大佛寺|江南佛窟造像,新昌山水轻徒',
  87. image: [
  88. '/static/image/temp-44.png',
  89. '/static/image/temp-45.png',
  90. '/static/image/temp-46.png',
  91. ],
  92. createTime: '2025-06-15',
  93. },
  94. ]
  95. },
  96. search() {
  97. console.log('search', this.keyword)
  98. uni.navigateTo({
  99. url: '/pages_order/growing/activity/search?search=' + this.keyword
  100. })
  101. // this.keyword = ''
  102. },
  103. onAdd() {
  104. this.$refs.recordFormPopup.open()
  105. },
  106. jumpToChooseMember() {
  107. uni.navigateTo({
  108. url: `/pages_order/member/switch`
  109. })
  110. },
  111. },
  112. }
  113. </script>
  114. <style scoped lang="scss">
  115. .page__view {
  116. /deep/ .tabbar-box {
  117. .tabbar {
  118. z-index: 10000;
  119. }
  120. }
  121. }
  122. .search {
  123. $w: 474rpx;
  124. $h: 64rpx;
  125. $radius: 32rpx;
  126. $borderWidth: 4rpx;
  127. width: $w;
  128. height: $h;
  129. position: relative;
  130. padding: 94rpx 32rpx 6rpx 32rpx;
  131. border-radius: $radius;
  132. &-icon {
  133. margin: 0 13rpx 0 26rpx;
  134. width: 30rpx;
  135. height: auto;
  136. }
  137. /deep/ .uv-search__content {
  138. padding: 12rpx 0;
  139. border: 4rpx solid transparent;
  140. }
  141. /deep/ .uv-search__content {
  142. background: #FFFFFF !important;
  143. border-color: #CFEFFF !important;
  144. }
  145. &.is-focus {
  146. /deep/ .uv-search__action {
  147. padding: 19rpx 24rpx;
  148. font-size: 26rpx;
  149. font-weight: 500;
  150. line-height: 1;
  151. color: #FFFFFF;
  152. background: #00A9FF;
  153. border-radius: 32rpx;
  154. }
  155. }
  156. }
  157. .archives {
  158. padding: 32rpx 40rpx 16rpx 40rpx;
  159. }
  160. .btn-choose {
  161. margin-top: 84rpx;
  162. padding: 14rpx 125rpx;
  163. font-size: 36rpx;
  164. font-weight: 500;
  165. line-height: 1.4;
  166. color: #FFFFFF;
  167. background: linear-gradient(to right, #21FEEC, #019AF9);
  168. border: 2rpx solid #00A9FF;
  169. border-radius: 41rpx;
  170. }
  171. </style>