1.增加地区页面

2.修改加油列表
yj-dev
杨杰 3 years ago
parent 93098c18dd
commit f6fc4710a0
  1. 48
      components/sl-filter/filter-view.vue
  2. 7
      pages.json
  3. 89
      pages/goods/refuel/refuel.vue
  4. 14
      pages/tabBar/home/home.vue
  5. 64
      pages/user/positioning/positioning.vue

@ -5,8 +5,10 @@
<view class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index">
<view v-if="item.isSort">
<view class="filter-content-list">
<view v-for="(detailItem,idx) in selectDetailList" :key="idx" :class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'"
:style="{'color': detailItem.isSelected?themeColor:'#666666'}" @tap="sortTap(idx,selectDetailList,item.key)">
<view v-for="(detailItem,idx) in selectDetailList" :key="idx"
:class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'"
:style="{'color': detailItem.isSelected?themeColor:'#666666'}"
@tap="sortTap(idx,selectDetailList,item.key)">
<text>{{detailItem.title}}</text>
</view>
</view>
@ -16,16 +18,20 @@
<text>{{item.detailTitle}}</text>
</view>
<view class="filter-content-detail">
<text v-for="(detailItem,idx) in selectDetailList" :key="idx" class='filter-content-detail-item-default' :style="{'background-color':detailItem.isSelected?themeColor:'#f6f6f6','color':detailItem.isSelected?'#FFFFFF':'#999999'}"
<text v-for="(detailItem,idx) in selectDetailList" :key="idx"
class='filter-content-detail-item-default'
:style="{'background-color':detailItem.isSelected?themeColor:'#f6f6f6','color':detailItem.isSelected?'#FFFFFF':'#999999'}"
@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key)">
{{detailItem.title}}
</text>
</view>
<view class="filter-content-footer">
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" @tap="resetClick(selectDetailList,item.key)">
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;"
@tap="resetClick(selectDetailList,item.key)">
<text>重置</text>
</view>
<view class="filter-content-footer-item" :style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick">
<view class="filter-content-footer-item"
:style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick">
<text>确定</text>
</view>
</view>
@ -95,7 +101,8 @@
let obj = {}
for (let i = 0; i < this.menuList.length; i++) {
let item = this.menuList[i];
if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString().length > 0) { //
if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString()
.length > 0) { //
if (item.isMutiple) {
obj[item.key] = [];
@ -130,7 +137,7 @@
resetAllSelect(callback) {
let titles = [];
for (let i = 0; i < this.menuList.length; i++) {
this.resetSelected(this.menuList[i].detailList,this.menuList[i].key);
this.resetSelected(this.menuList[i].detailList, this.menuList[i].key);
titles[this.menuList[i].key] = this.menuList[i].title;
}
let obj = {
@ -150,12 +157,14 @@
if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // falsetrue
for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) {
if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) {
this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this.menuList[i].isMutiple, this
this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this
.menuList[i].isMutiple, this
.menuList[i].key)
}
}
} else {
this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i].isMutiple, this.menuList[
this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i]
.isMutiple, this.menuList[
i].key)
}
@ -164,7 +173,8 @@
// truefalse
for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) {
if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) {
this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i].isMutiple, this
this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i]
.isMutiple, this
.menuList[i].key)
}
}
@ -405,10 +415,12 @@
.filter-content-detail-item-active {
background-color: #D1372C;
color: #FFFFFF;
padding: 5px 15px;
border-radius: 20px;
margin-right: 8px;
margin-top: 10px;
padding: 5px 0px;
border-radius: 5px;
width: 21%;
margin-left: 4%;
text-align: center;
margin-top: 15px;
display: inline-block;
font-size: 13px;
}
@ -416,10 +428,12 @@
.filter-content-detail-item-default {
background-color: #FFFFFF;
color: #666666;
padding: 5px 15px;
padding: 5px 0px;
border-radius: 5px;
margin-right: 8px;
margin-top: 10px;
width: 21%;
margin-left: 4%;
text-align: center;
margin-top: 15px;
display: inline-block;
font-size: 13px;
}

@ -422,8 +422,15 @@
"backgroundColorBottom": "#ffffff"
}
},{
"path" : "pages/user/positioning/positioning",
"style" :
{
"navigationBarTitleText": "地区选择",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {

@ -2,13 +2,27 @@
<view>
<view class="width100 backcorfff">
<image mode="widthFix" class=" flleft sear mart15" src="../../../static/img/btjy.png"></image>
<uSearchBar @confirm="getGasStoreList" v-model="searname" @input="getGasStoreList"></uSearchBar>
<uSearchBar @confirm="search" @input="input"></uSearchBar>
</view>
<!-- <slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList"
@result="result"></slFilter> -->
<view class="width100 height40 backcorfff">
<view class="width90">
<view class="stuMenu flleft fotct" @click="showPopup(1)">50km内<image mode="widthFix" class="stuimg margle"
src="../../../static/img/xiala.png"></image>
</view>
<view class="stuMenu flleft fotct">距离优先<image mode="widthFix" class="stuimg margle"
src="../../../static/img/xiala.png"></image>
</view>
<view class="stuMenu flleft fotct">92#<image mode="widthFix" class="stuimg margle"
src="../../../static/img/xiala.png"></image>
</view>
</view>
</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(item.store_key)">
<image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r" style="max-height: 80px;">
<image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r"
style="max-height: 80px;">
</image>
<view class="recontright">
<view class="text1 width100 font15 fontwig6 paddtop10">{{item.store_name}}</view>
@ -21,11 +35,23 @@
</view>
</view>
<view class="font14 width100 fcoreb5 mart5 height22">
<text class="font18 fontwig6">{{item.price_vip}}</text><text class="fcor999 margle">油站价{{item.price_gun}}</text>
<text class="font18 fontwig6">{{item.price_vip}}</text><text
class="fcor999 margle">油站价{{item.price_gun}}</text>
</view>
</view>
</view>
<wybPopup ref="popup" type="top" height="600" width="500" radius="6" :showCloseIcon="true">
<view class="fotct font18 fontwig6 fcor333 mart10 height30">选择油枪</view>
<view class="font15 fcor666 width90 mart10 height22">汽油油枪</view>
<view v-if="typeId == 2">
<view :class="item.gunNo == gunNo?'activeRefuel':'refuel'" v-for="(item,index) in gunnumber"
:key="index" @click="changeValue2(item)">
{{item.gunNo}}
</view>
</view>
</wybPopup>
</view>
</template>
@ -34,12 +60,14 @@
getGasStoreList
} from '../../../Utils/Api.js';
import slFilter from '@/components/sl-filter/sl-filter.vue';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
let app = getApp();
export default {
components: {
slFilter,
uSearchBar
uSearchBar,
wybPopup
},
data() {
return {
@ -82,10 +110,7 @@
'detailTitle': '',
'reflexTitle': true,
'defaultSelectedIndex': 0,
'detailList': [
{
'detatitle': '汽油',
'dataList': [{
'detailList': [{
'title': '90#',
'value': ''
}, {
@ -100,9 +125,7 @@
}, {
'title': '101#',
'value': '101#'
}]
},
]
}, ]
},
{
'title': '距离',
@ -150,13 +173,34 @@
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
searname:''
searname: ''
}
},
onLoad() {
this.getGasStoreList();
},
onReachBottom() {
this.getGasStoreList();
},
methods: {
//
showPopup(item) {
this.$refs.popup.show();
this.typeId = item;
},
search(res) {
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
},
input(res) {
this.searname = res;
this.pageNum = 1;
this.isNoMoreData = false;
this.refuelList = [];
this.getGasStoreList();
},
//
getGasStoreList() {
uni.showLoading({
@ -168,7 +212,7 @@
}
let pagenum = this.pageNum;
let params = {
storeName : this.searname,
storeName: this.searname,
distance: '999',
regionId: '110000',
oilNoName: '92#',
@ -195,7 +239,7 @@
//
goDetails(items) {
uni.navigateTo({
url: '../refuel-details/refuel-details?id='+items
url: '../refuel-details/refuel-details?id=' + items
})
},
result(val) {
@ -211,6 +255,19 @@
background-color: #f6f6f6;
}
.stuMenu {
width: 33.3%;
height: 30px;
line-height: 30px;
font-size: 14px;
color: #333333;
.stuimg {
width: 10px;
vertical-align: middle;
}
}
.sear {
margin-left: 10px;
width: 50px;

@ -7,7 +7,7 @@
<view v-if="showHeader" class="header"
:style="{ position: headerPosition,top:headerTop,opacity: afterHeaderOpacity }">
<!-- 定位城市 -->
<view class="addr">
<view class="addr" @click="goPostion">
<view class="icon location"></view>
{{ city }}
</view>
@ -407,6 +407,18 @@
console.log(err);
});
},
//
toSearch() {
uni.navigateTo({
url: '../../goods/HM-search/HM-search'
})
},
//
goPostion(){
uni.navigateTo({
url:'/pages/user/positioning/positioning'
})
},
//
toScan() {
uni.scanCode({

@ -0,0 +1,64 @@
<template>
<view>
<view class="width100 backcorfff">
<uSearchBar @confirm="search" @input="input"></uSearchBar>
<view class="line1 mart10"></view>
<view class="width90 mart20 font15 fcor333">当前定位</view>
<view class="posacname actives width90 mart20">南充</view>
<view class="width90 mart20 font14 fcor333">其他地区</view>
<view class="posacname mart20 flleft font14" :class="{'actives':posId===item.name}" v-for="(item,index) in posList" @click="change(item)">
{{item.name}}</view>
</view>
</view>
</template>
<script>
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
export default {
components: {
uSearchBar
},
data() {
return {
posList: [{
name: '南充'
},
{
name: '高坪'
},
{
name: '嘉陵'
},
{
name: '南部'
}
],
posId: ''
}
},
methods: {
change(item) {
this.posId = item.name;
}
}
}
</script>
<style lang="less">
.posacname {
background-color: #f5f5f5;
color: #666666;
width: 20%;
height: 30px;
margin-left: 4%;
line-height: 30px;
text-align: center;
border-radius: 5px;
}
.actives{
color: #089bf5;
background-color: #f4faff;
border: 1px solid #089bf5;
}
</style>
Loading…
Cancel
Save