driverIdentity.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  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 class="c-row b-b">
  43. <text class="tit">常驻城市</text>
  44. <view class="con-list">
  45. <input placeholder="请填写常驻城市" name="input" v-model="DriverViewInfo.residentCityProvincial"></input>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="margin-top">
  50. <view class="labels">货车信息</view>
  51. <view class="labels"> 车辆 -?</view>
  52. <view class="c-row b-b">
  53. <text class="tit">车牌号</text>
  54. <view class="con-list">
  55. <input placeholder="请填写车牌号" name="input" v-model="driverCarInfoList.carNumber"></input>
  56. </view>
  57. </view>
  58. <view class="c-row b-b">
  59. <text class="tit">车型</text>
  60. <!-- <view class="con-list"> -->
  61. <picker @change="ModelChange" :value="ModelIndex" :range="ModelType" class="con-list">
  62. <view class="picker ">
  63. {{ModelIndex>-1?ModelType[ModelIndex]:'请选择车型'}}
  64. </view>
  65. </picker>
  66. <!-- </view> -->
  67. </view>
  68. <view class="c-row b-b">
  69. <text class="tit">不含车头车长(米)</text>
  70. <!-- <view class="con-list"> -->
  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>
  78. <view class="c-row b-b">
  79. <text class="tit">载重(吨)</text>
  80. <view class="con-list">
  81. <input placeholder="请填写载重(吨)" name="input" v-model="driverCarInfoList.carLoad"></input>
  82. </view>
  83. </view>
  84. <view class="c-row b-b">
  85. <text class="tit">出厂年份</text>
  86. <view class="con-list">
  87. <input placeholder="请填写出厂年份" name="input" v-model="driverCarInfoList.yearManufacture"></input>
  88. </view>
  89. </view>
  90. <button type="default">添加车辆</button>
  91. </view>
  92. <view class="margin-top">
  93. <view class="labels">账户信息</view>
  94. <view class="labels"> 账户 -?</view>
  95. <view class="c-row b-b">
  96. <text class="tit">账户类型</text>
  97. <view class="con-list">
  98. <input placeholder="请填写账户类型" name="input" v-model="driverPayeeInfoList.accountType"></input>
  99. </view>
  100. </view>
  101. <view class="c-row b-b">
  102. <text class="tit">银行卡照片(可选)</text>
  103. <view class="con-list">
  104. <input placeholder="请上传照片" name="input" v-model="driverPayeeInfoList.payeeAddressUrl"></input>
  105. </view>
  106. </view>
  107. <view class="c-row b-b">
  108. <text class="tit">银行卡号</text>
  109. <view class="con-list">
  110. <input placeholder="请输入银行卡号" name="input" v-model="driverPayeeInfoList.bankCard"></input>
  111. </view>
  112. </view>
  113. <view class="c-row b-b">
  114. <text class="tit">开户行</text>
  115. <view class="con-list">
  116. <input placeholder="请输入开户行" name="input" v-model="driverPayeeInfoList.bankDeposit"></input>
  117. </view>
  118. </view>
  119. <view class="c-row b-b">
  120. <text class="tit">开户支行</text>
  121. <view class="con-list">
  122. <input placeholder="请输入开户支行" name="input" v-model="driverPayeeInfoList.bankDepositBranch"></input>
  123. </view>
  124. </view>
  125. <view class="c-row b-b">
  126. <text class="tit">收款人姓名</text>
  127. <view class="con-list">
  128. <input placeholder="请输入收款人姓名" name="input" v-model="driverPayeeInfoList.payeeName"></input>
  129. </view>
  130. </view>
  131. <view class="c-row b-b">
  132. <text class="tit">收款人身份证号</text>
  133. <view class="con-list">
  134. <input placeholder="请输入收款人身份证号" name="input" v-model="driverPayeeInfoList.payeeNumberCard"></input>
  135. </view>
  136. </view>
  137. <button type="default">添加账号</button>
  138. </view>
  139. <view class="margin-top">
  140. <view class="labels">上传附件</view>
  141. <button type="default">行驶证</button>
  142. <button type="default">驾驶证</button>
  143. <button type="default">道路运营证</button>
  144. <button type="default">从业资格证</button>
  145. </view>
  146. <view class="padding flex flex-direction">
  147. <button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
  148. </view>
  149. </view>
  150. </view>
  151. </template>
  152. <script>
  153. import {
  154. mapState
  155. } from 'vuex';
  156. export default {
  157. data() {
  158. return {
  159. goods:{},
  160. ModelIndex:'高栏',
  161. Model:'',
  162. ModelType:["高栏","集装箱","自卸车"],
  163. carLong:'',
  164. carLongType:['13','9.6','8.2','8.7','11.7','12.5','13.7','15','16','17.5'],
  165. id:[],
  166. id1:"",
  167. id2:"",
  168. // bank1:"",
  169. // bank2:"",
  170. // bankid:[],
  171. sendText: '获取验证码',
  172. sendText: '获取验证码',
  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. driverCarInfoList: {},
  179. driverPayeeInfoList: {},
  180. DriverViewInfo: {
  181. driverCarInfoList: [],
  182. driverPayeeInfoList: [],
  183. },
  184. }
  185. },
  186. computed: {
  187. ...mapState(['hasLogin','userInfo'])
  188. },
  189. methods: {
  190. phoneinput(e) {
  191. if (e.detail.value.length == 11) {
  192. this.codestatus = true
  193. }
  194. },
  195. getcode() {
  196. var that = this
  197. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.customerPhone)) {
  198. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  199. customerPhone: this.customerPhone
  200. }).then(res => {
  201. if (res.data.code == 200) {
  202. that.sendDisabled = true
  203. let sec = 60
  204. let interval = setInterval(() => {
  205. sec--;
  206. that.sendText = sec + 's后重发'
  207. if (sec <= 0) {
  208. that.sendDisabled = false
  209. that.sendText = "获取验证码"
  210. clearInterval(interval)
  211. }
  212. }, 1000)
  213. } else {
  214. uni.showToast({
  215. title: res.data.message,
  216. icon: 'none',
  217. duration: 2000
  218. })
  219. }
  220. })
  221. .catch(res => {
  222. uni.showToast({
  223. title: res.data.message,
  224. icon: 'none',
  225. duration: 2000
  226. })
  227. });
  228. } else {
  229. uni.showToast({
  230. title: '请输入正确的手机号',
  231. icon: 'none',
  232. duration: 2000
  233. })
  234. }
  235. },
  236. doGetVerify() {
  237. const that = this
  238. var phone = this.inputContent;
  239. if (!phone || phone.length != 11) {
  240. uni.showToast({
  241. title: '请输入正确手机号!',
  242. icon: 'none'
  243. })
  244. return
  245. }
  246. that.$api.request('user', 'sendVerifyCode', {
  247. phone: phone,
  248. }).then(res => {
  249. that.sendDisabled = true
  250. let sec = 60
  251. let interval = setInterval(() => {
  252. sec--;
  253. that.sendText = sec + 's后重发'
  254. if (sec <= 0) {
  255. that.sendDisabled = false
  256. that.sendText = "获取验证码"
  257. clearInterval(interval)
  258. }
  259. }, 1000)
  260. })
  261. },
  262. verifyCodeInput(e) {
  263. this.verifyCode = e.detail.value
  264. },
  265. cancel() {
  266. this.inputShow = false
  267. this.inputStatus = 'none'
  268. this.isPhone = false
  269. },
  270. ModelChange(e) {
  271. this.ModelIndex = e.detail.value
  272. this.Model = this.ModelType[this.ModelIndex];
  273. this.driverCarInfoList.carModel = this.ModelType[this.ModelIndex];
  274. },
  275. carLongChange(e) {
  276. this.carLongIndex = e.detail.value
  277. this.carLong = this.carLongType[this.carLongIndex];
  278. },
  279. idUp(){
  280. var that = this
  281. wx.chooseImage({
  282. success: function(res) {
  283. wx.uploadFile({
  284. url: 'https://www.zthymaoyi.com/upload/admin',
  285. filePath: res.tempFilePaths[0],
  286. name: 'file',
  287. success(res) {
  288. var data = res.data
  289. var strToObj = JSON.parse(data)
  290. that.id[0] = strToObj.url
  291. that.id1 = strToObj.url
  292. }
  293. })
  294. }
  295. })
  296. },
  297. idLow(){
  298. var that = this
  299. wx.chooseImage({
  300. success: function(res) {
  301. wx.uploadFile({
  302. url: 'https://www.zthymaoyi.com/upload/admin',
  303. filePath: res.tempFilePaths[0],
  304. name: 'file',
  305. success(res) {
  306. var data = res.data
  307. var strToObj = JSON.parse(data)
  308. that.id[1] = strToObj.url
  309. that.id2 = strToObj.url
  310. }
  311. })
  312. }
  313. })
  314. },
  315. getcode() {
  316. var that = this
  317. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.identityAuthenticationInfo.customerPhone)) {
  318. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  319. phone: this.identityAuthenticationInfo.customerPhone
  320. }).then(res => {
  321. if (res.data.code == 200) {
  322. that.sendDisabled = true
  323. let sec = 60
  324. let interval = setInterval(() => {
  325. sec--;
  326. that.sendText = sec + 's后重发'
  327. if (sec <= 0) {
  328. that.sendDisabled = false
  329. that.sendText = "获取验证码"
  330. clearInterval(interval)
  331. }
  332. }, 1000)
  333. } else {
  334. uni.showToast({
  335. title: res.data.message,
  336. icon: 'none',
  337. duration: 2000
  338. })
  339. }
  340. })
  341. .catch(res => {
  342. uni.showToast({
  343. title: res.data.message,
  344. icon: 'none',
  345. duration: 2000
  346. })
  347. });
  348. } else {
  349. uni.showToast({
  350. title: '请输入正确的手机号',
  351. icon: 'none',
  352. duration: 2000
  353. })
  354. }
  355. this.driverCarInfoList.carLength = this.carLongType[this.carLongIndex];
  356. },
  357. commit() {
  358. this.DriverViewInfo.driverCarInfoList = [this.driverCarInfoList]
  359. this.DriverViewInfo.driverPayeeInfoList = [this.driverPayeeInfoList]
  360. this.DriverViewInfo.commonId = this.userInfo.id
  361. this.$api.doRequest('post', '/driverViewInfo/api/addInfo', this.DriverViewInfo).then(res => {
  362. }).catch(res => {
  363. uni.showToast({
  364. title: res.data.message,
  365. icon: 'none',
  366. duration: 2000
  367. })
  368. })
  369. },
  370. }
  371. }
  372. </script>
  373. <style>
  374. .center {
  375. padding: 10px 20px;
  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: #303133;
  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. </style>