鸿宇研学生前端代码
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.

184 lines
4.3 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. '/pages_order/static/temp-38.png',
  69. '/pages_order/static/temp-38.png',
  70. '/pages_order/static/temp-38.png',
  71. ],
  72. createTime: '2025-07-12',
  73. },
  74. {
  75. id: '002',
  76. name: '仙踪新昌·韩妃江古道|邂逅“江南小桂林”',
  77. image: [
  78. '/pages_order/static/temp-38.png',
  79. '/pages_order/static/temp-38.png',
  80. '/pages_order/static/temp-38.png',
  81. ],
  82. createTime: '2025-06-18',
  83. },
  84. {
  85. id: '003',
  86. name: '山水石窟·大佛寺|江南佛窟造像,新昌山水轻徒',
  87. image: [
  88. '/pages_order/static/temp-38.png',
  89. '/pages_order/static/temp-38.png',
  90. '/pages_order/static/temp-38.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. .search {
  116. $w: 474rpx;
  117. $h: 64rpx;
  118. $radius: 32rpx;
  119. $borderWidth: 4rpx;
  120. width: $w;
  121. height: $h;
  122. position: relative;
  123. padding: 94rpx 32rpx 6rpx 32rpx;
  124. border-radius: $radius;
  125. &-icon {
  126. margin: 0 13rpx 0 26rpx;
  127. width: 30rpx;
  128. height: auto;
  129. }
  130. /deep/ .uv-search__content {
  131. padding: 12rpx 0;
  132. border: 4rpx solid transparent;
  133. }
  134. /deep/ .uv-search__content {
  135. background: #FFFFFF !important;
  136. border-color: #CFEFFF !important;
  137. }
  138. &.is-focus {
  139. /deep/ .uv-search__action {
  140. padding: 19rpx 24rpx;
  141. font-size: 26rpx;
  142. font-weight: 500;
  143. line-height: 1;
  144. color: #FFFFFF;
  145. background: #00A9FF;
  146. border-radius: 32rpx;
  147. }
  148. }
  149. }
  150. .archives {
  151. padding: 32rpx 40rpx 16rpx 40rpx;
  152. }
  153. .btn-choose {
  154. margin-top: 84rpx;
  155. padding: 14rpx 125rpx;
  156. font-size: 36rpx;
  157. font-weight: 500;
  158. line-height: 1.4;
  159. color: #FFFFFF;
  160. background: linear-gradient(to right, #21FEEC, #019AF9);
  161. border: 2rpx solid #00A9FF;
  162. border-radius: 41rpx;
  163. }
  164. </style>