driverIdentity.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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. carLong: '',
  195. carLongIndex:0,
  196. carLongType: ['13', '9.6', '8.2', '8.7', '11.7', '12.5', '13.7', '15', '16', '17.5'],
  197. driverCarInfoList: {},
  198. driverPayeeInfoList: {},
  199. DriverViewInfo: {
  200. driverCarInfoList: [],
  201. driverPayeeInfoList: [],
  202. },
  203. verifyCode:"",
  204. codestatus:false,
  205. customerPhone: '',
  206. addressUrl:[],
  207. }
  208. },
  209. computed: {
  210. ...mapState(['hasLogin','userInfo'])
  211. },
  212. methods: {
  213. // phoneinput(e) {
  214. // if (e.detail.value.length == 11) {
  215. // this.codestatus = true
  216. // }
  217. // },
  218. travel(){
  219. var that = this
  220. wx.chooseImage({
  221. success: function(res) {
  222. wx.uploadFile({
  223. url: 'https://www.zthymaoyi.com/upload/admin',
  224. filePath: res.tempFilePaths[0],
  225. name: 'file',
  226. success(res) {
  227. var data = res.data
  228. var strToObj = JSON.parse(data)
  229. that.travels = strToObj.url
  230. that.addressUrl[0] = strToObj.url
  231. }
  232. })
  233. }
  234. })
  235. },
  236. drive(){
  237. var that = this
  238. wx.chooseImage({
  239. success: function(res) {
  240. wx.uploadFile({
  241. url: 'https://www.zthymaoyi.com/upload/admin',
  242. filePath: res.tempFilePaths[0],
  243. name: 'file',
  244. success(res) {
  245. var data = res.data
  246. var strToObj = JSON.parse(data)
  247. that.drives = strToObj.url
  248. that.addressUrl[1] = strToObj.url
  249. }
  250. })
  251. }
  252. })
  253. },
  254. operate(){
  255. var that = this
  256. wx.chooseImage({
  257. success: function(res) {
  258. wx.uploadFile({
  259. url: 'https://www.zthymaoyi.com/upload/admin',
  260. filePath: res.tempFilePaths[0],
  261. name: 'file',
  262. success(res) {
  263. var data = res.data
  264. var strToObj = JSON.parse(data)
  265. that.operates = strToObj.url
  266. that.addressUrl[2] = strToObj.url
  267. }
  268. })
  269. }
  270. })
  271. },
  272. practice(){
  273. var that = this
  274. wx.chooseImage({
  275. success: function(res) {
  276. wx.uploadFile({
  277. url: 'https://www.zthymaoyi.com/upload/admin',
  278. filePath: res.tempFilePaths[0],
  279. name: 'file',
  280. success(res) {
  281. var data = res.data
  282. var strToObj = JSON.parse(data)
  283. that.practices = strToObj.url
  284. that.addressUrl[3] = strToObj.url
  285. }
  286. })
  287. }
  288. })
  289. },
  290. getcode() {
  291. var that = this
  292. console.log(that.DriverViewInfo.driverPhone)
  293. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(that.DriverViewInfo.driverPhone)) {
  294. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  295. customerPhone: that.DriverViewInfo.driverPhone
  296. }).then(res => {
  297. if (res.data.code == 200) {
  298. that.sendDisabled = true
  299. let sec = 60
  300. let interval = setInterval(() => {
  301. sec--;
  302. that.sendText = sec + 's后重发'
  303. if (sec <= 0) {
  304. that.sendDisabled = false
  305. that.sendText = "获取验证码"
  306. clearInterval(interval)
  307. }
  308. }, 1000)
  309. } else {
  310. uni.showToast({
  311. title: res.data.message,
  312. icon: 'none',
  313. duration: 2000
  314. })
  315. }
  316. })
  317. .catch(res => {
  318. uni.showToast({
  319. title: res.data.message,
  320. icon: 'none',
  321. duration: 2000
  322. })
  323. });
  324. } else {
  325. uni.showToast({
  326. title: '请输入正确的手机号',
  327. icon: 'none',
  328. duration: 2000
  329. })
  330. }
  331. },
  332. ModelChange(e) {
  333. this.ModelIndex = e.detail.value
  334. this.Model = this.ModelType[this.ModelIndex];
  335. this.driverCarInfoList.carModel = this.ModelType[this.ModelIndex];
  336. },
  337. carLongChange(e) {
  338. this.carLongIndex = e.detail.value
  339. this.carLong = this.carLongType[this.carLongIndex];
  340. },
  341. idUp(){
  342. var that = this
  343. wx.chooseImage({
  344. success: function(res) {
  345. wx.uploadFile({
  346. url: 'https://www.zthymaoyi.com/upload/admin',
  347. filePath: res.tempFilePaths[0],
  348. name: 'file',
  349. success(res) {
  350. var data = res.data
  351. var strToObj = JSON.parse(data)
  352. that.id[0] = strToObj.url
  353. that.id1 = strToObj.url
  354. }
  355. })
  356. }
  357. })
  358. },
  359. idLow(){
  360. var that = this
  361. wx.chooseImage({
  362. success: function(res) {
  363. wx.uploadFile({
  364. url: 'https://www.zthymaoyi.com/upload/admin',
  365. filePath: res.tempFilePaths[0],
  366. name: 'file',
  367. success(res) {
  368. var data = res.data
  369. var strToObj = JSON.parse(data)
  370. that.id[1] = strToObj.url
  371. that.id2 = strToObj.url
  372. }
  373. })
  374. }
  375. })
  376. },
  377. commit() {
  378. this.DriverViewInfo.addressUrl = this.addressUrl.toString()
  379. this.DriverViewInfo.driverCarInfoList = [this.driverCarInfoList]
  380. this.DriverViewInfo.driverPayeeInfoList = [this.driverPayeeInfoList]
  381. this.DriverViewInfo.commonId = this.userInfo.id
  382. this.DriverViewInfo.cardAddressUrl = this.id.toString()
  383. this.DriverViewInfo.pcFlag = 0
  384. this.DriverViewInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  385. console.log(this.DriverViewInfo,"司机对象")
  386. this.$api.doRequest('post', '/driverViewInfo/api/addInfo', this.DriverViewInfo).then(res => {
  387. }).catch(res => {
  388. uni.showToast({
  389. title: res.data.message,
  390. icon: 'none',
  391. duration: 2000
  392. })
  393. })
  394. },
  395. }
  396. }
  397. </script>
  398. <style>
  399. .center {
  400. padding: 10px 20px;
  401. }
  402. .labels{
  403. font-size: 16px;
  404. font-weight: 400;
  405. }
  406. .c-row {
  407. display: -webkit-box;
  408. display: -webkit-flex;
  409. display: flex;
  410. -webkit-box-align: center;
  411. -webkit-align-items: center;
  412. align-items: center;
  413. padding: 20rpx 30rpx;
  414. position: relative;
  415. }
  416. .con-list {
  417. -webkit-box-flex: 1;
  418. -webkit-flex: 1;
  419. flex: 1;
  420. display: -webkit-box;
  421. display: -webkit-flex;
  422. display: flex;
  423. -webkit-box-orient: vertical;
  424. -webkit-box-direction: normal;
  425. -webkit-flex-direction: column;
  426. flex-direction: column;
  427. color: #303133;
  428. line-height: 40rpx;
  429. text-align: right;
  430. padding-right: 20rpx;
  431. font-size: 14px;
  432. }
  433. .getcode {
  434. font-size: 14px;
  435. position: absolute;
  436. top: 50%;
  437. transform: translateY(-50%);
  438. color: #AFB3BF;
  439. background: #F5F6F9;
  440. height: 30px;
  441. line-height: 30px;
  442. }
  443. .getcode.active {
  444. border: none;
  445. }
  446. .uni-navigator{
  447. display:inline-block;
  448. color:#22C572;
  449. }
  450. .getcode.active {
  451. background: #22C572;
  452. color: #fff;
  453. }
  454. .labels {
  455. font-size: 16px;
  456. font-weight: 400;
  457. }
  458. .c-row {
  459. display: -webkit-box;
  460. display: -webkit-flex;
  461. display: flex;
  462. -webkit-box-align: center;
  463. -webkit-align-items: center;
  464. align-items: center;
  465. padding: 20rpx 30rpx;
  466. position: relative;
  467. }
  468. .con-list {
  469. -webkit-box-flex: 1;
  470. -webkit-flex: 1;
  471. flex: 1;
  472. display: -webkit-box;
  473. display: -webkit-flex;
  474. display: flex;
  475. -webkit-box-orient: vertical;
  476. -webkit-box-direction: normal;
  477. -webkit-flex-direction: column;
  478. flex-direction: column;
  479. color: #303133;
  480. line-height: 40rpx;
  481. text-align: right;
  482. padding-right: 20rpx;
  483. font-size: 14px;
  484. }
  485. .verificationCode {
  486. margin-top: 20px;
  487. background: #F5F6F9;
  488. color: #AFB3BF;
  489. }
  490. .verificationCode:after {
  491. border: none;
  492. }
  493. .verificationCode.active {
  494. background: #22C572;
  495. color: #fff;
  496. }
  497. .getcode {
  498. font-size: 14px;
  499. position: absolute;
  500. /* right:0; */
  501. top: 50%;
  502. transform: translateY(-50%);
  503. color: #AFB3BF;
  504. background: #F5F6F9;
  505. height: 30px;
  506. line-height: 30px;
  507. }
  508. .getcode:after {
  509. border: none;
  510. }
  511. .getcode.active {
  512. background: #22C572;
  513. color: #fff;
  514. }
  515. </style>