Catering.vue 17 KB

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