爱简收旧衣按件回收前端代码仓库
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.

206 lines
4.6 KiB

1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
  1. <template>
  2. <view class="staff-detail-container">
  3. <!-- 顶部导航栏 -->
  4. <view class="navbar" :style="navbarStyle">
  5. <view class="nav-left" @tap="goBack">
  6. <uni-icons type="back" size="24" color="#222" />
  7. </view>
  8. <view class="nav-title">员工管理详情</view>
  9. <view class="nav-right">
  10. <!-- <uni-icons type="more-filled" size="24" color="#222" style="margin-right: 16rpx;" />
  11. <uni-icons type="scan" size="24" color="#222" /> -->
  12. </view>
  13. </view>
  14. <view class="main-content">
  15. <view class="info-card">
  16. <view class="card-title">个人信息</view>
  17. <view class="info-row">
  18. <text class="label">姓名</text>
  19. <text class="value">{{ staff.name }}</text>
  20. </view>
  21. <view class="divider"></view>
  22. <view class="info-row">
  23. <text class="label">电话</text>
  24. <text class="value">{{ staff.phone }}</text>
  25. </view>
  26. <view class="divider"></view>
  27. <view class="info-row">
  28. <text class="label">角色</text>
  29. <text class="value">{{ staff.role }}</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="bottom-bar">
  34. <button class="action-btn danger" @tap="removeStaff">解除员工</button>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import pullRefreshMixin from '../mixins/pullRefreshMixin.js'
  40. export default {
  41. mixins: [pullRefreshMixin],
  42. data() {
  43. return {
  44. staff: {
  45. name: '冯启彬',
  46. phone: '18899102278',
  47. role: '质检员',
  48. },
  49. statusBarHeight: 0,
  50. }
  51. },
  52. computed: {
  53. navbarStyle() {
  54. return `padding-top: ${this.statusBarHeight}px;`;
  55. }
  56. },
  57. onLoad(options) {
  58. uni.getSystemInfo({
  59. success: (res) => {
  60. this.statusBarHeight = res.statusBarHeight || 20;
  61. }
  62. });
  63. // eventChannel 传递员工信息
  64. const eventChannel = this.getOpenerEventChannel && this.getOpenerEventChannel();
  65. if (eventChannel) {
  66. eventChannel.on('staffDetail', (staff) => {
  67. this.staff = Object.assign({}, this.staff, staff);
  68. });
  69. }
  70. },
  71. methods: {
  72. goBack() {
  73. uni.navigateBack();
  74. },
  75. removeStaff() {
  76. uni.showToast({ title: '已解除员工', icon: 'none' });
  77. },
  78. refreshData() {
  79. // TODO: 实现员工详情刷新逻辑,如重新请求接口
  80. },
  81. async onRefresh() {
  82. await this.refreshData && this.refreshData()
  83. }
  84. },
  85. onPullDownRefresh() {
  86. this.refreshData && this.refreshData()
  87. uni.stopPullDownRefresh()
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .staff-detail-container {
  93. min-height: 100vh;
  94. background: #f7f7f7;
  95. padding-bottom: 160rpx;
  96. }
  97. .navbar {
  98. position: fixed;
  99. top: 0;
  100. left: 0;
  101. width: 100vw;
  102. height: 100rpx;
  103. background: #fff;
  104. z-index: 10;
  105. display: flex;
  106. align-items: flex-end;
  107. justify-content: space-between;
  108. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  109. padding: 0 32rpx;
  110. .nav-left {
  111. flex: 0 0 48rpx;
  112. display: flex;
  113. align-items: center;
  114. height: 100%;
  115. }
  116. .nav-title {
  117. flex: 1;
  118. text-align: center;
  119. font-size: 36rpx;
  120. font-weight: bold;
  121. color: #222;
  122. line-height: 100rpx;
  123. }
  124. .nav-right {
  125. flex: 0 0 80rpx;
  126. display: flex;
  127. align-items: center;
  128. justify-content: flex-end;
  129. height: 100%;
  130. }
  131. }
  132. .main-content {
  133. margin-top: 120rpx;
  134. margin-bottom: 40rpx;
  135. }
  136. .info-card {
  137. background: #fff;
  138. border-radius: 40rpx;
  139. margin: 0 32rpx 32rpx 32rpx;
  140. padding: 40rpx 36rpx 36rpx 36rpx;
  141. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  142. }
  143. .card-title {
  144. font-size: 32rpx;
  145. font-weight: bold;
  146. color: #222;
  147. margin-bottom: 32rpx;
  148. }
  149. .info-row {
  150. display: flex;
  151. align-items: center;
  152. min-height: 60rpx;
  153. margin-bottom: 0;
  154. .label {
  155. font-size: 26rpx;
  156. color: #b3b3b3;
  157. width: 110rpx;
  158. font-weight: 400;
  159. }
  160. .value {
  161. font-size: 30rpx;
  162. color: #222;
  163. font-weight: 500;
  164. flex: 1;
  165. word-break: break-all;
  166. }
  167. }
  168. .divider {
  169. height: 2rpx;
  170. background: #f3f3f3;
  171. margin: 18rpx 0 18rpx 0;
  172. border: none;
  173. }
  174. .bottom-bar {
  175. position: fixed;
  176. left: 0;
  177. right: 0;
  178. bottom: 0;
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. background: #f7f7f7;
  183. padding-bottom: env(safe-area-inset-bottom);
  184. padding-top: 24rpx;
  185. padding-bottom: 24rpx;
  186. z-index: 20;
  187. }
  188. .action-btn {
  189. flex: 1;
  190. margin: 0 32rpx;
  191. height: 80rpx;
  192. border-radius: 40rpx;
  193. font-size: 30rpx;
  194. font-weight: 500;
  195. border: 2rpx solid #ffd36d;
  196. background: #fffbe6;
  197. color: #ffb800;
  198. box-shadow: 0 2rpx 8rpx rgba(255, 156, 0, 0.03);
  199. }
  200. .action-btn.danger {
  201. color: #ffb800;
  202. border: 2rpx solid #ffd36d;
  203. background: #fffbe6;
  204. }
  205. </style>