4 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
xiaozhiyong
da0f4e6589 更新 2024-04-09 14:35:06 +08:00
xiaozhiyong
3c1fc03e1f 更新 2024-04-08 10:43:56 +08:00
8 changed files with 217 additions and 174 deletions

View File

@@ -23,24 +23,23 @@
<view class="gray-text">加载中...</view>
</view>
<view class="margin-lg flex flex-direction text-center">
<button v-if="checked" @click="decryptPhoneNumber" class="cu-btn round bg-main-oil lg text-lg"
open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">
<text class="cuIcon-weixin padding-right-xs"> </text>
<button v-if="checked" class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
@getphonenumber="decryptPhoneNumber">
<text>
微信用户一键登录
一键登录
</text>
</button>
<button v-else class="cu-btn round bg-main-oil lg text-lg" @click="$refs.popup.open('center')">
<text class="cuIcon-weixin padding-right-xs"> </text>
<!-- <text class="cuIcon-weixin padding-right-xs"> </text> -->
<text>
微信用户一键登录
一键登录
</text>
</button>
<button class="cu-btn margin-top round lg" @tap="refuseEmpower">
输入手机号码登录
</button>
<button class="cu-btn bg-0 margin-top round text-sm" @tap="refuseLogin">
跳过
跳过登录
</button>
</view>
<loginBottom ref='loginBottom' :checked='checked' @onCheck="checkAgree" />
@@ -174,28 +173,36 @@
})
},
decryptPhoneNumber(e) {
if (!this.checked) {
uni.showToast({
title: '请您阅读并同意协议',
icon: 'none'
})
return
}
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
...e.detail,
sessionKey: this.sessionKey,
unionId: uni.getStorageSync('unionid'),
openId: uni.getStorageSync('openid'),
uni.getSetting({
success: () => {
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
...e.detail,
sessionKey: this.sessionKey,
unionId: uni.getStorageSync('unionid'),
openId: uni.getStorageSync('openid'),
}
let url1 = 0 == this.TabCur ? 'bindLoginByPhonePersonal' :
'bindLoginByPhoneCompany'
this.bindLoginByPhone(data1, url1)
}
}
let url1 = 0 == this.TabCur ? 'bindLoginByPhonePersonal' : 'bindLoginByPhoneCompany'
this.bindLoginByPhone(data1, url1)
} else {
uni.showModal({
title: '用户拒绝手机号的授权',
content: `请输入手机号码登录,如有疑问,请联系客服处理`
})
}
})
// if (!this.checked) {
// uni.showToast({
// title: '请您阅读并同意协议',
// icon: 'none'
// })
// return
// }
// else {
// uni.showModal({
// title: '用户拒绝手机号的授权',
// content: `请输入手机号码登录,如有疑问,请联系客服处理`
// })
// }
},
bindLoginByPhone(data, url) {
if (this.count < 1) {

View File

@@ -465,7 +465,7 @@
} else {
this.userHandle = true
uni.showModal({
title: '用户拒绝了手机号的授权,并给你一个大耳巴子',
title: '用户拒绝了手机号的授权',
content: `如有疑问,请联系客服处理`
})
}

View File

@@ -308,7 +308,7 @@
if (!user) {
uni.showModal({
title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳​˙)♡",
content: "登录中品加油才可以加油 |˛˙꒳​˙)♡",
confirmText: '去登陆',
success: (res) => {
if (res.confirm) {

View File

@@ -88,8 +88,11 @@
url: '/pages/tabbar/home/home',
})
} else {
uni.redirectTo({
url: '/BagAuth/pages/login/login'
// uni.redirectTo({
// url: '/BagAuth/pages/login/login'
// })
uni.switchTab({
url: '/pages/tabbar/home/home',
})
}
}

View File

@@ -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) {
@@ -318,12 +312,21 @@
success: (res) => {
if (!res.authSetting['scope.userLocation']) {
uni.showModal({
title: '请您打开定位权限',
content: '用于获取您当前位置附近油站',
title: '提示',
content: '您暂无授权定位权限,将无法显示附近油站',
confirmText: '去设置',
success: (resSec) => {
if (resSec.confirm) {
uni.openSetting({})
uni.openSetting({
success: (resThird) => {
if (resThird
.authSetting[
'scope.userLocation'
]) {
this.refreshLocation()
}
}
})
}
}
})
@@ -370,16 +373,61 @@
showQr() {
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;
}
this.showThreeSites = true
},
toCards() {
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.navigateTo({
url: '/BagMoney/pages/oilCards/oilCards'
})
},
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'
})
@@ -394,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
}
@@ -437,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}`
@@ -488,6 +528,21 @@
},
openScan() {
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.scanCode({
scanType: 'qrCode',
onlyFromCamera: false,

View File

@@ -33,13 +33,13 @@
<!-- 筛选开始 -->
<scroll-view class="screentop bg-white" style="flex: 1;">
<view class="">
<sl-filter v-if="isFilterData" reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList"
@result="filterRes" :menuList="menuList"></sl-filter>
<sl-filter v-if="isFilterData" reflexTitle ref="slFilter" :productCodeList="productCodeList"
:areaCodeList="areaCodeList" @result="filterRes" :menuList="menuList"></sl-filter>
<!-- <sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="menuList"></sl-filter> -->
</view>
<view class="bg-white min-height-50 padding-top" v-if="siteList.length>0">
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0"
:listHeight="listHeight" class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
:listHeight="listHeight" class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
</site-item>
<view class="placeholder-hidden">
@@ -69,11 +69,11 @@
data() {
return {
getSiteListTimer:null,
getSiteListTimer: null,
filterData: {
// oilProductCode: '0#'
},
isFilterData:false,
isFilterData: false,
contentTitle: '您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
loadStatus: 'load',
listHeight: 160,
@@ -267,7 +267,7 @@
if (!uni.getStorageSync('filterData')) {
this.getFilterData()
} else {
this.isFilterData=true
this.isFilterData = true
}
},
@@ -331,31 +331,31 @@
uni.setStorageSync('productCodeList', res.data.productCodeList)
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
this.areaCodeList = uni.getStorageSync('areaCodeList')
let channelCodes = []
res.data.channelCodes.map(item => {
channelCodes.push({
title: item.name,
value: item.id
})
let channelCodes = []
res.data.channelCodes.map(item => {
channelCodes.push({
title: item.name,
value: item.id
})
let productCodes = []
res.data.productCodes.map(item => {
productCodes.push({
title: item.name,
value: item.id
})
})
let productCodes = []
res.data.productCodes.map(item => {
productCodes.push({
title: item.name,
value: item.id
})
let siteBrands = []
res.data.siteBrands.map(item => {
siteBrands.push({
title: item.name,
value: item.id
})
})
let siteBrands = []
res.data.siteBrands.map(item => {
siteBrands.push({
title: item.name,
value: item.id
})
menuList[0].detailList = menuList[0].detailList.concat(channelCodes)
menuList[1].detailList = menuList[1].detailList.concat(productCodes)
menuList[2].detailList = menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList);
})
menuList[0].detailList = menuList[0].detailList.concat(channelCodes)
menuList[1].detailList = menuList[1].detailList.concat(productCodes)
menuList[2].detailList = menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList);
if (uni.getStorageSync('areaCodeList')) {
this.areaCodeList = uni.getStorageSync('areaCodeList')
} else {
@@ -379,87 +379,67 @@
},
getSiteList() {
let data1 = {
let parameter = {
currentPage: this.currentPage,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong:'ZHONGPIN',
longitude: 117.157817, // 必有字段 备注:// 当前位置经度
latitude: 31.802472, // 必有字段 备注:// 当前位置维度
clientBelong: 'ZHONGPIN',
longitude: 117.157817, // 必有字段 备注:// 当前位置经度
latitude: 31.802472, // 必有字段 备注:// 当前位置维度
sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
siteName: this.siteName,
...uni.getStorageSync('location'),
// ...this.filterData
siteBrand: this.siteName ? '' : this.filterData.siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
channelCode: this.siteName ? '' : this.filterData.channelCode, // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
oilProductCode: this.siteName ? '' : this.filterData.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
siteBrand: this.siteName ? '' : this.filterData
.siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
channelCode: this.siteName ? '' : this.filterData
.channelCode, // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
oilProductCode: this.siteName ? '' : this.filterData
.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
provinceCode: this.filterData.provinceCode,
cityCode: this.filterData.cityCode,
areaCode: this.filterData.areaCode,
distance: this.filterData.distance,
zpDisable:'ENABLE',
zpDisable: 'ENABLE',
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
}
}
}
if (!uni.getStorageSync('Authorization')) {
oilSiteApi.readOnlySites(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'
}
oilSiteApi.getSiteLists(parameter).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'
}
})
} 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) {
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}`,
fail: (err) => {},
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) {
this.title2 = item.text
@@ -497,22 +477,22 @@
// this.getSiteList()
// }, 100)
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
this.getSiteListTimer = setTimeout(() => {
this.currentPage = 1
this.siteList = []
this.getSiteList()
},500);
}, 500);
},
onSearch() {
// this.currentPage = 1
// this.siteList = []
// this.getSiteList()
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
this.getSiteListTimer = setTimeout(() => {
this.currentPage = 1
this.siteList = []
this.getSiteList()
},500);
}, 500);
}
}
}

View File

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

View File

@@ -222,22 +222,21 @@ export default {
success(res) {
console.log(res.authSetting,'res.authSetting')
if (!res.authSetting[ 'scope.userLocation']) {
console.log('用户没有授权用户没有授权用户没有授权用户没有授权')
// console.log('用户没有授权用户没有授权用户没有授权用户没有授权')
// 用户没有授权
uni.showModal({
title: '提示',
content: '您暂无授权定位权限,将无法显示油站距离',
content: '您暂无授权定位权限,将无法显示附近油站',
confirmText: '去设置',
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
if (res.authSetting['scope.userLocation']) {
re()
// 授权成功,重新定位
} else {
// 没有允许定位权限
wx.showToast({
title: '您拒绝了定位权限,将无法使用附近电站站功能',
title: '您拒绝了定位权限',
icon: 'none'
});
rj('拒绝了定位权限')