driverIdentity.vue 9.9 KB

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