Commit a4348bf7 by yangzhi

featshopfiy跳转

parent ebd12b8c
...@@ -66,16 +66,23 @@ export default { ...@@ -66,16 +66,23 @@ 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.userInfo&&this.$route.query.shopKey){
this.setShopKey(this.$route.query)
this.$router.push('/contact')
}
},
methods: { methods: {
...mapMutations(['setUserInfo']), ...mapMutations(['setUserInfo','setShopKey']),
changePath() { changePath() {
this.scrollParent().scrollTo({ this.scrollParent().scrollTo({
behavior: 'smooth', behavior: 'smooth',
...@@ -83,6 +90,9 @@ export default { ...@@ -83,6 +90,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="
...@@ -33,11 +34,11 @@ ...@@ -33,11 +34,11 @@
font-size: 50px; font-size: 50px;
line-height: 100px; line-height: 100px;
font-family: '微软雅黑'; font-family: '微软雅黑';
" v-else> " v-else>
您尚未开通erp权限,请联系您的商务经理 您尚未开通erp权限,请联系您的商务经理
</h1> </h1>
<h2 <h2
style=" style="
text-align: center; text-align: center;
color: #fff; color: #fff;
font-size: 36px; font-size: 36px;
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
联系电话:15399065167 联系电话:15399065167
</h2> </h2>
<h2 <h2
style=" style="
text-align: center; text-align: center;
color: #fff; color: #fff;
font-size: 36px; font-size: 36px;
...@@ -77,24 +78,40 @@ ...@@ -77,24 +78,40 @@
</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'))
} }
}, },
computed: { computed: {
// ...mapState(['userInfo']), ...mapState(['shopifyObj']),
},
mounted() {
if (this.userInfo) {
this.getShopifyInfo()
}
}, },
methods: { methods: {
goBack() { goBack() {
this.$router.push('/') this.$router.push('/')
}, },
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