Businesses.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px'}">
  3. <view class="tenant-title">
  4. <text>基本信息</text>
  5. </view>
  6. <view class="from-content">
  7. <view class="one-realName">
  8. <view class="realName">
  9. 商户名称
  10. </view>
  11. <!-- <u--input v-model="realName" border="none" pl ></u--input> -->
  12. <view class="right">
  13. <input type="text" v-model="list.name" border="none" placeholder="请输入昵称" />
  14. </view>
  15. </view>
  16. <view class="one" @click="nav">
  17. <view class="">
  18. 商户类型
  19. </view>
  20. <view class="">
  21. 渔家乐
  22. </view>
  23. <!-- <view class="right">
  24. <input type="text" v-model="list.phone" border="none" placeholder="请输入" style="height: 48rpx;" />
  25. </view> -->
  26. </view>
  27. <view class="one-mobile">
  28. <view class="mobile">
  29. 企业名称
  30. </view>
  31. <view class="right">
  32. <input type="text" v-model="list.busName" border="none" placeholder="请输入" style="height: 48rpx;" />
  33. </view>
  34. </view>
  35. <view class="one">
  36. <view class="">
  37. 企业类型
  38. </view>
  39. <view class="right">
  40. <input type="text" v-model="companyType" border="none" placeholder="请输入"
  41. style="height: 48rpx; text-align: right;" />
  42. </view>
  43. </view>
  44. <view class="one-mobile">
  45. <view class="mobile">
  46. 企业法人
  47. </view>
  48. <view class="right">
  49. <input type="text" v-model="list.legalPerson" border="none" placeholder="请输入"
  50. style="height: 48rpx;" />
  51. </view>
  52. </view>
  53. <view class="one-mobile">
  54. <view class="mobile">
  55. 法人身份证号码
  56. </view>
  57. <view class="right">
  58. <input type="text" v-model="list.idCard" border="none" placeholder="请输入" style="height: 48rpx;" />
  59. </view>
  60. </view>
  61. <view class="one-mobile">
  62. <view class="mobile" style="width: 350rpx;">
  63. 统一社会信用代码
  64. </view>
  65. <view class="right">
  66. <input type="text" v-model="list.creditCode" border="none" placeholder="请输入"
  67. style="height: 48rpx;" />
  68. </view>
  69. </view>
  70. <view class="one-mobile">
  71. <view class="mobile">
  72. 企业地址
  73. </view>
  74. <view class="right">
  75. <input type="text" v-model="list.address" border="none" placeholder="请输入" style="height: 48rpx;" />
  76. </view>
  77. </view>
  78. </view>
  79. <view class="tenant-title">
  80. <text>联系人信息</text>
  81. </view>
  82. <view class="from-content">
  83. <view class="one-mobile">
  84. <view class="mobile">
  85. 联系人姓名
  86. </view>
  87. <view class="right">
  88. <input type="text" v-model="list.linkName" border="none" placeholder="请输入" style="height: 48rpx;" />
  89. </view>
  90. </view>
  91. <view class="one-mobile">
  92. <view class="mobile">
  93. 联系人号码
  94. </view>
  95. <view class="right">
  96. <input type="text" v-model="list.phone" border="none" placeholder="请输入" style="height: 48rpx;" />
  97. </view>
  98. </view>
  99. </view>
  100. <view class="tenant-title">
  101. <text>商家相册</text>
  102. </view>
  103. <view class="from-content" style="padding: 30rpx;">
  104. <view class="tenant-image">
  105. <view @click="idCardFront">
  106. <image :src="list.idCardFront" mode=""></image>
  107. <view>法人身份证国徽面</view>
  108. </view>
  109. <view @click="idCardReverse">
  110. <image :src="list.idCardReverse" mode=""></image>
  111. <view>法人身份证人像面</view>
  112. </view>
  113. <view @click="licensePic">
  114. <image :src="list.licensePic" mode=""></image>
  115. <view>营业执照</view>
  116. </view>
  117. <view @click="usccl">
  118. <image :src="list.usccl" mode=""></image>
  119. <view>统一社会信息代码证</view>
  120. </view>
  121. <view @click="shopSign">
  122. <image :src="list.shopSign" mode=""></image>
  123. <view>门头照</view>
  124. </view>
  125. <view @click="shopImgs">
  126. <image :src="list.shopImgs" mode=""></image>
  127. <view>店铺照片</view>
  128. </view>
  129. </view>
  130. </view>
  131. <!-- 选择弹框学历要求 -->
  132. <u-popup :show="showTwo" @close="close" :round="24" @open="open">
  133. <view class="pop">
  134. <view class="hander">
  135. <view class="left" @click="showTwo=false">
  136. 取消
  137. </view>
  138. <view class="center">
  139. <!-- 学历要求 -->
  140. </view>
  141. <view class="right" @click="showTwo=false">
  142. 确定
  143. </view>
  144. </view>
  145. <view class="At-last" v-for="item,index in JobList">
  146. <view class="item" @click="choose(item,index)" :class="indexDb==index?'activeItem':''">
  147. {{item.name}}
  148. </view>
  149. </view>
  150. </view>
  151. </u-popup>
  152. <view class="from-content">
  153. <button class="tenant-button" @click="merchant">
  154. 立即保存
  155. </button>
  156. </view>
  157. </view>
  158. </template>
  159. <script>
  160. export default {
  161. data() {
  162. return {
  163. h: uni.getSystemInfoSync().windowHeight - 87,
  164. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  165. titleHeader: '个人信息',
  166. fileList: [],
  167. JobList: [{
  168. name: '不限'
  169. }, {
  170. name: '高中',
  171. },
  172. {
  173. name: '中专/技校',
  174. },
  175. {
  176. name: '大专',
  177. },
  178. {
  179. name: '本科',
  180. },
  181. {
  182. name: '硕士',
  183. }
  184. ],
  185. fishermanId: uni.getStorageSync('merchantId'),
  186. list: {},
  187. dto: {
  188. name: '', //商户名称
  189. busName: '', //企业名称
  190. merchantType: 10, //商户类型
  191. companyType: '', //企业类型
  192. legalPerson: '', //企业法人
  193. idCard: '', //法人身份证号码
  194. creditCode: '', //统一社区信用代码
  195. areaDetail: '', //企业地址
  196. linkName: '', //联系人姓名
  197. phone: '', //联系人号码
  198. idCardFront: '', //法人身份证国徽面
  199. idCardReverse: '', //法人身份证人像面
  200. licensePic: '', //营业执照
  201. usccl: '', //统一社会信息代码证
  202. shopSign: '', //门头照
  203. shopImgs: '', //店铺照片
  204. id: '',
  205. address: '', //企业地址
  206. },
  207. typeList: {},
  208. companyType: ''
  209. }
  210. },
  211. onLoad() {
  212. this.getList()
  213. },
  214. methods: {
  215. // 获取数据
  216. getList() {
  217. // this.$api.get('/merchant/merchantFisherman/home?id=' + this.homestayId).then(res => {
  218. // console.log(res.data);
  219. // })
  220. let id = this.fishermanId
  221. this.$api.get(`/merchant/merchantFisherman/home/${id}`).then(res => {
  222. console.log(res.data);
  223. this.list = res.data.data
  224. this.getDict()
  225. })
  226. },
  227. // 获取企业类型字典
  228. getDict() {
  229. this.$api.get('/sys/dict/type/all').then(res => {
  230. console.log(res.data)
  231. //this.$store.state.Dict = Object.assign(res.data);
  232. // this.dictValue
  233. this.typeList = res.data.data.find((p) => p.dictType == 'CompanyType').dataList;
  234. console.log(this.typeList);
  235. this.companyType = this.typeList.find((p) => p.dictValue == this.list.companyType).dictLabel
  236. console.log(this.companyType);
  237. })
  238. },
  239. // 立即保存
  240. merchant() {
  241. this.dto.idCardFront = this.list.idCardFront
  242. this.dto.name = this.list.name
  243. this.dto.busName = this.list.busName
  244. this.dto.merchantType = this.list.merchantType
  245. this.dto.companyType = this.list.companyType
  246. this.dto.legalPerson = this.list.legalPerson
  247. this.dto.idCard = this.list.idCard
  248. this.dto.creditCode = this.list.creditCode
  249. this.dto.idCardReverse = this.list.idCardReverse
  250. this.dto.licensePic = this.list.licensePic
  251. this.dto.usccl = this.list.usccl
  252. this.dto.shopSign = this.list.shopSign
  253. this.dto.shopImgs = this.list.shopImgs
  254. this.dto.linkName = this.list.linkName
  255. this.dto.phone = this.list.phone
  256. this.dto.address = this.list.address
  257. this.dto.id = uni.getStorageSync('merchantId')
  258. this.$api.put('/merchant/merchantFisherman/home', this.dto).then(res => {
  259. console.log('0000', res.data);
  260. if (res.data.code == 0) {
  261. this.$showToast('保存成功');
  262. setTimeout(() => {
  263. this.getList()
  264. }, 1000)
  265. }
  266. })
  267. },
  268. // 上传头像法人身份证国徽面
  269. idCardFront() {
  270. uni.chooseImage({
  271. sourceType: ['album'], //从相册选择
  272. success: chooseImageRes => {
  273. const tempFilePaths = chooseImageRes.tempFilePaths;
  274. uni.uploadFile({
  275. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  276. filePath: tempFilePaths[0],
  277. name: 'file',
  278. header: {
  279. token: wx.getStorageSync('access_token')
  280. },
  281. success: res => {
  282. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  283. let data = JSON.parse(res.data);
  284. this.dto.idCardFront = data.data.url
  285. this.list.idCardFront = data.data.url
  286. }
  287. });
  288. },
  289. fail: err => {
  290. this.myToast('图片上传失败', 'none');
  291. }
  292. });
  293. },
  294. // 上传法人身份证人像面
  295. idCardReverse() {
  296. uni.chooseImage({
  297. sourceType: ['album'], //从相册选择
  298. success: chooseImageRes => {
  299. const tempFilePaths = chooseImageRes.tempFilePaths;
  300. uni.uploadFile({
  301. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  302. filePath: tempFilePaths[0],
  303. name: 'file',
  304. header: {
  305. token: wx.getStorageSync('access_token')
  306. },
  307. success: res => {
  308. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  309. let data = JSON.parse(res.data);
  310. this.dto.idCardReverse = data.data.url
  311. this.list.idCardReverse = data.data.url
  312. }
  313. });
  314. },
  315. fail: err => {
  316. this.myToast('图片上传失败', 'none');
  317. }
  318. });
  319. }, // 上传营业执照
  320. licensePic() {
  321. uni.chooseImage({
  322. sourceType: ['album'], //从相册选择
  323. success: chooseImageRes => {
  324. const tempFilePaths = chooseImageRes.tempFilePaths;
  325. uni.uploadFile({
  326. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  327. filePath: tempFilePaths[0],
  328. name: 'file',
  329. header: {
  330. token: wx.getStorageSync('access_token')
  331. },
  332. success: res => {
  333. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  334. let data = JSON.parse(res.data);
  335. this.dto.licensePic = data.data.url
  336. this.list.licensePic = data.data.url
  337. }
  338. });
  339. },
  340. fail: err => {
  341. this.myToast('图片上传失败', 'none');
  342. }
  343. });
  344. }, // 上传统一社会信息代码证
  345. usccl() {
  346. uni.chooseImage({
  347. sourceType: ['album'], //从相册选择
  348. success: chooseImageRes => {
  349. const tempFilePaths = chooseImageRes.tempFilePaths;
  350. uni.uploadFile({
  351. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  352. filePath: tempFilePaths[0],
  353. name: 'file',
  354. header: {
  355. token: wx.getStorageSync('access_token')
  356. },
  357. success: res => {
  358. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  359. let data = JSON.parse(res.data);
  360. this.dto.usccl = data.data.url
  361. this.list.usccl = data.data.url
  362. }
  363. });
  364. },
  365. fail: err => {
  366. this.myToast('图片上传失败', 'none');
  367. }
  368. });
  369. }, // 上传门头照
  370. shopSign() {
  371. uni.chooseImage({
  372. sourceType: ['album'], //从相册选择
  373. success: chooseImageRes => {
  374. const tempFilePaths = chooseImageRes.tempFilePaths;
  375. uni.uploadFile({
  376. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  377. filePath: tempFilePaths[0],
  378. name: 'file',
  379. header: {
  380. token: wx.getStorageSync('access_token')
  381. },
  382. success: res => {
  383. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  384. let data = JSON.parse(res.data);
  385. this.dto.shopSign = data.data.url
  386. this.list.shopSign = data.data.url
  387. }
  388. });
  389. },
  390. fail: err => {
  391. this.myToast('图片上传失败', 'none');
  392. }
  393. });
  394. }, // 上传店铺照片
  395. shopImgs() {
  396. uni.chooseImage({
  397. sourceType: ['album'], //从相册选择
  398. success: chooseImageRes => {
  399. const tempFilePaths = chooseImageRes.tempFilePaths;
  400. uni.uploadFile({
  401. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  402. filePath: tempFilePaths[0],
  403. name: 'file',
  404. header: {
  405. token: wx.getStorageSync('access_token')
  406. },
  407. success: res => {
  408. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  409. let data = JSON.parse(res.data);
  410. this.dto.shopImgs = data.data.url
  411. this.list.shopImgs = data.data.url
  412. }
  413. });
  414. },
  415. fail: err => {
  416. this.myToast('图片上传失败', 'none');
  417. }
  418. });
  419. },
  420. }
  421. }
  422. </script>
  423. <style lang="scss" scoped>
  424. .page {
  425. box-sizing: border-box;
  426. // padding: 30rpx;
  427. // padding-top: 150rpx;
  428. }
  429. //标题样式
  430. .tenant-title {
  431. height: 88rpx;
  432. background: #F5F8FA;
  433. padding-left: 30rpx;
  434. text {
  435. line-height: 88rpx;
  436. font-size: 28rpx;
  437. color: #007A69;
  438. }
  439. }
  440. //商家相册样式
  441. .tenant-image {
  442. width: 100%;
  443. display: flex;
  444. flex-wrap: wrap;
  445. justify-content: space-around;
  446. >view {
  447. width: 47%;
  448. text-align: center;
  449. image {
  450. width: 100%;
  451. height: 212rpx;
  452. background: #F6F8F9;
  453. }
  454. view {
  455. margin: 15rpx 0 45rpx 0;
  456. }
  457. }
  458. }
  459. //保存样式
  460. .tenant-button {
  461. background: #007A69;
  462. border-radius: 40rpx;
  463. font-weight: bold;
  464. font-size: 28rpx;
  465. color: #FFFFFF;
  466. height:88rpx;
  467. line-height: 88rpx;
  468. }
  469. .from-content {
  470. padding: 30rpx;
  471. .title {
  472. margin: 40rpx 0 36rpx;
  473. font-size: 30rpx;
  474. font-weight: Regular;
  475. color: #111111;
  476. }
  477. .one-image {
  478. width: 100%;
  479. display: flex;
  480. justify-content: space-between;
  481. .image {
  482. width: 124rpx;
  483. height: 124rpx;
  484. border-radius: 100rpx;
  485. image {
  486. width: 100%;
  487. height: 100%;
  488. border-radius: 100rpx;
  489. }
  490. }
  491. .user {
  492. margin-top: 24rpx;
  493. font-size: 30rpx;
  494. color: #111;
  495. font-weight: Regular;
  496. }
  497. }
  498. .one-realName {
  499. width: 100%;
  500. display: flex;
  501. align-items: center;
  502. height: 120rpx;
  503. line-height: 120rpx;
  504. border-bottom: 1rpx solid #EFEFEF;
  505. .realName {
  506. width: 188rpx;
  507. height: 120rpx;
  508. font-size: 30rpx;
  509. color: #333333;
  510. font-weight: Regular;
  511. }
  512. .right {
  513. text-align: right;
  514. width: 100%;
  515. font-size: 30rpx;
  516. color: #666666;
  517. font-weight: Regular;
  518. // display: flex;
  519. // justify-content: space-between;
  520. }
  521. }
  522. .one-mobile {
  523. display: flex;
  524. width: 100%;
  525. align-items: center;
  526. height: 120rpx;
  527. line-height: 120rpx;
  528. border-bottom: 1rpx solid #EFEFEF;
  529. .right {
  530. width: 100%;
  531. text-align: right;
  532. font-size: 30rpx;
  533. color: #666666;
  534. font-weight: Regular;
  535. }
  536. .mobile {
  537. width: 380rpx !important;
  538. height: 120rpx;
  539. font-size: 30rpx;
  540. color: #333333;
  541. font-weight: Regular;
  542. }
  543. .replacement {
  544. border-radius: 50rpx;
  545. width: 80rpx;
  546. height: 48rpx;
  547. line-height: 48rpx;
  548. border: 1rpx solid #025EA7;
  549. color: #025EA7;
  550. font-weight: Regular;
  551. font-size: 24rpx;
  552. text-align: center;
  553. }
  554. }
  555. .one {
  556. height: 120rpx;
  557. line-height: 120rpx;
  558. display: flex;
  559. border-bottom: 1rpx solid #EFEFEF;
  560. justify-content: space-between;
  561. align-items: center;
  562. font-size: 30rpx;
  563. color: #333333;
  564. font-weight: Regular;
  565. }
  566. }
  567. .btn {
  568. margin: 120rpx auto;
  569. width: 650rpx;
  570. height: 88rpx;
  571. display: flex;
  572. background-color: #01B9F9;
  573. line-height: 88rpx;
  574. border-radius: 50rpx;
  575. .btn-btn {
  576. margin: 0 auto;
  577. font-size: 32rpx;
  578. color: #FFFFFF;
  579. font-weight: Regular;
  580. }
  581. }
  582. </style>