2 Commits

Author SHA1 Message Date
xiaozhiyong
5848de68fa 更新 2024-06-19 16:35:21 +08:00
xiaozhiyong
0c0aac6fac 更新 2024-06-17 16:29:56 +08:00
3 changed files with 152 additions and 151 deletions

View File

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

View File

@@ -33,8 +33,8 @@
<!-- 筛选开始 --> <!-- 筛选开始 -->
<scroll-view class="screentop bg-white" style="flex: 1;"> <scroll-view class="screentop bg-white" style="flex: 1;">
<view class=""> <view class="">
<sl-filter v-if="isFilterData" reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList" <sl-filter v-if="isFilterData" reflexTitle ref="slFilter" :productCodeList="productCodeList"
@result="filterRes" :menuList="menuList"></sl-filter> :areaCodeList="areaCodeList" @result="filterRes" :menuList="menuList"></sl-filter>
<!-- <sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="menuList"></sl-filter> --> <!-- <sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="menuList"></sl-filter> -->
</view> </view>
<view class="bg-white min-height-50 padding-top" v-if="siteList.length>0"> <view class="bg-white min-height-50 padding-top" v-if="siteList.length>0">
@@ -379,7 +379,7 @@
}, },
getSiteList() { getSiteList() {
let data1 = { let parameter = {
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: 10, pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象 params: { //类型Object 必有字段 备注:// 筛选对象
@@ -390,9 +390,12 @@
siteName: this.siteName, siteName: this.siteName,
...uni.getStorageSync('location'), ...uni.getStorageSync('location'),
// ...this.filterData // ...this.filterData
siteBrand: this.siteName ? '' : this.filterData.siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 ) siteBrand: this.siteName ? '' : this.filterData
channelCode: this.siteName ? '' : this.filterData.channelCode, // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌) .siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
oilProductCode: this.siteName ? '' : this.filterData.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#) channelCode: this.siteName ? '' : this.filterData
.channelCode, // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
oilProductCode: this.siteName ? '' : this.filterData
.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
provinceCode: this.filterData.provinceCode, provinceCode: this.filterData.provinceCode,
cityCode: this.filterData.cityCode, cityCode: this.filterData.cityCode,
areaCode: this.filterData.areaCode, areaCode: this.filterData.areaCode,
@@ -400,10 +403,9 @@
zpDisable: 'ENABLE', zpDisable: 'ENABLE',
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1 comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
} }
}
} oilSiteApi.getSiteLists(parameter).then(res => {
if (!uni.getStorageSync('Authorization')) {
oilSiteApi.readOnlySites(data1).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
this.siteList = this.siteList.concat(res.data.list) this.siteList = this.siteList.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页 if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
@@ -414,52 +416,30 @@
} }
} }
}) })
} else {
oilSiteApi.getSiteLists(data1).then(res => {
if (res.code == 20000) {
this.siteList = this.siteList.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.loadStatus = 'nomore'
} else {
this.currentPage++
this.loadStatus = 'load'
}
}
})
}
}, },
toDetail(item) { 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)); let itemS = encodeURIComponent(JSON.stringify(item));
uni.navigateTo({ uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`, url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
fail: (err) => {}, fail: (err) => {},
success: () => {} success: () => {}
}) })
// if (uni.getStorageSync('user')) {
// uni.navigateTo({
// url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
// fail: (err) => {
// // console.log(err)
// },
// success: () => {
// // console.log('err')
// }
// })
// } else {
// uni.showModal({
// title: '请您登录',
// content: "登录小星加油才可以加油 |˛˙꒳​˙)♡",
// confirmText: '去登陆',
// success: (res) => {
// if (res.confirm) {
// uni.reLaunch({
// url: '../../../BagAuth/pages/login/login'
// })
// }
// }
// })
// }
}, },
nameSelect(value, item) { nameSelect(value, item) {
this.title2 = item.text this.title2 = item.text

View File

@@ -4,7 +4,7 @@ import utils from '@/utils/encode'
// const env = process.env.NODE_ENV // const env = process.env.NODE_ENV
const env = 'production'/* */ const env = 'production'/* */
// const env = 'test' // const env = 'test'
// const testUrl = 'http://192.168.0.254:38080' const testUrl = 'http://192.168.110.77:38080'
// const productUrl = 'http://121.196.213.68/adminapi' //预生产 // const productUrl = 'http://121.196.213.68/adminapi' //预生产
const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
@@ -22,9 +22,8 @@ service.interceptors.request.use(
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
const token = uni.getStorageSync('Authorization') const token = uni.getStorageSync('Authorization') || " "
const unionId = uni.getStorageSync('unionid') const unionId = uni.getStorageSync('unionid')
console.log(unionId)
const openId = uni.getStorageSync('openid') const openId = uni.getStorageSync('openid')
// const accountSources = 'WE_CHAT_PROGRAM' // const accountSources = 'WE_CHAT_PROGRAM'
const accountSources = 'LOGIN_MP_WECHAT' const accountSources = 'LOGIN_MP_WECHAT'