Commit b1d094b1 by 杨北旺

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

1 parent 7e982c66
...@@ -89,8 +89,7 @@ export default { ...@@ -89,8 +89,7 @@ export default {
}, },
handlePay(payData) { handlePay(payData) {
const {timeStamp, nonceStr, packages, signType, paySign} = payData; const {timeStamp, nonceStr, packages, signType, paySign} = payData;
WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(res => { WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(() => {
console.log(res)
if (this.appearance == 2) { if (this.appearance == 2) {
let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination
window.vm.$router.push({ window.vm.$router.push({
......
...@@ -88,7 +88,6 @@ const getSessionAppId = (sid,status) => { ...@@ -88,7 +88,6 @@ const getSessionAppId = (sid,status) => {
} }
const getSessionId = (redirectUrl, state) => { const getSessionId = (redirectUrl, state) => {
const params = getParams(window.location.href) const params = getParams(window.location.href)
console.log(params)
if (params.code) { if (params.code) {
const appId = sessionStorage.getItem('GL_WX_APPID') const appId = sessionStorage.getItem('GL_WX_APPID')
common.getSessionId({ code: params.code, state, appId }).then(res => { common.getSessionId({ code: params.code, state, appId }).then(res => {
......
...@@ -88,7 +88,6 @@ class WxConfig { ...@@ -88,7 +88,6 @@ class WxConfig {
scale, scale,
infoUrl, infoUrl,
success(res) { success(res) {
console.log(res)
resolve(res) resolve(res)
} }
}) })
......
...@@ -233,6 +233,21 @@ const myDialog = (message,confirmText,cancelText,comfirmFn,cancelFn)=>{ ...@@ -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 = { const utils = {
removeLocalStorage, removeLocalStorage,
setLocalStorage, setLocalStorage,
...@@ -253,7 +268,8 @@ const utils = { ...@@ -253,7 +268,8 @@ const utils = {
alert, alert,
cloneText, cloneText,
getParams, getParams,
myDialog myDialog,
openNavigation
} }
Object.keys(utils).map(key => { Object.keys(utils).map(key => {
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
self.getTwoHeightArr(); self.getTwoHeightArr();
}); });
self.hideLoading() self.hideLoading()
}, 1500); }, 2000);
}, },
methods: { methods: {
// 点击跳转商品详情 // 点击跳转商品详情
...@@ -172,6 +172,9 @@ export default { ...@@ -172,6 +172,9 @@ export default {
}; };
}, },
}, },
destroyed(){
window.removeEventListener('scroll', this.bindScrollEvent, false);
},
}; };
</script> </script>
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.listeningBack(); // this.listeningBack();
this.getOilNoList(); this.getOilNoList();
let longitude,latitude; let longitude,latitude;
if(this.$store.state.address.longitude) { if(this.$store.state.address.longitude) {
...@@ -121,11 +121,12 @@ export default { ...@@ -121,11 +121,12 @@ export default {
history.pushState({}, null, window.location.href); history.pushState({}, null, window.location.href);
if(path == 'oilStation.location' || path == 'oilStation.detail' || path == 'oilStation.record') { if(path == 'oilStation.location' || path == 'oilStation.detail' || path == 'oilStation.record') {
window.vm.$router.replace({name:window.vm.$store.state.prevPath}) window.vm.$router.replace({name:window.vm.$store.state.prevPath})
if(sessionStorage.getItem('common') == 1) {
window.vm.$router.replace({name:'equity.index'}) window.vm.$router.replace({name:'equity.index'})
}else { // if(sessionStorage.getItem('common') == 1) {
window.vm.$router.replace({name:'common.index'}) // window.vm.$router.replace({name:'equity.index'})
} // }else {
// window.vm.$router.replace({name:'common.index'})
// }
} }
} }
}, },
...@@ -255,11 +256,11 @@ export default { ...@@ -255,11 +256,11 @@ export default {
}, },
//更新定位 //更新定位
jumpLocation() { jumpLocation() {
window.vm.$router.push({ name: 'oilStation.location'}) window.vm.$router.replace({ name: 'oilStation.location'})
}, },
//加油记录 //加油记录
jumpRecord() { jumpRecord() {
window.vm.$router.push({ name: 'oilStation.record' }) window.vm.$router.replace({ name: 'oilStation.record' })
}, },
//详情 //详情
jumpDetail(val) { jumpDetail(val) {
......
...@@ -181,10 +181,10 @@ export default { ...@@ -181,10 +181,10 @@ export default {
}, },
selectItem(val) { selectItem(val) {
this.$store.commit('setAddress',val) this.$store.commit('setAddress',val)
window.vm.$router.push({ path: '/oilStation/index'}) window.vm.$router.replace({ path: '/oilStation/index'})
}, },
selectAddress() { selectAddress() {
window.vm.$router.push({ path: '/oilStation/index'}) window.vm.$router.replace({ path: '/oilStation/index'})
}, },
selectLocation(value) { selectLocation(value) {
let para = { let para = {
...@@ -197,7 +197,7 @@ export default { ...@@ -197,7 +197,7 @@ export default {
let { code, message } = res let { code, message } = res
if (code == 0) { if (code == 0) {
this.$store.commit('setAddress',para) this.$store.commit('setAddress',para)
window.vm.$router.push({ path: '/oilStation/index'}) window.vm.$router.replace({ path: '/oilStation/index'})
} else { } else {
this.showToast(message) this.showToast(message)
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!