Commit 484fbabc by qinjianhui
parents f66f38fc 6981d9e9
......@@ -65,16 +65,25 @@ export default {
{ name: '关于我们', path: '/about_us' },
{ name: '帮助', path: '/help' },
],
userInfo:JSON.parse(localStorage.getItem('userInfo'))
}
},
computed: {
...mapState(['userInfo']),
// ...mapState(['userInfo']),
active() {
return this.$route.path
},
},
mounted() {
if(this.$route.query.shopKey){
localStorage.setItem('shopifyObj', JSON.stringify(this.$route.query))
}
if(this.userInfo){
this.$router.push('/contact')
}
},
methods: {
...mapMutations(['setUserInfo']),
...mapMutations(['setUserInfo','setShopKey']),
changePath() {
this.scrollParent().scrollTo({
behavior: 'smooth',
......@@ -82,6 +91,9 @@ export default {
})
},
login() {
// if(this.$route.query&&this.$route.query.shopKey){
// this.setShopKey(this.$route.query.shopKey)
// }
this.$router.push('/login')
},
register() {
......
......@@ -7,10 +7,14 @@ export default new Vuex.Store({
},
state: {
userInfo: JSON.parse(JSON.stringify(localStorage.getItem('userInfo'))) || undefined,
shopifyObj:{}
},
mutations: {
setUserInfo(state, profile) {
state.userInfo = profile
},
setShopKey(state,data){
state.shopifyObj = data
}
},
actions: {
......
......@@ -24,7 +24,8 @@
line-height: 100px;
font-family: '微软雅黑';
" v-if="userInfo.erpKey">
<a :href="'https://'+userInfo.erpKey+'.jomalls.com'" target="_blank" style="text-decoration: none"> {{userInfo.erpKey+'.jomalls.com'}}</a>
<a :href="'https://'+userInfo.erpKey+'.jomalls.com'" target="_blank" style="text-decoration: none">
{{ userInfo.erpKey + '.jomalls.com' }}</a>
</div>
<h1
style="
......@@ -77,24 +78,41 @@
</template>
<script>
// import {mapState} from 'vuex'
import {mapState} from 'vuex'
import {post} from '../utils/axios'
export default {
name: 'contact',
components: {},
data() {
return {
userInfo:JSON.parse(localStorage.getItem('userInfo'))
userInfo: JSON.parse(localStorage.getItem('userInfo')),
shopifyObj:JSON.parse(localStorage.getItem('shopifyObj'))
}
},
computed: {
// ...mapState(['userInfo']),
...mapState(['shopifyObj']),
},
mounted() {
if (this.userInfo&&this.shopifyObj) {
this.getShopifyInfo()
}
},
methods: {
goBack() {
this.$router.push('/home')
},
logout() {},
getShopifyInfo() {
post('business/shop/bind', {
shopKey: this.shopifyObj.shopKey,
platform: this.shopifyObj.platform,
companyCode: this.userInfo.erpKey
}).then(res => {
console.log(res)
})
},
logout() {
},
},
}
</script>
......
......@@ -173,7 +173,7 @@
<script>
import { post, get } from '../utils/axios'
import md5 from 'js-md5'
import { mapMutations } from 'vuex'
import {mapMutations, mapState} from 'vuex'
export default {
name: 'login',
components: {},
......@@ -290,7 +290,7 @@ export default {
let url = `business/user/login`
post(url, {
email: this.ruleForm.email,
password: passwordHash,
password: passwordHash
}).then((res) => {
if (res.code === 200) {
localStorage.setItem('userInfo', JSON.stringify(res.data))
......
......@@ -106,6 +106,7 @@
<script>
import { get, post } from '../utils/axios'
import md5 from 'js-md5'
import {mapState} from "vuex";
export default {
name: 'register',
components: {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment