edit.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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-ph',
  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. @include useTheme() {
  86. background: #fff;
  87. .page-top {
  88. height: 360px;
  89. background: fetch('pc-banner-record-club');
  90. background-size: auto 360px;
  91. .logo {
  92. display: block;
  93. width: 120px;
  94. height: 120px;
  95. border-radius: 50%;
  96. background: #fff;
  97. }
  98. .name {
  99. font-size: 30px;
  100. color: #fff;
  101. }
  102. }
  103. .page-content {
  104. width: 700px;
  105. margin: 0 auto;
  106. overflow: hidden;
  107. min-height: calc(100vh - 80px - 80px - 360px);
  108. box-sizing: border-box;
  109. padding-bottom: 40px;
  110. .page-title {
  111. font-size: 24px;
  112. font-weight: bold;
  113. text-align: center;
  114. padding: 40px 0;
  115. }
  116. .control {
  117. margin-top: 62px;
  118. .button {
  119. width: 295px;
  120. height: 50px;
  121. cursor: pointer;
  122. &.submit {
  123. background-color: fetch('color');
  124. color: #fff;
  125. }
  126. }
  127. }
  128. .normal-row {
  129. position: relative;
  130. .label {
  131. font-size: 14px;
  132. color: #606266;
  133. span {
  134. color: #b2b2b2;
  135. }
  136. }
  137. .postion-btn {
  138. position: absolute;
  139. top: 50%;
  140. right: 0;
  141. transform: translateY(-50%);
  142. width: 62px;
  143. height: 28px;
  144. line-height: 28px;
  145. font-size: 14px;
  146. color: #fff;
  147. background: #1890ff;
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. cursor: pointer;
  152. border-radius: 4px;
  153. &::before {
  154. content: '';
  155. display: inline-block;
  156. width: 16px;
  157. height: 16px;
  158. background: url(~assets/theme-images/common/icon-position.png)
  159. no-repeat center;
  160. background-size: 16px 16px;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. @media screen and (max-width: 768px) {
  169. ::v-deep {
  170. .el-form-item__label {
  171. font-size: 3.4vw;
  172. }
  173. }
  174. .page {
  175. @include useTheme() {
  176. background: #fff;
  177. .page-top {
  178. height: 46vw;
  179. background: fetch('h5-banner-record-club');
  180. background-size: auto 46vw;
  181. .logo {
  182. display: block;
  183. width: 14.8vw;
  184. height: 14.8vw;
  185. border-radius: 50%;
  186. background: #fff;
  187. }
  188. .name {
  189. font-size: 4vw;
  190. color: #fff;
  191. }
  192. }
  193. .page-content {
  194. box-sizing: border-box;
  195. padding: 8vw 7vw;
  196. .page-title {
  197. font-size: 4.2vw;
  198. font-weight: bold;
  199. text-align: center;
  200. margin-bottom: 8vw;
  201. color: #282828;
  202. }
  203. .control {
  204. .button {
  205. width: 100%;
  206. height: 12vw;
  207. cursor: pointer;
  208. &.submit {
  209. background-color: fetch('color');
  210. color: #fff;
  211. }
  212. }
  213. }
  214. .normal-row {
  215. position: relative;
  216. .label {
  217. font-size: 14px;
  218. color: #606266;
  219. span {
  220. color: #b2b2b2;
  221. font-size: 2.6vw;
  222. }
  223. }
  224. .postion-btn {
  225. position: absolute;
  226. top: 50%;
  227. right: 0;
  228. transform: translateY(-50%);
  229. width: 14vw;
  230. height: 6.8vw;
  231. line-height: 6.8vw;
  232. font-size: 3.2vw;
  233. color: #fff;
  234. background: #1890ff;
  235. display: flex;
  236. justify-content: center;
  237. align-items: center;
  238. cursor: pointer;
  239. border-radius: 0.4vw;
  240. &::before {
  241. content: '';
  242. display: inline-block;
  243. width: 3.58vw;
  244. height: 3.58vw;
  245. background: url(~assets/theme-images/common/icon-position.png)
  246. no-repeat center;
  247. background-size: 3.58vw;
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255. </style>