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

549 lines
13 KiB

1 week ago
5 days ago
1 week ago
5 days ago
1 week ago
1 week ago
1 week ago
  1. <template>
  2. <view class="apply-page">
  3. <!-- 顶部区域 -->
  4. <view class="header">
  5. <!-- 顶部导航栏 -->
  6. <view class="nav-bar">
  7. <view class="back-icon" @tap="navigateBack">
  8. <uni-icons type="left" size="20"></uni-icons>
  9. </view>
  10. <view class="title">回收侠·推客联盟</view>
  11. </view>
  12. <!-- 特点标签 -->
  13. <view class="feature-tags">
  14. <view class="tag">
  15. <text class="iconfont check"></text>
  16. <text>收益高</text>
  17. </view>
  18. <view class="tag">
  19. <text class="iconfont check"></text>
  20. <text>品类全</text>
  21. </view>
  22. <view class="tag">
  23. <text class="iconfont check"></text>
  24. <text>到账快</text>
  25. </view>
  26. <view class="tag">
  27. <text class="iconfont check"></text>
  28. <text>城市多</text>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 主要内容区域 -->
  33. <view class="content">
  34. <view class="page-header">
  35. <text class="title">申请推广官</text>
  36. <view class="contact-service" @tap="contactService">
  37. <text class="icon">??</text>
  38. <text>联系客服</text>
  39. </view>
  40. </view>
  41. <!-- 表单区域 -->
  42. <view class="form">
  43. <!-- 姓名输入 -->
  44. <view class="form-item">
  45. <text class="label">姓名</text>
  46. <input
  47. class="input"
  48. type="text"
  49. placeholder="请输入"
  50. placeholder-class="placeholder"
  51. v-model="formData.name"
  52. />
  53. </view>
  54. <!-- 电话输入 -->
  55. <view class="form-item">
  56. <text class="label">电话</text>
  57. <input
  58. class="input"
  59. type="number"
  60. placeholder="请输入"
  61. placeholder-class="placeholder"
  62. v-model="formData.phone"
  63. />
  64. </view>
  65. <!-- 职业选择 -->
  66. <view class="form-item" @tap="showPicker('occupation')">
  67. <text class="label">职业</text>
  68. <view class="picker-value">
  69. <text :class="{'placeholder': !formData.occupation}">
  70. {{formData.occupation || '请选择'}}
  71. </text>
  72. <text class="iconfont arrow">></text>
  73. </view>
  74. </view>
  75. <!-- 年龄选择 -->
  76. <view class="form-item" @tap="showPicker('age')">
  77. <text class="label">年龄</text>
  78. <view class="picker-value">
  79. <text :class="{'placeholder': !formData.age}">
  80. {{formData.age || '请选择'}}
  81. </text>
  82. <text class="iconfont arrow">></text>
  83. </view>
  84. </view>
  85. <!-- 推广时间选择 -->
  86. <view class="form-item" @tap="showPicker('promotionTime')">
  87. <text class="label">每日可花推广时间</text>
  88. <view class="picker-value">
  89. <text :class="{'placeholder': !formData.promotionTime}">
  90. {{formData.promotionTime || '请选择'}}
  91. </text>
  92. <text class="iconfont arrow">></text>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 底部按钮 -->
  98. <view class="bottom-btns">
  99. <button class="btn upgrade-btn" @tap="upgrade">升级推广官</button>
  100. <button class="btn submit-btn" @tap="submitForm">提交</button>
  101. </view>
  102. <!-- 选择器弹窗 -->
  103. <view class="picker-popup" v-if="showPickerPopup">
  104. <view class="popup-mask" @tap="hidePicker"></view>
  105. <view class="popup-content">
  106. <view class="popup-header">
  107. <text class="reset">重置</text>
  108. <text class="title">{{pickerTitle}}</text>
  109. </view>
  110. <picker-view
  111. class="picker-view"
  112. :value="[currentPickerIndex]"
  113. @change="onPickerChange"
  114. :indicator-style="indicatorStyle"
  115. >
  116. <picker-view-column>
  117. <view
  118. class="picker-item"
  119. v-for="(item, index) in currentPickerOptions"
  120. :key="index"
  121. :class="{'selected-item': index === currentPickerIndex}"
  122. >{{item}}</view>
  123. </picker-view-column>
  124. </picker-view>
  125. <button class="confirm-btn" @tap="confirmPicker">确认</button>
  126. </view>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
  132. export default {
  133. mixins: [pullRefreshMixin],
  134. data() {
  135. return {
  136. formData: {
  137. name: '',
  138. phone: '',
  139. occupation: '',
  140. age: '',
  141. promotionTime: ''
  142. },
  143. showPickerPopup: false,
  144. currentPickerType: '',
  145. currentPickerIndex: 0,
  146. indicatorStyle: 'height: 88rpx; border: none;',
  147. pickerOptions: {
  148. occupation: ['产品摄影师', '外呼专员', '宝妈', '导购员', '产品经理'],
  149. age: ['28岁', '29岁', '30岁', '31岁', '32岁'],
  150. promotionTime: ['2小时', '3小时', '4小时', '5小时', '6小时']
  151. }
  152. }
  153. },
  154. computed: {
  155. pickerTitle() {
  156. const titles = {
  157. occupation: '职业',
  158. age: '年龄',
  159. promotionTime: '每日可花推广时间'
  160. }
  161. return titles[this.currentPickerType] || ''
  162. },
  163. currentPickerOptions() {
  164. return this.pickerOptions[this.currentPickerType] || []
  165. }
  166. },
  167. methods: {
  168. async onRefresh() {
  169. // 模拟刷新数据
  170. await new Promise(resolve => setTimeout(resolve, 1000))
  171. this.stopPullRefresh()
  172. },
  173. navigateBack() {
  174. uni.navigateBack()
  175. },
  176. contactService() {
  177. // 实现联系客服功能
  178. uni.showToast({
  179. title: '正在连接客服...',
  180. icon: 'none'
  181. })
  182. },
  183. showPicker(type) {
  184. this.currentPickerType = type
  185. // 设置当前选中项的索引
  186. const currentValue = this.formData[this.currentPickerType]
  187. this.currentPickerIndex = this.currentPickerOptions.indexOf(currentValue)
  188. if (this.currentPickerIndex === -1) this.currentPickerIndex = 0
  189. this.showPickerPopup = true
  190. },
  191. hidePicker() {
  192. this.showPickerPopup = false
  193. },
  194. onPickerChange(e) {
  195. const index = e.detail.value[0]
  196. this.currentPickerIndex = index
  197. },
  198. confirmPicker() {
  199. const selectedValue = this.currentPickerOptions[this.currentPickerIndex]
  200. this.formData[this.currentPickerType] = selectedValue
  201. this.hidePicker()
  202. },
  203. upgrade(){
  204. uni.navigateTo({
  205. url: '/pages/component/upgrad'
  206. })
  207. },
  208. submitForm() {
  209. // 实现表单提交功能
  210. console.log('提交表单数据:', this.formData)
  211. uni.showToast({
  212. title: '提交成功',
  213. icon: 'success'
  214. })
  215. }
  216. }
  217. }
  218. </script>
  219. <style lang="scss" scoped>
  220. .apply-page {
  221. min-height: 100vh;
  222. background: linear-gradient(to right,#9be48f,#42dfc2);
  223. padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
  224. }
  225. .header {
  226. background: linear-gradient(to right,#9be48f,#42dfc2);
  227. padding: 0 30rpx;
  228. padding-bottom: 20rpx;
  229. .nav-bar {
  230. display: flex;
  231. align-items: center;
  232. // justify-content: space-between;
  233. height: 88rpx;
  234. padding-top: var(--status-bar-height);
  235. .title {
  236. font-family: DingTalk JinBuTi;
  237. font-weight: 400;
  238. font-style: italic;
  239. font-size: 50rpx;
  240. line-height: 100%;
  241. letter-spacing: 0%;
  242. vertical-align: bottom;
  243. color: #333;
  244. margin-left: 10%;
  245. }
  246. .back-icon, .more-icon {
  247. width: 88rpx;
  248. height: 88rpx;
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. .iconfont {
  253. font-size: 40rpx;
  254. color: #333;
  255. }
  256. }
  257. }
  258. .feature-tags {
  259. display: flex;
  260. justify-content: space-between;
  261. width: 90%;
  262. margin: 0 auto;
  263. margin-top: 10rpx;
  264. border: 1px solid rgba(0, 0, 0, 0.3);
  265. border-radius: 20rpx;
  266. background: linear-gradient(to right,#9be48f,#42dfc2);
  267. .tag {
  268. // background: rgba(255, 255, 255, 0.8);
  269. border-radius: 30rpx;
  270. padding: 12rpx 24rpx;
  271. display: flex;
  272. align-items: center;
  273. .check {
  274. color: #4CAF50;
  275. margin-right: 8rpx;
  276. font-size: 24rpx;
  277. }
  278. text {
  279. font-size: 24rpx;
  280. color: #333;
  281. }
  282. }
  283. }
  284. }
  285. .content {
  286. padding: 40rpx 30rpx;
  287. background: linear-gradient(to bottom,#eaffe6,6%,#fcfffb);
  288. border-radius: 40rpx 40rpx 0 0;
  289. margin-top: 20rpx;
  290. min-height: 100vh;
  291. .page-header {
  292. display: flex;
  293. justify-content: space-between;
  294. align-items: center;
  295. margin-bottom: 60rpx;
  296. .title {
  297. font-size: 40rpx;
  298. font-weight: bold;
  299. color: #333;
  300. }
  301. .contact-service {
  302. display: flex;
  303. align-items: center;
  304. padding: 12rpx 24rpx;
  305. border-radius: 10rpx;
  306. border: 2rpx solid #df8155;
  307. background: #fff0d2;
  308. .icon {
  309. margin-right: 8rpx;
  310. font-size: 28rpx;
  311. }
  312. text {
  313. font-size: 26rpx;
  314. color: #da7143;
  315. }
  316. }
  317. }
  318. .form {
  319. .form-item {
  320. margin-bottom: 40rpx;
  321. .label {
  322. font-family: PingFang SC;
  323. font-weight: 400;
  324. font-size: 13px;
  325. line-height: 140%;
  326. letter-spacing: 0%;
  327. color: #343534;
  328. font-weight: normal;
  329. margin-bottom: 16rpx;
  330. display: block;
  331. }
  332. .input {
  333. width: 100%;
  334. height: 88rpx;
  335. background: transparent;
  336. padding: 0;
  337. font-size: 30rpx;
  338. border: none;
  339. border-bottom: 1rpx solid rgba(0, 0, 0, 0.08);
  340. &::placeholder {
  341. color: rgba(153, 153, 153, 0.35);
  342. font-size: 30rpx;
  343. }
  344. }
  345. .picker-value {
  346. width: 100%;
  347. height: 88rpx;
  348. background: transparent;
  349. padding: 0;
  350. display: flex;
  351. align-items: center;
  352. justify-content: space-between;
  353. border: none;
  354. border-bottom: 1rpx solid rgba(0, 0, 0, 0.08);
  355. text {
  356. font-size: 30rpx;
  357. color: #333;
  358. &.placeholder {
  359. color: rgba(153, 153, 153, 0.35);
  360. }
  361. }
  362. .arrow {
  363. color: #999;
  364. font-size: 24rpx;
  365. // transform: rotate(90deg);
  366. opacity: 0.5;
  367. }
  368. }
  369. }
  370. }
  371. }
  372. .bottom-btns {
  373. position: fixed;
  374. bottom: 0;
  375. left: 0;
  376. right: 0;
  377. padding: 20rpx 30rpx;
  378. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  379. display: flex;
  380. justify-content: space-between;
  381. background: rgba(255, 255, 255, 0.9);
  382. backdrop-filter: blur(10px);
  383. .btn {
  384. flex: 1;
  385. height: 88rpx;
  386. line-height: 88rpx;
  387. text-align: center;
  388. border-radius: 44rpx;
  389. font-size: 32rpx;
  390. margin: 0 10rpx;
  391. border: none;
  392. &.upgrade-btn {
  393. background: rgba(255, 255, 255, 0.9);
  394. color: #666;
  395. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  396. }
  397. &.submit-btn {
  398. background: linear-gradient(90deg, #91dba5, #7ed4a6);
  399. color: #fff;
  400. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  401. }
  402. }
  403. }
  404. .picker-popup {
  405. position: fixed;
  406. top: 0;
  407. left: 0;
  408. right: 0;
  409. bottom: 0;
  410. z-index: 999;
  411. .popup-mask {
  412. position: absolute;
  413. top: 0;
  414. left: 0;
  415. right: 0;
  416. bottom: 0;
  417. background: rgba(0, 0, 0, 0.6);
  418. }
  419. .popup-content {
  420. position: absolute;
  421. left: 0;
  422. right: 0;
  423. bottom: 0;
  424. background: #fff;
  425. border-radius: 24rpx 24rpx 0 0;
  426. padding-bottom: calc(env(safe-area-inset-bottom) + 40rpx);
  427. .popup-header {
  428. display: flex;
  429. align-items: center;
  430. padding: 30rpx;
  431. position: relative;
  432. justify-content: center;
  433. border-bottom: 1rpx solid #f5f5f5;
  434. .title {
  435. font-size: 32rpx;
  436. color: #333;
  437. font-weight: normal;
  438. }
  439. .reset {
  440. position: absolute;
  441. left: 30rpx;
  442. font-size: 28rpx;
  443. color: #666;
  444. }
  445. }
  446. .picker-view {
  447. width: 100%;
  448. height: 440rpx;
  449. background: #fff;
  450. .picker-item {
  451. height: 88rpx;
  452. line-height: 88rpx;
  453. text-align: center;
  454. font-size: 28rpx;
  455. color: #999;
  456. font-weight: normal;
  457. }
  458. }
  459. .confirm-btn {
  460. margin: 30rpx;
  461. height: 88rpx;
  462. line-height: 88rpx;
  463. background: linear-gradient(90deg, #91dba5, #7ed4a6);
  464. color: #fff;
  465. font-size: 32rpx;
  466. border-radius: 44rpx;
  467. border: none;
  468. }
  469. }
  470. }
  471. ::v-deep .uni-picker-view-indicator {
  472. height: 88rpx !important;
  473. background-color: rgba(245, 245, 245, 0.3);
  474. }
  475. ::v-deep .uni-picker-view-mask {
  476. background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4)),
  477. linear-gradient(0deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4));
  478. }
  479. ::v-deep .uni-picker-view-content {
  480. .picker-item {
  481. transition: all 0.2s;
  482. }
  483. }
  484. ::v-deep .uni-picker-view-indicator::after,
  485. ::v-deep .uni-picker-view-indicator::before {
  486. display: none;
  487. }
  488. ::v-deep .selected-item {
  489. font-size: 34rpx !important;
  490. color: #333 !important;
  491. font-weight: 600 !important;
  492. }
  493. ::v-deep .placeholder {
  494. color: rgba(153, 153, 153, 0.5) !important;
  495. font-size: 30rpx;
  496. }
  497. </style>