PersonalEditing.vue 7.5 KB

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