caolc #9
@@ -119,15 +119,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
setTimeout(()=>{
|
|
||||||
|
console.log('%c 子组件参数↓','font-size:30px;color:red')
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
if(this.areaCodeList1.length == 0){
|
if(this.areaCodeList1.length == 0){
|
||||||
this.areaCodeList = uni.getStorageSync('areaCodeList')
|
this.areaCodeList = uni.getStorageSync('areaCodeList')
|
||||||
}else{
|
}else{
|
||||||
this.areaCodeList = this.areaCodeList1
|
this.areaCodeList = this.areaCodeList1
|
||||||
}
|
}
|
||||||
this.areaCodeList.unshift({areaName:'全部'})
|
this.areaCodeList.unshift({areaName:'全部'})
|
||||||
},1000)
|
this.$forceUpdate();
|
||||||
console.log('%c 子组件参数↓','font-size:30px;color:red')
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
selectedTitleObj() {
|
selectedTitleObj() {
|
||||||
|
|||||||
@@ -533,6 +533,7 @@
|
|||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
params: { //类型:Object 必有字段 备注:// 筛选对象
|
params: { //类型:Object 必有字段 备注:// 筛选对象
|
||||||
|
clientBelong:'BAICHUAN',
|
||||||
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||||
// longitude: 117.157817, // 必有字段 备注:// 当前位置经度
|
// longitude: 117.157817, // 必有字段 备注:// 当前位置经度
|
||||||
// latitude: 31.802472, // 必有字段 备注:// 当前位置维度
|
// latitude: 31.802472, // 必有字段 备注:// 当前位置维度
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.initList()
|
// this.initList()
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.initList()
|
this.initList()
|
||||||
@@ -168,6 +168,7 @@
|
|||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
initList() {
|
initList() {
|
||||||
|
console.log('initList')
|
||||||
if (this.TabCur == 0 && this.list.length == 0) {
|
if (this.TabCur == 0 && this.list.length == 0) {
|
||||||
this.getOrder('全部', this.currentPage.currentPage,'initList')
|
this.getOrder('全部', this.currentPage.currentPage,'initList')
|
||||||
} else if (this.TabCur == 1 && this.list0.length == 0) {
|
} else if (this.TabCur == 1 && this.list0.length == 0) {
|
||||||
@@ -242,6 +243,7 @@
|
|||||||
pageSize: 10, //类型:Number 必有字段 备注:无
|
pageSize: 10, //类型:Number 必有字段 备注:无
|
||||||
index: (page - 1) * 10,
|
index: (page - 1) * 10,
|
||||||
params: { //类型:Object 必有字段 备注:无
|
params: { //类型:Object 必有字段 备注:无
|
||||||
|
clientBelong:'BAICHUAN',
|
||||||
orderStatus: id == '全部' ? '' : (id +''), //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
orderStatus: id == '全部' ? '' : (id +''), //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||||
search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
|
search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
|
||||||
},
|
},
|
||||||
@@ -253,7 +255,7 @@
|
|||||||
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||||
if (id == '0') {
|
if (id == '0') {
|
||||||
// 0:待支付 list0
|
// 0:待支付 list0
|
||||||
this.list0 = this.list0.concat(res.data.list)
|
this.list0 = this.list0.concat(res.data.list);
|
||||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||||
this.status.loadOrderStatus0 = 'nomore'
|
this.status.loadOrderStatus0 = 'nomore'
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -33,12 +33,13 @@
|
|||||||
<!-- 筛选开始 -->
|
<!-- 筛选开始 -->
|
||||||
<scroll-view class="screentop bg-white" style="flex: 1;">
|
<scroll-view class="screentop bg-white" style="flex: 1;">
|
||||||
<view class="">
|
<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> -->
|
<!-- <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">
|
||||||
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0" :listHeight="listHeight"
|
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0"
|
||||||
class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
|
:listHeight="listHeight" class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
|
||||||
</site-item>
|
</site-item>
|
||||||
<view class="placeholder-hidden">
|
<view class="placeholder-hidden">
|
||||||
|
|
||||||
@@ -71,18 +72,17 @@
|
|||||||
filterData: {
|
filterData: {
|
||||||
// oilProductCode: '0#'
|
// oilProductCode: '0#'
|
||||||
},
|
},
|
||||||
contentTitle:'您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
|
isFilterData:false,
|
||||||
|
contentTitle: '您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
|
||||||
loadStatus: 'load',
|
loadStatus: 'load',
|
||||||
listHeight:160,
|
listHeight: 160,
|
||||||
areaCodeList:[],
|
areaCodeList: [],
|
||||||
siteName: '',
|
siteName: '',
|
||||||
menuList:[
|
menuList: [{
|
||||||
{
|
|
||||||
title: '距离',
|
title: '距离',
|
||||||
isMutiple: false,
|
isMutiple: false,
|
||||||
key: 'distance',
|
key: 'distance',
|
||||||
detailList: [
|
detailList: [{
|
||||||
{
|
|
||||||
title: "全部",
|
title: "全部",
|
||||||
value: ''
|
value: ''
|
||||||
},
|
},
|
||||||
@@ -131,7 +131,8 @@
|
|||||||
{
|
{
|
||||||
title: "LNG",
|
title: "LNG",
|
||||||
value: "LNG"
|
value: "LNG"
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '油品',
|
// title: '油品',
|
||||||
@@ -258,6 +259,8 @@
|
|||||||
this.refreshLocation()
|
this.refreshLocation()
|
||||||
if (!uni.getStorageSync('filterData')) {
|
if (!uni.getStorageSync('filterData')) {
|
||||||
this.getFilterData()
|
this.getFilterData()
|
||||||
|
} else {
|
||||||
|
this.isFilterData=true
|
||||||
}
|
}
|
||||||
this.getSiteList()
|
this.getSiteList()
|
||||||
},
|
},
|
||||||
@@ -288,39 +291,73 @@
|
|||||||
this.getSiteList()
|
this.getSiteList()
|
||||||
},
|
},
|
||||||
getFilterData() {
|
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 => {
|
oilSiteApi.getCheckInfo().then(res => {
|
||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
uni.setStorageSync('productCodeList', res.data.productCodeList)
|
uni.setStorageSync('productCodeList', res.data.productCodeList)
|
||||||
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
|
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
|
||||||
this.areaCodeList = uni.getStorageSync('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')
|
this.areaCodeList = uni.getStorageSync('areaCodeList')
|
||||||
}else{
|
} else {
|
||||||
this.areaCodeList = res.data.areaCodeList
|
this.areaCodeList = res.data.areaCodeList
|
||||||
}
|
}
|
||||||
// this.productCodeList = uni.getStorageSync('productCodeList')
|
// this.$forceUpdate();
|
||||||
// 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.isFilterData = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onSelected(e) {
|
onSelected(e) {
|
||||||
@@ -342,6 +379,7 @@
|
|||||||
currentPage: this.currentPage,
|
currentPage: this.currentPage,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
params: { //类型:Object 必有字段 备注:// 筛选对象
|
params: { //类型:Object 必有字段 备注:// 筛选对象
|
||||||
|
clientBelong:'BAICHUAN',
|
||||||
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||||
siteName: this.siteName,
|
siteName: this.siteName,
|
||||||
...uni.getStorageSync('location'),
|
...uni.getStorageSync('location'),
|
||||||
@@ -352,11 +390,11 @@
|
|||||||
.channelCode, // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
.channelCode, // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||||
oilProductCode: this.siteName ? '' : this.filterData
|
oilProductCode: this.siteName ? '' : this.filterData
|
||||||
.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
|
.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,
|
||||||
distance:this.filterData.distance,
|
distance: this.filterData.distance,
|
||||||
comprehensiveSort:this.filterData.comprehensiveSort?this.filterData.comprehensiveSort:1
|
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -401,13 +439,13 @@
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'请您登录',
|
title: '请您登录',
|
||||||
content:"登录小星加油才可以加油 |˛˙꒳˙)♡",
|
content: "登录小星加油才可以加油 |˛˙꒳˙)♡",
|
||||||
confirmText:'去登陆',
|
confirmText: '去登陆',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if(res.confirm){
|
if (res.confirm) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url:'../../../BagAuth/pages/login/login'
|
url: '../../../BagAuth/pages/login/login'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user