| | |
| | | // 引入css |
| | | import "@/assets/iconfont/iconfont.css"; |
| | | import "@/assets/iconfont/iconfont.ttf"; |
| | | import { getUserInfodata } from "./axios/api"; |
| | | |
| | | import { mapActions } from "vuex"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | }, |
| | | name: "App", |
| | | created() { |
| | | this.getUserInfo(); |
| | | this.setUseInfo(); |
| | | this.$state.theme = "red"; |
| | | console.log(this.$state.theme, "asdasdasd"); |
| | | let title = this.$route.meta.title || this.$t("hj224"); |
| | | this.title = title; |
| | | if (this.$route.meta.is_Show) { |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | async getUserInfo() { |
| | | // 获取用户信息 |
| | | // let showcookie = this.getCookie('USER_TOKEN'); |
| | | let data = await getUserInfodata(); |
| | | if (data.status === 0) { |
| | | // this.getProductSetting() |
| | | this.$store.state.userInfo = data.data; |
| | | } else { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | }); |
| | | } |
| | | this.$store.state.user = this.user; |
| | | }, |
| | | ...mapActions(["setUseInfo"]), |
| | | |
| | | footColse() { |
| | | this.$store.commit("dialogVisible", true); |
| | | }, |
| | |
| | | import headers from "./components/header.vue"; |
| | | import * as api from "@/axios/api"; |
| | | import { Notify } from "vant"; |
| | | import { mapMutations } from "vuex"; |
| | | import { mapActions, mapMutations } from "vuex"; |
| | | |
| | | export default { |
| | | name: "newLogin", |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | ...mapActions(["setUseInfo"]), |
| | | ...mapMutations(["undataToken"]), |
| | | checkboxChange(e) { |
| | | window.localStorage.setItem("login_checked", e); |
| | |
| | | let data = await api.login(opts); |
| | | |
| | | if (data.status === 0) { |
| | | this.setUseInfo(); |
| | | if (this.checked) { |
| | | window.localStorage.setItem( |
| | | "login_admin", |
| | |
| | | |
| | | <script> |
| | | import * as api from "@/axios/api"; |
| | | import { mapActions } from "vuex"; |
| | | |
| | | export default { |
| | | name: "trBuy", |
| | |
| | | } else if (this.bayType == "qh") { |
| | | this.priceTabs = [this.$t("hj108")]; |
| | | } |
| | | this.getUserInfo(); |
| | | this.setUseInfo(); |
| | | this.getMoneyData(); |
| | | this.getSettingInfo(); |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | ...mapActions(["setUseInfo"]), |
| | | |
| | | async getMoneyData() { |
| | | let data = await api.getMoney(); |
| | | let type = this.bayType === "SZHB" ? "US" : this.bayType; |
| | |
| | | this.$router.push("/authentications"); |
| | | return; |
| | | } |
| | | // if (!this.agree) { |
| | | // Toast('需同意合作协议才能交易!') |
| | | // } else if (isNull(this.selectNumber) && isNull(this.autoNumber)) { |
| | | // Toast('请选择购买手数') |
| | | // } else if (isNull(this.selectType)) { |
| | | // Toast('请选择买卖方向') |
| | | // } else if(isNull(this.subaccountNumber)) { |
| | | // Toast('请选择子账户') |
| | | // } else {} |
| | | |
| | | if (this.buying) { |
| | | return; |
| | | } |
| | |
| | | elAlertType: "success", |
| | | }); |
| | | this.getUserInfo(); |
| | | var buyType = '' |
| | | var buyType = ""; |
| | | if (this.tabsCurrentIndex == 0) { |
| | | buyType = 1; |
| | | } else { |
| | | buyType = 0; |
| | | } |
| | | if(this.bayType=='US'){ |
| | | |
| | | this.$router.push("/warehouse?index=1&buyType="+buyType); |
| | | }else if(this.bayType=='MAS'){ |
| | | this.$router.push("/warehouse?index=0&buyType="+buyType); |
| | | }else { |
| | | if (this.bayType == "US") { |
| | | this.$router.push("/warehouse?index=1&buyType=" + buyType); |
| | | } else if (this.bayType == "MAS") { |
| | | this.$router.push("/warehouse?index=0&buyType=" + buyType); |
| | | } else { |
| | | this.$router.push("/warehouse"); |
| | | } |
| | | } else { |
| | |
| | | import { getUserInfodata } from "@/axios/api"; |
| | | import Vue from "vue"; |
| | | import Vuex from "vuex"; |
| | | // import getters from './getters' |
| | |
| | | let state = { |
| | | className: "black", |
| | | theme: "red", |
| | | userInfo: { |
| | | // 用户信息 |
| | | }, |
| | | userInfo: window.localStorage.getItem("useInfo") |
| | | ? JSON.parse(window.localStorage.getItem("useInfo")) |
| | | : {}, |
| | | user: {}, |
| | | bankInfo: { |
| | | bankNo: "" |
| | |
| | | |
| | | export default new Vuex.Store({ |
| | | state, |
| | | actions: {}, |
| | | actions: { |
| | | async setUseInfo({ commit }) { |
| | | let data = await getUserInfodata(); |
| | | if (data.status === 0) { |
| | | commit("SET_USE_INFO", data.data); |
| | | } else { |
| | | commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | mutations: { |
| | | SET_USE_INFO(state, useInfo) { |
| | | state.userInfo = useInfo; |
| | | window.localStorage.setItem("useInfo", JSON.stringify(useInfo)); |
| | | }, |
| | | undataToken(state, token) { |
| | | state.token = token || null; |
| | | }, |