14 Commits

Author SHA1 Message Date
3ebd48fb67 Merge pull request 'xiaozy' (#11) from xiaozy into master
Reviewed-on: #11
2023-06-06 06:57:19 +00:00
xiaozhiyong
6e05200fc9 更新 2023-06-02 10:55:25 +08:00
xiaozhiyong
bb00c6ed4a 更新 2023-06-01 19:59:47 +08:00
xiaozhiyong
12d19c841d 更新 2023-05-31 15:17:37 +08:00
e7f38adf34 Merge pull request 'xiaozy' (#10) from xiaozy into master
Reviewed-on: #10
2023-04-07 03:12:21 +00:00
xiaozhiyong
5b4c84fc62 update .gitignore 2023-03-29 13:41:02 +08:00
xiaozhiyong
45369b4a9a 更新 2023-03-29 13:39:16 +08:00
20725ea756 Merge pull request 'caolc' (#9) from caolc into master
Reviewed-on: #9
2023-02-15 12:59:44 +00:00
caoliancun
5b2587bdfe 11 2023-02-15 20:59:22 +08:00
caolc
1f249bc07d ii 2023-02-15 19:57:59 +08:00
13d887e47e Merge pull request 'caolc' (#8) from caolc into master
Reviewed-on: #8
2023-02-14 08:06:59 +00:00
caolc
6c6e59c838 Merge branch 'master' of http://121.196.213.68:3000/caoliancun/MP-XiaoXing into caolc 2023-02-14 16:06:24 +08:00
caolc
9ebf78279b 佰川修改 2023-02-14 16:06:02 +08:00
a62d76ec66 Merge pull request 'lixuan' (#7) from lixuan into master
Reviewed-on: #7
2023-02-14 07:58:59 +00:00
10 changed files with 394 additions and 390 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,6 @@
.DS_Store
.package-lock.json
node_modules/
/dist/
/unpackage/

24
App.vue
View File

@@ -92,7 +92,7 @@
imageUrl: 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/login-bg.png',
}
}
console.log(view.route)
// console.log(view.route)
clearTimeout(loginTimer)
clearTimeout(onlineTimer)
@@ -165,16 +165,16 @@
},
onShow: function() {
uni.getLocation({
type: 'wgs84',
success: function(res) {
uni.setStorageSync('location', {
longitude: res.longitude + '',
latitude: res.latitude + ''
})
}
});
console.log('onReady')
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// uni.setStorageSync('location', {
// longitude: res.longitude + '',
// latitude: res.latitude + ''
// })
// }
// });
// console.log('onReady')
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
let key = ''
@@ -188,7 +188,7 @@
}
setTimeout(() => {
console.log(key)
// console.log(key)
if (key == '在线') {
} else {

View File

@@ -1,127 +1,43 @@
<template>
<view class="login-page bg-white">
<view class="image login-bg">
<!-- <image :src="imgURL+'login-bg.png'" mode="widthFix"></image> -->
<!-- <image src="../../../BagStation/static/img/LV.png" mode="widthFix"></image> -->
<image src="../../../static/img/login-bg.png" mode="widthFix"></image>
</view>
<scroll-view scroll-x class=" bg-white nav padding">
<view class="flex text-center padding-bottom">
<view class="cu-item flex-sub">
</view>
<view class="cu-item flex-sub" :class="0==TabCur?'text-red cur':''" @tap="tabSelect(0)">
个人账号
</view>
<view class="cu-item flex-sub">
</view>
<!-- <view class="cu-item flex-sub" :class="1==TabCur?'text-red cur':''" @tap="tabSelect(1)">
<!--<view class="cu-item flex-sub" :class="1==TabCur?'text-red cur':''" @tap="tabSelect(1)">
企业账号
</view>
-->
</view>-->
</view>
</scroll-view>
<view class="cu-load load-modal" v-if="loadModal">
<view class="gray-text">加载中...</view>
</view>
<view class="margin-lg flex flex-direction text-center">
<button class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
@getphonenumber="decryptPhoneNumber">
<text class="cuIcon-weixin padding-right-xs"> </text>
<text>
微信用户一键登录
</text>
</button>
<button class="cu-btn margin-top round lg" @tap="refuseEmpower">
<!-- <button class="cu-btn margin-top round lg" @tap="refuseEmpower">
输入手机号码登录
</button>
</button> -->
<button class="cu-btn bg-0 margin-top round text-sm" @tap="refuseLogin">
跳过
</button>
</view>
<!-- <loginBottom :check="loginOut" /> -->
<loginBottom @onCheck="checkAgree" />
</view>
</template>
@@ -131,7 +47,6 @@
import loginBottom from './components/loginBottom.vue'
import oilIdentityApi from '@/api/oil-identity'
export default {
components: {
loginBottom
@@ -139,6 +54,7 @@
data() {
return {
// imgsrc:require('../../../BagStation/static/img/login-bg.png'),
checked:false,
userHandle: false,
TabCur: 0,
accuntSource: false,
@@ -157,16 +73,16 @@
},
onLoad() {
uni.clearStorageSync()
this.refreshLocation()
// this.refreshLocation()
uni.login({
provider: 'weixin',
success: (loginRes) => {
console.log(loginRes,'+++++++')
console.log(loginRes, '+++++++')
const code = loginRes.code
this.onceCode = code
console.log(this.onceCode,'----------')
console.log(this.onceCode, '----------')
oilIdentityApi.sendCode(this.onceCode).then(res => {
console.log(res,'++++++++++++++++')
console.log(res, '++++++++++++++++')
if (res.code === 20000) {
this.sessionKey = res.data.sessionKey
uni.setStorageSync('openid', res.data.openId)
@@ -198,18 +114,21 @@
})
},
methods: {
checkAgree(val) {
this.checked = val
},
refuseLogin() {
uni.switchTab({
url: '/pages/tabbar/home/home'
})
},
refreshLocation() {
uni.getLocation({
type: 'wgs84',
success: function(res) {
uni.setStorageSync('location', res)
}
});
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// uni.setStorageSync('location', res)
// }
// });
},
autoLogin() {
// let url = 'loginCompany'
@@ -231,6 +150,13 @@
decryptPhoneNumber(e) {
if (!this.checked) {
uni.showToast({
title: '请您阅读并同意协议',
icon: 'none'
})
return
}
// console.log(e.detail)
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
@@ -306,7 +232,8 @@
height: 750rpx;
background-color: #fff;
}
.bg-0{
.bg-0 {
background-color: transparent;
color: #555555;
}

View File

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

View File

@@ -34,8 +34,8 @@
</view> -->
<view class="filter-content-detail" v-show="pickerShow">
<!-- 省市区选择 -->
<view class="region-box" v-if="index==0">
<picker-view disabled :value="region" @change="bindChange" ref="showHide">
<view class="region-box" v-if="index==0">
<picker-view disabled :value="region" @change="bindChange" ref="showHide">
<picker-view-column>
<view class="center" v-for="(item, index) in areaCodeList" :key="index">
{{ item.areaName }}
@@ -119,16 +119,18 @@
}
},
created() {
setTimeout(()=>{
if(this.areaCodeList1.length == 0){
this.areaCodeList = uni.getStorageSync('areaCodeList')
}else{
this.areaCodeList = this.areaCodeList1
}
this.areaCodeList.unshift({areaName:'全部'})
},1000)
console.log('%c 子组件参数↓','font-size:30px;color:red')
},
mounted() {
if(this.areaCodeList1.length == 0){
this.areaCodeList = uni.getStorageSync('areaCodeList')
}else{
this.areaCodeList = this.areaCodeList1
}
this.areaCodeList.unshift({areaName:'全部'})
this.$forceUpdate();
},
computed: {
selectedTitleObj() {
let obj = {}

82
package-lock.json generated
View File

@@ -1,40 +1,94 @@
{
"name": "wechat-oil",
"version": "1.0.0",
"lockfileVersion": 1,
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "wechat-oil",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
"axios": "^0.21.3",
"crypto-js": "^4.0.0",
"js-cookie": "^2.2.1",
"js-md5": "^0.7.3"
}
},
"node_modules/axios": {
"version": "0.21.4",
"resolved": "https://registry.npmmirror.com/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.14.0"
}
},
"node_modules/crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==",
"dev": true
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"dev": true,
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/js-cookie": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz",
"integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==",
"dev": true
},
"node_modules/js-md5": {
"version": "0.7.3",
"resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz",
"integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==",
"dev": true
}
},
"dependencies": {
"axios": {
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz",
"integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==",
"version": "0.21.4",
"resolved": "https://registry.npmmirror.com/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dev": true,
"requires": {
"follow-redirects": "^1.14.0"
}
},
"crypto-js": {
"version": "4.0.0",
"resolved": "https://registry.nlark.com/crypto-js/download/crypto-js-4.0.0.tgz",
"integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw=",
"version": "4.1.1",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==",
"dev": true
},
"follow-redirects": {
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz",
"integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==",
"version": "1.15.2",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"dev": true
},
"js-cookie": {
"version": "2.2.1",
"resolved": "https://registry.npm.taobao.org/js-cookie/download/js-cookie-2.2.1.tgz",
"integrity": "sha1-aeEG3F1YBolFYpAqpbrsN0Tpsrg=",
"resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz",
"integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==",
"dev": true
},
"js-md5": {
"version": "0.7.3",
"resolved": "https://registry.npm.taobao.org/js-md5/download/js-md5-0.7.3.tgz",
"integrity": "sha1-tPL7sLMnRV9ZjWcn447Ccs0Jw/I=",
"resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz",
"integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==",
"dev": true
}
}

View File

@@ -69,7 +69,7 @@
})
}
interstitialAd.onLoad((err) => {
console.log('onLoad event emit', err)
// console.log('onLoad event emit', err)
})
interstitialAd.onError((err) => {
setTimeout(() => {
@@ -77,7 +77,7 @@
uni.switchTab({
url: '/pages/tabbar/home/home',
fail: (err) => {
console.log(err)
// console.log(err)
}
// url:'/BagStation/orderDetail/orderDetail'
})
@@ -87,12 +87,12 @@
})
}
}, 2000)
console.log('onError event emit', err)
// console.log('onError event emit', err)
})
// 在适合的场景显示插屏广告
if (interstitialAd) {
interstitialAd.show().catch((err) => {
console.error(err)
// console.error(err)
})
}
interstitialAd.onClose(res => {
@@ -101,7 +101,7 @@
uni.switchTab({
url: '/pages/tabbar/home/home',
fail: (err) => {
console.log(err)
// console.log(err)
}
// url:'/BagStation/orderDetail/orderDetail'
})
@@ -118,7 +118,7 @@
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
console.log('请求完新版本信息的回调', res.hasUpdate);
// console.log('请求完新版本信息的回调', res.hasUpdate);
});
updateManager.onUpdateReady(function(res) {
@@ -165,7 +165,7 @@
value: item.id
})
})
console.log(channelCodes, productCodes, siteBrands)
// console.log(channelCodes, productCodes, siteBrands)
this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes)
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes)
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)

View File

@@ -15,9 +15,10 @@
</view>
<view class="search-form radius" @tap="InputFocus">
<text class="cuIcon-search"></text>
<input disabled :adjust-position="false" type="text" placeholder="搜索油站名称" confirm-type="search" />
<input disabled :adjust-position="false" type="text" placeholder="搜索油站名称"
confirm-type="search" />
</view>
<!-- <view class="">
<!-- <view class="">
阿三
</view> -->
</view>
@@ -58,10 +59,10 @@
</view>
<view class="text-xxl" @tap="toManagement">
<view class="cuIcon-form">
</view>
<text class="text-df">
中交风控
中交风控
</text>
</view>
</view>
@@ -113,10 +114,10 @@
</view>
<view class="text-xxl" @tap="toManagement">
<view class="cuIcon-form">
</view>
<text class="text-df">
中交风控
中交风控
</text>
</view>
</view>
@@ -148,11 +149,11 @@
</view> -->
<!-- 广告图片开始 -->
<view class="my-bg padding">
<view class="" >
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular >
<swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray">
<view class="">
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular>
<!-- <swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray">
<image :src="item.src" style="width: 100%;" mode="widthFix"></image>
</swiper-item>
</swiper-item> -->
<swiper-item>
<ad unit-id="adunit-fae65289bc72095d" ad-intervals="30"></ad>
</swiper-item>
@@ -167,8 +168,8 @@
</view> -->
<view class=" ">
<view class="" 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)">
<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)">
</site-item>
</view>
<view class="" v-else>
@@ -198,7 +199,7 @@
},
data() {
return {
swiperArray:[
swiperArray: [
// {
// src:this.global.starUrl+'banner.png',
// link:''
@@ -208,7 +209,7 @@
link: 'https://tengxun.hkzj168.com/?ChannelId=20220831152210221048473'
},
],
listHeight:160,
listHeight: 160,
siteInfo: {
},
@@ -325,16 +326,11 @@
]
};
},
onTabItemTap(res){
this.showThreeSites =false
onTabItemTap(res) {
this.showThreeSites = false
},
onLoad() {
this.reverseGeocoder(this.location)
this.refreshLocation()
// if (!uni.getStorageSync('filterData')) {
// this.getFilterData()
// }
},
onPullDownRefresh() {
this.refreshLocation()
@@ -354,54 +350,38 @@
icon: "none"
})
}
uni.navigateTo({
// url: `/BagStation/orderDetail/orderDetail?id=XOILAWMP202107070000025117`
})
// uni.redirectTo({
// url:'/BagStation/pages/makeOrder/makeOrder'
// // url:'/BagStation/pages/makeOrder/payResult?status=success'
// })
// url:'/BagStation/pages/makeOrder/payResult?status=success'
},
beforeCreate() {},
onReady() {
// this.getSiteList()
this.refreshLocation()
},
methods: {
toManagement(){
toManagement() {
const user = uni.getStorageSync('user');
if(user){
Financial.findHomePageReport({customerId:user.id}).then(res=>{
if(res.data){
if (user) {
Financial.findHomePageReport({
customerId: user.id
}).then(res => {
if (res.data) {
uni.navigateTo({
url:`../../../Financial/pages/estimate/index?data=${encodeURIComponent(JSON.stringify(res.data))}`
url: `../../../Financial/pages/estimate/index?data=${encodeURIComponent(JSON.stringify(res.data))}`
})
}else{
} else {
uni.navigateTo({
url:'../../../Financial/pages/index?guide=1'
url: '../../../Financial/pages/index?guide=1'
})
}
});
}else{
} else {
uni.showToast({
title: '请先登录!',
icon: 'none'
})
}
},
swiperClick(item,index) {
if(!item?.link) return
switch (Number(index)) {
// case 0:
// this.goCall()
// break;
default:
console.log('item.link')
uni.navigateTo({
url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
})
}
swiperClick(item, index) {
if (!item?.link) return
uni.navigateTo({
url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
})
},
goToPage(url) {
if (!url) return;
@@ -417,6 +397,35 @@
})
},
refreshLocation() {
uni.getLocation({
type: 'wgs84',
success: (res) => {
uni.setStorageSync('location', res)
},
fail: () => {
uni.getSetting({
success: (res) => {
if (!res.authSetting['scope.userLocation']) {
uni.showModal({
title: '请您打开定位权限',
content: '用于获取您当前位置附近的油站',
confirmText: '去设置',
success: (resSec) => {
if (resSec.confirm) {
uni.openSetting({})
}
}
})
}
}
})
},
complete: () => {
this.getSiteList()
},
});
},
realPosition() {
uni.getLocation({
type: 'wgs84',
success: (res) => {
@@ -424,9 +433,7 @@
},
complete: () => {
this.getSiteList()
// // console.log('made')
},
});
},
hideModel(name) {
@@ -443,7 +450,7 @@
oilSiteApi.getUserAuthInfo().then(res => {
if (res.code === 20000) {
this.getAmount()
this.getSiteList()
// this.getSiteList()
// realStatus: 0 vehicleStatus: 0
if (this.showAuthFrzen <= new Date().getTime()) {
this.showAuthFrror = res.data.realStatus && res.data.vehicleStatus ? false :
@@ -487,10 +494,11 @@
// url: 'plugin://routePlan/index?key=' + this.qqMapKey + '&referer=' + referer +
// '&endPoint=' + endPoint
// })
uni.removeStorageSync("origins")
uni.removeStorageSync("destination")
uni.removeStorageSync("origins")
uni.removeStorageSync("destination")
wx.navigateTo({
url:'../../../BagStation/pages/routePlain/routePlain'})
url: '../../../BagStation/pages/routePlain/routePlain'
})
} else if (index == 8) {
this.goToPage('/BagAuth/pages/agreeMent/OperationGuide')
}
@@ -523,16 +531,16 @@
url: '/pages/tabbar/order/orderList/orderList'
})
},
filterRes(val) {
this.filterData = val
this.getSiteList()
},
// filterRes(val) {
// this.filterData = val
// this.getSiteList()
// },
getSiteList() {
let data1 = {
currentPage: 1,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong: 'BAICHUAN',
sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
// longitude: 117.157817, // 必有字段 备注:// 当前位置经度
// latitude: 31.802472, // 必有字段 备注:// 当前位置维度
@@ -541,50 +549,25 @@
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
// channelCode: "", // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
// oilProductCode: "0#" // 备注:// 油号选择 ( 0# 92# 92#)
comprehensiveSort:1
comprehensiveSort: 1
}
}
if (!uni.getStorageSync('user')) {
oilSiteApi.readOnlySites(data1).then(res => {
this.getCount++
if (res.code == 20000) {
// console.log(res.data.list)
this.siteList = res.data.list
} else {
if (this.getCount == 1) {
setTimeout(() => {
this.getSiteList()
}, 1000)
} else {
uni.getSetting({
success: (resSet) => {
if (resSet.authSetting['scope.address'] == false) {
uni.showMode({
title: '请您打开定位权限',
content: '用于获取您当前位置附近的油站',
confirmText: '去设置',
success: (res) => {
if (res.confirm) {
uni.openSetting({
})
}
}
})
}
}
})
}
}
})
} else {
console.log(data1,'dayindata111111111111')
oilSiteApi.getSiteLists(data1).then(res => {
if (res.code == 20000) {
// console.log(res.data.list)
this.siteList = res.data.list
}
})
@@ -596,22 +579,18 @@
if (uni.getStorageSync('user')) {
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
}
fail: (err) => {},
success: () => {}
})
} else {
uni.showModal({
title:'请您登录',
content:"登录小星加油才可以加油 |˛˙꒳​˙)♡",
confirmText:'去登陆',
title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳​˙)♡",
confirmText: '去登陆',
success: (res) => {
if(res.confirm){
if (res.confirm) {
uni.reLaunch({
url:'../../../BagAuth/pages/login/login'
url: '../../../BagAuth/pages/login/login'
})
}
}

View File

@@ -136,7 +136,7 @@
}
},
onShow() {
this.initList()
// this.initList()
},
onLoad() {
this.initList()
@@ -168,6 +168,7 @@
}, 500)
},
initList() {
console.log('initList')
if (this.TabCur == 0 && this.list.length == 0) {
this.getOrder('全部', this.currentPage.currentPage,'initList')
} else if (this.TabCur == 1 && this.list0.length == 0) {
@@ -242,6 +243,7 @@
pageSize: 10, //类型Number 必有字段 备注:无
index: (page - 1) * 10,
params: { //类型Object 必有字段 备注:无
clientBelong:'BAICHUAN',
orderStatus: id == '全部' ? '' : (id +''), //类型String 必有字段 备注:订单状态 0待支付 1已支付 -1支付失败 2已取消3已退款
search: this.search //类型String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
},
@@ -253,7 +255,7 @@
// 0待支付 1已支付 -1支付失败 2已取消3已退款
if (id == '0') {
// 0待支付 list0
this.list0 = this.list0.concat(res.data.list)
this.list0 = this.list0.concat(res.data.list);
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus0 = 'nomore'
uni.showToast({

View File

@@ -33,12 +33,13 @@
<!-- 筛选开始 -->
<scroll-view class="screentop bg-white" style="flex: 1;">
<view class="">
<sl-filter 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)">
<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)">
</site-item>
<view class="placeholder-hidden">
@@ -71,111 +72,111 @@
filterData: {
// oilProductCode: '0#'
},
contentTitle:'您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
isFilterData:false,
contentTitle: '您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
loadStatus: 'load',
listHeight:160,
areaCodeList:[],
listHeight: 160,
areaCodeList: [],
siteName: '',
menuList:[
{
title: '距离',
isMutiple: false,
key: 'distance',
detailList: [
{
title: "全部",
value: ''
},
{
title: "20Km",
value: 20
},
{
title: "30Km",
value: 30
},
{
title: "50Km",
value: 50
},
{
title: "省市",
value: 10
}
]
},
{
title: '油品',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
},
{
title: "0#",
value: "0#"
},
{
title: "-10#",
value: "-10#"
},
{
title: "-20#",
value: "-20#"
},
{
title: "-35#",
value: "-35#"
},
{
title: "LNG",
value: "LNG"
}]
menuList: [{
title: '距离',
isMutiple: false,
key: 'distance',
detailList: [{
title: "全部",
value: ''
},
// {
// title: '油品',
// key: 'oilProductCode',
// isMutiple: false,
// detailList: {全部:[{
// title: "全部",
// value: ""
// }],
// 柴油:[{
// title: "0#",
// value: "0#"
// },
// {
// title: "-10#",
// value: "-10#"
// },
// {
// title: "-20#",
// value: "-20#"
// },
// {
// title: "-35#",
// value: "-35#"
// }],
// 天然气:[{
// title: "LNG",
// value: "LNG"
// }]}
// },
{
title: '距离优先',
isMutiple: false,
key: 'comprehensiveSort',
detailList: [{
title: "距离优先",
value: 1
},
{
title: "价格优先",
value: 2
}
]
},
title: "20Km",
value: 20
},
{
title: "30Km",
value: 30
},
{
title: "50Km",
value: 50
},
{
title: "省市",
value: 10
}
]
},
{
title: '油品',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
},
{
title: "0#",
value: "0#"
},
{
title: "-10#",
value: "-10#"
},
{
title: "-20#",
value: "-20#"
},
{
title: "-35#",
value: "-35#"
},
{
title: "LNG",
value: "LNG"
}
]
},
// {
// title: '油品',
// key: 'oilProductCode',
// isMutiple: false,
// detailList: {全部:[{
// title: "全部",
// value: ""
// }],
// 柴油:[{
// title: "0#",
// value: "0#"
// },
// {
// title: "-10#",
// value: "-10#"
// },
// {
// title: "-20#",
// value: "-20#"
// },
// {
// title: "-35#",
// value: "-35#"
// }],
// 天然气:[{
// title: "LNG",
// value: "LNG"
// }]}
// },
{
title: '距离优先',
isMutiple: false,
key: 'comprehensiveSort',
detailList: [{
title: "距离优先",
value: 1
},
{
title: "价格优先",
value: 2
}
]
},
],
// menuList: uni.getStorageSync('filterData') ? uni.getStorageSync('filterData') : [
// {
@@ -258,10 +259,12 @@
this.refreshLocation()
if (!uni.getStorageSync('filterData')) {
this.getFilterData()
} else {
this.isFilterData=true
}
this.getSiteList()
},
onPullDownRefresh() {
this.filterRes(this.filterData)
setTimeout(function() {
@@ -288,39 +291,73 @@
this.getSiteList()
},
getFilterData() {
let menuList = [{
title: '渠道',
isMutiple: false,
key: 'channelCode',
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '0#轻柴油',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '品牌',
key: 'siteBrand',
isSort: true,
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
}
]
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
uni.setStorageSync('productCodeList', res.data.productCodeList)
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
this.areaCodeList = uni.getStorageSync('areaCodeList')
if(uni.getStorageSync('areaCodeList')){
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 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);
if (uni.getStorageSync('areaCodeList')) {
this.areaCodeList = uni.getStorageSync('areaCodeList')
}else{
} else {
this.areaCodeList = res.data.areaCodeList
}
// this.productCodeList = uni.getStorageSync('productCodeList')
// res.data.channelCodes.map(item => {
// this.menuList[0].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// res.data.productCodes.map(item => {
// this.menuList[1].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// res.data.siteBrands.map(item => {
// this.menuList[2].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// // console.log(channelCodes, productCodes, siteBrands)
// this.$refs.slFilter.resetMenuList(this.menuList)
// this.$forceUpdate();
}
this.isFilterData = true
})
},
onSelected(e) {
@@ -342,21 +379,22 @@
currentPage: this.currentPage,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong:'BAICHUAN',
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-其他 )
.siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
channelCode: this.siteName ? '' : this.filterData
.channelCode, // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
.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,
comprehensiveSort:this.filterData.comprehensiveSort?this.filterData.comprehensiveSort:1
provinceCode: this.filterData.provinceCode,
cityCode: this.filterData.cityCode,
areaCode: this.filterData.areaCode,
distance: this.filterData.distance,
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
}
}
@@ -388,7 +426,7 @@
},
toDetail(item) {
let itemS = encodeURIComponent(JSON.stringify(item))
let itemS = encodeURIComponent(JSON.stringify(item))
if (uni.getStorageSync('user')) {
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
@@ -401,13 +439,13 @@
})
} else {
uni.showModal({
title:'请您登录',
content:"登录小星加油才可以加油 |˛˙꒳​˙)♡",
confirmText:'去登陆',
title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳​˙)♡",
confirmText: '去登陆',
success: (res) => {
if(res.confirm){
if (res.confirm) {
uni.reLaunch({
url:'../../../BagAuth/pages/login/login'
url: '../../../BagAuth/pages/login/login'
})
}
}