addcompany.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. <template>
  2. <view class="content">
  3. <web-view :src="srcHandler()" v-if="isSshowPlayVideo"></web-view>
  4. <!-- <u-navbar leftText="返回" title="企业认证" :safeAreaInsetTop="true">
  5. <view class="u-nav-slot" slot="left">
  6. <u-icon @click='navback' name="arrow-left" size="19"></u-icon>
  7. </view>
  8. <view class="u-nav-slot" slot="right">
  9. <view @click="goDetailPage('/pages/mine/company/addcompanythree')" class='next'>下一步</view>
  10. </view>
  11. </u-navbar> -->
  12. <view style='margin:10px 0 0 19px;font-size:12px;color:#EF4034;'>注:企业认证仅限该企业法定代表人本人完成。</view>
  13. <view class='wrap'>
  14. <view class="flex border-bottom mt20 align-center">
  15. <view class="left">企业名称</view>
  16. <view class="flex right">
  17. <u--input placeholder="输入企业名称" inputAlign='left' border="none" v-model="dataDetails.companyName">
  18. </u--input>
  19. </view>
  20. </view>
  21. <view class="flex border-bottom mt20 align-center">
  22. <view class="left">法定代表人姓名</view>
  23. <view class="flex right">
  24. <u--input placeholder="输入法定代表人姓名" inputAlign='left' border="none"
  25. v-model="dataDetails.legalPersonName">
  26. </u--input>
  27. </view>
  28. </view>
  29. <view class="flex border-bottom mt20 align-center">
  30. <view class="left">联系电话</view>
  31. <view class="flex right">
  32. <u--input disabledColor='#fff' disabled placeholder="输入联系电话" inputAlign='left' border="none"
  33. v-model="dataDetails.phone">
  34. </u--input>
  35. </view>
  36. </view>
  37. <view class="flex mt20 align-center">
  38. <view class="left">注册实缴金额</view>
  39. <view class="flex right align-center">
  40. <u--input placeholder="输入企业注册实缴金额" inputAlign='left' border="none"
  41. v-model="dataDetails.registeredPaidAmount">
  42. </u--input>
  43. <view>万元</view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class='content1'>
  48. <view class="title">上传营业执照</view>
  49. <view style='position:relative;' @click="uploadImg(1)">
  50. <view v-if='!dataDetails.businessLicenseAddressUrl' class="picture picture7">
  51. <image class="xj-image" src="@/static/mine/ic_shanchuan@2x.png"></image>
  52. <view class="text">上传营业执照</view>
  53. </view>
  54. <view v-if='dataDetails.businessLicenseAddressUrl' @click.stop="uploadImg(1)"
  55. class="preview-card-img picture ">
  56. <view @click.stop="delCard(1)">
  57. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  58. </image>
  59. </view>
  60. <image class="" :src="dataDetails.businessLicenseAddressUrl" mode="aspectFit"></image>
  61. </view>
  62. </view>
  63. <view class="flex row">
  64. <view class="left-text">营业期限截止日期</view>
  65. <view style='font-size:16px;width:50%;' class='flex flex-space-between'
  66. @click="selectValidityPeriod(0)">
  67. <view :style="{'color':dataDetails.businessTermDate ? '#000':'#C6CBD5'}">
  68. {{dataDetails.businessTermDate?dataDetails.businessTermDate:'选择期限截止日期'}}
  69. </view>
  70. <view>
  71. <u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="flex row noborder">
  76. <view class="left-text">统一社会信用代码</view>
  77. <u--input placeholder="请输入统一社会信用代码" inputAlign='left' border="none"
  78. v-model="dataDetails.unifiedSocialCreditCode">
  79. </u--input>
  80. </view>
  81. <view class="flex row noborder">
  82. <view class="left-text">企业用地是否自有</view>
  83. <u-radio-group placement="row" class="select-type" v-model="dataDetails.landOwnership">
  84. <u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
  85. :label="item.name" :name="item.name" @change="radioChange($event,item)" labelSize='12px'
  86. :iconSize='4'>
  87. </u-radio>
  88. </u-radio-group>
  89. </view>
  90. </view>
  91. <view class='content2'>
  92. <view class="title">{{dataDetails.landOwnership=='自有'?'上传房产证':'上传租赁合同(扫描件或图片)'}}</view>
  93. <view style='position:relative;'>
  94. <view v-if='!dataDetails.propertyAddressUrl' @click="uploadImg(2)" class="picture">
  95. <image class="xj-image" src="@/static/mine/company/tianjiazhaopian@3x.png"></image>
  96. </view>
  97. <view v-if='dataDetails.propertyAddressUrl' @click.stop="uploadImg(2)" class="preview-card-img picture">
  98. <view @click.stop="delCard(2)">
  99. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  100. </image>
  101. </view>
  102. <image class="uploadimage" :src="dataDetails.propertyAddressUrl" mode="aspectFit"></image>
  103. </view>
  104. </view>
  105. </view>
  106. <view class='content3' v-if="dataDetails.landOwnership=='租赁'">
  107. <view class="flex row flex-space-between">
  108. <view class="left-text">场地租赁截止日期</view>
  109. <view class='flex flex-space-between' @click="selectValidityPeriod(1)">
  110. <view :style="{'color':dataDetails.siteLeaseDate ? '#000':'#C6CBD5'}">
  111. {{dataDetails.siteLeaseDate?dataDetails.siteLeaseDate:'选择日期'}}
  112. </view>
  113. <view>
  114. <u-icon name="arrow-right" color="#7E7E7E" size="12"></u-icon>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <!-- http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 -->
  120. <!-- dataDetails.videoAddressUrl -->
  121. <view class='content3' v-if="!dataDetails.videoAddressUrl"
  122. @click="goDetailPage('/pages/mine/company/addcompanythree')">
  123. <view class="left-text">视频验证(打开摄像头并阅读提示文字)</view>
  124. <view class="video-icon">
  125. <u-icon size="40" name="camera-fill"></u-icon>
  126. </view>
  127. </view>
  128. <view class='content3' v-if="dataDetails.videoAddressUrl">
  129. <view class="left-text">视频验证(点击按钮播放视频)</view>
  130. <view >
  131. <view class="video-icon">
  132. <u-icon size="40" name="play-circle-fill" @click="isSshowPlayVideo=true"></u-icon>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="content4">
  137. <view class="flex row noborder mt20 flex-space-between">
  138. <view class="left-text">申请开通平台垫付运费业务</view>
  139. <view>
  140. <u-switch @change="change" v-model="value" inactiveColor='#ABB0BB' size="20"></u-switch>
  141. </view>
  142. </view>
  143. <view class="flex service align-center">
  144. <u--image @click='consent'
  145. :src="consentStatus==true?'../../../static/images/mine/duihao@2x.png':'../../../static/images/mine/wxz.png'"
  146. width="12px" height="12px"></u--image>
  147. 我已阅读并同意
  148. <navigator
  149. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
  150. class="path" hover-class="navigator-hover">《服务协议》</navigator>和<navigator
  151. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
  152. class="path" hover-class="navigator-hover">《隐私政策》</navigator>
  153. </view>
  154. </view>
  155. <view class='footer'>
  156. <!-- <view @click="goDetailPage('/pages/mine/company/addcompanythree')" class='newlyIncreased'>下一步</view> -->
  157. <view @click="submit()" class='newlyIncreased'>提交</view>
  158. </view>
  159. <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
  160. @change="changeHandler" @cancel="isShowcardValidity=false">
  161. </u-picker>
  162. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  163. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  164. </u-action-sheet>
  165. </view>
  166. </template>
  167. <script>
  168. import {
  169. mapState
  170. } from 'vuex';
  171. import upload from '@/components/upload.vue';
  172. import uploadImage from '@/components/ossutil/uploadFile.js';
  173. export default {
  174. components: {},
  175. data() {
  176. return {
  177. isSshowPlayVideo: false,
  178. srcHandler() {
  179. //
  180. return `/hybrid/html/play.html?src=${this.dataDetails.videoAddressUrl}`
  181. },
  182. consentStatus: false,
  183. ValidityPeriodType: '',
  184. value: true,
  185. radioCustomStyle: {
  186. margin: '0 0 0 20rpx'
  187. },
  188. radiolist1: [{
  189. name: '自有',
  190. disabled: false
  191. },
  192. {
  193. name: '租赁',
  194. disabled: false
  195. },
  196. ],
  197. isShowcardValidity: false,
  198. uploadType: '',
  199. index: '',
  200. isShowimgType: false,
  201. validityPeriod: [],
  202. checked: false,
  203. checked1: false,
  204. dataDetails: {
  205. phone: '',
  206. businessLicenseAddressUrl: '',
  207. propertyAddressUrl: '',
  208. advanceFreightService: 1,
  209. landOwnership: '自有',
  210. videoAddressUrl: null
  211. }
  212. }
  213. },
  214. onLoad(options) {
  215. this.validityPeriod = this.$helper.makeValidityPeriod(0, '长期')
  216. console.log(this)
  217. this.dataDetails.commonId = this.userInfo.id
  218. this.dataDetails.phone = this.userInfo.phone
  219. console.log('```````````````')
  220. console.log(options)
  221. this.dataDetails.videoAddressUrl = options.videoSrc
  222. },
  223. computed: {
  224. ...mapState(['hasLogin', 'userInfo']),
  225. },
  226. methods: {
  227. loadedmetadata(event) {
  228. console.log(event)
  229. },
  230. loadeddata(event) {
  231. console.log(event)
  232. },
  233. videoErrorCallback: function(e) {
  234. uni.showModal({
  235. content: e.target.errMsg,
  236. showCancel: false
  237. })
  238. },
  239. submit() {
  240. uni.showLoading({
  241. title: '加载中',
  242. mask: true
  243. })
  244. var _this = this
  245. this.$request.baseRequest('post', '/companyInfo/api/addCompanyInfo', _this.dataDetails).then(res => {
  246. uni.hideLoading()
  247. uni.$u.toast('提交成功')
  248. this.goDetailPage('/pages/mine/company/index')
  249. })
  250. .catch(res => {
  251. uni.hideLoading()
  252. uni.showToast({
  253. title: res.message,
  254. icon: 'none',
  255. duration: 2000
  256. })
  257. });
  258. },
  259. consent() {
  260. this.consentStatus = !this.consentStatus
  261. },
  262. change(e) {
  263. if (this.value) {
  264. this.$set(this.dataDetails, 'advanceFreightService', 1)
  265. } else {
  266. this.$set(this.dataDetails, 'advanceFreightService', 0)
  267. }
  268. },
  269. radioChange(n) {
  270. console.log('radioChange', n);
  271. this.dataDetails.landOwnership = n
  272. console.log('this.dataDetails.landOwnership', this.dataDetails.landOwnership);
  273. },
  274. delCard(type) {
  275. if(type==1){}else{
  276. }
  277. this.dataDetails.businessLicenseAddressUrl = ''
  278. this.$forceUpdate()
  279. },
  280. navBack() {
  281. uni.navigateBack();
  282. },
  283. checkedchange() {
  284. this.checked = !this.checked
  285. if (this.checked) {
  286. this.dataDetails.landOwnership = 0
  287. this.checked1 = false
  288. } else {
  289. }
  290. },
  291. checkedchange1() {
  292. this.checked1 = !this.checked1
  293. if (this.checked1) {
  294. this.dataDetails.landOwnership = 1
  295. this.checked = false
  296. } else {
  297. }
  298. },
  299. clickcancel() {
  300. this.isShowcardValidity = false
  301. },
  302. imgTypeSelect(val) {
  303. var _this = this
  304. if (val.name == '相册') {
  305. uni.chooseImage({
  306. count: 1,
  307. sourceType: this.$helper.chooseImage.sourceType,
  308. success: function(res) {
  309. console.log(JSON.stringify(res.tempFilePaths));
  310. uploadImage(res.tempFilePaths[0], 'appData/',
  311. result => {
  312. // 上传成功回调函数
  313. console.log('图片地址', result)
  314. switch (_this.uploadType) {
  315. // 身份正面
  316. case 1:
  317. _this.dataDetails.businessLicenseAddressUrl = result
  318. console.log(_this.dataDetails.businessLicenseAddressUrl)
  319. break
  320. // 身份反面
  321. case 2:
  322. _this.dataDetails.propertyAddressUrl = result
  323. console.log(_this.dataDetails.propertyAddressUrl)
  324. break
  325. case 3:
  326. break;
  327. }
  328. }
  329. )
  330. }
  331. });
  332. } else {
  333. uni.chooseImage({
  334. count: 1,
  335. sourceType: ['camera'],
  336. success: function(res) {
  337. console.log(JSON.stringify(res.tempFilePaths));
  338. uploadImage(res.tempFilePaths[0], 'appData/',
  339. result => {
  340. // 上传成功回调函数
  341. console.log('图片地址', result)
  342. _this.dataDetails.businessLicenseAddressUrl = result
  343. }
  344. )
  345. }
  346. });
  347. }
  348. },
  349. uploadImg(type) {
  350. this.uploadType = type
  351. this.isShowimgType = true
  352. // this.index = index
  353. },
  354. goDetailPage(src) {
  355. uni.setStorage({
  356. key: 'companydata',
  357. data: JSON.stringify(this.dataDetails)
  358. });
  359. uni.$u.route(src);
  360. },
  361. selectValidityPeriod(type) {
  362. this.ValidityPeriodType = type
  363. this.isShowcardValidity = true
  364. },
  365. confirmValidityPeriod(e) {
  366. switch (this.ValidityPeriodType) {
  367. case 0:
  368. if (e.value[0] == '长期') {
  369. this.dataDetails.businessTermDate = e.value[0]
  370. } else {
  371. this.dataDetails.businessTermDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  372. }
  373. break
  374. case 1:
  375. if (e.value[0] == '长期') {
  376. this.dataDetails.siteLeaseDate = e.value[0]
  377. } else {
  378. this.dataDetails.siteLeaseDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  379. }
  380. break
  381. }
  382. console.log('confirm', e)
  383. this.isShowcardValidity = false
  384. },
  385. changeHandler(e) {
  386. const {
  387. columnIndex,
  388. value,
  389. values,
  390. index,
  391. picker = this.$refs.uPicker
  392. } = e
  393. // if (columnIndex === 0) {
  394. //
  395. // if (e.index != 0) {
  396. // picker.setColumnValues(1, this.validityPeriod[1].shift())
  397. // }
  398. // } else if (columnIndex === 1) {
  399. // if (e.index != 0) {
  400. // picker.setColumnValues(2, this.validityPeriod[2].shift())
  401. // }
  402. // }
  403. },
  404. }
  405. }
  406. </script>
  407. <style lang="scss" scoped>
  408. .content {
  409. padding: 0 0 200rpx 0;
  410. }
  411. page {
  412. background: #F5F6FA;
  413. }
  414. .next {
  415. color: #2772FB;
  416. font-size: 13px;
  417. }
  418. .wrap {
  419. background: #fff;
  420. padding: 20rpx 30rpx;
  421. border-radius: 5px;
  422. margin: 20rpx;
  423. .left {
  424. width: 240rpx;
  425. font-size: 28rpx;
  426. }
  427. .right {
  428. font-size: 28rpx;
  429. width: calc(100% - 240rpx);
  430. }
  431. }
  432. .preview-card-img {
  433. // /deep/uni-image>div, uni-image>img {
  434. // transform: scale(1.5) rotate(-90deg);
  435. // }
  436. }
  437. .picture {
  438. margin-top: 20rpx;
  439. background: #F5F6FA;
  440. width: 212rpx;
  441. height: 212rpx;
  442. border-radius: 20rpx;
  443. display: flex;
  444. flex-direction: column;
  445. justify-content: center;
  446. align-items: center;
  447. color: #6A7282;
  448. }
  449. .content1 {
  450. background: #fff;
  451. padding: 20rpx;
  452. margin: 20rpx;
  453. border-radius: 10rpx;
  454. .row {
  455. border-bottom: 1px solid #EEEEEE;
  456. padding-bottom: 28rpx;
  457. margin-top: 26rpx;
  458. }
  459. .left-text {
  460. // background: red;
  461. width: 320rpx;
  462. color: #333333;
  463. display: flex;
  464. align-items: center;
  465. font-size: 14px;
  466. }
  467. .picture {
  468. position: relative;
  469. width: 100%;
  470. height: 440rpx;
  471. display: flex;
  472. justify-content: center;
  473. flex-direction: column;
  474. align-items: center;
  475. .text {
  476. margin-top: 20rpx;
  477. }
  478. }
  479. .picture7 {
  480. background: url(../../../static/mine/cy.png);
  481. background-size: 100% 100%;
  482. }
  483. .xj-image {
  484. width: 100rpx;
  485. height: 100rpx;
  486. }
  487. .title {
  488. color: #999999;
  489. margin: 20rpx 0;
  490. }
  491. }
  492. .content2,
  493. .content3,
  494. .content4 {
  495. background: #fff;
  496. padding: 20rpx;
  497. margin: 20rpx;
  498. border-radius: 10rpx;
  499. }
  500. .u-input {
  501. font-size: 16px;
  502. }
  503. .content4 {}
  504. .del-card {
  505. position: absolute;
  506. top: -10rpx;
  507. right: -6rpx;
  508. width: 80rpx;
  509. height: 80rpx;
  510. z-index: 9;
  511. }
  512. .footer {
  513. position: fixed;
  514. background: #fff;
  515. width: 100%;
  516. bottom: 0;
  517. left: 0;
  518. padding: 40rpx 60rpx;
  519. box-sizing: border-box;
  520. }
  521. .newlyIncreased {
  522. width: 100%;
  523. height: 80rpx;
  524. margin: 0 auto;
  525. text-align: center;
  526. color: #fff;
  527. background: #2772FB;
  528. background-size: 100%;
  529. border-radius: 50rpx;
  530. display: flex;
  531. align-items: center;
  532. justify-content: center;
  533. }
  534. .u-checkbox-label--left {
  535. margin: 0 10px;
  536. }
  537. .service {
  538. font-size: 24rpx;
  539. margin: 20rpx;
  540. justify-content: center;
  541. /deep/.u-image {
  542. margin: 0 20rpx;
  543. }
  544. }
  545. .video-icon {
  546. margin-top: 20rpx;
  547. background: #F5F6FA;
  548. width: 212rpx;
  549. height: 211rpx;
  550. border-radius: 20rpx;
  551. display: flex;
  552. flex-direction: column;
  553. justify-content: center;
  554. align-items: center;
  555. color: #6A7282;
  556. }
  557. </style>