You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
high-mini/pages/goods/refuel/refuel.vue

227 lines
5.2 KiB

<template>
<view>
<view class="width100 backcorfff">
<image mode="widthFix" class=" flleft sear mart15" src="../../../static/img/btjy.png"></image>
<uSearchBar @confirm="search" @input="input"></uSearchBar>
</view>
<slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList"
@result="result"></slFilter>
<view class="width90 height100p backcorfff border-r mart10" v-for="(item,index) in refuelList" :key="index" @click="goDetails">
<image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r">
3 years ago
</image>
<view class="recontright">
<view class="text1 width100 font15 fontwig6 paddtop10">{{item.store_name}}</view>
<view class="width100 mart10 height22">
<view class="width70 flleft text1 font13 fcor999">
{{item.address}}
</view>
<view class="width30 flright font13 fcor666 fotct">
<image mode="widthFix" src="../../../static/img/dh.png" style="width: 10px;"></image>1.9km
</view>
</view>
<view class="font14 width100 fcoreb5 mart5 height22">
<text class="font18 fontwig6">6.40</text><text class="fcor999 margle">油站价6.88</text>
</view>
</view>
</view>
3 years ago
</view>
</template>
<script>
import {getGasStoreList} from '../../../Utils/Api.js';
import slFilter from '@/components/sl-filter/sl-filter.vue';
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
export default {
components: {
slFilter,
uSearchBar
},
data() {
return {
themeColor: '#089bf5',
titleColor: '#666666',
filterResult: '',
menuList: [{
'title': '品牌',
'key': 'single',
'isMutiple': false,
'detailTitle': '请选择(单选)',
'reflexTitle': true,
'defaultSelectedIndex': 0,
'detailList': [{
'title': '全部品牌',
'value': ''
}, {
'title': '中石化',
'value': '中石化'
}, {
'title': '中石油',
'value': '中石油'
}, {
'title': '亮牌',
'value': '亮牌'
}, {
'title': '其他',
'value': '其他'
},
]
},
{
'title': '距离',
3 years ago
'key': 'single1',
'isMutiple': false,
'detailTitle': '请选择(单选)',
'reflexTitle': true,
'defaultSelectedIndex': 0,
'detailList': [{
3 years ago
'title': '距离最近',
'value': ''
3 years ago
},
{
'title': '距离最远',
'value': '距离最远'
}
]
},
{
'title': '油号',
3 years ago
'key': 'single2',
'isMutiple': false,
'detailTitle': '请选择(单选)',
'reflexTitle': true,
'defaultSelectedIndex': 0,
'detailList': [{
'title': '不限',
'value': ''
}, {
'title': '89#',
'value': '89#'
}, {
'title': '92#',
'value': '92#'
}, {
'title': '95#',
'value': '92#'
}, {
'title': '98#',
'value': '98#'
}, ]
},
{
'title': '距离',
3 years ago
'key': 'single3',
'isMutiple': false,
'detailTitle': '请选择(单选)',
'reflexTitle': true,
'defaultSelectedIndex': 0,
'detailList': [{
'title': '默认排序',
'value': ''
},
{
'title': '发布时间',
3 years ago
'value': '发布时间'
},
{
'title': '薪资最高',
3 years ago
'value': '薪资最高'
},
{
'title': '离我最近',
3 years ago
'value': '离我最近'
}
]
}
],
refuelList: [],
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
}
},
onLoad() {
this.getGasStoreList();
},
methods: {
//查询列表
getGasStoreList() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
distance: '25',
regionId: '110000',
oilNoName: '92#',
longitude: "116.881602",
latitude: '39.912496',
pageNum: pagenum,
pageSize: this.pageSize
}
getGasStoreList(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
this.refuelList = this.refuelList.concat(res.return_data.list);
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.refuelList = [];
uni.hideLoading()
}
})
},
//跳转详情
goDetails() {
uni.navigateTo({
url: '../refuel-details/refuel-details'
})
},
result(val) {
console.log('filter_result:' + JSON.stringify(val));
this.filterResult = JSON.stringify(val, null, 2)
}
}
}
</script>
<style lang="scss">
page {
background-color: #f6f6f6;
}
.sear {
margin-left: 10px;
width: 50px;
}
.searImg {
margin-left: 55px;
}
.recontleft {
width: 80px;
margin-left: 10px;
}
.recontright {
margin-left: 95px;
}
.text {
margin-top: 50px;
margin-left: 20px;
width: 100%;
}
</style>