PersonalEditing.vue 5.6 KB

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