PersonalEditing.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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="from-content">
  5. <view class="one-image" @click="upImage">
  6. <view class="user">
  7. 店铺标志
  8. </view>
  9. <view class="image">
  10. <image :src="list.storeFrontPic">
  11. </image>
  12. <u-icon @click="more()" name="arrow-right" color="#AAA"></u-icon>
  13. </view>
  14. </view>
  15. <view class="one-realName">
  16. <view class="realName">
  17. 店铺名称
  18. </view>
  19. <view class="right">
  20. <input type="text" v-model="list.name" border="none" placeholder="请输入手机号" style="height: 48rpx;" />
  21. </view>
  22. </view>
  23. <view class="one-mobile">
  24. <view class="mobile">
  25. 联系电话
  26. </view>
  27. <view class="right">
  28. <input type="text" v-model="list.phone" border="none" placeholder="请输入手机号" style="height: 48rpx;" />
  29. </view>
  30. </view>
  31. <view class="one-mobile">
  32. <view class="mobile">
  33. 商家地址
  34. </view>
  35. <view class="right">
  36. <input type="text" v-model="list.areaDetail" border="none" placeholder="请输入"
  37. style="height: 48rpx;" />
  38. </view>
  39. </view>
  40. <!-- <view class="one" @click="nav">
  41. <view class="">
  42. 营业执照
  43. </view>
  44. <input type="text" v-model="dto.creditCode" border="none" placeholder="请输入" style="height: 48rpx;" />
  45. </view>
  46. <view class="one">
  47. <view class="">
  48. 统一社会信用代码
  49. </view>
  50. <view class="">
  51. <u-icon name="arrow-right"></u-icon>
  52. </view>
  53. </view> -->
  54. </view>
  55. <!-- <view class="from-content">
  56. <view class="title">
  57. 店铺照片
  58. </view>
  59. <view class="pics">
  60. <image :src='item' v-for="(item,index) in shopImgs" :key="index"></image>
  61. </view>
  62. </view> -->
  63. <view class="from-content1">
  64. <button class="tenant-button" @click="save">
  65. 立即保存
  66. </button>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. h: uni.getSystemInfoSync().windowHeight - 87,
  75. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  76. fileList: [],
  77. dto: {
  78. name: '黄沙村渔家乐', //昵称
  79. phone: '18755113256', //手机号
  80. shopSign: '', // 头像
  81. idCode: '', // 证件号
  82. id: '',
  83. areaDetail: ''
  84. },
  85. list: {
  86. name: '黄沙村渔家乐', //昵称
  87. phone: '18755113256', //手机号
  88. shopSign: '', // 头像
  89. idCode: '', // 证件号
  90. id: '',
  91. areaDetail: ''
  92. },
  93. shopImgs: [],
  94. }
  95. },
  96. onLoad() {
  97. this.getInfo();
  98. },
  99. methods: {
  100. getInfo() {
  101. this.$api.get('/api/merchant/food/merchant/' + uni.getStorageSync('merchantId')).then(res => {
  102. console.log(res)
  103. if (res.data.code == 0) {
  104. this.list = res.data.data;
  105. if (!res.data.data.shopSign) {
  106. this.list.shopSign =
  107. 'https://i.ringzle.com/file/20240225/26feb8cc8f744123a980211ebdfb8d40.png';
  108. }
  109. }
  110. })
  111. },
  112. // 上传头像
  113. upImage() {
  114. uni.chooseImage({
  115. sourceType: ['album'], //从相册选择
  116. success: chooseImageRes => {
  117. const tempFilePaths = chooseImageRes.tempFilePaths;
  118. this.$api.detectionContent(tempFilePaths[0], 2).then(result => {
  119. if (result.code === 0) {
  120. uni.uploadFile({
  121. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  122. filePath: tempFilePaths[0],
  123. name: 'file',
  124. header: {
  125. token: wx.getStorageSync('access_token')
  126. },
  127. success: res => {
  128. let data = JSON.parse(res.data);
  129. this.list.storeFrontPic = data.data.url;
  130. this.save();
  131. }
  132. });
  133. } else this.$showToast(result.msg)
  134. })
  135. },
  136. fail: err => {
  137. this.myToast('图片上传失败', 'none');
  138. }
  139. });
  140. },
  141. save() {
  142. this.dto.idCardFront = this.list.idCardFront
  143. this.dto.name = this.list.name
  144. this.dto.companyName = this.list.companyName
  145. this.dto.merchantType = this.list.merchantType
  146. this.dto.companyType = this.list.companyType
  147. this.dto.legalPerson = this.list.legalPerson
  148. this.dto.idCard = this.list.idCard
  149. this.dto.creditCode = this.list.creditCode
  150. this.dto.idCardReverse = this.list.idCardReverse
  151. this.dto.licensePic = this.list.licensePic
  152. // this.dto.usccl = this.list.usccl
  153. this.dto.storeFrontPic = this.list.storeFrontPic
  154. this.dto.shopImgs = this.list.shopImgs
  155. this.dto.linkName = this.list.linkName
  156. this.dto.phone = this.list.phone
  157. this.dto.areaDetail = this.list.areaDetail
  158. this.dto.id = uni.getStorageSync('merchantId')
  159. this.dto.id = uni.getStorageSync('merchantId')
  160. let newDto = JSON.parse(JSON.stringify(this.dto));
  161. newDto.idCard = this.$aesTm.encrypt(newDto.idCard);
  162. newDto.legalPerson = this.$aesTm.encrypt(newDto.legalPerson);
  163. newDto.linkName = this.$aesTm.encrypt(newDto.linkName);
  164. newDto.phone = this.$aesTm.encrypt(newDto.phone);
  165. // return console.log(newDto,'this.dto');
  166. this.$api.detectionContent(newDto.name).then(result => {
  167. if (result.code !== 0) return this.$showToast(result.msg);
  168. this.$api.put('/api/merchant/food/updateMerchantInfo', newDto).then(res => {
  169. if (res.data.code == 0) {
  170. this.$showToast('保存成功');
  171. }
  172. })
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. //保存样式
  180. .from-content1 {
  181. position: fixed;
  182. bottom: 30rpx;
  183. padding: 0 24rpx;
  184. left: 0;
  185. z-index: 10;
  186. width: 100%;
  187. box-sizing: border-box;
  188. }
  189. .tenant-button {
  190. background: #007A69;
  191. border-radius: 40rpx;
  192. font-weight: bold;
  193. font-size: 28rpx;
  194. color: #FFFFFF;
  195. height: 88rpx;
  196. line-height: 88rpx;
  197. }
  198. .page {
  199. box-sizing: border-box;
  200. padding: 30rpx;
  201. // padding-top: 150rpx;
  202. }
  203. .pics {
  204. display: grid;
  205. grid-template-columns: repeat(3, 1fr);
  206. gap: 12rpx
  207. }
  208. .from-content {
  209. .title {
  210. margin: 40rpx 0 36rpx;
  211. font-size: 30rpx;
  212. font-weight: Regular;
  213. color: #111111;
  214. }
  215. .one-image {
  216. width: 100%;
  217. display: flex;
  218. align-items: center;
  219. justify-content: space-between;
  220. .image {
  221. display: flex;
  222. align-items: center;
  223. image {
  224. width: 124rpx;
  225. border-radius: 100rpx;
  226. height: 124rpx;
  227. border-radius: 100rpx;
  228. }
  229. }
  230. .user {
  231. margin-top: 24rpx;
  232. font-size: 30rpx;
  233. color: #111;
  234. font-weight: Regular;
  235. }
  236. }
  237. .one-realName {
  238. width: 100%;
  239. display: flex;
  240. align-items: center;
  241. height: 120rpx;
  242. border-bottom: 1rpx solid #EFEFEF;
  243. .realName {
  244. width: 188rpx;
  245. height: 120rpx;
  246. line-height: 120rpx;
  247. font-size: 30rpx;
  248. color: #333333;
  249. font-weight: Regular;
  250. }
  251. .right {
  252. text-align: right;
  253. width: 100%;
  254. font-size: 30rpx;
  255. color: #666666;
  256. font-weight: Regular;
  257. // display: flex;
  258. // justify-content: space-between;
  259. }
  260. }
  261. .one-mobile {
  262. display: flex;
  263. width: 100%;
  264. align-items: center;
  265. height: 120rpx;
  266. border-bottom: 1rpx solid #EFEFEF;
  267. .right {
  268. width: 100%;
  269. text-align: right;
  270. font-size: 30rpx;
  271. color: #666666;
  272. font-weight: Regular;
  273. }
  274. .mobile {
  275. width: 188rpx;
  276. height: 120rpx;
  277. line-height: 120rpx;
  278. font-size: 30rpx;
  279. color: #333333;
  280. font-weight: Regular;
  281. }
  282. .replacement {
  283. border-radius: 50rpx;
  284. width: 80rpx;
  285. height: 48rpx;
  286. line-height: 48rpx;
  287. border: 1rpx solid #025EA7;
  288. color: #025EA7;
  289. font-weight: Regular;
  290. font-size: 24rpx;
  291. text-align: center;
  292. }
  293. }
  294. .one {
  295. height: 120rpx;
  296. line-height: 120rpx;
  297. display: flex;
  298. border-bottom: 1rpx solid #EFEFEF;
  299. justify-content: space-between;
  300. align-items: center;
  301. font-size: 30rpx;
  302. color: #333333;
  303. font-weight: Regular;
  304. }
  305. }
  306. .btn {
  307. margin: 120rpx auto;
  308. width: 650rpx;
  309. height: 88rpx;
  310. display: flex;
  311. background-color: #01B9F9;
  312. line-height: 88rpx;
  313. border-radius: 50rpx;
  314. .btn-btn {
  315. margin: 0 auto;
  316. font-size: 32rpx;
  317. color: #FFFFFF;
  318. font-weight: Regular;
  319. }
  320. }
  321. </style>