更新
This commit is contained in:
@@ -237,7 +237,7 @@
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
this.refreshLocation()
|
||||
// this.refreshLocation()
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh()
|
||||
}, 800);
|
||||
@@ -249,17 +249,11 @@
|
||||
const openid = uni.getStorageSync('openid')
|
||||
if (token && openid) {
|
||||
this.getAuthInfo()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '您还没有登录哦',
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
this.refreshLocation();
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
toManagement() {
|
||||
const user = uni.getStorageSync('user');
|
||||
if (user) {
|
||||
@@ -328,7 +322,7 @@
|
||||
if (resThird
|
||||
.authSetting[
|
||||
'scope.userLocation'
|
||||
]) {
|
||||
]) {
|
||||
this.refreshLocation()
|
||||
}
|
||||
}
|
||||
@@ -379,25 +373,39 @@
|
||||
|
||||
|
||||
showQr() {
|
||||
const user = uni.getStorageSync('user');
|
||||
let user = uni.getStorageSync("user");
|
||||
if (!user) {
|
||||
uni.showToast({
|
||||
title: '请先登录!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
uni.showModal({
|
||||
content: "登录后才能出示付款码哦",
|
||||
confirmText: "去登录",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/BagAuth/pages/login/login",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.showThreeSites = true
|
||||
},
|
||||
|
||||
toCards() {
|
||||
const user = uni.getStorageSync('user');
|
||||
let user = uni.getStorageSync("user");
|
||||
if (!user) {
|
||||
uni.showToast({
|
||||
title: '请先登录!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
uni.showModal({
|
||||
content: "登录后才能查看哦",
|
||||
confirmText: "去登录",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/BagAuth/pages/login/login",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/BagMoney/pages/oilCards/oilCards'
|
||||
@@ -405,6 +413,21 @@
|
||||
},
|
||||
|
||||
toOrders() {
|
||||
let user = uni.getStorageSync("user");
|
||||
if (!user) {
|
||||
uni.showModal({
|
||||
content: "登录后才能查看哦",
|
||||
confirmText: "去登录",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/BagAuth/pages/login/login",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/order/orderList/orderList'
|
||||
})
|
||||
@@ -419,42 +442,19 @@
|
||||
let params = {
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
params: { //类型:Object 必有字段 备注:// 筛选对象
|
||||
longitude: 117.157817, // 必有字段 备注:// 当前位置经度
|
||||
latitude: 31.802472, // 必有字段 备注:// 当前位置维度
|
||||
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
|
||||
// channelCode: "", // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||
// oilProductCode: "0#" // 备注:// 油号选择 ( 0# 92# 92#)
|
||||
params: {
|
||||
longitude: 117.157817,
|
||||
latitude: 31.802472,
|
||||
clientBelong: 'ZHONGPIN',
|
||||
comprehensiveSort: 1,
|
||||
zpDisable: 'ENABLE',
|
||||
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||
sort: "juli",
|
||||
...uni.getStorageSync('location'),
|
||||
...this.filterData,
|
||||
}
|
||||
};
|
||||
|
||||
if (!uni.getStorageSync('user')) {
|
||||
oilSiteApi.readOnlySites(params).then(res => {
|
||||
this.getCount++
|
||||
if (res.code == 20000) {
|
||||
this.siteList = res.data.list
|
||||
} else {
|
||||
if (this.getCount == 1) {
|
||||
setTimeout(() => {
|
||||
this.getSiteList()
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
oilSiteApi.getSiteLists(params).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.siteList = res.data.list
|
||||
}
|
||||
})
|
||||
}
|
||||
oilSiteApi[uni.getStorageSync('user') ? 'getSiteLists' : 'getSiteLists'](params).then(res => {
|
||||
oilSiteApi.getSiteLists(params).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.siteList = res.data.list
|
||||
}
|
||||
@@ -462,6 +462,21 @@
|
||||
},
|
||||
|
||||
toDetail(item) {
|
||||
let user = uni.getStorageSync("user");
|
||||
if (!user) {
|
||||
uni.showModal({
|
||||
content: "登录后才能查看哦",
|
||||
confirmText: "去登录",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/BagAuth/pages/login/login",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
let itemS = encodeURIComponent(JSON.stringify(item));
|
||||
uni.navigateTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`
|
||||
@@ -513,13 +528,20 @@
|
||||
},
|
||||
|
||||
openScan() {
|
||||
const user = uni.getStorageSync('user');
|
||||
let user = uni.getStorageSync("user");
|
||||
if (!user) {
|
||||
uni.showToast({
|
||||
title: '请先登录!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
uni.showModal({
|
||||
content: "登录后才能使用扫一扫哦",
|
||||
confirmText: "去登录",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/BagAuth/pages/login/login",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.scanCode({
|
||||
scanType: 'qrCode',
|
||||
|
||||
Reference in New Issue
Block a user