index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. <template>
  2. <view>
  3. <!-- #ifdef MP -->
  4. <view class="cart_nav">
  5. <nav-bar ref="navBarRef" navTitle="成为骑手" :isBackgroundColor="false">
  6. </nav-bar>
  7. </view>
  8. <!-- #endif -->
  9. <view v-if="!successful">
  10. <form @submit="formSubmit">
  11. <view class="merchantsSettled">
  12. <view class="merchantBg">
  13. <image class="bag" src="/static/img/rider.jpg" alt="" srcset="" />
  14. </view>
  15. <view class="list">
  16. <view style="padding: 21rpx 0 86rpx 39rpx;">
  17. <view class="item-box">
  18. <view class="title required" style="width: 147rpx;">姓名</view>
  19. <input class="uni-input" v-model="name" focus placeholder="请输入你的姓名" />
  20. </view>
  21. <view class="item-box">
  22. <view class="title required" style="width: 147rpx;">手机号</view>
  23. <input class="uni-input" type='number' v-model="phone" focus placeholder="请输入你的手机号" />
  24. </view>
  25. <view class="item-box">
  26. <view class="title required" style="width: 147rpx;">短信验证</view>
  27. <input class="uni-input" type='number' maxlength="6" v-model="bindingCaptcha" focus placeholder="请输入验证码" />
  28. <button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
  29. {{ text }}
  30. </button>
  31. </view>
  32. <view class="item-box" style="justify-content: space-between;">
  33. <view class="title required">是否有过配送经验</view>
  34. <switch :value="isSwitch" :checked="isSwitch" @change="isSwitch = !isSwitch" color="#12CA00" style="transform:scale(0.9)">
  35. <text style="margin-top: 3rpx;">{{isSwitch ? '是' : '否'}}</text>
  36. </switch>
  37. </view>
  38. <view class="item-box" style="border: none;padding: 0;">
  39. <view class="title required">配送职责(可多选)</view>
  40. </view>
  41. <view class="item-box" style="justify-content: space-between;">
  42. <view class="item-job" :class="checkbox1 ? 'job-border-color' : ''" @tap="checkbox1 = !checkbox1">
  43. <view v-if="checkbox1">
  44. <view class="sjx"></view>
  45. <text class="dg-icon"></text>
  46. </view>
  47. <text class="title">骑手</text>
  48. <view class="job-remark">负责校园外卖配送</view>
  49. </view>
  50. <view class="item-job" :class="checkbox2 ? 'job-border-color' : ''" @tap="checkbox2 = !checkbox2">
  51. <view v-if="checkbox2">
  52. <view class="sjx"></view>
  53. <text class="dg-icon"></text>
  54. </view>
  55. <text class="title">快递员</text>
  56. <view class="job-remark">负责快递代取/代寄</view>
  57. </view>
  58. <!-- <checkbox-group name="checkbox" style="margin-top: 38rpx;" @change="checkboxChange">
  59. <label style="margin-left: 96rpx">
  60. <checkbox class="mycheck" value="1" :checked="checkbox1" /> <text style="margin-left: 10rpx"> 骑手</text>
  61. </label>
  62. <label style="margin-left: 96rpx">
  63. <checkbox class="mycheck" value="2" :checked="checkbox2" /> <text style="margin-left: 10rpx"> 快递员</text>
  64. </label>
  65. </checkbox-group> -->
  66. </view>
  67. <view class="item no-border">
  68. <text class="acea-row row-middle required item-title">请上传身份证证件照正反照</text>
  69. <text v-if="merchantTypeInfo" class="item-title">( {{merchantTypeInfo}} )</text>
  70. <text class="item-desc">(图片最多可上传5张,格式支持JPG、PNG、JPEG)</text>
  71. <view class="upload">
  72. <view class='pictrue' v-for="(item,index) in pics" :key="index" :data-index="index" @click="getPhotoClickIdx">
  73. <image :src='item'></image>
  74. <text class='iconfont icon-guanbi1' @click.stop='DelPic(index)'></text>
  75. </view>
  76. <view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic' v-if="pics.length < 5">
  77. <text class='iconfont icon-icon25201'></text>
  78. <view>上传凭证</view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view style="padding: 0 96rpx;margin: 96rpx 0 20rpx 0;">
  84. <label class="radio">
  85. <radio activeBackgroundColor="$bg-color-primary" value="isAgree" @tap="isAgree = !isAgree" :checked="isAgree" />我已阅读相关条款
  86. </label>
  87. <button class="settleAgree" @click="showProtocol = true">《入驻协议》</button>
  88. </view>
  89. <view style="padding: 0 96rpx;">
  90. <button class="sub" @tap="formSubmit">提交申请</button>
  91. </view>
  92. </view>
  93. </view>
  94. </form>
  95. <view class="settlementAgreement" v-if="showProtocol">
  96. <view class="setAgCount">
  97. <i class="icon iconfont icon-guanbi" @click="showProtocol = false"></i>
  98. <div class="title">骑手入驻协议</div>
  99. <view class="content">
  100. <jyf-parser :html="protocol" ref="article" :tag-style="tagStyle"></jyf-parser>
  101. </view>
  102. </view>
  103. </view>
  104. <view class='loadingicon acea-row row-center-wrapper' v-if="loading">
  105. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
  106. </view>
  107. </view>
  108. <view class="settledSuccessMain" v-else>
  109. <view class="settledSuccessful">
  110. <image class="image" src="../static/images/settledSuccessful.svg" alt="" />
  111. <view class="title">恭喜,您的资料提交成功!</view>
  112. <view class="info">预计15个工作日内审核完毕,平台客服会及时与您联系!</view>
  113. <view class="goHome" hover-class="none" @click="goHome">
  114. 返回首页
  115. </view>
  116. </view>
  117. </view>
  118. <Verify @success="handlerOnVerSuccess" :captchaType="'clickWord'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
  119. </view>
  120. </template>
  121. <script>
  122. import {
  123. mapGetters
  124. } from "vuex";
  125. import {
  126. riderSettledCode,
  127. riderSettledApply
  128. } from '@/api/user.js'
  129. import {
  130. Debounce
  131. } from '@/utils/validate.js'
  132. import Verify from '../components/verifition/verify.vue';
  133. import navBar from '@/components/navBar';
  134. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  135. let app = getApp();
  136. export default {
  137. computed: {
  138. ...mapGetters(['isLogin', 'uid'])
  139. },
  140. components: {
  141. Verify,
  142. navBar
  143. },
  144. data() {
  145. return {
  146. successful: false,
  147. showProtocol: false,
  148. loading: false,
  149. protocol: '',
  150. tagStyle: {
  151. img: 'width:100%;display:block;'
  152. },
  153. userInfo: {},
  154. merchantData: {
  155. name: "",
  156. realName: "",
  157. phone: "",
  158. captcha: '',
  159. categoryId: 0,
  160. handlingFee: '',
  161. keywords: '',
  162. qualificationPicture: '',
  163. typeId: 0
  164. },
  165. pics: [],
  166. checkbox1: true,
  167. checkbox2: false,
  168. statusBarHeight: app.globalData.statusBarHeight,
  169. theme: app.globalData.theme,
  170. navigationBarHeight: 112,
  171. isAgree: false,
  172. isSwitch: false,
  173. name: '',
  174. phone: '',
  175. bindingCaptcha: '',
  176. disabled: false,
  177. text: '发送验证码',
  178. nums: 60,
  179. timer: '',
  180. merchantTypeInfo: '',
  181. isKey: '',
  182. picsStr: ''
  183. }
  184. },
  185. methods: {
  186. onVerify() {
  187. let that = this;
  188. if (!that.name) return that.$util.Tips({
  189. title: '请填写姓名!'
  190. });
  191. if (!that.phone) return that.$util.Tips({
  192. title: '请填写手机号码!'
  193. });
  194. if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
  195. title: '请输入正确的手机号码!'
  196. });
  197. if (!that.bindingCaptcha) return that.$util.Tips({
  198. title: '请填写验证码!'
  199. });
  200. if (!that.checkbox1 && !that.checkbox2) return that.$util.Tips({
  201. title: '请选择配送职责!'
  202. });
  203. if (!that.isAgree) return that.$util.Tips({
  204. title: '请勾选相关条款!'
  205. });
  206. if (that.pics.length == 0) return that.$util.Tips({
  207. title: "请上传资质图片"
  208. });
  209. if (that.pics) {
  210. that.picsStr = JSON.stringify(that.pics)
  211. }
  212. return true;
  213. },
  214. getUserInfo() {
  215. this.$store.dispatch('USERINFO').then(res => {
  216. this.userInfo = res;
  217. console.log(this.userInfo)
  218. if(this.userInfo.isRider){
  219. this.$util.navigateTo("/pages/rider_index/index");
  220. }else{
  221. this.$util.Tips({
  222. title: "您未注册,请先注册成为骑手"
  223. });
  224. }
  225. });
  226. },
  227. // 首页
  228. goHome() {
  229. uni.switchTab({
  230. url: '/pages/index/index'
  231. });
  232. },
  233. handBack() {
  234. uni.navigateBack({
  235. delta: 1
  236. })
  237. },
  238. //滑块验证成功后
  239. handlerOnVerSuccess(data) {
  240. this.$refs.verify.hide();
  241. uni.showLoading({
  242. title: '加载中',
  243. mask: true
  244. });
  245. riderSettledCode({
  246. phone: +that.phone
  247. }).then(res => {
  248. that.$util.Tips({
  249. title: res.message
  250. });
  251. that.timer = setInterval(that.getTimes, 1000);
  252. that.disabled = true;
  253. uni.hideLoading();
  254. }).catch(err => {
  255. return that.$util.Tips({
  256. title: err
  257. });
  258. uni.hideLoading();
  259. });
  260. },
  261. /**
  262. * 发送验证码
  263. *
  264. */
  265. code: Debounce(function() {
  266. this.nums = 60;
  267. let that = this;
  268. if (!that.phone) return that.$util.Tips({
  269. title: '请填写手机号码!'
  270. });
  271. if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
  272. title: '请输入正确的手机号码!'
  273. });
  274. this.$refs.verify.show();
  275. }),
  276. getTimes() {
  277. this.nums = this.nums - 1;
  278. this.text = "剩余 " + this.nums + "s";
  279. if (this.nums < 0) {
  280. clearInterval(this.timer);
  281. }
  282. this.text = "剩余 " + this.nums + "s";
  283. if (this.text < "剩余 " + 0 + "s") {
  284. this.disabled = false;
  285. this.text = "重新获取";
  286. }
  287. },
  288. checkboxChange(e) {
  289. const arr = e.detail.value
  290. this.checkbox1 = arr.includes('1')
  291. this.checkbox2 = arr.includes('2')
  292. },
  293. formSubmit: function() {
  294. if (this.onVerify()) {
  295. const params = {
  296. jobScope: `${this.checkbox1 ? 1 : 0},${this.checkbox2 ? 1 : 0}`, // 骑手 // 快递员
  297. isExped: this.isSwitch, // 是否有配送经验
  298. name: this.name, // 姓名
  299. phone: this.phone, // 电话
  300. captcha: +this.bindingCaptcha, // 验证码
  301. qualificationPicture: this.picsStr
  302. }
  303. console.log(params)
  304. riderSettledApply(params).then(data => {
  305. this.loading = true;
  306. this.timer = setTimeout(() => {
  307. this.successful = true;
  308. }, 1000)
  309. }).catch(res => {
  310. this.$util.Tips({
  311. title: res
  312. });
  313. })
  314. // riderSettledApply(params).then(res => {
  315. // this.$util.Tips({
  316. // title: '提交成功,等待审核'
  317. // });
  318. // this.handBack()
  319. // }).catch(err => {
  320. // return this.$util.Tips({
  321. // title: err
  322. // });
  323. // });
  324. }
  325. },
  326. /**
  327. * 上传文件
  328. *
  329. */
  330. uploadpic: function() {
  331. let that = this;
  332. that.$util.uploadImageOne({
  333. url: 'upload/image',
  334. name: 'multipart',
  335. model: "user",
  336. pid: 0
  337. }, function(res) {
  338. console.log(res)
  339. that.pics.push(res);
  340. that.$set(that, 'pics', that.pics);
  341. });
  342. },
  343. /**
  344. * 删除图片
  345. *
  346. */
  347. DelPic: function(index) {
  348. let that = this,
  349. pic = this.pics[index];
  350. that.pics.splice(index, 1);
  351. that.$set(that, 'pics', that.pics);
  352. },
  353. // 图片预览
  354. // 获得相册 idx
  355. getPhotoClickIdx(e) {
  356. let _this = this;
  357. let idx = e.currentTarget.dataset.index;
  358. _this.imgPreview(_this.pics, idx);
  359. },
  360. // 图片预览
  361. imgPreview: function(list, idx) {
  362. // list:图片 url 数组
  363. if (list && list.length > 0) {
  364. uni.previewImage({
  365. current: list[idx], // 传 Number H5端出现不兼容
  366. urls: list
  367. });
  368. }
  369. },
  370. },
  371. onLoad(options) {
  372. // this.getUserInfo();
  373. },
  374. mounted() {
  375. this.merchantBg = `../static/images/${this.theme}.jpg`;
  376. },
  377. }
  378. </script>
  379. <style scoped lang="scss">
  380. .required::before {
  381. content: '* ';
  382. color: red;
  383. margin-right: 4rpx;
  384. }
  385. .item-box {
  386. display: flex;
  387. align-items: center;
  388. border-bottom: 3rpx solid #D7D8DD;
  389. margin-bottom: 21rpx;
  390. padding-bottom: 21rpx;
  391. margin-right: 38rpx;
  392. .title {
  393. //font-weight: 600;
  394. font-size: 28rpx;
  395. color: #666666;
  396. }
  397. input {
  398. flex: 1;
  399. }
  400. }
  401. .item-job {
  402. border-radius: 8rpx;
  403. position: relative;
  404. padding: 15rpx 25rpx;
  405. text-align: center;
  406. border: 2rpx solid #D7D8DD;
  407. .sjx {
  408. position: absolute;
  409. width: 0;
  410. height: 0;
  411. top: 0;
  412. right: 0;
  413. border-top: 60rpx solid $bg-color-primary;
  414. border-left: 60rpx solid transparent;
  415. }
  416. .dg-icon {
  417. position: absolute;
  418. top: -5rpx;
  419. right: 5rpx;
  420. transform: rotate(14deg);
  421. ::before {
  422. content: '\2713';
  423. color: #fff;
  424. }
  425. }
  426. }
  427. .job-remark {
  428. margin-top: 25rpx;
  429. font-weight: 400;
  430. font-size: 23rpx;
  431. color: #333;
  432. }
  433. .code {
  434. padding: 13rpx 23rpx;
  435. font-weight: 400;
  436. font-size: 21rpx;
  437. color: #FFFFFF;
  438. background-color: $bg-color-primary;
  439. }
  440. .code.on {
  441. color: #b9b9bc !important;
  442. }
  443. .sub {
  444. // width: 100%;
  445. // margin: 25px auto 25px auto;
  446. // background-color: $bg-color-primary;
  447. // font-weight: 600;
  448. // font-size: 35rpx;
  449. // color: #FFFFFF;
  450. // padding: 25rpx 0;
  451. width: 588rpx;
  452. margin: 25px auto 25px auto;
  453. height: 86rpx;
  454. border-radius: 25px;
  455. text-align: center;
  456. line-height: 86rpx;
  457. font-size: 15px;
  458. color: #FFFFFF;
  459. background-color: $bg-color-primary;
  460. //@include main_bg_color(theme);
  461. }
  462. .order-nav {
  463. font-weight: 500;
  464. font-size: 35rpx;
  465. color: #FFFFFF;
  466. position: relative;
  467. background-color: #FF6702;
  468. display: flex;
  469. align-items: center;
  470. justify-content: center;
  471. .back-button {
  472. position: absolute;
  473. left: 20rpx;
  474. }
  475. }
  476. .back-button {
  477. width: 30rpx;
  478. height: 30rpx;
  479. border-right: 4rpx solid #fff;
  480. border-bottom: 4rpx solid #fff;
  481. transform: rotate(135deg);
  482. margin-left: 10rpx;
  483. display: inline-block;
  484. position: relative;
  485. }
  486. .settlementAgreement {
  487. width: 100%;
  488. height: 100%;
  489. position: fixed;
  490. top: 0;
  491. left: 0;
  492. background: rgba(0, 0, 0, .5);
  493. z-index: 10;
  494. }
  495. .settlementAgreement .setAgCount {
  496. background: #fff;
  497. width: 656rpx;
  498. height: 458px;
  499. position: absolute;
  500. top: 50%;
  501. left: 50%;
  502. border-radius: 12rpx;
  503. -webkit-border-radius: 12rpx;
  504. padding: 20rpx 52rpx !important;
  505. -webkit-transform: translate(-50%, -50%);
  506. -moz-transform: translate(-50%, -50%);
  507. transform: translate(-50%, -50%);
  508. overflow-y: scroll;
  509. .content {
  510. height: 740rpx !important;
  511. overflow-y: scroll;
  512. /deep/ p {
  513. font-size: 13px;
  514. line-height: 22px;
  515. }
  516. /deep/ img {
  517. max-width: 100%;
  518. }
  519. }
  520. }
  521. .settlementAgreement .setAgCount .icon {
  522. font-size: 24rpx;
  523. color: #b4b1b4;
  524. position: absolute;
  525. top: 40rpx;
  526. right: 15rpx;
  527. }
  528. .settlementAgreement .setAgCount .title {
  529. color: #333;
  530. font-size: 32rpx;
  531. text-align: center;
  532. font-weight: bold;
  533. }
  534. .settlementAgreement .setAgCount .content {
  535. margin-top: 32rpx;
  536. color: #333;
  537. font-size: 26rpx;
  538. line-height: 22px;
  539. text-align: justify;
  540. text-justify: distribute-all-lines;
  541. height: 756rpx;
  542. overflow-y: scroll;
  543. }
  544. uni-checkbox-group,
  545. .settleAgree {
  546. display: inline-block;
  547. font-size: 24rpx;
  548. }
  549. .settleAgree {
  550. @include main_color(theme);
  551. }
  552. .acea-row,
  553. .upload {
  554. display: -webkit-box;
  555. display: -moz-box;
  556. display: -webkit-flex;
  557. display: -ms-flexbox;
  558. display: flex;
  559. -webkit-box-lines: multiple;
  560. -moz-box-lines: multiple;
  561. -o-box-lines: multiple;
  562. -webkit-flex-wrap: wrap;
  563. -ms-flex-wrap: wrap;
  564. flex-wrap: wrap;
  565. }
  566. .upload {
  567. margin-top: 20rpx;
  568. }
  569. .pictrue {
  570. width: 130rpx;
  571. height: 130rpx;
  572. margin: 24rpx 22rpx 0 0;
  573. position: relative;
  574. font-size: 11px;
  575. color: #bbb;
  576. &:nth-child(4n) {
  577. margin-right: 0;
  578. }
  579. &:nth-last-child(1) {
  580. border: 0.5px solid #ddd;
  581. box-sizing: border-box;
  582. }
  583. uni-image,
  584. image {
  585. width: 100%;
  586. height: 100%;
  587. border-radius: 1px;
  588. img {
  589. -webkit-touch-callout: none;
  590. -webkit-user-select: none;
  591. -moz-user-select: none;
  592. display: block;
  593. position: absolute;
  594. top: 0;
  595. left: 0;
  596. opacity: 0;
  597. width: 100%;
  598. height: 100%;
  599. }
  600. }
  601. .icon-guanbi1 {
  602. font-size: 33rpx;
  603. position: absolute;
  604. top: -10px;
  605. right: -10px;
  606. }
  607. }
  608. .job-border-color {
  609. border-color: $bg-color-primary;
  610. }
  611. .merchantsSettled {
  612. position: relative;
  613. background-color: $bg-color-primary;
  614. height: 140vh;
  615. }
  616. .merchantsSettled .merchantBg {
  617. width: 100%;
  618. height: 900rpx;
  619. .bag {
  620. width: 100%;
  621. height: 100%;
  622. }
  623. .merchantBg-title {
  624. text-align: center;
  625. color: #fff;
  626. font-size: 60rpx;
  627. font-weight: 600;
  628. margin-bottom: 20rpx;
  629. }
  630. .merchantBg-join {
  631. text-align: center;
  632. color: #fff;
  633. font-size: 36rpx;
  634. }
  635. }
  636. .merchantsSettled .list {
  637. background-color: #fff;
  638. border-radius: 12px;
  639. margin: 0 24rpx;
  640. position: absolute;
  641. top: 18%;
  642. width: calc(100% - 24px);
  643. }
  644. .loadingicon {
  645. height: 100vh;
  646. overflow: hidden;
  647. position: absolute;
  648. top: 0;
  649. left: 0;
  650. }
  651. .settledSuccessMain {
  652. height: 100vh;
  653. display: flex;
  654. flex-direction: column;
  655. background: #fff;
  656. }
  657. .settledSuccessful {
  658. flex: 1;
  659. width: 100%;
  660. padding: 0 56px;
  661. height: auto;
  662. background: #fff;
  663. text-align: center;
  664. }
  665. .settledSuccessful .image {
  666. width: 189px;
  667. height: 157px;
  668. margin-top: 66px;
  669. }
  670. .settledSuccessful .title {
  671. color: #333333;
  672. font-size: 16px;
  673. font-weight: bold;
  674. margin-top: 35px;
  675. }
  676. .settledSuccessful .info {
  677. color: #A0A0A0;
  678. font-size: 13px;
  679. margin-top: 12px;
  680. }
  681. .settledSuccessful .goHome {
  682. margin: 60px auto 0;
  683. line-height: 43px;
  684. color: #282828;
  685. font-size: 15px;
  686. border: 1px solid #B4B4B4;
  687. border-radius: 60px;
  688. }
  689. </style>