list.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="page-no-tab">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="我的申请"
  8. background-color="#157A2C"
  9. color="#fff"
  10. @clickLeft="goBack"
  11. ></uni-nav-bar>
  12. <view class="search-bar">
  13. <input
  14. ref="keywordInput"
  15. class="search-input"
  16. v-model="keyword"
  17. confirm-type="search"
  18. placeholder="搜索申请编号 / 标题"
  19. @confirm="onKeywordConfirm"
  20. />
  21. <text class="search-btn press" @click="onKeywordConfirm">搜索</text>
  22. </view>
  23. <view class="tabs">
  24. <view
  25. v-for="(t, index) in tabs"
  26. :key="t.value"
  27. class="tab press"
  28. :class="{ active: tabIndex === index }"
  29. @click="onTabChange(index)"
  30. >{{ t.label }}</view>
  31. </view>
  32. <view class="filter">
  33. <!-- 类型筛选:胶囊 + u-icon 箭头(原来的「⌄」字符基线不齐,看着是错位的) -->
  34. <view
  35. class="type-filter press"
  36. :class="{ 'is-active': !!typeFilter }"
  37. @click="chooseType"
  38. >
  39. <text class="type-filter-label">{{ typeFilterLabel }}</text>
  40. <u-icon name="arrow-down" :size="11" :color="typeFilter ? '#157a2c' : '#6f7782'" />
  41. </view>
  42. <text class="filter-tip">共 {{ total }} 条</text>
  43. </view>
  44. <view v-if="loading" class="empty"><view>◌</view><text>加载中…</text></view>
  45. <view v-else-if="list.length" class="list">
  46. <!-- 卡片模板抽到 components/hr/ApplyCard.vue(与「申请记录」共用) -->
  47. <apply-card
  48. v-for="item in list"
  49. :key="item.id"
  50. :row="item"
  51. :admin="adminMode"
  52. @detail="openItem(item)"
  53. @flow="openFlow(item)"
  54. />
  55. <view v-if="hasMore" class="load-more press" @click="loadList(false)">
  56. {{ loadingMore ? "加载中…" : "加载更多" }}
  57. </view>
  58. <view v-else class="load-more muted">没有更多了</view>
  59. </view>
  60. <view v-else class="empty"><view>□</view><text>{{ emptyText }}</text></view>
  61. <!-- 类型筛选:与其它选择器同款的底部滚轮 -->
  62. <u-picker
  63. :show="typePickerShow"
  64. :columns="[typePickerColumns]"
  65. title="申请类型"
  66. :item-height="56"
  67. :visible-item-count="5"
  68. confirm-color="#157a2c"
  69. cancel-color="#7d8794"
  70. @confirm="onTypeConfirm"
  71. @cancel="typePickerShow = false"
  72. @close="typePickerShow = false"
  73. ></u-picker>
  74. </view>
  75. </template>
  76. <script>
  77. import { applicationListMixin } from "@/utils/hr/application-list";
  78. import { back } from "@/utils/hr/router";
  79. import ApplyCard from "@/components/hr/ApplyCard.vue";
  80. export default {
  81. components: { ApplyCard },
  82. mixins: [applicationListMixin],
  83. data() {
  84. return {
  85. adminMode: false,
  86. };
  87. },
  88. onLoad() {
  89. this.loadList(true);
  90. },
  91. methods: {
  92. goBack() {
  93. back("/pages/index/index");
  94. },
  95. },
  96. };
  97. </script>
  98. <style scoped lang="scss">
  99. @import "@/pages/hr/common-style.scss";
  100. .search-bar {
  101. display: flex;
  102. align-items: center;
  103. padding: 18rpx 24rpx;
  104. background: #fff;
  105. }
  106. .search-input {
  107. flex: 1;
  108. height: 68rpx;
  109. padding: 0 24rpx;
  110. border-radius: 34rpx;
  111. background: #f4f6f8;
  112. font-size: 26rpx;
  113. color: #1f2329;
  114. }
  115. .search-btn {
  116. margin-left: 18rpx;
  117. font-size: 27rpx;
  118. color: #157a2c;
  119. }
  120. .tabs {
  121. height: 92rpx;
  122. display: flex;
  123. background: #fff;
  124. border-bottom: 1rpx solid #edf0f2;
  125. }
  126. .tab {
  127. position: relative;
  128. flex: 1;
  129. display: flex;
  130. align-items: center;
  131. justify-content: center;
  132. color: #6f7782;
  133. font-size: 27rpx;
  134. }
  135. .tab.active {
  136. color: #157a2c;
  137. font-weight: 500;
  138. }
  139. .tab.active:after {
  140. content: "";
  141. position: absolute;
  142. bottom: 0;
  143. width: 42rpx;
  144. height: 5rpx;
  145. border-radius: 3rpx;
  146. background: #157a2c;
  147. }
  148. .filter {
  149. height: 92rpx;
  150. padding: 0 28rpx;
  151. display: flex;
  152. align-items: center;
  153. justify-content: space-between;
  154. background: #fff;
  155. font-size: 24rpx;
  156. }
  157. /* 类型筛选:做成胶囊按钮,箭头用 u-icon(比「⌄」字符对齐稳) */
  158. .type-filter {
  159. display: flex;
  160. align-items: center;
  161. height: 58rpx;
  162. padding: 0 20rpx;
  163. border: 1rpx solid #e2e7ec;
  164. border-radius: 29rpx;
  165. background: #fff;
  166. }
  167. .type-filter-label {
  168. margin-right: 10rpx;
  169. color: #4b5563;
  170. font-size: 24rpx;
  171. }
  172. /* 已选类型时高亮,一眼看出当前有筛选 */
  173. .type-filter.is-active {
  174. border-color: #a9d5b6;
  175. background: #f2faf0;
  176. }
  177. .type-filter.is-active .type-filter-label {
  178. color: #157a2c;
  179. }
  180. .filter-tip {
  181. color: #a0a7b0;
  182. }
  183. .list {
  184. padding: 24rpx;
  185. }
  186. /* 卡片样式已移入 components/hr/ApplyCard.vue(「我的申请」与「申请记录」共用一份);
  187. 这里只保留页面级的搜索 / 筛选 / 列表容器样式 */
  188. .load-more {
  189. padding: 24rpx 0 40rpx;
  190. text-align: center;
  191. font-size: 24rpx;
  192. color: #157a2c;
  193. }
  194. .load-more.muted {
  195. color: #a0a7b0;
  196. }
  197. .empty {
  198. padding-top: 230rpx;
  199. text-align: center;
  200. color: #a0a7b0;
  201. }
  202. .empty view {
  203. font-size: 80rpx;
  204. color: #cfd4da;
  205. }
  206. .empty text {
  207. display: block;
  208. margin-top: 20rpx;
  209. }
  210. </style>