PersonalEditing.vue 7.6 KB

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