Commit 484fbabc by qinjianhui
parents f66f38fc 6981d9e9
...@@ -65,16 +65,25 @@ export default { ...@@ -65,16 +65,25 @@ export default {
{ name: '关于我们', path: '/about_us' }, { name: '关于我们', path: '/about_us' },
{ name: '帮助', path: '/help' }, { name: '帮助', path: '/help' },
], ],
userInfo:JSON.parse(localStorage.getItem('userInfo'))
} }
}, },
computed: { computed: {
...mapState(['userInfo']), // ...mapState(['userInfo']),
active() { active() {
return this.$route.path 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: { methods: {
...mapMutations(['setUserInfo']), ...mapMutations(['setUserInfo','setShopKey']),
changePath() { changePath() {
this.scrollParent().scrollTo({ this.scrollParent().scrollTo({
behavior: 'smooth', behavior: 'smooth',
...@@ -82,6 +91,9 @@ export default { ...@@ -82,6 +91,9 @@ export default {
}) })
}, },
login() { login() {
// if(this.$route.query&&this.$route.query.shopKey){
// this.setShopKey(this.$route.query.shopKey)
// }
this.$router.push('/login') this.$router.push('/login')
}, },
register() { register() {
......
...@@ -7,10 +7,14 @@ export default new Vuex.Store({ ...@@ -7,10 +7,14 @@ export default new Vuex.Store({
}, },
state: { state: {
userInfo: JSON.parse(JSON.stringify(localStorage.getItem('userInfo'))) || undefined, userInfo: JSON.parse(JSON.stringify(localStorage.getItem('userInfo'))) || undefined,
shopifyObj:{}
}, },
mutations: { mutations: {
setUserInfo(state, profile) { setUserInfo(state, profile) {
state.userInfo = profile state.userInfo = profile
},
setShopKey(state,data){
state.shopifyObj = data
} }
}, },
actions: { actions: {
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
line-height: 100px; line-height: 100px;
font-family: '微软雅黑'; font-family: '微软雅黑';
" v-if="userInfo.erpKey"> " 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> </div>
<h1 <h1
style=" style="
...@@ -77,24 +78,41 @@ ...@@ -77,24 +78,41 @@
</template> </template>
<script> <script>
// import {mapState} from 'vuex' import {mapState} from 'vuex'
import {post} from '../utils/axios'
export default { export default {
name: 'contact', name: 'contact',
components: {}, components: {},
data() { data() {
return { return {
userInfo:JSON.parse(localStorage.getItem('userInfo')) userInfo: JSON.parse(localStorage.getItem('userInfo')),
shopifyObj:JSON.parse(localStorage.getItem('shopifyObj'))
} }
}, },
computed: { computed: {
// ...mapState(['userInfo']), ...mapState(['shopifyObj']),
},
mounted() {
if (this.userInfo&&this.shopifyObj) {
this.getShopifyInfo()
}
}, },
methods: { methods: {
goBack() { goBack() {
this.$router.push('/home') 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> </script>
......
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
<script> <script>
import { post, get } from '../utils/axios' import { post, get } from '../utils/axios'
import md5 from 'js-md5' import md5 from 'js-md5'
import { mapMutations } from 'vuex' import {mapMutations, mapState} from 'vuex'
export default { export default {
name: 'login', name: 'login',
components: {}, components: {},
...@@ -290,7 +290,7 @@ export default { ...@@ -290,7 +290,7 @@ export default {
let url = `business/user/login` let url = `business/user/login`
post(url, { post(url, {
email: this.ruleForm.email, email: this.ruleForm.email,
password: passwordHash, password: passwordHash
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
localStorage.setItem('userInfo', JSON.stringify(res.data)) localStorage.setItem('userInfo', JSON.stringify(res.data))
......
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
<script> <script>
import { get, post } from '../utils/axios' import { get, post } from '../utils/axios'
import md5 from 'js-md5' import md5 from 'js-md5'
import {mapState} from "vuex";
export default { export default {
name: 'register', name: 'register',
components: {}, 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