edit.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <div class="club-info page">
  3. <div class="page-top flex flex-col justify-center items-center">
  4. <!-- <img class="logo" :src="supplierInfo.logo" /> -->
  5. <div class="name mt-2" v-text="supplierInfo.shopName + '认证记录'"></div>
  6. </div>
  7. <div class="page-content">
  8. <div class="page-title">机构认证</div>
  9. <FormClubInfo ref="formClubInfo" @step="onClubInfoFormStep" />
  10. <div class="control flex flex-col items-center">
  11. <div
  12. class="button submit flex justify-center items-center"
  13. @click="onSubmit"
  14. >
  15. 提交
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import SimpleUploadImage from '@/components/SimpleUploadImage'
  23. import SimpleRadio from '@/components/SimpleRadio'
  24. import { mapGetters } from 'vuex'
  25. import FormClubInfo from '../../form/components/form-club-info.vue'
  26. export default {
  27. layout: 'app',
  28. components: {
  29. SimpleUploadImage,
  30. SimpleRadio,
  31. FormClubInfo,
  32. },
  33. computed: {
  34. ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix', 'clubUserId']),
  35. },
  36. data() {
  37. return {
  38. clubInfo: {},
  39. formData: {},
  40. }
  41. },
  42. created() {
  43. this.fetchAuthDetail()
  44. },
  45. methods: {
  46. async onSubmit() {
  47. try {
  48. await this.$refs.formClubInfo.validate()
  49. this.formData.authUserId = this.authUserId
  50. this.formData.source = 2
  51. this.formData.authId = this.clubInfo.authId
  52. await this.$http.api.authClubSave(this.formData)
  53. this.$toast('保存成功')
  54. this.$router.push(`${this.routePrefix}/record/club/detail`)
  55. } catch (error) {
  56. console.log(error)
  57. }
  58. },
  59. // 获取认证机构信息
  60. async fetchAuthDetail() {
  61. try {
  62. const result = await this.$http.api.fetchClubAuthInfo({
  63. clubUserId: this.clubUserId,
  64. })
  65. this.formData.authId = result.data.auth.authId
  66. const res = await this.$http.api.fetchClubAuthInfoData({
  67. authId: result.data.auth.authId,
  68. })
  69. this.clubInfo = res.data
  70. this.$refs.formClubInfo.init(this.clubInfo)
  71. } catch (error) {
  72. console.log(error)
  73. }
  74. },
  75. onClubInfoFormStep(data) {
  76. console.log(data)
  77. this.formData = data
  78. },
  79. },
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. @media screen and (min-width: 768px) {
  84. .page {
  85. background: #fff;
  86. }
  87. .page-top {
  88. height: 360px;
  89. @include themify($themes) {
  90. background: themed('pc-banner-record-club');
  91. background-size: auto 360px;
  92. }
  93. .logo {
  94. display: block;
  95. width: 120px;
  96. height: 120px;
  97. border-radius: 50%;
  98. background: #fff;
  99. }
  100. .name {
  101. font-size: 30px;
  102. color: #fff;
  103. }
  104. }
  105. .page-content {
  106. width: 700px;
  107. margin: 0 auto;
  108. overflow: hidden;
  109. min-height: calc(100vh - 80px - 80px - 360px);
  110. box-sizing: border-box;
  111. padding-bottom: 40px;
  112. .page-title {
  113. font-size: 24px;
  114. font-weight: bold;
  115. text-align: center;
  116. padding: 40px 0;
  117. }
  118. .control {
  119. margin-top: 62px;
  120. .button {
  121. width: 295px;
  122. height: 50px;
  123. cursor: pointer;
  124. &.submit {
  125. @include themify($themes) {
  126. background-color: themed('color');
  127. color: #fff;
  128. }
  129. }
  130. }
  131. }
  132. .normal-row {
  133. position: relative;
  134. .label {
  135. font-size: 14px;
  136. color: #606266;
  137. span {
  138. color: #b2b2b2;
  139. }
  140. }
  141. .postion-btn {
  142. position: absolute;
  143. top: 50%;
  144. right: 0;
  145. transform: translateY(-50%);
  146. width: 62px;
  147. height: 28px;
  148. line-height: 28px;
  149. font-size: 14px;
  150. color: #fff;
  151. background: #1890ff;
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. cursor: pointer;
  156. border-radius: 4px;
  157. &::before {
  158. content: '';
  159. display: inline-block;
  160. width: 16px;
  161. height: 16px;
  162. background: url(~assets/theme-images/common/icon-position.png)
  163. no-repeat center;
  164. background-size: 16px 16px;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. @media screen and (max-width: 768px) {
  171. ::v-deep {
  172. .el-form-item__label {
  173. font-size: 3.4vw;
  174. }
  175. }
  176. .page {
  177. background: #fff;
  178. }
  179. .page-top {
  180. height: 46vw;
  181. @include themify($themes) {
  182. background: themed('h5-banner-record-club');
  183. background-size: auto 46vw;
  184. }
  185. .logo {
  186. display: block;
  187. width: 14.8vw;
  188. height: 14.8vw;
  189. border-radius: 50%;
  190. background: #fff;
  191. }
  192. .name {
  193. font-size: 4vw;
  194. color: #fff;
  195. }
  196. }
  197. .page-content {
  198. box-sizing: border-box;
  199. padding: 8vw 7vw;
  200. .page-title {
  201. font-size: 4.2vw;
  202. font-weight: bold;
  203. text-align: center;
  204. margin-bottom: 8vw;
  205. color: #282828;
  206. }
  207. .control {
  208. .button {
  209. width: 100%;
  210. height: 12vw;
  211. cursor: pointer;
  212. &.submit {
  213. @include themify($themes) {
  214. background-color: themed('color');
  215. color: #fff;
  216. }
  217. }
  218. }
  219. }
  220. .normal-row {
  221. position: relative;
  222. .label {
  223. font-size: 14px;
  224. color: #606266;
  225. span {
  226. color: #b2b2b2;
  227. font-size: 2.6vw;
  228. }
  229. }
  230. .postion-btn {
  231. position: absolute;
  232. top: 50%;
  233. right: 0;
  234. transform: translateY(-50%);
  235. width: 14vw;
  236. height: 6.8vw;
  237. line-height: 6.8vw;
  238. font-size: 3.2vw;
  239. color: #fff;
  240. background: #1890ff;
  241. display: flex;
  242. justify-content: center;
  243. align-items: center;
  244. cursor: pointer;
  245. border-radius: 0.4vw;
  246. &::before {
  247. content: '';
  248. display: inline-block;
  249. width: 3.58vw;
  250. height: 3.58vw;
  251. background: url(~assets/theme-images/common/icon-position.png)
  252. no-repeat center;
  253. background-size: 3.58vw;
  254. }
  255. }
  256. }
  257. }
  258. }
  259. </style>