Businesses.vue 16 KB

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