driverIdentity.vue 13 KB

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