PersonalEditing.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. <view class="right">
  19. <input type="text" v-model="dto.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="dto.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="dto.address" 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="merchant">
  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. 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. //保存样式
  138. .tenant-button {
  139. position: fixed;
  140. bottom: 0;
  141. background: #007A69;
  142. border-radius: 40rpx;
  143. font-weight: bold;
  144. font-size: 28rpx;
  145. color: #FFFFFF;
  146. width: 92%;
  147. box-sizing: border-box;
  148. // padding-bottom: 30rpx;
  149. margin-bottom: 30rpx;
  150. }
  151. .page {
  152. box-sizing: border-box;
  153. padding: 30rpx;
  154. // padding-top: 150rpx;
  155. }
  156. .pics {
  157. display: grid;
  158. grid-template-columns: repeat(3, 1fr);
  159. gap: 12rpx
  160. }
  161. .from-content {
  162. .title {
  163. margin: 40rpx 0 36rpx;
  164. font-size: 30rpx;
  165. font-weight: Regular;
  166. color: #111111;
  167. }
  168. .one-image {
  169. width: 100%;
  170. display: flex;
  171. align-items: center;
  172. justify-content: space-between;
  173. .image {
  174. display: flex;
  175. align-items: center;
  176. image {
  177. width: 124rpx;
  178. border-radius: 100rpx;
  179. height: 124rpx;
  180. border-radius: 100rpx;
  181. }
  182. }
  183. .user {
  184. margin-top: 24rpx;
  185. font-size: 30rpx;
  186. color: #111;
  187. font-weight: Regular;
  188. }
  189. }
  190. .one-realName {
  191. width: 100%;
  192. display: flex;
  193. align-items: center;
  194. height: 120rpx;
  195. border-bottom: 1rpx solid #EFEFEF;
  196. .realName {
  197. width: 188rpx;
  198. height: 120rpx;
  199. line-height: 120rpx;
  200. font-size: 30rpx;
  201. color: #333333;
  202. font-weight: Regular;
  203. }
  204. .right {
  205. text-align: right;
  206. width: 100%;
  207. font-size: 30rpx;
  208. color: #666666;
  209. font-weight: Regular;
  210. // display: flex;
  211. // justify-content: space-between;
  212. }
  213. }
  214. .one-mobile {
  215. display: flex;
  216. width: 100%;
  217. align-items: center;
  218. height: 120rpx;
  219. border-bottom: 1rpx solid #EFEFEF;
  220. .right {
  221. width: 100%;
  222. text-align: right;
  223. font-size: 30rpx;
  224. color: #666666;
  225. font-weight: Regular;
  226. }
  227. .mobile {
  228. width: 188rpx;
  229. height: 120rpx;
  230. line-height: 120rpx;
  231. font-size: 30rpx;
  232. color: #333333;
  233. font-weight: Regular;
  234. }
  235. .replacement {
  236. border-radius: 50rpx;
  237. width: 80rpx;
  238. height: 48rpx;
  239. line-height: 48rpx;
  240. border: 1rpx solid #025EA7;
  241. color: #025EA7;
  242. font-weight: Regular;
  243. font-size: 24rpx;
  244. text-align: center;
  245. }
  246. }
  247. .one {
  248. height: 120rpx;
  249. line-height: 120rpx;
  250. display: flex;
  251. border-bottom: 1rpx solid #EFEFEF;
  252. justify-content: space-between;
  253. align-items: center;
  254. font-size: 30rpx;
  255. color: #333333;
  256. font-weight: Regular;
  257. }
  258. }
  259. .btn {
  260. margin: 120rpx auto;
  261. width: 650rpx;
  262. height: 88rpx;
  263. display: flex;
  264. background-color: #01B9F9;
  265. line-height: 88rpx;
  266. border-radius: 50rpx;
  267. .btn-btn {
  268. margin: 0 auto;
  269. font-size: 32rpx;
  270. color: #FFFFFF;
  271. font-weight: Regular;
  272. }
  273. }
  274. </style>