1.增加地区页面

2.修改加油列表
yj-dev
杨杰 3 years ago
parent 93098c18dd
commit f6fc4710a0
  1. 54
      components/sl-filter/filter-view.vue
  2. 11
      pages.json
  3. 117
      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 class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index">
<view v-if="item.isSort"> <view v-if="item.isSort">
<view class="filter-content-list"> <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'" <view v-for="(detailItem,idx) in selectDetailList" :key="idx"
:style="{'color': detailItem.isSelected?themeColor:'#666666'}" @tap="sortTap(idx,selectDetailList,item.key)"> :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> <text>{{detailItem.title}}</text>
</view> </view>
</view> </view>
@ -16,16 +18,20 @@
<text>{{item.detailTitle}}</text> <text>{{item.detailTitle}}</text>
</view> </view>
<view class="filter-content-detail"> <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"
@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key)"> 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}} {{detailItem.title}}
</text> </text>
</view> </view>
<view class="filter-content-footer"> <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> <text>重置</text>
</view> </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> <text>确定</text>
</view> </view>
</view> </view>
@ -95,7 +101,8 @@
let obj = {} let obj = {}
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
let item = this.menuList[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) { if (item.isMutiple) {
obj[item.key] = []; obj[item.key] = [];
@ -130,7 +137,7 @@
resetAllSelect(callback) { resetAllSelect(callback) {
let titles = []; let titles = [];
for (let i = 0; i < this.menuList.length; i++) { 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; titles[this.menuList[i].key] = this.menuList[i].title;
} }
let obj = { let obj = {
@ -150,13 +157,15 @@
if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // falsetrue if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // falsetrue
for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) { for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) {
if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) { 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) .menuList[i].key)
} }
} }
} else { } 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]
i].key) .isMutiple, this.menuList[
i].key)
} }
// //
@ -164,8 +173,9 @@
// truefalse // truefalse
for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) { for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) {
if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) { 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]
.menuList[i].key) .isMutiple, this
.menuList[i].key)
} }
} }
} }
@ -405,10 +415,12 @@
.filter-content-detail-item-active { .filter-content-detail-item-active {
background-color: #D1372C; background-color: #D1372C;
color: #FFFFFF; color: #FFFFFF;
padding: 5px 15px; padding: 5px 0px;
border-radius: 20px; border-radius: 5px;
margin-right: 8px; width: 21%;
margin-top: 10px; margin-left: 4%;
text-align: center;
margin-top: 15px;
display: inline-block; display: inline-block;
font-size: 13px; font-size: 13px;
} }
@ -416,10 +428,12 @@
.filter-content-detail-item-default { .filter-content-detail-item-default {
background-color: #FFFFFF; background-color: #FFFFFF;
color: #666666; color: #666666;
padding: 5px 15px; padding: 5px 0px;
border-radius: 5px; border-radius: 5px;
margin-right: 8px; width: 21%;
margin-top: 10px; margin-left: 4%;
text-align: center;
margin-top: 15px;
display: inline-block; display: inline-block;
font-size: 13px; font-size: 13px;
} }

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

@ -2,13 +2,27 @@
<view> <view>
<view class="width100 backcorfff"> <view class="width100 backcorfff">
<image mode="widthFix" class=" flleft sear mart15" src="../../../static/img/btjy.png"></image> <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> </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" <view class="width90 height100p backcorfff border-r mart10" v-for="(item,index) in refuelList" :key="index"
@click="goDetails(item.store_key)"> @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> </image>
<view class="recontright"> <view class="recontright">
<view class="text1 width100 font15 fontwig6 paddtop10">{{item.store_name}}</view> <view class="text1 width100 font15 fontwig6 paddtop10">{{item.store_name}}</view>
@ -21,11 +35,23 @@
</view> </view>
</view> </view>
<view class="font14 width100 fcoreb5 mart5 height22"> <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> </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> </view>
</template> </template>
@ -34,12 +60,14 @@
getGasStoreList getGasStoreList
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import slFilter from '@/components/sl-filter/sl-filter.vue'; 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'; import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
let app = getApp(); let app = getApp();
export default { export default {
components: { components: {
slFilter, slFilter,
uSearchBar uSearchBar,
wybPopup
}, },
data() { data() {
return { return {
@ -82,27 +110,22 @@
'detailTitle': '', 'detailTitle': '',
'reflexTitle': true, 'reflexTitle': true,
'defaultSelectedIndex': 0, 'defaultSelectedIndex': 0,
'detailList': [ 'detailList': [{
{ 'title': '90#',
'detatitle': '汽油', 'value': ''
'dataList': [{ }, {
'title': '90#', 'title': '92#',
'value': '' 'value': '92#'
}, { }, {
'title': '92#', 'title': '95#',
'value': '92#' 'value': '95#'
}, { }, {
'title': '95#', 'title': '98#',
'value': '95#' 'value': '98#'
}, { }, {
'title': '98#', 'title': '101#',
'value': '98#' 'value': '101#'
}, { }, ]
'title': '101#',
'value': '101#'
}]
},
]
}, },
{ {
'title': '距离', 'title': '距离',
@ -150,13 +173,34 @@
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
isNoMoreData: false, isNoMoreData: false,
searname:'' searname: ''
} }
}, },
onLoad() { onLoad() {
this.getGasStoreList(); this.getGasStoreList();
}, },
onReachBottom() {
this.getGasStoreList();
},
methods: { 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() { getGasStoreList() {
uni.showLoading({ uni.showLoading({
@ -168,7 +212,7 @@
} }
let pagenum = this.pageNum; let pagenum = this.pageNum;
let params = { let params = {
storeName : this.searname, storeName: this.searname,
distance: '999', distance: '999',
regionId: '110000', regionId: '110000',
oilNoName: '92#', oilNoName: '92#',
@ -195,7 +239,7 @@
// //
goDetails(items) { goDetails(items) {
uni.navigateTo({ uni.navigateTo({
url: '../refuel-details/refuel-details?id='+items url: '../refuel-details/refuel-details?id=' + items
}) })
}, },
result(val) { result(val) {
@ -211,6 +255,19 @@
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.stuMenu {
width: 33.3%;
height: 30px;
line-height: 30px;
font-size: 14px;
color: #333333;
.stuimg {
width: 10px;
vertical-align: middle;
}
}
.sear { .sear {
margin-left: 10px; margin-left: 10px;
width: 50px; width: 50px;

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