driverIdentity.vue 14 KB

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