| | |
| | | <el-step title="注册信息"></el-step>
|
| | | </el-steps>
|
| | |
|
| | | <el-carousel
|
| | | ref="carousel"
|
| | | trigger="click"
|
| | | :loop="false"
|
| | | :autoplay="false"
|
| | | :initial-index="active"
|
| | | >
|
| | | <el-carousel ref="carousel" trigger="click" :loop="false" :autoplay="false" :initial-index="active">
|
| | | <el-carousel-item>
|
| | | <formAccount ref="form0"></formAccount>
|
| | | </el-carousel-item>
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import formAccount from "@/pages/index/components/formAccount";
|
| | | import formNet from "@/pages/index/components/formNet";
|
| | | import formInfo from "@/pages/index/components/formInfo";
|
| | | import {
|
| | | getInitInfo,
|
| | | savePassword,
|
| | | initNetwork,
|
| | | saveRegInfo,
|
| | | getRegInfo,
|
| | | isOnNet,
|
| | | } from "./api";
|
| | | import formAccount from "@/pages/index/components/formAccount"
|
| | | import formNet from "@/pages/index/components/formNet"
|
| | | import formInfo from "@/pages/index/components/formInfo"
|
| | | import { getInitInfo, savePassword, initNetwork, saveRegInfo, getRegInfo, isOnNet } from "./api"
|
| | |
|
| | | export default {
|
| | | created() {
|
| | | window.addEventListener("keydown", (event) => {
|
| | | if (event.keyCode === 9) {
|
| | | console.log("tabfalse13");
|
| | | event.preventDefault();
|
| | | console.log("tabfalse13")
|
| | | event.preventDefault()
|
| | | }
|
| | | });
|
| | | })
|
| | | },
|
| | | mounted() {
|
| | | this.getInitInfo();
|
| | | let message = "网络正常";
|
| | | this.getInitInfo()
|
| | | let message = "网络正常"
|
| | |
|
| | | function onLine(callback) {
|
| | | var img = new Image();
|
| | | var img = new Image()
|
| | | //临时判断网络是否通畅
|
| | | img.src = "http://apps.smartai.com/img/icon_logo.f78688b5.png";
|
| | | img.src = "http://apps.smartai.com/img/icon_logo.f78688b5.png"
|
| | | img.onload = function () {
|
| | | console.log("11111");
|
| | | if (callback) callback(true);
|
| | | };
|
| | | console.log("11111")
|
| | | if (callback) callback(true)
|
| | | }
|
| | | img.onerror = function () {
|
| | | console.log("22222");
|
| | | if (callback) callback(false);
|
| | | };
|
| | | console.log("22222")
|
| | | if (callback) callback(false)
|
| | | }
|
| | | }
|
| | |
|
| | | onLine((flag) => {
|
| | | let message = "";
|
| | | let message = ""
|
| | | if (flag) {
|
| | | this.isNet = true;
|
| | | message = "已有网络";
|
| | | this.isNet = true
|
| | | message = "已有网络"
|
| | | } else {
|
| | | //网络断网效果图出来后,将此地改为跳转路径到效果图上
|
| | | message = "未配置网络";
|
| | | message = "无法连接互联网"
|
| | | this.$notify({
|
| | | message: message,
|
| | | });
|
| | | message: message
|
| | | })
|
| | | }
|
| | | });
|
| | | })
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | active: 0,
|
| | | formData: {},
|
| | | isWhite: true,
|
| | | isNet: false,
|
| | | };
|
| | | isNet: false
|
| | | }
|
| | | },
|
| | | components: {
|
| | | formAccount,
|
| | | formNet,
|
| | | formInfo,
|
| | | formInfo
|
| | | },
|
| | | methods: {
|
| | | preForm() {
|
| | | if (this.active == 0) {
|
| | | return;
|
| | | return
|
| | | }
|
| | | this.active--;
|
| | | this.$refs["carousel"].prev();
|
| | | this.active--
|
| | | this.$refs["carousel"].prev()
|
| | | },
|
| | | async nextForm() {
|
| | | if (this.active == 2) {
|
| | | const data = this.$refs[`form${this.active}`].getFormData();
|
| | | await saveRegInfo(data);
|
| | | location.assign("/view/login/");
|
| | | return;
|
| | | const data = this.$refs[`form${this.active}`].getFormData()
|
| | | await saveRegInfo(data)
|
| | | location.assign("/view/login/")
|
| | | return
|
| | | }
|
| | |
|
| | | if (this.active == 0) {
|
| | | const data = this.$refs[`form${this.active}`].getFormData();
|
| | | const data = this.$refs[`form${this.active}`].getFormData()
|
| | | if (!data) {
|
| | | return false;
|
| | | return false
|
| | | }
|
| | | const res1 = await savePassword(data);
|
| | | console.log(data);
|
| | | this.active++;
|
| | | this.$refs["carousel"].next();
|
| | | const res1 = await savePassword(data)
|
| | | console.log(data)
|
| | | this.active++
|
| | | this.$refs["carousel"].next()
|
| | | }
|
| | |
|
| | | if (this.active == 1) {
|
| | | const data = this.$refs[`form${this.active}`].getFormData();
|
| | | initNetwork(data);
|
| | | this.active++;
|
| | | this.$refs["carousel"].next();
|
| | | const data = this.$refs[`form${this.active}`].getFormData()
|
| | | initNetwork(data)
|
| | | this.active++
|
| | | this.$refs["carousel"].next()
|
| | | }
|
| | |
|
| | | this.getInitInfo()
|
| | | },
|
| | | nextFormNot() {
|
| | | this.active++;
|
| | | this.$refs["carousel"].next();
|
| | | this.getInitInfo()
|
| | |
|
| | | this.active++
|
| | | this.$refs["carousel"].next()
|
| | | },
|
| | | async getInitInfo() {
|
| | | const res = await getInitInfo().catch((err) => {
|
| | | this.isWhite = false;
|
| | | });
|
| | | this.isWhite = false
|
| | | })
|
| | |
|
| | | console.log(res);
|
| | | console.log(res)
|
| | |
|
| | | if (res.data && res.data.initPwd && !res.data.initRegInfo) {
|
| | | const res1 = await getRegInfo();
|
| | | this.active = 1;
|
| | | console.log(res1);
|
| | | const res1 = await getRegInfo()
|
| | | this.active = 1
|
| | | console.log(res1)
|
| | | setTimeout(() => {
|
| | | this.$refs["carousel"].setActiveItem(1);
|
| | | }, 0);
|
| | | this.$refs["carousel"].setActiveItem(1)
|
| | | }, 0)
|
| | | }
|
| | |
|
| | | if (res.data && res.data.initPwd && res.data.initRegInfo) {
|
| | | location.assign("/view/login/");
|
| | | return;
|
| | | location.assign("/view/login/")
|
| | | return
|
| | | }
|
| | |
|
| | | this.isWhite = false;
|
| | | },
|
| | | this.isWhite = false
|
| | | }
|
| | | },
|
| | | destroyed() {
|
| | | window.removeEventListener("keydown", (event) => {
|
| | | console.log(event.value);
|
| | | event.preventDefault();
|
| | | });
|
| | | },
|
| | | };
|
| | | console.log(event.value)
|
| | | event.preventDefault()
|
| | | })
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|