PersonalEditing.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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="dto.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. <!-- <u--input v-model="realName" border="none" pl ></u--input> -->
  19. <view class="right">
  20. <!-- <input type="text" v-model="dto.name" border="none" placeholder="请输入昵称" /> -->
  21. {{dto.name}}
  22. </view>
  23. </view>
  24. <view class="one-mobile">
  25. <view class="mobile">
  26. 联系电话
  27. </view>
  28. <view class="right">
  29. <input type="text" v-model="dto.phone" border="none" placeholder="请输入手机号" style="height: 48rpx;" />
  30. </view>
  31. </view>
  32. <view class="one-mobile">
  33. <view class="mobile">
  34. 商家地址
  35. </view>
  36. <view class="right">
  37. {{dto.address}}
  38. {{dto.address}}
  39. </view>
  40. </view>
  41. <view class="one" @click="nav">
  42. <view class="">
  43. 营业执照
  44. </view>
  45. <view class="">
  46. <u-icon name="arrow-right"></u-icon>
  47. </view>
  48. </view>
  49. <view class="one">
  50. <view class="">
  51. 统一社会信用代码
  52. </view>
  53. <view class="">
  54. <u-icon name="arrow-right"></u-icon>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="from-content">
  59. <view class="title">
  60. 店铺照片
  61. </view>
  62. <view class="pics">
  63. <image :src='item' v-for="(item,index) in shopImgs" :key="index"></image>
  64. </view>
  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. shopImgs: [],
  84. }
  85. },
  86. onLoad() {
  87. this.getInfo();
  88. },
  89. methods: {
  90. getInfo() {
  91. this.$api.get('/merchant/merchantFisherman/home/' + uni.getStorageSync('merchantId'), {
  92. }).then(res => {
  93. if (res.data.code == 0) {
  94. this.dto = res.data.data;
  95. if (!res.data.data.shopSign) {
  96. this.dto.shopSign =
  97. 'https://i.ringzle.com/file/20240225/26feb8cc8f744123a980211ebdfb8d40.png';
  98. }
  99. this.shopImgs = res.data.data.split(',');
  100. console.log(this.shopImgs)
  101. }
  102. })
  103. },
  104. // 上传头像
  105. upImage() {
  106. uni.chooseImage({
  107. sourceType: ['album'], //从相册选择
  108. success: chooseImageRes => {
  109. const tempFilePaths = chooseImageRes.tempFilePaths;
  110. uni.uploadFile({
  111. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  112. filePath: tempFilePaths[0],
  113. name: 'file',
  114. header: {
  115. token: wx.getStorageSync('access_token')
  116. },
  117. success: res => {
  118. let data = JSON.parse(res.data);
  119. this.dto.shopSign = data.data.url;
  120. this.save();
  121. }
  122. });
  123. },
  124. fail: err => {
  125. this.myToast('图片上传失败', 'none');
  126. }
  127. });
  128. },
  129. save() {
  130. this.$api.put('/merchant/merchantFisherman/home', this.dto).then(res => {
  131. })
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .page {
  138. box-sizing: border-box;
  139. padding: 30rpx;
  140. // padding-top: 150rpx;
  141. }
  142. .pics {
  143. display: grid;
  144. grid-template-columns: repeat(3, 1fr);
  145. gap: 12rpx
  146. }
  147. .from-content {
  148. .title {
  149. margin: 40rpx 0 36rpx;
  150. font-size: 30rpx;
  151. font-weight: Regular;
  152. color: #111111;
  153. }
  154. .one-image {
  155. width: 100%;
  156. display: flex;
  157. align-items: center;
  158. justify-content: space-between;
  159. .image {
  160. display: flex;
  161. align-items: center;
  162. image {
  163. width: 124rpx;
  164. border-radius: 100rpx;
  165. height: 124rpx;
  166. border-radius: 100rpx;
  167. }
  168. }
  169. .user {
  170. margin-top: 24rpx;
  171. font-size: 30rpx;
  172. color: #111;
  173. font-weight: Regular;
  174. }
  175. }
  176. .one-realName {
  177. width: 100%;
  178. display: flex;
  179. align-items: center;
  180. height: 120rpx;
  181. border-bottom: 1rpx solid #EFEFEF;
  182. .realName {
  183. width: 188rpx;
  184. height: 120rpx;
  185. line-height: 120rpx;
  186. font-size: 30rpx;
  187. color: #333333;
  188. font-weight: Regular;
  189. }
  190. .right {
  191. text-align: right;
  192. width: 100%;
  193. font-size: 30rpx;
  194. color: #666666;
  195. font-weight: Regular;
  196. // display: flex;
  197. // justify-content: space-between;
  198. }
  199. }
  200. .one-mobile {
  201. display: flex;
  202. width: 100%;
  203. align-items: center;
  204. height: 120rpx;
  205. border-bottom: 1rpx solid #EFEFEF;
  206. .right {
  207. width: 100%;
  208. text-align: right;
  209. font-size: 30rpx;
  210. color: #666666;
  211. font-weight: Regular;
  212. }
  213. .mobile {
  214. width: 188rpx;
  215. height: 120rpx;
  216. line-height: 120rpx;
  217. font-size: 30rpx;
  218. color: #333333;
  219. font-weight: Regular;
  220. }
  221. .replacement {
  222. border-radius: 50rpx;
  223. width: 80rpx;
  224. height: 48rpx;
  225. line-height: 48rpx;
  226. border: 1rpx solid #025EA7;
  227. color: #025EA7;
  228. font-weight: Regular;
  229. font-size: 24rpx;
  230. text-align: center;
  231. }
  232. }
  233. .one {
  234. height: 120rpx;
  235. line-height: 120rpx;
  236. display: flex;
  237. border-bottom: 1rpx solid #EFEFEF;
  238. justify-content: space-between;
  239. align-items: center;
  240. font-size: 30rpx;
  241. color: #333333;
  242. font-weight: Regular;
  243. }
  244. }
  245. .btn {
  246. margin: 120rpx auto;
  247. width: 650rpx;
  248. height: 88rpx;
  249. display: flex;
  250. background-color: #01B9F9;
  251. line-height: 88rpx;
  252. border-radius: 50rpx;
  253. .btn-btn {
  254. margin: 0 auto;
  255. font-size: 32rpx;
  256. color: #FFFFFF;
  257. font-weight: Regular;
  258. }
  259. }
  260. </style>