driverIdentity.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. <template>
  2. <view class="center">
  3. <view>
  4. <view style="margin: 0 auto;" v-if="id1 != ''" @click="idUp">
  5. <image v-bind:src="id1" class="picture"></image>
  6. </view>
  7. <view style="margin: 0 auto;" v-if="id2 != ''" @click="idLow">
  8. <image v-bind:src="id2" class="picture"></image>
  9. </view>
  10. </view>
  11. <view class="information">
  12. <view class="c-row b-b">
  13. <text class="tit">姓名</text>
  14. <view class="con-list">
  15. <input placeholder="请填写姓名" name="input" v-model="DriverViewInfo.driverName"></input>
  16. </view>
  17. </view>
  18. <view class="c-row b-b">
  19. <text class="tit">身份证号</text>
  20. <view class="con-list">
  21. <input placeholder="请填写身份证号" name="input" v-model="DriverViewInfo.numberCard"></input>
  22. </view>
  23. </view>
  24. <view class="c-row b-b">
  25. <text class="tit">手机号</text>
  26. <view class="con-list">
  27. <input placeholder="请填写手机号" name="input" v-model="DriverViewInfo.driverPhone"></input>
  28. </view>
  29. </view>
  30. <view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
  31. <button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
  32. class='getcode'>{{sendText}}</button>
  33. <view style='width:70%;position:relative;margin-left: 200px;'>
  34. <view class="con-list">
  35. <!-- style='width:70%;position:relative;margin-left: 200px;' -->
  36. <input v-model='verifyCode' placeholder="请输入验证码" type="text">
  37. </view>
  38. </view>
  39. </view>
  40. <view class="c-row ">
  41. <text class="tit">常驻城市</text>
  42. <view class="con-list">
  43. <input placeholder="请填写常驻城市" name="input" v-model="DriverViewInfo.residentCityProvincial"></input>
  44. </view>
  45. </view>
  46. <!-- </view>
  47. <view class="margin-top">
  48. <view class="information">
  49. <view class="c-row ">
  50. <text class="tit">车辆 -?</text>
  51. <view class="con-list">
  52. <image src="../../static/img/jiaoyi/shanchu@2x.png" class="eliminate"></image>
  53. </view>
  54. </view>
  55. <view class="c-row b-b">
  56. <text class="tit">车牌号</text>
  57. <view class="con-list">
  58. <input placeholder="请填写车牌号" name="input" v-model="driverCarInfoList.carNumber"></input>
  59. </view>
  60. </view>
  61. <view class="c-row b-b">
  62. <text class="tit">车型</text>
  63. <picker @change="ModelChange" :value="ModelIndex" :range="ModelType" class="con-list">
  64. <view class="picker ">
  65. {{ModelIndex>-1?ModelType[ModelIndex]:'请选择车型'}}
  66. </view>
  67. </picker>
  68. </view>
  69. <view class="c-row b-b">
  70. <text class="tit">不含车头车长(米)</text>
  71. <picker @change="carLongChange" :value="carLongIndex" :range="carLongType" class="con-list">
  72. <view class="picker">
  73. {{carLongIndex>-1?carLongType[carLongIndex]:'请选择车长'}}
  74. </view>
  75. </picker>
  76. </view>
  77. <view class="c-row b-b">
  78. <text class="tit">载重(吨)</text>
  79. <view class="con-list">
  80. <input placeholder="请填写载重(吨)" name="input" v-model="driverCarInfoList.carLoad"></input>
  81. </view>
  82. </view>
  83. <view class="c-row ">
  84. <text class="tit">出厂年份</text>
  85. <view class="con-list">
  86. <input placeholder="请填写出厂年份" name="input" v-model="driverCarInfoList.yearManufacture"></input>
  87. </view>
  88. </view>
  89. </view>
  90. <button class="btn">添加车辆</button>
  91. </view> -->
  92. <!-- <view class="margin-top">
  93. <view class="information">
  94. <view class="c-row ">
  95. <text class="tit">账户 -?</text>
  96. <view class="con-list">
  97. <image src="../../static/img/jiaoyi/shanchu@2x.png" class="eliminate"></image>
  98. </view>
  99. </view>
  100. <view class="c-row b-b">
  101. <text class="tit">账户类型</text>
  102. <view class="con-list">
  103. <input placeholder="请填写账户类型" name="input" v-model="driverPayeeInfoList.accountType"></input>
  104. </view>
  105. </view>
  106. <view class="c-row b-b">
  107. <text class="tit">银行卡照片(可选)</text>
  108. <view class="con-list">
  109. <input placeholder="请上传照片" name="input" v-model="driverPayeeInfoList.payeeAddressUrl"></input>
  110. </view>
  111. </view>
  112. <view class="c-row b-b">
  113. <text class="tit">银行卡号</text>
  114. <view class="con-list">
  115. <input placeholder="请输入银行卡号" name="input" v-model="driverPayeeInfoList.bankCard"></input>
  116. </view>
  117. </view>
  118. <view class="c-row b-b">
  119. <text class="tit">开户行</text>
  120. <view class="con-list">
  121. <input placeholder="请输入开户行" name="input" v-model="driverPayeeInfoList.bankDeposit"></input>
  122. </view>
  123. </view>
  124. <view class="c-row b-b">
  125. <text class="tit">开户支行</text>
  126. <view class="con-list">
  127. <input placeholder="请输入开户支行" name="input" v-model="driverPayeeInfoList.bankDepositBranch"></input>
  128. </view>
  129. </view>
  130. <view class="c-row b-b">
  131. <text class="tit">收款人姓名</text>
  132. <view class="con-list">
  133. <input placeholder="请输入收款人姓名" name="input" v-model="driverPayeeInfoList.payeeName"></input>
  134. </view>
  135. </view>
  136. <view class="c-row b-b">
  137. <text class="tit">收款人身份证号</text>
  138. <view class="con-list">
  139. <input placeholder="请输入收款人身份证号" name="input" v-model="driverPayeeInfoList.payeeNumberCard"></input>
  140. </view>
  141. </view>
  142. </view >
  143. <button class="btn">添加账号</button>
  144. </view>
  145. <view class="margin-top">
  146. <view class="labels">上传附件</view>
  147. <button type="default" @click="travel">行驶证</button>
  148. <view style="width: 100px;margin: 0 auto;" v-if="travels != ''">
  149. <image v-bind:src = "travels" style="width: 100px;height: 100px;"></image>
  150. </view>
  151. <button type="default" @click="drive">驾驶证</button>
  152. <view style="width: 100px;margin: 0 auto;" v-if="drives != ''">
  153. <image v-bind:src = "drives" style="width: 100px;height: 100px;"></image>
  154. </view>
  155. <button type="default" @click="operate">道路运营证</button>
  156. <view style="width: 100px;margin: 0 auto;" v-if="operates != ''">
  157. <image v-bind:src = "operates" style="width: 100px;height: 100px;"></image>
  158. </view>
  159. <button type="default" @click="practice">从业资格证</button>
  160. <view style="width: 100px;margin: 0 auto;" v-if="practices != ''">
  161. <image v-bind:src = "practices" style="width: 100px;height: 100px;"></image>
  162. </view>
  163. </view>
  164. <view class="padding flex flex-direction">
  165. <button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
  166. </view>-->
  167. </view>
  168. <button class="btns btn" @click="jumpUrl">下一步</button>
  169. </view>
  170. </template>
  171. <script>
  172. import {
  173. mapState
  174. } from 'vuex';
  175. export default {
  176. data() {
  177. return {
  178. goods: {},
  179. ModelIndex: '高栏',
  180. Model: '',
  181. ModelType: ["高栏", "集装箱", "自卸车"],
  182. carLong: '',
  183. carLongType: ['13', '9.6', '8.2', '8.7', '11.7', '12.5', '13.7', '15', '16', '17.5'],
  184. id: [],
  185. id1: "../../static/img/authentication/identityup(2).png",
  186. id2: "../../static/img/authentication/identitylow(2).png",
  187. travels: "",
  188. drives: "",
  189. practices: "",
  190. operates: "",
  191. sendText: '获取验证码',
  192. sendDisabled: false,
  193. sendText: '获取验证码',
  194. ModelIndex: '高栏',
  195. Model: '',
  196. ModelType: ["高栏", "集装箱", "自卸车"],
  197. carLong: '',
  198. carLongIndex: 0,
  199. carLongType: ['13', '9.6', '8.2', '8.7', '11.7', '12.5', '13.7', '15', '16', '17.5'],
  200. driverCarInfoList: {},
  201. driverPayeeInfoList: {},
  202. DriverViewInfo: {
  203. },
  204. verifyCode: "",
  205. codestatus: false,
  206. customerPhone: '',
  207. addressUrl: [],
  208. personImgs:{},
  209. }
  210. },
  211. computed: {
  212. ...mapState(['hasLogin', 'userInfo'])
  213. },
  214. methods: {
  215. // phoneinput(e) {
  216. // if (e.detail.value.length == 11) {
  217. // this.codestatus = true
  218. // }
  219. // },
  220. jumpUrl() {
  221. if (this.id[0] == "" || this.id[0] == null) {
  222. this.$api.msg('请上传身份证正面!')
  223. return
  224. }
  225. if (this.id[1] == "" || this.id[1] == null) {
  226. this.$api.msg('请上传身份证反面!')
  227. return
  228. }
  229. if (!this.DriverViewInfo.driverName) {
  230. this.$api.msg('姓名不能为空')
  231. return
  232. }
  233. if (!this.DriverViewInfo.numberCard) {
  234. this.$api.msg('身份证号不能为空')
  235. return
  236. }
  237. if (!this.DriverViewInfo.driverPhone) {
  238. this.$api.msg('手机号不能为空')
  239. return
  240. }
  241. if (!this.DriverViewInfo.residentCityProvincial) {
  242. this.$api.msg('常住城市不能为空')
  243. return
  244. }
  245. this.DriverViewInfo.cardAddressUrl = this.id.toString()
  246. var model = JSON.stringify(this.DriverViewInfo);
  247. uni.navigateTo({
  248. url: `/pageD/identity/driverIdentityTwo?DriverViewInfo=` + model,
  249. })
  250. },
  251. getcode() {
  252. var that = this
  253. console.log(that.DriverViewInfo.driverPhone)
  254. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(that.DriverViewInfo.driverPhone)) {
  255. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  256. customerPhone: that.DriverViewInfo.driverPhone
  257. }).then(res => {
  258. if (res.data.code == 200) {
  259. that.sendDisabled = true
  260. let sec = 60
  261. let interval = setInterval(() => {
  262. sec--;
  263. that.sendText = sec + 's后重发'
  264. if (sec <= 0) {
  265. that.sendDisabled = false
  266. that.sendText = "获取验证码"
  267. clearInterval(interval)
  268. }
  269. }, 1000)
  270. } else {
  271. uni.showToast({
  272. title: res.data.message,
  273. icon: 'none',
  274. duration: 2000
  275. })
  276. }
  277. })
  278. .catch(res => {
  279. uni.showToast({
  280. title: res.data.message,
  281. icon: 'none',
  282. duration: 2000
  283. })
  284. });
  285. } else {
  286. uni.showToast({
  287. title: '请输入正确的手机号',
  288. icon: 'none',
  289. duration: 2000
  290. })
  291. }
  292. },
  293. ModelChange(e) {
  294. this.ModelIndex = e.detail.value
  295. this.Model = this.ModelType[this.ModelIndex];
  296. this.driverCarInfoList.carModel = this.ModelType[this.ModelIndex];
  297. },
  298. carLongChange(e) {
  299. this.carLongIndex = e.detail.value
  300. this.carLong = this.carLongType[this.carLongIndex];
  301. },
  302. idUp() {
  303. var that = this
  304. wx.chooseImage({
  305. success: function(res) {
  306. wx.uploadFile({
  307. url: 'https://www.zthymaoyi.com/upload/admin',
  308. filePath: res.tempFilePaths[0],
  309. name: 'file',
  310. success(res) {
  311. var data = res.data
  312. var strToObj = JSON.parse(data)
  313. that.id[0] = strToObj.url
  314. that.id1 = strToObj.url
  315. that.personImgs.personImg = that.id[0]
  316. that.$api.doRequest('get', '/driverViewInfo/personShibie', that.personImgs).then(res => {
  317. console.log("成功!")
  318. that.DriverViewInfo.driverName = res.data.data.recPerson
  319. that.DriverViewInfo.numberCard = res.data.data.recPersonNo
  320. console.log(that.DriverViewInfo.driverName)
  321. }).catch(res => {
  322. uni.showToast({
  323. title: res.data.message,
  324. icon: 'none',
  325. duration: 2000
  326. })
  327. })
  328. }
  329. })
  330. }
  331. })
  332. },
  333. idLow() {
  334. var that = this
  335. wx.chooseImage({
  336. success: function(res) {
  337. wx.uploadFile({
  338. url: 'https://www.zthymaoyi.com/upload/admin',
  339. filePath: res.tempFilePaths[0],
  340. name: 'file',
  341. success(res) {
  342. var data = res.data
  343. var strToObj = JSON.parse(data)
  344. that.id[1] = strToObj.url
  345. that.id2 = strToObj.url
  346. }
  347. })
  348. }
  349. })
  350. },
  351. commit() {
  352. this.DriverViewInfo.addressUrl = this.addressUrl.toString()
  353. this.DriverViewInfo.driverCarInfoList = [this.driverCarInfoList]
  354. this.DriverViewInfo.driverPayeeInfoList = [this.driverPayeeInfoList]
  355. this.DriverViewInfo.commonId = this.userInfo.id
  356. this.DriverViewInfo.cardAddressUrl = this.id.toString()
  357. this.DriverViewInfo.pcFlag = 0
  358. this.DriverViewInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  359. console.log(this.DriverViewInfo, "司机对象")
  360. this.$api.doRequest('post', '/driverViewInfo/api/addInfo', this.DriverViewInfo).then(res => {}).catch(
  361. res => {
  362. uni.showToast({
  363. title: res.data.message,
  364. icon: 'none',
  365. duration: 2000
  366. })
  367. })
  368. },
  369. }
  370. }
  371. </script>
  372. <style scoped>
  373. .center {
  374. padding: 10px 20px;
  375. background-color: #F5F6FA;
  376. }
  377. .labels {
  378. font-size: 16px;
  379. font-weight: 400;
  380. }
  381. .c-row {
  382. display: -webkit-box;
  383. display: -webkit-flex;
  384. display: flex;
  385. -webkit-box-align: center;
  386. -webkit-align-items: center;
  387. align-items: center;
  388. padding: 20rpx 30rpx;
  389. position: relative;
  390. }
  391. .con-list {
  392. -webkit-box-flex: 1;
  393. -webkit-flex: 1;
  394. flex: 1;
  395. display: -webkit-box;
  396. display: -webkit-flex;
  397. display: flex;
  398. -webkit-box-orient: vertical;
  399. -webkit-box-direction: normal;
  400. -webkit-flex-direction: column;
  401. flex-direction: column;
  402. color: #AFB3BF;
  403. line-height: 40rpx;
  404. text-align: right;
  405. padding-right: 20rpx;
  406. font-size: 14px;
  407. }
  408. .getcode {
  409. font-size: 14px;
  410. position: absolute;
  411. top: 50%;
  412. transform: translateY(-50%);
  413. color: #AFB3BF;
  414. background: #F5F6F9;
  415. height: 30px;
  416. line-height: 30px;
  417. }
  418. .getcode.active {
  419. border: none;
  420. }
  421. .uni-navigator {
  422. display: inline-block;
  423. color: #22C572;
  424. }
  425. .getcode.active {
  426. background: #22C572;
  427. color: #fff;
  428. }
  429. .labels {
  430. font-size: 16px;
  431. font-weight: 400;
  432. }
  433. .c-row {
  434. display: -webkit-box;
  435. display: -webkit-flex;
  436. display: flex;
  437. -webkit-box-align: center;
  438. -webkit-align-items: center;
  439. align-items: center;
  440. padding: 20rpx 30rpx;
  441. position: relative;
  442. }
  443. .con-list {
  444. -webkit-box-flex: 1;
  445. -webkit-flex: 1;
  446. flex: 1;
  447. display: -webkit-box;
  448. display: -webkit-flex;
  449. display: flex;
  450. -webkit-box-orient: vertical;
  451. -webkit-box-direction: normal;
  452. -webkit-flex-direction: column;
  453. flex-direction: column;
  454. color: #303133;
  455. line-height: 40rpx;
  456. text-align: right;
  457. padding-right: 20rpx;
  458. font-size: 14px;
  459. }
  460. .verificationCode {
  461. margin-top: 20px;
  462. background: #F5F6F9;
  463. color: #AFB3BF;
  464. }
  465. .verificationCode:after {
  466. border: none;
  467. }
  468. .verificationCode.active {
  469. background: #22C572;
  470. color: #fff;
  471. }
  472. .getcode {
  473. font-size: 14px;
  474. position: absolute;
  475. /* right:0; */
  476. top: 50%;
  477. transform: translateY(-50%);
  478. color: #AFB3BF;
  479. background: #F5F6F9;
  480. height: 30px;
  481. line-height: 30px;
  482. }
  483. .getcode:after {
  484. border: none;
  485. }
  486. .getcode.active {
  487. background: #22C572;
  488. color: #fff;
  489. }
  490. .picture {
  491. width: 100%;
  492. height: 220px;
  493. text-align: center;
  494. margin-top: 10px;
  495. }
  496. .tit {
  497. font-size: 14px;
  498. }
  499. .labels {
  500. margin: 5px 10px;
  501. }
  502. .information {
  503. margin-top: 10px;
  504. background-color: #FFFFFF;
  505. border-radius: 20px;
  506. }
  507. .btn {
  508. margin-top: 10px;
  509. background-color: #FFFFFF;
  510. border-radius: 25px;
  511. border: none;
  512. }
  513. /* //清除 */
  514. .eliminate {
  515. width: 20px;
  516. height: 20px;
  517. float: right;
  518. }
  519. /* 下一步 */
  520. .btn {
  521. margin-top: 10px;
  522. background-color: #FFFFFF;
  523. border-radius: 25px;
  524. border: none;
  525. }
  526. .btns {
  527. background-color: #22C572;
  528. }
  529. </style>