PersonalEditing.vue 5.5 KB

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