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

570 lines
14 KiB

1 week ago
  1. <template>
  2. <view class="container">
  3. <!-- 顶部绿色区域包含用户信息和旧衣兑换现金 -->
  4. <view class="top-section">
  5. <!-- 顶部用户信息 -->
  6. <view class="user-header">
  7. <view class="user-info">
  8. <image class="avatar" :src="userInfo.avatar || '/static/images/avatar.png'" mode="aspectFill"></image>
  9. <text class="username">{{ userInfo.nickname || '未登录' }}</text>
  10. <view class="role-tag">
  11. <text>{{ userInfo.role === 'admin' ? '超级管理员' : '普通用户' }}</text>
  12. </view>
  13. </view>
  14. <view class="header-right">
  15. <uni-icons type="more-filled" size="24" color="#fff"></uni-icons>
  16. <uni-icons type="circle" size="24" color="#fff"></uni-icons>
  17. </view>
  18. </view>
  19. <!-- 旧衣换现金banner -->
  20. <view class="exchange-banner">
  21. <view class="banner-text">
  22. <text class="title">旧衣换现金</text>
  23. <text class="subtitle">旧衣有"金"绿色暖生活</text>
  24. </view>
  25. <image class="banner-image" src="/static/images/recycle.png" mode="aspectFit"></image>
  26. </view>
  27. </view>
  28. <!-- 下半部分内容区域 -->
  29. <view class="content-section">
  30. <!-- 管理模块 -->
  31. <view class="management-grid">
  32. <view class="grid-item">
  33. <view class="icon-badge">
  34. <uni-icons type="person" size="24" color="#8B5CF6"></uni-icons>
  35. <text class="badge">2</text>
  36. </view>
  37. <text>用户管理</text>
  38. </view>
  39. <view class="grid-item">
  40. <view class="icon-badge">
  41. <uni-icons type="list" size="24" color="#3B82F6"></uni-icons>
  42. <text class="badge">99+</text>
  43. </view>
  44. <text>订单管理</text>
  45. </view>
  46. <view class="grid-item">
  47. <view class="icon-badge">
  48. <uni-icons type="staff" size="24" color="#10B981"></uni-icons>
  49. </view>
  50. <text>员工管理</text>
  51. </view>
  52. </view>
  53. <!-- 订单管理 -->
  54. <view class="section-card">
  55. <view class="section-header">
  56. <text class="title">订单管理</text>
  57. <view class="view-all">
  58. <text>全部</text>
  59. <uni-icons type="right" size="14" color="#999"></uni-icons>
  60. </view>
  61. </view>
  62. <view class="order-card">
  63. <view class="order-info">
  64. <text class="order-id">{{orderInfo.orderId}}</text>
  65. <view class="info-item">
  66. <text class="label">用户名称</text>
  67. <text class="value">{{orderInfo.customerName}}</text>
  68. </view>
  69. <view class="info-item">
  70. <text class="label">电话</text>
  71. <text class="value">{{orderInfo.phone}}</text>
  72. </view>
  73. <view class="info-item">
  74. <text class="label">预约时间</text>
  75. <text class="value">{{orderInfo.appointmentTime}}</text>
  76. </view>
  77. </view>
  78. <view class="order-actions">
  79. <view class="action-btn">
  80. <uni-icons type="undo" size="20" color="#666"></uni-icons>
  81. <text>驳回</text>
  82. </view>
  83. <view class="action-btn">
  84. <uni-icons type="person" size="20" color="#666"></uni-icons>
  85. <text>审批</text>
  86. </view>
  87. </view>
  88. <text class="status-tag">{{orderInfo.status}}</text>
  89. </view>
  90. </view>
  91. <!-- 用户管理 -->
  92. <view class="section-card">
  93. <view class="section-header">
  94. <text class="title">用户管理</text>
  95. <view class="view-all">
  96. <text>全部</text>
  97. <uni-icons type="right" size="14" color="#999"></uni-icons>
  98. </view>
  99. </view>
  100. <view class="user-card">
  101. <view class="user-info">
  102. <text class="title">{{promoterApplication.name}} 的推广官申请</text>
  103. <text class="time">{{promoterApplication.time}}</text>
  104. <view class="info-list">
  105. <view class="info-item">
  106. <text class="label">电话</text>
  107. <text class="value">{{promoterApplication.phone}}</text>
  108. </view>
  109. <view class="info-item">
  110. <text class="label">职业</text>
  111. <text class="value">{{promoterApplication.occupation}}</text>
  112. </view>
  113. <view class="info-item">
  114. <text class="label">年龄</text>
  115. <text class="value">{{promoterApplication.age}}</text>
  116. </view>
  117. <view class="info-item">
  118. <text class="label">每日可花推广时间</text>
  119. <text class="value">{{promoterApplication.dailyPromotionHours}}小时</text>
  120. </view>
  121. </view>
  122. </view>
  123. <text class="status-tag">{{promoterApplication.status}}</text>
  124. </view>
  125. </view>
  126. <!-- 员工管理 -->
  127. <view class="section-card">
  128. <view class="section-header">
  129. <text class="title">员工管理</text>
  130. <view class="view-all">
  131. <text>全部</text>
  132. <uni-icons type="right" size="14" color="#999"></uni-icons>
  133. </view>
  134. </view>
  135. <view class="staff-table">
  136. <view class="table-header">
  137. <text class="col-rank">排名</text>
  138. <text class="col-name">姓名</text>
  139. <text class="col-orders">处理订单</text>
  140. <text class="col-promoters">推广人数</text>
  141. </view>
  142. <view
  143. class="table-row"
  144. v-for="(item, index) in staffList"
  145. :key="index"
  146. >
  147. <text class="col-rank" :class="'rank-' + (index + 1)">{{index + 1}}</text>
  148. <text class="col-name">{{item.name}}</text>
  149. <text class="col-orders">{{item.orders}}</text>
  150. <text class="col-promoters">{{item.promoters}}</text>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. <uv-tabbar
  156. :value="value"
  157. :fixed="true"
  158. @change="changeTo"
  159. >
  160. <uv-tabbar-item text="首页" icon="home"></uv-tabbar-item>
  161. <uv-tabbar-item text="角色管理" icon="photo"></uv-tabbar-item>
  162. <uv-tabbar-item text="个人中心" icon="account"></uv-tabbar-item>
  163. </uv-tabbar>
  164. </view>
  165. </template>
  166. <script>
  167. // import tabBarMixin from '../mixins/tabBarMixin.js'
  168. // import {adminList} from '../mixins/list.js'
  169. export default {
  170. // mixins: [tabBarMixin],
  171. data() {
  172. return {
  173. value : 0,
  174. userInfo: {
  175. nickname: '郑婷雅',
  176. role: 'admin',
  177. avatar: '/static/images/avatar.png'
  178. },
  179. orderInfo: {
  180. orderId: 'RE827381278615226',
  181. customerName: '周小艺',
  182. phone: '138****1234',
  183. appointmentTime: '周四 11:00~13:00',
  184. status: '待质检'
  185. },
  186. promoterApplication: {
  187. name: '周小艺',
  188. time: '16:22',
  189. phone: '139****1234',
  190. occupation: '待业',
  191. age: 32,
  192. dailyPromotionHours: 6,
  193. status: '待确认'
  194. },
  195. staffList: [
  196. { name: '钱君霖', orders: 237, promoters: 236 },
  197. { name: '吴彦谋', orders: 230, promoters: 230 },
  198. { name: '周小艺', orders: 180, promoters: 180 },
  199. { name: '郑文锦', orders: 166, promoters: 166 },
  200. { name: '何炜', orders: 150, promoters: 150 }
  201. ]
  202. }
  203. },
  204. methods:{
  205. changeTo(e){
  206. this.value = e
  207. console.log(e,'111')
  208. if(e==1){
  209. uni.reLaunch({
  210. url: '/pages/component/role_management'
  211. });
  212. }else if(e == 2){
  213. uni.reLaunch({
  214. url: '/pages/component/admin_my'
  215. });
  216. }
  217. }
  218. },
  219. // onLoad() {
  220. // this.checkUserRole();
  221. // uni.hideTabBar();
  222. // },
  223. // onShow() {
  224. // this.checkUserRole();
  225. // if (this.userRole !== 'admin') {
  226. // uni.showToast({
  227. // title: '无权限访问',
  228. // icon: 'none'
  229. // });
  230. // uni.reLaunch({
  231. // url: '/pages/index/index'
  232. // });
  233. // }
  234. // }
  235. }
  236. </script>
  237. <style lang="scss">
  238. .container {
  239. min-height: 100vh;
  240. background: #f5f5f5;
  241. padding-bottom: calc(var(--window-bottom) + 100rpx);
  242. }
  243. .top-section {
  244. background: #00C853;
  245. padding: 0 0 40rpx;
  246. // border-radius: 0 0 30rpx 30rpx;
  247. position: relative;
  248. z-index: 1;
  249. box-shadow: 0 16rpx 36rpx rgba(0, 200, 83, 0.9),
  250. 0 2rpx 8rpx rgba(0, 0, 0, 0.15);
  251. .user-header {
  252. padding: 60rpx 30rpx 20rpx;
  253. display: flex;
  254. justify-content: space-between;
  255. align-items: center;
  256. .user-info {
  257. display: flex;
  258. align-items: center;
  259. .avatar {
  260. width: 80rpx;
  261. height: 80rpx;
  262. border-radius: 50%;
  263. margin-right: 20rpx;
  264. border: 2rpx solid rgba(255,255,255,0.3);
  265. }
  266. .username {
  267. color: #fff;
  268. font-size: 32rpx;
  269. margin-right: 20rpx;
  270. }
  271. .role-tag {
  272. background: rgba(255,255,255,0.2);
  273. padding: 4rpx 16rpx;
  274. border-radius: 30rpx;
  275. text {
  276. color: #fff;
  277. font-size: 24rpx;
  278. }
  279. }
  280. }
  281. .header-right {
  282. display: flex;
  283. gap: 20rpx;
  284. }
  285. }
  286. .exchange-banner {
  287. margin: 20rpx 30rpx;
  288. background: rgba(255,255,255,0.1);
  289. border-radius: 20rpx;
  290. padding: 30rpx;
  291. display: flex;
  292. justify-content: space-between;
  293. align-items: center;
  294. .banner-text {
  295. .title {
  296. color: #fff;
  297. font-size: 40rpx;
  298. font-weight: bold;
  299. margin-bottom: 10rpx;
  300. display: block;
  301. }
  302. .subtitle {
  303. color: rgba(255,255,255,0.8);
  304. font-size: 28rpx;
  305. }
  306. }
  307. .banner-image {
  308. width: 180rpx;
  309. height: 140rpx;
  310. }
  311. }
  312. }
  313. .content-section {
  314. margin-top: -20rpx;
  315. position: relative;
  316. z-index: 2;
  317. padding: 0 20rpx;
  318. .management-grid {
  319. background: #fff;
  320. border-radius: 20rpx;
  321. padding: 30rpx;
  322. display: flex;
  323. justify-content: space-around;
  324. margin-bottom: 20rpx;
  325. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.05);
  326. .grid-item {
  327. display: flex;
  328. flex-direction: column;
  329. align-items: center;
  330. gap: 10rpx;
  331. .icon-badge {
  332. position: relative;
  333. width: 80rpx;
  334. height: 80rpx;
  335. background: #f8f8f8;
  336. border-radius: 20rpx;
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. .badge {
  341. position: absolute;
  342. top: -10rpx;
  343. right: -10rpx;
  344. background: #ff4d4f;
  345. color: #fff;
  346. font-size: 20rpx;
  347. padding: 2rpx 10rpx;
  348. border-radius: 20rpx;
  349. min-width: 32rpx;
  350. text-align: center;
  351. }
  352. }
  353. text {
  354. font-size: 28rpx;
  355. color: #333;
  356. }
  357. }
  358. }
  359. }
  360. .section-card {
  361. margin: 20rpx;
  362. background: #fff;
  363. border-radius: 20rpx;
  364. padding: 30rpx;
  365. .section-header {
  366. display: flex;
  367. justify-content: space-between;
  368. align-items: center;
  369. margin-bottom: 20rpx;
  370. .title {
  371. font-family: PingFang SC;
  372. font-weight: 800;
  373. font-size: 15px;
  374. line-height: 140%;
  375. letter-spacing: 0%;
  376. text-align: center;
  377. vertical-align: middle;
  378. font-weight: 500;
  379. color: #333;
  380. }
  381. .view-all {
  382. display: flex;
  383. align-items: center;
  384. gap: 4rpx;
  385. color: #999;
  386. font-size: 28rpx;
  387. }
  388. }
  389. }
  390. .order-card {
  391. background: #fff;
  392. border-radius: 12rpx;
  393. padding: 20rpx;
  394. position: relative;
  395. border: 1px solid #f0f0f0;
  396. .order-info {
  397. .order-id {
  398. font-size: 32rpx;
  399. color: #333;
  400. margin-bottom: 10rpx;
  401. display: block;
  402. }
  403. .info-item {
  404. display: flex;
  405. align-items: center;
  406. margin-bottom: 10rpx;
  407. .label {
  408. font-size: 28rpx;
  409. color: #999;
  410. min-width: 80rpx;
  411. }
  412. .value {
  413. font-size: 28rpx;
  414. color: #333;
  415. font-weight: 500;
  416. }
  417. }
  418. }
  419. .order-actions {
  420. display: flex;
  421. justify-content: center;
  422. gap: 60rpx;
  423. margin-top: 20rpx;
  424. padding-top: 20rpx;
  425. border-top: 1px solid #f5f5f5;
  426. .action-btn {
  427. display: flex;
  428. align-items: center;
  429. flex-direction: column;
  430. gap: 10rpx;
  431. color: #666;
  432. font-size: 14rpx;
  433. }
  434. }
  435. .status-tag {
  436. position: absolute;
  437. top: 55%;
  438. right: 20rpx;
  439. color: #ff9800;
  440. font-size: 28rpx;
  441. }
  442. }
  443. .user-card {
  444. background: #fff;
  445. border-radius: 12rpx;
  446. padding: 20rpx;
  447. position: relative;
  448. border: 1px solid #f0f0f0;
  449. .user-info {
  450. .title {
  451. font-family: PingFang SC;
  452. font-weight: 400;
  453. font-size: 18px;
  454. line-height: 140%;
  455. letter-spacing: 0%;
  456. vertical-align: middle;
  457. color: #333;
  458. margin-bottom: 10rpx;
  459. display: block;
  460. padding-right: 120rpx;
  461. }
  462. .time {
  463. position: absolute;
  464. top: 20rpx;
  465. right: 20rpx;
  466. font-size: 28rpx;
  467. color: #999;
  468. }
  469. .info-list {
  470. .info-item {
  471. display: flex;
  472. align-items: center;
  473. margin-bottom: 10rpx;
  474. .label {
  475. font-size: 28rpx;
  476. color: #999;
  477. min-width: 80rpx;
  478. }
  479. .value {
  480. font-size: 28rpx;
  481. color: #333;
  482. font-weight: 500;
  483. }
  484. }
  485. }
  486. }
  487. .status-tag {
  488. position: absolute;
  489. top: 75%;
  490. right: 20rpx;
  491. color: #ff9800;
  492. font-size: 28rpx;
  493. }
  494. }
  495. .staff-table {
  496. background: #fff;
  497. border-radius: 12rpx;
  498. padding: 20rpx;
  499. border: 1px solid #f0f0f0;
  500. .table-header, .table-row {
  501. display: flex;
  502. padding: 20rpx;
  503. font-size: 28rpx;
  504. .col-rank { width: 15%; }
  505. .col-name { width: 25%; }
  506. .col-orders { width: 30%; }
  507. .col-promoters { width: 30%; }
  508. }
  509. .table-header {
  510. color: #999;
  511. border-bottom: 1px solid #f5f5f5;
  512. }
  513. .table-row {
  514. color: #333;
  515. .rank-1 { color: #f5222d; }
  516. .rank-2 { color: #fa8c16; }
  517. .rank-3 { color: #52c41a; }
  518. }
  519. }
  520. </style>