processidentity.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. <template>
  2. <view class="process">
  3. <view class="process-header">
  4. <view class="process-header-text">
  5. <view class="process-header-text-neishi" @click="topgi">
  6. <view class="process-header-text-icon">
  7. <image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
  8. </image>
  9. </view>
  10. </view>
  11. <view class="process-header-text-title">
  12. 店铺入驻
  13. </view>
  14. </view>
  15. </view>
  16. <view class="process-zhuti">
  17. <view class="process-zhuti-yi">
  18. <view class="process-zhuti-yi-text">
  19. 请上传身份证人像面:
  20. </view>
  21. <view class="process-zhuti-yi-upload" @click="cardPositivePerson">
  22. <image v-if="merchantspersonal.card_positive_person" :src="merchantspersonal.card_positive_person"
  23. mode=""></image>
  24. <image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822174457868.png" mode="">
  25. </image>
  26. </view>
  27. </view>
  28. <view class="process-zhuti-yi">
  29. <view class="process-zhuti-yi-text">
  30. 请上传身份证国徽面:
  31. </view>
  32. <view class="process-zhuti-yi-upload" @click="cardBackPerson">
  33. <image v-if="merchantspersonal.card_back_person" :src="merchantspersonal.card_back_person" mode="">
  34. </image>
  35. <image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822174524262.png" mode="">
  36. </image>
  37. </view>
  38. </view>
  39. <view class="process-zhuti-yi">
  40. <view class="process-zhuti-yi-text">
  41. 身份证号
  42. </view>
  43. <view class="process-zhuti-yi-input">
  44. <input placeholder="请填写身份证号" v-model="merchantspersonal.idcard_no">
  45. </view>
  46. </view>
  47. <view class="process-zhuti-yi">
  48. <view class="process-zhuti-yi-text">
  49. 身份证有效期限
  50. </view>
  51. <view class="process-zhuti-yi-input" style="display: flex;">
  52. <uni-datetime-picker type="date" :clear-icon="false" v-model="merchantspersonal.identification_valid_date_start" @maskClick="maskClick">
  53. <input placeholder="有效期限开始" v-model="merchantspersonal.identification_valid_date_start" disabled>
  54. </uni-datetime-picker>
  55. <view class="" style="width: 100rpx;height: 100%;background-color: rgba(31, 124, 255, 0.1); display: flex;justify-content: center;align-items: center; color: #B6B6B6;">
  56. ——
  57. </view>
  58. <!-- :disabled="merchantspersonal.identification_valid_date_end == '长期' ? true : false" -->
  59. <uni-datetime-picker type="date" :clear-icon="false" v-model="merchantspersonal.identification_valid_date_end" @maskClick="maskClick">
  60. <input placeholder="有效期限结束" v-model="merchantspersonal.identification_valid_date_end" disabled>
  61. </uni-datetime-picker>
  62. <checkbox-group style="line-height: 94rpx;background: rgba(31, 124, 255, 0.1);padding: 0 20rpx;" @change="checkboxChange">
  63. <label>
  64. <checkbox value="2099-12-31" />长期
  65. </label>
  66. </checkbox-group>
  67. <!-- <uni-datetime-picker v-model="range" type="date" @change="changeLog" style="display: flex;">
  68. <input placeholder="请填写身份证有效期限" v-model="merchantspersonal.identification_valid_date_start" disabled>
  69. </uni-datetime-picker>
  70. <uni-datetime-picker v-model="range" type="date" @change="changeLog" style="display: flex;">
  71. <input placeholder="请填写身份证有效期限" v-model="merchantspersonal.identification_valid_date_end" disabled>
  72. </uni-datetime-picker> -->
  73. </view>
  74. </view>
  75. <view class="process-zhuti-yi">
  76. <view class="process-zhuti-yi-text">
  77. 联系人姓名
  78. </view>
  79. <view class="process-zhuti-yi-input">
  80. <input placeholder="请填写联系人姓名" v-model="merchantspersonal.name">
  81. </view>
  82. </view>
  83. <view class="process-zhuti-yi">
  84. <view class="process-zhuti-yi-text">
  85. 联系人手机号
  86. </view>
  87. <view class="process-zhuti-yi-input">
  88. <input placeholder="请填写联系人手机号" maxlength="11" v-model="merchantspersonal.phone" @input="inputPhone">
  89. </view>
  90. </view>
  91. <view class="process-zhuti-yi">
  92. <view class="process-zhuti-yi-text">
  93. 联系人邮箱
  94. </view>
  95. <view class="process-zhuti-yi-input">
  96. <input placeholder="请填写联系人邮箱" v-model="merchantspersonal.email">
  97. </view>
  98. </view>
  99. </view>
  100. <view class="process-zhuti-fot">
  101. <view class="process-zhuti-fottext">
  102. <view class="fottext-img" @click="agreement = !agreement">
  103. <image v-if="agreement" src="https://cdn.bjtdba.com/vod/image/2022-08-23/20220823132347513.png"
  104. mode=""></image>
  105. <image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822155008662.png" mode="">
  106. </image>
  107. </view>
  108. <view class="fottext-nav">
  109. 点击表示同意<span style="color: #1f7cff" @click="xieyi()">《商家入驻协议》</span>
  110. </view>
  111. </view>
  112. <view class="process-zhuti-btnbox">
  113. <view class="process-zhuti-btn backbtn" @click="backStep">
  114. 上一步
  115. </view>
  116. <view :class="[btnBir ? 'btn-bir' : '', 'process-zhuti-btn' ]" @click="btnBir ? goIdentity() : ''">
  117. 立即申请
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. import {
  125. merchaSettlen,
  126. updateMerchaSettlen
  127. } from '@/commit/api.js';
  128. import {
  129. mapGetters
  130. } from 'vuex';
  131. export default {
  132. data() {
  133. return {
  134. merchantspersonal: {
  135. card_positive_person: '', // 身份证正面
  136. card_back_person: '', // 身份证反面
  137. idcard_no: '', // 身份证号
  138. identification_valid_date_start: '', // 身份证开始时间
  139. identification_valid_date_end: '', // 身份证结束时间
  140. name: '', //姓名
  141. phone: '', // 手机号
  142. email: '', // 邮箱
  143. uid: ''
  144. },
  145. longtime:'',
  146. value: 0,
  147. range: [],
  148. agreement: false,
  149. merchantData: {},
  150. btnBir: false,
  151. nextMerchantsData: {}
  152. }
  153. },
  154. computed: {
  155. ...mapGetters(['merchantsDataAlls'])
  156. },
  157. onLoad(opsition) {
  158. this.identification_valid_date_end
  159. console.log(this.merchantspersonal.identification_valid_date_end,"989898")
  160. let userinfo = uni.getStorageSync('userinfo')
  161. this.merchantspersonal.uid = userinfo.uid
  162. const merchantsDataAll = this.merchantsDataAlls.merchantsDataAll;
  163. if (JSON.stringify(merchantsDataAll) != "{}") {
  164. this.range = [merchantsDataAll.identification_valid_date_start, merchantsDataAll
  165. .identification_valid_date_end
  166. ];
  167. this.merchantspersonal.card_positive_person = merchantsDataAll.card_positive_person; // 身份证正面
  168. this.merchantspersonal.card_back_person = merchantsDataAll.card_back_person; // 身份证反面
  169. this.merchantspersonal.idcard_no = merchantsDataAll.idcard_no; // 身份证号
  170. this.merchantspersonal.identification_valid_date_start = merchantsDataAll.identification_valid_date_start; // 身份证开始时间
  171. this.merchantspersonal.identification_valid_date_end = merchantsDataAll.identification_valid_date_end; // 身份证结束时间
  172. this.merchantspersonal.name = merchantsDataAll.name; // 姓名
  173. this.merchantspersonal.phone = merchantsDataAll.phone; // 手机号
  174. this.merchantspersonal.email = merchantsDataAll.email; // 邮箱
  175. }
  176. },
  177. watch: {
  178. merchantspersonal: {
  179. handler: function(val) {
  180. this.isShow(val)
  181. },
  182. deep: true
  183. },
  184. agreement: {
  185. handler: function(val) {
  186. this.isShow()
  187. }
  188. }
  189. },
  190. methods: {
  191. maskClick(e){
  192. console.log('maskClick事件:', e);
  193. },
  194. checkboxChange: function (e) {
  195. if(e.detail.value){
  196. this.longtime = e.detail.value[0];
  197. }else{
  198. this.longtime = "";
  199. }
  200. },
  201. topgi() {
  202. uni.navigateBack({
  203. delta: 1
  204. });
  205. },
  206. //商户协议
  207. xieyi() {
  208. uni.setStorageSync('agreementType','6')
  209. uni.navigateTo({
  210. url: "/pages/index/bottombat?type=6"
  211. })
  212. },
  213. isShow(list) {
  214. let temp = true
  215. if (list) {
  216. for (let i in list) {
  217. if (list[i] == "" || list[i] == null) {
  218. temp = false
  219. }
  220. }
  221. }
  222. if (!this.agreement) {
  223. temp = false
  224. }
  225. this.btnBir = temp
  226. },
  227. // 身份证正面
  228. cardPositivePerson() {
  229. let that = this;
  230. that.$time.uploadPictures(res => {
  231. that.merchantspersonal.card_positive_person = res;
  232. });
  233. },
  234. // 身份证反面
  235. cardBackPerson() {
  236. let that = this;
  237. that.$time.uploadPictures(res => {
  238. that.merchantspersonal.card_back_person = res;
  239. });
  240. },
  241. // 身份证有效期
  242. changeLog(e) {
  243. // this.merchantspersonal.identification_valid_date_start = e[0];
  244. // this.merchantspersonal.identification_valid_date_end = e[1];
  245. },
  246. // 手机号
  247. inputPhone(e) {
  248. this.$nextTick(function() {
  249. this.merchantspersonal.phone = e.target.value.replace(/[^\d]/g, '');
  250. })
  251. },
  252. backStep() {
  253. uni.navigateBack({
  254. delta: 1
  255. });
  256. },
  257. goIdentity() {
  258. let that = this;
  259. if (that.merchantspersonal.card_positive_person == "") return uni.showToast({
  260. title: "请上传身份证人像面",
  261. icon: "none"
  262. });
  263. if (that.merchantspersonal.card_back_person == "") return uni.showToast({
  264. title: "请上传身份证国徽面",
  265. icon: "none"
  266. });
  267. if (that.merchantspersonal.idcard_no == "") return uni.showToast({
  268. title: "请填写身份证号",
  269. icon: "none"
  270. });
  271. if (!/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/
  272. .test(that.merchantspersonal.idcard_no)) {
  273. uni.showToast({
  274. title: "请填写有效身份证号",
  275. icon: "none"
  276. });
  277. return
  278. }
  279. if (that.merchantspersonal.identification_valid_date_start == "" && (that.merchantspersonal
  280. .identification_valid_date_end == "" || this.longtime == "")) return uni.showToast({
  281. title: "请选择身份证有效期限",
  282. icon: "none"
  283. });
  284. if (that.merchantspersonal.name == "") return uni.showToast({
  285. title: "请填写联系人姓名",
  286. icon: "none"
  287. });
  288. if (that.merchantspersonal.phone == "")
  289. return uni.showToast({
  290. title: "请填写联系人手机号",
  291. icon: "none"
  292. });
  293. if (!/^1[3456789]\d{9}$/.test(that.merchantspersonal.phone)) {
  294. uni.showToast({
  295. title: "请填写有效联系人手机号",
  296. icon: "none"
  297. });
  298. return
  299. }
  300. if (that.merchantspersonal.email == "") {
  301. uni.showToast({
  302. title: "请填写联系人邮箱",
  303. icon: "none"
  304. });
  305. return
  306. }
  307. if (!/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(
  308. that.merchantspersonal.email)) {
  309. uni.showToast({
  310. title: "请填写有效联系人邮箱",
  311. icon: "none"
  312. });
  313. return
  314. }
  315. if (!that.agreement) return uni.showToast({
  316. title: "请阅读并勾选同意《商家入驻协议》",
  317. icon: "none"
  318. });
  319. if(that.longtime){
  320. that.merchantspersonal.identification_valid_date_end = that.longtime;
  321. }
  322. uni.showLoading({
  323. title: '加载中',
  324. mask: true
  325. });
  326. uni.getStorage({
  327. key: 'merchants_in',
  328. success: function(res) {
  329. that.merchantData = Object.assign(that.merchantData, res.data)
  330. uni.getStorage({
  331. key: 'merchants_in_store',
  332. success: function(res) {
  333. that.merchantData = Object.assign(that.merchantData, res.data, that
  334. .merchantspersonal)
  335. let selectmerchant = uni.getStorageSync('selectmerchant')
  336. let merchantsStatus = that.merchantsDataAlls.merchantsStatus;
  337. if (merchantsStatus == 1) {
  338. //修改信息
  339. that.merchantData = Object.assign(that.merchantData, {
  340. mer_id: selectmerchant.merId
  341. })
  342. updateMerchaSettlen(that.merchantData).then(res => {
  343. if (res.data.status == 200) {
  344. console.log('成功', res);
  345. uni.removeStorage({
  346. key: 'merchants_in'
  347. });
  348. uni.removeStorage({
  349. key: 'merchants_in_store'
  350. });
  351. uni.redirectTo({
  352. url: './processaudit?submitCode=1'
  353. });
  354. uni.hideLoading();
  355. }
  356. }, fail => {
  357. console.log('fail', fail)
  358. uni.hideLoading();
  359. })
  360. } else {
  361. if (selectmerchant.pay_type == 2) {
  362. //修改信息
  363. that.merchantData = Object.assign(that.merchantData, {
  364. mer_id: selectmerchant.merId
  365. })
  366. updateMerchaSettlen(that.merchantData).then(res => {
  367. if (res.data.status == 200) {
  368. console.log('成功', res);
  369. uni.removeStorage({
  370. key: 'merchants_in'
  371. });
  372. uni.removeStorage({
  373. key: 'merchants_in_store'
  374. });
  375. uni.redirectTo({
  376. url: './processaudit?submitCode=1'
  377. });
  378. uni.hideLoading();
  379. }
  380. }, fail => {
  381. console.log('fail', fail)
  382. uni.hideLoading();
  383. })
  384. } else {
  385. // 新增信息
  386. merchaSettlen(that.merchantData).then(res => {
  387. console.log('res', res)
  388. if (res.data.status == 200) {
  389. console.log('成功', res);
  390. uni.removeStorage({
  391. key: 'merchants_in'
  392. });
  393. uni.removeStorage({
  394. key: 'merchants_in_store'
  395. });
  396. uni.redirectTo({
  397. url: './processaudit?submitCode=1'
  398. });
  399. uni.hideLoading();
  400. }
  401. }, fail => {
  402. console.log('fail', fail)
  403. uni.hideLoading();
  404. })
  405. }
  406. }
  407. }
  408. });
  409. }
  410. });
  411. }
  412. }
  413. }
  414. </script>
  415. <style>
  416. page {
  417. background-color: #F7F8FC;
  418. }
  419. </style>
  420. <style lang="scss" scoped>
  421. .process {
  422. width: 100%;
  423. height: 100%;
  424. display: flex;
  425. flex-direction: column;
  426. align-items: center;
  427. justify-content: center;
  428. .process-header {
  429. position: fixed;
  430. top: 0;
  431. left: 0;
  432. z-index: 111;
  433. width: 100%;
  434. height: 176rpx;
  435. background: #FFFFFF;
  436. display: flex;
  437. justify-content: center;
  438. .process-header-text {
  439. width: 686rpx;
  440. font-size: 36rpx;
  441. font-weight: 500;
  442. color: #333333;
  443. display: flex;
  444. margin-top: 107rpx;
  445. align-items: center;
  446. .process-header-text-neishi {
  447. width: 45rpx;
  448. height: 45rpx;
  449. margin-right: 17rpx;
  450. .process-header-text-icon {
  451. width: 36rpx;
  452. height: 36rpx;
  453. margin-top: 2rpx;
  454. image {
  455. width: 100%;
  456. height: 100%;
  457. }
  458. }
  459. }
  460. }
  461. }
  462. .process-zhuti {
  463. width: 100%;
  464. height: auto;
  465. margin-top: 202rpx;
  466. display: flex;
  467. flex-direction: column;
  468. align-items: center;
  469. // padding: 32rpx 0 40rpx;
  470. padding-bottom: 40rpx;
  471. background: #FFFFFF;
  472. .process-zhuti-yi {
  473. width: 686rpx;
  474. // height: 150rpx;
  475. display: flex;
  476. flex-direction: column;
  477. justify-content: space-between;
  478. align-items: flex-start;
  479. margin-top: 32rpx;
  480. .process-zhuti-yi-text {
  481. font-size: 30rpx;
  482. font-weight: 500;
  483. color: #333333;
  484. margin-bottom: 26rpx;
  485. }
  486. .process-zhuti-yi-input {
  487. width: 100%;
  488. height: 94rpx;
  489. // background: #1F7CFF;
  490. // 31 124 255 10
  491. border-radius: 8rpx;
  492. // opacity: 0.1;
  493. input {
  494. width: 100%;
  495. height: 94rpx;
  496. background: rgba(31, 124, 255, 0.1);
  497. border-radius: 8rpx;
  498. box-sizing: border-box;
  499. padding-left: 32rpx;
  500. }
  501. }
  502. .process-zhuti-yi-upload {
  503. width: 100%;
  504. // height: 404rpx;
  505. // background: rgba(31, 124, 255, 0.1);
  506. border-radius: 8rpx;
  507. display: flex;
  508. justify-content: center;
  509. align-items: center;
  510. image {
  511. width: 520rpx;
  512. height: 279rpx;
  513. border: 1rpx dashed #aaa;
  514. }
  515. }
  516. }
  517. }
  518. .process-zhuti-fot {
  519. margin: 50rpx 0 94rpx;
  520. }
  521. .process-zhuti-fottext {
  522. font-size: 24rpx;
  523. margin-bottom: 20rpx;
  524. .fottext-img {
  525. display: inline-block;
  526. vertical-align: middle;
  527. image {
  528. width: 28rpx;
  529. height: 28rpx;
  530. margin-right: 15rpx;
  531. }
  532. }
  533. .fottext-nav {
  534. display: inline-block;
  535. }
  536. }
  537. .process-zhuti-btnbox {
  538. color: #FFFFFF;
  539. display: flex;
  540. justify-content: space-between;
  541. }
  542. .process-zhuti-btn {
  543. width: 330rpx;
  544. height: 98rpx;
  545. background: rgba(31, 124, 255, 0.4);
  546. text-align: center;
  547. line-height: 98rpx;
  548. border-radius: 8rpx;
  549. }
  550. .backbtn {
  551. margin-right: 26rpx;
  552. background: #1F7CFF;
  553. }
  554. .btn-bir {
  555. background: #1F7CFF;
  556. }
  557. }
  558. /deep/.uni-date{
  559. width: 50%;
  560. display: inline-block;
  561. }
  562. </style>