Businesses.vue 15 KB

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