Catering.vue 16 KB

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