123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <template>
- <div class="club-device page">
- <div class="page-top flex flex-col justify-center items-center">
- <!-- <img class="logo" :src="supplierInfo.logo" /> -->
- <div class="name mt-2" v-text="supplierInfo.shopName + '认证记录'"></div>
- </div>
- <div class="page-content">
- <div class="page-title">设备认证</div>
- <FormClubDevice
- ref="formClubDevice"
- :formType="formType"
- @step="onClubDeviceFormStep"
- />
- <div class="control flex flex-col items-center">
- <div
- class="button submit flex justify-center items-center"
- @click="onSubmit"
- >
- 提交
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import FormClubDevice from '../../form/components/form-club-device.vue'
- import { mapGetters } from 'vuex'
- export default {
- layout: 'app',
- components: {
- FormClubDevice,
- },
- data() {
- return {
- productInfo: {},
- formData: {},
- productId: 0,
- formType: '',
- }
- },
- computed: {
- ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix', 'authId']),
- },
- mounted() {
- this.formType = this.$route.query.type
- this.getProductDetails()
- },
- methods: {
- async onSubmit() {
- try {
- await this.$refs.formClubDevice.validate()
- if (this.formType === 'edit') {
- this.formData.authId = this.authId
- }
- await this.$http.api.authProducSave(this.formData)
- this.$toast('保存成功')
- this.$router.push(
- `${this.routePrefix}/record/device/detail?id=${this.productId}`
- )
- } catch (error) {
- console.log(error)
- }
- },
- // 获取认证机构信息
- async getProductDetails() {
- try {
- this.productId = this.$route.query.id
- const res = await this.$http.api.getProductDetails({
- productId: this.productId,
- })
- this.productInfo = res.data
- console.log('productInfo', this.productInfo)
- this.$refs.formClubDevice.init(this.productInfo)
- } catch (error) {}
- },
- onClubDeviceFormStep(data) {
- console.log(data)
- this.formData = data[0]
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- @media screen and (min-width: 768px) {
- .page {
- background: #fff;
- }
- .page-top {
- height: 360px;
- @include themify($themes) {
- background: themed('pc-banner-record-device');
- background-size: auto 360px;
- }
- .logo {
- display: block;
- width: 120px;
- height: 120px;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 30px;
- color: #fff;
- }
- }
- .page-content {
- width: 700px;
- margin: 0 auto;
- overflow: hidden;
- min-height: calc(100vh - 80px - 80px - 360px);
- box-sizing: border-box;
- padding-bottom: 40px;
- .page-title {
- font-size: 24px;
- font-weight: bold;
- text-align: center;
- padding: 40px 0;
- }
- .el-select {
- width: 100%;
- }
- .control {
- margin-top: 62px;
- .button {
- width: 295px;
- height: 50px;
- cursor: pointer;
- &.submit {
- @include themify($themes) {
- background-color: themed('color');
- color: #fff;
- }
- }
- }
- }
- .device-param-list {
- position: relative;
- .add-param {
- position: absolute;
- cursor: pointer;
- top: -40px;
- right: 0;
- text-decoration: underline;
- font-size: 14px;
- @include themify($themes) {
- color: themed('color');
- }
- }
- .param {
- position: relative;
- .remove {
- position: absolute;
- right: 0;
- top: 0;
- width: 20px;
- height: 20px;
- background: #f94b4b;
- border-radius: 2px;
- cursor: pointer;
- color: #fff;
- font-size: 14px;
- text-align: center;
- line-height: 20px;
- }
- }
- }
- }
- }
- @media screen and (max-width: 768px) {
- .page {
- background: #fff;
- }
- .page-top {
- height: 46vw;
- @include themify($themes) {
- background: themed('h5-banner-record-device');
- background-size: auto 46vw;
- }
- .logo {
- display: block;
- width: 14.8vw;
- height: 14.8vw;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 4vw;
- color: #fff;
- }
- }
- .page-content {
- box-sizing: border-box;
- padding: 8vw 7vw;
- .page-title {
- font-size: 4.2vw;
- font-weight: bold;
- text-align: center;
- color: #282828;
- margin-bottom: 4.6vw;
- }
- .el-select {
- width: 100%;
- }
- .control {
- .button {
- width: 100%;
- height: 12vw;
- cursor: pointer;
- &.submit {
- @include themify($themes) {
- background-color: themed('color');
- color: #fff;
- }
- }
- }
- }
- .device-param-list {
- position: relative;
- .add-param {
- position: absolute;
- cursor: pointer;
- top: -40px;
- right: 0;
- font-size: 3.4vw;
- @include themify($themes) {
- color: themed('color');
- }
- }
- .param {
- position: relative;
- .remove {
- position: absolute;
- right: 0;
- top: 0;
- width: 4.4vw;
- height: 4.4vw;
- background: #f94b4b;
- border-radius: 0.2vw;
- cursor: pointer;
- color: #fff;
- font-size: 3.4vw;
- text-align: center;
- line-height: 4.4vw;
- }
- }
- }
- }
- }
- </style>
|