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

293 lines
8.5 KiB

1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
  1. <template>
  2. <view class="tui-manage-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. <!-- Tab栏 -->
  15. <view class="tab-bar-fixed" :style="{top: navBarRealHeight + 'px'}">
  16. <view class="tab-tabs">
  17. <view :class="['tab-item', {active: currentTab === 0}]" @tap="switchTab(0)">全部</view>
  18. <view :class="['tab-item', {active: currentTab === 1}]" @tap="switchTab(1)">推广官申请列表</view>
  19. </view>
  20. <uni-icons type="search" size="28" color="#222" class="tab-search" />
  21. </view>
  22. <view class="tab-content" :style="{paddingTop: (navBarRealHeight + tabBarHeight) + 'px'}">
  23. <!-- 全部 -->
  24. <view v-if="currentTab === 0">
  25. <view v-for="(item, idx) in tuiList" :key="idx" class="tui-card" @tap="goTuiDetail(item)">
  26. <view class="tui-info-row"><text class="tui-label">姓名</text><text class="tui-value">{{ item.name }}</text></view>
  27. <view class="tui-info-row"><text class="tui-label">一级推广数</text><text class="tui-value">{{ item.level1 }}</text></view>
  28. <view class="tui-info-row"><text class="tui-label">二级推广数</text><text class="tui-value">{{ item.level2 }}</text></view>
  29. <view class="tui-info-row"><text class="tui-label">回收总额</text><text class="tui-value">{{ item.totalAmount }}</text></view>
  30. <view class="tui-info-row"><text class="tui-label">佣金总额</text><text class="tui-value">{{ item.commission }}</text></view>
  31. </view>
  32. </view>
  33. <!-- 推广官申请列表 -->
  34. <view v-if="currentTab === 1">
  35. <view v-for="(item, idx) in applyList" :key="idx" class="tui-card">
  36. <view class="tui-info-row"><text class="tui-value">{{ item.name }} 的推广官申请</text></view>
  37. <view class="tui-info-row"><text class="tui-label">电话</text><text class="tui-value">{{ item.phone }}</text></view>
  38. <view class="tui-info-row"><text class="tui-label">每日可花推广时间</text><text class="tui-value">{{ item.time }}</text></view>
  39. <view class="tui-info-row"><text class="tui-label">申请时间</text><text class="tui-value">{{ item.applyTime }}</text></view>
  40. <view class="tui-status-bar">
  41. <view v-if="item.status==='待审批'" class="tui-status orange">待审批</view>
  42. <view v-else-if="item.status==='已驳回'" class="tui-status red">已驳回</view>
  43. <view v-else-if="item.status==='已确认'" class="tui-status gray">已确认</view>
  44. </view>
  45. <view class="tui-action-bar">
  46. <view class="tui-action" v-if="item.status==='待审批'"><uni-icons type="undo" size="32" color="#999" /><text>驳回</text></view>
  47. <view class="tui-action" v-if="item.status==='待审批'" @tap.stop="goApplyDetail(item)"><uni-icons type="person" size="32" color="#999" /><text>审批</text></view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import pullRefreshMixin from '../mixins/pullRefreshMixin.js'
  56. export default {
  57. mixins: [pullRefreshMixin],
  58. data() {
  59. return {
  60. currentTab: 0,
  61. tuiList: [
  62. { name: '周小艺', level1: 67, level2: 67, totalAmount: '8273.99', commission: '278.99' },
  63. { name: '李世海', level1: 67, level2: 67, totalAmount: '8273.99', commission: '278.99' },
  64. { name: '何炜', level1: 67, level2: 67, totalAmount: '8273.99', commission: '278.99' },
  65. { name: '李梓发', level1: 67, level2: 67, totalAmount: '8273.99', commission: '278.99' },
  66. ],
  67. applyList: [
  68. { name: '周小艺', phone: '18899102278', time: '6小时', applyTime: '2025-03-20 11:00', status: '待审批' },
  69. { name: '周小艺', phone: '18899102278', time: '6小时', applyTime: '2025-03-20 11:00', status: '已驳回' },
  70. { name: '周小艺', phone: '18899102278', time: '6小时', applyTime: '2025-03-20 11:00', status: '已确认' },
  71. { name: '周小艺', phone: '18899102278', time: '6小时', applyTime: '2025-03-20 11:00', status: '待审批' },
  72. ],
  73. statusBarHeight: 0,
  74. navBarRealHeight: 0,
  75. tabBarHeight: 80, // px
  76. }
  77. },
  78. computed: {
  79. navbarStyle() {
  80. return `padding-top: ${this.statusBarHeight}px;`;
  81. }
  82. },
  83. onLoad() {
  84. uni.getSystemInfo({
  85. success: (res) => {
  86. this.statusBarHeight = res.statusBarHeight || 20;
  87. }
  88. });
  89. this.$nextTick(() => {
  90. uni.createSelectorQuery().select('.navbar').boundingClientRect(rect => {
  91. if (rect) {
  92. this.navBarRealHeight = rect.height;
  93. }
  94. }).exec();
  95. });
  96. },
  97. methods: {
  98. goBack() {
  99. uni.navigateBack();
  100. },
  101. switchTab(idx) {
  102. this.currentTab = idx;
  103. },
  104. goTuiDetail(tui) {
  105. uni.navigateTo({
  106. url: '/pages/manager/tui-detail',
  107. success: (res) => {
  108. res.eventChannel.emit('tuiDetail', tui);
  109. }
  110. });
  111. },
  112. goApplyDetail(apply) {
  113. uni.navigateTo({
  114. url: '/pages/manager/tui-apply-detail',
  115. success: (res) => {
  116. res.eventChannel.emit('applyDetail', apply);
  117. }
  118. });
  119. },
  120. refreshData() {
  121. // TODO: 实现推广官列表刷新逻辑,如重新请求接口
  122. },
  123. async onRefresh() {
  124. await this.refreshData && this.refreshData()
  125. }
  126. },
  127. onPullDownRefresh() {
  128. this.refreshData && this.refreshData()
  129. uni.stopPullDownRefresh()
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .tui-manage-container {
  135. min-height: 100vh;
  136. background: #f7f7f7;
  137. padding-bottom: 40rpx;
  138. }
  139. .navbar {
  140. position: fixed;
  141. top: 0;
  142. left: 0;
  143. width: 100vw;
  144. height: 100rpx;
  145. background: #fff;
  146. z-index: 10;
  147. display: flex;
  148. align-items: flex-end;
  149. justify-content: space-between;
  150. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  151. padding: 0 32rpx;
  152. .nav-left {
  153. flex: 0 0 48rpx;
  154. display: flex;
  155. align-items: center;
  156. height: 100%;
  157. }
  158. .nav-title {
  159. flex: 1;
  160. text-align: center;
  161. font-size: 36rpx;
  162. font-weight: bold;
  163. color: #222;
  164. line-height: 100rpx;
  165. }
  166. .nav-right {
  167. flex: 0 0 80rpx;
  168. display: flex;
  169. align-items: center;
  170. justify-content: flex-end;
  171. height: 100%;
  172. }
  173. }
  174. .tab-bar-fixed {
  175. position: fixed;
  176. left: 0;
  177. width: 100vw;
  178. z-index: 20;
  179. background: #fff;
  180. display: flex;
  181. align-items: center;
  182. justify-content: space-between;
  183. height: 80rpx;
  184. border-bottom: 2rpx solid #f3f3f3;
  185. margin: 0;
  186. box-sizing: border-box;
  187. padding-left: 0;
  188. padding-right: 32rpx;
  189. }
  190. .tab-tabs {
  191. display: flex;
  192. flex: 1;
  193. height: 100%;
  194. }
  195. .tab-item {
  196. flex: 1;
  197. text-align: center;
  198. font-size: 32rpx;
  199. color: #222;
  200. font-weight: 500;
  201. position: relative;
  202. padding-bottom: 12rpx;
  203. display: flex;
  204. align-items: center;
  205. justify-content: center;
  206. }
  207. .tab-item.active {
  208. color: #ffb400;
  209. font-weight: bold;
  210. }
  211. .tab-item.active::after {
  212. content: '';
  213. display: block;
  214. width: 48rpx;
  215. height: 6rpx;
  216. border-radius: 6rpx;
  217. background: #ffb400;
  218. position: absolute;
  219. left: 50%;
  220. transform: translateX(-50%);
  221. bottom: 0;
  222. }
  223. .tab-search {
  224. margin-left: 16rpx;
  225. }
  226. .tab-content {
  227. margin-top: 32rpx;
  228. }
  229. .tui-card {
  230. background: #fff;
  231. border-radius: 40rpx;
  232. margin: 0 32rpx 32rpx 32rpx;
  233. padding: 40rpx 36rpx 36rpx 36rpx;
  234. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  235. }
  236. .tui-info-row {
  237. display: flex;
  238. align-items: center;
  239. margin-bottom: 18rpx;
  240. .tui-label {
  241. font-size: 30rpx;
  242. color: #b3b3b3;
  243. width: 180rpx;
  244. font-weight: 400;
  245. }
  246. .tui-value {
  247. font-size: 32rpx;
  248. color: #222;
  249. font-weight: 500;
  250. }
  251. }
  252. .tui-status-bar {
  253. display: flex;
  254. justify-content: flex-end;
  255. margin-top: 12rpx;
  256. }
  257. .tui-status {
  258. font-size: 28rpx;
  259. border-radius: 0 0 20rpx 0;
  260. padding: 8rpx 32rpx;
  261. font-weight: 400;
  262. &.orange {
  263. background: #fff7e6;
  264. color: #ffb400;
  265. }
  266. &.red {
  267. background: #ffeaea;
  268. color: #ff4d4f;
  269. }
  270. &.gray {
  271. background: #f5f5f5;
  272. color: #999;
  273. }
  274. }
  275. .tui-action-bar {
  276. display: flex;
  277. justify-content: center;
  278. align-items: center;
  279. margin-top: 24rpx;
  280. gap: 80rpx;
  281. }
  282. .tui-action {
  283. display: flex;
  284. flex-direction: column;
  285. align-items: center;
  286. font-size: 28rpx;
  287. color: #999;
  288. uni-icons {
  289. margin-bottom: 4rpx;
  290. }
  291. }
  292. </style>