addcompany.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <view class="content">
  3. <!-- <web-view id="mapContainer" :src="srcHandler()"></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;'>
  50. <view v-if='!dataDetails.businessLicenseAddressUrl' @click="uploadImg(1)" 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' @click="goDetailPage('/pages/mine/company/addcompanythree')">
  122. <video src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" @error="videoErrorCallback" controls></video>
  123. <video src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/appData/video165026727868476.mp4" :play-strategy='3' @error="videoErrorCallback" controls></video>
  124. <view v-if="!dataDetails.videoAddressUrl">
  125. <view class="left-text">视频验证(打开摄像头并阅读提示文字)</view>
  126. <view class="video-icon">
  127. <u-icon size="40" name="camera-fill"></u-icon>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="content4">
  132. <view class="flex row noborder mt20 flex-space-between">
  133. <view class="left-text">申请开通平台垫付运费业务</view>
  134. <view>
  135. <u-switch @change="change" v-model="value" inactiveColor='#ABB0BB' size="20"></u-switch>
  136. </view>
  137. </view>
  138. <view class="flex service align-center">
  139. <u--image @click='consent'
  140. :src="consentStatus==true?'../../static/images/mine/duihao@2x.png':'../../static/images/mine/wxz.png'"
  141. width="12px" height="12px"></u--image>
  142. 我已阅读并同意
  143. <navigator
  144. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
  145. class="path" hover-class="navigator-hover">《服务协议》</navigator>和<navigator
  146. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
  147. class="path" hover-class="navigator-hover">《隐私政策》</navigator>
  148. </view>
  149. </view>
  150. <view class='footer'>
  151. <!-- <view @click="goDetailPage('/pages/mine/company/addcompanythree')" class='newlyIncreased'>下一步</view> -->
  152. <view @click="submit()" class='newlyIncreased'>提交</view>
  153. </view>
  154. <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
  155. @change="changeHandler" @cancel="isShowcardValidity=false">
  156. </u-picker>
  157. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  158. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  159. </u-action-sheet>
  160. </view>
  161. </template>
  162. <script>
  163. import {
  164. mapState
  165. } from 'vuex';
  166. import upload from '@/components/upload.vue';
  167. import uploadImage from '@/components/ossutil/uploadFile.js';
  168. export default {
  169. components: {},
  170. data() {
  171. return {
  172. srcHandler() {
  173. //
  174. return `/hybrid/html/play.html`
  175. },
  176. consentStatus: false,
  177. ValidityPeriodType: '',
  178. value: true,
  179. radioCustomStyle: {
  180. margin: '0 0 0 20rpx'
  181. },
  182. radiolist1: [{
  183. name: '自有',
  184. disabled: false
  185. },
  186. {
  187. name: '租赁',
  188. disabled: false
  189. },
  190. ],
  191. isShowcardValidity: false,
  192. uploadType: '',
  193. index: '',
  194. isShowimgType: false,
  195. validityPeriod: [],
  196. checked: false,
  197. checked1: false,
  198. dataDetails: {
  199. phone: '',
  200. businessLicenseAddressUrl: '',
  201. propertyAddressUrl: '',
  202. advanceFreightService: 1,
  203. landOwnership: '自有',
  204. videoAddressUrl: null
  205. }
  206. }
  207. },
  208. onLoad(options) {
  209. this.validityPeriod = this.$helper.makeValidityPeriod(0, '长期')
  210. console.log(this)
  211. this.dataDetails.commonId = this.userInfo.id
  212. this.dataDetails.phone = this.userInfo.phone
  213. console.log('```````````````')
  214. console.log(options)
  215. this.dataDetails.videoAddressUrl = options.videoSrc
  216. },
  217. computed: {
  218. ...mapState(['hasLogin', 'userInfo']),
  219. },
  220. methods: {
  221. videoErrorCallback: function(e) {
  222. uni.showModal({
  223. content: e.target.errMsg,
  224. showCancel: false
  225. })
  226. },
  227. submit() {
  228. uni.showLoading({
  229. title: '加载中',
  230. mask: true
  231. })
  232. var _this = this
  233. this.$request.baseRequest('post', '/companyInfo/api/addCompanyInfo', _this.dataDetails).then(res => {
  234. uni.hideLoading()
  235. uni.$u.toast('提交成功')
  236. this.goDetailPage('/pages/mine/company/index')
  237. })
  238. .catch(res => {
  239. uni.hideLoading()
  240. uni.showToast({
  241. title: res.message,
  242. icon: 'none',
  243. duration: 2000
  244. })
  245. });
  246. },
  247. consent() {
  248. this.consentStatus = !this.consentStatus
  249. },
  250. change(e) {
  251. if (this.value) {
  252. this.$set(this.dataDetails, 'advanceFreightService', 1)
  253. } else {
  254. this.$set(this.dataDetails, 'advanceFreightService', 0)
  255. }
  256. },
  257. radioChange(n) {
  258. console.log('radioChange', n);
  259. this.dataDetails.landOwnership = n
  260. console.log('this.dataDetails.landOwnership', this.dataDetails.landOwnership);
  261. },
  262. delCard() {
  263. this.dataDetails.businessLicenseAddressUrl = ''
  264. this.$forceUpdate()
  265. },
  266. navBack() {
  267. uni.navigateBack();
  268. },
  269. checkedchange() {
  270. this.checked = !this.checked
  271. if (this.checked) {
  272. this.dataDetails.landOwnership = 0
  273. this.checked1 = false
  274. } else {
  275. }
  276. },
  277. checkedchange1() {
  278. this.checked1 = !this.checked1
  279. if (this.checked1) {
  280. this.dataDetails.landOwnership = 1
  281. this.checked = false
  282. } else {
  283. }
  284. },
  285. clickcancel() {
  286. this.isShowcardValidity = false
  287. },
  288. imgTypeSelect(val) {
  289. var _this = this
  290. if (val.name == '相册') {
  291. uni.chooseImage({
  292. count: 1,
  293. sourceType: this.$helper.chooseImage.sourceType,
  294. success: function(res) {
  295. console.log(JSON.stringify(res.tempFilePaths));
  296. uploadImage(res.tempFilePaths[0], 'appData/',
  297. result => {
  298. // 上传成功回调函数
  299. console.log('图片地址', result)
  300. switch (_this.uploadType) {
  301. // 身份正面
  302. case 1:
  303. _this.dataDetails.businessLicenseAddressUrl = result
  304. console.log(_this.dataDetails.businessLicenseAddressUrl)
  305. break
  306. // 身份反面
  307. case 2:
  308. _this.dataDetails.propertyAddressUrl = result
  309. console.log(_this.dataDetails.propertyAddressUrl)
  310. break
  311. case 3:
  312. break;
  313. }
  314. }
  315. )
  316. }
  317. });
  318. } else {
  319. uni.chooseImage({
  320. count: 1,
  321. sourceType: ['camera'],
  322. success: function(res) {
  323. console.log(JSON.stringify(res.tempFilePaths));
  324. uploadImage(res.tempFilePaths[0], 'appData/',
  325. result => {
  326. // 上传成功回调函数
  327. console.log('图片地址', result)
  328. _this.dataDetails.businessLicenseAddressUrl = result
  329. }
  330. )
  331. }
  332. });
  333. }
  334. },
  335. uploadImg(type) {
  336. this.uploadType = type
  337. this.isShowimgType = true
  338. // this.index = index
  339. },
  340. goDetailPage(src) {
  341. uni.setStorage({
  342. key: 'companydata',
  343. data: JSON.stringify(this.dataDetails)
  344. });
  345. uni.$u.route(src);
  346. },
  347. selectValidityPeriod(type) {
  348. this.ValidityPeriodType = type
  349. this.isShowcardValidity = true
  350. },
  351. confirmValidityPeriod(e) {
  352. switch (this.ValidityPeriodType) {
  353. case 0:
  354. if (e.value[0] == '长期') {
  355. this.dataDetails.businessTermDate = e.value[0]
  356. } else {
  357. this.dataDetails.businessTermDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  358. }
  359. break
  360. case 1:
  361. if (e.value[0] == '长期') {
  362. this.dataDetails.siteLeaseDate = e.value[0]
  363. } else {
  364. this.dataDetails.siteLeaseDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  365. }
  366. break
  367. }
  368. console.log('confirm', e)
  369. this.isShowcardValidity = false
  370. },
  371. changeHandler(e) {
  372. const {
  373. columnIndex,
  374. value,
  375. values,
  376. index,
  377. picker = this.$refs.uPicker
  378. } = e
  379. // if (columnIndex === 0) {
  380. // debugger
  381. // if (e.index != 0) {
  382. // picker.setColumnValues(1, this.validityPeriod[1].shift())
  383. // }
  384. // } else if (columnIndex === 1) {
  385. // if (e.index != 0) {
  386. // picker.setColumnValues(2, this.validityPeriod[2].shift())
  387. // }
  388. // }
  389. },
  390. }
  391. }
  392. </script>
  393. <style lang="scss" scoped>
  394. .content {
  395. padding: 0 0 200rpx 0;
  396. }
  397. page {
  398. background: #F5F6FA;
  399. }
  400. .next {
  401. color: #2772FB;
  402. font-size: 13px;
  403. }
  404. .wrap {
  405. background: #fff;
  406. padding: 20rpx 30rpx;
  407. border-radius: 5px;
  408. margin: 20rpx;
  409. .left {
  410. width: 240rpx;
  411. font-size: 28rpx;
  412. }
  413. .right {
  414. font-size: 28rpx;
  415. width: calc(100% - 240rpx);
  416. }
  417. }
  418. .preview-card-img {
  419. // /deep/uni-image>div, uni-image>img {
  420. // transform: scale(1.5) rotate(-90deg);
  421. // }
  422. }
  423. .picture {
  424. margin-top: 20rpx;
  425. background: #F5F6FA;
  426. width: 212rpx;
  427. height: 212rpx;
  428. border-radius: 20rpx;
  429. display: flex;
  430. flex-direction: column;
  431. justify-content: center;
  432. align-items: center;
  433. color: #6A7282;
  434. }
  435. .content1 {
  436. background: #fff;
  437. padding: 20rpx;
  438. margin: 20rpx;
  439. border-radius: 10rpx;
  440. .row {
  441. border-bottom: 1px solid #EEEEEE;
  442. padding-bottom: 28rpx;
  443. margin-top: 26rpx;
  444. }
  445. .left-text {
  446. // background: red;
  447. width: 320rpx;
  448. color: #333333;
  449. display: flex;
  450. align-items: center;
  451. font-size: 14px;
  452. }
  453. .picture {
  454. position: relative;
  455. width: 100%;
  456. height: 440rpx;
  457. display: flex;
  458. justify-content: center;
  459. flex-direction: column;
  460. align-items: center;
  461. .text {
  462. margin-top: 20rpx;
  463. }
  464. }
  465. .picture7 {
  466. background: url(../../../static/mine/cy.png);
  467. background-size: 100% 100%;
  468. }
  469. .xj-image {
  470. width: 100rpx;
  471. height: 100rpx;
  472. }
  473. .title {
  474. color: #999999;
  475. margin: 20rpx 0;
  476. }
  477. }
  478. .content2,
  479. .content3,
  480. .content4 {
  481. background: #fff;
  482. padding: 20rpx;
  483. margin: 20rpx;
  484. border-radius: 10rpx;
  485. }
  486. .u-input {
  487. font-size: 16px;
  488. }
  489. .content4 {}
  490. .del-card {
  491. position: absolute;
  492. top: -10rpx;
  493. right: -6rpx;
  494. width: 80rpx;
  495. height: 80rpx;
  496. z-index: 9;
  497. }
  498. .footer {
  499. position: fixed;
  500. background: #fff;
  501. width: 100%;
  502. bottom: 0;
  503. left: 0;
  504. padding: 40rpx 60rpx;
  505. box-sizing: border-box;
  506. }
  507. .newlyIncreased {
  508. width: 100%;
  509. height: 80rpx;
  510. margin: 0 auto;
  511. text-align: center;
  512. color: #fff;
  513. background: #2772FB;
  514. background-size: 100%;
  515. border-radius: 50rpx;
  516. display: flex;
  517. align-items: center;
  518. justify-content: center;
  519. }
  520. .u-checkbox-label--left {
  521. margin: 0 10px;
  522. }
  523. .service {
  524. font-size: 24rpx;
  525. margin: 20rpx;
  526. justify-content: center;
  527. /deep/.u-image {
  528. margin: 0 20rpx;
  529. }
  530. }
  531. .video-icon {
  532. margin-top: 20rpx;
  533. background: #F5F6FA;
  534. width: 212rpx;
  535. height: 211rpx;
  536. border-radius: 20rpx;
  537. display: flex;
  538. flex-direction: column;
  539. justify-content: center;
  540. align-items: center;
  541. color: #6A7282;
  542. }
  543. </style>