Commit ac5edd5c by 杨北旺

修复头像显示问题

1 parent 319ec225
......@@ -6,7 +6,7 @@ import {
Notify
} from 'vant'
import store from '@/store'
import { common,equity } from '../api/api'
import { common } from '../api/api'
Vue.use(VueRouter)
const router = new VueRouter({
routes,
......@@ -75,14 +75,15 @@ const getSessionAppId = (sid,status) => {
setUserInfo(data);
if(status) {
store.commit('reload');
}else {
equity.getCardInfo().then(res => {
let { code } = res;
if (code == 0) {
router.push({name: 'equity.index'})
}
})
}
// else {
// equity.getCardInfo().then(res => {
// let { code } = res;
// if (code == 0) {
// router.push({name: 'equity.index'})
// }
// })
// }
}
})
}
......
......@@ -21,6 +21,15 @@ export default {
center:false
};
},
created(){
if (window.history && window.history.pushState) {
    history.pushState(null, null, document.URL);
    window.addEventListener('popstate', this.watchReturn, false);//false阻止默认事件
  }
},
destroyed() {
window.removeEventListener('popstate', this.watchReturn, false);//false阻止默认事件
},
mounted() {
let result = this.getLocalStorage("bindinfo");
const {code,errId,message} = result
......@@ -41,6 +50,11 @@ export default {
methods: {
copyName(){
this.cloneText('嘀加智享车生活')
},
watchReturn(){
// this.$router.replace({ name: "common.expcard"});
window.history.back();
history.pushState(null, null, document.URL);
}
},
};
......
......@@ -245,6 +245,10 @@ export default {
this.isOpen = 0;
}
// 重新获取头像,避免头像拿不到
//app那边可能拿不到头像---写这个重新获取一下
let { nickName, logo } = this.$store.state;
this.userInfo.nickName = nickName;
this.userInfo.logo = logo;
this.getUserInfoBySession();
// 试用期到期。弹框提示
let showMydialog1 = this.getLocalStorage("showMydialog1");
......@@ -266,7 +270,6 @@ export default {
this.isConcernFn();
//app那边可能拿不到头像---写这个重新获取一下
let { nickName, logo } = this.$store.state;
console.log('store',this.$store.state);
this.userInfo.nickName = nickName;
this.userInfo.logo = logo;
},
......
......@@ -258,7 +258,9 @@ export default {
},
//详情
jumpDetail(val) {
window.vm.$router.push({ name: 'oilStation.detail',query:{
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.push({ name: 'oilStation.detail',query:{
oilId: val.id,
oilNo: val.oilNo,
longitude: val.gasAddressLongitude,
......@@ -266,6 +268,28 @@ export default {
distance: val.distance
}
})
}else{
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/oilStation/detail?sessionId=${sessionId}&oilId=${val.id}&&oilNo=${val.oilNo}&longitude=${val.gasAddressLongitude}&latitude=${val.gasAddressLatitude}&distance=${val.distance}`;
this.openWindows(url, 'oilStation.detail')
}
// const ua = navigator.userAgent.toLowerCase()
// if (ua.match(/MicroMessenger/i) == 'micromessenger') {
// window.vm.$router.push({ name: 'oilStation.detail',query:{
// oilId: val.id,
// oilNo: val.oilNo,
// longitude: val.gasAddressLongitude,
// latitude: val.gasAddressLatitude,
// distance: val.distance
// }
// })
// }else{
// let [href] = window.location.href.split('/#/');
// let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&oilId=${val.id}&&oilNo=${val.oilNo}&longitude=${val.gasAddressLongitude}&latitude=${val.gasAddressLatitude}&distance=${distance}`;
// this.openWindows(url, 'cardRoll.detail')
// }
},
change() {
this.pageNum = 1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!