driverIdentityTwo.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="center">
  3. <!-- 车辆信息 -->
  4. <view class="information">
  5. <view class="c-row">
  6. <text class="tit">货车信息</text>
  7. <view class="con-list">
  8. <image v-bind:src="opencar" class="open" opencarboolean @click="opencarclick"></image>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="informations" v-if="opencarboolean == true" v-for="(item , index) in driverCarInfoList"
  13. :Key="index">
  14. <view class="c-row ">
  15. <text class="tit">车辆 -{{index+1}}</text>
  16. <view class="con-list">
  17. <image src="../../static/img/jiaoyi/shanchu@2x.png" class="eliminate" @click="carDel(index)"></image>
  18. </view>
  19. </view>
  20. <view class="c-row b-b">
  21. <text class="tit">车牌号</text>
  22. <view class="con-list">
  23. <input placeholder="请填写车牌号" name="input" v-model="item.carNumber"></input>
  24. </view>
  25. </view>
  26. <view class="c-row b-b">
  27. <text class="tit">车型</text>
  28. <picker @change="ModelChange" :value="ModelIndex" :range="ModelType" class="con-list">
  29. <view class="picker " v-model="item.carModel">
  30. {{ModelIndex>-1?ModelType[ModelIndex]:'请选择车型'}}
  31. </view>
  32. </picker>
  33. <!-- </view> -->
  34. </view>
  35. <view class="c-row b-b">
  36. <text class="tit">不含车头车长(米)</text>
  37. <picker @change="carLongChange" :value="carLongIndex" :range="carLongType" class="con-list">
  38. <view class="picker" v-model="item.carLength">
  39. {{carLongIndex>-1?carLongType[carLongIndex]:'请选择车长'}}
  40. </view>
  41. </picker>
  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="item.carLoad"></input>
  47. </view>
  48. </view>
  49. <view class="c-row ">
  50. <text class="tit">出厂年份</text>
  51. <view class="con-list">
  52. <input placeholder="请填写出厂年份" name="input" v-model="item.yearManufacture"></input>
  53. </view>
  54. </view>
  55. </view>
  56. <button class="btn" v-if="opencarboolean == true" @click="carAdd">
  57. <image src="../../static/img/jiaoyi/ic_fabu@3x.png" class="add"></image>
  58. <texe>添加车辆</texe>
  59. </button>
  60. <!-- 账户信息 -->
  61. <view class="information">
  62. <view class="c-row">
  63. <text class="tit">账户信息</text>
  64. <view class="con-list">
  65. <image v-bind:src="openuser" class="open" openuserboolean @click="openuserclick"></image>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="informations" v-if="openuserboolean == true" v-for="(items , index) in driverPayeeInfoList"
  70. :Key="index">
  71. <!-- <view class="labels"> 账户 -?</view> -->
  72. <view class="c-row ">
  73. <text class="tit">账户 -{{index+1}}</text>
  74. <view class="con-list">
  75. <image src="../../static/img/jiaoyi/shanchu@2x.png" class="eliminate" @click="userDel(index)"></image>
  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="items.accountType"></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="items.payeeAddressUrl"></input>
  88. </view>
  89. </view>
  90. <view class="c-row b-b">
  91. <text class="tit">银行卡号</text>
  92. <view class="con-list">
  93. <input placeholder="请输入银行卡号" name="input" v-model="items.bankCard"></input>
  94. </view>
  95. </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="items.bankDeposit"></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="items.bankDepositBranch"></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="items.payeeName"></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="items.payeeNumberCard"></input>
  118. </view>
  119. </view>
  120. </view>
  121. <button class="btn" v-if="openuserboolean == true" @click="userAdd()">
  122. <image src="../../static/img/jiaoyi/ic_fabu@3x.png" class="add"></image>
  123. <text style="margin-top: -2px;">添加账户</text>
  124. </button>
  125. <button class="btns btn" @click="jumpUrl">下一步</button>
  126. </view>
  127. </view>
  128. </template>
  129. <script>
  130. import {
  131. mapState
  132. } from 'vuex';
  133. export default {
  134. data() {
  135. return {
  136. opencar: "../../static/img/authentication/down2@3x.png",
  137. openuser: "../../static/img/authentication/down2@3x.png",
  138. opencarboolean: false,
  139. openuserboolean: false,
  140. driverCarInfoList: [{
  141. carNumber: '',
  142. carModel: "高栏",
  143. carLength: "13",
  144. carLoad: "",
  145. yearManufacture: "",
  146. }],
  147. driverPayeeInfoList: [
  148. {
  149. accountType:"",
  150. cardAddressUrl:"",
  151. bankCard:"",
  152. bankDeposit:"",
  153. bankDepositBranch:"",
  154. payeeName:"",
  155. payeeNumberCard:"",
  156. }
  157. ],
  158. ModelIndex: 0,
  159. Model: '',
  160. ModelType: ["高栏", "集装箱", "自卸车"],
  161. carLong: '',
  162. carLongIndex: 0,
  163. carLongType: ['13', '9.6', '8.2', '8.7', '11.7', '12.5', '13.7', '15', '16', '17.5'],
  164. DriverViewInfo:{},
  165. }
  166. },
  167. onLoad(options){
  168. this.DriverViewInfo = JSON.parse(options.DriverViewInfo)
  169. },
  170. methods: {
  171. jumpUrl(){
  172. for(var i = 0 ; i < this.driverCarInfoList.length ; i++){
  173. if (!this.driverCarInfoList[i].carNumber) {
  174. this.$api.msg('车牌号不能为空')
  175. return
  176. }
  177. if (!this.driverCarInfoList[i].carModel) {
  178. this.$api.msg('车型不能为空')
  179. return
  180. }
  181. if (!this.driverCarInfoList[i].carLength) {
  182. this.$api.msg('车长不能为空')
  183. return
  184. }
  185. if (!this.driverCarInfoList[i].carLoad) {
  186. this.$api.msg('载重不能为空')
  187. return
  188. }
  189. if (!this.driverCarInfoList[i].yearManufacture) {
  190. this.$api.msg('出厂年份不能为空')
  191. return
  192. }
  193. }
  194. for(var i = 0 ; i < this.driverPayeeInfoList.length ; i++){
  195. if (!this.driverPayeeInfoList[i].accountType) {
  196. this.$api.msg('账户类型不能为空')
  197. return
  198. }
  199. // if (!this.driverCarInfoList[i].cardAddressUrl) {
  200. // this.$api.msg('银行卡照片不能为空')
  201. // }
  202. if (!this.driverPayeeInfoList[i].bankCard) {
  203. this.$api.msg('银行卡号不能为空')
  204. return
  205. }
  206. if (!this.driverPayeeInfoList[i].bankDeposit) {
  207. this.$api.msg('开户行不能为空')
  208. return
  209. }
  210. if (!this.driverPayeeInfoList[i].bankDepositBranch) {
  211. this.$api.msg('开户支行不能为空')
  212. return
  213. }
  214. if (!this.driverPayeeInfoList[i].payeeName) {
  215. this.$api.msg('收款人姓名不能为空')
  216. return
  217. }
  218. if (!this.driverPayeeInfoList[i].payeeNumberCard) {
  219. this.$api.msg('收款人身份证号不能为空')
  220. return
  221. }
  222. }
  223. this.DriverViewInfo.driverCarInfoList = this.driverCarInfoList
  224. this.DriverViewInfo.driverPayeeInfoList = this.driverPayeeInfoList
  225. var model = JSON.stringify(this.DriverViewInfo);
  226. console.log(this.DriverViewInfo,"sjijsoi")
  227. uni.navigateTo({
  228. url: `/pageD/identity/driverIdentityThree?DriverViewInfo=` + model
  229. })
  230. },
  231. carAdd() {
  232. this.driverCarInfoList.push({
  233. carNumber: '',
  234. carModel: "",
  235. carLength: "",
  236. carLoad: "",
  237. yearManufacture: "",
  238. })
  239. },
  240. userAdd() {
  241. this.driverPayeeInfoList.push({
  242. accountType:"",
  243. cardAddressUrl:"",
  244. bankCard:"",
  245. bankDeposit:"",
  246. bankDepositBranch:"",
  247. payeeName:"",
  248. payeeNumberCard:"",
  249. })
  250. },
  251. carDel(index) {
  252. if (this.driverCarInfoList.length > 1) {
  253. this.driverCarInfoList.splice(index, 1)
  254. }
  255. },
  256. userDel(index) {
  257. if (this.driverPayeeInfoList.length > 1) {
  258. this.driverPayeeInfoList.splice(index, 1)
  259. }
  260. },
  261. ModelChange(e) {
  262. this.ModelIndex = e.detail.value
  263. this.Model = this.ModelType[this.ModelIndex];
  264. this.driverCarInfoList[this.driverCarInfoList.length - 1].carModel = this.ModelType[this.ModelIndex];
  265. },
  266. carLongChange(e) {
  267. this.carLongIndex = e.detail.value
  268. this.carLong = this.carLongType[this.carLongIndex];
  269. this.driverCarInfoList[this.driverCarInfoList.length - 1].carLength = this.carLongType[this.carLongIndex];
  270. },
  271. opencarclick() {
  272. if (this.opencarboolean == false) {
  273. this.opencarboolean = true;
  274. this.opencar = "../../static/img/authentication/up2%20(3).png"
  275. } else if (this.opencarboolean == true) {
  276. this.opencarboolean = false;
  277. this.opencar = "../../static/img/authentication/down2@3x.png"
  278. }
  279. },
  280. openuserclick() {
  281. if (this.openuserboolean == false) {
  282. this.openuserboolean = true;
  283. this.openuser = "../../static/img/authentication/up2%20(3).png"
  284. } else if (this.openuserboolean == true) {
  285. this.openuserboolean = false;
  286. this.openuser = "../../static/img/authentication/down2@3x.png"
  287. }
  288. }
  289. }
  290. }
  291. </script>
  292. <style scoped>
  293. .center {
  294. padding: 10px 20px;
  295. background-color: #F5F6FA;
  296. }
  297. .c-row {
  298. display: -webkit-box;
  299. display: -webkit-flex;
  300. display: flex;
  301. -webkit-box-align: center;
  302. -webkit-align-items: center;
  303. align-items: center;
  304. padding: 20rpx 30rpx;
  305. position: relative;
  306. line-height: 36px;
  307. }
  308. .con-list {
  309. -webkit-box-flex: 1;
  310. -webkit-flex: 1;
  311. flex: 1;
  312. display: -webkit-box;
  313. display: -webkit-flex;
  314. display: flex;
  315. -webkit-box-orient: vertical;
  316. -webkit-box-direction: normal;
  317. -webkit-flex-direction: column;
  318. flex-direction: column;
  319. color: #AFB3BF;
  320. line-height: 40rpx;
  321. text-align: right;
  322. padding-right: 20rpx;
  323. font-size: 14px;
  324. }
  325. .open {
  326. width: 30px;
  327. height: 20px;
  328. }
  329. .information {
  330. margin-top: 10px;
  331. width: 100%;
  332. height: 56px;
  333. background-color: #FFFFFF;
  334. border-radius: 16px;
  335. }
  336. .informations {
  337. margin-top: 10px;
  338. background-color: #FFFFFF;
  339. border-radius: 20px;
  340. }
  341. .btn {
  342. margin-top: 10px;
  343. background-color: #FFFFFF;
  344. border-radius: 25px;
  345. border: none;
  346. }
  347. .btns{
  348. background-color: #22C572;
  349. }
  350. .add{
  351. width: 26px;
  352. height: 26px;
  353. margin-top: 10px;
  354. /* background-image: url(../../static/img/jiaoyi/ic_fabu@3x.png); */
  355. }
  356. /* 清除 */
  357. .eliminate {
  358. width: 20px;
  359. height: 20px;
  360. float: right;
  361. }
  362. </style>