driverIdentity.vue 11 KB

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