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

528 lines
14 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="upgrade-page">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-bar" :style="{height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px'}">
  5. <view class="nav-bar-inner">
  6. <view class="back-icon" @tap="navigateBack">
  7. <uni-icons type="left" size="22" color="#222" />
  8. </view>
  9. <view class="nav-bar-title">回收侠·推客联盟</view>
  10. <view class="nav-bar-right">
  11. <uni-icons type="more-filled" size="22" color="#222" />
  12. </view>
  13. </view>
  14. </view>
  15. <!-- 打钩标签区 -->
  16. <view class="feature-tags" :style="{marginTop: navBarTotalHeight + 'px'}">
  17. <view class="tag" v-for="(t, i) in featureTags" :key="i">
  18. <text class="check"></text>
  19. <text class="text">{{t}}</text>
  20. </view>
  21. </view>
  22. <!-- 主内容区 -->
  23. <view class="main-content">
  24. <view class="upgrade-card">
  25. <view class="upgrade-title-row">
  26. <text class="upgrade-title">申请推广官</text>
  27. <view class="contact-service" @tap="contactService">
  28. <uni-icons type="headphones" size="22" color="#df8155" />
  29. <text class="contact-text">联系客服</text>
  30. </view>
  31. </view>
  32. <!-- 表单区 -->
  33. <view class="form-item">
  34. <text class="label">姓名</text>
  35. <input class="input" type="text" placeholder="请输入" v-model="formData.name" />
  36. </view>
  37. <view class="form-item">
  38. <text class="label">电话</text>
  39. <input class="input" type="number" placeholder="请输入" v-model="formData.phone" />
  40. </view>
  41. <view class="form-item" @tap="showPicker('userTime')">
  42. <text class="label">每日可花推广时间</text>
  43. <view class="picker-value">
  44. <text :class="{'placeholder': !formData.userTime}">{{formData.userTime || '请选择'}}</text>
  45. <uni-icons type="right" size="18" color="#bbb" />
  46. </view>
  47. </view>
  48. <view class="desc-text">
  49. "支付费用后,您将成为更高等级的推广官,享受更高额度的佣金及相关权益,包括但不限于优先推广资源、专属培训课程、一对一业务指导等"
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 底部按钮区 -->
  54. <view class="bottom-btns">
  55. <button class="btn gray" @tap="showUpgradeModal = true">升级推广官</button>
  56. <button class="btn green" @tap="submitForm">提交</button>
  57. </view>
  58. <!-- 选择器弹窗 -->
  59. <view class="picker-popup" v-if="showPickerPopup">
  60. <view class="popup-mask" @tap="hidePicker"></view>
  61. <view class="popup-content">
  62. <view class="popup-header">
  63. <text class="reset" @tap="resetPicker">重置</text>
  64. <text class="title">每日可花推广时间</text>
  65. </view>
  66. <picker-view class="picker-view" :value="[currentPickerIndex]" @change="onPickerChange" :indicator-style="indicatorStyle">
  67. <picker-view-column>
  68. <view class="picker-item" v-for="(item, index) in pickerOptions" :key="index" :class="{'selected-item': index === currentPickerIndex}">{{item}}</view>
  69. </picker-view-column>
  70. </picker-view>
  71. <button class="confirm-btn" @tap="confirmPicker">确认</button>
  72. </view>
  73. </view>
  74. <!-- 升级推广官弹窗 -->
  75. <view v-if="showUpgradeModal" class="progress-modal-mask">
  76. <view class="progress-modal-box">
  77. <view class="progress-modal-title">联系运营商\n升级解锁更多权益</view>
  78. <view class="progress-modal-list">
  79. <view class="progress-modal-item" @tap="contactService">
  80. <text>在线客服</text>
  81. <uni-icons type="right" size="22" color="#bbb" />
  82. </view>
  83. <view class="progress-modal-item" @tap="contactService">
  84. <text>客服电话</text>
  85. <uni-icons type="right" size="22" color="#bbb" />
  86. </view>
  87. </view>
  88. <button class="progress-modal-btn" @tap="showUpgradeModal = false">我知道了</button>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
  95. export default {
  96. mixins: [pullRefreshMixin],
  97. data() {
  98. return {
  99. statusBarHeight: 0,
  100. navBarHeight: 44,
  101. navBarTotalHeight: 44,
  102. featureTags: ['收益高', '品类全', '到账快', '城市多'],
  103. formData: {
  104. name: '',
  105. phone: '',
  106. userTime: ''
  107. },
  108. showPickerPopup: false,
  109. currentPickerIndex: 0,
  110. indicatorStyle: 'height: 88rpx; border: none;',
  111. pickerOptions: ['2小时', '3小时', '4小时', '5小时', '6小时'],
  112. showUpgradeModal: false
  113. }
  114. },
  115. onLoad() {
  116. const sysInfo = uni.getSystemInfoSync()
  117. this.statusBarHeight = sysInfo.statusBarHeight
  118. this.navBarHeight = 44
  119. this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
  120. this.getMyPromotionInfo()
  121. },
  122. methods: {
  123. async onRefresh() {
  124. // 模拟刷新数据
  125. await new Promise(resolve => setTimeout(resolve, 1000))
  126. uni.stopPullRefresh()
  127. },
  128. navigateBack() {
  129. uni.navigateBack()
  130. },
  131. contactService() {
  132. uni.navigateTo({ url: '/pages/subcomponent/admin_faq' })
  133. },
  134. showPicker() {
  135. this.showPickerPopup = true
  136. },
  137. hidePicker() {
  138. this.showPickerPopup = false
  139. },
  140. onPickerChange(e) {
  141. const index = e.detail.value[0]
  142. this.currentPickerIndex = index
  143. },
  144. confirmPicker() {
  145. this.formData.userTime = this.pickerOptions[this.currentPickerIndex]
  146. this.hidePicker()
  147. },
  148. resetPicker() {
  149. this.currentPickerIndex = 0
  150. },
  151. submitForm() {
  152. // 手机号校验
  153. const phone = this.formData.phone
  154. if (!phone) {
  155. uni.showToast({ title: '请输入手机号', icon: 'none' })
  156. return
  157. }
  158. if (!/^1[3-9]\d{9}$/.test(phone)) {
  159. uni.showToast({ title: '手机号格式不正确', icon: 'none' })
  160. return
  161. }
  162. this.$api('apply', this.formData, (res) => {
  163. if (res && res.success) {
  164. uni.showToast({ title: '提交成功', icon: 'success' })
  165. uni.navigateBack()
  166. }
  167. })
  168. },
  169. getMyPromotionInfo(){
  170. this.$api('getMyPromotionInfo', {}, (res) => {
  171. if (res && res.success && res.result) {
  172. this.formData = res.result
  173. }
  174. })
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss" scoped>
  180. .upgrade-page {
  181. min-height: 100vh;
  182. background: linear-gradient(180deg, #eaffe6 0%, #fff 30%);
  183. padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
  184. }
  185. .nav-bar {
  186. position: fixed;
  187. top: 0;
  188. left: 0;
  189. right: 0;
  190. z-index: 1000;
  191. width: 100vw;
  192. background: linear-gradient(to right, #b2f08d 0%, #39e9d2 100%);
  193. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.03);
  194. .nav-bar-inner {
  195. display: flex;
  196. align-items: center;
  197. height: 44px;
  198. width: 100vw;
  199. position: relative;
  200. }
  201. .back-icon, .nav-bar-right {
  202. width: 44px;
  203. height: 44px;
  204. display: flex;
  205. align-items: center;
  206. justify-content: center;
  207. position: absolute;
  208. top: 0;
  209. }
  210. .back-icon { left: 0; }
  211. .nav-bar-right { right: 0; }
  212. .nav-bar-title {
  213. flex: 1;
  214. text-align: center;
  215. font-size: 36rpx;
  216. font-weight: bold;
  217. color: #222;
  218. letter-spacing: 2rpx;
  219. line-height: 44px;
  220. }
  221. }
  222. .feature-tags {
  223. position: relative;
  224. z-index: 1;
  225. margin: 0 32rpx;
  226. margin-top: 0;
  227. margin-bottom: 0;
  228. background: linear-gradient(to right, #b2f08d 0%, #39e9d2 100%);
  229. border-radius: 32rpx;
  230. box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
  231. padding: 0 24rpx;
  232. height: 80rpx;
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. .tag {
  237. flex: 1;
  238. display: flex;
  239. align-items: center;
  240. justify-content: center;
  241. .check {
  242. width: 36rpx;
  243. height: 36rpx;
  244. background: #fff;
  245. border-radius: 50%;
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. font-size: 28rpx;
  250. color: #13ac47;
  251. font-weight: bold;
  252. margin-right: 10rpx;
  253. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  254. }
  255. .text {
  256. color: #fff;
  257. font-size: 28rpx;
  258. font-weight: bold;
  259. }
  260. }
  261. }
  262. .main-content {
  263. margin-top: -48rpx;
  264. padding-top: 88rpx;
  265. background: linear-gradient(180deg, #eaffe6 0%, #fff 30%);
  266. min-height: 100vh;
  267. width: 100vw;
  268. box-sizing: border-box;
  269. position: relative;
  270. z-index: 11;
  271. border-radius: 40rpx 40rpx 0 0;
  272. overflow: hidden;
  273. display: flex;
  274. flex-direction: column;
  275. align-items: center;
  276. }
  277. .upgrade-card {
  278. width: 92vw;
  279. max-width: 700rpx;
  280. margin: 40rpx auto 0 auto;
  281. background: #fff;
  282. border-radius: 32rpx;
  283. box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.08);
  284. padding: 40rpx 32rpx 32rpx 32rpx;
  285. display: flex;
  286. flex-direction: column;
  287. align-items: stretch;
  288. .upgrade-title-row {
  289. display: flex;
  290. justify-content: space-between;
  291. align-items: center;
  292. margin-bottom: 32rpx;
  293. .upgrade-title {
  294. font-size: 32rpx;
  295. font-weight: bold;
  296. color: #222;
  297. }
  298. .contact-service {
  299. display: flex;
  300. align-items: center;
  301. padding: 4rpx 12rpx;
  302. border-radius: 12rpx;
  303. border: 2rpx solid #df8155;
  304. background: #fff0d2;
  305. .contact-text {
  306. color: #df8155;
  307. font-size: 22rpx;
  308. margin-left: 4rpx;
  309. }
  310. uni-icons {
  311. font-size: 20rpx !important;
  312. }
  313. }
  314. }
  315. .form-item {
  316. margin-bottom: 32rpx;
  317. .label {
  318. font-size: 28rpx;
  319. color: #222;
  320. margin-bottom: 12rpx;
  321. display: block;
  322. }
  323. .input {
  324. width: 100%;
  325. height: 72rpx;
  326. background: transparent;
  327. padding: 0;
  328. font-size: 30rpx;
  329. border: none;
  330. border-bottom: 1rpx solid #eee;
  331. &::placeholder {
  332. color: #bbb;
  333. font-size: 30rpx;
  334. }
  335. }
  336. .picker-value {
  337. width: 100%;
  338. height: 72rpx;
  339. display: flex;
  340. align-items: center;
  341. justify-content: space-between;
  342. border-bottom: 1rpx solid #eee;
  343. .placeholder {
  344. color: #bbb;
  345. }
  346. text {
  347. font-size: 30rpx;
  348. color: #222;
  349. }
  350. }
  351. }
  352. .desc-text {
  353. font-size: 26rpx;
  354. color: #666;
  355. line-height: 1.6;
  356. margin-top: 32rpx;
  357. text-align: center;
  358. }
  359. }
  360. .bottom-btns {
  361. position: fixed;
  362. left: 0;
  363. right: 0;
  364. bottom: 0;
  365. display: flex;
  366. justify-content: space-between;
  367. padding: 24rpx 32rpx calc(env(safe-area-inset-bottom) + 24rpx) 32rpx;
  368. background: #fff;
  369. z-index: 100;
  370. .btn {
  371. flex: 1;
  372. height: 88rpx;
  373. border-radius: 44rpx;
  374. font-size: 32rpx;
  375. font-weight: bold;
  376. margin: 0 12rpx;
  377. border: none;
  378. box-shadow: none;
  379. &.gray {
  380. background: linear-gradient(90deg, #b2f08d, #39e9d2);
  381. color: #222;
  382. border: 2rpx solid #e5e5e5;
  383. }
  384. &.green {
  385. background: linear-gradient(90deg, #b2f08d, #39e9d2);
  386. color: #222;
  387. border: none;
  388. }
  389. }
  390. }
  391. .picker-popup {
  392. position: fixed;
  393. top: 0;
  394. left: 0;
  395. right: 0;
  396. bottom: 0;
  397. z-index: 999;
  398. .popup-mask {
  399. position: absolute;
  400. top: 0;
  401. left: 0;
  402. right: 0;
  403. bottom: 0;
  404. background: rgba(0, 0, 0, 0.6);
  405. }
  406. .popup-content {
  407. position: absolute;
  408. left: 0;
  409. right: 0;
  410. bottom: 0;
  411. background: #fff;
  412. border-radius: 24rpx 24rpx 0 0;
  413. padding-bottom: calc(env(safe-area-inset-bottom) + 40rpx);
  414. .popup-header {
  415. display: flex;
  416. align-items: center;
  417. padding: 30rpx;
  418. position: relative;
  419. justify-content: center;
  420. border-bottom: 1rpx solid #f5f5f5;
  421. .title {
  422. font-size: 32rpx;
  423. color: #333;
  424. font-weight: normal;
  425. }
  426. .reset {
  427. position: absolute;
  428. left: 30rpx;
  429. font-size: 28rpx;
  430. color: #666;
  431. }
  432. }
  433. .picker-view {
  434. width: 100%;
  435. height: 440rpx;
  436. background: #fff;
  437. .picker-item {
  438. height: 88rpx;
  439. line-height: 88rpx;
  440. text-align: center;
  441. font-size: 28rpx;
  442. color: #999;
  443. font-weight: normal;
  444. }
  445. }
  446. .confirm-btn {
  447. margin: 30rpx;
  448. height: 88rpx;
  449. line-height: 88rpx;
  450. background: linear-gradient(90deg, #91dba5, #7ed4a6);
  451. color: #fff;
  452. font-size: 32rpx;
  453. border-radius: 44rpx;
  454. border: none;
  455. }
  456. }
  457. }
  458. .progress-modal-mask {
  459. position: fixed;
  460. left: 0; right: 0; top: 0; bottom: 0;
  461. background: rgba(0,0,0,0.25);
  462. z-index: 2000;
  463. display: flex;
  464. align-items: center;
  465. justify-content: center;
  466. }
  467. .progress-modal-box {
  468. width: 80vw;
  469. max-width: 420px;
  470. background: linear-gradient(180deg, #f3fff2 0%, #eafff6 100%);
  471. border-radius: 32rpx;
  472. box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.10);
  473. padding: 56rpx 0 32rpx 0;
  474. display: flex;
  475. flex-direction: column;
  476. align-items: center;
  477. }
  478. .progress-modal-title {
  479. font-size: 34rpx;
  480. color: #222;
  481. font-weight: bold;
  482. text-align: center;
  483. margin-bottom: 48rpx;
  484. white-space: pre-line;
  485. }
  486. .progress-modal-list {
  487. width: 88%;
  488. display: flex;
  489. flex-direction: column;
  490. gap: 18rpx;
  491. margin-bottom: 48rpx;
  492. }
  493. .progress-modal-item {
  494. border-radius: 18rpx;
  495. height: 80rpx;
  496. display: flex;
  497. align-items: center;
  498. justify-content: space-between;
  499. font-size: 30rpx;
  500. color: #222;
  501. padding: 0 32rpx;
  502. box-shadow: 0 2rpx 8rpx rgba(60, 167, 250, 0.04);
  503. }
  504. .progress-modal-btn {
  505. width: 88%;
  506. height: 88rpx;
  507. background: linear-gradient(90deg, #b2f08d, #39e9d2);
  508. color: #222;
  509. font-size: 32rpx;
  510. font-weight: bold;
  511. border-radius: 44rpx;
  512. margin-top: 8rpx;
  513. box-shadow: 0 4rpx 16rpx rgba(60, 167, 250, 0.08);
  514. display: flex;
  515. align-items: center;
  516. justify-content: center;
  517. border: none;
  518. }
  519. </style>