Businesses.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  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. let id = this.fishermanId
  222. this.$api.get(`/api/merchant/food/merchant/${id}`).then(res => {
  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. this.typeList = res.data.data.find((p) => p.dictType == 'CompanyType').dataList;
  231. this.companyType = this.typeList.find((p) => p.dictValue == this.list.companyType).dictLabel
  232. })
  233. },
  234. // 立即保存
  235. merchant() {
  236. this.dto.idCardFront = this.list.idCardFront
  237. this.dto.name = this.list.name
  238. this.dto.companyName = this.list.companyName
  239. this.dto.merchantType = this.list.merchantType
  240. this.dto.companyType = this.list.companyType
  241. this.dto.legalPerson = this.list.legalPerson
  242. this.dto.idCard = this.list.idCard
  243. this.dto.creditCode = this.list.creditCode
  244. this.dto.idCardReverse = this.list.idCardReverse
  245. this.dto.licensePic = this.list.licensePic
  246. // this.dto.usccl = this.list.usccl
  247. this.dto.storeFrontPic = this.list.storeFrontPic
  248. this.dto.shopImgs = this.list.shopImgs
  249. this.dto.linkName = this.list.linkName
  250. this.dto.phone = this.list.phone
  251. this.dto.areaDetail = this.list.areaDetail
  252. this.dto.id = uni.getStorageSync('merchantId');
  253. let newDataForm = JSON.parse(JSON.stringify(this.dto));
  254. newDataForm.idCard = this.$aesTm.encrypt(newDataForm.idCard);
  255. newDataForm.legalPerson = this.$aesTm.encrypt(newDataForm.legalPerson);
  256. newDataForm.linkName = this.$aesTm.encrypt(newDataForm.linkName);
  257. newDataForm.phone = this.$aesTm.encrypt(newDataForm.phone);
  258. this.$api.put('/api/merchant/food/updateMerchantInfo', newDataForm).then(res => {
  259. if (res.data.code == 0) {
  260. this.$showToast('保存成功');
  261. setTimeout(() => {
  262. this.getList()
  263. }, 1000)
  264. }
  265. })
  266. },
  267. // 上传头像法人身份证国徽面
  268. idCardFront() {
  269. uni.chooseImage({
  270. sourceType: ['album'], //从相册选择
  271. success: chooseImageRes => {
  272. const tempFilePaths = chooseImageRes.tempFilePaths;
  273. uni.uploadFile({
  274. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  275. filePath: tempFilePaths[0],
  276. name: 'file',
  277. header: {
  278. token: wx.getStorageSync('access_token')
  279. },
  280. success: res => {
  281. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  282. let data = JSON.parse(res.data);
  283. this.dto.idCardFront = data.data.url
  284. this.list.idCardFront = data.data.url
  285. }
  286. });
  287. },
  288. fail: err => {
  289. this.myToast('图片上传失败', 'none');
  290. }
  291. });
  292. },
  293. // 上传法人身份证人像面
  294. idCardReverse() {
  295. uni.chooseImage({
  296. sourceType: ['album'], //从相册选择
  297. success: chooseImageRes => {
  298. const tempFilePaths = chooseImageRes.tempFilePaths;
  299. uni.uploadFile({
  300. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  301. filePath: tempFilePaths[0],
  302. name: 'file',
  303. header: {
  304. token: wx.getStorageSync('access_token')
  305. },
  306. success: res => {
  307. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  308. let data = JSON.parse(res.data);
  309. this.dto.idCardReverse = data.data.url
  310. this.list.idCardReverse = data.data.url
  311. }
  312. });
  313. },
  314. fail: err => {
  315. this.myToast('图片上传失败', 'none');
  316. }
  317. });
  318. }, // 上传营业执照
  319. licensePic() {
  320. uni.chooseImage({
  321. sourceType: ['album'], //从相册选择
  322. success: chooseImageRes => {
  323. const tempFilePaths = chooseImageRes.tempFilePaths;
  324. uni.uploadFile({
  325. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  326. filePath: tempFilePaths[0],
  327. name: 'file',
  328. header: {
  329. token: wx.getStorageSync('access_token')
  330. },
  331. success: res => {
  332. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  333. let data = JSON.parse(res.data);
  334. this.dto.licensePic = data.data.url
  335. this.list.licensePic = data.data.url
  336. }
  337. });
  338. },
  339. fail: err => {
  340. this.myToast('图片上传失败', 'none');
  341. }
  342. });
  343. }, // 上传统一社会信息代码证
  344. // usccl() {
  345. // uni.chooseImage({
  346. // sourceType: ['album'], //从相册选择
  347. // success: chooseImageRes => {
  348. // const tempFilePaths = chooseImageRes.tempFilePaths;
  349. // uni.uploadFile({
  350. // url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  351. // filePath: tempFilePaths[0],
  352. // name: 'file',
  353. // header: {
  354. // token: wx.getStorageSync('access_token')
  355. // },
  356. // success: res => {
  357. // // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  358. // let data = JSON.parse(res.data);
  359. // this.dto.usccl = data.data.url
  360. // this.list.usccl = data.data.url
  361. // }
  362. // });
  363. // },
  364. // fail: err => {
  365. // this.myToast('图片上传失败', 'none');
  366. // }
  367. // });
  368. // }, // 上传门头照
  369. shopSign() {
  370. uni.chooseImage({
  371. sourceType: ['album'], //从相册选择
  372. success: chooseImageRes => {
  373. const tempFilePaths = chooseImageRes.tempFilePaths;
  374. uni.uploadFile({
  375. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  376. filePath: tempFilePaths[0],
  377. name: 'file',
  378. header: {
  379. token: wx.getStorageSync('access_token')
  380. },
  381. success: res => {
  382. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  383. let data = JSON.parse(res.data);
  384. this.dto.storeFrontPic = data.data.url
  385. this.list.storeFrontPic = data.data.url
  386. }
  387. });
  388. },
  389. fail: err => {
  390. this.myToast('图片上传失败', 'none');
  391. }
  392. });
  393. }, // 上传店铺照片
  394. shopImgs() {
  395. uni.chooseImage({
  396. sourceType: ['album'], //从相册选择
  397. success: chooseImageRes => {
  398. const tempFilePaths = chooseImageRes.tempFilePaths;
  399. uni.uploadFile({
  400. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  401. filePath: tempFilePaths[0],
  402. name: 'file',
  403. header: {
  404. token: wx.getStorageSync('access_token')
  405. },
  406. success: res => {
  407. // uploadFile上传成功后,根据和后台的约定msgCode判断接口调用状态
  408. let data = JSON.parse(res.data);
  409. this.dto.shopImgs = data.data.url
  410. this.list.shopImgs = data.data.url
  411. }
  412. });
  413. },
  414. fail: err => {
  415. this.myToast('图片上传失败', 'none');
  416. }
  417. });
  418. },
  419. }
  420. }
  421. </script>
  422. <style lang="scss" scoped>
  423. .page {
  424. box-sizing: border-box;
  425. // padding: 30rpx;
  426. // padding-top: 150rpx;
  427. }
  428. //标题样式
  429. .tenant-title {
  430. height: 88rpx;
  431. background: #F5F8FA;
  432. padding-left: 30rpx;
  433. text {
  434. line-height: 88rpx;
  435. font-size: 28rpx;
  436. color: #007A69;
  437. }
  438. }
  439. //商家相册样式
  440. .tenant-image {
  441. width: 100%;
  442. display: flex;
  443. flex-wrap: wrap;
  444. justify-content: space-around;
  445. >view {
  446. width: 47%;
  447. text-align: center;
  448. image {
  449. width: 100%;
  450. height: 212rpx;
  451. background: #F6F8F9;
  452. }
  453. view {
  454. margin: 15rpx 0 45rpx 0;
  455. }
  456. }
  457. }
  458. //保存样式
  459. .tenant-button {
  460. background: #007A69;
  461. border-radius: 40rpx;
  462. font-weight: bold;
  463. font-size: 28rpx;
  464. color: #FFFFFF;
  465. height: 88rpx;
  466. line-height: 88rpx;
  467. }
  468. .from-content {
  469. padding: 30rpx;
  470. .title {
  471. margin: 40rpx 0 36rpx;
  472. font-size: 30rpx;
  473. font-weight: Regular;
  474. color: #111111;
  475. }
  476. .one-image {
  477. width: 100%;
  478. display: flex;
  479. justify-content: space-between;
  480. .image {
  481. width: 124rpx;
  482. height: 124rpx;
  483. border-radius: 100rpx;
  484. image {
  485. width: 100%;
  486. height: 100%;
  487. border-radius: 100rpx;
  488. }
  489. }
  490. .user {
  491. margin-top: 24rpx;
  492. font-size: 30rpx;
  493. color: #111;
  494. font-weight: Regular;
  495. }
  496. }
  497. .one-realName {
  498. width: 100%;
  499. display: flex;
  500. align-items: center;
  501. height: 120rpx;
  502. line-height: 120rpx;
  503. border-bottom: 1rpx solid #EFEFEF;
  504. .realName {
  505. width: 188rpx;
  506. height: 120rpx;
  507. font-size: 30rpx;
  508. color: #333333;
  509. font-weight: Regular;
  510. }
  511. .right {
  512. text-align: right;
  513. width: 100%;
  514. font-size: 30rpx;
  515. color: #666666;
  516. font-weight: Regular;
  517. // display: flex;
  518. // justify-content: space-between;
  519. }
  520. }
  521. .one-mobile {
  522. display: flex;
  523. width: 100%;
  524. align-items: center;
  525. height: 120rpx;
  526. line-height: 120rpx;
  527. border-bottom: 1rpx solid #EFEFEF;
  528. .right {
  529. width: 100%;
  530. text-align: right;
  531. font-size: 30rpx;
  532. color: #666666;
  533. font-weight: Regular;
  534. }
  535. .mobile {
  536. width: 380rpx !important;
  537. height: 120rpx;
  538. font-size: 30rpx;
  539. color: #333333;
  540. font-weight: Regular;
  541. }
  542. .replacement {
  543. border-radius: 50rpx;
  544. width: 80rpx;
  545. height: 48rpx;
  546. line-height: 48rpx;
  547. border: 1rpx solid #025EA7;
  548. color: #025EA7;
  549. font-weight: Regular;
  550. font-size: 24rpx;
  551. text-align: center;
  552. }
  553. }
  554. .one {
  555. height: 120rpx;
  556. line-height: 120rpx;
  557. display: flex;
  558. border-bottom: 1rpx solid #EFEFEF;
  559. justify-content: space-between;
  560. align-items: center;
  561. font-size: 30rpx;
  562. color: #333333;
  563. font-weight: Regular;
  564. }
  565. }
  566. .btn {
  567. margin: 120rpx auto;
  568. width: 650rpx;
  569. height: 88rpx;
  570. display: flex;
  571. background-color: #01B9F9;
  572. line-height: 88rpx;
  573. border-radius: 50rpx;
  574. .btn-btn {
  575. margin: 0 auto;
  576. font-size: 32rpx;
  577. color: #FFFFFF;
  578. font-weight: Regular;
  579. }
  580. }
  581. </style>