PersonalEditing.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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. this.$api.detectionContent(tempFilePaths[0], 2).then(result => {
  119. if (result.code === 0) {
  120. uni.uploadFile({
  121. url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
  122. filePath: tempFilePaths[0],
  123. name: 'file',
  124. header: {
  125. token: wx.getStorageSync('access_token')
  126. },
  127. success: res => {
  128. let data = JSON.parse(res.data);
  129. this.dto.shopSign = data.data.url;
  130. this.save();
  131. }
  132. });
  133. } else this.$showToast(result.msg)
  134. })
  135. },
  136. fail: err => {
  137. this.myToast('图片上传失败', 'none');
  138. }
  139. });
  140. },
  141. save() {
  142. this.dto.idCardFront = this.list.idCardFront
  143. this.dto.name = this.list.name
  144. this.dto.companyName = this.list.companyName
  145. this.dto.merchantType = this.list.merchantType
  146. this.dto.companyType = this.list.companyType
  147. this.dto.legalPerson = this.list.legalPerson
  148. this.dto.idCard = this.list.idCard
  149. this.dto.creditCode = this.list.creditCode
  150. this.dto.idCardReverse = this.list.idCardReverse
  151. this.dto.licensePic = this.list.licensePic
  152. // this.dto.usccl = this.list.usccl
  153. this.dto.storeFrontPic = this.list.storeFrontPic
  154. this.dto.shopImgs = this.list.shopImgs
  155. this.dto.linkName = this.list.linkName
  156. this.dto.phone = this.list.phone
  157. this.dto.areaDetail = this.list.areaDetail
  158. this.dto.id = uni.getStorageSync('merchantId')
  159. this.dto.id = uni.getStorageSync('merchantId')
  160. this.$api.detectionContent(this.dto.name).then(result => {
  161. if (result.code !== 0) return this.$showToast(result.code==87014?'店铺名称包含敏感违规信息':result.msg);
  162. this.$api.put('/api/merchant/food/updateMerchantInfo', this.dto).then(res => {
  163. if (res.data.code == 0) {
  164. this.$showToast('保存成功');
  165. }
  166. })
  167. })
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. //保存样式
  174. .from-content1 {
  175. position: fixed;
  176. bottom: 30rpx;
  177. padding: 0 24rpx;
  178. left: 0;
  179. z-index: 10;
  180. width: 100%;
  181. box-sizing: border-box;
  182. }
  183. .tenant-button {
  184. background: #007A69;
  185. border-radius: 40rpx;
  186. font-weight: bold;
  187. font-size: 28rpx;
  188. color: #FFFFFF;
  189. height: 88rpx;
  190. line-height: 88rpx;
  191. }
  192. .page {
  193. box-sizing: border-box;
  194. padding: 30rpx;
  195. // padding-top: 150rpx;
  196. }
  197. .pics {
  198. display: grid;
  199. grid-template-columns: repeat(3, 1fr);
  200. gap: 12rpx
  201. }
  202. .from-content {
  203. .title {
  204. margin: 40rpx 0 36rpx;
  205. font-size: 30rpx;
  206. font-weight: Regular;
  207. color: #111111;
  208. }
  209. .one-image {
  210. width: 100%;
  211. display: flex;
  212. align-items: center;
  213. justify-content: space-between;
  214. .image {
  215. display: flex;
  216. align-items: center;
  217. image {
  218. width: 124rpx;
  219. border-radius: 100rpx;
  220. height: 124rpx;
  221. border-radius: 100rpx;
  222. }
  223. }
  224. .user {
  225. margin-top: 24rpx;
  226. font-size: 30rpx;
  227. color: #111;
  228. font-weight: Regular;
  229. }
  230. }
  231. .one-realName {
  232. width: 100%;
  233. display: flex;
  234. align-items: center;
  235. height: 120rpx;
  236. border-bottom: 1rpx solid #EFEFEF;
  237. .realName {
  238. width: 188rpx;
  239. height: 120rpx;
  240. line-height: 120rpx;
  241. font-size: 30rpx;
  242. color: #333333;
  243. font-weight: Regular;
  244. }
  245. .right {
  246. text-align: right;
  247. width: 100%;
  248. font-size: 30rpx;
  249. color: #666666;
  250. font-weight: Regular;
  251. // display: flex;
  252. // justify-content: space-between;
  253. }
  254. }
  255. .one-mobile {
  256. display: flex;
  257. width: 100%;
  258. align-items: center;
  259. height: 120rpx;
  260. border-bottom: 1rpx solid #EFEFEF;
  261. .right {
  262. width: 100%;
  263. text-align: right;
  264. font-size: 30rpx;
  265. color: #666666;
  266. font-weight: Regular;
  267. }
  268. .mobile {
  269. width: 188rpx;
  270. height: 120rpx;
  271. line-height: 120rpx;
  272. font-size: 30rpx;
  273. color: #333333;
  274. font-weight: Regular;
  275. }
  276. .replacement {
  277. border-radius: 50rpx;
  278. width: 80rpx;
  279. height: 48rpx;
  280. line-height: 48rpx;
  281. border: 1rpx solid #025EA7;
  282. color: #025EA7;
  283. font-weight: Regular;
  284. font-size: 24rpx;
  285. text-align: center;
  286. }
  287. }
  288. .one {
  289. height: 120rpx;
  290. line-height: 120rpx;
  291. display: flex;
  292. border-bottom: 1rpx solid #EFEFEF;
  293. justify-content: space-between;
  294. align-items: center;
  295. font-size: 30rpx;
  296. color: #333333;
  297. font-weight: Regular;
  298. }
  299. }
  300. .btn {
  301. margin: 120rpx auto;
  302. width: 650rpx;
  303. height: 88rpx;
  304. display: flex;
  305. background-color: #01B9F9;
  306. line-height: 88rpx;
  307. border-radius: 50rpx;
  308. .btn-btn {
  309. margin: 0 auto;
  310. font-size: 32rpx;
  311. color: #FFFFFF;
  312. font-weight: Regular;
  313. }
  314. }
  315. </style>