Commit b1d094b1 by 杨北旺

修改我的卡包/首页加油列表/精选

1 parent 7e982c66
......@@ -89,8 +89,7 @@ export default {
},
handlePay(payData) {
const {timeStamp, nonceStr, packages, signType, paySign} = payData;
WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(res => {
console.log(res)
WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(() => {
if (this.appearance == 2) {
let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination
window.vm.$router.push({
......
......@@ -88,7 +88,6 @@ const getSessionAppId = (sid,status) => {
}
const getSessionId = (redirectUrl, state) => {
const params = getParams(window.location.href)
console.log(params)
if (params.code) {
const appId = sessionStorage.getItem('GL_WX_APPID')
common.getSessionId({ code: params.code, state, appId }).then(res => {
......
......@@ -88,7 +88,6 @@ class WxConfig {
scale,
infoUrl,
success(res) {
console.log(res)
resolve(res)
}
})
......
......@@ -233,6 +233,21 @@ const myDialog = (message,confirmText,cancelText,comfirmFn,cancelFn)=>{
}
})
}
// 导航 (微信环境需要传WX过来,如果在这里直接导入会报错)
const openNavigation = (val,WX)=>{
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(() => {
// console.log(res)
})
}else{
if (checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)}))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)}))
}
}
}
const utils = {
removeLocalStorage,
setLocalStorage,
......@@ -253,7 +268,8 @@ const utils = {
alert,
cloneText,
getParams,
myDialog
myDialog,
openNavigation
}
Object.keys(utils).map(key => {
......
......@@ -73,7 +73,7 @@ export default {
self.getTwoHeightArr();
});
self.hideLoading()
}, 1500);
}, 2000);
},
methods: {
// 点击跳转商品详情
......@@ -172,6 +172,9 @@ export default {
};
},
},
destroyed(){
window.removeEventListener('scroll', this.bindScrollEvent, false);
},
};
</script>
......
......@@ -94,7 +94,7 @@ export default {
}
},
mounted() {
this.listeningBack();
// this.listeningBack();
this.getOilNoList();
let longitude,latitude;
if(this.$store.state.address.longitude) {
......@@ -121,11 +121,12 @@ export default {
history.pushState({}, null, window.location.href);
if(path == 'oilStation.location' || path == 'oilStation.detail' || path == 'oilStation.record') {
window.vm.$router.replace({name:window.vm.$store.state.prevPath})
if(sessionStorage.getItem('common') == 1) {
window.vm.$router.replace({name:'equity.index'})
}else {
window.vm.$router.replace({name:'common.index'})
}
window.vm.$router.replace({name:'equity.index'})
// if(sessionStorage.getItem('common') == 1) {
// window.vm.$router.replace({name:'equity.index'})
// }else {
// window.vm.$router.replace({name:'common.index'})
// }
}
}
},
......@@ -255,11 +256,11 @@ export default {
},
//更新定位
jumpLocation() {
window.vm.$router.push({ name: 'oilStation.location'})
window.vm.$router.replace({ name: 'oilStation.location'})
},
//加油记录
jumpRecord() {
window.vm.$router.push({ name: 'oilStation.record' })
window.vm.$router.replace({ name: 'oilStation.record' })
},
//详情
jumpDetail(val) {
......
......@@ -181,10 +181,10 @@ export default {
},
selectItem(val) {
this.$store.commit('setAddress',val)
window.vm.$router.push({ path: '/oilStation/index'})
window.vm.$router.replace({ path: '/oilStation/index'})
},
selectAddress() {
window.vm.$router.push({ path: '/oilStation/index'})
window.vm.$router.replace({ path: '/oilStation/index'})
},
selectLocation(value) {
let para = {
......@@ -197,7 +197,7 @@ export default {
let { code, message } = res
if (code == 0) {
this.$store.commit('setAddress',para)
window.vm.$router.push({ path: '/oilStation/index'})
window.vm.$router.replace({ path: '/oilStation/index'})
} else {
this.showToast(message)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!