移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

431 lignes
13 KiB

  1. <template>
  2. <div class="app-container" :style="{height:height+'px'}">
  3. <!-- <van-nav-bar-->
  4. <!-- title="个人用户注册"-->
  5. <!-- left-arrow-->
  6. <!-- fixed-->
  7. <!-- placeholder-->
  8. <!-- @click-left="onClickLeft"-->
  9. <!-- style="background: linear-gradient(to right,#91E1CA,#E0F4E4);"-->
  10. <!-- />-->
  11. <navBar title="个人用户注册" background="0" positionType="fixed"></navBar>
  12. <van-form @submit="getSubmit">
  13. <div class="block_box">
  14. <div class="block_tt"><i></i>用户信息</div>
  15. <van-field v-model="form.phone" type="tel" label="手机号" placeholder="请输入手机号,作为登录账号" required :rules="[{ required:true }]" />
  16. <!-- <van-field-->
  17. <!-- center-->
  18. <!-- clearable-->
  19. <!-- label="短信验证码"-->
  20. <!-- placeholder="请输入短信验证码"-->
  21. <!-- required-->
  22. <!-- v-model="form.sms"-->
  23. <!-- :rules="[{ required:true }]"-->
  24. <!-- >-->
  25. <!-- <template #button>-->
  26. <!-- <van-button size="small" type="primary" native-type="button" :rules="[{ required:true }]">发送验证码</van-button>-->
  27. <!-- </template>-->
  28. <!-- </van-field>-->
  29. <van-field v-model="form.password" type="password" label="密码" placeholder="请输入密码" required :rules="[{ required:true }]"/>
  30. <van-field v-model="confirmPassWord" type="password" label="确认密码" placeholder="请再次输入密码" required :rules="[{ required:true }]"/>
  31. <van-field v-model="form.realname" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/>
  32. <van-field v-model="form.idCardNum" label="身份证号" placeholder="请输入身份证号" required :rules="[{ required:true }]"/>
  33. <van-field v-model="form.address" label="联系地址" placeholder="请输入联系地址" />
  34. <van-field name="uploader" label="身份证(正)" required :border="false"></van-field>
  35. <van-field name="uploader">
  36. <template #input>
  37. <van-uploader :after-read="afterReadSFZ" :before-delete="deleteFileSFZ" v-model="fileListSFZ" multiple :max-count="1" />
  38. </template>
  39. </van-field>
  40. <p style="color: red;padding: 2vw 3vw;">*身份证照片</p>
  41. </div>
  42. <!-- <van-divider>银行信息</van-divider>-->
  43. <div class="block_box">
  44. <div class="block_tt"><i></i>银行信息</div>
  45. <van-field name="uploader" label="银行卡" required :border="false"></van-field>
  46. <van-field name="uploader">
  47. <template #input>
  48. <van-uploader :after-read="afterReadYHK" :before-delete="deleteFileYHK" v-model="fileListYHK" multiple :max-count="1" />
  49. </template>
  50. </van-field>
  51. <van-field v-model="form.bankCardName" label="开户姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/>
  52. <van-field v-model="form.bankCardNum" label="开户账号" placeholder="请输入开户账号" required :rules="[{ required:true }]"/>
  53. <van-field
  54. v-model="accountType"
  55. is-link
  56. readonly
  57. required
  58. :rules="[{ required:true }]"
  59. label="账户类型"
  60. placeholder="请选择账户类型"
  61. @click="showAccountType = true"
  62. />
  63. <van-popup v-model:show="showAccountType" position="bottom">
  64. <van-picker
  65. show-toolbar
  66. value-key="dictLabel"
  67. :columns="accountTypeOption"
  68. @confirm="onConfirmAccountType"
  69. @cancel="showAccountType = false"
  70. />
  71. </van-popup>
  72. <van-field
  73. v-model="bankType"
  74. is-link
  75. readonly
  76. required
  77. :rules="[{ required:true }]"
  78. label="所属银行"
  79. placeholder="请选择所属银行"
  80. @click="showBankType = true"
  81. />
  82. <van-popup v-model:show="showBankType" position="bottom">
  83. <van-picker
  84. show-toolbar
  85. value-key="dictLabel"
  86. :columns="bankTypeOption"
  87. @confirm="onConfirmBankType"
  88. @cancel="showArea = false"
  89. />
  90. </van-popup>
  91. <van-field
  92. v-model="sheng"
  93. is-link
  94. readonly
  95. label="开户省市"
  96. placeholder="请选择开户省市"
  97. @click="showSheng = true"
  98. />
  99. <van-popup v-model:show="showSheng" position="bottom">
  100. <van-picker
  101. show-toolbar
  102. value-key="label"
  103. :columns="shengOption"
  104. @confirm="onConfirmSheng"
  105. @cancel="showSheng = false"
  106. />
  107. </van-popup>
  108. <van-field v-model="form.bankDeposit" label="关键词" placeholder="请输入开户行地址关键词,如镇街名称"/>
  109. <van-field
  110. v-model="form.bankAddress"
  111. label="开户银行"
  112. placeholder="输入【开户省市、关键词】后:"
  113. required
  114. :rules="[{ required:true }]"
  115. readonly
  116. @click="showBankAddress = true"
  117. >
  118. <template #button>
  119. <van-button size="small" type="primary" native-type="button" @click="searchBankAddress">点击检索</van-button>
  120. </template>
  121. </van-field>
  122. <van-popup v-model:show="showBankAddress" position="bottom">
  123. <van-picker
  124. show-toolbar
  125. value-key="bankDeposit"
  126. :columns="bankAddressOption"
  127. @confirm="onConfirmBankAddress"
  128. @cancel="showBankAddress = false"
  129. />
  130. </van-popup>
  131. <van-field v-model="form.payeePaymentLines" label="联行号" placeholder="开户银行选定后,自动填充!" required :rules="[{ required:true }]"/>
  132. <van-field v-model="form.code" center clearable label="验证码" placeholder="图形验证码" required :rules="[{ required:true }]">
  133. <template #button>
  134. <img class="code-img" :src="codeUrl" @click="getCode" />
  135. </template>
  136. </van-field>
  137. </div>
  138. <div class="submit">
  139. <!-- <p>我已阅读并同意<span>《农村产权交易信息服务平台会员注册协议》</span></p>-->
  140. <van-button round block type="info" color="#0DBCAA" native-type="submit">立即注册</van-button>
  141. </div>
  142. </van-form>
  143. </div>
  144. </template>
  145. <script>
  146. import { getCodeImg } from "@/api/login";
  147. import {userRegister, attachmentUpload, realtimeBackList, depositList} from "@/api/register/index";
  148. import {deleteUserImg, options, realtimeList} from "@/api/user";
  149. import navBar from "@/components/common/nav_bar.vue";
  150. export default {
  151. name: "userRegister",
  152. components: { navBar },
  153. data() {
  154. return {
  155. height:0,
  156. tel:'',
  157. confirmPassWord:'',
  158. form: {
  159. phone: "", //账号
  160. code: "", //验证码
  161. password: "", //密码
  162. realname: "", //姓名
  163. idCardNum: "", //身份证号
  164. address: "", //地址
  165. uuid:'',//图形验证码ID
  166. memberType:1,
  167. economicType:1,
  168. idCardPic :'',
  169. accountOpenCert:'',
  170. bankCardName:'',
  171. bankCardNum:'',
  172. bankAddress:'',
  173. },
  174. codeUrl:'',
  175. fileListSFZ:[],
  176. fileListYHK:[],
  177. hcAreaInfoFieldName: {
  178. text: "label",
  179. value: "value",
  180. children: "children",
  181. },
  182. bankTypeOption:[],
  183. sheng:'',
  184. shi:'',
  185. bankType:'',
  186. accountType:'',
  187. bankDeposit:'',
  188. showBankType:false,
  189. showSheng :false,
  190. shengOption:options,
  191. showShi :false,
  192. shiOption:[],
  193. showBankAddress :false,
  194. accountTypeOption:[],
  195. showAccountType :false,
  196. bankAddressOption:[],
  197. };
  198. },
  199. created() {
  200. this.getCode()
  201. this.getDicts("bank_type_all").then(response => {
  202. this.bankTypeOption = response.data;
  203. });
  204. this.getDicts("bank_account_type").then(response => {
  205. this.accountTypeOption = response.data;
  206. });
  207. this.height = document.body.clientHeight
  208. },
  209. methods: {
  210. getCode() {
  211. getCodeImg().then((res) => {
  212. this.form.uuid = res.uuid;
  213. this.codeUrl = "data:image/gif;base64," + res.img;
  214. });
  215. },
  216. getSubmit(){
  217. console.log(this.form)
  218. if (this.form.password!= this.confirmPassWord){
  219. this.$toast({
  220. icon: 'error', // 找到自己需要的图标
  221. message: '两次密码输入不一致',
  222. duration:"2000",
  223. onClose:function(){
  224. }
  225. })
  226. return;
  227. }
  228. if (this.form.idCardPic == ''){
  229. this.$toast({
  230. icon: 'error', // 找到自己需要的图标
  231. message: '请上传身份证',
  232. duration:"2000",
  233. onClose:function(){
  234. }
  235. })
  236. return;
  237. }
  238. if (this.form.accountOpenCert == ''){
  239. this.$toast({
  240. icon: 'error', // 找到自己需要的图标
  241. message: '请上传银行卡',
  242. duration:"2000",
  243. onClose:function(){
  244. }
  245. })
  246. return;
  247. }
  248. this.$toast.loading({
  249. message: '正在注册...',
  250. forbidClick: true,
  251. });
  252. this.form.accountType = '2';
  253. console.log(this.form);
  254. var that = this
  255. userRegister(this.form).then((res) => {
  256. this.$toast.clear();
  257. this.$toast({
  258. icon: 'success', // 找到自己需要的图标
  259. message: '注册成功',
  260. duration:"2000",
  261. onClose:function(){
  262. that.$router.push({path: '/login'})
  263. }
  264. })
  265. });
  266. },
  267. afterReadSFZ(file) {
  268. // 此时可以自行将文件上传至服务器
  269. this.$toast.loading({
  270. message: "上传中...",
  271. forbidClick: true,
  272. duration: 0,
  273. });
  274. console.log(file)
  275. let params1 = new FormData();
  276. params1.append("file", file.file);
  277. attachmentUpload(params1).then((r1) => {
  278. this.form.idCardPic = r1.fileName;
  279. })
  280. },
  281. afterReadYHK(file) {
  282. // 此时可以自行将文件上传至服务器.
  283. this.$toast.loading({
  284. message: "上传中...",
  285. forbidClick: true,
  286. duration: 0,
  287. });
  288. let params1 = new FormData();
  289. params1.append("file", file.file);
  290. attachmentUpload(params1).then((r1) => {
  291. this.form.accountOpenCert = r1.fileName;
  292. })
  293. },
  294. deleteFileSFZ(elIndex){
  295. return (file, name) => {
  296. let fileIndex = name.index
  297. this.fileListSFZ[elIndex].splice(fileIndex, 1)
  298. this.form.idCardPic = '';
  299. }
  300. },
  301. deleteFileYHK(elIndex){
  302. return (file, name) => {
  303. let fileIndex = name.index
  304. this.fileListYHK[elIndex].splice(fileIndex, 1)
  305. this.form.accountOpenCert = '';
  306. }
  307. },
  308. searchBankAddress(){
  309. let data = {
  310. sheng:this.form.sheng,
  311. shi:this.form.shi,
  312. bankType:this.form.bankType,
  313. bankDeposit:this.form.bankDeposit,
  314. }
  315. depositList(data).then(response => {
  316. if (response.rows.length<1){
  317. if (this.form.sheng==''||this.form.shi==''){
  318. this.$toast({
  319. icon: 'fail', // 找到自己需要的图标
  320. message: '请选择省市',
  321. duration:"1000",
  322. })
  323. return;
  324. }
  325. if (this.form.bankDeposit==''){
  326. this.$toast({
  327. icon: 'fail', // 找到自己需要的图标
  328. message: '请输入关键词',
  329. duration:"1000",
  330. })
  331. return;
  332. }
  333. realtimeBackList(data).then(response2 => {
  334. this.bankAddressOption = response2.data;
  335. });
  336. }else{
  337. this.bankAddressOption = response.rows;
  338. }
  339. });
  340. },
  341. onConfirmBankType(value){
  342. this.showBankType = false;
  343. this.form.bankAddress = '';
  344. this.form.payeePaymentLines = '';
  345. this.bankType = value.dictLabel;
  346. this.form.bankType = value.dictValue;
  347. },
  348. onConfirmSheng(value){
  349. console.log(value)
  350. this.showSheng = false;
  351. this.form.sheng = value[0];
  352. this.form.shi = value[1];
  353. this.sheng = value.join('/');
  354. },
  355. onConfirmBankAddress(value){
  356. console.log(value)
  357. this.form.bankAddress = value.bankDeposit;
  358. this.form.payeePaymentLines = value.payeePaymentLines;
  359. this.showBankAddress = false;
  360. },
  361. onConfirmAccountType(value){
  362. console.log(value)
  363. this.form.accountType = value.dictValue;
  364. this.accountType = value.dictLabel;
  365. this.showAccountType = false;
  366. },
  367. },
  368. };
  369. </script>
  370. <style scoped lang="scss">
  371. .app-container {
  372. background-color: #F4F8FB;
  373. .code-img {
  374. width: 220px;
  375. }
  376. }
  377. .submit{
  378. width: 90%;
  379. margin: 2vh auto 0;
  380. padding-bottom: 5vh;
  381. p{
  382. text-align: center;
  383. margin-bottom: 0.2rem;
  384. span{
  385. color: #007E72;
  386. }
  387. }
  388. }
  389. .block_box{
  390. width: 94%;
  391. margin: 3vw auto;
  392. background: #ffffff;
  393. padding: 3vw 0;
  394. border-radius: 15Px;
  395. overflow: hidden;
  396. .block_tt{
  397. font-size: 20Px;
  398. display: flex;
  399. align-items: center;
  400. padding: 1.6vh 3vw;
  401. line-height: 1;
  402. font-weight: bold;
  403. i{
  404. display: block;
  405. width: 4Px;
  406. height: 16Px;
  407. background: #0CBEA6;
  408. margin-right: 5PX;
  409. border-radius: 5PX;
  410. }
  411. /*border-left: 3Px solid #0CBEA6;*/
  412. }
  413. }
  414. </style>