merge master

This commit is contained in:
xiaozhiyong
2023-03-20 09:47:19 +08:00
29 changed files with 656 additions and 463 deletions

View File

@@ -106,42 +106,18 @@
</view>
</view>
</view>
<!-- 宫格菜单开始 -->
<!-- <view class="bg-white padding pagestartthree">
<view class="grid col-5 text-center ">
<view class="text-xxl " v-for="(item,index) in cuIconList" @tap="shadoumeiyou(index)" :key="index"
:class="index<5?'margin-bottom':''">
! <view :class="['cuIcon-'+item.icon,'text-' +item.color]">
</view>
<view class="text-center">
<view class="my-icon-sm">
<image :src="imgURL +item.iconUrl" mode="widthFix"></image>
</view>
<view class="text-sm">
<text class="text-sm color-333">
{{item.name}}
</text>
</view>
</view>
</view>
</view>
</view> -->
<!-- 广告图片开始 -->
<view class="my-bg padding">
<view class="" >
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular >
<!-- <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>
<ad unit-id="adunit-fae65289bc72095d" ad-intervals="30"></ad>
</swiper-item>
</swiper>
<!-- <image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image> -->
</swiper> -->
<image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image>
</view>
</view>
<!-- 筛选开始 -->
@@ -517,6 +493,7 @@
currentPage: 1,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong:'ZHONGPIN',
sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
// longitude: 117.157817, // 必有字段 备注:// 当前位置经度
// latitude: 31.802472, // 必有字段 备注:// 当前位置维度

View File

@@ -98,6 +98,7 @@
data() {
return {
getSiteListTimer:null,
TabCur: 0,
search: '',
status: {
@@ -136,7 +137,7 @@
}
},
onShow() {
this.initList()
// this.initList()
},
onLoad() {
this.initList()
@@ -214,117 +215,126 @@
}
},
onRequest() {
if (this.TabCur == 0) {
this.currentPage.currentPage = 1
this.list = []
this.getOrder('全部', this.currentPage.currentPage,'onRequest')
} else if (this.TabCur == 1) {
this.currentPage.currentPage0 = 1
this.list0 = []
this.getOrder('0', this.currentPage.currentPage0,'onRequest')
} else if (this.TabCur == 2) {
this.currentPage.currentPage1 = 1
this.list1 = []
this.getOrder('1', this.currentPage.currentPage1,'onRequest')
} else if (this.TabCur == 3) {
this.currentPage.currentPage2 = 1
this.list2 = []
this.getOrder('2', this.currentPage.currentPage2,'onRequest')
} else if (this.TabCur == 4) {
this.currentPage.currentPage3 = 1
this.list3 = []
this.getOrder('3', this.currentPage.currentPage3,'onRequest')
}
if (this.TabCur == 0) {
this.currentPage.currentPage = 1
this.list = []
this.getOrder('全部', this.currentPage.currentPage,'onRequest')
} else if (this.TabCur == 1) {
this.currentPage.currentPage0 = 1
this.list0 = []
this.getOrder('0', this.currentPage.currentPage0,'onRequest')
} else if (this.TabCur == 2) {
this.currentPage.currentPage1 = 1
this.list1 = []
this.getOrder('1', this.currentPage.currentPage1,'onRequest')
} else if (this.TabCur == 3) {
this.currentPage.currentPage2 = 1
this.list2 = []
this.getOrder('2', this.currentPage.currentPage2,'onRequest')
} else if (this.TabCur == 4) {
this.currentPage.currentPage3 = 1
this.list3 = []
this.getOrder('3', this.currentPage.currentPage3,'onRequest')
}
},
getOrder(id, page, tip) {
let postData = {
currentPage: page, //类型Number 必有字段 备注:无
pageSize: 10, //类型Number 必有字段 备注:无
index: (page - 1) * 10,
params: { //类型:Object 必有字段 备注:无
orderStatus: id == '全部' ? '' : (id +''), //类型:String 必有字段 备注:订单状态 0待支付 1已支付 -1支付失败 2已取消3已退款
search: this.search //类型String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
},
}
console.log('tip',id,tip)
orderApi.getOrderInfoByPage(postData).then(res => {
if (res.code == 20000) {
// console.log('订单列表厂房发', page, res.data.list.length)
// 0待支付 1已支付 -1支付失败 2已取消3已退款
if (id == '0') {
// 0待支付 list0
this.list0 = this.list0.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus0 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage0++
this.status.loadOrderStatus0 = 'load'
}
} else if (id == '1') {
// 1已支付 list1
this.list1 = this.list1.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus1 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage1++
this.status.loadOrderStatus1 = 'load'
this.$emit('changeOrderLoadStatus', id, 'load', false)
}
} else if (id == '2') {
//2已取消 list2
this.list2 = this.list2.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus2 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage2++
this.status.loadOrderStatus2 = 'load'
this.$emit('changeOrderLoadStatus', id, 'load', false)
}
} else if (id == '3') {
// 3已退款 list3
this.list3 = this.list3.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus3 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage3++
this.status.loadOrderStatus3 = 'load'
}
} else if (id == '全部') {
// 全部 list
this.list = this.list.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage++
this.status.loadOrderStatus = 'load'
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
let postData = {
currentPage: page, //类型:Number 必有字段 备注:无
pageSize: 10, //类型:Number 必有字段 备注:
index: (page - 1) * 10,
params: { //类型Object 必有字段 备注:无
clientBelong:'ZHONGPIN',
orderStatus: id == '全部' ? '' : (id +''), //类型String 必有字段 备注:订单状态 0待支付 1已支付 -1支付失败 2已取消3已退款
search: this.search //类型String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
},
}
console.log('tip',id,tip)
orderApi.getOrderInfoByPage(postData).then(res => {
if (res.code == 20000) {
// console.log('订单列表厂房发', page, res.data.list.length)
// 0待支付 1已支付 -1支付失败 2已取消3已退款
if (id == '0') {
// 0待支付 list0
this.list0 = this.list0.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus0 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage0++
this.status.loadOrderStatus0 = 'load'
}
} else if (id == '1') {
// 1已支付 list1
this.list1 = this.list1.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus1 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage1++
this.status.loadOrderStatus1 = 'load'
this.$emit('changeOrderLoadStatus', id, 'load', false)
}
} else if (id == '2') {
//2已取消 list2
this.list2 = this.list2.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus2 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage2++
this.status.loadOrderStatus2 = 'load'
this.$emit('changeOrderLoadStatus', id, 'load', false)
}
} else if (id == '3') {
// 3已退款 list3
this.list3 = this.list3.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus3 = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage3++
this.status.loadOrderStatus3 = 'load'
}
} else if (id == '全部') {
// 全部 list
this.list = this.list.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.status.loadOrderStatus = 'nomore'
uni.showToast({
title: '就这么多啦',
icon: 'none'
})
} else {
this.currentPage.currentPage++
this.status.loadOrderStatus = 'load'
}
}
}
}
})
})
},500)
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<view class="page-content">
<cu-custom class="bg-main-oil" bgColor="bg-main-oil">
<block slot="content">佰川加油</block>
<block slot="content">中品加油</block>
</cu-custom>
<view class="margin-top-lg">
<swiper class="screen-swiper text-center square-dot" :indicator-dots="true"

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">
@@ -68,114 +69,115 @@
data() {
return {
getSiteListTimer:null,
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 +260,12 @@
this.refreshLocation()
if (!uni.getStorageSync('filterData')) {
this.getFilterData()
} else {
this.isFilterData=true
}
this.getSiteList()
},
onPullDownRefresh() {
this.filterRes(this.filterData)
setTimeout(function() {
@@ -288,39 +292,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) {
@@ -337,26 +375,26 @@
getSiteList() {
this.refreshLocation()
let data1 = {
currentPage: this.currentPage,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
clientBelong:'ZHONGPIN',
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'
})
}
}
@@ -444,16 +482,28 @@
},
onInput() {
setTimeout(() => {
// setTimeout(() => {
// this.currentPage = 1
// this.siteList = []
// this.getSiteList()
// }, 100)
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
this.currentPage = 1
this.siteList = []
this.getSiteList()
}, 100)
},500);
},
onSearch() {
this.currentPage = 1
this.siteList = []
this.getSiteList()
// this.currentPage = 1
// this.siteList = []
// this.getSiteList()
clearTimeout(this.getSiteListTimer);
this.getSiteListTimer = setTimeout(()=>{
this.currentPage = 1
this.siteList = []
this.getSiteList()
},500);
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<view class="bg-white page-content">
<view class="bg-img padding-bottom-lg flex align-center"
style="background-image: url(https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/wd-sz.png);height: 600upx;">
style="background-image: url(https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/bg-wg@ZP.png);height: 600upx;">
<view class="padding-xl margin-top bg-tm text-white top-part">
<view class="padding-xs padding-top-lg text-sm padding-top">
Hi{{(user.name?user.name:wxInfo.nickName)|nameKong}}师傅愿你开心每一天!
@@ -126,7 +126,7 @@
<view class="cu-item">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-1.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'hb@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>红包卡券</text>
@@ -134,7 +134,7 @@
<view class="cu-item">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-2.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'hd@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>活动通知</text>
@@ -142,7 +142,7 @@
<view class="cu-item">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-3.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'tj@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>推荐有礼</text>
@@ -150,7 +150,7 @@
<view class="cu-item" @tap="goToPage('/BagAuth/pages/agreeMent/OperationGuide')">
<view class=" padding-tb-0">
<view class="image-self-view">
<img :src="starUrl+'wd-ic-4.png'" lazy-load class="png" mode="widthFix"></img>
<img :src="otherImgURL+'sm@ZP.png'" lazy-load class="png" mode="widthFix"></img>
</view>
</view>
<text>操作说明</text>
@@ -194,6 +194,7 @@
},
data() {
return {
otherImgURL: this.global.otherImgURL,
imgURL: this.global.imgURL ,
starUrl: this.global.starUrl,
isCompany: uni.getStorageSync('accountStatus'),