PersonalEditing.vue 7.1 KB

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